07-13-2008 06:16 PM - edited 07-13-2008 06:19 PM
07-14-2008 06:44 AM
cube404,
I have to admit I don't know much about the base package. I would hope the something as simple as a numeric conversion would be in all packages.
07-14-2008 10:45 AM
07-14-2008 12:58 PM
07-14-2008 01:55 PM - edited 07-14-2008 01:56 PM
Unsigned U16 has a data range of 0 - 65535. Signed I16 has a range of –32,768 to 32,767.
Done correctly, unsigned integer ( U16 ) = 65535 converts to a signed integer ( I16 ) = -1. Both of these numbers are represented by a binary 1111111111111111. The only difference between signed and unsigned is how the binary number is interpreted. If it is a signed integer and the most significant bit is a one, then you know you are dealing with a negative number. To get the value of that negative number you must perform a two's compliment. The NI function does all this automatically.
07-14-2008 03:40 PM
Thanks centerbolt and everyone else that chipped in...
That did work for me and I believe the I16 will be big enough to handle the data I'm expecting. I was converting the data to a I32 because the data registers being written to are the signed 32-bit registers. I definitely didn't have the added time to re-write the drivers to read it in as I32 instead of the U8 array and then decode and type cast it to a I16 as the modbus receive drivers are doing.
07-16-2008 12:37 AM - edited 07-16-2008 12:38 AM
07-16-2008 12:53 AM - edited 07-16-2008 12:55 AM
09-10-2010 10:18 PM
Hello!Can you contact me?250332583@qq.com,I have some questions to ask you ,thanks!
09-11-2010 12:05 AM