Sign in to follow this  
Followers 0
Guest Arne

Step 7 - Jump over parts of the program.

8 posts in this topic

I am using a plc tutor with some programming examples. (Not a Siemens book.) In the programming examples (That is actually based on Allen Bradley, I think) there is used a programming techniqe where parts of the ladder ptogram is left out depending of the value of a logoical bit. (I think the AB name for this function is MCR - master control relay or somethin like that) I have seen a simular function on Onron PLC's. Is it possible to set up such a function that will leave out the execution of parts of a ladder program for the Siemens Step 7 (5.2, s-7 300 Hardware). ??

Share this post


Link to post
Share on other sites
Using the help function in the Step 7 program I actually found a MCR function: <Quote> Symbol ---(MCR<) Description ---(MCR<) (Open a Master Control Relay zone) saves the RLO in the MCR stack. The MCR nesting stack is a LIFO stack (last in, first out) and only 8 stack entries (nesting levels) are possible. If the stack is already full, the ---(MCR<) function produces an MCR stack fault (MCRF). The following elements are MCR-dependent and influenced by the RLO state that is saved to the MCR stack while opening an MCR zone: <Unquote> Dont know if this works simular to the AB mcr function .. I would appreciate any further information on this subject ..

Share this post


Link to post
Share on other sites
If anybody should happen to know about this, please leave a msg: When using multible mcrs the fuction has to be deacticated and activated between to give proper operation. I find this stange and a bit "clumsy", and I ask myself if this really can be true. Have to make a syntax like this: ---(MCRA) (Activate) ---(MCR<) The part or section of the program. ---(MCR>) ---(MCRD) (Deactivate) ---(MCRA) (Activate) ---(MCR<) The part or section of the program. ---(MCR>) ---(MCRD) (Deactivate) ---(MCRA) (Activate) ---(MCR<) The part or section of the program. ---(MCR>) ---(MCRD) (Deactivate) ---(MCRA) (Activate) ---(MCR<) The part or section of the program. ---(MCR>) ---(MCRD) (Deactivate) Something I have missed ? Anybody who knows ?

Share this post


Link to post
Share on other sites
You said you wanted parts of the program to be "left out" during execution. I don't think an MCR does this. All the code within the range of an MCR is still executed (including timers, counters, arithmetic etc) but the outputs are set to '0' if the MCR is active. If you really want to leave out sections of code, I can think of two ways - - build your program using FCs and FBs to get some structure in it. Make the call to an FC or FB dependent on the bit you want to use to control the code within the FC or FB - use any one of the Jump statements (Jump Conditional JC seems most appropriate) to skip over portions of code that should not be executed within an FC or FB

Share this post


Link to post
Share on other sites
I've never used the MCR function so I may be wrong (probably?), but I have the impression that if you are using lots of MCR groups you use the MCRA / MCRD commands to divide them into convenient subgroups. For example you might have ten MCR areas in your program of which, say, the first four are for job A and the last six, then you would group the first four in one MCRA / MCRD area and the following six MCRs in another. I may be totally wrong and if I am, no doubt someone will be sure to point it out, but it just seems a fairly logical useage. Guest is right that the MCR command does not jump over a portion of the program, but while Set and Reset commands are no longer executed, they are left in the state they are in, not set back to 0. Edited by RMA

Share this post


Link to post
Share on other sites
Thanks for your comment ! I have carried out some tests. It apears that the jump function work bether for my purpose than the mcr. The mcr seems to be locking the outouts in the existing position, while timers and things like that is still running. Using the jmp function seems to lock it all, including also the timers. The basic idea vere to translate some Allen Bradley programs "close as possible" up to a new Simens code. Using OB's, fc's, fb's etc will as I see it rearange all or most of the orginal coding. Replacing the mcr function with the jmp function should on the other hand be a good solution, that still will remain the orginal structure. I will now try to make a revision of the program based on the jmp command as a replacement for the mcr function. Thanks a lot Best reg Arne.

Share this post


Link to post
Share on other sites
RMA -> Yes, the mcr function has some a little bit strange sides concerning grouping and levels. I think it is bether and more practical to use the jmp fuction as a more "quick and easy predictable alternative". It also give less code for "the same amount of proper operation".

Share this post


Link to post
Share on other sites
After diverse testing og jmp command, fc's, fb's etc, the concusion is that the most clear and easy programming is done with the use of the existing MCR syntax (For this certain program.) (Translation of the programs in the book of Hugh Jack).

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