LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

is there a way to convert decimal or hexadecimal string to bcd on labview 8.0 or 7.1??

i am trying to convert user input data to bcd data. is there a way to do this besides converting each individual data bit to binary?
0 Kudos
Message 1 of 4
(4,817 Views)
How do you want the data represented in memory? Because the BCD code only takes 4 bits there are several options:
  1. One byte per digit with the unused bits set to zero
  2. One byte per digit with the unused bits set to ones (hardly anybody does this anymore)
  3. Two digits stored in each byte
Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 4
(4,812 Views)
I'd go with option 3 please
0 Kudos
Message 3 of 4
(4,789 Views)
Hi kukla,

have you tried the very easy formula bcd = 16* number2 + number1 ???
Number1&2 should ofcourse not exceed the range of 0 to 9, as you work here with decimal numbers...
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 4
(4,782 Views)