11-28-2012 09:19 AM
Hello everyone,
I'm trying too make a morse decoder in LabVIEW.
So far everything is working out fine, but now I'm stuck on a simple problem.
I'm trying to compare my 8 bit array with a bigger array with all the possible letters in it e.g: 10001010.
At the end of the program I want to know the number of the row of the corresponding letter, so I can say: this code is for instance letter F.
Do you have any idea how I have to do this? I found a few programs on this forum, but none of them did what I was looking for.
Thanks in advance,
Nicolas
Solved! Go to Solution.
11-28-2012 10:11 AM
Nicholas,
Since Morse is a variable length code, how do you encode it in 8 bits?
I think you may be making this much more difficult than it needs to be. Convert the 8 bits to an integer. Is that integer the answer you want?
Lynn
11-28-2012 11:48 AM
I made my own adaptation of morse, because otherwise it would be too difficult to manually produce and record the code.
I'm able to make 6 small arrays of 1 byte (6 letters). I also made an arrays with all the codes in it.
I only need to compare both arrays and be able to tell which letter it is.
This is my own code:
Thank you for the fast reply
11-28-2012 06:05 PM
Nicolas,
Create two arrays in the same order. One will have the numeric codes. The other will have the letters. Use the Search 1D array function with the code value. The output will be the index in the array where the value is found. Use Index Array to get the corresponding letter from the other array.
Lynn
11-29-2012 02:02 AM
·-- ···· ·- - ·- -··· --- ··- - -· ··- -- -··· · ·-· ··· ··--··
·---- ··--- ···-- ····- ····· -···· --··· ---·· ----· -----
11-29-2012 10:02 AM
I don't really understand how I can make them in the same order? Can I add more numbers in one place in the array? Or do I have to use clusters?
Because Search array only exists for 1D.
Sorry for being so foolish
11-29-2012 10:12 AM
As Lynn stated earlier, your best bet is to convert your 8-bit code into a number (Boolean Array to Number). You can then use the Search 1D Array to get an index for which letter was received.
So you need 2 arrays of the same length. One will be the coded numbers. The other the letters corresponding to the coded number.
11-29-2012 10:12 AM
Inpsector,
Not being foolish, just not too experienced with LabVIEW yet.
Since you will be creating the arrays manually, just make the arrays like the table you posted.
Letters: [A, B, C, D,... Z]
Codes: [10110000, 11101010, 11101110, 11101000,... 11111010]
Searching Codes for 11101110 will return index 2. Letters[2] = C.
Lynn
11-29-2012 10:27 AM
be sure to drink your Ovaltine
11-29-2012 10:32 AM
Thank you all for replying so fast.
After my previous post, I tried making it without 'search array'.
After a while I found another way to make the program (attachement).
I just logged in again to tell you it's working and now I see how I could have used the search function.
Nicolas
p.s.: if you are interested, I can post a movie of the robot here later.