This document contains quick reference information about examples, VIs/functions,
route specification strings, and error codes for NI Switch Executive (NISE).
Examples
ICONVI/FUNCTION NAME AND DESCRIPTION
Getting Started
Opens a session and makes a route connection.
Interactive Control
Uses many of the API functions through an interactive tool.
Route Specification Syntax Example
Demonstrates the many different aspects of route specifications, including
usage of routes, route groups, fully specified routes, and combinations of
route types.
Sequenced Connect And Disconnect
Uses Connect and Disconnect to sequence through different switching
system states.
Using Find Route to Connect Two Channels
Uses Find Route to determine a path between two channels and then
connects the path.
Functions†
ICONTYPE PARAMETERVALUE TO SET, COMMENTS
niSE Open Session
(niSE_OpenSession)
Opens a session to a specified NISE virtual device. Opens communications
with all of the IVI switches associated with the specified NISE virtual device.
Returns a session handle used to identify the virtual device in all subsequent
NISE calls.
NISEConstString virtualDeviceName Name of the NISE virtual device to
NISEConstStringoptionsUsed to pass information to each of
NISESession* [out] sessionHandleReference to virtual device session
open a session to
the IVI devices on startup
niSE Close Session
(niSE_CloseSession)
Reduces the reference count of open sessions by one. If the reference count
goes to zero, any open IVI switch sessions are closed.
NISESessionsessionHandleReference to virtual device session
niSE Connect
(niSE_Connect)
Connects the routes specified by the connection specification.
When connecting, it may allow for multiconnection based on the
multiconnection mode.
NISESessionsessionHandleReference to virtual device session
NISEConstStringconnectSpecString describing the connections
NISEInt32multiconnectMode • USE_DEFAULT_MODE (–1)
NISEBooleanwaitForDebounce• NISE_TRUE
to be made
• NO_MULTICONNECT (0)
• MULTICONNECT_ROUTES (1)
• NISE_FALSE
niSE Connect And Disconnect
(niSE_ConnectAndDisconnect)
Connects the routes specified by the connection specification.
When connecting, it may allow for multiconnection based on the
multiconnection mode. Disconnects the routes specified in the
disconnection specification. This VI/ function is useful for switching
from one state to another state.
NISESessionsessionHandleReference to virtual device session
NISEConstStringconnectSpecString describing the connections
NISEConstStringdisconnectSpecString describing the
† Function names for C, C++, LabWindowsTM/CVITM, and Visual Basic are in parentheses.
to be made
disconnections to be made
NI Switch Executive Quick Reference Guide
2ni.com
ICONTYPEPARAMETERVALUE TO SET, COMMENTS
niSE Connect And Disconnect (continued)
NISEInt32multiconnectMode • USE_DEFAULT_MODE (–1)
NISEInt32operationOrder• BREAK_BEFORE_MAKE (1)
NISEBooleanwaitForDebounce• NISE_TRUE
• NO_MULTICONNECT (0)
• MULTICONNECT_ROUTES (1)
• BREAK_AFTER_MAKE (2)
• NISE_FALSE
niSE Disconnect
(niSE_Disconnect)
Disconnects the routes specified in the disconnection specification.
NISESessionsessionHandleReference to virtual device session
NISEConstStringdisconnectSpecString describing the
disconnections to be made
niSE Disconnect All
(niSE_DisconnectAll)
Disconnects all connections on every IVI switch device managed by the
NISE session reference passed to this function.
NISESessionsessionHandleReference to virtual device session
niSE Find Route
(niSE_FindRoute)
Finds an existing or potential route between channel 1 and channel 2.
NISESessionsessionHandleReference to virtual device session
NISEConstStringchannel 1Channel name of one of the end
NISEConstStringchannel 2Channel name of one of the end
NISEBuffer* [out]routeSpecReturns the path between the
NISEInt32 * [in/out] routeSpecSize• Input = size of the route string
Checks to see if the switching system is debounced or not. This VI/function
does not wait for debouncing to occur and returns true if the system is fully
debounced.
NISESessionsessionHandleReference to virtual device session
NISEBoolean* [out] isDebounced• NISE_TRUE
• NISE_FALSE
niSE Wait For Debounce
(niSE_WaitForDebounce)
Waits for all of the switches in the NISE virtual device to debounce.
NISESessionsessionHandleReference to virtual device session
NISEInt32maxTimeAmount of time to wait (in ms) for
the debounce to complete before
timing out
Additional C/C++/Visual Basic Functions
C, C++, and Visual Basic users have two additional functions available that are not
needed in LabVIEW.
TYPEPARAMETERVALUE TO SET, COMMENTS
niSE_ClearError
Clears the last queried error from memory.
NISESessionsessionHandleReference to virtual device session
niSE_GetError
Queries for and returns the most recent error.
NISESessionsessionHandleReference to virtual device session
NISEStatus* [out]errorNumberReturns the error number of the first
NISEBuffer* [out]errorDescriptionReturns a string describing the error
NISEInt32* [out]errorDescriptionSize• Input = size of the error description
NI Switch Executive Quick Reference Guide
error that occurred in the session since
the error was last cleared
buffer being passed
• Return = size required to hold entire
string
4ni.com
Route Specification Strings
Route specification strings are the paths connecting two channels and are composed of
one or more routes delimited by ampersands (
syntax, there are three defined routes or route groups:
routeOrGroup & routeOrGroup & routeOrGroup...
where routeOrGroup can be:
• Route name
• Route group name
• Two endpoint channels to be connected that are delimited by
determines the path between the endpoints. In this mode, a hardwire alias name may
be substituted for the endpoints.
channel -> channel
• Fully specified path enclosed in square brackets consisting of one or more endpoint
channels delimited by
->:
[channel -> channel -> channel...]
where channel can be:
• A channel alias name
• A unique name created by combining the IVI device logical name and IVI
channel name separated by a forward slash (
(device/iviChan).
&). For example, in the following line of
->. NISE dynamically
/) delimiter. For example,
Note • Any channel, other than an endpoint, within a route specification
string
must
the endpoint channels
• Channels used as endpoints must
channels.
• When connecting a route, the list of channels must obey the
exclusion rules by both explicitly in the route specification string, as
well as implicitly by any previous connections. Exclusion violations
result in an error.
The following are samples of route specification strings for a matrix:
be reserved for routing or directly hardwired to one of
Each supported ADE has an associated Route Specification String Example. Refer to the
examples for the appropriate ADE to see how route specification strings are used when
programming.
FFFF8EAA –29013There was an error when accessing (open or read) the NI Switch
technical support.
exist.
unavailable. Close other applications and try again.
be understood.
limit for this session has expired. Restart your application to continue
evaluating.
licenses can only import configurations created with a development
license. Import the configuration into a development license system and
re-export the file to resolve the problem.
period has expired.
The operation requested requires a development license.
Executive configuration file.
NI Switch Executive Quick Reference Guide
6ni.com
VALUEVALUE
(HEX)(DECIMAL) DESCRIPTION
IMPORTING_FILE_FORMAT
FFFF8EA9–29014The file is not a valid NI Switch Executive configuration file.
INVALID_END_POINTS
FFFF8EA8–29015The endpoints of the path do not match the existing endpoints.
INVALID_PATH
FFFF8EA7–29016Cannot connect this path on the device.
INVALID_CHANNEL_SPECIFICATION
FFFF8EA6–29017The channel specification string contains invalid characters or could not
be understood.
DLL_NOT_FOUND
FFFF8EA5–29018A needed DLL was not found. Check to ensure that NI Switch
Executive is properly installed and that all needed DLLs are in the
search path.
FUNCTION_NOT_FOUND
FFFF8EA4–29019A needed function in a DLL could not be found. Although the DLL exists,
it may be an incorrect version and may not contain the needed function.
MAX_TIME_EXCEEDED
FFFF8EA3–29020One or more switching devices have not debounced within the specified
maximum time.
ROUTE_ALREADY_EXISTS
FFFF8EA2–29021The route you are trying to connect or a route with the same endpoints
is already connected.
ROUTE_EXISTS_AS_UNSHAREABLE
FFFF8EA1–29022The route you are trying to connect already exists as a non-multiconnect
route. It must be disconnected before you can make a multiconnect
route.
ROUTE_EXISTS_BY_DIFFERENT_PATH
FFFF8EA0–29023The route you are trying to connect already exists but is connected
through a different path than the one specified.
ROUTE_DOES_NOT_EXIST
FFFF8E9F–29024The specified route does not exist. You cannot disconnect a route that
does not exist.
PARTIAL_DISCONNECT
FFFF8E9E–29025Device specific errors occurred during the disconnect operation.
RESOURCE_IN_USE
–29026 A connection could not be made because one of the switch resources
needed to make the connection is used as part of another
currently connected route.
FILE_WRITE
FFFF8E9D–29027 An error occurred while attempting to write to file.
FFFF8E9C –29028 An error occurred while attempting to read from file.
INVALID_MULTICONNECT_MODE
FFFF8E9B –29029 Invalid multiconnect mode.
INVALID_OPERATION_ORDER
FFFF8E9A –29030 Invalid operation order.
CONFIG_CHANNEL_CONFLICT
FFFF8E99 –29031 A reserved for routing channel required for connecting this route is
SOURCE_CHANNEL_CONFLICT
FFFF8E98 –29032 Connecting this route would cause excluded channels to be shorted
ROUTE_EXISTS_WITH_DIFFERENT_MODE
FFFF8E97 –29033 The route you are trying to connect already exists with a different
DISABLED_CHANNEL
FFFF8E96–29034The channel you are trying to use has been disabled for this virtual
CANNOT_CONNECT_TO_ITSELF
FFFF8E95–29035You cannot connect a channel to itself. Either your endpoint channels are
ROUTE_NOT_FOUND
FFFF8E94–29036Route cannot be found between the specified endpoints.
already in use by another route.
together.
multiconnect mode. It must be disconnected before you can make this
connection.
device.
the same or they reside on the same hardwire.
Programming Flow
The following diagram shows a typical programming flow for NI Switch Executive.
CVITM, IVITM,LabVIEWTM, National InstrumentsTM, NITM, ni.comTM, and TestStandTMare trademarks of
National Instruments Corporation. Product and company names mentioned herein are trademarks or
trade names of their respective companies. For patents covering National Instruments products,
refer to the appropriate location: Help»Patents in your software, the patents.txt file on your CD,
or ni.com/patents.