Support and Documentation
Breadcrumbs

3.2.2 Special Stream Modes [T-Series Datasheet]

Useful sub-modes for stream operation.

Burst Stream

Burst stream is when stream collects a pre-determined number of scans, then stops. To set the stream burst size, write to STREAM_NUM_SCANS:

The LJM library collects burst stream data with the StreamBurst function.

It may be beneficial to set STREAM_BUFFER_SIZE_BYTES to a large value for fast burst stream.

T7-Pro only: Burst stream is well-suited for WiFi connections, because WiFi has a lower throughput than other connection types.

Externally Clocked Stream - T7/T8

Externally-clocked stream allows T-series devices to trigger a stream scan from an external clock pulse instead of the internal clock.

  • The primary use case of this feature is synchronizing the stream scans of multiple LabJacks.

  • This can also be used to control stream scanning based on any clock source. Even a variable or non periodic clock source.

Normal stream rate limitations do apply, so check the Stream Timing datasheet for more information.

Clock Source

Normally the scan rate is generated from the internal crystal oscillator, but the following register provides the option to specify the scan rate based on an external clock supplied to the appropriate pin (T7: CIO3, T8: FIO2).

To subdivide the external clock pulses for a slower scan rate, use STREAM_EXTERNAL_CLOCK_DIVISOR.

LJM Configuration

To properly use this stream mode, it is recommended that you configure LJM stream timeout appropriately.
By setting LJM_STREAM_RECEIVE_TIMEOUT_MODE to 2, and LJM_STREAM_RECEIVE_TIMEOUT_MS to 0, you can have an indefinite wait between stream scans for non periodic stream pulses.
You can learn more about LJM timing configs and LJM stream configs at the provided links.

Using a DIO_EF as a Clock Source

One option to generate a stream clock is to use the PWM DIO_EF. The clock signal from a single PWM output could be shared between multiple devices. For example, configure a 50 kHz output with 50% duty cycle on the FIO0 terminal of one LabJack. Jumper FIO0 to the appropriate pin (T7: CIO3, T8: FIO2) for use with externally clocked stream. The following pseudocode for the T7 demonstrates the configuration that is required:

STREAM_CLOCK_SOURCE = 2 # Configure externally clocked stream on CIO3

DIO_EF_CLOCK0_ENABLE = 0
DIO_EF_CLOCK0_DIVISOR = 1 # No divisor, the base clock is 80 MHz on the T7
DIO_EF_CLOCK0_ROLL_VALUE = 1600 # 80 MHz / 1600 = 50 kHz output
DIO_EF_CLOCK0_ENABLE = 1

DIO0_EF_ENABLE = 0
DIO0_EF_INDEX = 0 # PWM output on FIO0/DIO0

DIO0_EF_OPTIONS = 0 # Use DIO_EF_CLOCK0 (50kHz output configured above)
DIO0_EF_CONFIG_A = 800 # 800 / 1600 = 50% duty cycle
DIO0_EF_ENABLE = 1


Triggered Stream - T7/T8

T7 minimum firmware: 1.0186

T8 minimum firmware: 1.0021

Stream can be configured to start scanning when a trigger is detected. Trigger sources are DIO_EF modes:

Frequency In and Conditional Reset allow you to select rising or falling edges and Pulse Width In will trigger from either edge.

See Appendix A for hysteresis voltage information.

Configuring stream to use a trigger requires setting up a DIO_EF and adding the STREAM_TRIGGER_INDEX register to normal stream configuration. Note that it is not necessary to set any DIO_EF_CONFIG registers; it is only necessary to change the index and enable the feature.

STREAM_TRIGGER_INDEX (address 4024):

  • 0 = No trigger. Stream will start when Enabled.

  • 2000 = DIO_EF0 will start stream.

  • 2001 = DIO_EF1 will start stream.

  • 2002 = DIO_EF2 will start stream.

  • 2003 = DIO_EF3 will start stream.

  • 2006 = DIO_EF6 will start stream.

  • 2007 = DIO_EF7 will start stream.

The delay between the trigger and the first collected sample is one scan period.

To use triggered stream with LJM, see the triggered stream section of the LJM User's Guide.

A more complicated stream trigger can be implemented with a Lua script. For example, a Lua script could check for an arbitrary stream trigger condition in conjunction with triggered stream being started as normal. Once the Lua script detects that the stream condition is fulfilled, it writes a pulse to a digital out (such as DIO3) which is then detected by the normal trigger (as specified by STREAM_TRIGGER_INDEX).

Sub Stream - T8

T8 minimum firmware: 1.0050

Sub-stream is a T8-only feature that allows specified analog inputs and temperature sensors to be sampled at a lower frequency than the main sampling rate (STREAM_SCAN_RATE_HZ). This enables high-speed data acquisition on primary channels while accommodating internal CJC sensors, which have a maximum rate limit of 250 Hz.

When a stream is initiated with any Analog Input (AIN) channels configured for sub-streaming, the T8 calculates internal clock settings for both the primary rate and the sub-stream rate. Because the sub-stream is derived from the primary clocking system, changes to the main rate may impose limitations that cause the sub-stream rate to shift. The final calculated sub-stream rate—typically between 100 and 250 Hz—can be verified via the STREAM_SUB_AIN_RATE register. This resulting rate is applied globally to all AINs and temperature sensors which have sub-streaming enabled.

Data for channels with sub-stream enabled is returned at the STREAM_SCAN_RATE_HZ, matching the timing of all other primary channels. However, these values only update at the calculated sub-stream rate. Consequently, the stream will contain redundant samples, where a single measurement is repeated across multiple scan intervals until the next sub-stream update occurs.

Note: Sub-stream support requires the latest T8 firmware and LJM definitions file.


Configuration Steps

  1. Define Primary Rates: Set your desired stream resolution and rate using STREAM_RESOLUTION_INDEX and STREAM_SCANRATE_HZ.

  2. Enable Sub-stream Channels: Designate which channels will run in Sub-stream mode using either the STREAM_SUB_AIN_MASK or individual STREAM_SUB_AIN# registers.

  3. Configure Scan List: Add channels to the stream scan list as usual. Channels configured for sub-streaming are added to the list in the same manner as standard channels; no special ordering is required.

    • Hardware Architecture Note: Any given analog input and its corresponding temperature sensor are always sampled at the same rate. When sub-stream is enabled on an AIN, both that AIN and the temperature sensor will use the sub-stream rate.

  4. Verify Calculated Rates: Check the actual resulting resolution and rate via STREAM_SUB_AIN_RESOLUTION_INDEX and STREAM_SUB_AIN_RATE.

  5. Start Stream: Execute the stream start command normally.