LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Building a 1-D, ordered array from multiple while loop outputs

I'm in the process of creating a VI that decodes a continuous wave of Morse CodeI'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 CodeMy 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 loopMy 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" orderedThe 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 requiredIt 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

 

blockdiag.JPG 

0 Kudos
Message 1 of 7
(2,769 Views)
I found a solution!  Feel free to ignore the previous post, unless anyone would like further information.
0 Kudos
Message 2 of 7
(2,752 Views)

Hi John,

 

I would recommend posting the solution anyways, in case, people search for this in the future.

Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 3 of 7
(2,736 Views)

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?

Message Edited by GerdW on 06-29-2009 02:20 PM
Best regards,
GerdW


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

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.

0 Kudos
Message 5 of 7
(2,692 Views)

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 howeverI'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 occursI've attached three screenshots, each showing a different case in the Case structure.  

 

Any feedback would be greatly appreciatedThank you!

 

John P

Download All
0 Kudos
Message 6 of 7
(2,688 Views)

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.

0 Kudos
Message 7 of 7
(2,675 Views)