05-06-2014 11:37 AM
LV 2013.1, LV RT 13
I have a problem similar to this post, but that ended up solving a different problem.
I need the labels from the elements of a TYPEDEFed cluster, running from an RTEXE on an RT target.
This code works fine in the DevSys, because the front panel is available. But when compiled into RTEXE, the CONTROLS[ ] property returns an empty array.
I tried turning OFF the REMOVE FRONT PANEL setting in the Build Spec for this file, but nothing changed.
I got past the emergency by creating a constant array with the names in it, but I intended to use the TypeDef as the master source, so that if any of the spelling changes, the labels array that I extract will automatically follow suit.
Is that possible?
Blog for (mostly LabVIEW) programmers: Tips And Tricks
Solved! Go to Solution.
05-06-2014 11:43 AM
Use the Variant library functions instead. I posted an example that does this (including for nested clusters) just yesterday:
05-06-2014 12:01 PM
Excellent ! I rarely use Variants because they're usually slower than other solutions, but this is one case where they are the best solution.
I'm caching the results, so if they're slow, I don't care much.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
05-06-2014 01:16 PM
@CoastalMaineBird wrote:
Excellent ! I rarely use Variants because they're usually slower than other solutions, but this is one case where they are the best solution.
I haven't benchmarked it, but do you have some experience that suggests that variants are slower than property nodes for this sort of thing? The variant approach has the advantage that it doesn't tie up the user interface thread. Also, I can't find the post right now, but I think I remember seeing comments that the variant VIs are faster in 2013 than they were in 2012 (or maybe it was 2012 versus 2011).
05-06-2014 04:32 PM
I didn't mean variants were slower in this context; I meant compared to local variables and terminals and things.
I just compared my original solution (which doesn't work on RTEXE) to your suggestion (which does) and the difference is dramatic:
Blog for (mostly LabVIEW) programmers: Tips And Tricks