From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Switch Hardware and Software

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help calling Switch Executive from VB.NET

I have a VB.NET application and would like to call Switch Executive functions from it. When I add the reference I do not get any functions listed.
 
Thanks,
 
Alan Howard
Huntron, Inc.
0 Kudos
Message 1 of 11
(10,075 Views)

Hi Alan,

I assume you were attempting to use the Switch Executive calls in the nise.dll (OpenSession, Connect, Disconnect, DisconnectAll, etc.).  Unfortunately, as you stated above, the standard typelib won't allow you to make calls in the VB.NET environment. 

However, a COM interface will work in VB.NET, so you will be able to use the Configuration API of Switch Executive.  These function calls give you access to the definitions and configurations for all the switches, channels, hardwires, buses, exclusions, routes, and route groups associated with the switching configuration.  In other words, if you are attempting to programmatically configure your Switch Executive Virtual Device, you can use the COM interface provided.

VB.NET is not yet a development environment supported by Switch Executive (we support C, CVI, LabVIEW, and VB6).  In reference to the problem of using the Switch Executive function calls found in the nise.dll, one solution is to create a VB.NET wrapper.  I have seen a VB.NET wrapper used before, and although it was neither fully developed nor tested, it did work with OpenSession, Connect, Disconnect, and CloseSession function calls.  Until .NET is a development environment supported by Switch Executive, creating a VB.NET wrapper may be the way to go!

Let me know if you have further questions!

Chad Erickson
Switch Product Support Engineer
NI - USA

0 Kudos
Message 2 of 11
(10,053 Views)

Do you have details on the VB.NET you are talking about?

Thanks,

Alan Howard

Huntron, Inc.

0 Kudos
Message 3 of 11
(10,050 Views)

Hi Alan,

Visual Basic .NET in Microsoft Visual Studio .NET 2003 or Visual Basic 2005 Express Edition are the VB .NETs that are known to work with a valid wrapper.  Please let me know if you have further questions on this issue!

Chad Erickson
Switch Product Support Engineer
NI - USA

0 Kudos
Message 4 of 11
(10,022 Views)

Sorry I my response not clear. I was looking for more information on the valid wrapper for Switch Executive.

Thanks,

Alan Howard

0 Kudos
Message 5 of 11
(10,020 Views)
Hi Alan,
 
I may have a working example for you to reference.  I notice you have SR# 7117946 open to National Instruments Support.  May I contact you through that channel?
 
Thanks!
 
Chad Erickson
Switch Product Support Engineer
NI - USA
0 Kudos
Message 6 of 11
(10,002 Views)
Sure
0 Kudos
Message 7 of 11
(9,988 Views)

Thank you.

Chad Erickson
Switch Product Support Engineer
NI - USA

 

0 Kudos
Message 8 of 11
(9,977 Views)

I know this is obviously a very old thread but I'm in need of the exact same thing. Has any progress on this come to light in the last 6 years? I'm currently using switch executive through teststand but since we mainly use teststand to call VB.NET functions, it would make our lives much easier to just call switch executive from VB.NET...

 

 

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

Search for a file called NISE.vb which makes calls to niswitch_32.dll

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