02-16-2012 04:35 AM - edited 02-16-2012 04:37 AM
Hi,
I'm trying to read values from the PM3000a over serial. I'm using LabView 2009 32 bit and VISA 5.2.
I've used the LabView driver and programs downloaded from here and have reworked them to get my current VI.
Basically in my program, I'm looping through some serial commands from a string array and writing them one at a time to the PM3000a over serial and then reading and storing the results from the query in a numeric array.
For some reason, sometimes the values get mixed up. I've attached my VI and a screenshot.
The results I'm expecting are:
(Power query) :FND:CH1:WAT?; =~300
(Voltage query) :FND:CH1:VLT?; =~230
But the actual results I'm getting are:
(Power query) :FND:CH1:WAT?; =~230
(Voltage query) :FND:CH1:VLT?; =~300
Thanks in advance 🙂
Solved! Go to Solution.
02-16-2012 06:19 AM
At somne point you miss to read the data, so it will stay in the buffer and will be read instead of the most recent data.
Add a 'VISA flush I/O buffer' before sending a request should help.
And try find out why there is some data left in the buffer 😉 Sometimes data can be send out due to user interaction on the intrument panel (Print button etc))
Usually the answer of an instrument includes the unit , so by using 'Scan from string' you can add a check.
When posting vis you should include the subvi's 😉
To get help with additional string tests you should also store some strings in a string indicator , make all values default , save the vi and post that.
02-22-2012 08:06 AM
Hi, sorry about not posting the sub vi...I will know for again.
I think flushing the buffer seems to do the trick for the minute. I have to flush both the read and write buffer.
Thanks for your help.