Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

tnt5002 --can not receive response for *IDN? from TNT5002

Hello,

 


I have some problem on developing driver for TNT5002,I am using USB-GPIB Agilent IO control based on PC(windows xp) to connect TNT5002 pci-gpib which plug in MPC8541 board,and the os is vxworks5.5.

After initialization of TNT5002,and initialized for receiving,I can send data to tnt5002 from pc.

The problem is:

when I send *IDN? to tnt5002,and I am sure I read the "*IDN?" string from the GFIFO,but I can not receive the response from TNT5002.
Why?

 

The initialization code as follow:

/* Initialize TNT5002 */

CMDR[SOFT_RESET] = 0x22; //TNT5002 for 4882 mode

AUXMR[CH_RST] = 0x02; //assert pon message

ADMR = 0x31; //ADDR_MODE is normal addressing

ADR0 = 0x0e; //GPIB ADDRESS:14

 


/* Configuration for Serial Poll */

IMR0 = 0x80; //clear STBO IE

AUXMR = 0x18; //REQT

 

/* Configuration for Parallel Poll */

PPR[PPMODE1] = 0x70;//do not sue Parallel Poll

 


/* Configuration for Device clear block */

AUXRE = 0xc0; //Disable device clear

 

/* Configuration for Device Trigger Block */

AUXRE = 0xc0; //Disable device trigger

 

/* Set T1 delay */

*(0x11) = 0x32;

 

/* Clear pon */

AUXMR[PON] = 0x00;

 

The initialization for receiving:

 


/* Initialization for receiving */

 CFG = 0x21; //CFG

CNT0 = 0xe0; //CNT

CNT1 = 0xff;

EOSR = 0x00; //EOSR

AUXMR = 0x94; //AUXRA

AUXMR = 0x03; //AUXMR[RHDF]

CMDR[RESET_FIFO] = 0x10; //CMDR[RESET_FIFO]

CMDR[GO] = 0x04; //CMDR[GO]

 

tmp = PciGpibReadByte(0x54004106);

SPMR= tmp&0xbf;

IMR1[END IE] = 0x10; //IMR1

IMR3[NEF IE] = 0x04; //IMR3

 

The receiving routine is :

switch(isr3)

{

case NFF_FULL:

{

for(i = 0; i < 16; i++)

{

*p++ = PciGpibReadByte((UINT32)0x54004118);

*p++ = PciGpibReadByte((UINT32)0x54004119);

}

break;

}

case THREE_QUARTER:

{

for(i = 0; i <15 ; i++)


{

*p++ = PciGpibReadByte((UINT32)0x54004118);

*p++ = PciGpibReadByte((UINT32)0x54004119);

}

*p++ = PciGpibReadByte((UINT32)0x54004119);

break;

}

case TOW_BYTE:

{

 for(i = 0; i < 11; i++)

{

*p++ = PciGpibReadByte((UINT32)0x54004118);

*p++ = PciGpibReadByte((UINT32)0x54004119);

}

*p++ = PciGpibReadByte((UINT32)0x54004119);

break;


}

case OOD:

{

*p++ = PciGpibReadByte((UINT32)0x54004118);


break;

}

default:

break;


}

printf("%s",string);

 

 


Please!Thank you!

0 Kudos
Message 1 of 3
(3,833 Views)

Hello,

In addition for last post,I read some post which said:

"The TNT5002 should automatically interpret most command bytes it receives.You never need to setup a transfer to receive a command byte,it all happens automatically.The processing of most commands also happens automatically.There may be some status or ISR bit that sets that requires you to do somthing but you should rarely need the firmware to interpret a command byte."

 

Is there any status or ISR bit not right be set?Or I have some error in my post?

 

Thank you!

0 Kudos
Message 2 of 3
(3,828 Views)

Hello,

 

In addition,

 

1

I use CPU control the transfer, need to set HSSEL(Handshake select Register) or not?

HSSEL = 0x11

Is the ONEC bit need to set?

 

2

I have no idea to set the SPMR,

PPR[PPMODE1] = 0x70;        //do not sue Parallel Poll

Disable the Parallel poll,but I don't known if it is connection with *IDN? response.

 

?

 

Thank you!

 

 

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