LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Access TestStand Expression Browser using Step type in .NET

Hi,

 

I have written a simple StepType in C# (please see attachment). I wish to transfer the value entered by the user in the text field to TestStand.

The step type works fine, but now I want to open expression browser (using button f(x), somewhat similar to TestStand) and access TestStand variables and then enter this variable in the text field.

 

I have seen a similar example "HP34401a_StepTypeExample.seq" with custom step written in CVI (delievered with TestStand) but I need one in C# which could explain to which library do I have to make refrences, which functions are available (help files if possible).

 

Any pointer would be of great help.

 

Regards

RB

0 Kudos
Message 1 of 6
(4,078 Views)

Update: Added reference to dotNet.TestStand.Interop.API assembly, but I still lack an example in .NET.

0 Kudos
Message 2 of 6
(4,068 Views)

Hi,

 

if you want to use the Operators/Functions provided in TestStand in your code module, you can use the method  EvaluateEx()

TestStand provides two methods exposed by PropertyObject class called Evaluate() and EvaluateEx(). You can pass each method a string with an expression that contains TestStand Operators/Functions and a variable or property. TestStand will return the evaluated expression as a PropertyObject object reference.

 

A possible idea for you:

 

- Use TestStand UI ExpressionEdit Control

- Use string controls for your expressions,

- Use the Engine.CheckExprSyntax or Engine.CheckExpression methods to check the expression syntax.

0 Kudos
Message 3 of 6
(4,045 Views)

Thanks for hint. I could follow your advice to create propertyObject from sequenceContext. Will try your solution soon.

 

Do you have any example? I have all in CVI, searched intensively on NI website but no success.

0 Kudos
Message 4 of 6
(4,031 Views)

 

Hi

 

Unfortunately, I do not have any example.

 

You typically do not need to edit expressions in a user interface application, you can connect a manager control to a read-only ExpressionEdit control to display text information about the application state, such as the pathname of the sequence file selection or the name of the current user.

You can also use ExpressionEdit controls in dialog boxes for step types and in tools in which you prompt users to enter a TestStand expression.

 

You can find all Properties, Methods and Events you need:

ExpressionEdit

0 Kudos
Message 5 of 6
(4,024 Views)

"connect a manager control to a read-only ExpressionEdit" is not helpful at all.  Here is a thread that shows how to do this:

http://forums.ni.com/t5/NI-TestStand/Proper-use-of-quot-TestStand-UI-ExpressionEdit-Control-quot-in/...

 

Took me a little while to find this so I thought it was worth spreading the word.  

0 Kudos
Message 6 of 6
(3,615 Views)