Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Can anyone help me with Labview/GPIB timing problems?

I am trying to use a very simple VI (downloaded from the NI site) to control a Newport 1830C optical power meter.

I have been spending most of my time trying to use the VI issue a command to read the current displayed power. When I run the VI normally, I get no response from the meter, and the VI simply terminates without any error message. (The "remote" indicator does light on the meter, though, so it seems to be receieving the command.)

However, when I run the VI in the "highlight exectution" mode, everything seems to work just fine, and I receive a correct reading from the meter! Needles to say, this makes it really hard to debug the problem.

My guess is that I have some kind of timing problem, and t
he "highlight execution" feature fixes it by introducing delays. Is this correct? If so, how can I achieve the same thing by putting in delays by hand?

thanks, Whitney White
0 Kudos
Message 1 of 3
(3,636 Views)
Whitney,

I agree that this is very likely to be a timing issue. VIs run much slower in highlight execution mode, therefore your instrument may need more time to prepare the data you have requested. Try wiring a delay inline prior to the GPIB reads and/or writes, or try using Service Requests (SRQs) to give the instrument enough time to generate the data it needs to send back to the computer.

Another possibility is that your instrument may not be IEEE 488 compliant. Some older instruments indicate that they are ready to receive data before they really are. Try changing the GPIB bus timing to the slowest setting (in the GPIB Configuration Utility). This only affects the time that the GPIB controller waits before valid data is on the bus and the DAV line i
s asserted (a step in the GPIB handshaking that occurs each time a byte of information is sent to the device) so this may not be effective.

Lastly, you may wish to try the instrument driver for your instrument. There is a contributed driver at this location: LabVIEW Traditional Instrument Driver: Newport Optical Power Meter 1830C. A 'contributed driver' means that someone outside of National Instruments wrote the driver and then submitted it for posting. This driver also contains a good example of adding a time out.

Regards,
Heather S.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 3
(3,636 Views)
Heather, thank you so much!

I appreciate your answer. Amazingly, the problem turned out to be an actual hardware problem with the GPIB port on the meter. It failed several basic diagnostic tests. Also, when a replaced it with another instrument, everything worked well. There's afirst for everything, I guess.

Whitney
0 Kudos
Message 3 of 3
(3,636 Views)