GQ Electronics Technical Support Forum


GQ Electronics Technical Support Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 GQ Electronics Forums
 3. GQ EMF EF Meter RF Spectrum Power Analyzer
 GQ EMF380v2 realtime datalogging TeraTerm macro
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Neko2

Spain
9 Posts

Posted - 02/06/2019 :  05:50:30  Show Profile  Reply with Quote
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

---------------------------------------------
Reply #1

Neko2

Spain
9 Posts

Posted - 02/06/2019 :  06:18:36  Show Profile  Reply with Quote
Disclaimer: use at own risk
Go to Top of Page
Reply #2

ZLM

1229 Posts

Posted - 02/06/2019 :  06:37:09  Show Profile  Reply with Quote
Good job. Thank you for sharing.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
GQ Electronics Technical Support Forum © Copyright since 2011 Go To Top Of Page
Generated in 0.08 sec. Snitz Forums 2000