Datalogging script question

Hello All,

I would like to log data continuously at a 1 second interval when a trigger tag goes high. I researched the ONCHANGE command and it appears to work for any change to the tag. How can I set this to be a “1” and to log data every second while the tag is high?

Sample code thus far:

INIT Section
ONCHANGE “Pumps_Running_DC_Trigger”, “GOTO LogData”

LogData:
LOGGROUPIO “A”

Thanks!
Rich

Hello Richard,

You can can use an IF statement in the Log Data section with a TSET/ONTIMER function to log the data.

INIT Section
ONCHANGE “Pumps_Running_DC_Trigger”, “GOTO LogData”

LogData:
IF @Pumps_Running_DC_Trigger = 1
TSET 1,1
ONTIMER 1, “LOGGROUPIO “A””

Please be advised that this is a rough draft of the code, but so some changes may or may not be needed.

Thank you for the help, I will give it a shot and modify accordingly!

Rich