LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading from a GPIB device

Solved!
Go to solution

The only reason why the Read would work is if the instrument is continuously sending data. Is it? Some older instruments did this. If so, then you need to perform the read operation a different way. You need to append what you read to a shift register until you've gotten all the characters for a number. So, if the instrument sends the measurements using, say, 12 bytes, you'd need to read at least that much (you will also have some termination character). However, the very first read may be in the middle of the number. I.e., if the value if 12.3456789, the first read may start at the "5" character.

 

What does the manual say?

Message 11 of 16
(1,379 Views)

I'd also like to know where in the manual it says that command string is supposed to tell the instrument to take a measurement and place it in it's buffer. Very unusual if it did all by itself. The standard for GPIB is to do nothing until it is specifically commanded to do so and that means sending the exact command for taking a measurement - not just configuring it.

 

There are basic GPIB tutorials on the web.

Message 12 of 16
(1,376 Views)

Those are 2 good suggestions (though dennis didn't suggest this, merely hinted at it).

I may have a wrong  read function.  I was looking at the driver for the HP 3456A and that is how they set up their read function, and I just assumed that they would work similarly.  I am not exactly sure how it reads data, I'll have to do some reading and get back to you.

 

Or I may have misinterpretted the GPIB read function.  The instrument takes measurements on its own (i believe it doesn't need a command string for this) but it may need a command to put the data in the buffer, which would then be read by the GPIB read function, which I don't currently have.

0 Kudos
Message 13 of 16
(1,371 Views)

If you have the National Instruments Measurement and Automation Explorer (MAX) installed, which is likely, you can experiment with your command strings that you send and the results you get back, before writing any LabVIEW. It sometimes helps, you are solving an equation with fewer variables that way.

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 14 of 16
(1,351 Views)

Ok so I did a little fooling around with the VI.  The problem (I think) has to do with the way the data is formatted by the Keithley.

 

k181GR.JPG

 

The "data" indicator is the raw, unformatted string as it is returned by the keithley.

N means no error, DCV means volts DC, and then the reading in exponential format.

 

The fract/exp string to number converter is unable to convert it correctly, because although I get a correct reading from the raw data, the converted number stays at 0 (as does the data written by the write to measurement file function).

 

My guess is that I need a way to drop the first 4 digits of the raw data string, but I am not sure how to do it.

 

0 Kudos
Message 15 of 16
(1,337 Views)
Solution
Accepted by topic author LarsUlrich

Pass the string into the "Match pattern" function found on the "string" palette. It has an input to define what to match, produces three strings; before the match, the match and after the match. The later would be the number if you match on the NVDC or whatever. You can also use that for error checking, if the match isn't found the instrument probably sent an error message.

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



Message 16 of 16
(1,321 Views)