LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
altenbach

Add a Terminal that Defines Default Data for building arrays from mismatched parts

Status: New

(This is an idea related to Jack's idea here, which however deals with "reshape array".)

 

When using "built array" with parts that are mismatched in lenght, the largest input wins and the rest are padded with the default value for the given datatype (zero for numerics). This is often not desirable, for example when graphing multiple plots.

 

Padding with zero causes extra data (zeroes) to show on the graph that did not exist in the original wires. A more desirable option here would be to pad with NaN so only actual data is graphed.

 

My suggestion is to add an optional input to "built array" that allows defining the pad value is case the inputs are mismatched.

 

Here is an example how it could look like. (of course the icon would probably need to change a little)

 

 

 

8 Comments
Darin.K
Trusted Enthusiast
altenbach
Knight of NI

Thanks Darin, this looks similar but for some reason I did not find it with a casual search before posting. 😉

 

For reasons outlined by Jack in the idea I linked, this idea here is a bit more versatile because it allows any pad value for any data type. For example for DBL we might want +Inf and for signed integers me might want -1, for example. For paths we might want to pick between "empty path" or "not a path". For strings we might want the string "---missing----", "empty" or "N/A" instead of the current empty string or similar. For arrays of cluster we might need to pick a different default for each cluster element.

Broken_Arrow
Active Participant

Kudos, I like it, but I think it should be an option, activated such as the way we turn on Concatenate Inputs.

Richard






altenbach
Knight of NI

You mean as in "right-click...show default pad value terminal" or as in "right-click...pad with X". Since there are so many possible choices (especially for e.g. strings), I think we need a terminal. This also allows for changes at run time.

 

I think all it needs is a small square a few pixels away from the right top/bottom edge to outline the terminal. We still need to be able to grow the node upwards and downwards even if the terminal is wired. Mechanically, it should behave similar to the cluster input of the bundle node. 

Ray.R
Knight of NI

Nice idea.  I would suggest having a separate build array function to the existing one.  With a different icon, of course. 

 

I'm sure that's what you meant.

Kjell-E
Member

THIS would be awesomely useful!

---------------------------------------------------

Project Engineer
LabVIEW 2009
Run LabVIEW on WinXP and Vista system.
Used LabVIEW since May 2005

Certifications: CLD and CPI certified
Currently employed.
Timmar
Active Participant

I like it,

 

Can I suggest an extention:

Option 1: Pad with Value (as suggested),

Option 2: Pad with a default array

 

Could be handy when dealing with spreadsheets is "default" values omitted.

iTm - Senior Systems Engineer
uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT
altenbach
Knight of NI

> Option 1: Pad with Value (as suggested)

> Option 2: Pad with a default array

 

My idea already incorporates both options. You get the default pad value (and the current behavior!) if you leave the terminal unwired.

 

Did you have something else in mind?

 

I don't quite understand the "spreadsheets" argument. How does the idea relate to spreadsheets?