adccommunitymod (AutomationDirect) asked a question.

Analog Scaling help

Created Date: September 17,2007

Created By: 72hdflh

**** 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.****

This is my first analog project and I am learning as I go, So please forgive me if this is a stupid question. I have an analog infrared temperature sensor that is 0-10 vdc, I have the sensor scaled so that at 110 deg. F, I have 10 vdc and at 140 deg. F, I have zero vdc. With a 30 deg. span I divide 4095 by 30 I should have a value of 136.5 per deg.(Example;110 deg=4095,111 deg=3958,etc.) How can I use this data to view the actual temperature on my C-more HMI. Right now my raw value is in V 2001 and my filtered value is in V 2011, also this is a DL06 plc. I tried the ANSCL i-box with High Engineering set at 110 and Low Engineering set at 140, this worked O.K. at 4095 and 0 but the in between values do not come out right. Any help will be greatly appreciated. http://forum1.automationdirect.com/board/confused.gif


  • adccommunitymod (AutomationDirect)

    Created Date: September 17,2007

    Created by: KPrice

    Is this correct?

    0-10VDC input signal

    0-4095 raw value

    110.0 deg @ 10VDC

    140.0 deg @ 0VDC

    You want 1-decimal point temp

    You are using BCD

    Your equation could be:

    temp (xxx.x)=1400-((raw value*300)/4095)

    I included the correction for 1-decimal point. This could be into a BCD math I-box.

    Using standard instructions, your code could be:

    LD raw value

    MUL K30

    MUL K10

    DIV K4095

    OUT mx value

    LD K140

    MUL K10

    SUB mx value

    OUT Temp (xxx.x)

    I used seperate instructions to correct for the 1-decimal point. I have not yet tried the ANSCL i-box. I do not know if the ANSCL i-box can handle the neg slope. You could then display the temp (BCD) on the C-more showing the 1-decimal point. Does this work for you?

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: September 17,2007

    Created by: 72hdflh

    KPrice,

    Yes, This info is correct.

    0-10VDC input signal

    0-4095 raw value

    110.0 deg @ 10VDC

    140.0 deg @ 0VDC

    You want 1-decimal point temp

    You are using BCD

    The code that you posted works but only in reverse with a value of 4095 I am reading 139.4, if I drop the decimal I get 140.

    Thanks for the help.

    I should also add 10VDC = 4095

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: September 17,2007

    Created by: KPrice

    I assume (which gets me in trouble) that you have the sensor connected, the PLC is in RUN, and you 're monitoring the (2) v-memory locations in a Data View? You see "4095 " in the "raw value " v-memory location, and "1394 " in the "Temp (xxx.x) " v-memory location? Could there be any other lines of code that are writing to the (3) v-memory locations "raw value ", "mx value ", or "Temp (xxx.x) "? Also, I'm curious that the senor seems to be going full-scale or out-of-range. Could there be a problem causing the signal to go out-of-range? Do you ever get the "raw value " to be, say, 3/4 range (3071)?

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: September 17,2007

    Created by: 72hdflh

    KPrice,

    "I assume (which gets me in trouble) that you have the sensor connected, the PLC is in RUN "

    Yes

    "You see "4095 " in the "raw value " v-memory location, and "1394 " in the "Temp (xxx.x) " v-memory location? "

    Yes

    "Could there be any other lines of code that are writing to the (3) v-memory locations "raw value ", "mx value ", or "Temp (xxx.x) "? "

    I don't think so?

    I am at full scale at 110 degrees F or less, I am not sure if it maybe going out of range, if it is I never see it go past 4095 in the Data View. I am testing it with a flame, which with scaling in the sensor that I have (110-140 degrees) it is pretty much 4095 to 0, but even with the flame in front of the sensor I never see 0 in Data View,it only goes to about 5, so I am not seeing anything in between. I am going to try to email you a pdf of my short little piece of code and a screenshot of Data View.

    Thanks for your help.

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: September 17,2007

    Created by: KPrice

    I received your email and attachments. And I will review.

  • adccommunitymod (AutomationDirect)

    Created Date: September 17,2007

    Created by: KPrice

    I will send you an email with some more detail. But for the purposes of this forum, I found that the V-memory location that was used for the "mx value " was also used by one of your unused analog input points and was being over-written by the unused analog input point value. The small value (caused by noise on the open connections) caused the miscalculation.

  • adccommunitymod (AutomationDirect)

    Created Date: September 18,2007

    Created by: 72hdflh

    I replaced V2003 with V2011, with a value of 4095 in V2001 I am getting a value of 6 in V2011 in Data View. In C-more with a value of 4095 in V2001 I am still reading 139.4 and when I put the flame in front of the sensor I will get a value of 5 in V2001 and C-more is showing 140.0.

    The code that I have for the analog out seems to work as far as giving me 4-20ma out, verified with my VOM. It looks like my biggest problem is getting the readout on the C-more to display properly.

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: September 21,2007

    Created by: 72hdflh

    I got it solved by eliminating the MUL K10 and changing the MUL K30 to MUL K300. Works perfectly now.

    Thanks

  • adccommunitymod (AutomationDirect)

    Created Date: September 21,2007

    Created by: Bob S BN

    to: 72hdflh

    Do you still have the round tube swingarm with drum brake or did you switch to rect. tube and a gma disk setup??

    Yes, I rode one for 10 years.

    Good luck with your project, Bob

  • adccommunitymod (AutomationDirect)

    Created Date: September 21,2007

    Created by: 72hdflh

    To Bob S BN

    When I got the bike the Drum was in bad shape so I changed to the rectangular swingarm and I used the stock style banana caliper.

    Thanks

    Joe

10 of 11