LabVIEW Idea Exchange

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

Set index inputs on LVOOP array element accessors to Required

Status: Completed
Available in LabVIEW 2012

 

I almost never use accessors for array elements, but recently I did and I found something I didn't expect:

 

Create_Accessor.png

 

 

 

 

Unbroken_VI.png

 

 

The index inputs on the accessor VIs are set to recommended, so you might not notice that you didn't wire them in. I expected them to be required.

 

 

I checked and found out that this is a design decision - it was done that way because that's how the Index Array and Replace Array Subset primitives behave - they don't require you to wire in an index.

However, the argument could be made that those primitives behave that way because they can be expanded (although they apparently behaved the same even before the expansion feature was added).

 

In addition, the In Place Element Structure does have the index input set as required, so LV already has a counter-example built-in.

 

 

 

Since it's basically a choice between two valid scenarios, NI needs user input to decide, so that's where your votes come in.

Personally, I think it's less important what other features in LV do and more important to allow people to safely and conveniently use my classes. I would expect that in most cases I would want the inputs to be required, so that's the idea here - Change the index inputs on LVOOP array element accessors to be required by default:

 

 

broken_VI.png

 


___________________
Try to take over the world!
25 Comments
Darin.K
Trusted Enthusiast
I pretty much agree with Daklu. This actual change will barely affect me, and there is a simple workaround if it does. What does affect me is the precedent of a seemingly ad hoc process where a relatively small set of users votes based on the flavor of the day. I would think that there would be a global rule or philosophy and this case would be a simple application of that rule. I would much prefer a rule that I disagree with but understand than having to remember how dozens of these things are decided. This is how we get the IPES behaving differently. My own whacky preference is that "required" inputs in subVIs would not break code when unwired, but throw warnings instead. I happen to take warnings seriously, and I like to test half-wired code sometimes.
tst
Knight of NI Knight of NI
Knight of NI

Daklu, I agree with everything you said. Like I said, I requested this change because I knew it was a simple one which was more likely to be implemented than a change which would honor the "new controls required" preference. I also feel that this is the better choice, but since like others I don't use this too much, my opinion on how this should behave also has limited value (although it does basically have the value of "this is the opinion of a first time user").

 

 

 

P.S. All the code used to generate these VIs is found in the folder AQ pointed to. You could simply go into that folder and remove the error case structures from the VIT. Of course, that could break the code (although I doubt that) and it would need to be done on each machine.

 

Another alternative is to use the post-creation plugins AQ once pointed to - I'm assuming you get the reference of the created VI which you can then use to parse the diagram and remove the case structure.


___________________
Try to take over the world!
AristosQueue (NI)
NI Employee (retired)

> Of course, that could break the code (although I doubt that) and it would need to be done on each machine.

 

It would not break any of the scripting code.

 

> Another alternative is to use the post-creation plugins AQ once pointed to

 

That would also work.

 

MaryH
Member
Status changed to: In Beta
 
G-Money
NI Employee (retired)
Status changed to: Completed
Available in LabVIEW 2012