LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

GPIB read.

hi,

I'm trying to read a section data buffer in the first [1800 bytes] thru
GPIB, and each data value is represent by each 16 bit binary number.

Buffer Value
[0000] ...data[1]
[0004] ...data[2]
....
[1796] ...data[n-1]
[1800] ...data[n]

My question is how to read 16bit each time thru GPIB? I can use GPIB to
read buffer but it always come out all "binary string" which is not
readable. Is there any built-in GPIB function in LabVIEW allow to read
certain bit each time, and convert binary string to decimal? Also, is
CIN (Code Interface Node) in C-program other way to approach??

Thanks for help.
Jacky Wong
0 Kudos
Message 1 of 2
(3,577 Views)
> I'm trying to read a section data buffer in the first [1800 bytes] thru
> GPIB, and each data value is represent by each 16 bit binary number.
>
> Buffer Value
> [0000] ...data[1]
> [0004] ...data[2]
> ....
> [1796] ...data[n-1]
> [1800] ...data[n]
>
> My question is how to read 16bit each time thru GPIB? I can use GPIB to
> read buffer but it always come out all "binary string" which is not
> readable. Is there any built-in GPIB function in LabVIEW allow to read
> certain bit each time, and convert binary string to decimal? Also, is
> CIN (Code Interface Node) in C-program other way to approach??
>

You need to look at the typecast node. Whenever you are pulling
back binary data and need to look at as another type of binary,
then
consider using typecast. If the data is coming back as
formatted data, then use a Scan From String.

To go the other way, use typcast to make the binary data and
use Format into String.

In this case, cast it as an array of I16 or U16. Depending
on the byte ordering, you might need to use the swap bytes to
reorder the bytes.

Greg McKaskle
0 Kudos
Message 2 of 2
(3,577 Views)