12-17-2012 07:01 PM
I try to make a case structure where the DO lines control is outside the case and is the one connected to the case selector? what should i put so that there will be no such error?
12-17-2012 07:32 PM
You description is not clear. Please show us some code instead.
What exactly is connected to the case selector?? Where is "there"?
12-17-2012 07:46 PM
I have attached the VI. The error is at the case selector. Thank you fro the help! 😃
12-17-2012 08:05 PM
You are wiring an array of booleans to the case selector. How is the case structure supposed to know which needs to be true? I'm guessing in this case you want to use an "or array elements" primative.
12-17-2012 09:11 PM
by using an Or array, i will be able to connect the DO lines connector then?
12-17-2012 09:14 PM
Well, you need to decide what you want. A case currently only hase two cases, but you have 2^N possible states.
See how far you get...
12-17-2012 09:16 PM
@altenbach wrote:
Well, you need to decide what you want. A case currently only hase two cases, but you have 2^N possible states.
- If the case should depend on a specific boolean from the array, use index array to get it.
- If the case should be true if at least one boolean is true, use "OR array elements"
- If the case should be true if all booleans are true, use "AND array elements".
- If you want a special case for each boolean, wrap a FOR loop around the case structure and autoindex on the array.
- If you want a potentially different case for each possible combination of booleans, use "boolean array to number", wire the number to the selector and create as many cases as needed..
- ... etc.
See how far you get...
Thanks for providing more detail...i got lazy.
12-17-2012 09:47 PM
I shall try the OR and For loop..but i will attach my current VI and the connection to the elvis. it works in such a way where all the first 2 controls of each DO lines need to be on then the LED will turn on. And the case selector still cannot connect with the Do lines even with OR comparison. I wish to do is LED can only turn on when button 1 of DO Lines 1 and DO lines 2 is ON or when control 2 of DO lines 1 and DO lines 2 are on. But with the current VI attached, LED can only turn on with all the buttons (1 and 2 for both) to be on.
12-17-2012 10:04 PM - edited 12-17-2012 10:08 PM
Some of the descriptions you are using are kind of confusing.
"first 2 controls of each DO line(s)"
"button 1 of DO lines 1 and DO lines 2"
"control 2 of DO lines 1 and DO lines 2"
What is the difference between "button 1" and "control 2". I am going to assume you mean the same thing when you say "button" vs. "control" but just decided to change terminology in mid-sentence
You need to write out a Truth table to describe what you need done. The way you have the description written, you are already using the word "OR" to describe the different situations. That is going to be a key part of your program.
This shows:
(DOlines button1 AND button2) OR
(DOlines2 button1 AND button2) OR
(DOlines button1 AND DO lines2 button1) OR
(DOlines button2 AND DO lines2 button2)
12-17-2012 10:27 PM
can the result be then connected to a NI Elvis Writer?