04-03-2017 02:45 AM
In teststand II,
Develop a small sequence that programmatically inserts a locals variable using the activex/com adapter, the sequence context, and the Property Objict class?
04-03-2017 05:25 AM
The steps needed to dynamically add a variable are covered by this KnowledgeBase article:
How Can I Programmatically Create Variables in TestStand?
Just change the lookupString to the local name you require, eg. "Locals.NewVariable"
Regards,
Charlie Rodway | Principal Software Engineer | Certified TestStand Architect (CTA)
Computer Controlled Solutions Ltd | NI Silver Alliance Partner | GDevCon#1 Sponsor
04-03-2017 08:36 AM
The TestStand API can be called directly from expressions, so there is no need to use the ActiveX/COM adapter to call the TestStand API from a sequence.
Hope this helps,
-Doug
04-03-2017 09:07 AM
I'd prefer to call it as an expression, but it looks like the homework question calls for an ActiveX step.
Charlie Rodway | Principal Software Engineer | Certified TestStand Architect (CTA)
Computer Controlled Solutions Ltd | NI Silver Alliance Partner | GDevCon#1 Sponsor
04-10-2017 10:15 PM
Hi, Charlie Rodway
Thank you very much.
would you PLS aslo let me know how to call it as an expression?
04-18-2017 04:54 AM
As an expression, you could use:
Locals.NewSubProperty("NewString1", PropValType_String, False, "", PropOption_InsertElement + PropOption_DoNothingIfExists)
You could also use the following expression if you want to set the value at the same time, eg "TEXT":
Locals.SetValString("NewString2", PropOption_InsertElement + PropOption_DoNothingIfExists, "TEXT")
I hope this helps,
Charlie Rodway | Principal Software Engineer | Certified TestStand Architect (CTA)
Computer Controlled Solutions Ltd | NI Silver Alliance Partner | GDevCon#1 Sponsor