NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Get access to a Remote Engine in c#

Hello,

I created an entry a few days ago, but now I have a different problem. I am supposed to develop a C# application which has no UI, from which I can start sequences in a TestStand UI. For this, I read the topic "Remote Sequence Execution" in the manual for TestStand 2022 and made the respective changes in TestStand 2022.

 

Now to my actual question: How can I now access my remote engine in C#? I have placed a COM reference on National Instruments REngine. I was also able to create an instance of the remote engine. However, I do not know how to tell this instance which engine instance I want to access remotely. I cannot find any method by which I can assign some IP or something similar. Similarly, I would be interested to know where, after I have activated the remote engine access in the TestStand 2022 UI, I can get information about IP or something similar.

 

I also looked at the UI operator example in the directory "National Instruments\TestStand 2022 (32-bit)\UserInterfaces\Full-Featured\CSharp". Unfortunately, I could not find anything helpful since, as mentioned above, I do not need a user interface and therefore do not have an AxApplicationManager.

 

In short: I do not know how to assign an actual engine to a remote engine instance in C#.

 

Thank you very much for your help!

 

Best regards,

 

Tim

0 Kudos
Message 1 of 8
(973 Views)

Tim,

 

This feels like you are doing the wrong thing for what you need.  Is your requirement to simply run a "headless" test?  Meaning everything is done through the command line?    If so this can be achieved very easily using the command line arguments to the Operator Interface.

 

This is probably the most relevant:

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000P9lvSAC&l=en-US

 

If you want to see them in your UI or sequence file:

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019ZQzSAM&l=en-US

 

Didn't read this too in depth but might have some relevant info:

https://forums.ni.com/t5/Continuous-Integration/TestStand-command-line-options/td-p/3949195

 

 

Maybe you can clarify your goal from a very high level and we can point you a little better.

 

Hope this helps,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 8
(943 Views)

Hello jigg, First of all, thank you for your response! Unfortunately, my task is not to develop a command line application.

 

I'll try to describe my task from a distance:

 

  • I have to control TestStand from another computer.

  • This computer unfortunately does not support Windows.

  • However, this computer does support TCP 

My task:

 

  • TestStand is running on a Windows PC.

  • I need to develop a C# application that runs on the Windows PC.

  • This application establishes a TCP connection with the non-Windows PC.

  • Through this TCP connection, I receive commands in my C# application, such as starting an execution, stopping an execution, etc.

  • Within my C# application, I should control an already running TestStand application using the TestStand API.

In essence, I need to control a TestStand application through my own program.

 

Example:

I want to run a sequence in TestStand 2022. However, this should not be done by pressing the green run button in the UI, but instead through a C# application. Essentially, remotely controlled.

In summary:

I have a system that does not support Windows, and from there, I need to communicate via TCP to a Windows PC to instruct it to execute a command in TestStand.


Best regards,
Tim

0 Kudos
Message 3 of 8
(935 Views)

May be you can have a look at GitHub - ni/grpc-teststand-api: Early Access Release of gRPC client and server examples for the Test...

-------------------------------------------------------
Control Lead | Intelline Inc
0 Kudos
Message 4 of 8
(925 Views)

Thank you for clearly spelling out your need.  This makes total sense and I've done something similar before.

 

Basically in TestStand a User Interface is a TestStand application that can run sequences.  Whether or not the front panels are visible are not important.  For this sake we'll call it a TS App (TestStand Application).   In each TS App there are multiple pieces that interact with the TS Engine.  Those are what we call Manager Controls: Application Manager is the most important.  There are 2 others that deal with sequences that are opened but not executing and executions (which are just sequence files that are executing).

 

If I were in your shoes I'd write a custom TS App that can handle the TCP commands and then based on the TCP commands coming in it could then tell the manager controls to do their things to the engine (examples: start execution, terminate, stop, get results, etc...).

 

I have to admit the gRPC option would be better if possible.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 5 of 8
(923 Views)

Thank you for your quick response!

So, should I discard my idea of controlling the TestStand 2022 UI via the Remote Engine? Theoretically, this could save me from developing my own UI.

 

Best regards,

Tim

0 Kudos
Message 6 of 8
(893 Views)

The remote engine is used for one TestStand sequence to talk to another one.  I don't think it will do what you want.  And I'm pretty sure both machines have to have TestStand running which means you will have to use Windows on both machines... which negates your whole plot here.

 

In the past when I've needed to do remote TestStand execution I just call the seq editor via a command line with arguments to start the test.  Then I just watch for the process to finish.   If you need to pass more data than just "start the test" then you will still need to create a User Interface... but it doesn't have to display anything.  It can just be a TCP handler that calls engine commands on the TestStand engine.  

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 7 of 8
(877 Views)

@Entropie wrote:

Hello jigg, First of all, thank you for your response! Unfortunately, my task is not to develop a command line application.

 

I'll try to describe my task from a distance:

 

  • I have to control TestStand from another computer.

  • This computer unfortunately does not support Windows.

  • However, this computer does support TCP 

My task:

 

  • TestStand is running on a Windows PC.

  • I need to develop a C# application that runs on the Windows PC.

  • This application establishes a TCP connection with the non-Windows PC.

  • Through this TCP connection, I receive commands in my C# application, such as starting an execution, stopping an execution, etc.

  • Within my C# application, I should control an already running TestStand application using the TestStand API.

In essence, I need to control a TestStand application through my own program.

 

Example:

I want to run a sequence in TestStand 2022. However, this should not be done by pressing the green run button in the UI, but instead through a C# application. Essentially, remotely controlled.

In summary:

I have a system that does not support Windows, and from there, I need to communicate via TCP to a Windows PC to instruct it to execute a command in TestStand.


Best regards,
Tim


 

Haha, this is easy, really easy
I can complete the entire game of your task
The C # code is expected to be fully implemented in no more than 500 lines, and it also includes the ability to output various information, such as detailed step test information,total test results,native xml report
Even outputting reports in third-party custom formats (XLS, XML, HTML, PDF)... [This would add a bit more code, possibly 50-200 lines]

0 Kudos
Message 8 of 8
(339 Views)