Sharing Natively Supported Instrument Sessions between LabVIEW and .NET Code Modules (TSM)
- Updated2025-07-31
- 2 minute(s) read
When you write a test program that uses the same instrument session in LabVIEW and in .NET code modules, use the TSM Code Module API methods for storing and accessing instrument sessions from the pin map associated with the test program because the TSM Code Module API methods properly store and retrieve the instrument sessions so you can access the sessions by LabVIEW and .NET code modules.
Execute Code Modules in the Same Process that Creates Instrument Sessions
Code modules that access instrument sessions must execute in the same process as the code module that created the session. .NET code modules execute in the process that executes the test program. LabVIEW code modules execute in the process that executes the test program or in the LabVIEW Development System process, depending on the LabVIEW Adapter settings. .NET code modules cannot use instrument sessions created by LabVIEW code modules running in the LabVIEW Development System process. LabVIEW code modules running in the LabVIEW Development System cannot use instrument sessions created by .NET code modules.
LabVIEW Adapter Configuration
When you share instrument sessions between LabVIEW and .NET code modules, you must select the LabVIEW Runtime option in the LabVIEW Adapter Configuration dialog box so LabVIEW code modules execute in the same process as the TestStand Engine and the .NET code modules, which allows LabVIEW and .NET code modules to access the instrument sessions.
Debugging Considerations
Because you must use the LabVIEW Runtime option in the LabVIEW Adapter to share instrument sessions with .NET code modules, you cannot use the Development System option in the LabVIEW Adapter for debugging purposes in a system that shares instrument sessions between LabVIEW and .NET code modules.
If you use LabVIEW 2015 or later, you can attach the LabVIEW Development System to the TestStand Sequence Editor to debug LabVIEW VIs executing in the LabVIEW Run-Time Engine.