Announcement

Collapse
No announcement yet.

Better analog resolution with DL06

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts


  • Better analog resolution with DL06

    I have a f0-04ad-1 I am playing around with. I am feeding it a 4-20 signal from my flue process meter, and have all the inputs set right.
    I am trying to simulate a 0-150 psi pressure transducer I plan on adding to our application.

    The problem I am having is that the resolution after I do the scaling is in whole decimals, and I would much rather have it a little more precise, say down to 1/10's of a PSI, which should be no problem.

    I am using a ibox to load the values into v401,v402,v403, and v404.

    on the next rung, I have LD(401) ----> MUL(k150) ----> DIV(k4095) ----->OUT(V2010).

    The math works fine, but stores the number as a whole digit, and not a real.

    Any thoughts?? Thanks


  • #2
    try this

    LD V401
    MUL K150
    BIN // CONVERT BCD VALUE TO BINARY
    BTOR // CONVERT BINARY TO REAL
    DIVR R4095.0 // DIVIDE BY 4095.0 REAL
    OUTD V2010 // OUTPUT TO 32BIT V2010-V2011

    now look at V2010 in Data View as a REAL and you should be getting what you want
    There are 10 kinds of people in this world, those who know binary, and those who do not.

    Comment



    • #3
      Alternately, if you didn't want to use reals in your program (inline compares are gone), you could just change your MUL(k150) to MUL(k1500) to imply a decimal point. You will need to alter all your setpoints or alarm values etc. to match the implied decimal place, but most HMIs can be setup to do this transparently.

      Brian

      Comment



      • #4
        Originally posted by franji1 View Post
        try this

        LD V401
        MUL K150
        BIN // CONVERT BCD VALUE TO BINARY
        BTOR // CONVERT BINARY TO REAL
        DIVR R4095.0 // DIVIDE BY 4095.0 REAL
        OUTD V2010 // OUTPUT TO 32BIT V2010-V2011

        now look at V2010 in Data View as a REAL and you should be getting what you want
        When I scale my output to 20mA, simulating a output of 150psi, I get a v2010 of 0.9995116..... 12mA gives me 0.4999

        Comment



        • #5
          Originally posted by bfitz View Post
          Alternately, if you didn't want to use reals in your program (inline compares are gone), you could just change your MUL(k150) to MUL(k1500) to imply a decimal point. You will need to alter all your setpoints or alarm values etc. to match the implied decimal place, but most HMIs can be setup to do this transparently.

          Brian
          by changing to k1500... I see how I'm getting the extra decimal that I wanted. Now my next task is to convert over to a decimal from a BCD number.

          My mind has been shot as they switched me to third shift this week, and I', playing catch up/

          Comment



          • #6
            Originally posted by joe_haase View Post
            by changing to k1500... I see how I'm getting the extra decimal that I wanted. Now my next task is to convert over to a decimal from a BCD number.
            What do you need the "decimal" for??

            What Brian was hinting at is many HMI's, including the CMORE line can be set up to display a BCD number with the decimal point where you want it. While the decimal is "implied" in the PLC logic, the HMI numeric displays and numeric entry can have the decimal point showing to the operator just like it belongs there.
            Bob

            Comment



            • #7
              Working With Binary Data

              I am trying to do something similar with a F4-04AD-1 and I notice that you do a BIN conversion with the data from the sensor. If I load the data as binary

              LD K8200 (8 means read as binary)
              OUT V710 (Slot 2 on DL06)

              this will do away with the need for conversion, but when I go to do my scaling will I be doing it the same way.

              LD V401
              MUL K150

              BTOR // CONVERT BINARY TO REAL
              DIVR R4095.0 // DIVIDE BY 4095.0 REAL
              OUTD V2010 // OUTPUT TO 32BIT V2010-V2011

              Comment



              • #8
                Originally posted by Bob S BN View Post
                What do you need the "decimal" for??

                What Brian was hinting at is many HMI's, including the CMORE line can be set up to display a BCD number with the decimal point where you want it. While the decimal is "implied" in the PLC logic, the HMI numeric displays and numeric entry can have the decimal point showing to the operator just like it belongs there.
                I will be trying HMIMax with this setup. When I do the basic conversion using the built in scaling iBox, it only loads a whole number into the memory address. Since the card and the sensor can handle better resolution, I wanted to take advantage of it. I reworked the math and got my PT100 to show in the 100's of a degree, a big advancment over getting "68" degrees as a output.

                Originally posted by robertkeenan View Post
                I am trying to do something similar with a F4-04AD-1 and I notice that you do a BIN conversion with the data from the sensor. If I load the data as binary

                LD K8200 (8 means read as binary)
                OUT V710 (Slot 2 on DL06)

                this will do away with the need for conversion, but when I go to do my scaling will I be doing it the same way.

                LD V401
                MUL K150

                BTOR // CONVERT BINARY TO REAL
                DIVR R4095.0 // DIVIDE BY 4095.0 REAL
                OUTD V2010 // OUTPUT TO 32BIT V2010-V2011
                Why not just use the iBox to load the values into the DL06 as BCD, then do basic math with the BCD number instead of converting to real? I couldn't get the output correct by going with a real#.

                Comment

                Working...
                X