Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with gpib, cvi read wrong results from instruments

Hello group,

i read data from a hp universal counter to detect if a measured
frequency from a device is in a right range. but sometimes i get
faulty results from my instruments, if i do a "rc = hp5313xa_dataRes
(hp53132a, &mw);".
Please see the spy-file i attached with this post. The rc-value of the
called function is always 0 (success). but if i look at the spy-file i
can see some error-messages. Please have a look at the spy-file
between line 32-36. The correct value should be approximately 10MHz
and the instruments display shows allways the correct value but the
instrument driver return other values. Since the spy-file shows the
faulty value, i think the instrument driver parse the data correctly.
But
where can the problem be located? Unfortunately the returned
function code is zero, so i can?t filter the faulty results.

Thanks in advanced for your support
Gregoire

I?m using Measurement Studio 6.0
Installed Visa-Version: 2.6
Installed Ivi-Version: 1.83
Used driver for HP53132a: Visa driver hp5313xa (dated 20.12.2001)



[Attachment hp53132a_spyfile.spy, see below]
0 Kudos
Message 1 of 6
(4,083 Views)
Hi Gregoire,
This is a bit strange. Given the spy file, you are right, it should be reporting the error. I do not have the instrument here, but I tried to trace through the code to see where it would be happening. If you look at the HP5313XA.C file around line 1492 you can see the section of code that is happening. For some reason the VI_ERROR_INSTR_SYSTEM_ERROR does not seem to be getting set. Can you add a few lines of code in there to verify that errCode is returned as zero while nispy shows that it is getting an error? Possibly a printf statement might work well.

Thanks!
Aaron K.
Application Engineer
National Instruments
0 Kudos
Message 2 of 6
(4,083 Views)
Hello Aaron,

i have logged all error codes of the hp5313xa_get_error routine and i
have catched one error message (Error-code: -1074001916 ,Data corrupt
or stale ). But the return code of all my called function is always 0.
I think this error was reported by a internal function call and not
been passed to the user-programm. The error occurs after a call of the
"hp5313xa_dataRes" function, but the function itself return with 0.
By the way NiSpy shows always Vi_Success even if a function failed.
I think the function must report this error to ensure that the read
data will not be processed, however i have played around with some
delays and reached that the counter will not send faulty datas. I
think i have overrun my instrument sometimes.

Hope this hel
ps
Gregoire
0 Kudos
Message 3 of 6
(4,083 Views)
Hi Gregoire,
NiSpy will not show a failure because it is below the level where the error occurrs. An analogy would be to think about communication between two computers over TCP/IP. If you try to send an email, and the address does not respond, you will not get a TCP/IP error. However, the dataRes function should return an error. I will look into this more.

Best Regards,
Aaron K.
Application Engineer
National Instruments
0 Kudos
Message 4 of 6
(4,083 Views)
Hello Aaron,

> NiSpy will not show a failure because it is below the level
sorry, you are right, that was a small thought error, on my side 🙂

> However, the dataRes function should return an error. I will look
> into this more.
Thanks for your support

Have a nice weekend
Gregoire
0 Kudos
Message 5 of 6
(4,083 Views)
Hi Gregoire,
I just wanted to let you know that I have not forgotten about you. Things have been a bit hectic this week with NIWeek going. I am still looking into this issue and will be back in contact with you soon!

Best Regards,
Aaron K.
Application Engineer
National Instruments
0 Kudos
Message 6 of 6
(4,083 Views)