Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

labview GPIB write-read vs NI-Max query

Hi there,

I am currently writting a LV program to get the measurement results from the Hp 16500b, the command to get the data is :SYSTEM:DATA?.
The way I do it in LV is I use the GPIB write.vi followed by the GPIB read.vi but the results I get are not always correct. Let me explain:
the data comming out of the GPIB read.vi is binary not like 000100111 but like  yy  .
So in order to understand the data I need to convert it to hex. or binary (0 and 1's). Therefore I take the read out string and put it into the string to byte array and then I use tha format into string function (% b, or %x)in a shift register.
But the results I get are most of the time wrong compared to Ni-MAX. If I enter the command :SYSTEM:DATA? in the c
ommunicate with instrument window in NI-MAX I get other results correct results that is!!!
Now what is the difference between a Query in Ni-Max and the GPIB write - read.vi's in LV??

Ni-max shows for instance :
1f 00 1f 00 1f 00 1f 00 1f 00 1f 00 1f 00 1f 00 1f 00 1f 00 1f 00 1f 00 1f 00 1f 00 1f 00 1f 00 1f 00 1f 00 1f 00 1f 00 1f 00 1f 00 1f 00 1f 00

whereas labview gives me:
1F01F01F01F01F01F01F01F01F01F01F01F01F01F01F01F01F01F01F01F01F01F01F01F01F01F01F01F01F01F01F01F01F01F01F01F01F01F01F01F01F01F0

also is there an easy way to split the string in LV to get the hex values sorted 2 by 2 like in Ni-Max?
0 Kudos
Message 1 of 2
(3,182 Views)
Hi,

It seems to be a formating problem. Instead of using the format into string VI, try these two approaches.

a) Don't use any additional VIs and change the display mode of the string control. Right click on the string control and select Hex display. The control will automatically format the incoming string into Hex. You'll even get the word arrangement you are looking for.

b) use the string to byte array. In this case the resul will not be a string. It will be an array with the actual numbers.

Hope this helps.

DiegoF
National Instruments.
0 Kudos
Message 2 of 2
(3,182 Views)