04-30-2012 11:25 PM
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.
05-01-2012 08:40 AM
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.
05-01-2012 09:45 AM
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?
05-01-2012 05:42 PM
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.
05-02-2012 05:54 AM