LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How can you insert delays between characters transmitted on COM1 to a routine generated with I/O Assistant?

The Sun TC01 temperature chamber I'm working with uses a 9600 Baud serial interface for control.  The example Basic code I've seen for the interface inserts delays
between each byte sent to the temperature chamber.  I tried using the I/O Assistant (without the delays) and cannot get commands that consist of more than one
character to work.  I'm concluding that a delay of 100 milliseconds or so is actually required between the characters.  So how can I customize the I/O Assistant
generated code to fix this problem?
0 Kudos
Message 1 of 4
(3,259 Views)
Sandia,

If you right click on the command you create in the I/O Assistant (Write, Read and Parse, etc) you can choose an option called Set Run Delay... This will allow you to set a delay after the write executes. You'd then just write one byte at a time with this delay.

Brandon Vasquez | Software Engineer | Integration Services | National Instruments
0 Kudos
Message 2 of 4
(3,239 Views)

Thanks for the suggestions.  However, it seems like that command adds a delay *after* all the bytes are sent:

 // Format the number to be sent to the instrument
 ViErrChk(viPrintf(resourceName, "%-4.1fC\n", Centigrade));

 // Delay before executing the next step
 Delay(0.1);

Is there anything that could send the characters one at a time with 100ms delays between each character?

0 Kudos
Message 3 of 4
(3,234 Views)
If you want to send each byte with this delay, you would want to do something along the lines of putting the writes in a loop with this Delay function inside the loop and write one byte at a time. With this, you would no longer be using the I/O Assistant by itself, as you would need to change the text code that it is creating for you to function differently.

Brandon Vasquez | Software Engineer | Integration Services | National Instruments
0 Kudos
Message 4 of 4
(3,228 Views)