From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
08-22-2015 09:04 AM
Hello,
I'm trying to read data from Agilent OSA that output the data in 32 bit number through GPIB interface.
if the bytes are numberd as 0, 1 , 2, and 3 - I need to swap 0 and 3, 1 and 2.
that is: to start with 0/1/2/3 and to end with 3/2/1/0.
can someone help how to do that for each 32 bits?
08-22-2015 10:43 AM
Can you give an example of the data message coming from the instrument? My initial thought is to just use Unflatten From String with a U32 (or I32) as the data type and the Endianess set to Little Endian.
08-22-2015 10:53 AM
The data set is simply the trace of the OSA.
1001 numbers such as -45.26 for example.
08-22-2015 11:30 AM
I attach an image of my proposed solution?
I found split and joing function for high and low byts or word - so I split, swap and rejoin in reverse.
what do you think?
08-22-2015 11:56 AM - edited 08-22-2015 11:57 AM
Ah, so it is just an array of SGL data coming from the instrument. Here is what I propose
08-23-2015 02:59 AM
none of the above works.
I'm very high exponnets numbes (E+8).
Any suggestions?
08-23-2015 05:53 AM
08-23-2015 08:46 PM
@Albert.Geven wrote:
Is that floating point constant that you show in your jpg a double or a single?
I can't see from the jpg but it makes a big difference in values.
Let's clarify this a little more. A SGL (Single Precision Floating Point) uses 32 bits to represent a number. A DBL (Double Precision Floating Point) uses 64 bits. So when you convert to your floating point, make sure you are using SGL, just like I did in my snippet earlier.