Hello all,
I am using an analog input value that I load into a register to do some calculations with. I'm having an issue where the first 32,767 counts give me a positive number when i load it into a register but starting at AI[]=32768 the value in the register is -32768 and as the analog value increases further the value loaded into the register counts toward zero from -32768. I'm guessing this has something to do with the register being set as a signed integer but have no clue how to fix it. using r-30ib handling tool. Is there a way to make it where these negative values don't show up?
Any input is much appreciated! thanks!
half Analog input range is negative when loaded into register to do calculation
-
robot take over -
September 16, 2015 at 6:37 PM -
Thread is marked as Resolved.
-
-
This is kind of a hack, but try adding 0.1 during the register assignment. This should cast it to a float, which can take much larger numbers.
-
Thanks for the suggestion nation, I gave it a try and I still get the same issue. I also tried to divide the analog value by 100 to make it smaller which failed as well.
-
-
It works on my end too! Thats interesting that mixed logic handles it correctly.
Thanks for taking the time to help me out Nation. I really appreciate it. -
Somewhat off topic, but what kind of analog input card are you using?
I recently tried to order the 16 bit model a i/o card and was told that they don't offer one, even though it's in their manuals with a part number.
This leaves you with the 12 bit card, which limits the resolution to +-2000. When you have a nice analog sensor, it kinda sucks... -
I use a Numatics G3-3 valve manifold that has input modules. I map it over ethernet IP scanner connection.
-
How are you transmitting an analog signal over a digital protocol? Are you using group i/o?