LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help issues with arrays

Solved!
Go to solution

I need to be able to set the array "ingredients" to search on max 5 rows of the ingredients entered by the user referring to the array "All". then return the array row that contains at least 1 of the words in the array "Set using all specified ingredients" there must be no repetition of rows.

 

gc26p.pngQQUEu.png

 

0 Kudos
Message 11 of 22
(929 Views)

Thank you for translating your Homework Assignment from Italian to English for us.  I'm not 100% certain I understand the assignment, so I cannot tell if your homework answer is correct, but you should be able to tell, right?  

 

So here are some suggestions to help you debug your LabVIEW program.

  • Slow it down and watch it run.  Do you see the fifth Icon on the Toolbar (it looks like a Light Bulb).  That is called "Highlight Execution".  If you turn it on and run the program, you will see "data" moving through the wires, and can even see the values as they go by.  See if you can find where it does something "unexpected" or "undesired".
  • Another thing to do is to click on a wire and click "Probe" from the Drop-Down menu.  Every time the Wire passes data, the data will appear in the "Probe Window".  Probes can even handle Arrays.
  • You seem to have basic LabVIEW techniques for Arrays mastered.  I'm impressed that you used a For Loop with a Stop condition, and also used a Conditional setting on a Indexing Tunnel.
  • I'm confident that with a little more effort on your part, you can find and fix the bug in this program.

Bob Schor

Message 12 of 22
(909 Views)

I have been working on it for several days but I have no idea how to extend the array to more rows.
Basically when you write a word that is in the array "Set using all specified ingredients" below the 5th line nothing appears on the array below it same exact thing for the array "ingredients" where you cannot write beyond 2 lines.

can you help me?

0 Kudos
Message 13 of 22
(891 Views)

It is NOT appropriate to plagiarize code that is not yours without giving links to the earlier discussion.

 

I am not even sure why you started a new thread thus I merged the two discussions into one.

Message 14 of 22
(867 Views)

@GamerBlock27 wrote:

I have been working on it for several days but I have no idea how to extend the array to more rows.
Basically when you write a word that is in the array "Set using all specified ingredients" below the 5th line nothing appears on the array below it same exact thing for the array "ingredients" where you cannot write beyond 2 lines.

can you help me?


Size the controls Appopriatly and hide the index displays.  The user cannot type into elements the cursor cannot select.


"Should be" isn't "Is" -Jay
0 Kudos
Message 15 of 22
(859 Views)

@GamerBlock27 wrote:

Basically when you write a word that is in the array "Set using all specified ingredients" below the 5th line nothing appears on the array below it same exact thing for the array "ingredients" where you cannot write beyond 2 lines.

can you help me?


  • The "Set using all specified ingredients" is an indicator and its content depend on the code after running. It is not for user inputs! Make sure you know the difference between a control (=data source) and an indicator (=data sink)!
  • The "ingredients" is an array and you can enter as many elements as you want. There are no "lines", each entry is limited to one line.
  • To return all rows that contain at least one (instead of all!)  of the ingredients, you simply need to change the code logic. Should be trivial! (Actually it is simpler!)
  • What do you mean by "there must be no repetition of rows". Each row is unique unless the (ALL) input already contains duplicate rows. If that is the case, solve the problem upstream!

 

I recommend to first continue with the basic tutorials.

0 Kudos
Message 16 of 22
(854 Views)

@altenbach wrote:

It is NOT appropriate to plagiarize code that is not yours without giving links to the earlier discussion.

 

I am not even sure why you started a new thread thus I merged the two discussions into one.


when i saw the post, I was surprised to someone with Neat code without knowing how to handle array's. Now i am clear from where the initial code was.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 17 of 22
(845 Views)

@PalanivelThiruvenkadam wrote:

@altenbach wrote:

It is NOT appropriate to plagiarize code that is not yours without giving links to the earlier discussion.

 

I am not even sure why you started a new thread thus I merged the two discussions into one.


when i saw the post, I was surprised to someone with Neat code without knowing how to handle array's. Now i am clear from where the initial code was.


JB_0-1682108043676.png

I'm still not sure what the blue wires do.  If OR Array is true stop the inner loop wire OR array out of the inner loop on a last value tunnel to the conditional tunnel boolean input.

 

EDIT: perhaps the requirements have changed a bit?......

 


"Should be" isn't "Is" -Jay
0 Kudos
Message 18 of 22
(838 Views)

@PalanivelThiruvenkadam wrote:


when i saw the post, I was surprised to someone with Neat code without knowing how to handle array's. Now i am clear from where the initial code was.


When I first saw this post, seriously, my first thought was "That looks like Altenbach's coding style."  Those times when you see a snippet that you can study for 30 minutes and still not know what is going on but somehow, it cleverly outputs the correct answer and looks awesome at the same time...that's how I felt.  Makes sense now.

aputman
0 Kudos
Message 19 of 22
(826 Views)

@JÞB wrote:
I'm still not sure what the blue wires do.  If OR Array is true stop the inner loop wire OR array out of the inner loop on a last value tunnel to the conditional tunnel boolean input.

 

EDIT: perhaps the requirements have changed a bit?......

 


The requirements were not entirely clear but the current code finds only rows that contain all of the listed ingredients, so if the array contains 2 ingredients, the loop stops after two have been found. If fewer were found when the loop stops, the entry is filtered out by the conditional tunnel. There are many other ways to do all this of course.

0 Kudos
Message 20 of 22
(818 Views)