Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

IBRD reading hexadecimal data

Solved!
Go to solution

using ibrd reading curve data in SONY/TEK_370A test instrument,  but the result is not correct.     

 

in  ibrd function,  the buffer is defined as string type,  but the curve data is hexadecimal . 

 can IBRD function  read hexadecimal using  string type buffer.

0 Kudos
Message 1 of 7
(4,183 Views)

Don't assume that string data is ASCII. It's all the same data and it is up to you correctly convert/represent it. There will be an explanation in the manual on how to convert the binary to floating point.

 

No idea what programming language you are using so cannot provide an example.

0 Kudos
Message 2 of 7
(4,180 Views)

dear   ,   programming language is VB 6.0.  could you provide an example .  thanks  

0 Kudos
Message 3 of 7
(4,177 Views)

Sorry, I have not used VB in years but the process in the LabVIEW driver is that after the CURVE? command is issued, a WFMPRE command is issued to get the preamble with the YMULT, YOFFSET, XOFFSET, etc. It looks like the U16 array consists of an x data point, y data point, x data point, y data point, etc. The information in the preamble is then used to scale the U16 to floats.

0 Kudos
Message 4 of 7
(4,169 Views)
Solution
Accepted by topic author davissun

In the vbib-32.bas module that is included in your GPIB project, integer I/O calls (ibrdi, ilrdi, ibwrti, and ilwrti) are provided for users who need to perform arithmetic operations on the data and want to avoid the overhead of converting to the character strings required by ibrd and ibwrt and back into the integer format for the arithmetic operations.

ibrdi and ibwrti are passed data in the form of an integer array, instead of a character string. Using these functions, you can access the data directly as integers instead of defining them as characters and then converting each pair of characters to an integer. Internally, the ibwrti function sends each integer to the GPIB in low-byte, high-byte order. The ibrdi function reads a series of data bytes from the GPIB and stores them into the integer array in low-byte, high-byte order.

 

Hope this information is helpful.

 

gpibtester

0 Kudos
Message 5 of 7
(4,157 Views)

Thanks.  Smiley Very Happy

 Referring to ibrdi, a function ibrdb is created,  in which data is saved in a array of byte type.  and  the problem is solved.

0 Kudos
Message 6 of 7
(4,129 Views)

It is good that you were able to refer to ibrdi to create a function that works with the hexadecimal array that you need!

 

Regards,

gpibtester

0 Kudos
Message 7 of 7
(4,112 Views)