LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI 9205 give input results in a 10 bit format

Hello:

 

I am using LabView 2012, NI 9205 to read a voltage value of potentiometer. I set up the NI 9205 to give the data out as a DOUBLE so i do not have to convert to voltage value. Now I also need the same data result in a 10 bit format. I can not change the data as a DOUBLE because I use it in another part of the program.

Any ideas of what can I do bisaid converting the voltage to a 10 bit format.

0 Kudos
Message 1 of 2
(2,210 Views)

@Toro wrote:

Hello:

 

I am using LabView 2012, NI 9205 to read a voltage value of potentiometer. I set up the NI 9205 to give the data out as a DOUBLE so i do not have to convert to voltage value. Now I also need the same data result in a 10 bit format. I can not change the data as a DOUBLE because I use it in another part of the program.

Any ideas of what can I do bisaid converting the voltage to a 10 bit format.


Perhaps I am misunderstanding what you want to do, but a "DOUBLE" number can be displayed however you want.  There is no "converting" persay.  Only how you want it represented.

 

For example:  Decimal value [123] is the same as binary number [0001111011] with 10 bits.  They are both "doubles" technically. (Well you could even argue they are "INTS".  But assume you have them as a LabVIEW double ).

 

I can only think of two possible ways you need the have this in "10 bit" format (as you call it). 

 

  1. First, perhaps you need it as an array or string of 1's and 0's within the code for some reason.  If so, you will likely need to convert the double into another data type.

  2. Second, you need to output the data in this format (either to the front panel or a file).  For this, you DO NOT need to convert the data from the double.  You can just modify the Indicators on the front panel or use a format code to interpret the double as a binary number.

Please let me know more exactly what you want, and I can help you get a solution! 😄  (Even if it is much different than the likely examples listed above.)

 

*Note:  It should also be noted that doubles in LabVIEW can hold more than 10 bits of data...

 

 

TerminalNumeric Data TypeBits of Storage on DiskApproximate Number of Decimal DigitsApproximate Range
         
Double-precision, floating-point 64 15 Minimum positive number: 4.94e–324

Maximum positive number: 1.79e+308

Minimum negative number: –4.94e–324

Maximum negative number: –1.79e+308
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If someone helped you out, please select their post as the solution and/or give them Kudos!
0 Kudos
Message 2 of 2
(2,202 Views)