LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Requirements for right click 'Insert Build Array' for broken scalar-to-array wires?

Create a 1D array of strings. Wire it to a Transpose 2D Array primitive, or the 2D data input of Write To Spreadsheet File. You've connected a 1D array to a connector looking for a 2D array, so the wire will be broken. Right click on this, and you'll be given the option to Insert Build Array on the RCM. The same works for many scalar-to-array connections, such as when you try wiring a Boolean constant to And Array Elements.

 

This behaviour's not consistent, however. Try wiring a numeric constant to Sum Array Elements. Ignoring the fact that this is nonsensical, you're not offered the option. Same for connecting a numeric constant to the input of a Mean calculation VI.

 

The reason I ask is that it's a neat feature I'd use from time to time to make my life easier if I could force its use. For instance, I have a TDMS logging FG which takes a 1D array of clusters of string + variant data. Sometimes I only want to write one property; sometimes I want to write multiple. I'm aware I could make the VI polymorphic if I cared, but having a right click 'Insert Build Array' option every time I forgetfully wire a single cluster to the FG would be fun!

---
CLA
0 Kudos
Message 1 of 3
(2,210 Views)

@thoult wrote:

 

This behaviour's not consistent, however.


I agree behaviour is inconsistent. I don't have a solution but can recommend couple of very good alternatives if you are not aware of them already.

 

QuickDrop https://decibel.ni.com/content/docs/DOC-9573

Add these shortcuts to your LabVIEW.ini file https://decibel.ni.com/content/docs/DOC-8344

 

Select the broken wire, Ctrl - Space, type 'ba' for build array and then Ctrl-I

 

If this is a task you perform frequently, you could just write your own QuickDrop plug-in and assign a Shortcut using the template provided which inserts build array by default.

 

I would also recommend checking out the other shortcuts and plugins available.

 

JKI RCF https://decibel.ni.com/content/docs/DOC-5565


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to the Test Automation user group: UK Test Automation Group
Message 2 of 3
(2,189 Views)

Thanks for the suggestions.

 

I currently use QD to do this, but it's a native LV feature for some primitives and core VIs.

 

If it were a connector property, for instance, I could create sub VIs for distribution that could be interacted with the same way. Consumers of those VIs wouldn't have to use any additional tools to interact with it like this. The straightforward solution is to create a polymorphic VI, but it's the kind of thing that feels like it should be accessible as it clearly already exists!

 

There's a type conversion plugin for RCF that supposedly does this too.

 

It doesn't really affect my productivity, but it's one of those things that makes me curious 🙂

---
CLA
0 Kudos
Message 3 of 3
(2,174 Views)