Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Lecroy 8091A driver, lc8901a_init() makes two calls!!

I got a Camac crate hooked up to a pc(windows 98)
with Gpib-card and Lecroy 8091A gpib interface.
Using Labwindows CVI 5.5 patch 1.


Making calls after init the gpib pc card this code
generates two calls, first the requested, and secondly some erroneous call.

-------------8<------------Code
lc8901a_init ("GPIB::2", 0, 1, &lcGPIB);
lcGPIB is declared as static.
----------------------------------

SPy log:
------------------8<--------------
8. ibdev(0, 2, 0 (0x0), T3s (12), 1, 0x100A)
Process ID: 0xFFFC8113 Thread ID: 0xFFFB6193
Start Time: 13:56:31.730 Call Duration: 00:00:00.060
ibsta: 0x100 iberr: 0 ibcntl: 0(0x0)

9. ThreadIbsta()
Process ID: 0xFFFC8113 Thread ID: 0xFFFB6193
Start Time: 13:56:31.790 Call Duration: 00:00:00.000
ibsta: 0x100 iberr: 0 ibcntl: 0(0x0)

10. ibconfig(UD0, IbcREADDR (0x0006), 1 (0x1))
Process ID: 0xFFFC8113 Thread ID: 0xFFFB6193
Start Time: 13:56:31.840 Call Duration: 00:00:00.000
ibsta: 0x100 iberr: 0 ibcntl: 0(0x0)

11. ThreadIberr()
Process ID: 0xFFFC8113 Thread ID: 0xFFFB6193
Start Time: 13:56:31.840 Call Duration: 00:00:00.000
ibsta: 0x100 iberr: 0 ibcntl: 0(0x0)

12. ibconfig(0, IbcEndBitIsNormal (0x001A), 0 (0x0))
Process ID: 0xFFFC8113 Thread ID: 0xFFFB6193
Start Time: 13:56:31.840 Call Duration: 00:00:00.060
ibsta: 0x130 iberr: 1 ibcntl: 0(0x0)

13. ibln(0, 2, NO_SAD (0), TRUE (1))
Process ID: 0xFFFC8113 Thread ID: 0xFFFB6193
Start Time: 13:56:31.900 Call Duration: 00:00:00.000
ibsta: 0x130 iberr: 0 ibcntl: 1(0x1)

14. ibtmo(UD0, T10s (13))
Process ID: 0xFFFC8113 Thread ID: 0xFFFB6193
Start Time: 13:56:31.900 Call Duration: 00:00:00.050
ibsta: 0x100 iberr: 12 ibcntl: 0(0x0)

> 15. ibdev(0, 4095, 0 (0x0), T10s (13), 1, 0x0000)
> Process ID: 0xFFFC8113 Thread ID: 0xFFFB6193
> Start Time: 13:56:31.950 Call Duration: 00:00:00.000
> ibsta: 0x8100 iberr: 4 ibcntl: 0(0x0)

> 16. ThreadIbsta()
> Process ID: 0xFFFC8113 Thread ID: 0xFFFB6193
> Start Time: 13:56:32.010 Call Duration: 00:00:00.000
> ibsta: 0x8100 iberr: 4 ibcntl: 0(0x0)

> 17. ThreadIberr()
> Process ID: 0xFFFC8113 Thread ID: 0xFFFB6193
> Start Time: 13:56:32.010 Call Duration: 00:00:00.000
> ibsta: 0x8100 iberr: 4 ibcntl: 0(0x0)
----------------------------------------------

I have no clue why the second call happends with
a value thats out of range.

Hope someone knows.

/Anders
0 Kudos
Message 1 of 3
(3,399 Views)
Hello-

From the version of the driver from ni.com/idnet, the prototype for the init function is as follows:

int PUBLIC hp8901a_init (int addr, int id_query, int rest, int *instrID)

It appears as though, a character string is somehow getting cast into an int for the addr parameter. So, addr is not quite accurate. For the first parameter try a primary address (ie 2), instead of a string (ie "GPIB::2").

I hope this helps.

Randy Solomonson
Application Engineer
National Instruments
0 Kudos
Message 2 of 3
(3,399 Views)
The driver from ni.com eventually uses
ViRrsc and ViOpen() and won't take a int()
as and argument neither a '2' as a string
the program gets runtime break due to lc8091a_init() havent got a complete argument.

/Anders.
0 Kudos
Message 3 of 3
(3,399 Views)