11-07-2013 11:39 AM - edited 11-07-2013 11:40 AM
I configured an instrument driver measurement VI to fetch test results from a testing device. There is an constant to enter the type of test result to fetch either cres, swave, or twave.
My problem with the VI is that when I run it to fetch "cres" for example, the output string array would display the result from the previous run. I would need to run the VI again to correctly display the result of "cres". Similarly, if I include the measurement VI more than once within one VI to fetch in sequential order of "cres", "swave" and "twave" for example, even with a time delay and in a sequence structure to separate the requests, the output box for "cres" would display data from previous execution and the output box for "swave" would display the data from "cres", and "twave" output box "swave". Please see attached file for detail.
11-07-2013 01:07 PM
It seems that your system reads the previous string still available in the buffer.
Maybe read the buffer as long as bytes available indicates there is still data.
Or do a flush before the write.
I wonder what happens the very first time you run the program after starting LabVIEW
11-07-2013 04:10 PM
I would see how many bytes are in the buffer before you do any fetch. Though, just doing a flush before the first fetch would make sure there is nothing there. All it takes is 1 message to get out of sync. Is this the only VI you are using? Your problem might be in one of your other VIs if not.