Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I read data (RS232) from Fluke Hydra 2620A, using LV instrument drivers?

I am trying to use the LV instrument driver for the Hydra 2 to read the data over RS232. I can configure a channel, set the scan interval etc, but I cant seem to read any data.
My programme is attached.
0 Kudos
Message 1 of 4
(4,495 Views)
Do you still have a question about this?  There are a few things that you can do to try to find where the error is coming from.
 
1. Use highlighted execution.  If one of the VIs in your code is erroring out, then you should be able to see it.  To use this feature, go to the block diagram, and click on the light bulb near the upper left hand corner of the window.  Then run your VI by either pressing "CTRL-R" or clicking on the run button.  When you're done with highlighted execution, disable it by clicking on the light bulb again.
 
2.  Use Error Handling.  Currently, you are using a sequence structure to control how you go from one step to the next, and you have no error data being passed from one step to another.  Typically this is bad.  Sequence structures have their place in LabVIEW, however if all you are doing is trying to ensure that one thing or another happens before something else, all you need to do is use the error lines - that is, connect the "Error Out" Terminal from one VI to the "Error In" terminal of another VI.  This has at least three benefits. 
1. You don't need the sequency structure any more (at least in this basic case). 
2. Your code is optimized.  Typically subVIs are developed so that if an error has occurred previously, the subVI will execute much simpler code. 
3. You can find the source of errors much more easily.
3.  Use instrument drivers or use VISA (at least in the beginning).  With the instrument driver supplied, at least al the basic functionality that you might need, including resetting the device, should be included.  Use the instrument drivers to do this.
 
Finally, have you looked into taking a LabVIEW basics or a LabVIEW instrument control class?  You might consider it if you've never worked with LabVIEW before.
0 Kudos
Message 2 of 4
(4,456 Views)

Thanks for the reply. The idea of using the error output to sequence the operation of the program is a good one, but the instrument driver VI's I have dont have error outputs on them. The IVI controls do however.

I think I have two problems here, the instrument when it returns data, doesnt always return the same number of lines in the same order! Eg sometimes I get a date stamp, followed by data, then more data and the alarm settings, then other times I get  a mixture of => for OK and the data.

Then the other problem seems to be one of communicating via RS232.

0 Kudos
Message 3 of 4
(4,444 Views)

the => is the 'message understood' response left over in the buffer by your last command send. ?> means ERROR (Page 4-8 in manual)   

I used to read the data in scan mode with the NEXT? command (and 'SCAN 1'  🙂 . After each received values string I send NEXT? again.

Time by time, as you noted, you get a ?>/GRRR/  instread of the values string. My impression is, that this arrives because of a spike on the rs232 line that was misinterpreted by the fluke.

However since I check my received string for exactly this phrase before interpreting it (with spreadsheet string to array) this problem was gone.

 

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 4 of 4
(4,428 Views)