Sie sind auf Seite 1von 4

i have made a gpib controller with p89v51rd2bn. I need a c code to configure tnt4882 as a...

Page 1 of 4

Cart | Help Search

Y o u a r e h e r e : N I H o m e > N I D e v e lo p e r Z o n e > N I D i s c u s s i o n F o r u m s
Select Community

Instrument Control (GPIB, Serial,


VISA, IVI)
Register · Sign In · Help
NI Discussion Forums : Most Active Hardware Boards : Instrument Control (GPIB, Serial, VISA, IVI) :
i have made a gpib controller with p89v51rd2bn. I need a c code to configure tnt4882 as a listener and a seprate c code as a talker a

Reply Topic Options « Message

devika
Member i have made a gpib controller with p89v51rd2bn. I need a c co
to configure tnt4882 as a listener and a seprate c code as a ta
and please explain functions used in that.
05-12-2009 06:51 AM

0 Kudos

Message 1 of 7 (640 Views)

devika Re: i have made a gpib controller with p89v51rd2bn. I need a c code to configure tnt488
Member
listener and a seprate c code as a talker and please explain functions used in that.
05-12-2009 08:39 AM

computer is reading my device but it is showing that it doesnot respond to idn query

0 Kudos

Message 2 of 7 (635 Views)

Steven T Re: i have made a gpib controller with p89v51rd2bn. I need a c code to configure tnt488
Active Participant
listener and a seprate c code as a talker and please explain functions used in that.
05-12-2009 10:10 AM

Hello,

There is a source code package that can be used to get the TNT4882 to respond to queries such as
0 Kudos
versions, one that uses interrupts and one that does not. If you trace the function calls down to the lo
the TNT4882 registers are being accessed by Memory IO functions.

I would recommend spending some time going over the code and correslating the function names wit
(using the TNT4882 manual).

http://forums.ni.com/t5/Instrument-Control-GPIB-Serial/i-have-made-a-gpib-controller-wit... 12/7/2010
i have made a gpib controller with p89v51rd2bn. I need a c code to configure tnt4882 as a... Page 2 of 4

http://joule.ni.com/nidu/cds/view/p/id/223/lang/en

I hope this helps,


Steven T.
Message 3 of 7 (629 Views)

devika Re: i have made a gpib controller with p89v51rd2bn. I need a c code to configure tnt4
Member
listener and a seprate c code as a talker and please explain functions used in that.
05-12-2009 10:27 PM

My microcontroller is communicating with 4882. we want to use labview to communicate with the tn
application code available also primary address of the device is being identified but is not
0 Kudos

Message 4 of 7 (614 Views)

Re: i have made a gpib controller with p89v51rd2bn. I need a c code to configure tnt4
Dennis Knutson listener and a seprate c code as a talker and please explain functions used in that.
Knight of NI
05-12-2009 10:55 PM

Your questions are confusing. First you ask for some c code and now you ask for some LabVIEW c
and VISA but typically all you would need is a VISA Write or VISA Read. Of course, no LabVIEW co
no response to an *IDN? query. You would have to code that into the microcontroller. If you don't
0 Kudos instrument is not compliant with IEEE-488.2.

Message 5 of 7 (610 Views)

devika Re: i have made a gpib controller with p89v51rd2bn. I need a c code to configure tnt4
Member
listener and a seprate c code as a talker and please explain functions used in that.
05-13-2009 12:24 AM

Hey Dennis,
I understand what you are trying to say. It would be helpful if you pointed me to the documents that
configuration the TNT4882 should be put to inorder to have it communicate with VISA.
0 Kudos
This is what I have done...

void TNT_config(void){
XBYTE[CMDR] = 0x22; //soft reset command to command register

XBYTE[SPMR] = 0x80; //following steps configure the TNT into turbo+7210 mode
XBYTE[AUXMR]= 0x80; // do
XBYTE[SPMR]= 0x99; // do
XBYTE[AUXMR]= 0x99; // do
XBYTE[HSSEL] = 0x01; //Configure TNT to one chip mode

XBYTE[AUXMR]= 0x02; //To make sure that the local PON message is asserted.
// to logically disconnect the GPIB and GPIB interface
//Configure the TNT for GPIB operation

http://forums.ni.com/t5/Instrument-Control-GPIB-Serial/i-have-made-a-gpib-controller-wit... 12/7/2010
i have made a gpib controller with p89v51rd2bn. I need a c code to configure tnt4882 as a... Page 3 of 4

XBYTE[ADMR]= 0x31; //To set the TNT in dual primary addressing mode.
XBYTE[ADR]= 0x0A; //The primary address of the built GPIB card as seen by the MAX
XBYTE[ADR]= 0xE0; //TNT has no secondary address
XBYTE[AUXMR] = 0x51; //hold off handshake immediately
XBYTE[SPMR]= 0x01; //Initial serial poll response byte
//Enable interrupts
XBYTE[IMR0] = 0xAD;
XBYTE[IMR1] = 0x00;
XBYTE[IMR2] = 0x00;
XBYTE[IMR3] = 0x08;
XBYTE[HIER] = 0xC0; //To select deglitching circuit on the TNT
XBYTE[AUXMR]= 0x00; //To clear the local PON message
return;
}

Max is reading the address as 10. we want to confiqure tnt as a listener.so do we have to write the
ADR register?
Message 6 of 7 (605 Views)

Steven T Re: i have made a gpib controller with p89v51rd2bn. I need a c code to configure tnt4
Active Participant
listener and a seprate c code as a talker and please explain functions used in that.
05-13-2009 08:34 AM

Devika,

I don't think that you understand how invovled your question is. Getting your instrument to respond
0 Kudos
complicated. However, we know that your TNT4882 is initialized correctly because it is showing up
instruments. This means that you have successfully followed the directions in Chapter 4 of the
Manual.

Here are the additional steps necessary for communication (both sending and receiving data):
1. Initialize the transfer
1. Wait for the GPIB Controller to complete the necessary addressing (the TNT4882 must be add
and listener to receive data)
2. Reset the FIFO
3. See the remaining steps on page 4-8 in the manual
2. Conduct the transfer
1. This is a fairly complicated state machine See page 4-9 in the manual.
3. Post Transfer Termination (after the transfer is complete)
1. Send the stop command
2. Read the Counts to determine the number of bytes transferred
3. See the remaining steps on page 4-12 in the manual.
Depending on how you are using the chip, there are numerous ways to implement these steps. Wit
bus), with interrupts, or even using a timer for timeout detection. Once you decide which features
you can see the manual for tips on implementation or you can see the source code package that I d
implementation of an instrument responding to a *IDN? query.

The code that you posted will only get the instrument to respond to addressing by the controller. It
communicate.

I hope this helps,


Steven T.
Message 7 of 7 (581 Views)

http://forums.ni.com/t5/Instrument-Control-GPIB-Serial/i-have-made-a-gpib-controller-wit... 12/7/2010
i have made a gpib controller with p89v51rd2bn. I need a c code to configure tnt4882 as a... Page 4 of 4

« Message

By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully
before using any part of this site. Please go here for information on ni.com's copyright infringement policy.

My Profile | Privacy | Legal | Contact NI © 2 0 1 0 N a t i o n a l I n s t r u m e n t s C o r p o r a ti o n . A l l r i g h t s r e s e r v e d . | E-Mail this Page

http://forums.ni.com/t5/Instrument-Control-GPIB-Serial/i-have-made-a-gpib-controller-wit... 12/7/2010

Das könnte Ihnen auch gefallen