LabJack Read Task
Learn how to create a read task for LabJack hardware.
The read task is used for acquiring analog and digital data from LabJack devices. In this guide, we’ll walk you through the steps to create a LabJack read task in Synnax.
Prerequisites
Before configuring the task, you’ll need to have connected and configured a LabJack device and created the relevant channels in Synnax. Check out the device configuration 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. A LabJack read task defines a background process that reads data from the analog or digital inputs on a particular LabJack device.
A read task can be started, stopped, and re-configured at any time. Synnax permanently stores the configuration of the task in Synnax, so it’s easy to set up multiple tasks for different purposes.
Important Rules for Read Tasks
There are a few important rules to keep in mind when creating a 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.
Sampling thermocouple channels
In order to leverage the LJM’s built-in thermocouple features, configuring a task with thermocouple channels will reduce the maximum reliable sample rate you can acquire data, compared to a task with only analog or digital input channels.
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 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 Read Task”.
From the Command Palette
To create a 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
“LabJack”. You’ll see an option called “Create a LabJack Read Task”. Select this
option to open the read task configuration dialog.
From The Layout Selector
To create a read task from the layout selector, click on the "" button in the top right corner and select “LabJack Read Task”.
Configuring the Task
Step 1 Select your Labjack Device
The first step is to select the LabJack 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 Add () 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 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 Synnax database.
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 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, control, and processing. Historical data will not be available for review.
We recommend turning data saving off when you’re testing a new task or running operations where historical data saving is not important.
Start the Task
Once you’d added all of the channels you need and have configured the task timing, 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.