Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

data conversions in labview

I need an example of a simple labview module that will read in data from the modem, parse it into separate bins, and save. The data coming into the modem is binary or hex, I need to convert the data to decimal values and then further convert some of the values to degrees by multiplying by some constant. I need these values saved in some output file. As of now, the information is being stored as ascii which isn't helpful. Can you please help me with conversions. Thank you.
0 Kudos
Message 1 of 4
(2,963 Views)
There's several methods to convert ASCII to numerics. There's Scan From String, String to Byte Array, type casting, etc. The exact method used will depend on what your string actually is. Can you post an example? For converting hex, see this post. For other examples, try doing a search of the forum. Numerous questions and examples on this subject have been posted.
0 Kudos
Message 2 of 4
(2,956 Views)
I have the same problem when receiving a binary (28 byte stream) from a Network Analyzer (HP 8573). My GPIB Read outputs the following string - in hex format: '2341 0018 3DAE 7000 3E90 9400 03DB A000 3E90 BA00 3DB1 4000 3E90 6600'.

The first 2 bytes is the header '#A', the next two is the length of the data, 0018 = 24 bytes of data. Then the following bytes are complex single precision floats (4 bytes each for real and imaginary parts).

So this data stream has a header (2), the data count (2), and 3 data points ((4,4)x3)(each having a real and imaginary part).

How would I pull out a decimal representation from this? I must admit I am not very familar with type casting or 'flattening data'.

Thanks,

Chris
0 Kudos
Message 3 of 4
(2,898 Views)
Duplicate post.

If you look at your original post, you would see that I mentioned a driver and asked which progamming language you use. If you want an example, you have to provide that. No one here knows whether you're using LabVIEW, CVI, Visual Basic, C++, Fortran, etc.
0 Kudos
Message 4 of 4
(2,893 Views)