06-18-2024 09:03 AM
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!
Solved! Go to Solution.
06-18-2024 10:16 AM - edited 06-18-2024 10:19 AM
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.
06-18-2024 02:05 PM
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
06-18-2024 06:59 PM
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?
06-19-2024 12:39 PM
Once you have the Engine Object, you can use the whole API.
BTW ... not NewException 😉
06-19-2024 08:46 PM
Yes, NewException is my mistake, it is NewExecution.
Maybe I know how to do that.
Thank you so much! Oli_Wachno.