I hope someone can help me out with decoding the binary data block returned from the 8163A mainframe in Labview. Please note, I can not use the VXI PnP drivers in Labview version 2011, since National Instruments eliminated the import feature. I used to use them in version 7.1 and everything worked fine. However, I now have to write new VIs.

I am using the logging function from a power meter module. So, if I issue the following commands: sense1:func:par:logg 1,1s SENSE1:FUNCTION:RESULT? I would expect a return in the format , #14ffff, where ffff is the single result in binary format. The returned string from Labview is: #14yá¢2 which is 2331 3479 E1A2 320A (in hex). My question is how do I convert this to the single value from the logging function? (In my application, I plan on collecting 120 logging values, but I thought I would start with just one for now)

For the above HEX return, the 2331 34 is the #14 header and the 0A is the new line, so I am assuming that the rest of the data is the logging result - however, I have racked my brain and LV programming skills for quite a while now to determine how to convert this with no luck at all. The value should be somewhere on the order of 19E-9 Watts (~ -47 dBm).

I had a similar problem with an older HP OTDR about 10 years ago and I had solved it.... but I lost that piece of code.

Any and all help is appreciated.

Thanks

Bob

I am using the logging function from a power meter module. So, if I issue the following commands: sense1:func:par:logg 1,1s SENSE1:FUNCTION:RESULT? I would expect a return in the format , #14ffff, where ffff is the single result in binary format. The returned string from Labview is: #14yá¢2 which is 2331 3479 E1A2 320A (in hex). My question is how do I convert this to the single value from the logging function? (In my application, I plan on collecting 120 logging values, but I thought I would start with just one for now)

For the above HEX return, the 2331 34 is the #14 header and the 0A is the new line, so I am assuming that the rest of the data is the logging result - however, I have racked my brain and LV programming skills for quite a while now to determine how to convert this with no luck at all. The value should be somewhere on the order of 19E-9 Watts (~ -47 dBm).

I had a similar problem with an older HP OTDR about 10 years ago and I had solved it.... but I lost that piece of code.

Any and all help is appreciated.

Thanks

Bob

Hi Bob,

The complication here is the byte ordering in the binary representation. From the 8163A and related mainframes, the binary data starts with the least significant bit. Probably the Labview expects the reverse order.

So in the case of your data, the byte sequence

79 E1 A2 32

probably needs to be reversed to

32 a2 e1 79

before interpretation as a Real32 number.

I do get 18.96nW from this data, but am not using Labview.

I think some details on how to do this can be found on the NI support site, using the search term "endian".

You may also be able to use the PnP driver as you have been with the help of the files linked in this topic:

My understanding is that this still worked with Labview 2010.

Regards,

Mike