NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

C# Customer User Interface of Teststand

Solved!
Go to solution

Hello, I am a new developer of Teststand, mainly using C# language. I am trying to create a customer User Interface based on the example provided by NI: Building a TestStand UI with Native Controls, and it can running normally.


But I have a few problems need your help:

 


Question 1:
I used code similar to the following to load the seq file to be tested:

AxSequenceFileViewMgr1. Sequence=axApplication Mgr1. OpenSequenceFile (path) GetSequence (0);


However, when I prepared for testing using the EntryPoint of TestUUTs, I found that the ProcessModel file was specified in advance in Mainmenu Configure--Station Options--Model--Station Model.
Is there a way for me to specify the ProcessModel file through programming? (For some reasons, I will customize the original official ProcessModel file and call the customized ProcessModel file in the test)

 

 

Question 2:
There will be a step in my test seq file that calls the scanner to scan the serial number of the product and store it in the local variable. After this step, is there any way to transfer the serial number from local to the variable specified in modeldata so that it can be displayed on the interface and generated in the report? Is it through UIMessage? Or can the variables specified in modeldata be written directly through programming? I would greatly appreciate it if you could provide a simple example

 

 

Looking forward to receiving an answer, many thanks for U!

Message 1 of 6
(392 Views)

Regarding question 2, I found some interesting content from the community.

It seems that is a common question, I will try to solve it asap.

Message 2 of 6
(374 Views)

If your StationSettings allow it, you can start an exection via the API with any ProcessModelFile you specify

 

https://www.ni.com/docs/de-DE/bundle/teststand/page/executing-sequences-using-api-net.html

 

 

Message 3 of 6
(355 Views)

Thank you, Oli_Wachno.


I have seen this example before, but my understanding of this knowledge is not complete. I have always believed that it can be used this way if subsequence needs to be run after the manager is enabled.


So can I assume that when I start the test environment through ApplicationMgr, I can also use:

 ApplicationMgr. GetEngine(). GetSequenceFileEx

and

 ApplicationMgr.GetEngine().NewException

 to complete the test, and:

1. I can specify test.seq and Processmodel.seq according to my needs

2. UIMessage mechanism still handled by axApplicationMgr_UIMessageEvent and axApplicationMgr_UserMessage

 

Is it right?

Message 4 of 6
(339 Views)
Solution
Accepted by topic author Andrew2024

Once you have the Engine Object, you can use the whole API.

 

BTW ... not NewException 😉

Message 5 of 6
(321 Views)

Yes, NewException is my mistake, it is NewExecution.

Maybe I know how to do that.

Thank you so much! Oli_Wachno.

0 Kudos
Message 6 of 6
(308 Views)