adccommunitymod (AutomationDirect) asked a question.

Scaling analog signals

Created Date: January 24,2005

Created By: Justin27

**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****

I have a 250-1 in a local rack. I set up an analog input module for binary and 4 channel input. LD K8400 OUT V7663 LDA O4500 OUT V7673 I then entered this rung LD V4500 BTOR DIVR R 4.095 RTOB OUT V5000 I wanted to scale my analog input to 0-1000 representing 0-100%. When I vary the input from 0-10 VDC the data in V5000 will not track the full range of the data in V2000. I found I had to add a MULR R1 between the BTOR and the DIVR R4.095 to get V5000 to track V2000. Does this make sense? I don’t understand the MULR R1 Justin


  • adccommunitymod (AutomationDirect)

    Created Date: January 24,2005

    Created by: Justin27

    I have a 250-1 in a local rack.

    I set up an analog input module for binary and 4 channel input.

    LD K8400

    OUT V7663

    LDA O4500

    OUT V7673

    I then entered this rung

    LD V4500

    BTOR

    DIVR R 4.095

    RTOB

    OUT V5000

    I wanted to scale my analog input to 0-1000 representing 0-100%.

    When I vary the input from 0-10 VDC the data in V5000 will not track the full range of the data in V2000.

    I found I had to add a MULR R1 between the BTOR and the DIVR R4.095 to get V5000 to track V2000.

    Does this make sense?

    I don't understand the MULR R1

    Justin

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: January 24,2005

    Created by: ericn

    Why bother using real numbers? The example in the analog manual should work just fine. Assuming your 0-4095 value is in V4500, then:

    LD V4500

    MUL K1000

    DIV 4096

    OUT V5000

    -Eric

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: January 24,2005

    Created by: marksji

    Originally posted by Justin27:

    Does this make sense?

    I don't understand the MULR R1

    Not really, but I agree with Eric, don't bother with real numbers, your not gaining anything using them.

  • adccommunitymod (AutomationDirect)

    Created Date: January 25,2005

    Created by: JimHoward

    Justin,

    Based on your description, I'm assuming you are using an F2-04AD-2 (4 channel, analog voltage input module, capable of 0-10 VDC inputs).

    When the raw data is brought in (Ch.1 - V4500, Ch.2 - V4501, Ch.3 - V4502, Ch.4 - V4503) as Binary; there is "extra baggage " in the form of the module diagnostic bit, and the sign/failure bit; that should be stripped off the raw data before you perform any calculations. Here's how I'd do it:

    PLC 250(-1)

    // Rung 1

    // Address 0

    STR SP1

    LD V4500

    ANDD Kfff

    BCD

    MUL K1000

    DIV K4095

    OUT V5000

    // Rung 2

    // Address 8

    STRN SP0

    AND B4500.15

    OUT C1000

    // Rung 3

    // Address 12

    STRN SP0

    AND B4500.14

    OUT C1001

    // Rung 4

    // Address 16

    END

    // Rung 5

    // Address 17

    NOP

    #BEGIN ELEMENT_DOC

    "C1000 ", " ", " ", "Sign Bit or Channel Failure, Analog Input - Slot 3, Ch.1 "

    "C1001 ", " ", " ", "Electrical Noise, Analog Input - Slot 3, Ch.1 "

    "V4500 ", " ", " ", "Raw Analog Input - Slot 3, Ch.1 (Binary) "

    "V5000 ", " ", " ", "Scaled Analog Input - Slot 3, Ch.1 (BCD), 0 - 100.0% "

    "B4500.14 ", " ", " ", "Electrical Noise, Analog Input - Slot 3, Ch.1 "

    "B4500.15 ", " ", " ", "Sign Bit or Channel Failure, Analog Input - Slot 3, Ch.1 "

    #END

    The ANDD lets only the lower 12 bits pass through to the "scaling math ". The binary data must be converted to BCD before you use the MULT and DIV. The output of this "scaling math " is a BCD number.

    Note, that in my documentation description I include the data type (Binary)(BCD), so I don't mix-up the data types.

    In your example, the "sign bit/channel failure bit " should never come on, as you have a 0-10 VDC (unipolar) voltage signal. Also, the "electrical noise bit " should never come on. The NOT SP0 simply disables the alarm bits (C1000 & C1001) for one scan, as they are not reliable for the 1st scan.

    Good luck with your project.

    Jim

    Expand Post