Hellos!
I've got a machine running win98 and latest
labwindows, trying to tinker around with a
Camac crate making a time of fligth unit
(a 3512a/d, a 4204tof and a 3588hist mem).
I got a 8901a gpib card and have been pulling
off data at a very slow rate, I know the crate
is fast 150KHz and don't expect that kind of speed
but atleast 50Khz or around that. Since I had problems
and couldn't get it to pull single 16bit word than 3Khz
i started to tinker with lower level gpib commands to the 8901a, and found i could'nt make it go into talk mode. I could make it go to untalk `, listen and unlisten, but not talk which is important when i want to latch in commands. If I use ibrd and shure it
gets to talk but does it really latch in the commands i sent it? Can't think of why it fails with the lowlevel cmds. example of code and Ispy log.
void a8901_listen(int num)
{
static int cmd[4];
//cmd[0]=0x3F;
//cmd[1]=0x5F;
//cmd[2]=0x20;
if (num==1)
{
cmd[0]=0x20 + MyDev;
ibcmd(Myboard,cmd,1L);
}
else ibcmd(Myboard,"\x3F",1L);
}
void a8901_talk(int kum)
{
static int kmd[4];
//kmd[0]=63;
//kmd[1]=95;
//kmd[2]=64;
if (kum==1)
{
kmd[0]= 0x40 +MyDev;
ibcmd(Myboard,kmd,1L);
}
else ibcmd(Myboard,"\x5F",1L);
}
int initalizedevice()
{
static char bajsa[40];
MyDev = ibdev (0, 2, NO_SAD, T10s, 1, 0);
ibsic(Myboard);
//clear CAMAC
a8901_listen(1);
ibwrt (MyDev, "\x22", 1);
a8901_listen(0);
a8901_talk(1);
//assert inhibit (no data collection)
a8901_listen(1);
ibwrt (MyDev, "\x48", 1);
//ibrd(MyDev,MyRetn,2);
a8901_talk(1);
//set up for high speed block read 16bit
a8901_listen(1);
ibwrt (MyDev, "\x7A", 1);
a8901_listen(0);
}
this was just and excerpt. the listen and unlisten and
untalk works but i can't get it to talk.
NI spy log
---------------------
1. ibfind(gpib0)
Process ID: 0xFFFCA191 Thread ID: 0xFFFB79FD
Start Time: 16:29:29.620 Call Duration: 00:00:00.110
ibsta: 0x100 iberr: 0 ibcntl: 0(0x0)
2. ibpad(GPIB0, 0)
Process ID: 0xFFFCA191 Thread ID: 0xFFFB79FD
Start Time: 16:29:29.730 Call Duration: 00:00:00.000
ibsta: 0x100 iberr: 0 ibcntl: 0(0x0)
3. ibrsc(GPIB0, 1)
Process ID: 0xFFFCA191 Thread ID: 0xFFFB79FD
Start Time: 16:29:29.730 Call Duration: 00:00:00.050
ibsta: 0x100 iberr: 1 ibcntl: 0(0x0)
4. ibsic(GPIB0)
Process ID: 0xFFFCA191 Thread ID: 0xFFFB79FD
Start Time: 16:29:29.780 Call Duration: 00:00:00.000
ibsta: 0x130 iberr: 0 ibcntl: 0(0x0)
5. ibsre(GPIB0, 1)
Process ID: 0xFFFCA191 Thread ID: 0xFFFB79FD
Start Time: 16:29:29.780 Call Duration: 00:00:00.000
ibsta: 0x130 iberr: 0 ibcntl: 0(0x0)
6. ibconfig(GPIB0, IbcAUTOPOLL (0x0007), 0 (0x0))
Process ID: 0xFFFCA191 Thread ID: 0xFFFB79FD
Start Time: 16:29:29.780 Call Duration: 00:00:00.060
ibsta: 0x130 iberr: 1 ibcntl: 0(0x0)
7. ibdev(0, 2, 0 (0x0), T10s (13), 1, 0x0000)
Process ID: 0xFFFCA191 Thread ID: 0xFFFB79FD
Start Time: 16:29:29.840 Call Duration: 00:00:00.000
ibsta: 0x100 iberr: 0 ibcntl: 0(0x0)
8. ibsic(GPIB0)
Process ID: 0xFFFCA191 Thread ID: 0xFFFB79FD
Start Time: 16:29:29.840 Call Duration: 00:00:00.050
ibsta: 0x130 iberr: 0 ibcntl: 0(0x0)
9. ibcmd(GPIB0, "8", 1 (0x1))
Process ID: 0xFFFCA191 Thread ID: 0xFFFB79FD
Start Time: 16:29:29.890 Call Duration: 00:00:00.000
ibsta: 0x130 iberr: 0 ibcntl: 1(0x1)
10. ibwrt(UD0, """, 1 (0x1))
Process ID: 0xFFFCA191 Thread ID: 0xFFFB79FD
Start Time: 16:29:29.890 Call Duration: 00:00:00.000
ibsta: 0x100 iberr: 0 ibcntl: 1(0x1)
11. ibcmd(GPIB0, "?", 1 (0x1))
Process ID: 0xFFFCA191 Thread ID: 0xFFFB79FD
Start Time: 16:29:33.190 Call Duration: 00:00:00.050
ibsta: 0x138 iberr: 0 ibcntl: 1(0x1)
12. ibcmd(GPIB0, "X", 1 (0x1))
Process ID: 0xFFFCA191 Thread ID: 0xFFFB79FD
Start Time: 16:29:35.390 Call Duration: 00:00:00.000
ibsta: 0x130 iberr: 0 ibcntl: 1(0x1)
13. ibcmd(GPIB0, "8", 1 (0x1))
Process ID: 0xFFFCA191 Thread ID: 0xFFFB79FD
Start Time: 16:29:36.490 Call Duration: 00:00:00.000
ibsta: 0x130 iberr: 0 ibcntl: 1(0x1)
14. ibwrt(UD0, "H", 1 (0x1))
Process ID: 0xFFFCA191 Thread ID: 0xFFFB79FD
Start Time: 16:29:36.490 Call Duration: 00:00:00.050
ibsta: 0x100 iberr: 0 ibcntl: 1(0x1)
15. ibcmd(GPIB0, "X", 1 (0x1))
Process ID: 0xFFFCA191 Thread ID: 0xFFFB79FD
Start Time: 16:29:36.540 Call Duration: 00:00:00.000
ibsta: 0x130 iberr: 0 ibcntl: 1(0x1)
----------------
best regards :
Anders