Jump to content


Photo
- - - - -

analog scaling problems


  • Please log in to reply
4 replies to this topic

#1 sparkotronic

sparkotronic

    Sparky

  • MrPLC Member
  • PipPipPip
  • 100 posts
  • Gender:Male
  • Location:Scotland
  • Interests:Music, Music, Music and the occasional book. Often at the same time.
  • Country:Scotland
    Scotland

Posted 20 November 2009 - 04:13 PM

Hi

I'm trying to change a project in my workplace.
I need to replace an existing analog input card with an analog in/output card on a Siemens S300 PLC.

The problem is that the input signal is 4-20mA but the I/O card reads 0-20mA.

Does anyone have any idea of some code that will turn the 0-20 into 4-20 so that I can integrate it into the original program?

Thanks in advance, Colin

#2 slcman

slcman

    Sparky

  • MrPLC Member
  • PipPipPip
  • 331 posts
  • Gender:Male
  • Country:Canada
    Canada

Posted 22 November 2009 - 10:14 AM

You may use FC105 in standard library -> TI-S7 Converting block

For see library, clic in menu bar View -> Overview

Attached Thumbnails

  • Capturer.JPG

------------------------------------------------------------------------------------------------------------------------------------------------------------
SLCMAN

#3 sparkotronic

sparkotronic

    Sparky

  • MrPLC Member
  • PipPipPip
  • 100 posts
  • Gender:Male
  • Location:Scotland
  • Interests:Music, Music, Music and the occasional book. Often at the same time.
  • Country:Scotland
    Scotland

Posted 22 November 2009 - 02:26 PM

You may use FC105 in standard library -> TI-S7 Converting block


I did think about that, but the result of FC105 is in real form.
To integrate it into the original program, I need it to be in integer format as the program has a custom built scaling block which turns 4-20mA into Degrees celcius.

Someone suggested FB450, I've been told that this is a Siemens standard block for converting 0-20mA into 4-20mA and FB451 is to go the other way.

#4 JesperMP

JesperMP

    Guru

  • MrPLC Member
  • PipPipPipPipPip
  • 784 posts
  • Location:Copenhagen
  • Country:Denmark
    Denmark

Posted 23 November 2009 - 10:06 AM

Hi Colin

FC105 SCALE is recommendable.
The FC105 assums that the native analog range of the input module is used.
You can easily trick FC105 to account for the difference between 4-20mA and 0-20mA, by changing the minimum scaled value by minus 25% of the full range.
Example: 4-20mA = 0-100 degr.C --> FC105 minimum = -25 degr. C

To change to an Integer, use the RND function.
Be sure that the INT value can span the converted REAL value.
Simple example:
L "rVal"
RND
T "iVal"

edit: You can probably use the same principle of offsetting the minimum value with the custom scaling block.

Edited by JesperMP, 23 November 2009 - 10:06 AM.


#5 sparkotronic

sparkotronic

    Sparky

  • MrPLC Member
  • PipPipPip
  • 100 posts
  • Gender:Male
  • Location:Scotland
  • Interests:Music, Music, Music and the occasional book. Often at the same time.
  • Country:Scotland
    Scotland

Posted 25 November 2009 - 12:27 AM

Hi Colin

FC105 SCALE is recommendable.
The FC105 assums that the native analog range of the input module is used.
You can easily trick FC105 to account for the difference between 4-20mA and 0-20mA, by changing the minimum scaled value by minus 25% of the full range.
Example: 4-20mA = 0-100 degr.C --> FC105 minimum = -25 degr. C

To change to an Integer, use the RND function.
Be sure that the INT value can span the converted REAL value.
Simple example:
L "rVal"
RND
T "iVal"

edit: You can probably use the same principle of offsetting the minimum value with the custom scaling block.


Thanks for the reply.

A very nice person on another forum gave me a bit of code that works great with the exsisting scaling block.

Thanks for the help, I'd be lost without the internet and all you great folks!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users