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