LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

angle from degrees to a 14 bit BCD format

Solved!
Go to solution

I need to convert an angle from degrees to a 14 bit BCD format. i.e. 0 degrees all 0's, 359.99 degrees all 1's. What is the best way to go about this?

0 Kudos
Message 1 of 3
(2,235 Views)
Solution
Accepted by topic author venturer

Hi venturer,

 

angle(BCD14) = convert-to-u16( remainder( angle(degree) / 360 ) * 16384 )

 

Simple math, isn't it?

 

Btw.

This isn't called BCD. It's just a different number range (0-16383) for the same meaning (0-359.99°)...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 3
(2,234 Views)

Hi venturer,

 

one small correction: you have to divide by 360 once:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 3
(2,231 Views)