Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

gpib freezes after first message

I am trying to connect to an optical instrument (i.e. a monochromator) to select a particular wavelength. I wrote a quick program to test sending commands and read the response from the instrument (typical things that would be used for testing are '?ID' or 'SERIAL') to return the GPIB address or serial number. After sending the write command, I poll every 100 ms to see if the operation is completed or poll output is 145. I noticed that the poll is 145 only at the first interation from power starting the instrument. All other commands will make the poll 147 and it seems thae command is not send to the instrument.

 

VI is attached.

0 Kudos
Message 1 of 5
(3,238 Views)

Unless there is something particularly time-consuming about your query - reading back the serial number or GPIB address are not such operations - there isn't any reason to poll.

 

 

0 Kudos
Message 2 of 5
(3,226 Views)

Serial and ID commands are meant as an example, I use this vi as testing to see how things work. In the actual experiment I'll set the wavelength (e.g. '500 NM') wait for the motors to stop measure the power, then step an repeat. Polling is useful in this case because it tells when a certain operation is stopped so I do other parts of the measurement.

 

Based on this link:

http://zone.ni.com/reference/en-XX/help/371361E-01/lvinstio/gpib_serial_poll/

 

it sounds like for gpib serial poll being 145 means

'lockout state' and 'attention asserted' and 'device clear state'

 

For the value 147, it should have one more bit on: 'device trigger state'

 

Does it mean it is waiting for a trigger of some sort?

 

 

0 Kudos
Message 3 of 5
(3,221 Views)

MihaiB,

 

If you're just trying to test GPIB communication to your device, I would recommend starting from a shipping example (Help » Find Examples).  LabVIEW - GPIB.vi does a simple write and read.  You could amend the example to your specific application.  With NI-VISA and NI-488.2 installed, you could use the GPIB-VISA.vi example as well.  Try using these and see how it works out.

Regards,

Jared R.
Precision DC Product Support Engineer
National Instruments
0 Kudos
Message 4 of 5
(3,205 Views)

I really would advise you to use visa instead of gpib calls.

greetings from the Netherlands
0 Kudos
Message 5 of 5
(3,198 Views)