NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to instantiate TS Engine from C#?

I've got problems with instantiating TS Engine from C#.

 

What I want to do is a simple C# console application which returns into the console sequence file version number. Basically, I want to write inC# what inLV looks like this.

 

But I cannot instantiate the Engine by doing: EngineClass Eng = new EngineClass();

 

Wnat shall I do?

 

Capture.JPG

 

 

 

 

 

0 Kudos
Message 1 of 11
(7,594 Views)

If you look into the example user interfaces, you will see how the engine is retrieved:

 

First you will need the correct using:

 

// TestStand User Interface Controls
using NationalInstruments.TestStand.Interop.UI;

 

 

and afterward, just call the GetEngine routine and perform what you need to do

 

NationalInstruments.TestStand.Interop.UI.Ax.AxApplicationMgr.GetEngine().whatever

 

Certified-LabVIEW-Architect_rgb.jpgCertified_TestStand_Architect_rgb.jpg


"I won't be wronged. I won't be insulted. I won't be laid a-hand on. I don't do these things to other people, and I require the same from them." John Bernard Books

0 Kudos
Message 2 of 11
(7,590 Views)

Yes, I've seen this.

 

But would it work with Console Application Project? 

 

UI is designed to work with WPF (Windows Presentation Foundation), but I want only the console app.

0 Kudos
Message 3 of 11
(7,586 Views)

Hi,

 

Just take a look at this threads:

http://forums.ni.com/t5/NI-TestStand/Marshalling-the-IEngine-object/m-p/666852

 

there are a small projects which you might use for your console app as well.

 

Regards

 

Juergen

 

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 4 of 11
(7,569 Views)

http://forums.ni.com/t5/NI-TestStand/how-to-create-a-local-object-reference-variable-in-teststand/m-...

 

Hope now link is visible....

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 5 of 11
(7,564 Views)

Juergen,

 

I'd want to say it is visible but I have problem even in the first line. Of course I've referenced the assembly.

 

I think the difference is I'd like to build Console Application; what you sent was example of WindowsForm Application.

 

Have a look:

 

Capture0.JPG 

 

 

 

0 Kudos
Message 6 of 11
(7,553 Views)

Hi,

 

I have just open the example. It is Referencing to TS 4.0 Assembly.

Delete this refernce an point to your TS version on your maschine.

 

Regards

 

Juergen

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 7 of 11
(7,548 Views)

Hi,

 

i had done some stuff with the console. I can provide an example an Monday...

 

Regards

 

Juergen

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 8 of 11
(7,544 Views)

Your example works fine on my machine.

Reference was automatically updated.

 

In your example and in my code I'm refering to the same version.

 

I think the problem is somewhere else.

 

I've read http://zone.ni.com/reference/en-XX/help/370052K-01/TOC71.htm but with no real help from it.

0 Kudos
Message 9 of 11
(7,543 Views)

@j_dodek wrote:

Hi,

 

i had done some stuff with the console. I can provide an example an Monday...

 

Regards

 

Juergen


 

 

O!, That would be great!

0 Kudos
Message 10 of 11
(7,542 Views)