Andrei Blagaila

MC Function on Q CPU

9 posts in this topic

If I use at the begging of a POU the MC Nn Mn command do I have to use something at the end of the POU? I want the entire block to work only if certain conditions are True.

Thank you

Share this post


Link to post
Share on other sites

I'm not sure what you are trying to acheive here. Could you specify a bit more? What language do you want to use? Printscreens?

Most functions has a [Function block name]_E type whitch can be used to limit the function by adding conditions Before the EN-signal.

Share this post


Link to post
Share on other sites

Sure. I have a function for the machine that I want to abilitate and disabilitate. If the conditions are true is works, if not it skips the code. I tried with GOEND but if by accident the Latch is switched off while working the outputs freeze ON and it could cause major problems.

1.jpg

Share this post


Link to post
Share on other sites

At the end of the section you want to control you need to add a MCR instruction (---ll----SM400---------------[MCR N0]). Everything before the MC instruction and everything after the MCR instruction will scan normally and not be affected by the MC instruction.

Share this post


Link to post
Share on other sites
6 hours ago, Andrei Blagaila said:

And if I use the whole POU? Do I need to use MCR? Or is it not needed?

That should be fine. Also I made mistake on previous post. You cannot place a contact in front of the MCR so your final line should be ----------------------------------[MCR N0]

Share this post


Link to post
Share on other sites

Thanks. I'll leave it without and test on the machine soon. If it works I will leave it like this, if not before the [END] line i will put [MCR N0].

Share this post


Link to post
Share on other sites

I misunderstood your question. I think you will have to use the MCR function even if you are using the master control for the whole program. I don't have a PLC to connect to to be sure, but I expect you will receive a PLC error if not. I suppose you could try it without just to see, but I'm certain it will work if you do include include the MCR instruction. Let us know.

Share this post


Link to post
Share on other sites

I loaded it to the CPU and no error lights. Everything is running. I checked to see the next POU and that works even if the functions is disabilitated. I don't have the tool here to test on it but in a couple of weeks I can do that. For the Simulation Stand that has a complete PLC rack and HMI it seems to work.

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