Sign in to follow this  
Followers 0
sparkotronic

analog scaling problems

5 posts in this topic

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

Share this post


Link to post
Share on other sites
You may use FC105 in standard library -> TI-S7 Converting block For see library, clic in menu bar View -> Overview

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0