Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Scan for instruments using MAX

Hello,
i have a question about scanning for instruments using MAX.  When using IBIC it is possible to identify my selfmade GPIB-device (which contains a PIC-Controller that has a part of the GPIB protocol implemented) by using ibwrt "*IDN?" command. The device responses correctly when using the ibrd command.
So i think that MAX uses some commands ,my device  doesn't support, for scanning for instruments. Can somebody tell me what exactly the GPIB controller is doing during a scan ? Maybe it does a serial or a parallel poll ??? In this case I could implement this function to my PIC-Controller.

0 Kudos
Message 1 of 5
(3,696 Views)
The scan for instruments algorithm is pretty simple. The GPIB controller sends a listen address, unasserts ATN, waits a little while, then checks the state of the GPIB NDAC signal. If there was a device at that particular GPIB address it is now asserting NDAC (not Data Accepted) because it is address to listen and has not accepted a byte. If there is no listener present then NDAC will be unasserted. NDAC is active low meaning it is asserted when at ground and unasserted when at around 3V.

Does your device assert NDAC if it becomes addressed to listen when ATN is unasserted?
0 Kudos
Message 2 of 5
(3,686 Views)
Here is a short description of my algorithm:
My device starts with NRFD set high (because it is ready for new data), and NDAC set low ( because it didn't accept any data yet).
Then it waits for an interrupt caused by DAV going low. The interrupt routine checks ATN. If ATN is low, the actual address which was set by the controller is read. In the case that the listener address matches, NRFD is set low and NDAC is set high. At last the device starts a loop where it polls the DAV. As soon as DAV goes high my device sets NDAC low and NRFD high. Now the device waits for the next interrupt caused by DAV.

0 Kudos
Message 3 of 5
(3,682 Views)
It looks like your algorithm should work, although there are probably lots of things that can go wrong when implementing GPIB state machines in software. Have you considered using a GPIB ASIC and connecting that to your PIC?

Do you have a GPIB analyzer or an oscilloscope you can use to see what is happening on the bus? You want to check that NDAC is asserted (voltage is close to ground) after accepting its listen address when ATN is unasserted (at about 3.3V).

Here is a link that describes the scan for instruments algorithm better

http://forums.ni.com/ni/board/message?board.id=140&message.id=14201&query.id=362176#M14201
0 Kudos
Message 4 of 5
(3,673 Views)
Thanks a lot for your help.
Something is still not working, but maybe I should really use my DSO to watch the lines (a logic analyzer would be great :))
I will check the link, and hope i will find some further information.

Bye, Daniel
0 Kudos
Message 5 of 5
(3,663 Views)