07-20-2009 05:45 PM
When trying to write three characters to the serial port, I found that the serial port needs to be cleared between each character writing. But, the VI serial clear takes noticeably more time than without serial clear. Is there a more effiecient VISA command than serial clear VI?
I would like to run this in a 15 milisecond loop on a PC using LabVIEW 8.5.1.
07-20-2009 10:02 PM
Why do you think you need to clear the buffer between writes? I've cleared the buffer at the beginning but in all my years of using serial, never had a reason to clear between. You code seems unnecessarily complicated if all you have to do is write 3 bytes. Why do you start with a DBL array. Why don't you just have a U8 array to start and with a Byte Array to string, use a single VISA Write?
Why don't you post an actual VI. It's impossible to debug a picture.
07-20-2009 10:45 PM
I thought I needed to clear the buffer between writes because when I didn't have them in there, the VI would only write the first byte, and with the clear buffer it at least writes all three bytes, although it is slower. I have a different version of the code that you suggested, but it only writes the first byte as well, so I wanted to use the code that worked the most.
The VI in the picture (1st), as well as the simplified code (2nd) is attached.
07-20-2009 10:55 PM
Still way too complicated. If you want to write each and every byte in the array, you just need to do what is shown below.