T O P I C R E V I E W |
Neko2 |
Posted - 02/06/2019 : 05:39:52 Hello, I have made a macro for TeraTerm to acquire data in real time for the GQ EMF380v2 meter connected to the computer, the macro is very simple and generates a csv file with the Computer DateTime, EMF, EF, RFTotal and RFTotalPeak values every 10 seconds. Terminate data acquisition by closing the connection with teraterm. I apologize because the variables and error messages are in Spanish.
---------------------------------------------
mtimeout=300 ValorEMF='0' UdsEMF='-' ValorEF='0' UdsEF='-' ValorRFTotal='0' UdsRFTotal='-' ValorRFTotalPico='0' UdsRFTotalPico='-' Primero=1 Cabecera='-' Linea='-' FechaHora='-'
; abre el archivo getdate FechaHora 'EMF_%Y%m%d_%H%M%S.csv'
fileopen file FechaHora 0 if file=-1 then messagebox 'Error: No puedo abrir el archivo' 'Error' endif
; entra en modo sincrono setsync 1 testlink
while result=2 getdate FechaHora '%d/%m/%Y %H:%M:%S'
send '<GETEMF>' waitln '' strsplit inputstr ' ' 4 ValorEMF=groupmatchstr3 if Primero=1 Then UdsEMF=groupmatchstr4 endif send '<GETEF>' waitln '' strsplit inputstr ' ' 4 ValorEF=groupmatchstr3 if Primero=1 Then UdsEF=groupmatchstr4 endif
send '<GETRFTOTALDENSITY>' waitln '' strsplit inputstr ' ' 4 ValorRFTotal=groupmatchstr1 if Primero=1 Then sprintf2 UdsRFTotal '%s %s'groupmatchstr2 groupmatchstr3 endif
send '<GETRFTOTALDENSITYPEAK>' waitln '' strsplit inputstr ' ' 4 ValorRFTotalPico=groupmatchstr1 if Primero=1 Then sprintf2 UdsRFTotalPico '%s %s %s'groupmatchstr2 groupmatchstr3 groupmatchstr4 endif
if Primero=1 Then sprintf2 Cabecera '%s,%s,%s,%s,%s' 'FechaHora' UdsEMF UdsEf UdsRFTotal UdsRFTotalPico filewriteln file Cabecera Primero=0 endif
sprintf2 Linea '%s,%s,%s,%s,%s' FechaHora ValorEMF ValorEf ValorRFTotal ValorRFTotalPico filewriteln file Linea send '<RESETRFPEAK>' pause 10 testlink endwhile
fileclose file ; entro en modo asincrono setsync 0
--------------------------------------------- |
2 L A T E S T R E P L I E S (Newest First) |
Neko2 |
Posted - 02/06/2019 : 06:20:06 Disclaimer: use at own risk |
Neko2 |
Posted - 02/06/2019 : 05:46:30 I'm sorry, I post in the wrong forum and I don't know how to move to the correct forum. |
|
|