LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LiFi using morse code, how to decode

Solved!
Go to solution

I already posted a similar topic a while back. I have already finished the transmission. I have hard time with the decoding and receiving. Attached are my codes, how do I correct it.

Download All
0 Kudos
Message 1 of 9
(367 Views)
Solution
Accepted by topic author InP6Hell

you have written a 'text to morse code' encoder, in transmission.vi

 

string-2-morse.png

 

and there is an 'morse code to text' decoder in

https://forums.ni.com/t5/LabVIEW-Digest-Programming/LabVIEW-Digest-Challenge-3/td-p/3678897

 

especially:

 Morse Code (2017)-1.vi ‏21 KB

can be used directly to countercheck your encoder 

alexderjuengere_0-1777555560006.png

 

Spoiler
morse-2-string.png

good luck

Message 2 of 9
(290 Views)

I would probably take my variant attribute based approach and rewrite it using a map. 😄

0 Kudos
Message 3 of 9
(168 Views)

@InP6Hell wrote:

I already posted a similar topic a while back. I have already finished the transmission. I have hard time with the decoding and receiving. Attached are my codes, how do I correct it.


Your code is broken for example because you are autoindexing on the LUT (the wire actually goes to the indexing tunnel underneath the loop!) and wiring a non-autoindexing output tunnel that goes nowhere does not do anything useful.

 

altenbach_1-1777819710366.png

 

Both of your programs are a total mess, with overlapping and hidden wires flowing in all directions and several pure Rube Goldberg constructs. This makes it much easier for bugs to hide and makes debugging almost impossible.

 

For example, compare the following:

 

altenbach_2-1777820528427.png

 

0 Kudos
Message 4 of 9
(161 Views)

Thanks for the insight. I already saw other solutions for the decoding end. My problem right now is how to make it determine whether the light is dash/dot using pulse width. I am making a laser morse code setup and that is bugging me as of the moment

0 Kudos
Message 5 of 9
(112 Views)

I am nearly done with this project. I am trying to implement a on and off mechanism to do morse wherein the duration of the on/off signifies a dash or dot. I am strictly only using this for numbers so there is a 5 character conditional. It works but it only decodes only 1 character. How do make it such that it can handle multiple characters?

InP6Hell_1-1777958057300.png

 

0 Kudos
Message 6 of 9
(64 Views)

Hi P6,

 


@InP6Hell wrote:

It works but it only decodes only 1 character. How do make it such that it can handle multiple characters?


Your code is hardly to decipher form that downscaled image.

And please downconvert your VI before attaching. Most suggest "LabVIEW 2021 or older", I prefer LV2019...

 

Generic answer:

When you have a routine to decode one character then you only need to call that routine several times to decode several characters...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 9
(44 Views)

Hello! Here's an older version of the file. Can't get my head around on how to make it decode more characters. I was thinking of making an array and spaces between characters. Still working on it

0 Kudos
Message 8 of 9
(28 Views)

Hi P6

 


@InP6Hell wrote:

Can't get my head around on how to make it decode more characters. 


Because your "Morse string" never gets cleared from previoulsy decoded data, you only append new morse codes at the end...

And the decoding routine always starts from beginning of "Morse string", again and again!

Additionally you call the decoding routine WHEN the "Morse string" contains exactly 5 chars...

 

You should have found those items on your own by using some simple debugging techniques, like probes and highlight execution!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 9
(22 Views)