Morse Coding a horn in ladder

mitureg

Member
Join Date
May 2013
Location
Canada
Posts
199
Hi all, thank you for reading this post. it's been a while since I posted a thread. I hope you are well.

I have this new project requirement for naval sound signal with a horn in case of restricted visibility.

We need to alternate short-short-long or long-long-short values. These must then be spaced with a delay of about 2 minutes.

The client wants a push button that engage a sequence that will repeat until the switch is disengaged.

We have to use TwidoSuite for the project, but if anybody could explain the concept in Allen-Bradley that would be fine.

Much appreciated,
Mitureg.
 
It is a fixed message repeated, for example long-long-short, over and over again.
Could you elaborate on the state sequence logic?

Much appreciated.
 
It is like this ? :

Horn on for X time.
Horn off for fixed time (1 sec for example)
Horn on for Y time.
Horn off for fixed time (1 sec)
Horn on for Z time.
Horn off for fixed time (120 sec)

If that is always the sequence, it can be done by 6 timers in sequence.
To change the "message" you simply load the X, Y and Z timers with different values.
 
It is like this ? :

Horn on for X time.
Horn off for fixed time (1 sec for example)
Horn on for Y time.
Horn off for fixed time (1 sec)
Horn on for Z time.
Horn off for fixed time (120 sec)

If that is always the sequence, it can be done by 6 timers in sequence.
To change the "message" you simply load the X, Y and Z timers with different values.

Yes this is it, but there would be only 2 values; long and short. Then it has to repeat at the end of your example above.

Any illustrations?

Much appreciated,
Mitureg
 
Any illustrations?
I wont do the whole thing for you and then make a powerpoint show.

Here are my final tips:
Have 3 buttons "start_long_long_short", "start_short_short_long" and "stop".
Define 2 variables "long_long_short_started" and "short_short_long_started".

When "start_short_short_long" is pressed AND "long_long_short_started" is NOT on, AND "short_short_long_started" is NOT on,
THEN set "short_short_long_started"=ON, and load the timer setpoints X=1sec, Y=1sec, Z=2sec, and start the 1st timer.

When "start_long_long_short" is pressed AND "long_long_short_started" is NOT on, AND "short_short_long_started" is NOT on,
THEN set "long_long_short_started"=ON, and load the timer setpoints X=2sec, Y=2sec, Z=1sec, and start the 1st timer.

Each timers "done" bit starts the next timer, and the last timer starts the first timer.

The "stop" button clears both "long_long_short_started" and "short_short_long_started", and all the timers.
 
Until they decide they want to add another message.
The task described does not mention being able to change the sequence.
Even so, even if the task does include the ability to change the sequence, how is a state machine going to be able to do that ?
Once defined, the states in a state machine aren't changed easily.
But if it is going to be always 3 times sound + 2 minutes pause, then the framework I have describe will be easy to adapt.
 
I think that a State Machine would be overkill for this.
I agree. Knowing some of Alex's past history, he is a new graduate with a new job, and state machines were not mentioned in the curriculum. I think a Schneider TwidoSuite ladder logic program using timers will be the best solution.

In official "Morse" code, the long or dash, is 3 times the dot or short. Your horn ON times should have the longs 3 times longer than the shorts. Pauses between characters are 1 short or 1 dot time period. A morse long-long-short is a "G", and the short-short-long is a "U". These can also be assigned non-standard meanings for specific applications.

It seems to send one Morse character, you need a timer for the length of the character, then another time for the time-between-characters, then a 3rd time period for your 2-minute pause between messages. The total program becomes not so short but still easily doable using ladder logic.

You might consider using one timer with comparison instructions to do the entire 3-character message, then a second timer for the 2-minute pause between messages.

Time units for each message:
 
1 1 1 1 3 = 7 time units or 7 seconds, then 2-minute pause.
o o ---

3 1 3 1 1 = 9 time units or 9 seconds, then 2-minutes.
--- --- o


Then for Message 1, you need a timer with a 7-second Preset, and for Message 2, your timer needs a 9-second Preset.
 
Last edited:
Here is one way with 6 rungs, 3 timers, and 2 switches. If your TwidoSuite does not have the Limit (comparison range), then you can do the same thing with a combination of (>= AND <=) instructions.
 
Last edited:
An interesting application, could be expanded to allow HMI input of the morse-code message to be sounded.

But it did remind me of the old story .....

United States Navy Destroyer (USND) to Canadian unknown vessel CUV):

USND: "We are a United States Navy Destroyer. Advised you are on collision course. Please alter course immediately"

CUV: "Advise: Cannot Alter course. Please alter course immediately"

USND: "Advise: We are a Destroyer. You alter course now"

CUV: "Sir, I strongly recommend YOU alter course NOW"

USND "Sir, alter course IMMEDIATELY or we will be forced to seek your court martial"

CUV: "Ok, but it's your call. We are a lighthouse"
 
Thank you for the details Lancie and your time JesperDM.

I ran into problems trying to configure a timer in TwidoSuite. It seems not possible to put a timer towards the output of a rung in TwidoSuite.

Also the usual TM/DN is either a command in 2 steps or something I have yet to find.

Any help for the timer command would be greatly appreciated. I have a hard time understanding the help file of TwidoSuite for the timer.

He is the section on timer configuration.

Much appreciated,
Alex
 
The task described does not mention being able to change the sequence.
Even so, even if the task does include the ability to change the sequence, how is a state machine going to be able to do that ?

Sorry, I didn't realize this was more of a school project, and if the message definitely will not change, then yes, it is easier to hard code it. What I was thinking is that if they want one message it wouldn't be long before they want another. Also I am not familiar with twidosoft.

But for AB, here is how I envisioned the steps.

Step 0 - NOP
Step 1 - Read Character from String, Increment Character Index, Goto appropriate Step
Step 2 - Timer and Output for Short
Step 3 - Timer and Output for Long
Step 4 - Timer for Pause
Step 5- Character Delay - Goto Step 1
Step 6 - END - Timer for Pause, In Case of Repeat - Goto Step 0

Steps 2,3,4 Goto Step 5 upon completion

To start the sequence move desired message to ST10:0. Variations could include a repeat in which the message would be repeated as long as an integer is greater than zero (decrease integer in Step 0 or 6). Also, rather than a string (which I hate working with in ladder), you could use an array of integers moved into the timer, with start and Length/Stop.

You do need either string or indirect addressing capability (or both), which I am unsure of in the OP's PLC. It does take a little more thought, and some knowledge of more advanced functions in the PLC, but it wouldn't take much more time (depending on the length of message) than hard coding.

Once defined, the states in a state machine aren't changed easily.
That is why I like a state machine for repetitive programing. While each step remains the same (a simple function) the order is easily modifiable, and steps easily added without effecting the order of the rest.

Perhaps it is my bad, I was throwing out an idea for the problem more than responding directly to the questions.
 

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,188
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,174
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
258
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,296
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,563
Back
Top Bottom