06-04-2007 07:46 PM
06-04-2007 08:47 PM
06-05-2007 06:39 AM
The data source is a VISA serial read that generates 1 character string at 5 Hz, also the while loop excution rate. When a specific character is received a corresponding statement is written to a file. The 2000ms does need to be precise, I just need to avoid multiple writes to a file for a specified period, +/- 10%. Once a certain character is detected, I am not interested in what comes to the port for the next couple of seconds and I do not want it to stay in the VISA buffer either. In other words, I want the data read and discarded during the 2000ms period.
Thanks
06-05-2007 06:41 PM
Hello isaoz,
This is Dominic L. from Applications Engineering at National Instruments. If you would like to flush the buffer for two seconds after reading a value you can try the following method in the attachment.
This VI basically pulls data off the port for two seconds, with the elapsed time function, and essentially discards these values.
I hope this helps.
Thanks so much and have a great day!
06-05-2007 08:05 PM
Note: The 5 msec timeout value can be tweaked as needed to give the response that you need - as a point of reference 5 msec is about the approximately the time required to receive almost 5 characters at 9600 bps.
06-15-2007 04:02 AM
06-15-2007 04:07 AM