Michael Aivaliotis Posted April 4, 2017 Report Share Posted April 4, 2017 In the attached image found in the LabVIEW examples, you can see the code on the right. It shows how to add the attribute if it's not found. My question is why is the code on the outside of the IPE and not in the False case, on the inside? Quote Link to comment
infinitenothing Posted April 4, 2017 Report Share Posted April 4, 2017 The variant on the inside is referencing the child's data. The author wants to add the new attribute to the parent variant. Quote Link to comment
Michael Aivaliotis Posted April 4, 2017 Author Report Share Posted April 4, 2017 I'm blind. Right. I guess I'm trying to figure out the advantage of this programing method vs just using the "set variant attribute" primitive. I just want to add or update an attribute value. Not necessarily read it or access it for any reason. The primitive adds the attribute if it's missing anyway. Quote Link to comment
infinitenothing Posted April 4, 2017 Report Share Posted April 4, 2017 There's no advantage in the lookup case. That was just to show syntax. The advantage in the increment case is the same as with the other IPE border nodes. It provides a cleaner syntax and, if the child variant is large, it might improve performance by avoiding a copy. Quote Link to comment
hooovahh Posted April 5, 2017 Report Share Posted April 5, 2017 I saw some mild performance benefit from using the IPE for variant look ups instead of the primitives, but I remember it being a bit of a pain to test and use at times. I think something about creating an attribute if it didn't exist. Maybe it was just the way I was trying to use them. Edit: found my speed tests on the dark side for writing and reading attributes, it seems writing is going to be faster with the primitive, but a read that does nothing but return the value, is slower with an IPE than the primitive. Of course I'm sure NI intended on this feature being used where you perform a read, manipulate the data, and write it back in the same structure, which will probably result in even better performance. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.