09-08-2011 01:41 PM
Hi,
I'm sending commands over serial, in psuedo code this is what I want to achieve:
serial write -> wait 7 seconds -> serial write
..and that sequence will be called 15 times with different write buffer elements.
What is the best way to queue these commands while implementing a 7 second delay?
09-08-2011 02:20 PM
Do you want to be able to handle any other commands out of the queue while the 7 second delay is occurring?
You could just do the serial write, and the delay, then the serial write all as part of 1 command passed by the queue. You'd use a wait statement in a sequence structure, or even an Express time delay function so that you have the error wires to enforce the order of execution with the delay.
09-08-2011 02:21 PM - edited 09-08-2011 02:22 PM
09-08-2011 02:23 PM
No I'm not doing any other commands during the wait. What is an effective way just to impelement a basic delay/wait?
09-08-2011 02:47 PM
Use the wait function.
I would implement this as a master slave and include the "wait" as one of the commands sent to the slave.
This would put the waiting in the slave loop allowing the master to do other things.
Ben