Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Can anyone tell me how FINDlSTN actually works, i.e. in terms of NDAC lines

Hi

I am having trouble with a peice of kit that works fine on other GPIB cards but not with an NI card. I think the problem is that it doesn't respond properly to the FINDLSTN command that the NI software is sending when it "scans for devices". I have read in the documentation that the NI Card sends out all the listen address and then monitors the NDAC line to see if a listener is present. Can any tell me how it monitors the line ? is it looking for a high , a low , a pulse , is there a certain time delay require etc.


thanks
James

0 Kudos
Message 1 of 3
(3,910 Views)
The FINDLSTN protocol is actually defined by the IEEE 488.2 standard. National Instruments' NI-488.2 driver follows the protocol as written. I don't think I can copy the entire algorithm since it is copyrighted by IEEE, but here is the first part. It shows you enough of the timing characteristics and the line states that I think you can figure out the rest.

BEGIN Find Listeners
    WHILE a primary address remains unsent in the address input list
        BEGIN
            Send the IEEE 488.1 Unlisten message (UNL)
            Send the LAG of the primary address
            Set ATN FALSE
            Wait 1.5 ms minimum
        IF NDAC is TRUE
            THEN
                Place primary address in output address list  <=== Listener Found
            ELSE
                <Here is where they do the search for PAD/SAD devices>
        END
    Send the IEEE 488.1 Unlisten message (UNL)
END Find Listeners
Message 2 of 3
(3,906 Views)

Hello all.

 

I have the same trouble with the FINDLSTN protocol. I tried to realize the talker/listener functions by AVR Atmega Controller + SN7516x Driver Chips. Everythings works fine, i can communicate with my Atmega but FINDLSTN finds a device on each address and only the right address is able to response to the "*IDN?" read.

 

here is my piece of code:

 

 

unsigned char
ieee488_check_addressed_state (void) {

unsigned char byte_in;

while (!(GPIB_Ctrl_Read & (1 << ATN))) {
// negate not ready for data
NRFD_NEGATE;
// while data is not valid
while (GPIB_Ctrl_Read & (1 << DAV));
// read data byte
byte_in = ~GPIB_Data_Read;
// accept byte
NDAC_NEGATE;
// while data valid is asserted
while (!GPIB_Ctrl_Read & (1 << DAV));

if (byte_in == (0x20 | GPIB_Address)) {
gpib.addressed = 1;
gpib.listen = 1;

ieee488_listener_init ();
return 1;
}
else
if (byte_in == (0x40 | GPIB_Address)) {
gpib.addressed = 1;
gpib.talk = 1;

ieee488_talker_init ();
return 1;
}
// clear data accepted state
NDAC_ASSERT;
}
return 0;
}

 Now i found this forum post but the presented solution causes that no devices can be found on the bus. 

 

unsigned char ieee488_check_addressed_state (void) { unsigned char byte_in; while (!(GPIB_Ctrl_Read & (1 << ATN))) { // negate not ready for data NRFD_NEGATE; // while data is not valid while (GPIB_Ctrl_Read & (1 << DAV)); // read data byte byte_in = ~GPIB_Data_Read; //printf("\r\n Byte: %c, %#X ", byte_in, byte_in); // accept byte //NDAC_NEGATE; if (byte_in == (0x20 | GPIB_Address)) { gpib.addressed = 1; gpib.listen = 1; // wait for ATN FALSE while ((GPIB_Ctrl_Read & (1 << ATN))); // accept byte NDAC_NEGATE; ieee488_listener_init (); return 1; } else if (byte_in == (0x40 | GPIB_Address)) { gpib.addressed = 1; gpib.talk = 1; // accept byte NDAC_NEGATE; ieee488_talker_init (); return 1; } else if (byte_in == 0x3F || byte_in == 0x5F) { gpib.addressed = 0; gpib.listen = 0; gpib.talk = 0; // accept byte NDAC_NEGATE; ieee488_listener_init (); return 1; } // assert NDAC NDAC_ASSERT; // assert NRFD NRFD_ASSERT; } return 0; }

 Anyideas?

 

 

 

0 Kudos
Message 3 of 3
(3,492 Views)