News:

  • July 02, 2026, 07:41:31 PM

Login with username, password and session length

Author Topic: Signed Analog Inputs?  (Read 6006 times)

MarkTTU

  • Hero Member
  • *****
  • Posts: 293
    • SamJackson.com
Signed Analog Inputs?
« on: July 23, 2015, 12:43:25 PM »
Its been a long time coming, but I'm FINALLY starting on my first real world Do-more project. Trying to wrap my head around the logic behind having analog inputs go into a signed integer location automatically, but not actually be signed...

I have a F2-8AD4DA-1 card. All automagically configured and setup. If I look at WX0 this is what I see for different mA values I send to the card:

0mA = 0
4mA = 13,200
8mA = 26,325
12mA = -26,075
16mA = -12,960
20mA = -1

That sure seems to indicate that the analog card is placing an unsigned value into WX0, but Do-more is interpreting it as signed.

If I do a MapIO and just move all the WX points into V points then all is well and I get 0-65535 as I'd expect. What's odd to me is I don't have to cast the WX points as Unipolar, I can just do a MapIO WX0 -> V0 and it works. If I do explicitly state that WX0 should be cast as unipolar (ie WX0:u -> v0) it works just the same as if I don't cast WX0 as unipolar.

This isn't a show stopper or anything, but it seems really really screwy to me. I would have expected the signed values in WX0 to look more like this:

0mA = -32,767
10mA = 0
20mA = 32,767

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6164
  • Yes Pinky, Do-more will control the world!
Re: Signed Analog Inputs?
« Reply #1 on: July 23, 2015, 10:03:04 PM »
WX and WY memory are signed. We don't always know what is going on with the analog modules, given that many have jumper configurations. Future platforms won't struggle with such issues. All of the configuration will come from the PLC, and the PLC will "know" how the analog is configured.

In the meantime, it is completely appropriate to cast WX or WY to unipolar. You can actually document WXn:U, and then every time you reference the associated nickname, you will get the cast without having to expressly enter it.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO