Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Runtime error with tktds1k2k

I'm getting a non-fatal runtime-error when trying to execute the CVI example (tktds1k2k_example.c) included with the IVI Instrument drivers for the Tektronix 2024. The error occurs on the line
viCheckErr (viSetBuf (io, VI_READ_BUF | VI_WRITE_BUF, 4000));
and the error is "The given session does not support this operation."
For some reason if I'm running in simulation mode the error won't occur and the example runs fine. But when I disable simulation (Simulate=0) then i get the error. The compiler says the error is non-fatal but if I continue execution I will get "Driver Status.. The given session does not support this operation." and the program exits.
Does anyone know what to do about this issue?
0 Kudos
Message 1 of 4
(4,459 Views)
What bus interface are you using to communicate with the instrument? Serial? GPIB? Other? What resource string are you using? Are you running on a Win32 platform? viSetBuf() should be supported for both serial and GPIB.

The error does not occur when running in simulation mode because no IO code runs in simulation mode (i.e., this line of code is skipped).
0 Kudos
Message 2 of 4
(4,459 Views)
Noel, I'm using a GPIB bus with the resource string "GPIB0::1::INSTR" and my options string is "Simulate=0,RangeCheck=1,QueryInstrStatus=1,Cache=1,DriverSetup=Model:2024". I'm able to query the id and also send commands to my instrument using MAX so I think the communication is working. I have MAX 3.0 with IVI Compliance Package 2.1 and NI-VISA 3.0.1 installed currently.
0 Kudos
Message 3 of 4
(4,459 Views)
Strange. If you take a NI-Spy log and attach it in your next posting, I'll take a look at it.

You can launch NI-Spy from your Start>>National Instruments menu. Be sure to turn on "File Logging" from the Spy>>Options menu.
0 Kudos
Message 4 of 4
(4,459 Views)