Signal Tower Error Code(s)

6 posts in this topic

Hi, got a mental block lol. 

Got a machine we are modifying, currently got most of the code in place. Working on a fault routine now. This machine doesn't have an HMI or wide array of PL. Nothing major just a simple vision system check. Currently have 6 faults that will stop the cycle running. I'm wanting to have the beacon light (Red light) blink for the cause of the fault. For example:

Scenario 1- Fault stop for bottle check NG:  (two) .5 sec blinks -  2 sec red light off -  (two) .5 sec blinks ..... repeat 

Scenario 2- Fault stop for bottle check NG and reject sensor blocked:  (two) .5 sec blinks -2 sec red light off - (three) .5 sec blinks - 2 sec red light off....... repeat

I have the code a few different ways but it looks "dirty". Any suggestions?

Thanks in advance


Share this post

Link to post
Share on other sites


Share this post

Link to post
Share on other sites

Thanks Panic, 

The timing is ok. My issue, more or less is which alarm / alarms exist. 

If it were only one alarm that could exist at a time it wouldn't be bad. I will have 6 alarms in total. For example, if I had 3 alarm at once , probably not going to happen but need to program a such. 

If alarm x was a two blink, alarm y was 3 blink and alarm z was 4 blink.

I'm looking red light blink 2 times pause 2 sec, blink 3 times pause 2 sec blink 4 times pause 2 sec then repeat. This would be for alarm 1,2 and 3...

If the alarms were, alarms 2,4 and 6 the timing works be 3 blink, 5 blink and 7 blink with 2 sec pause in-between. 

Kinda like Morris code so to speak. 

Share this post

Link to post
Share on other sites

don't know about Morris code, I guess you meant Morse code.

one way is to create a lookup table (list as an array of integers or integer data table).
then for each alarm set count value into corresponding integer in that array/table

one can use system clock though custom clock is simpler to synchronize with alarm. this just avoids random duration of the first flash.

and use two counters:
one that count pulses, and another that keeps track of alarm number.
if alarm is present keep looping each counter:
increment pulse counter (counter#1) on each clock and reset it when moving to next alarm. when reseting Counter#1, increment Counter#2 (alarm number)
using indirect addressing (or array index) you can get correct preset for number of pulses for each alarm from the list. once you get this value (saved in one register), add 2 or whatever fixed vlaue to it (save to another register). this will be actual number of pulses to count before reseting counter#1 and incrementing #2. 
of course add condition to return to first alarm when you exceed the last one (if you reach non-existent alarm #7, reset counter#2).
activate tower light if alarm is present, pulse is active (0.5sec clock) and pulse count is less than value you read using indirect addressing. this way 2 or whatever fixed value will be the delay (2 sec or whatever).

maybe something like this :


tower light.png

Share this post

Link to post
Share on other sites

Thanks again Panic, 

Yeah, I did mean Morse Code lol... I used the example you provided, it works like we talked about. Just had to make some minor tweaks,  the last rung, going to the next interger the reset rung above it was clearing out the data before it could preform the next step. Just combined the two, and changed the "tower" output rung. The LEG N10:1 N10.2, changed to N10.0 N10.2. Everything else was perfect. 

Thank you again. That works much better then what I was trying. I was trying to get it working with the sequencer..., then timers/ counters..  but I didnt like the code. 


Share this post

Link to post
Share on other sites

no problem...

i guess i could have mentioned that no guarantees are offered since don't have access to PLC software at the moment. I did it from memory while pretending to watch some stupid chick movie that my wife picked... :shifty:


2 people like this

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