Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

C source code drivers for TNT4882

Dear all,

 

I am new to GPIB. Can anyone give example source code for data transfer from taker to listener for the controller TNT4882?

0 Kudos
Message 1 of 4
(4,195 Views)

Hi Bharath,

 

Thank you for contacting National Instruments.

 

You can find examples to get started with TNT4882 at the following links-

http://zone.ni.com/devzone/cda/epd/p/id/3272 

http://zone.ni.com/devzone/cda/epd/p/id/253 

 

Also you can find additonal material regarding NI TNT4882 at-

https://www.ni.com/en-us/shop/model/tnt4882.html

 

I hope this is helpful.

Have a great day.

Regards,
Kanchan Bhakoo
Applications Engineer | National Instruments
0 Kudos
Message 2 of 4
(4,188 Views)

I am using theESP software on a PIC Microcontroller, and I am not able to program the Count Registers. I can send to each register individually, and read back the data correctly (i.e. write to R-cnt0, read from Rcnt0 looped 0-255, then repeat for Rcnt1, Rcnt2, Rcnt3 and that works). However, whenever I try to program Rcnt0,Rcnt1,Rcnt2,Rcnt3 in that order, I always read back the value sent to Rcnt3 in all 4 registers??? This is being used in the code to control the count of databytes sent/received in 2's complement.

 

 

This is my test code below:

 

while (1)
{
  TNT_Out(R_cnt0, 0xAA);     
 TNT_Out(R_cnt1, 0x55);     
 Delay10KTCYx(200);//Delay 20K cycles
 TNT_Out(R_cnt2, 0xF0); 
 TNT_Out(R_cnt3, 0xFF);    
 LATD = 0x00;
 Delay10KTCYx(200);//Delay 20K cycles
 Delay10KTCYx(200);//Delay 20K cycles
 Delay10KTCYx(200);//Delay 20K cycles
 Delay10KTCYx(200);//Delay 20K cycles
 Delay10KTCYx(200);//Delay 20K cycles
 Delay10KTCYx(200);//Delay 20K cycles
 TNT_In(R_cnt0);
 LATD = Data_Bus; Reads 0xFF here
   Delay10KTCYx(200);//Delay 20K cycles
 Delay10KTCYx(200);//Delay 20K cycles
 TNT_In(R_cnt1);
 LATD = Data_Bus;Reads 0xFF here
   Delay10KTCYx(200);//Delay 20K cycles
 Delay10KTCYx(200);//Delay 20K cycles
 TNT_In(R_cnt2);
 LATD = Data_Bus;Reads 0xFF here
   Delay10KTCYx(200);//Delay 20K cycles
 Delay10KTCYx(200);//Delay 20K cycles
 TNT_In(R_cnt3);
 LATD = Data_Bus;Reads 0xFF here
   Delay10KTCYx(200);//Delay 20K cycles
 Delay10KTCYx(200);//Delay 20K cycles

 

If I reverse Rcnt0 and Rcnt3:

 

while (1)
{
  TNT_Out(R_cnt0, 0xFF);     
 TNT_Out(R_cnt1, 0x55);     
 Delay10KTCYx(200);//Delay 20K cycles
 TNT_Out(R_cnt2, 0xF0); 
 TNT_Out(R_cnt3, 0xAA);    
 LATD = 0x00;
 Delay10KTCYx(200);//Delay 20K cycles
 Delay10KTCYx(200);//Delay 20K cycles
 Delay10KTCYx(200);//Delay 20K cycles
 Delay10KTCYx(200);//Delay 20K cycles
 Delay10KTCYx(200);//Delay 20K cycles
 Delay10KTCYx(200);//Delay 20K cycles
 TNT_In(R_cnt0);
 LATD = Data_Bus; Reads 0xAA here
   Delay10KTCYx(200);//Delay 20K cycles
 Delay10KTCYx(200);//Delay 20K cycles
 TNT_In(R_cnt1);
 LATD = Data_Bus;Reads 0xAA here
   Delay10KTCYx(200);//Delay 20K cycles
 Delay10KTCYx(200);//Delay 20K cycles
 TNT_In(R_cnt2);
 LATD = Data_Bus;Reads 0xAA here
   Delay10KTCYx(200);//Delay 20K cycles
 Delay10KTCYx(200);//Delay 20K cycles
 TNT_In(R_cnt3);
 LATD = Data_Bus;Reads 0xAA here
   Delay10KTCYx(200);//Delay 20K cycles
 Delay10KTCYx(200);//Delay 20K cycles


0 Kudos
Message 3 of 4
(4,142 Views)

Thank you very much..:)

0 Kudos
Message 4 of 4
(4,138 Views)