Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

Process Binary Block Data from 3rd Party Instrument

I have an Agilent N1911A power meter and when I send the command  "TRAC:DATA? HRES" I recieve a string of what looks like hexidecimal numbers. I know Keysight has a way to process this data but they have not been forthcoming with how they do this. According to the power meter manual the string received is in a IEEE 754 32 bit floating point number format. So I am not sure how to go about processing this data in the attachment. I would prefer to do this in VBA but any help would be appriciated. Thanks

0 Kudos
Message 1 of 3
(2,192 Views)

Keysight uses normally the so called Binary transfer format when enabled. Most instruments also support an ASCII variant that transfers the values in text form, but of course typically requires more data to be transmitted that way.

 

The Binary transfer format starts with an ASCII preamble that is formatted in a certain way. It starts with a # and a single digit indicating how many digits follow. Those digits then indicate how many measurement values are contained in the binary data.

 

Looking at your data it shows this header as #540000, so there are 5 digits encoding the number of values, and those 5 digits form the number 40000, so there are 40000 measurement values.

 

The data seems to be 4 byte floating point values in little endian format, so you would have to convert them into a number. This conversion really is more like a Typecast but I'm not sure how you would do Typecasts in VB6. Never really liked it or worked with it at all and the last time I looked at VB6 was well over 20 years ago.

 

Most likely it would be easier to find out how to set the device to transfer data in ASCII text format instead and use that.

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 3
(2,007 Views)

An ASCII prologue that follows in the Binary transfer format is formatted in a certain way. It begins with a # and the first digit of the number of digits that follow. The number of measurement values in the binary data is then shown by those digits.

 

 

Your data indicates that this header is #540000, which means that there are 5 digits encoding the number of values and that those 5 digits create the number 40000, which indicates that there are 40000 measurement values.

0 Kudos
Message 3 of 3
(1,410 Views)