Use the Custom VI-based Server – Periodic Wizard to create a periodic I/O server.

The Custom VI-based Server – Periodic Wizard converts a VI into a custom I/O server that runs as a service and publishes NI Publish-Subscribe Protocol (NI-PSP) data items to the network. LabVIEW automatically launches, registers, initializes, performs error handling, and shuts down the periodic I/O server when necessary.

The Shared Variable Engine (SVE) launches the periodic I/O server when you load a LabVIEW process that includes a periodic I/O server. The periodic I/O server executes until the specified stop condition occurs. If the stop condition occurs and the periodic I/O server does not shut down by the specified timeout value, the VI aborts and generates an event of priority 500.

Creating a Periodic Custom I/O Server in LabVIEW

Before you create a periodic I/O server in LabVIEW, first create a data access VI that retrieves or emulates hardware data values in a loop structure. You then can use the Custom VI-based Server – Periodic Wizard to convert the VI to a periodic I/O server and configure the periodic I/O server in a process.

Use the following guidelines when you create the data access VI:

  • Make sure the VI does not contain any Event Structures or user interface interaction.
  • Make sure all While Loops terminate without user intervention. While Loops must terminate so the SVE can stop the VI.
  • Make sure all loops are timed in the same way.
  • Make sure controls and indicators that you want to publish from the top-level VI do not contain local variables, Property Nodes, or control references. The server synchronizes control and indicator values with NI-PSP data items only when a value is read or written at the control terminal. Modifying the value using a local variable, Property Node, or control reference can cause the data to be out of sync with NI-PSP data items.
  • If you select a While Loop in the top-level VI as the way to stop the server, configure the While Loop as either Stop if True or Continue if True. Do not use Stop on Error or Continue while Error.
  • 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.

Custom VI-based Server – Periodic Wizard checks these items when you attempt to convert a data access VI to a periodic I/O server.

Converting the Data Access VI

To convert the data access VI into a periodic 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 - Periodic and click the Continue button to create and configure the periodic I/O server. The Custom VI-based Server – Periodic Wizard creates the following files:

  • A VI template saved as National Instruments\Shared\DSC\Custom VI Periodic Server\version number\templates\vislt_filename.vit
  • A registration VI saved as National Instruments\Shared\DSC\Custom VI Periodic Server\version number\registration\vislr_filename.vi
  • DLLs and VIs in the National Instruments\Shared\DSC\Custom VI Periodic Server\version number\templates\filename folder

Testing a Periodic I/O Server

Use the Distributed System Manager to ensure that the periodic I/O server publishes values as expected.

Note After testing, you can build an application for this periodic I/O server and redistribute this application to a target computer. You must undeploy the periodic I/O server before making changes to it. You then need to redeploy the periodic I/O server to make the changes effective.