From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Morse Decoder Array Problem

Solved!
Go to solution

I have trouble believing this code works.  You have an obvious race condition.  Use wires instead of your local variables.  Plus, try using a FOR loop instead of the while loop and indexing.  You can autoindex the incoming array.

 

Here's my refactoring of your code.  So much cleaner.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 11 of 12
(457 Views)

Not good.  Suppose you have a number combination that doesn't show up in your array.  The while loop will run for ever.

 

Use the Search 1-D array like it has been suggested.  Then if a number is not found, it returns a -1 as the index and you can handle that however you want to.

0 Kudos
Message 12 of 12
(450 Views)