06-01-2019 02:33 AM
hi
Im just newbie in labview and . I have a problem on how
after i compare , i need the output to be like 2 condition
output 1 output 2
#sets of number less than 3 #sets of no more than 3
hope anyone could help me . I try to find the related topics..but still cant get thow..
Appreciate any help
06-01-2019 01:38 PM
Spend more time with the LabVIEW Tutorials. Be sure that you understand the Principle of Data Flow, which means that you can write your entire program without needing a single Frame structure (because everything is connected by wires and data travels in those wires). Just for fun, right-click the Frame Sequence and choose "Remove Sequence" -- your code will run exactly as before (but will be neater, more compact, and easier, I think, to read).
It is not clear what type of output you desire. What do you mean by "#sets of number less than 3"? Is this the same as saying "A set of all numbers < 3"? [I'm confused by "#sets"]. Note that a "Set of numbers < 3" and a "Set of numbers no more than 3" are almost the same except that the number "3" can be in the second set.
I see you are using LabVIEW 15. Learn about the types of output tunnels for the For and While loop. In particular, learn how the Conditional Indexing Tunnel makes creating arrays very simple (with no need for the Build Array function).
Do not use Local Variables -- they are a Trap for the Unwary. In your code, you can simply put the Indicator where your Local Variable is now wired.
Bob Schor
06-02-2019 07:48 PM
You're fairly close to a working solution. As usual () I agree with Bob Schor that some additional reading from the LabVIEW tutorials and knowledgebase articles would help you with this problem.
The conditional terminals that Bob mentioned are key to the simplest solution to your problem.
Note that within your current loop, you're using "Greater Than" as a comparison (didn't you want "Less Than", and "Less Than or Equal To"?
You want two different sets of outputs, so carry out two comparisons. Note that in your case, since your input is a set of random DBL values multiplied by 10, the chance of the two sets being different is miniscule. Perhaps you wanted to place values 0..2.999999999 in one group, and 3 to 10 in another?
If that is the case, consider which comparisons you need, and then place them in the loop.
In summary,