niSE_OpenSession
- Updated2023-02-21
- 1 minute(s) read
niSE_OpenSession
Opens a session to a specified NI Switch Executive virtual device. Opens communications with all of the IVI switches associated with the specified NI Switch Executive virtual device. Returns a session handle that you use to identify the virtual device in all subsequent NI Switch Executive function calls.
Function Prototype
NISEStatus __stdcall niSE_OpenSession( | NISEConstString virtualDeviceName, |
NISEConstString options, | |
NISESession * sessionHandle); |
Parameters
Input
Name | Type | Description |
---|---|---|
virtualDeviceName | NISEConstString | The session referencing this NI Switch Executive virtual device session. |
options | NISEConstString | The option string can be used to pass information to each of the IVI devices on startup. It can be used to set things such as simulation, range checking, and so on. Consult your driver documentation for more information about valid entries for the option string. |
Output
Name | Type | Description |
---|---|---|
sessionHandle | NISESession | The session referencing this NI Switch Executive virtual device session. |
niSE_OpenSession Details
NI Switch Executive uses a reference counting scheme to manage open session handles to an NI Switch Executive virtual device. Each call to niSE_OpenSession must be matched with a subsequent call to niSE_CloseSession.
Successive calls to niSE_OpenSession with the same virtual device name always returns the same session handle.
NI Switch Executive disconnects its communication with the IVI switches after all session handles are closed to a given virtual device.
The session handles can be used safely in multiple threads of an application.
Sessions can only be opened to a given NI Switch Executive virtual device from a single process at a time.