09-14-2015 01:56 AM
Im using LabVIEW to read data coming into a serial port and I am having trouble figuring out how to convert the bytes being read.
So, I am reading in 48 8-bit bytes, where every 2 8-bit bytes form a 16-bit integer, where the least significant byte is coming in first.
For example. The first byte is 10110110, the second is 01111011 to form 01111011 10110110.
From the 48 bit bytes, I need to get 24 16-bit integers?
Any ideas?
Solved! Go to Solution.
09-14-2015 02:16 AM - edited 09-14-2015 02:19 AM
Hi sout,
try this:
The right part shows two methods of converting the received string to meaningful data, using TypeCast or DeserializeString.
(When the byte order is different than needed you can wire a constant at DeserializeString or use SwapBytes after the TypeCast…)
09-14-2015 02:54 AM
Cool thanks, i will try that.
From there, How would i extract each individual I16-bit integer. For example the first value would be Vin, the second Vout, etc and I want to display each value seperately?
09-14-2015 03:12 AM
Hi sout,
you get an array of integer values. To index certain elements from your array you should use IndexArray…
When you have a fixed set of data you could TypeCast into a cluster. This cluster needs to be defined according to your datastructure. When doing so you could use UnbundleByName instead…