Send variable value component result to channel?


Recommended Posts

Hello,

I've created a variable value component that counts elapsed time from when my start button is pressed. It uses two global variables nested inside one of my auto-start sequences:

global timecounter = 0

global totaltime = 0

The code for the variable value component is :

formatdatetime("%H:%M:%S", (systime()-timecounter) * (timecounter != 0) + totaltime)

How can I capture this value in a channel so that I can read it in an export set that gathers info when I stop the machine (press the stop button)?

Mike

Link to comment
Share on other sites

If you are using an export set you can just put that expression directly into the export set. If you want it in a channel, then you'll either need to create a sequence with a little loop that sets the channel value to this expression every second or whatever interval you want, or you can do it in the Event of another channel that is already being read at constant interval.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.