NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

GPIB read data looks good in SPY but not in the TestStand variable

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. 

 

 CropperCapture[5].Png

 

 

Looking specifically at the 'Buffer' data for the step in the SPY GUI also shows no further data after the terminator.

 

CropperCapture[6].Png

 

 

Now the TestStand variable of the same result.

By the way, the other results also show the same corruption when selected.

 

CropperCapture[3].Png 

 

TestStand 4.2.1, LabVIEW 2009, LabWindows/CVI 2009
0 Kudos
Message 1 of 5
(3,945 Views)

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

Regards
Ray Farmer
0 Kudos
Message 2 of 5
(3,936 Views)

Hi

 

When i look on the screenshot the last string is 0x0A.

I miss the string termination 0x00

 

If you place 0x00 AFTER 0x0A then it will work.

Or do it as Ray said initalise the hole buffer !important! with 0x00

 

Juergen

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 3 of 5
(3,921 Views)

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

TestStand 4.2.1, LabVIEW 2009, LabWindows/CVI 2009
0 Kudos
Message 4 of 5
(3,903 Views)

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

TestStand 4.2.1, LabVIEW 2009, LabWindows/CVI 2009
Message 5 of 5
(3,889 Views)