adccommunitymod (AutomationDirect) asked a question.

Divide RTD Temp Reading

Created Date: January 16,2009

Created By: twitte

**** 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 fairly basic question which I can't solve. How can I divide my RTD card reading (F2-04RTD) by 10 so I can properly display it on my HMI. I tried using LD (vmemory of reading) DIV (k10) and OUT (new v memory), but this did not work. Any help would be great. Thank You Tyson


  • adccommunitymod (AutomationDirect)

    Created Date: January 17,2009

    Created by: KPrice

    twitte, A couple of questions come to mind,

    Did you setup the data format for binary or BCD?

    You may need to use double-word instructions with BCD format.

    The DIV instruction is a single-word BCD instruction.

    Is your temperature value negative?

    Could you be over-writing the V-memory location that holds your calculated temperature?

    Have you tried the SHFR K4 instruction to remove first digit?

    Your HMI may have a scaling feature available with your numeric display object.

    Do any of these ideas this help?

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: January 19,2009

    Created by: twitte

    Thanks for the suggestions.

    Right now I have it set up for binary numbers, I will try changing it to BCD. I will also try removing the first digit with the command you listed. When I tried dividing before I was using a new v memory location. All my reading are unipolar. I realized you can scale on the HMI for some situations, but not for all situations, like the graph feature on the CMORE.

    Thank You

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: January 19,2009

    Created by: a agnone

    Yes, do it in BCD. I just used the ladder from the book and then used a Display Numeric in the C-More. Works just fine.

  • adccommunitymod (AutomationDirect)

    Created Date: January 21,2009

    Created by: JimHoward

    twitte,

    Following is my method of working with the F2-04RTD module. Display the result V2010 on your HMI as real, as it will show both positive and negative temperatures.

    PLC 260

    // Rung 1

    // Address 0

    #BEGIN COMMENT

    "First, the raw RTD data is 15 bit Binary, with a " "sign bit " ", in the format " "magnitude plus "

    "sign " ". The sign bit is masked off with the ANDD function, before the Binary data word is "

    "converted to Real. As the data is in tenths of degrees, divide by 10 for whole degrees. "

    #END

    STR SP1

    LD V2000

    ANDD K7fff

    BTOR

    DIVR R10

    // Rung 2

    // Address 8

    #BEGIN COMMENT

    "Second, if the sign bit is ON (which indicates a temperature below zero), multiply the "

    "above real temperature data by -1 to make the real temperature data negative. "

    #END

    STR B2000.15

    MULR R-1

    // Rung 3

    // Address 13

    #BEGIN COMMENT

    "Third, filter and smooth the real temperature data, which helps reject any noise induced "

    "into the field wiring. The filter simply takes the difference between the previous filtered "

    "data (scratchpad) and the current data, and multiplies it (MULR) by a " "filter factor " " (note, "

    "a smaller number increases the filtering) and adds/subtracts that to/from the previous "

    "filtered data. "

    #END

    STR SP1

    SUBR V2020

    MULR R0.2

    ADDR V2020

    OUTD V2020

    OUTD V2010

    // Rung 4

    // Address 21

    STRN SP0

    AND X50

    OUT C1000

    // Rung 5

    // Address 24

    NOP

    #BEGIN ELEMENT_DOC

    "X50 ", "XMTR_RTD-1 ", " ", "Broken XMTR, RTD Input - Base0/Slot2/Ch1 "

    "C1000 ", "XMTRRTD1 ", " ", "Broken XMTR, RTD Input - Base0/Slot2/Ch1 "

    "V2000 ", "_RTD-1 ", " ", "Raw RTD Input - Base0/Slot2/Ch1 (Binary) "

    "V2010 ", "RTD1 ", " ", "Air Inlet Temperature (Filtered, Real) "

    "V2020 ", "__RTD-1 ", " ", "Scratchpad RTD Input - Base0/Slot2/Ch1 (Real) "

    "B2000.15 ", "Sign_RTD-1 ", " ", "Sign Bit, Raw RTD Input - Base0/Slot2/Ch1 "

    #END

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: January 16,2009

    Created by: twitte

    I have a fairly basic question which I can't solve. How can I divide my RTD card reading (F2-04RTD) by 10 so I can properly display it on my HMI. I tried using LD (vmemory of reading) DIV (k10) and OUT (new v memory), but this did not work. Any help would be great.

    Thank You

    Tyson

    Expand Post