NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

TestStand API with Visual C++ .NET

Where can I download the Teststand API document or some other documents regarding to developing using Visual C++ .NET. Any code examples are kindly seen as well.
0 Kudos
Message 1 of 8
(6,163 Views)
Hi jarebel,

The TestStand API Reference Poster is probably the best reference for getting started with TestStand.
You can access this from:
Start»Programs»National Instruments»TestStand»Online Help»Manuals»TestStand API Reference Poster.pdf
 
As far as example code in Visual C++, I would recommend the user interface code written in C++:
Start»Programs»National Instruments»TestStand»User Interfaces»C++ MFC»Source Code.
 
Hope this helps!
Jervin Justin
NI TestStand Product Manager
0 Kudos
Message 2 of 8
(6,136 Views)

Jervin,

 

The example you suggested is not C++ .NET but standard C++ with the MFC libraries added. It is a Win32 application.

With the advent of TestStand 4.2 the examples still do not contain a C++.NET example (i.e. Managed C++).

 

Also the C++ Adapter only has a code template for Visual C++ 6.0

 

Would there possibly be a C++.NET example at NI somewhere that you could post?

 

Thanks,

 

Ronnie

TestStand 4.2.1, LabVIEW 2009, LabWindows/CVI 2009
0 Kudos
Message 3 of 8
(5,717 Views)

Hi Believer,

 

 One good place to start is in the Manuals that ship with TestStand which are installed here:
C:\Program Files\National Instruments\TestStand 4.1.1\Doc\Manuals

The TestStandAPIReferencePost.pdf and TestStandUIControlsReferencePoster.pdf give an overview of the the Engine API and the User Interface controls. Then for more details about a method or class they can check in the "NI TestStand API Reference Help" which is just in the regular TestStand help, or they can get to it here:
C:\Program Files\National Instruments\TestStand 4.1.1\Doc\Help

All of that help is also available on our website. I prefer to use this because then you can open pages in different tabs or save bookmarks to pages you use a lot. That is here:
http://zone.ni.com/reference/en-XX/help/370052G-01/

Also, some of our examples that require code modules have a version that's written in .NET. These examples are located here:
C:\Documents and Settings\All Users\Documents\National Instruments\TestStand 4.1.1\Examples

 

 

Best regards,

David Varga

Applications Engineer

NIH

 

0 Kudos
Message 4 of 8
(5,701 Views)

Hi David,

 

I think you dont have understand david's question.

 

He is looking for some examples written in C++.NET that means managed code!

The examples that are shipped with TestStand  are done in C#  or in C++/MFC (Unmanaged code).

C++ and C# are diffnerent programming languages. 

 

Greetings

 

Juergen

 

 

 

 

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

Thanks Juergen for trying to make the issue clear with C++ .NET.

I'm hopeful that someone at NI understands this and is able to post even a small example for use with TestStand that's built in Visual Studio 2005 or Visual Studio 2008.

 

Ronnie

TestStand 4.2.1, LabVIEW 2009, LabWindows/CVI 2009
0 Kudos
Message 6 of 8
(5,687 Views)

Hi Ronnie,

 

There are currently no examples written in C++ clr, however the dotnet adapter should work with classes written in C++ clr exactly the same way it works with those written in C#. Although the syntax of C++ clr is different than C# most of the language features are similar and will compile down to the same underlying dotnet code. You basically just choose the dotnet adapter and insert a step that uses it, for example an "Action" step, and configure the step settings module panel to specify your assembly (either in the GAC or by path), the class, and class member you want to call/access. You can store references to dotnet objects that are returned from your calls in TestStand object reference variables and all the basic types should be compatible with the equivalent TestStand variable types. Other than that there is not much to it. If you have a specific question regarding this or are having trouble getting it to work, please let us know.

 

Just want to add one thing. To access the TestStand API from your assembly you need to add a reference to the TestStand API assemblies to your project for your assembly. They are in the GAC.

 

Hope this helps,

-Doug

Message Edited by dug9000 on 08-07-2009 03:55 PM
0 Kudos
Message 7 of 8
(5,676 Views)

Hi Doug,

 

Yes - what you say makes a lot of sense. I happily use TestStand and C#, but a requirement has come in for TestStand and C++.NET so I wanted to make absolutely sure that it's supported. The lack of even one example gave me concern, as well as the posts from NI staff equating it to MFC!

 

So thanks for the reassurance!

 

Ronnie

TestStand 4.2.1, LabVIEW 2009, LabWindows/CVI 2009
0 Kudos
Message 8 of 8
(5,672 Views)