Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How to communicate with 2 GPIB devices on same bus

Can 2 independent applications communicate with 2 GPIB devices connected on the same bus to one controller? In my setup the application A communicates only with GPIB device A, app. B communicates only with dev. B. More specific question regarding the GPIB controller driver software is: Will the controller pass the SRQ from GPIB dev. A only to ibwait() call made from the app. A (automatic serial polling off)?

Thx for any help

Sven
0 Kudos
Message 1 of 5
(3,855 Views)

If you are using the VISA-API, this should be possible. See the KB:

http://digital.ni.com/public.nsf/allkb/C42CDC77C00E0B8086256E9B0078F887?OpenDocument

 

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

It is also possible using the NI-488.2 API.  You will just have to open device level handles (ibdev) instead of board level handles (ibfind).  Using ibwait with the device level handles, will allow you to get the status information for each of those connections.

I hope this helps,

Steven T.

0 Kudos
Message 3 of 5
(3,796 Views)
@ Andre_Saller: I'm using the NI-488.2 API on a Solaris 8


@steven T wrote:

It is also possible using the NI-488.2 API.  You will just have to open device level handles (ibdev) instead of board level handles (ibfind).  Using ibwait with the device level handles, will allow you to get the status information for each of those connections.




Yes, my flow goes like this:

 bd_id = ibfind(boardName);
 ibconfig(bd_id, IbcAUTOPOLL, 0) & ERR ) // Auto polling disable

 // assert interface clear; GPIB board set to CIC (controller in charge)
 ibsic (bd_id);

 dev_id = ibdev(bd_id, dev_addr, 0, T300ms, 1, 0);

 status = ibwrt( m_dev_id, message, strlen(message));

 ibwait(m_dev_id,TIMO | RQS) // wait for service request, or timeout

 ibrsp(m_dev_id, &rsp_byt)

So if I understand you correct the ibwait( deviceA ) will only wait for events from device A.
Similar for ibrsp( deviceA ) it will only read responses from device A. Any stuff from device B will be kept by the NI-488.2 driver for application B in my example.

My current problem is that I get the following error "ESRQ  SRQ line 'stuck' on" in most operations if 2 GPIB devices are connected to the BUS. But so far I'm running just one application which talks to only one and the same GPIB device. All operation work fine if I disconnect the second GPIB device.

Thx  for your help

Sven

0 Kudos
Message 4 of 5
(3,784 Views)
Sven,
 
The SRQ happens when the SRQ line is asserted by one of the instruments.  The ESRQ error happens when an application is waiting for a service request, but one is already asserted for an instrument it does not have a handle for.  This is a problem because the application has no way of serial polling the device and stopping the SRQ that is already happening.  Your application should be modified to give up the processor so that the other application would have time to serial poll the instrument.  Then it can proceed with calling ibwait.
 
You can get all of this information from the NI-488.2 help topic ESRQ.
 
Steven T.
0 Kudos
Message 5 of 5
(3,753 Views)