From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
03-10-2013 06:36 PM
I am a beginner labview user,
I am making a case structure that currently has a random number (0-1) numeric wired to the selector terminal. The case structure is executing true/false events based on that. This is working fine. My problem is that I want the 0s and 1s to be predetermined. For example, I would want these numbers to be inputted one by one: 1 1 1 1 1 1 0 0 1 1 1 1 1 1. I do not want to manually click/input the numbers using numeric controls.
I used an array to do this but it is giving me an error when i am trying to wire the array to the selector terminal.
Please let me know if you need further clarification.
03-10-2013 06:48 PM
Try enclosing the case structure inside a for loop. Wire the array through the border of the loop. The tunnel will automtically set to auto-indexing.
Also it is generally not a good idea to wire floating point numbers to the selector terminal. Which case would you expect when the value is 3.5? Switch to an integer data type.
Lynn
03-10-2013 07:19 PM - edited 03-10-2013 07:30 PM
I dont quite understand. This is a simplified version of what i am trying to do. But instead of random 0 and 1, I would like chosen 0s and 1s. For example, the sequence 1 1 1 1 1 1 0 0 1 1 1 1 1 1
03-10-2013 07:23 PM
Is there a better method to do this other than an array? Remember, i do not want to input these numbers. They need to be hardcoded.
03-10-2013 07:35 PM
Array is a good way. If the arrays are large or could change rarely, storing the data in a file which could be read in and then processed might be an alternative.
You could also store the data as booleans directly.
Here is an example to give you a few ideas.
Lynn
03-11-2013 01:22 PM
Thank you!! That helped alot.