Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

TNT4882 - finding it from MAX

I am trying to achieve a Listner/Talker GPIB interface using the TNT4882 with a TI DSP on the generic interface side and the computer with its GPIB controller on the GPIB side. MAX won't find my TNT4882 when I scan for instruments. I have not tried to receive or send data yet because I can't seem to even get beyond the point of openning an instrument session with VISA. I am assuming that after initialization of the chip by the DSP, the TNT4882 should be detecteble by MAX with out me having to do anything. Is this a correct assumption?
I've attached a file which includes the initializaiton routine. The TNT4882 is mapped to the DSP address space which will explain the direct access to the registers. I am able to write and read into the registers with no problem.
0 Kudos
Message 1 of 65
(4,913 Views)
Scan for Instruments causes the GPIB controller to send and addressing command (forgot if it is MLA or MTA) to every possible address and then check the state of the GPIB signals to determine if any GPIB device responded to an address. If a device does respond, the controller then sends the *IDN? command to that address. If the device doesn't respond to *IDN? then MAX just lists the address of the device in MAX.

In order for the TNT4882 to be detected, it must be able to decode its own GPIB adress and that GPIB address must be different that the controller's GPIB address. I could not determine from your driver what GPIB address you are assigning to the TNT4882. The controller's GPIB address is probably 0 so the TNT4882's must be something other than 0.

Also, you can use ibic to troubleshoot your device by sending individual GPIB commands. For example, you can send MLA to the TNT4882, become a standby controller, and then look at the state of NRFD. Since the TNT4882 is not configured to receive data NRFD should be asserted if the TNT4882 correctly decoded its address.
0 Kudos
Message 2 of 65
(4,858 Views)
My primary address is 3. From what you are saying I understand that once I init the chip and load it with its primary address, then the TNT4882 will decode its address by itself once addressed by the controller. Is this true? I can't open a session with viOpen, nor can I detect the device from MAX. I don't quite understan what this MLA is that you suggest I do. does the initialization routine look fine? I've checked the GPIB pins between the TNT4882 and the GPIB connector several times to make sure they are properly routed. what else can I do or check to get going here?

thanks
0 Kudos
Message 3 of 65
(4,848 Views)
Yes, when the GPIB address is set and pon is clear the TNT4882 will correctly decode GPIB addressing commands sent by a controller.

MLA is an acronym for My Listen Address, it means that the controller is adressing a device at a particular address to talk.

The initialization routine looks fine to me.

I think the best approach to troubleshooting will be to use ibic on the GPIB controller side. You can open ibic through MAX by selecting Tools -> NI-488.2 -> Interactive Control. To open a session with the GPIB controller type "ibfind gpib0". This assumes your GPIB controller connected to the TNT is GPIB0. Next type "ibsic". This causes the GPIB controller to become CIC and assert attention. I see that your driver has a function called Read_GPIB_Lines that is called continuously. The controller asserting attention should be detected by the TNT and the value returned by this function should change, indicating attention is asserted. A few other bits should also change. If this value doesn't change it means that the TNT did not detect attention or there is a problem reading/writing registers between the TNT and the host processor. If the TNT did detect attention asserted, type "ibcmd "\x23". 0x23 is the MLA3 message. Sending this to the TNT should cause the TNT to become an active listener. If ibcmd returns with an error it most likely means the controller did not detect any other devices on the bus. If ibcmd is successful, read the ADSR in the TNT. The LA and LPAS bits should be set. If these bits are not set, and ibcmd did not return an error, it is very likely that there is a problem reading registers in the TNT.

Please perform these steps and let me know if any errors occur.
0 Kudos
Message 4 of 65
(4,844 Views)
OK, thank you. I did what you said and here are the results:

when I send the ibsic command, the Read_GPIB_Lines() does detect the ATN. when I scan for instruments from MAX it also detects the scan.
after Read_GPIB_Lines() detects the ATN, I then sent the command: ibcmd "\x23" , which returs the following error:
[8130] < err cmpl cic atn >
error: ENOL
count: 0

I also noticed that after I send the ibsic the Read_GPIB_Lines() keeps detecting an asserted line, I think it's not the ATN but the DIO8. only after I ibonl 0 does the Read_GPIB_Lines() stops detecting and goes into its loop. after I re enter again and do the ibsic
then again I detect the ATN. I also noticed that if I only poll the ATN, then I will detect it only after the first time I send the ibsic. the following times that I send it it doesn't detect it, like if the controller stops asserting the ATN. only after I ibonl 0 and start all over, then it detects the ATN again. just thought I'd mention this behavior in case you don't think its normal.

thanks,
0 Kudos
Message 5 of 65
(4,829 Views)
If I understand correctly, you're trying to get two things to happen.
1. Get MAX to show your TNT4882
2. Be able to open a VISA Session to your TNT4882

Doing a scan for instruments will NOT allow you to see your TNT4882 in MAX. If your PCI-GPIB board is built with the TNT4882 controller chip (newer PCI-GPIBs are built with TNT5002/5004 chips), the TNT4882 actually does the a scan for instruments - it will not be listed as an instrument as it is functioning as the controller. To be able to program the TNT4882 you need to make a change to the VISA Options of your system to show all PXI/PCI Devices. In MAX, click on Tools » NI-VISA » VISA Options.... Under "General Settings" » PXI/PCI Devices, click in the box to "Show all PXI/PCI Devices accessible to VISA". Restart MAX, and now if you expand devices and interfaces, you should see a listing PXI System Listing. If you expand that, you should be able to find your TNT4882 listed listed as something like "PXI1::7::INSTR", and from that point you can set a VISA alias, and start programming using either the VISA alias or the instrument descriptor.

When you've completed the above recommendation, you should be able to program your TNT4882 via VISA, and find it in MAX.

Logan S.
0 Kudos
Message 6 of 65
(4,823 Views)
Re to LoganS: maybee you are misunderstanding the problem. The TNT4882 is on my stand alone board. I am using the TNT4882 to have my device (board) become a GPIB talker/listner. I don't know what chip is in my GPIB controller, but MAX is certainly is recognizing the GPIB controller.

My status right now is that I have done what dittohead has suggested and I have listed the results in the response above. I am basically waiting for dittohead's respons, but if you are anyone has any other suggestions, I would be happy to hear.

thanks
0 Kudos
Message 7 of 65
(4,807 Views)
The ENOL error indicates the GPIB controller is not detecting the TNT4882. A common cause of this is pon not being cleared. I see in your initialization code that you are clearing pon. Can you double-check the constants and register offsets you are using to clear pon? You should be writing 0x00 to offset 0x0A.

ENOL specifically means that the GPIB controller detected NRFD and NDAC unasserted, which means there are no devices on the bus configured to accept bytes. When pon is asserted the TNT4882 will not assert any GPIB signals and all GPIB state machines are held in reset.

Also, can you verify the signals are correctly routed from the TNT4882 to the GPIB connector?
0 Kudos
Message 8 of 65
(4,805 Views)
Just want to make sure you don't miss my last post directly above yours.
0 Kudos
Message 9 of 65
(4,803 Views)
It seems that the TNT is not handshaking command bytes (hence the timeout when you tried to send it the command by addressing it to listen). Even though dittohead checked over it, you might look at your initialization code more closely. One line that I was curious about was:

TNT4882[R_auxmr]=F_hldi;

This puts the TNT4882 into an RFD holdoff state, which I believe will hold it in the ANRS state (meaning that the chip will not handshake your MLA3 command byte in, I believe). Is there any reason this line is in there?

Also, if you haven't seen the chip manual, it's very helpful (especially chapter 4) in giving initialization pseudo-code. The link is here: TNT4882 Manual.

Scott B.
GPIB Software
National Instruments
0 Kudos
Message 10 of 65
(4,796 Views)