Help - Search - Members - Calendar
Full Version: analog scaling problems
Forums.MrPLC.com > PLCs and Supporting Devices > Siemens
sparkotronic
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
slcman
You may use FC105 in standard library -> TI-S7 Converting block

For see library, clic in menu bar View -> Overview
sparkotronic
QUOTE (slcman @ Nov 22 2009, 11:14 AM) *
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.
JesperMP
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.
sparkotronic
QUOTE (JesperMP @ Nov 23 2009, 11: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.


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!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.