text to morse code

MarcusSkynet

Member
Join Date
May 2018
Location
Liberec
Posts
9
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 leters, those then translate and put back together. However I just starting with step 7 and I have no idea which functions use and most likely even how they works.
Thanks for all help.

SW: TIA v4 sp1, Win 8.1
 
You probably need to write a function that will translate ASCII characters into Morse code first.
How you do it it is up to you as there is many possible ways.
Easiest way could be to use outputs energized on time delay.
For exmaple 'A' is 'dot' 'dash' so you will energize output for 250ms pause and again for 750ms.

Try with one character first and then add more and more to your function.

Later you will probably need some sort of loop that will go through all characters in your string.
 
Last edited:
Create a look-up table with all the ASCII characters as bits of morse code. The "long" morse strokes are just 3 on bits.
Setup a big FIFO buffer with max no of bits that can fit the largest text that is foreseeably needed.
Read each character from the input-text, and add the characters as bits from the look-up table into the FIFO buffer. Between each character add 3 of off bits for the pause.
Then cyclically (every 0.5 sec ?) read one bit at a time from the FIFO buffer and send these to the output of choice.

edited. 3 in stead of 2 on bits for "long stroke".
 
Last edited:
It is not an actual application, it is just to prove my skills for company where I am looking for a job.
Unfortunately I have tried nothing so far. I am learning how to use TIA for about 3 weeks so I am quite lost how to even start. Right now I am checking functions how they work and how to use them.
 
Have you looked into how Morse Code works in terms of timings, etc?
Have you noticed anything particularly constant in the Morse Code?
Does that constant timing value ring a bell when it comes to PLC controls?
Have you worked or seen any example of a bounded or circular buffer where you have a pointer to write and a pointer to read?

Lastly, if you are willing to have someone give you the information, why not search for it yourself? A simple Google search brought a few interesting results... two of which in this forum and not even that long ago.

Mind you that plenty of people use these forums...
 
Have you looked into how Morse Code works in terms of timings, etc?
Have you noticed anything particularly constant in the Morse Code?
Does that constant timing value ring a bell when it comes to PLC controls?
Have you worked or seen any example of a bounded or circular buffer where you have a pointer to write and a pointer to read?

Lastly, if you are willing to have someone give you the information, why not search for it yourself? A simple Google search brought a few interesting results... two of which in this forum and not even that long ago.

Mind you that plenty of people use these forums...

Google search was my first option. However my google searches brought me nothing what I could use. That is why I am asking here (and on another places as well). I have worked with RSLogix before, but I have to compose it for siemens.

To your questions, all yes except buffer.
 
No offence intended, but are you at the level required for the job?



That won't cut the mustard, when given your first project.

I got it now. My bad. I thought it is about this particular task. Anyway, they know I am new in siemens, I have worked with allen bradley before. I already did another programs for them and this is my last one.
 
If you worked with RSLogix then ladder logic in TIA is very similar. Basic instructions like mov, add, ton works the same so you should be able to figure out something simple relatively easy.

Once you will start you can improve your program by adding more complex structure.
 
If you worked with RSLogix then ladder logic in TIA is very similar. Basic instructions like mov, add, ton works the same so you should be able to figure out something simple relatively easy.

Once you will start you can improve your program by adding more complex structure.

exactly, but as hard as I am trying, I cant find anything simple to solve this task
 

Similar Topics

Hi everyone, I hope you're all doing well. I'm currently working on updating an HMI project for the GP2500, and I've encountered a bit of a...
Replies
1
Views
59
I'm working with a project that contains some routines in ST but mostly in ladder. Am I correct in assuming this 'rung': DB1001DO._01AV55_OPEN :=...
Replies
4
Views
100
I have an expression in a structured text routine of a Logix controller that looks more or less like the following: ResultInteger := Integer1 *...
Replies
13
Views
374
Hey all, i have a panelview screen (image attached), with 4 items on it. Program 1, Program 2, ...3, ...4. The PLC i am using is a compactlogix...
Replies
5
Views
158
Good evening. I display the step number of a SFC on a display. Sometimes, on a trip, it goes quickly through many steps and I need to prove to...
Replies
1
Views
113
Back
Top Bottom