From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Wait six hours before sending next command

I'm using labview for some basic automation of a relay board and I haven't been able to find a function to use to make it wait a specified amount of time before sending the next write command, ie Serial Write, wait 6 hours, write again.  Can someone tell me what function I would need to use to get this done?

Thank you,

Pavel

0 Kudos
Message 1 of 4
(2,263 Views)

hi

it depends a bit on the architecture.. 

i am using this kind of wait (about one hour) in a state machine, with a timeout of 100 mse and waiting as much cycle as necessary. 

for some cases you can use the wait express function for 6*1800 sec but I would not recommend because the program will not answer for 6 hours...

with the state machine you can change this timeout if you need

N

0 Kudos
Message 2 of 4
(2,260 Views)
I would generally use a state machine because you will want your user to be able to abort in the middle of the delay. You can use use the time of day (in seconds) and check this at some periodic basis. You dont' want to poll so quickly that you consume all of the CPU cycles and you don't want to delay too long so you can still respond quickly to user requests such as aborting the application.


Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 3 of 4
(2,250 Views)

Go to the timing palette.

 

I agree about using the Wait (ms) or Delay function. Using the Tick Count or Elapsed Time function would work as well as any of the Get Date Time functions.

0 Kudos
Message 4 of 4
(2,248 Views)