Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Issue running user created instrument driver VI

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.

 

0 Kudos
Message 1 of 3
(4,016 Views)

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

greetings from the Netherlands
0 Kudos
Message 2 of 3
(4,001 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 3
(3,990 Views)