04-30-2018 11:51 AM
I have a potentially outlandish question. (Not that that's unusual.)
Does anyone know of a way to programmatically load a property loader source prototype into a property loader step at run time?
I played around with the TestStand API and property loader DLLs, but was unable to figure it out.
Here's the context:
We make reusable sequences that are used to test a variety of products, in a variety of test scenarios. Given that use case, using what is now the legacy property loader, we used to point a given sequence to a particular property file, a dynamically generated group name ("data marker"), and load the properties there. The group name was generated based on the socket number, the UUT type, its mode, etc.
We really want to adopt the newer property loader, but we'd like the flexibility of the legacy property loader, so I'm thinking of wrapping it in a custom step type and generating the property sources at run time given parameters supplied. Yes, we could be rigid and apply group names and their unique ID hashes to all products, but sometimes that's very cumbersome for our tastes and makes a lot of extra work for us.
Thanks as usual,
Solved! Go to Solution.
05-01-2018 08:36 AM
In the new property loader, you can create multiple groups using Import/Export Properties Tool. Once you determine the file format, you can create multiple groups by hand. I am assuming you already know this part.
Based on my understanding of your post, I will interpret the question as: 'How can I dynamically (using TestStand expressions) choose what group should be imported using new property loader and new file format?'
=> You can use preconditions (feature introduced in TestStand 2016 SP1) for each group.
To configure the precondition for each group, do the following:
- Perform 'Load Source Prototype' (This is the button you are showing in the snapshot)
- Launch 'Property Selector Dialog' (Use the last button present in the snapshot to launch the dialog)
- The dialog will list all the group present in the property loader source. For each group, use TestStand expression to specify 'Precondition' for the group.
- You can also use "$(GroupName)" and "$(GroupID)" macros in the expression which will be evaluated to the group name and id in the property loader source.
Also, regarding group name and ID, you can use any value for them. Just make sure they are unique.
If you want to use new property loader with legacy file format, you can achieve the same by doing the following:
- In the new property loader, select the source type to be the legacy formats (Ex: NI Legacy Comma Delimited Text)
- In 'Target File and Source Settings', go to the 'Plugin Options' and launch the configuration dialog. You can specify the data marker which is used in the legacy property loader.
05-01-2018 01:34 PM
Thanks once again for helping me out. You are correct in interpreting my question as,
'How can I dynamically (using TestStand expressions) choose what group should be imported using new property loader and new file format?'
I truly appreciate your explanation, which is helpful. I was aware of the preconditions, but it seems like we have to manually import the group names from the UI. Is there a way to import the group names at run time without the UI?
05-08-2018 10:49 AM - edited 05-08-2018 10:51 AM
Since this thread was left open, to summarize:
Based on discussions with NI personnel there is presently no way to load a prototype at runtime, nor is there presently a way to specify an arbitrary property group name at runtime.
The anticipated use of the property loader architecture, at least for now, is to specify a property group name at edit time and load the prototype. Then at runtime use preconditions to select properties from those with prototypes specified at edit time. This of course means that the developer has to anticipate all possible property groups needed in advance and load their prototypes.
I've formally asked for the feature of being able to specify an arbitrary property group name at runtime.
"Socket_Properties_" + Str( RunState.TestSockets.MyIndex )
That may be implemented in the future, but certainly don't quote me on that as the "if" and "when" are up to NI R&D.
A warm thanks to Shashidhar for graciously answering my question and to others at NI with whom I interacted on this topic.