Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Who can help me out?

I am using LV6.0 to communicate with a microcontroller. I can get data from the controller. Because each data is 10 bits and is divided into two words (higher/lower) to send/recieve. My question is how to put the higher and lower words together in the Labview after recieving them? Decimate arry may be helpful. But I cannot use it because the array is a dynamic one.
0 Kudos
Message 1 of 4
(3,223 Views)
Do you just want the number? If so, take the higher word and multiply by 2^5 and add the lower word. This will give you the number that the 10 bits represent.

Another method would be to rotate each bit into a variable (see Functions->Advanced->Data Manipulation->Rotate Left With Carry).

Is there another way of looking at the data that you are interested in? Just ask away.

Rob
0 Kudos
Message 2 of 4
(3,223 Views)
Hi Rob

Maybe my question is not clear. The numbers are in a serieal stream. It may be called a dynamic array. So my question is how to pick up the higher word and lower word from the stream. Then I can, as you said, multiply the higher by 256 and add the lower word.

Thanks,

Haodage
0 Kudos
Message 3 of 4
(3,223 Views)
I have attached a vi that will turn a bit array into a byte array. You should be able to use something similar to extract your numbers as long as you know where in the bit stream the numbers start. You may have to scan for a start sequence or some such to know where the number is. the secret here is knowing what to expect.

Rob
0 Kudos
Message 4 of 4
(3,223 Views)