From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

2 digit decimal to 12 bit binary

Hi

 I want to represent  a 2 digit number into 12 bit binary(boolean array of 12 bit)

ie. 14.4444 to 111111111111

      7.2222 to 100000000000

 

 

 

 Thanks in advance

 with regards 

DK

0 Kudos
Message 1 of 4
(5,348 Views)

Can you explain how to translate the number into boolean in detail?

0 Kudos
Message 2 of 4
(5,334 Views)

I want to Generate a 12 bit binary data on the DAQ card (which is having a 12 digital I/O)  for relation v=0.17404f-11.3191.  where f varies from 70 to 148 with decimal places 

0 Kudos
Message 3 of 4
(5,332 Views)

Ok, so 14.4444 is your max number.  So what you need to do is (V/14.444)*2^12 = (V/14.444)*4096 = V*283.5779562448, where V is your decimal number.  From there, you may have to do a round to make it a whole number of bits.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 4
(5,326 Views)