Page 1 of 1

Stop Button custom PLC tweak?

Posted: Tue Mar 28, 2023 7:11 pm
by Toaster
I've done a lot of customizing of Acorn, but one thing I've never really dabbled in is messing around with the PLC programming.

Here's what I am trying to solve for:

I have a secondary tool on my machine that is deployed by an air cylinder. Think of something like a self feeding air drill. When tool 99 is called, a relay fires that operates and air solenoid and sends the tool down.

This all works great until I press the stop button, or I go into MDI mode and return to the main screen. By design Acorn cancels all outputs and my tool pops up.

I want the tool to stay down during these situations but only when tool 99 is active.

Is there a way that I can configure the PLC to behave this way?

If so, could someone head me in the right direction? I've done plenty of custom script writing, but I have no experience in PLC editing.

Re: Stop Button custom PLC tweak?

Posted: Tue Mar 28, 2023 7:43 pm
by Ken Rychlik
If you have an extra output, you could do a latching circuit/relay when it fires, and send the signal through another relays NC contacts. Fire that relay to cancel the drill.

Re: Stop Button custom PLC tweak?

Posted: Tue Mar 28, 2023 7:51 pm
by Toaster
I don't have an extra output unfortunately, they're all used up!

Re: Stop Button custom PLC tweak?

Posted: Wed Mar 29, 2023 5:50 pm
by cncsnw
You don't say what pre-defined Acorn output name you are using for this tool; nor did you post a report, so idle speculation is the best I can offer.

Suppose that you were using one of the generic "OUTPUT" definitions such as "OUTPUT1" or "OUTPUT2"; and further suppose that you are turning it on and off with the default, non-specific M61-M68 and M81-M88 codes.

Then, if you look in your PLC program for the associated M code (for example, "M62" for "OUTPUT2"), somewhere around line 5100 you might [find a block of code that looks something like this:

Code: Select all

IF SV_STOP || DoCycleCancel THEN RST M61; OUTPUT1
IF SV_STOP || DoCycleCancel THEN RST M62; OUTPUT2
IF SV_STOP || DoCycleCancel THEN RST M63; OUTPUT3
IF SV_STOP || DoCycleCancel THEN RST M64; OUTPUT4
IF SV_STOP || DoCycleCancel THEN RST M65; OUTPUT5
IF SV_STOP || DoCycleCancel THEN RST M66; OUTPUT6
IF SV_STOP || DoCycleCancel THEN RST M67; OUTPUT7
IF SV_STOP || DoCycleCancel THEN RST M68; OUTPUT8
Each of those lines resets (turns off) one of the generic output requests, when there is a Fault or Emergency Stop condition, or when the cycle cancel button or an equivalent (e.g. the ESC key) is pressed.

If you want your output to stay on indefinitely, until you either run the corresponding M81-M88 code, or turn off the power, then you just need to delete or comment-out the line that resets the M function request you are using, then recompile your PLC program (or let the Wizard recompile it for you).

Re: Stop Button custom PLC tweak?

Posted: Thu Mar 30, 2023 9:19 am
by Toaster
I am using the generic outputs right now, and it looks like this would work. Is there way that I can make my own custom output?

And as far as how you can code in here.. Is this just like writing custom scripts?

More specifically could I do something like:

IF SV_STOP || IF #4120 EQ 99 THEN ELSE RST M66 ?