LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

why is there an error when i try to connect a control in the DO lines to NI Elvis writer under case structure?

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?

0 Kudos
Message 1 of 26
(3,134 Views)

You description is not clear. Please show us some code instead.

 

What exactly is connected to the case selector?? Where is "there"?

0 Kudos
Message 2 of 26
(3,131 Views)

I have attached the VI. The error is at the case selector. Thank you fro the help! 😃

0 Kudos
Message 3 of 26
(3,128 Views)

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.

0 Kudos
Message 4 of 26
(3,124 Views)

by using an Or array, i will be able to connect the DO lines connector then?

0 Kudos
Message 5 of 26
(3,118 Views)

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...

Message 6 of 26
(3,117 Views)

@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.

0 Kudos
Message 7 of 26
(3,114 Views)

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.

Download All
0 Kudos
Message 8 of 26
(3,109 Views)

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)

 

 

Message 9 of 26
(3,105 Views)

can the result be then connected to a NI Elvis Writer?

0 Kudos
Message 10 of 26
(3,101 Views)