Sign in to follow this  
Followers 0
Conor

SCl instruction in an SLC

14 posts in this topic

Hi guys, I was wondering if someone can explain the SCl instruction to me please. I don't really understand (can't get my head around) the explaination in the help files. I have attached a doc with a rung of code that I am trying to figure out. The help file says; Scaled value = (input value * rate) + offset Rate = (scaled max - scaled min) / (input max - input min) Offset = scaled min - (input min - rate) What is the scaled max/min What is the input max/min? I have a 4 - 20 mA signal. I have sourced this to the PLC (with Fluke 707 meter). 4 mA is 4000 and 20 mA is 20000. My processor is a 1747-L532E My Analogue input card is a 1746-NI8. Thanks, Conor comp_plc_scl.doc

Share this post


Link to post
Share on other sites
Conor, please take a look to the SLC Reference Manual, starting page 4-15...there are extended informations and examples that can help you to understand the SCL instruction. - fuzzy logic

Share this post


Link to post
Share on other sites
Grettings Conor. One of our forum members, Ron Beaufort, has posted an excellent tutorial about scaling on his web site. http://www.ronbeaufort.com/ On the left hand side click sample lessons. Scroll down to Scaling with y=mx+b parts 1 and 2. Ron covers the math behind scaling and in a down to earth and easy to comprehend way and exposes the workings of the SCL and SCP instructions. BTW, if you are using a Micrologix or any SLC besides the SLC5/01 or /02 the the SCP instruction is easier to apply.

Share this post


Link to post
Share on other sites
Thanks for your replys guys. Alaric, Its funny you mention the SCP instruction. I only posted a question on that last week. I am ok with that instruction, but I was just trying to get a handle on the rung of code that I had attached to the orignal post in this thread. The program I am trying to get my head around is on a compressor, and I have inherited it off a machine builder. One of my biggest gripes with some of these guys is that they don't comment code enough. I firmly believe that some programmers have their heads up their a*s. Just because they understand it, doesn't mean that everybody will. My two big pet hates at the mo are, No comments and No code change docs. It is so easy to do and saves everyone time in the long run. Sorry for the rant guys. Thanks again Conor

Share this post


Link to post
Share on other sites
Going beyond understanding the SCL instruction, why did the orginal programmer scale the same input to two different scales?

Share this post


Link to post
Share on other sites
Possibly 2x different units, from the same value? -100 to +100 & 0-100% ? That is what the values it the SCL instructions are calculating, to 1dec place of course... I have seen this done before, for different reasons...

Share this post


Link to post
Share on other sites
He has done that with all of the Analogues. I think that he is using one for control in the PLC and one for display on an HMI, but when one is not doing anything in the control, he still has the two SCL's.

Share this post


Link to post
Share on other sites
Hi guys, Correct me if I am wrong please. Rate : 31.25 Offset : -125000 In Max : 20000 In Min : 4000 Max Out: 50 Min Out : 0 This is for a pressure transducer, 4 - 20 mA, 0 - 50 mBar Also, thanks to lostcontrol for your help Thanks again. Conor

Share this post


Link to post
Share on other sites
See picture and text below. This is why the SCP instruction is so much better (easier) SCL.txt Edited by Mickey

Share this post


Link to post
Share on other sites
Yep, but this instruction is not available in all Processors...

Share this post


Link to post
Share on other sites
See picture also add the ML1100 to the list. Most but not all. In the OP's case his SLC5/03 does. Edited by Mickey

Share this post


Link to post
Share on other sites
Thanks Mickey, I did a ML1100 recently, and used the SCL, not knowing that the SCP was available. It is right at the end of the instruction selection in my RS500 anyway.... I will now know for next time!!

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