LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Split data into high byte and low byte

I am trying to send a 6 byte signal to a camera. one of the commands requires me to split a hexadecimal number into high byte and low byte and send it to the camera. I tried to use the split number function in the advanced/data manipulation palette. When I do this I get the low byte correctly but the high byte shows 0. Can somebody please help me with this
0 Kudos
Message 1 of 5
(6,214 Views)
The reason is that the value sent to the split function is not a 16 bit number as it should be (to be splitted into two bytes), but an I32. It's the constant (50) that the angle is multiplied by that forces the type from U16 to I32, just change the type of that constant.

LabVIEW tries to indicate all this to you by placing small grey coercien dots at the terminals. If you look there are lots of them, e.g. on the hi and low byte indicators, this shows that the output of the split is not a byte.
Message 2 of 5
(6,214 Views)
That helped! Thanks a lot!

Hema
0 Kudos
Message 3 of 5
(6,214 Views)
Mads,
Thanks for the great answer.

I just wanted to add a quick comment/suggestion for Hema. You can change the color of the coercion dots from gray to a bright color. Making this change may help you see this type of thing in the future.

I use it to make sure that my code is as "clean" as I can make it. To change the color select Tools >> Options >> Colors and de-select the "Use default colors" checkbox. You can now change the color of the dots from gray to bright green for example.

This is just a tip that has helped me in the past.

Evan
Applications Engineer
National Instruments
0 Kudos
Message 4 of 5
(6,214 Views)
Thanks Evan for the tip. I will do that

Hema
0 Kudos
Message 5 of 5
(6,214 Views)