Using the NI-DAQmx I/O Server

LabView NI-DAQmx

Using the NI-DAQmx I/O Server

In NI-DAQmx 8.0 or later, you can set up distributed applications to combine remote data applications using the NI-DAQmx I/O Server. For instance, you can configure a central computer to monitor other computers that control hardware sensors by using shared variables. You can connect to the NI-DAQmx I/O Server through LabVIEW 8.0, but LabVIEW is not required. If you use a third-party OPC client, you also can access DAQ channels.

Note  You must have at least one global virtual channel defined either in the project or in Measurement & Automation Explorer (MAX) to use the NI-DAQmx I/O Server. Global virtual channels of any I/O type can be bound to shared variables, but tasks cannot.

Complete the following steps to bind a DAQ channel to a shared variable in LabVIEW Project:

  1. Open LabVIEW.
  2. Click Empty Project.
  3. Right-click My Computer. Select New»Variable.
  4. Name the variable in the Shared Variable Properties dialog box that opens.
  5. Select Network-Published as the variable type from the drop-down list.
  6. Select the Bind to Source checkbox. The Access Type and data type are automatically selected for variables bound to NI-DAQmx channels.
  7. Click Browse.
  8. The Select Source Item dialog box opens. In the Network-Published Source drop-down list, select either Project Items or Network Items.
  9. Note  Project items include the global virtual channels defined in the project. Network items include items found on the network, such as the MAX channels on the local or remote computer and deployed project channels.
  10. Browse to the NI-DAQmx channel to which you want to bind. After binding, the access type and data type are automatically selected.
  11. Click OK.

To use the variable in a VI, drag the variable from the Project Explorer to the front panel or block diagram. A status indicator appears next to the front panel object. Run the program.

Note  NI-DAQmx provides a default variable in MAX called the Server Polling Rate which determines how fast the data acquisition software-timed loop runs. You can change this setting by adding the server polling rate variable to the VI.

Refer to the LabVIEW Help for more information about using shared variables in LabVIEW.

When using a third party OPC client, connect to the variable engine server to access DAQ channels on the network.

Note  Most NI-DAQmx-supported devices work with the NI-DAQmx I/O Server, but DSA devices do not. Refer to the NI-DAQmx Readme for a list of NI-DAQmx-supported devices.

Special Considerations with Counter Output Channels

The following special considerations apply when using counter output channels:

  • If you bind a shared variable to a counter output global virtual channel, the datatype is a 1D array of double-precision floating-point values with two elements. The array maps to the pulse specifications of the counter output channel. The units of those array elements vary depending on the output type (high/low time, frequency/duty cycle, high/low ticks) of the counter output channel you created.
  • The pulse specification you specify when you first create the global virtual channel determines which internal counter timebase the device uses. If you write a pulse specification outside the range supported by the internal timebase the driver chooses, an error occurs.
  • One output period must complete before you write a new pulse specification. For instance, if your pulse specification defines a period of 1 second, you must set up your application to write new pulse specifications to the shared variable at a period greater than 1 second.

For more information about generating pulses, refer to the NI-DAQmx Help.