LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Select - Possibility to do NOTHING on alternative option ?

I have a SELECT function. It gets controlled by a 0/1 bool.

 

If it's 'true', i want to forward a 2D-String Array (i connected that, and it works well).

 

If it's false, i basically want it to not forward anything at all - but im forced to connect the 'false' terminal with something.

I don't want to forward an completely empty 2D-String-Array in that case (my sloppy makeshift solution so far), i really want it to just forward nothing or in other words "have no activity" (e.g. it should only react if it gets a true signal).

 

Special difficulty: Case Structure as alternative is no option here either. 

0 Kudos
Message 1 of 4
(3,235 Views)

Well, I'm afraid you've overconstrained yourself.  A Case Structure IS the solution here and it's unclear why you think you should reject it as an option.  The Select function merely passes along 1 of 2 possible data sources -- downstream code WILL still execute regardless of which data source is selected.

 

 

-Kevin P.

 

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 2 of 4
(3,227 Views)

If two different things should happen as a function of the boolean you need two different code alternatives, which a case structure provides. Who makes the rules of "special difficulty:no case structure allowed"??? (Is this a puzzle or homework???) Typically all structures/functions that come with LabVIEW should be allowed, so if you require exceptions, we need to know why.

 

A select only creates data alternatives, which must be a 2D array of strings here, even if one is empty. (that's not sloppy). The nice thing is that arrays can be empty, while e.g. scalars always need to contain a value. If you are later auto-indexing the array on a FOR loop, you'll get zero iterations as required, and the loop code will not execute (without a case structure needed!).

 

I have the feeling that you are overthinking this. It would help if you can explain what you are trying to do from a more global point of view. I am sure there are plenty of great solutions.

 

Also try to get more defined terms, or at least explain in detail what they mean to you in this case. (e.g. term like "forward", "0/1 bool", or  "activity"). Can you attach some code draft?

0 Kudos
Message 3 of 4
(3,192 Views)

If you want to react to a value change, I'd look into the event structure.

 

Or put all actions in one case of the case structure, and do nothing in the other.

 

You can't have 'nothing' as input. If you want an empty array (!=nothing), wire an empty array.

 

0 Kudos
Message 4 of 4
(3,157 Views)