Use On Input Change I/O Servers
- Updated2025-11-07
- 3 minute(s) read
The Custom VI-based Server – On Input Change Wizard converts a VI into a custom I/O server that performs calculations for an application and publishes the calculated results as NI Publish-Subscribe Protocol (NI-PSP) data items to the network.
The Shared Variable Engine (SVE) launches the on input change I/O server when you load a LabVIEW process that includes an on input change I/O server. When any input changes or when a trigger condition occurs, the on input change I/O server recalculates published data items. This I/O server remains loaded until the process stops. On input change I/O servers do not have shutdown or timeout settings.
Creating an On Input Change I/O Server
To create an on input change I/O server, first create a Calculation VI that reads values, performs calculations, and returns a result. Then use the Custom VI-based Server – On Input Change Wizard to convert the VI to an on input change I/O server and configure the on input change I/O server in a process.
Guidelines for Creating a Calculation VI
Use the following guidelines when you create the Calculation VI:
- Make sure the VI is reentrant so that each instance of the server has its own data space. Otherwise, the server does not work.
- Make sure that the VI executes in the shortest time possible. The SVE waits until the VI finishes executing before updating the data items.
- Make sure all While Loops terminate without user intervention. While Loops must terminate so the SVE can stop the VI.
- Use double-precision, string, and Boolean data types when you create a VI to convert into a custom I/O server. These data types are the most efficient to use when publishing data items. LabVIEW converts other data types to variants, which can slow down the performance of the server.
The Custom VI-based Server – On Input Change Wizard checks these items, except for execution speed, when you attempt to convert a Calculation VI to an on input change I/O server.
Converting the Calculation VI
To convert the Calculation VI into an on input change I/O server, right-click My Computer or a LabVIEW project library in the Project Explorer window and select New»I/O Server from the shortcut menu. In the Create New I/O Server dialog box, select Custom VI - On Input Change and click the Continue button to create and configure the on input change I/O server. The Custom VI-based Server – On Input Change Wizard creates the following files:
- A registration VI saved as National Instruments\Shared\DSC\Custom VI Input Change Server\version number\vior_filename.vi
- VIs in the National Instruments\Shared\DSC\Custom VI Input Change Server\version number filename folder
Testing an On Input Change I/O Server
Use the Distributed System Manager to ensure that the on input change I/O server publishes values as expected.