Aux key programming

All things related to Centroid Oak, Allin1DC, MPU11 and Legacy products

Moderator: cnckeith

Post Reply
Dlab77@aol.com
Posts: 20
Joined: Fri Aug 15, 2014 4:44 pm
Allin1DC CNC Controller: Yes
CNC Control System Serial Number: A900357
DC3IOB: No
CNC11: Yes
CPU10 or CPU7: Yes

Aux key programming

Post by Dlab77@aol.com »

I would like to assign AUX 9 key to turn on a vacuum that I use to clear chips and dust when I am machining wood or plastic. I know how to make the AUX keys run G Code, but how do I get the AUX 9 to run one of the unused I/O (ie: Out 1) relays on the Allin1CNC controller. I already have a solid state relay to power the vacuum. All I need is 12 VDC to turn it on when I push AUX 9 key.

Thanks.

Dave
cncsnw
Posts: 3855
Joined: Wed Mar 24, 2010 5:48 pm

Re: Aux key programming

Post by cncsnw »

You need to add code to your PLC program to do that.

For example, supposing you wanted to use the OUT9 relay for the vacuum, and you wanted to turn it on and off with the Aux9 key:

Code: Select all

; in definitions section:
VacuumOut  IS OUT9  ; dust vacuum
;...
; in MainStage:
IF Aux9Key THEN (Aux9PD)  ; detect rising edge of key press event
IF Aux9PD ^ VacuumOut THEN (VacuumOut), (Aux9LED)   ; use key-down event to toggle output
Incidentally, OUT1 should not be unused. You should be using OUT1 as part of your emergency stop contactor coil loop.
Dlab77@aol.com
Posts: 20
Joined: Fri Aug 15, 2014 4:44 pm
Allin1DC CNC Controller: Yes
CNC Control System Serial Number: A900357
DC3IOB: No
CNC11: Yes
CPU10 or CPU7: Yes

Re: Aux key programming

Post by Dlab77@aol.com »

Thank you for your response.

I have found in the programming manual, Appendix A: Example PLC Program.

1. Under what file name and directory on my Allin1CNC computer hard drive will I find the PLC program that I will have to alter?
2. Will I first enter “VacuumOut IS OUT9” under
;----------------------------------------------------------------
; CONSTANT DEFINITIONS
;----------------------------------------------------------------
3. Does it matter that this does not seem to be the same format used in the example?
4. Should I then put
a. If Aux9key Then (Aux9PD)
b. IF Aux9PD ^ VacuumOut THEN (VacuumOut), (Aux9LED)

under:

;----------------------------------------------------------------
MainStage
;----------------------------------------------------------------

5. Does it matter where I put these commands?

Dave
cncsnw
Posts: 3855
Joined: Wed Mar 24, 2010 5:48 pm

Re: Aux key programming

Post by cncsnw »

I would put the OUT9 definition in the "Output Definitions" section, usually around line 200 of the source file.
Dlab77@aol.com
Posts: 20
Joined: Fri Aug 15, 2014 4:44 pm
Allin1DC CNC Controller: Yes
CNC Control System Serial Number: A900357
DC3IOB: No
CNC11: Yes
CPU10 or CPU7: Yes

Re: Aux key programming

Post by Dlab77@aol.com »

OK, thank you for answering that question. I need to know where to start, however.

Under what file name and directory on my Allin1CNC computer hard drive will I find the PLC program that I will have to alter?
cncsnw
Posts: 3855
Joined: Wed Mar 24, 2010 5:48 pm

Re: Aux key programming

Post by cncsnw »

The PLC program source file is usually stored in the control software directory. Supposing you have a mill control, that is the c:\cncm directory.

Supposing you are using an All-in-one DC control unit, with a typical software installation, then your original PLC program source file would be named allin1dc-basic.src.

It is good practice to work on a copy, under a new name, when you are creating a custom PLC program. That way it is obvious to anyone looking at files from your control (e.g. Ajax tech support) that you have a custom PLC program.

I usually name custom programs after the control serial number of the system they are for. E.g. "a900357.src".

Once you have made your changes, you need to compile the program using the MPUCOMP compiler. You need to specify "mpu.plc" as the output file.

For example, supposing you had saved your customized source file as "a900357.src", then the command to compile it would be "mpucomp a900357.src mpu.plc".

Then you need to shut down and cycle the power for changes to take effect.
Post Reply