ReferenceDevice DriversNiDigital Read Task

NI Digital Read Task

Learn how to create a digital read task for NI hardware.

The Digital Read Task is used for acquiring data from analog inputs on your NI devices. In this guide, we’ll walk you through the steps to create a digital read Task in Synnax.

Prerequisites

Before configuring the task, you’ll need to have connected and configured an NI device and created the relevant channels in Synnax. Check out the Configure Device guide for more information.

A Short Primer on Tasks

Tasks are the primary method for communicating with hardware devices in Synnax. Tasks can be used for both control and data acquisition purposes. In the context of the NI Driver, a digital read task defines a background process that reads data from the digital inputs on a particular DAQ card.

A digital read task can be started, stopped, and re-configured at any time. We permanently store the configuration of the task in Synnax, so it’s easy to set up multiple tasks for different purposes.

Important Rules for Digital Read Tasks

There are a few important rules to keep in mind when creating a digital read task.

Sample Rates

All channels in the task are sampled at the same rate. If you’d like to sample different channels at different rates, create a separate task to do so.

One Running Task Per Channel

Synnax can only accept live data from a channel from one source at a time. If you have a task running that reads from a pressure channel, you cannot start another task that reads from the same channel.

Open the Task Configuration Dialog

From the Resources Toolbar

To create a digital read task from the resources toolbar, open the Synnax Console and click on the “Resources” tab in the left sidebar. Find the device you’d like to create the task for, right-click on it, and select “Create Digital read Task”.

From the Command Palette

To create a digital read task from the command palette, open the Synnax Console and click on the Quick Search & Command Palette at the top. You can also open this palette with Ctrl+Shift+P on Windows/Linux and Cmd+Shift+P on macOS.

In command mode (enabled when the first character in the input is ”>”), type “NI”. You’ll see an option called “Create a New Digital read Task”. Select this option to open the read task configuration dialog.

From The Layout Selector

To create a digital read task from the layout selector, click on the ”+” button in the top right corner and select “NI Digital read Task”.

Configuring the Task

Step 1 Select your NI Device

The first step is to select the NI device you’d like to read data from. Use the dropdown menu in the top left corner to do so.

Step 2 Add Channels to the Task

Next, you’ll need to add channels to read data from. Click on the ”+” button in the channels section. Then, click on the new channel in the list to configure it.

Step 3 Configure Timing

There are two parameters to control the timing of the task: the sample rate and the stream rate. The sample rate defines at how many samples per second the task will read from the device. The stream rate defines how often the task will stream data into Synnax.

For example, if you set the sample rate to 10 Hz and the stream rate to 1 Hz, Synnax will read a batch of 10 samples every second, and then forward the entire batch to the server.

For very low rate tasks (< 50Hz), we recommend setting the stream rate to the same value as the sample rate. For higher rate tasks, lowering the stream rate can significantly improve performance. It’s typically best to keep the stream rate below 50Hz unless you need to quickly process incoming data in real-time.

Step 4 Enable/Disable Data Saving

Data saving defines whether acquired data will be permanently stored in Synnax. When enabled, Synnax will both stream and store data. When disabled, Synnax will only stream data for real-time visualization. Historical data will not be available for review.

Once you’d added all of the channels you need and have configured sampling rates, hit the “Configure” button. If there are no errors, Synnax will acknowledge the configured task and enable the “Play” button in the dialog. Click this button to start the task.

Start the Task

Once you’d added all of the channels you need and have configured task PerformanceTiming, hit the “Configure” button. If there are no errors, Synnax will acknowledge the configured task and enable the Play () button in the dialog. Click this button to start the task.

Starting and stopping a task does not re-apply the task configuration. If you’ve made changes to the configuration, you’ll need to re-configure the task by hitting the ” Configure” button.