I am trying to communicate with a very old instrument (CCD camera) by Python. The GPIB programming manual from the instrument manufacturer published in 1999 only provides a basic command listing. It also describes some standard procedures for GPIB communication.
I have coded some Python programs (with PyVisa) successfully before to control and acquire data from instruments connected with computers via ethernet or USB. However, GPIB is new to me and it seems quite different from them in terms of ATN, SRQ, a talker, or a listener.
I found GPIBInterface and GPIBInstrument classes from the PyVisa API documentation but couldn't find any information on talker or listener setting.
Here are my questions,
a. Is my presumption below for data acquisition process correct?
- Set the controller (PC) as a talker and the instrument as a listener.
- The controller asserts ATN.
- The controller commands data acquisition to the instrument.
- Wait for SRQ from the instrument.
- Set the instrument as a talker and the controller as a listener.
- The controller deasserts ATN.
- The instruments sends data message to the controller.
- Single acquisition done.
b. What is differences between a control message from the controller and direct 'write' function in a GPIBInstrument class?
Below code still works though it omits setting ATN, a talker, or a listener. Why's that?
import pyvisa
RM = pyvisa.ResourceMananger()
INSTRUMENT = RM.open_resource('instrument address')
print(INSTRUMENT.query('*IDN?'))
c. Is their any example or tutorial for GPIB programming via PyVisa?
I can't find appropriate one..
Any comments will be helpful. Thanks in advance.