Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Developing On Input Change I/O Servers (DSC Module)

You can use the Custom VI-based Server – On Input Change Wizard to create an on input change I/O server. 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 launches the on input change I/O server when you load a LabVIEW process that includes an on input change I/O server. The on input change I/O server remains loaded until the process stops, recalculating published data items when any input changes or when a trigger condition occurs. 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 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 because each instance of the server has its own data space.
  • Make sure that the VI executes in the shortest time possible. The Shared Variable Engine waits until the VI finishes executing before updating the data items.
  • Make sure all While Loop terminate. While Loops must terminate so the Shared Variable Engine 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 data types other than double-precision, string, and Boolean 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 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 VIs located in the National Instruments\Shared\DSC\Custom VI Input Change Server\8.0\filename folder.

Testing an On Input Change I/O Server

Use the NI Shared Variable Monitor to ensure that the on input change I/O server publishes values as expected.

Deploying an On Input Change I/O Server

Before you can deploy an application that includes an on input change I/O server, you must copy the following items to the deployment computer:

  • The registration VI, vior_filename.vi, located in the National Instruments\Shared\DSC\Custom VI Input Change Server\8.0\registration\ folder
  • The subVIs located in the National Instruments\Shared\DSC\Custom VI Input Change Server\8.0\filename folder

Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit