Morse Coding a horn in ladder

Any help for the timer command would be greatly appreciated. I have a hard time understanding the help file of TwidoSuite for the timer.
I don't have the TwidoSuite software, but looking at the Twido Software Reference Manual, you would use a Timer Block, setup for a TON Timer, followed by an output that goes one when the timer reaches its Preset Value. For the Timer output, use an internal relay (M bit address) or flag bit, not one of your valuable Q or external Outputs. Use the Timer "M" output bit in place of the Timer Done bits in my previously posted program.

Also the usual TM/DN is either a command in 2 steps or something I have yet to find.
The Allen Bradley RSLogix Timer Done bit does the same job as the standard Timer bit in most other PLC software programs. In other words, most PLC software programs only have 1 timer bit, where the RSLogix software has the usual timer output bit (called DN), plus two others, Timer Timing (TT) and Timer Enabled (EN). In my program, knowing this about the Twido Timer block, I was careful to arrange the program so it uses ONLY the Timer DN logic bits, because in Twido that standard timer output is your one-and-only timer bit choice.
 
Pulse

Disclaimer. Not a twido user.

But GE Allows Timers in the middle of the rung. So you could create a pulse like this, By using an On Delay Timer Then an Off Delay Timer To Control a Bit. The Following Rungs would make the Horn_2Sec Bit Pulse 2 seconds on then 2 seconds off as long the Push Button is True.

Pulse Generator.jpg
 
I decided to load the TwidoSuite software, get it running, study the Twido User Manual and find the equivalent instructions, and convert my LogixPro program to the Twido equivalent. Then I tested it with the Twido Simulation mode. The best I can tell, it works as intended. The actual program and a PDF printout are attached.

The program symbol descriptions really make a mess in the print-out as (unlike the Allen Bradley-Rockwell software) there seems to be no way to control how many characters print on each line, so they get spread around willy-nilly, making it harder to read.
 
Last edited:
Great Lancie, thank you for taking the time to translate de LIM Block in Twido. That gives a really good guideline on how things can be done. I was a bit worried at first when I saw the interface of that software.

With your illustration it gives me hope. Will try it today.

Much appreciated,
Alex
 
I should have mentioned that each message (SSL and LLS) will repeat every 2 minutes until the switch is turned OFF.

There could be a case where someone turns on both switches, so you may want to add interlocks (NC contact for the OTHER switch added after each switch contact) that prevents the second horn from being activated if the other one is ON. Another way to prevent this is to hard-wire a 3-position selector switch "SSL OFF LLS", so that only 1 message can be triggered at any time.
 
Hi Lancie, I worked on the program yesterday and hooked it up to a PWM for testing with the HMI and it works.

I modified the messages for our needs which are actually LSS, L and LL (Grounded, Underway, Underway but stopped).

I already did the programming for the interlocking switch I needed a simillar design for an Engineer Calling system on board. I use extra rungs that have a conditional bit reset, when a button is pressed, it resets the bits of others. Making it possible to send only one message at a time.

Thank you for you concerns.
Regards.
 
Hi Lancie, I worked on the program yesterday and hooked it up to a PWM for testing with the HMI and it works.
I am glad to hear that it worked. I would like to see the final version, if you would be so kind to print out a PDF copy.
 
Somewhere I have some routines that send actual morse code. I have done this on several jobs and processors. It is handy for debugging and indicating errors. (especially on HMI-less machines, I once used a blow off to whistle in morse code).

The whole thing is a state machine. The 'encoding' of the letters are stored in the bits of bytes. (dit(short) is a 1 and dah(long) is a 0.
There is one timer that paces the whole thing. It sets the duration of a dit.
You can add an outer loop to it to send a string of chars.

Where I was going with this (although more complicated than other solutions and over kill for your case of 3 signals) is that you could load the signal pattern into a word. Then shift out the bits of the word. A 1 indicates horn blast. 0's indicate silence. When there are no more horn blasts left (byte=0) your done. You would leave this code running all the time. When you want a signal you move the encoded data into the working shift register byte. The code notices there is something to do and off it goes.
 
Lancie, I got this problem with the TwidoSuite software.

It seems that it's impossible to reset the DONE bit of a timer. For example the DONE bit of %TM1 is TM1.Q. TM1.Q is not writable, hence when the timer is done with the preset, it stays on the last value.

I thought of using cascading timers, but there should be an easier way, assuming that the software is not garbage...

Much appreciated,
Alex
Any ideas using just one timer?
 
It seems that it's impossible to reset the DONE bit of a timer. For example the DONE bit of %TM1 is TM1.Q. TM1.Q is not writable, hence when the timer is done with the preset, it stays on the last value.
Yes, but when you turn off the input to the timer function block, TM1.Q should reset and the timer Current Value TM1.V should also reset to 0. This is the way most non-retentive timers work in almost all PLC software programs. It is good that the timer does not reset until you stop its trigger input, so you can keep everything ON until you are ready to reset the timer.

In your program, the Normally Closed %M190 Timer 0 DN bit (to the left of EACH of your pulse timers) resets all of the pulse timers, which in turn resets %TM0. So all timers get reset at the end of 1200 microseconds or 120 seconds, just as planned. Is there some reason you thought they should reset before that? If you did reset the pulse timers as soon as each was done, then you would have no trigger to keep the 1200-mseconds timer running for 120 seconds!

PS: I think your Reset relays in rungs 12 through 14 are really screwy. Whether or not this method will work depends on how each of those relays are Set. If the function doing the Sets is still ON, then of course as soons as these rungs do a Reset, the same relay(s) will be Set again during the very next PLC scan. This is not generally a good method. It is better to interrupt or change the logic that caused the Set or seal-in of a relay in the first place. Otherwise you create a race, where the last Set or seal-in in the program is the winner. To lock out all other horn functions when ONE has been selected, there is a betther method - simply use a NC contact for all other horn functions on each horn function seal-in, so that it cannot be sealed in unless all other horn functions are OFF.
 
Last edited:

. . . . . . . _ _ . _ _ _ _ _ . _ . . . . . _ . _ . _ _ _ _ . . .

 
Lancie1 said:
Is there some reason you thought they should reset before that?

I posted on the wrong thread. The TMi.Q done bit question was rather for the Alarm Sequence I am also working on. I got my answer on the other thread you replied. Thank you.


Lancie1 said:
It is better to interrupt or change the logic that caused the Set or seal-in of a relay in the first place. Otherwise you create a race, where the last Set or seal-in in the program is the winner.

I've put NC contact relays to interrupt the logic that causes the Set. You can have a look. My main concern at first was the have only one Button on the HMi that is ON (light on when activated).

Much appreciated,
Alex

ButtonReset_HMi.PNG
 
I've put NC contact relays to interrupt the logic that causes the Set. You can have a look. My main concern at first was they have only one Button on the HMi that is ON (light on when activated).
I am sorry, but I did not explain that very well. Let me try again. Whether your Reset for the various Horn function buttons will work depends on what type of button is defined by the HMI program. If the button is set for "maintained contact" or "Press ON-Press OFF", or "Alternate ON-OFF", then the HMI will keep that bit ON until the button is pressed again. Even if you reset the bits in your program (as you are now), the HMI will turn them ON again the next time the PLC reads the button inputs from the HMI.

Now, if the HMI horn buttons are progammed as "momentary contact", or "momentary Set", then your program should work as you have it now. The problem is that if ANOTHER horn button is pressed before the 2-minute Pause from the LAST horn function, then the way you had it before, there was nothing to reset the timers. Now you have a way to reset the timers, even though it is sort of clunky having to put 4 of the Horn button bits on each timer. You might simplify it by putting all the horn button bits in parallel on a run that activates a new M "Horn Reset" bit. Then use this new Horn Reset bit in place of the 4 Horn button bits to reset the timers. Thinking about it some more, the timers should have reset before because you already did have a contact to reset the NO horn bit to the left of each timer. This indicates that your PLC program could not successfuly reset each of the HMI horn buttons (maybe because they are not the "momentary contact type).

If they are not already, you might consider changing the type of the HMI Horn buttons to "momentary contact", and use that to Set a PLC bit in your ladder program for each horn. Then the PLC would have complete control over the horn bits and could always reset the bit as needed.
 
Last edited:

Similar Topics

Hi all, may I ask anybody for help to write a program which translates text to morse code. I understand I have to divide text string to individual...
Replies
34
Views
7,225
Possibly a bit of an odd one for a PLC, but why not. I need to display morse code messages on a indicator lamp, but I also need to be able to...
Replies
11
Views
4,244
Hello, I was wondering if anyone has a ControlLogix block or routine for encoding and decoding base64. I figured I would ask before diving into...
Replies
1
Views
261
Hello All, I hope we are all doing great and have a healthy and happy 2023!! I was wondering if anyone could help me decode this Motor Name...
Replies
15
Views
5,307
I have a Mitsubishi FX2N-64MR-UA1 processor. The 1st analog output card is an FX2N-4DA. It requires 24VDC power. That card is obsolete. The card...
Replies
1
Views
1,580
Back
Top Bottom