Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Sometimes visa driver Visa32.dll hangs

We have a test setup where we have a number of visa devices like Vm2710a(Dmm), Vtvm7004 (Programmable resistance) etc. I have a multithreaded MFC application through which i want to read & set values on these devices.

When some commands are not sent in sequence, visa driver doesn't give expected results and it hangs sometimes.

One thread is dedicated for DMM & the other thread is dedicated for Programmable load. When thread 1 is trying to read the vm2710a value say resistance, and from thread 2 when i try to command a new resistance on vtvm7004, in some cases visa driver is hanging. and the only way to restore is to restart the machine.

Commands are sent in the following sequence by the visa driver.
Say X is th
e device handle for DMM
Say Y is the device handle for vtvm7004.

ViPrintf(X, "read?")
ViWrite(Y, "SOUR1:RES 15000.0")
formatted ViWrite(X, "read?", .....)
Viscanf(X, "%lf")
ViWrite(Y, "ESR?")
formatted ViRead(X, "", ....)
....
...

I'm herewith attaching the log of NI spy. See lines 2386 to 2403. This is the problem area. Here 0x00156DA0 is the handle for DMM & 0X001592E8 is the handle for Vtvm7004.
Also note that there are some errors in lines 1870 to 1876.

Please let me if i'm doing anything wrong there. I think, visa32.dll is not handling things properly.

Thanks in Advance,
Swamy
0 Kudos
Message 1 of 2
(3,524 Views)
Swamy:

This is a strange problem. We'll need more info to help solve this. What OS? What VXI controller? What versions of NI software?

Also, if you could enable NI Spy file logging (not using File>>Save), this will give us more information about what is going on. Since that will be a really large file, please either WinZip it first, or send it in an email to our tech support staff.

One thing your code is doing wrong is the way you query the SYST:ERR? response. You are using "%ld,"%256... but you need a space after the comma. It should be "%ld, "%256... to parse the response correctly.

Dan Mondrik
Senior Software Engineer, NI-VISA
National Instruments
Message 2 of 2
(3,524 Views)