09-11-2009 07:08 PM
Hi,
I'm reading some data from a counter over GPIB.
The measurement result looks good in SPY (no corruption), but the TestStand variable has lots of binary at the end.
Anyone know what is going on?
Thanks as always,
Ronnie
First the SPY Output.
Looking specifically at the 'Buffer' data for the step in the SPY GUI also shows no further data after the terminator.
Now the TestStand variable of the same result.
By the way, the other results also show the same corruption when selected.
09-12-2009 10:39 AM
Hi,
You have a buffer of 1024, did you initialise before you used it because you maybe just be returning the contents of an un-initialised buffer back into teststand overwritten with your reading.
Regards
Ray
09-14-2009 01:45 AM
09-14-2009 01:13 PM
Ray and j_dodek,
Thanks for your help.
Ray - I did specifically initialize the variable to 0, but it made no difference.
(By the way, I thought that TestStand initialized variables for you? ).
I then limited the size of the buffer to 15 (the amount read back in SPY) but that also to no avail.
Perhaps it's an issue with the driver (an Agilent 53131A counter)... I'll take a look at the source code.
j_dodek - The manual says that 0xA is what the instrument returns - but you're right in that perhaps the 0x00 would make all the difference. It seems that this is not something I can command the instrument to do.
Although this is a brand new instrument, the original design and software seem very old (early 1990s).
I've tried the LabVIEW driver and 2 x LabWindows drivers.
Thanks again for your help gentlemen,
Ronnie
09-15-2009 10:50 AM
Well just to close up this issue in case anyone else ever has this problem, I had to alter the Agilent driver source code to terminate the string.
After the viRead function, I appended the '\0' in place of the 0x0A of the read data and that solved the problem.
TestStand then represented the string correctly without all the extra binary, and was also able to convert the string to a number.
Thanks again for all your suggestions,
Ronnie