09-11-2014 07:54 AM
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?
09-11-2014 08:27 AM
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
"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
09-11-2014 08:43 AM
09-12-2014 01:44 AM - edited 09-12-2014 01:46 AM
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
09-12-2014 02:25 AM
Hope now link is visible....
09-12-2014 08:43 AM
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:
09-12-2014 09:19 AM
09-12-2014 09:27 AM
09-12-2014 09:27 AM
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.
09-12-2014 09:28 AM - edited 09-12-2014 09:29 AM