08-03-2010 10:48 AM
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.
Solved! Go to Solution.
08-03-2010 10:54 AM
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.
08-03-2010 10:58 AM - edited 08-03-2010 11:04 AM
dear Dennis Knutson , programming language is VB 6.0. could you provide an example . thanks
08-03-2010 11:13 AM
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.
08-03-2010 02:26 PM
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
08-04-2010 03:30 AM
Thanks. ![]()
Referring to ibrdi, a function ibrdb is created, in which data is saved in a array of byte type. and the problem is solved.
08-04-2010 12:01 PM
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