Forums.MrPLC.com: analog scaling problems - Forums.MrPLC.com

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

analog scaling problems Rate Topic: -----

#1
User is offline   sparkotronic 

  • Sparky
  • PipPipPip
  • Group: MrPLC Member
  • Posts: 100
  • Joined: 29-July 05
  • Gender:Male
  • Location:Scotland
  • Interests:Music, Music, Music and the occasional book. Often at the same time.
  • Country:Scotland
    Scotland
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
0

#2
User is offline   slcman 

  • Sparky
  • PipPipPip
  • Group: MrPLC Member
  • Posts: 331
  • Joined: 24-March 05
  • Gender:Male
  • Country:Canada
    Canada
You may use FC105 in standard library -> TI-S7 Converting block

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

Attached thumbnail(s)

  • Attached Image: Capturer.JPG

------------------------------------------------------------------------------------------------------------------------------------------------------------
SLCMAN
0

#3
User is offline   sparkotronic 

  • Sparky
  • PipPipPip
  • Group: MrPLC Member
  • Posts: 100
  • Joined: 29-July 05
  • Gender:Male
  • Location:Scotland
  • Interests:Music, Music, Music and the occasional book. Often at the same time.
  • Country:Scotland
    Scotland

View Postslcman, on Nov 22 2009, 11:14 AM, said:

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

#4
User is offline   JesperMP 

  • Guru
  • PipPipPipPipPip
  • Group: MrPLC Member
  • Posts: 784
  • Joined: 03-May 05
  • Location:Copenhagen
  • Country:Denmark
    Denmark
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.

This post has been edited by JesperMP: 23 November 2009 - 10:06 AM

0

#5
User is offline   sparkotronic 

  • Sparky
  • PipPipPip
  • Group: MrPLC Member
  • Posts: 100
  • Joined: 29-July 05
  • Gender:Male
  • Location:Scotland
  • Interests:Music, Music, Music and the occasional book. Often at the same time.
  • Country:Scotland
    Scotland

View PostJesperMP, on Nov 23 2009, 11:06 AM, said:

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

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users