LabVIEW

cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

PM3000a: Serial Read and Write out of sync

Solved!
Go to solution

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 ๐Ÿ™‚

Download All
0 Kudos
Message 1 of 3
(2,699 Views)
Solution
Accepted by topic author meepaula

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.

 

Greetings from Germany
Henrik

LV since v3.1

โ€œgroundโ€ is a convenient fantasy

'ห™ห™ห™ห™uฤฑษฦƒษ lษฤฑp puษ ยฐ06 วuoษฅd ษนnoสŽ uษนnส‡ วsษวld 'สŽษนษuฤฑฦƒษษฏฤฑ sฤฑ pวlษฤฑp วสŒษษฅ noสŽ ษนวqษฏnu วษฅส‡'


0 Kudos
Message 2 of 3
(2,689 Views)

Hi, sorry about not posting the sub vi...I will know for again. Smiley Happy

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.

0 Kudos
Message 3 of 3
(2,670 Views)