Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Labwindows PCI-GPIB <-> Lecroy 8901a

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
0 Kudos
Message 1 of 3
(3,561 Views)
Hello-

Lines 12 and 13 of the Spy capture above show that the talk address is set to 24, then the listen address is set to 24. They are probably cancelling each other out.

The NI-488.2 API for Windows automatically sends the addressing information when using ibwrt and ibrd properly. This can be verified using a GPIB analyzer. If it is necessary to write to multiple devices try using SendList. The C:\Program Files\National Instruments\NI-488.2\Help\gpib32.hlp file can provide more details about these functions.

Also, there is a CVI driver available at ni.com/idnet for the LeCroy 8901a that may help.

Randy Solomonson
Application Engineer
National Instruments
0 Kudos
Message 2 of 3
(3,561 Views)
Anders,

I would recommend using the instrument driver too. It uses VISA and in the initialize function you'll notice that some of the settings for GPIB aren't what you would normally have for most GPIB instruments.

It's been three years since I've used the driver but it used to work fine and handles the different transfer modes as well and supports SRQs.

Trying the different transfer modes might also help with your transfer speed issues.

Best of luck,
Kamran - NI
An
0 Kudos
Message 3 of 3
(3,561 Views)