LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
0 Kudos
falkpl

Conditional array build

Status: Declined

Any idea that has not received any kudos within a year after posting will be automatically declined. 

 

For speed of development and ease of reading code I would like to add a contitional array build function.  I use a build inside of a case structure where the true case appends on to the array and the false case does nothing,  why even have the case structure to hide empty code and clutter up the block diagram, the could be easly grouped into a singel function (see below).  I am for anything that cleans up block diagrams and speeds up coding.

 Conditional Build.png 

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
7 Comments
RavensFan
Knight of NI

What do you want the output to be if the condition is false?  I assume you are asking for the top input to be passed through untouched.  But what about cases where you might want to build onto the beginning of an array?

falkpl
Trusted Enthusiast

False would return the inputted array.  Great point on the array input to select, I was assuming the top index only but this would have to have a selector choose the override the input to send out on false.  Maybe a mechanism similar to the array to cluster where on development the user can select the index/input to use as the false output.

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
tst
Knight of NI Knight of NI
Knight of NI

The problem is that this suggestion can apply to every single primitive LV has (for example, why not do this for bundling a cluster or for the add primitive, which I think has actually been suggested here?).

 

Do you think that conditionally appending to an array is something so common that it requires this change? I know I don't.


___________________
Try to take over the world!
falkpl
Trusted Enthusiast

In my experience I would say that I do a conditional append of arrays more often than any other conditional operation (add or bundle for example) by probably an order of magnitude.  I wound not change the original bundle due to the massive changes to existing code but offer a new functional with the condition built in.  I find that I do a conditional build often and would use this to clean up my code. Similar functionality is build into the feedback nodes and I have found several occasions where it has allowed cleaner code (especially when printing the documentation).  Maybe these features would not be necessary.

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
tst
Knight of NI Knight of NI
Knight of NI

Just to clarify - this is not in a loop, right? I'm asking because there are two ideas in development (one of them yours) which combined should handle this in loops:

 

http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Conditional-auto-indexing/idi-p/918682

http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Add-a-quot-Concatenate-Indexing-quot-option-for-arrays...


___________________
Try to take over the world!
falkpl
Trusted Enthusiast

This is outside of the loop but similar idea.  I was looking of a way to do this without the loop, although the original idea would solve many of the use cases for such a function.

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
Darren
Proven Zealot
Status changed to: Declined

Any idea that has not received any kudos within a year after posting will be automatically declined.