02-28-2019 03:06 PM
I have a LabVIEW code which needs to be timer control in terms of code running. The code should work as follows?
1. Need a timer that resets every 60 seconds.
2. From 0-30 seconds, the code should write the value 0(zero) to Modbus register 9 of slave device address 5
3. from 31 - 60 seconds, the code will write the value 256 to same Modbus register 9 of slave device address 5.
4. The timer will reset to zero and this loop continues for every 60 seconds.
Does anyone in the forum got an idea or a typical LabVIEW code that can perform the above function?
02-28-2019 03:19 PM
Put what you want in the case structure.
mcduff
02-28-2019 03:27 PM
Can you please send me the VI?
02-28-2019 03:32 PM
It is a snippet, if your have LabVIEW 2018 you should be able to download it and drag it to the block diagram and it will run. Note the code it meant to be in a loop.
What version do you have?
mcduff
02-28-2019 03:34 PM
I have 2017 version
02-28-2019 03:40 PM
Loop Example in LabVIEW 2017 attached. You may have to play with the rounding to get it just the way you want it.
mcduff
02-28-2019 03:47 PM
Thanks. will try it out.
02-28-2019 04:57 PM
I would just use the Elapsed Time VI in the Timing palette. It can everything but the case structure for you.
02-28-2019 05:00 PM
@crossrulz wrote:
I would just use the Elapsed Time VI in the Timing palette. It can everything but the case structure for you.
Never used it before, good catch.
mcduff