07-04-2011 10:32 AM
Hi,
I am trying to convert a general logging program written in Labview from outputting floating numbers to unsigned integers. I use the DAQmx read where I choose unscaled output(2D U16 NChan), the board is a PCI-6023E. I have the program running, but the output is somewhat odd. The input range is +/- 10 V. For positive voltages I get integers from 0 to 2047. For negative voltages I get integers from 2^16 - 2048 to 2^16. What I would like to have is of course 0 for -10 V and 4096 for 10 V. I have been looking through the different options in the DAQmx read etc. without any luck. If anybody has an idea that could shed some light on my problem it would be greatly appreciated.
Best regards
Pål Egil
Solved! Go to Solution.
07-04-2011 01:57 PM
The U16 type represents numbers as unsigned quantities. In particular, the I16 (signed integer) value -1, hex FFFF, is 65535. If you either save the values as I16 (assuming that's possible with your device) or simply convert them (using the Conversion sub-palette of the Numeric palette) to I16, I think you'll get what you expect.
Bob Schor
07-05-2011 04:28 AM
Saving as I16 instead of U16 works well, thank you! I then get the I16 value equal to 0 for 0V, -2048 for -10V and +2047 for 10V, so that is much better, the integer value for zero voltage I can easily change by introducing adding offset.Why labview doesn't start counting from 0 at the lower voltage level is still unclear to me, but I suppose its some default and not really important.
Thanks again!
Pål Egil