Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

.NET switch executive class library

Anyone have any luck with using Switch Executive through Visual Studio/Measurement Studio?  Can't find any class libraries like there is with other NI devices (DMM, SCOPE, etc) on NI's site.  I tried to use the IVI Instrument wizard through Measurement Studio but it doesn't even convert it to something that is able to be compiled... it tries to PInvoke on niSE_32.dll which doesn't even exist on my system with NISE 3.6 installed.  I finally wrote a DLL in CVI where I wrap Switch Executive's API into something I can manually PInvoke from C#, but that seems like a roundabout way to do it.....

0 Kudos
Message 1 of 4
(4,746 Views)

Hi taft220,

 

Unfortunately it does not look like we have any .NET libraries for Switch Executive. I believe that Switch Executive only has C dlls available, based on the note in this document:  ftp://ftp.ni.com/support/switchexecutive/Eval/Documentation/Getting%20Started%20with%20NI%20Switch%2...

 

Its sounds like the way you have found to get around this issue is in fact the likely workaround. 

Rachel M.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 4
(4,718 Views)

Hi taft220,

 

I am using C# as well and was curious if you would share your PInvoke wrapper of the Switch Executive API's?

 

Example of niSwitch_init function

[DllImport("niSwitch_32.dll", EntryPoint = "niSwitch_init", CallingConvention = CallingConvention.StdCall)]
public extern static int init(string Resource_Name, ushort ID_Query, ushort Reset_Device, ref System.IntPtr Instrument_Handle);

 

Thanks,

AG

0 Kudos
Message 3 of 4
(2,825 Views)

Hi AG,

 

taft220 might not be watching this post anymore since it is a couple of years old. I found some links that indicate you should be able to use Switch Executive with Measurement Studio, including the below white paper.

http://www.ni.com/white-paper/3724/en/

The below example may be helpful to you. The link is unfortunately broken, but I have reported it and hopefully it will be fixed soon. However, the example program is able to be downloaded.

http://www.ni.com/example/26648/en/

Maggie M.
Application Engineer
National Instruments.
http://www.ni.com/support
0 Kudos
Message 4 of 4
(2,809 Views)