02-13-2007 02:40 PM
We have VxWorks 6.3 running on a Pentium4 SPB. I have gotten the DDK to compile and run the chat program between two systems. My problem is how do I get the GPIB card to talk to an instrument. The instrument has an address of 14. The data to send is “R6\n”
Here is what I'm trying to do:
To initialize the card:
ibonl( card 1);
ibrsc(card 1);
if ((ibsta & (CIC | ATN))
== (CIC | ATN))
{
ibgts(card, 0);
}
ibtmo(card, timeout);
ibsic(card);
To send the data:
ibeos(card, 0x1400 | termchar);
ibtmo(card,timeout);
ibwait(card, TIMO | CIC);
char spebuf[] = { '?', 0x20, 0x18,
0x40, 0}; /* UNL, MLA, SPE, OTA */
char spdbuf[] = { 0x19, '_',
0}; /* SPD, UNT */
spebuf[3] += primary_address;
ibcmd(card, spebuf, 4);
ibcmd(card, spdbuf, 2);
ibwrt(card, data, data_length);
ibwait(card, TIMO | SRQI);
During the write I get the following error: “ERROR EADR returned GPIB not correctly addressed.”
What am I doing wrong?
02-14-2007 03:56 PM
02-15-2007 04:27 PM
Yes, the infromation was usefule and helped me fix the problem.