Page 1 of 2
Multi color led indicator light
Posted: Tue Dec 24, 2024 2:15 pm
by jasonstewart81
Merry Christmas Eve everyone. I have a question maybe someone more electronics advanced than me can answer. I purchased a multi color led indicator panel light I'm going to use on the front of my electronics enclosure for my cnc router. Originally I had drilled a 22mm hole for a selector switch but plans changed as they always do and that selector switch is going to be used along with a push button in a project box closer to the machine. So to fill that 22mm hole, that's where I decided to add the multi color led. Essentially my plan is to use it like a stack light and set an output for a green light, amber light, and red light. The issue is that in order to get an amber (yellow) light, I have to combine 2 wires to get that color as shown in the picture. I'm wondering if 2 diodes would allow me to get that amber (yellow) light indicator for an idle state. If it's too much of a pain to do I can just use blue which is a single wire and blue can be my idle color. Just curious.
Re: Multi color led indicator light
Posted: Tue Dec 24, 2024 3:11 pm
by cncsnw
That should work just fine.
If you needed to save an output relay, you could have the PLC program do the logic, so that it turns on both red and green whenever amber is called for. However, that would require that you edit your PLC program.
Re: Multi color led indicator light
Posted: Tue Dec 24, 2024 3:42 pm
by jasonstewart81
cncsnw wrote: ↑Tue Dec 24, 2024 3:11 pm
That should work just fine.
If you needed to save an output relay, you could have the PLC program do the logic, so that it turns on both red and green whenever amber is called for. However, that would require that you edit your PLC program.
It's funny that you say that because I was wondering if that was possible. I just couldn't figure out how to do so. Messing with the PLC program is a bit over my head. I was looking through the main acorn plc file in notepad ++ but couldn't figure out what to change or how to implement that. I definitely would like to not have to use another output just to turn the led amber when turning on the red & green would give me the same thing in my situation.
The only other thing I will say I'm not fond of is why they make the lights flash every couple seconds. I'm not sure how many cycles those on-board relays can handle, but I think I'd rather have the lights stay on than to click on and off and on and off.
Re: Multi color led indicator light
Posted: Tue Dec 24, 2024 4:15 pm
by tblough
IIRC, Acorn wizard already has output definitions for a stack light.
Re: Multi color led indicator light
Posted: Tue Dec 24, 2024 4:16 pm
by cncsnw
Yes, it does. It just does not do what he wants.
Somewhere around line 5550 in an Acorn PLC program:
Code: Select all
;-----------------------------------LightStack---------------------------------
;Blink Lights, On 5 Seconds, Off 1 Second
IF True THEN SET LightTurnOnTimer
IF LightTurnOnTimer THEN SET LightTurnOffTimer
IF LightTurnOffTimer THEN RST LightTurnOnTimer, RST LightTurnOffTimer
;Set Lights on Machine Status
IF SV_JOB_IN_PROGRESS && (LightTurnOnTimer || (SV_MACHINE_PARAMETER_890 == 1)) THEN (GreenLight) ; If job running normally then greenlight on
IF !SV_JOB_IN_PROGRESS && !SV_STOP && (LightTurnOnTimer || (SV_MACHINE_PARAMETER_890 == 1)) THEN (Amberlight) ; If not in job and not in fault then yellow light on
IF SV_STOP && (LightTurnOnTimer || (SV_MACHINE_PARAMETER_890 == 1)) THEN (RedLight) ; if in fault then red light on
;---------------------------------End LightStack-------------------------------
Change to read:
Code: Select all
;-----------------------------------LightStack---------------------------------
;Set Lights on Machine Status
IF !SV_JOB_IN_PROGRESS && !SV_STOP THEN (Amberlight) ; If not in job and not in fault then yellow light on
IF SV_JOB_IN_PROGRESS || AmberLight THEN (GreenLight) ; If job running normally then greenlight on
IF SV_STOP || AmberLight THEN (RedLight) ; if in fault then red light on
;---------------------------------End LightStack-------------------------------
Then put "RedLight" and "GreenLight" on outputs, and leave "AmberLight" unassigned so that it remains as a memory bit.
Re: Multi color led indicator light
Posted: Tue Dec 24, 2024 4:35 pm
by jasonstewart81
cncsnw wrote: ↑Tue Dec 24, 2024 4:16 pm
Yes, it does. It just does not do what he wants.
Somewhere around line 5550 in an Acorn PLC program:
Code: Select all
;-----------------------------------LightStack---------------------------------
;Blink Lights, On 5 Seconds, Off 1 Second
IF True THEN SET LightTurnOnTimer
IF LightTurnOnTimer THEN SET LightTurnOffTimer
IF LightTurnOffTimer THEN RST LightTurnOnTimer, RST LightTurnOffTimer
;Set Lights on Machine Status
IF SV_JOB_IN_PROGRESS && (LightTurnOnTimer || (SV_MACHINE_PARAMETER_890 == 1)) THEN (GreenLight) ; If job running normally then greenlight on
IF !SV_JOB_IN_PROGRESS && !SV_STOP && (LightTurnOnTimer || (SV_MACHINE_PARAMETER_890 == 1)) THEN (Amberlight) ; If not in job and not in fault then yellow light on
IF SV_STOP && (LightTurnOnTimer || (SV_MACHINE_PARAMETER_890 == 1)) THEN (RedLight) ; if in fault then red light on
;---------------------------------End LightStack-------------------------------
Change to read:
Code: Select all
;-----------------------------------LightStack---------------------------------
;Set Lights on Machine Status
IF !SV_JOB_IN_PROGRESS && !SV_STOP THEN (Amberlight) ; If not in job and not in fault then yellow light on
IF SV_JOB_IN_PROGRESS || AmberLight THEN (GreenLight) ; If job running normally then greenlight on
IF SV_STOP || AmberLight THEN (RedLight) ; if in fault then red light on
;---------------------------------End LightStack-------------------------------
Then put "RedLight" and "GreenLight" on outputs, and leave "AmberLight" unassigned so that it remains as a memory bit.
Thank you sir. I'll look deeper into this and obviously create a copy of the working untouched plc file.
Re: Multi color led indicator light
Posted: Wed Dec 25, 2024 3:40 pm
by jasonstewart81
Merry ACTUAL Christmas Day. Yeah I tried that code you provided CNCSNW and unless I'm doing something wrong which may very well be the case, it's not working. I beginning to think that because the "GreenLight" is assigned to and output and the "RedLight" is assigned to an output that I can't define it to turn both the Green and Red on to give me the Amber (Yellow) color for this fancy multicolor led panel light I bought. I figured the code would look like this, however I'm not a programmer so I honestly have no idea what I'm doing.
Code: Select all
;-----------------------------------LightStack---------------------------------
;Blink Lights, On 5 Seconds, Off 1 Second
;IF True THEN SET LightTurnOnTimer
;IF LightTurnOnTimer THEN SET LightTurnOffTimer
;IF LightTurnOffTimer THEN RST LightTurnOnTimer, RST LightTurnOffTimer
;Set Lights on Machine Status
IF SV_JOB_IN_PROGRESS && (LightTurnOnTimer || (SV_MACHINE_PARAMETER_890 == 1)) THEN (GreenLight) ; If job running normally then greenlight on
IF !SV_JOB_IN_PROGRESS && !SV_STOP && (LightTurnOnTimer || (SV_MACHINE_PARAMETER_890 == 1)) THEN (GreenLight && RedLight) ; If not in job and not in fault then yellow light on
IF SV_STOP && (LightTurnOnTimer || (SV_MACHINE_PARAMETER_890 == 1)) THEN (RedLight) ; if in fault then red light on
;---------------------------------End LightStack-------------------------------
https://www.automationdirect.com/adc/sh ... ml1-159-30
Re: Multi color led indicator light
Posted: Wed Dec 25, 2024 4:40 pm
by RogDC
jasonstewart81 wrote: ↑Wed Dec 25, 2024 3:40 pm
Merry ACTUAL Christmas Day. Yeah I tried that code you provided CNCSNW and unless I'm doing something wrong which may very well be the case, it's not working. I beginning to think that because the "GreenLight" is assigned to and output and the "RedLight" is assigned to an output that I can't define it to turn both the Green and Red on to give me the Amber (Yellow) color for this fancy multicolor led panel light I bought. I figured the code would look like this, however I'm not a programmer so I honestly have no idea what I'm doing.
Could you use two relays and have the 24V to common and the Red/Green inputs to NC of the relays, both relays off would give you yellow, then open (actuate) the desired relay to give you the red or green indicator?
For example
Relay 1 on, Relay 2 off = Green
Relay 1 off, Relay 2 on = Red
Relay 1 off, Relay 2 off = Yellow
This could be use with the NO contacts as well, logic would just be reversed.
Re: Multi color led indicator light
Posted: Wed Dec 25, 2024 6:37 pm
by jasonstewart81
RogDC wrote: ↑Wed Dec 25, 2024 4:40 pm
jasonstewart81 wrote: ↑Wed Dec 25, 2024 3:40 pm
Merry ACTUAL Christmas Day. Yeah I tried that code you provided CNCSNW and unless I'm doing something wrong which may very well be the case, it's not working. I beginning to think that because the "GreenLight" is assigned to and output and the "RedLight" is assigned to an output that I can't define it to turn both the Green and Red on to give me the Amber (Yellow) color for this fancy multicolor led panel light I bought. I figured the code would look like this, however I'm not a programmer so I honestly have no idea what I'm doing.
Could you use two relays and have the 24V to common and the Red/Green inputs to NC of the relays, both relays off would give you yellow, then open (actuate) the desired relay to give you the red or green indicator?
For example
Relay 1 on, Relay 2 off = Green
Relay 1 off, Relay 2 on = Red
Relay 1 off, Relay 2 off = Yellow
This could be use with the NO contacts as well, logic would just be reversed.
Ahhhh. I think I understand what you're saying. Essentially the moment I power up the Acorn and start CNC12 the Yellow light would be on and if a program is running it'll turn on whatever output # that's set for (GreenLight). Then if there's a fault, whatever output # that's set for (RedLight) will be on, but if the machine is idle, both relays will be off and the 24v that's on the common of the relay will pass to the normally closed on both the output for the (GreenLight and RedLight) thus sending 24v to the 2 wires needed to give me that "Yellow" color. I'm going to have to draw this out on my notepad to visualize this and see if that works. I really feel like there must be a way to turn on both outputs to give me the yellow light, I just don't know code and what the proper symbol usage is to make that happen.
Re: Multi color led indicator light
Posted: Wed Dec 25, 2024 7:35 pm
by jasonstewart81
Yeah, I think I'm just going to eliminate the use of the yellow light all together and use the green and red light. Green means go, red means stop. Simple as that. Trying to figure out how to eliminate the use of a 3rd output and use just the 2 outputs to turn red and green on to give me yellow is just hurting my brain.
