Page 1 of 1

SpindleCooling_Fan LED <answered>

Posted: Wed Feb 01, 2023 4:16 pm
by Sword
Is it possible to add a LED for an output definition to the PLC? For example, SpindleCoolingLED is 1129, but there's no SpindleCooling_Fan LED. What I'd like to do, is to have a LED come on when SpindleCooling_Fan output is active. I've done something similar with the "Auto Z to Plate" button and the ToolTouchOffTriggered skin event, but this one's a bit different.

Re: SpindleCooling_Fan LED

Posted: Wed Feb 01, 2023 6:12 pm
by cnckeith
yes, i'll have chris chime in on how to do that, in meantime post fresh report.zip please.thanks, k

Re: SpindleCooling_Fan LED

Posted: Thu Feb 02, 2023 11:39 am
by Allin1Chris
Hello Sword,

It is possible to add a LED Output your self, here is what i would do.

In the acorn_XXX_plc.src (XXX is mill, plasma, router, lathe), can add the following code.

Code: Select all

;Add Following to Output Definitions section of PLC
SpindleCoolingFanLED          IS OUT1141 ;Ensure this Output is not used already in your PLC.

;Following is Found in the MainStage of PLC
;SpindleCooling_Fan
;Turn SpindleCooling_Fan on anytime Spindle is Enabled
IF True THEN SpindleCooling_T = SV_MACHINE_PARAMETER_997 * 1000
IF SpindleEnableOut_M THEN SET SpindleCooling_Fan, RST SpindleCooling_T
IF !SpindleEnableOut_M THEN SET SpindleCooling_T
IF SpindleCooling_T THEN RST SpindleCooling_Fan

IF SpindleCooling_Fan THEN (SpindleCoolingFanLED) ;Add this line to activate LED when fan is on
The reason SpindleCooling_Fan does not have an LED already is because it is not activated by an Aux Key, it simply turns on when the spindle is enabled, and disabled when it is turned off (After the timer expires). The SpindleCooling Output is used for situations in which you like more control on when it is active, it can be activated either by a VCP Button or by M-Code command, thus has a LED already that is used for the VCP Button.

Re: SpindleCooling_Fan LED

Posted: Thu Feb 02, 2023 6:18 pm
by Sword
Thanks Chris! Easy-peasy, it works perfectly! Kind of what I thought needed to be done, but wasn't sure.

YT Short showing it with a 5 sec delay.

https://youtube.com/shorts/eBBG6VfGqao?feature=share