NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Starting teststand with specific sequence file from C#

Solved!
Go to solution

Hi All,

 

 

I would like to start teststand (for now just the development environment) with a given sequence file from a C# application.

The reason is as follows:

 

We have a C# TCIP server that can receive messages from clients connected to that server. When the server receives a message like "StartTestStand(C:/folder_bar/foobar.seq)" it should ideally startup teststand with the given sequence file, specified in the path.

 

it should close when the command "StopTestStand()" is recieved.

 

Can anyone guide me trough this process?

 

I have already found the following:

http://zone.ni.com/reference/en-XX/help/370052P-01/tsfundamentals/infotopics/net_ui_start_shutdown/  

https://forums.ni.com/t5/NI-TestStand/Calling-user-created-Teststand-sequence-from-NET/m-p/703125?qu...

 

The first link only starts the engine, not the development environment, whilst I can't get the second link to work, since I don't really know where to find (or get) the engine class. 

 

Background info: I've been looking into C# for a week, so I only have a basic understanding of it. I'm also not a "real" computer programmer, so please be gentle on me. :')

 

Thanks!

 

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

Hi,

 

Here is a link to Dynamically Set the Client Sequence File, this shows how to do this in LabVIEW however should show the process for C#,

 

I hope this is of help,

 

Thanks,

 

Amy

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

Hi Amy,

 

Thank you for your answer. Unfortunately it was not really what I was looking for.

However, it made me look into the examples and found the "TestStand UI with Native Conrols".

This gave me a really good starting point.

 

To summarize what I have accomplished so far and the workflow: 

- Initially there will be no teststand deployment running.

- A running TCPIP server will intercept a message, comming from a client. This message contains something like: DoMeasure(filepath, user).

- The server will then startup the deployment version, while automatically logging in to the given user and loading the sequence file, as given by the filepath.

- The sequence file automatically runs and finishes.

 

There is only one thing I want to do, that is automatically setting a UUT name at the start. As it is now, the user needs to fill this in and we don't want that.

 

For this, I want to make use of a CallBack override and then reading a FileGlobal variable "UUT_Serial" that I have created from within the server.

However, I have trouble creating this variable, since I can't find a way to find the Sequence Context. I want to use the API to retrieve the Sequence Context and not calling a function in teststand to hand it over to me.

 

My main question at the moment is:

Can the Sequence Context be obtained from the "AxApplicationMgr" or the "AxSequenceFileViewMgr" class?

 

(I will afterwards post my step-by-step solution here to this topic)

 

 

Thanks!

 

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

I have found the solution to the variable creation here:

 

https://forums.ni.com/t5/NI-TestStand/Globals-API-c-teststand/td-p/2254302

 

This means I have everything I need. I will document my solution later today or tomorrow.

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

Hi,

 

That's great I am glad you have everything you need now!

 

Thanks,

 

Amy

0 Kudos
Message 5 of 6
(3,983 Views)
Solution
Accepted by cedricmoers

I have attached the notes that I have taken during this tryout.

Please don't pay attention to spelling and syntax in this document, since it is merely a quick note for me to pick up at a later time.
Also my primary language is not English.

 

I hope it can help some of you in the future! 

Message 6 of 6
(3,974 Views)