LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

getting a total 16 bits binary value using low byte and hi byte

Hello everyone,

 

I am getting confused for a not very difficult question!!

In fact, In my labview program, I have 2 binary values (each one 8 bits). They are respresenting low byte and hi byte.

I want to get a total value over 16 bits using these two bytes.

 

Ex. I have 11111111 (or 255 in decimal) and 01111111 (or 1 in deciaml). And Î want to obtain 256 in total!

Using C language, I can easily use the follwoing expression:

TOT_VALUE=( ( (unsigned int) hi-byte) <<8) | (low_byte)

 

In labview, It doesnt work.

Thank you for your help.

0 Kudos
Message 1 of 3
(2,423 Views)

- You might want to change your hi-byte from I-8 into a I-16             11111111 => 0000000011111111

- You might want to change your lo-byte from I-8 into a I-16              01111111 => 0000000001111111 => (is this 1?)

- Add both numbers

=> result!!!

 

Kind regards,

- Bjorn -

Have fun using LabVIEW... and if you like my answer, please pay me back in Kudo's 😉
LabVIEW 5.1 - LabVIEW 2012
0 Kudos
Message 2 of 3
(2,419 Views)

Duplicate Post.

 

Don't start a new thread for the same question.  You were already being helped in the previous thread.

Message 3 of 3
(2,414 Views)