Hi Guys ,
Am a newbie in GPIB Programming with no experience. I am currently working on a project which require to Listen to data communication between Controller and Device via GPIB Bus.
The controller being NI GPIB-USB Controller connected to instrument which is to be controlled. My idea was to attach another GPIB-USB Adaptor (Currently am using Prologix GPIB-USB Controller) in LISTEN ONLY mode to see the data communication between the Controller and instrument.
I am able to collect all the commands sent from Controller to Instrument and reply from instrument, But unable to see any SRQ Code. Only those are missing. , Can anyone guide me on what am i doing wrong. Am using python's PySerial Module to achieve this. I have attached a sample code as below ,
CODE:
import os.path
import serial
import sys
from time import sleep
comport = '/dev/ttyUSB0'
# addr = '5'
ser = serial.Serial()
try:
ser = serial.Serial( comport, 9600, timeout=0.5 )
# Switch to DEVICE mode
cmd = '++mode 0'
print('Sending:', cmd)
cmd = cmd + '\n'
ser.write(cmd.encode('UTF-8'))
# Set instrument to LISTEN ONLY mode
cmd = '++lon 1'
print('Sending:', cmd)
cmd = cmd + '\n'
ser.write(cmd.encode('UTF-8'))
# Read the Data from GPIB BUS
while(True):
s = ser.read();
if len(s) > 0:
print(s)
When the Controller Issue a Command "T" to the instrument , It reponse back with an SRQ 49 , But in the Data Log collected , I only see the Next Command issue after T and cannot read the SRQ service number. But when i check the devide log , i can see that the Device replied with SRQ 49 After receiving command "T" from Controller.
Can anyone suggest what am i missing in here ? Am using the Prologix GPIB USB Controller in Device Mode and in LISTEN ONLY setting.