06-28-2009 11:24 PM
I'm in the process of creating a VI that decodes a continuous wave of Morse Code. I've resolved the signal into a series of 0's and 1's, and am now attempting to create 1-D arrays that correspond to specific letters/number (for example, SOS is [... --- ...] in Morse Code. My current program counts the number of 0's and 1's that it reads from the data file, and outputs "7", "8", "9", or "1", corresponding to a short space, medium space, long space, dot, or dash (three consecutive 1's are outputted).
Being a relatively new LabVIEW user (this is my first experience w/ the program), I've been unable to accomplish the next step: organizing the outputs (7,8,9,1) into a 1-D array, in the order in which they occur during the while loop. My objective in doing so is to then match the outputted array to a particular alphabet character, number, or punctuation mark.
I've tried multiple methods (build array, insert into array, replace array subset, etc.), but have been unable to output an array that is "time" ordered. The case structure in the upper right-hand corner counts from 1-(# of 7's, 8's, 9's, or 1's), which may be useful if indexing is required. It currently outputs an array, but that could easily be changed.
Below is a screenshot of the block diagram. Any advice would be greatly appreciated, and I'm more than willing to provide any further information deemed necessary. Thank you. John Polansky
06-29-2009 04:02 AM
06-29-2009 06:46 AM
Hi John,
I would recommend posting the solution anyways, in case, people search for this in the future.
06-29-2009 07:18 AM - edited 06-29-2009 07:20 AM
Hi John,
when posting the solution feel free to remove all those "multiply by zero", "multiply by 1", "add zero" and replace them with constants. The "add one" can be replaced by a primitive too...
Also you read in a 1D array of integers, convert it to dynamic data and convert that to a scalar DBL... What the heck is this?
06-30-2009 09:13 PM
Hi Adnan,
That does make sense- I was able to obtain a single array of output by adding the four individual outputs together. As each output occurs individually during the while loop, the summation yields a single value, and in ordered form.
John P.
06-30-2009 09:32 PM
Hey GerdW,
Thanks for the advice- I haven't cleaned up the program yet, but will once I ensure that it can accomplish what I desire: I'm attemtping to decode Morse Code waveform (which has been resolved into 0's and 1's in the text file), for a student satellite project.
I'm currently having a further issue however: I've wired the string of numbers that is built for each "character" to the case structure furthest on the right, and hope to create about 40 cases (26 letters, 10 numbers, and some punctuation marks). For now the case structure only contains 3 cases (False, a string corresponding to U, and a string corresponding to I).
I've ensured that I can individually obtain the U and I, but I've been unable to output them both during a single run of the while loop (just the I, which comes after the U, appears). Do you know how I could display output from each case as it occurs? I've attached three screenshots, each showing a different case in the Case structure.
Any feedback would be greatly appreciated. Thank you!
John P.
06-30-2009 11:30 PM
Once again, I've found a solution- I used the Concatenate Strings function inside the Case Structure to build a string of characters. I've attached a screen shot for clarity.
John P.