NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Create a Csharp Module/DLL from scratch?

Solved!
Go to solution

I want to create a module/DLL in C Sharp (Visual Studio .NET 2008) from scratch.  This module will be called from the TestStand's Tools menu, and it will take the current sequence file's fully qualified pathname as input.  But I don't know how to get started.  I took a brief look through the Examples folder, but I didn't see anything in Csharp.

 

Is there an Example I can copy?

Is there a helper app that will generate the Csharp stub(s) for me?

Is there a kind NI TestStand deity (god or goddess, I'm not picky) who will post a stub header/source file I can use?

0 Kudos
Message 1 of 4
(4,252 Views)
Solution
Accepted by topic author tlaford

I'm not sure what you're expecting. There really isn't much to it. Just create a C# class which has a method that you want to call from TestStand (make sure it's public). Then use the .NET adapter when you create a step (perhaps an Action step) and use the step settings panel to specify your assembly and what to call in it.

 

I recommend storing your code modules relative to the sequence file's directory and specify that relative path for the code module setting for the path. That way you can move the whole directory tree to another location or drive letter and everything will still work.

 

Also, if you want to use the TestStand API, the TestStand API interop assemblies are in the GAC and should show up in the list when you choose to add an assembly reference in visual studio.

 

-Doug

Message Edited by dug9000 on 05-06-2010 10:25 AM
Message 2 of 4
(4,234 Views)

Oh... is that all?  I was afraid the class would need special inheritance and the method would need a specific signature.

 

Thanks!

0 Kudos
Message 3 of 4
(4,231 Views)

You can find a .NET example in the Examples\Demo\DotNet folder under the <TestStand Public> folder.

 

The <TestStand Public> folder is located by default at C:\Documents and Settings\All Users\Documents\National Instruments\TestStand x.x on Windows 2000/XP and at C:\Users\Public\Documents\National Instruments\TestStand x.x on Windows 7 and Vista. 

 

David Rohacek

National Instruments

 

0 Kudos
Message 4 of 4
(4,215 Views)