Sign in to follow this  
Followers 0
Mtech1

SCP instruction in RS500

9 posts in this topic

Question: I am controlling a analog output signal using a SCP instruction. The problem is I need to change the valve scaling under certain conditions. I have not tested this yet but is it possible to move a value to MIN/MAX on this instruction? The output min/max will always be 0-32760. If I couldn't move a value into this function I was considering using multiple SCP instruction with the required Min/Max following a EQU statement to keep things in check. With this said I would have say 4 SCP Instructions all scaled differently but have the same output. But only one SCP Instruction would be used at anyone given time which would be determined by the EQU statement. What kind of trouble would this possibly cause since the output is setup in another location even if it wasn't controlled in that instruction at the time. I'm sure this sounds confusing/sorry.

Share this post


Link to post
Share on other sites
If I remember right, the MIN and MAX values do not need to be a constant but can be an address, thus allowing you to change the value in that address if you wish.

Share this post


Link to post
Share on other sites
Sorry:I should post a example of what I am thinking with using the EQU statements. Condition 1 EQU 1 then a SCP Instruction in same rung with Min=0,Max=40 then 0-32760 and output AOut1(example) Condition 2 EQU2 then a SCP Instruction in this rung with Min=20,Max=80 then 0-32760 and output AOut1 Condition 3 EQU3 then Min=-20,Max=40 then 0-32760 w/AOut1 Then so on so forth. Min/Max numbers are just examples.The reason for the change is each condition is based off a number that changes the SCP instructions Input value. So to keep this value in alignment with where I need the valve output and to prevent the processor from faulting this the only why I can come up with ensuring things are controlled. But wanted to make sure about placing a output that is used in multiple locations. Hopefully this help clear up a few more thoughts. Thanks.

Share this post


Link to post
Share on other sites
All 4 entries, Input Min, Input Max, Scaled Min, Scaled Max can be registers instead of constant numbers. So you can, depending on your conditions, move different values to the registers you choose for these 4 entries. Better than what you show, changes could be made while running.

Share this post


Link to post
Share on other sites
Thanks for your reply. I was hoping that I could move values into this instruction.Just wasn't sure. Thanks everyone.

Share this post


Link to post
Share on other sites
Your method is just fine and is simple enough. You can also use an address for input min and input max and MOV a value into that address like LordZorak suggested - I'm not sure from your reply that you understood what he meant. A third option is to use indirect addresses and indexed addresses with the SCP instruction. mtech1_example.RSS

Share this post


Link to post
Share on other sites
This seems to be a point of constant confusion. An output address in a PLC program, be it a bit such as O:0/0 or an analog output word like O:1.0 is just a place in memory. Nothing more, nothing less. You can write to it and read from it as many times as you want to in the course of your program. Each time your program writes to that address it changes the value stored in it. At the end of the program scan the PLC will copy the value that is that memory location to the physical output hardware. The value in that memory address does not change until an instruction writes to it. Now lets look at your program you asked about in post 3. If you are using three separate SCP instructions to write to an address and only one rung can be true at a time then only that rung writes to that memory address. Using your prior posted values, lets say conditon=1 and the input is 20. The SCP will write 16380 to the output. The subsequent two rungs are false. Those SCP instructions do not execute because the rung is false and so they do not write any thing to the output. The 16380 value in the address remains unchanged. Where you may be getting confused is with the OTE ---( )--- instruction. This instruction is unique because it ALWAYS executes whether the rung is true or false. The OTE instruction is an IF-THEN-ELSE instruction. IF the rung is true then write a 1 to the address else write a 0 the address. In this case, if you use multiple OTE instructions addressed to the same address then each time one executes it will write a value in that memory address whether the rung is true or false. If the address is an address in the output image table, at the end of the program the PLC will copy the value in that address (which is the last value it was changed to) to the physical output. I hope that helps. Edited by Alaric

Share this post


Link to post
Share on other sites
Thanks Alaric, OTE was exactly what I was thinking. Your reply cleared that up. I am still trying to grasp a better understanding of all the direct and indirect addressing. I suppose that will come as I get deeper into this. I will view your attachment this weekend.Thanks for your time.

Share this post


Link to post
Share on other sites
To put it in its simplest form. ... Use MOV to change Scale Set Points. Never have duplicate output in a program. (Regardless of whether you can get away with it or not. It's not the most reliable way.) Tip: Never use indirect addressing. (If you can get away with it. Indirect addressing can make it difficult for a lesser experienced PLC tech to troubleshoot and/or understand the program. A priority should be to write your programs in a way that is easiest for the layman to understand and work with. This reduces the end-user's downtime and saves them money. This rule of thumb is right up there with writing programs in a safe and reliable way.

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