10-29-2024 08:16 AM
Hi,
I'm trying to get the ThisContext object of a specific sequence.
I'm using :
var = (Sequence)propertyObj.GetPropertyObject("RunState.SequenceFile.Data.Seq[1]", 0); to go to the specific sequence from the main sequence but I want to get to the selected sequence ThisContext object
10-30-2024 12:36 PM
You want the to use ThisContext in a code module? The best way is to just pass the context as a parameter to your code.
10-31-2024 01:55 AM
In my code I want to load the limits to all of my sequences in one run. so, I need the ThisContex object of each sequence.
My problem with the example I provided is that when I run the code in this way the TestStand will insert the limits after it finish running (so it will do the testing of the previous limits and not the new one).
10-31-2024 02:13 AM
Hello,
TestStand provides a 'build-in' mecanism to load dynamically properties - and Limits of your test sequence are properties. See Import Properties from Excel in TestStand using Property Loader Step
The Property Loader is a tool that you can use from the Sequence Editor to import and export properties values, AND you can alose use the Property Loader step type to import property values at run-time - values that you may have edited from the exported file. Differents file format are available (Excel is not the only one).
Pick a look in TestStand Example, I guess there is one to illustrate Property Loader step usage.
This may address your need - whithout reinventing the wheel?
Hope this could helps,
10-31-2024 03:14 AM
10-31-2024 03:28 AM - edited 10-31-2024 03:28 AM
A straighforward one ? I guess no (IMHO, I might be wrong)
You may provide feedback and this new feature request on TestStand Idea Exchange (check if someone didn't already ask for this kind of feature).
On the other hand, developping something specifically because JSON is the format requiered will requiere time for development, testing, maintaining this, etc. This may be an argument to go to another format, for your supervisor.
I don't have the whole picture, what is the origin of these JSON files? Who does provide them? Another (workaround ?) solution may be to extract data from your JSON files and format it into a Property Loader supported text format (or wharever you want that is supported byt the Proerty Loader. And then use build-ins features.
10-31-2024 11:48 AM
@Mathieu_R. wrote:
A straighforward one ? I guess no (IMHO, I might be wrong)
You may provide feedback and this new feature request on TestStand Idea Exchange (check if someone didn't already ask for this kind of feature).
Already submitted, see: Property loader JSON support - NI Community
For those that like the idea, please use the kudo star at the above link
10-31-2024 12:29 PM
@Liorbu wrote:
My supervisors want it to work for json files only... is there a solution?
There is a way to save property objects to a JSON string.
See: Solved: Re: TestStand Report Results as JSON - NI Community
Please note that this converted the ResultList to JSON. You could try other property objects. Also, I don't see a way to convert a JSON string back to a property object.