LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

logic with array

Solved!
Go to solution

I have a program for my project but i need logic in it the logic i need is as follows:

 

* If a person enters a number greater than 8 it needs to display "please input a number 1 to 8"

*If a person enters in more than one 8 I would like it to display "please only put one 8"

*If the person does not put in an 8 than i would like it to display "please select a fear that is ranked 8"

 

here is the program i have so far if you can help it would be greatly apprecianted

 

 

 

 

 

Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
0 Kudos
Message 1 of 4
(2,909 Views)

I don't know how that snapshot of code you posted relates to your question.  Your code just searches for an 8 and return a villain that has it.  Where does your logic fit into that bit of code you posted?

 

To keep someone from entering a number greater than 8, use the date entry limits of the numeric control properties to prevent a number greater than 8 being entered.

 

To count the number of 8's, I would just use a For loop with autoindexing to step through the array.  If a number is equal to 8, than add one to a counter your store in a shift register.  When the loop is done, use a case structure where 0 gives your last message.  1 does not give a message, and 2 or default gives the message about not putting in more than one 8.

0 Kudos
Message 2 of 4
(2,903 Views)

I am kinda new to arrays in labview what would that look like?

 

 

thank you

Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
0 Kudos
Message 3 of 4
(2,899 Views)
Solution
Accepted by topic author Harold_Timmis

If you're new to arrays, I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours

 

See attached.

Message 4 of 4
(2,892 Views)