Skip to main content
Skip table of contents

LJStreamM - Windows Only

LJStreamM is a simple, ready-to-run executable that can acquire, graph, and log up to 96 channels of data from a single LabJack T-Series device. LJStreamM is ideal for scan rates[1] greater than 100 scans per second. Note: This documentation applies to LStreamM v1.15+.

Just starting? See our Device Quickstart Tutorials.

Supported devices

Downloads

LJStreamM is included in the main LJM installation package.

The latest development version of LJStreamM can be found at files.labjack.com.

The LJStreamM (LabVIEW) source code is available in the LabVIEW_LJM archive.

Overview

LJStreamM uses stream mode acquisition. This mode has more requisite knowledge than the command response communications used by LJLogM. See the Communication section of the T-series Datasheet for detailed information about stream mode acquisition. Also see the Data Rates Appendix and the LJM library stream section.

ljstreammbase.png

LJStreamM v1.15

LJLogM vs. LJStreamM: LJLogM should be used instead of LJStreamM whenever possible. LJStreamM is only recommended when scan rates[1] greater than 100 scans per second are required. LJLogM uses command-response mode communications. Every iteration it acquires and processes 1 scan at a time at the specified interval.  LJStreamM uses stream mode acquisition. It retrieves and processes 0.5 seconds worth of scans every iteration.  See Section 3 and Appendix A-1 of the T-Series Datasheet for more information.

LJStreamM vs. LJStreamUD:  LJStreamM supports T-Series devices.  LJStreamUD supports the U3, U6, and UE9.

Clearing Errors: Errors such as bad program settings can break the typical program execution. In most cases these errors can be cleared without exiting LJStreamM by using the Program Config or Device Config panel. Note that the configuration panels can only be accessed while stream is inactive.

  • Opening one of the configuration panels will clear the current error for the next program loop to run error free, however this would only resolve one-time errors.

  • Some device connection issues can be resolved by opening a new device connection using the Device Config panel. If you run into a device connection issue, try using the 'ANY' connection options for every setting. This will attempt to open the first found LJM-compatible LabJack device that is visible to the computer.

  • Bad program configurations can be cured by loading the default program config file LJM_Default_Configs.cfg using the Program Config panel. LJM_Default_Configs.cfg is saved to the current working directory each time LJStreamM is opened.

See the “Default Configuration Files”, “Device Config Panel”, and “Program Config Panel” sections below for more information.

Default Configuration Files

Clearing Errors: Errors such as bad program settings can break the typical program execution. In most cases these errors can be cleared without exiting LJStreamM by using the Program Config or Device Config panel.

  • Opening one of the configuration panels will clear the current error for the next program loop to run error free, however this would only resolve one-time errors.

  • Some device connection issues can be resolved by opening a new device connection using the Device Config panel. If you run into a device connection issue, try using the 'ANY' connection options for every setting. This will attempt to open the first found LJM-compatible LabJack device that is visible to the computer.

  • Bad program configurations can be cured by loading the default program config file LJM_Default_Configs.cfg using the Program Config panel. LJM_Default_Configs.cfg is saved to the current working directory each time LJStreamM is opened.

See the “Default Configuration Files”, “Device Config Panel”, and “Program Config Panel” sections below for more information.

Startup and Shutdown Behavior

When the program is started, the configuration file LJStreamM.cfg is read to determine the starting program configurations. If there is a problem loading the program configuration file, default configurations will be loaded. LJStreamM_open.cfg is read to determine the starting LabJack device open configurations. Any errors that occur when trying to open a device connection will be displayed under Error Message. A new device connection can be made at any time using the Device Config button; see the “Device Config Panel” section below.

When you exit the program, the current program settings are saved to LJStreamM.cfg and device open configurations are saved to LJStreamM_open.cfg. These files are saved to the current working directory, which will also be loaded the next time LJStreamM is opened.

Control and Indicator Descriptions

Device Type, Connection Type, and SerialNumber (Opening):  These indicators display information about the device connection that has been claimed by the program. By default, the program will open the first device connection it can find. To make a specific device connection, click the Device Config button then use the “Open a New Device Connection” options to make your desired connection. When you exit the Device Config panel and LJStreamM , the connection options you chose will be loaded the next time LJStreamM is opened.

# Channels: 1-96. Determines the number of rows/channels that will be measured. For example, row0, row1, and row2 will be active and measured if # Channels=3.

Row # (Insert/Delete): Insert or delete a row at the specified row number. Scaling equation variables are automatically shifted according to the insert/delete selection. Inserting a row number will pre-fill channel configurations with default values for the row Name, Scaling Equation, and Graph? values. See the Name, Scaling Equation, and Graph? descriptions below.

Scan Rate: Put in the desired scan rate[1].  The sample rate is equal to Scan Rate * # Channels.  See Appendix A-1 of the T-Series Datasheet for more information on data rates.  ScansPerRead is hard coded as ScanRate/2, so this program will iterate approximately every 500 ms.

Iteration Number: The number of program iterations since stream was started. This value is only updated while stream is active (after the Start Stream button is pressed.)

Scans Per Iteration: The number of scans[1] acquired per program iteration. This value is hard coded as ScanRate/2, so this program will iterate approximately every 500 ms. This value is only updated while stream is active (after the Start Stream button is pressed.)

ms Per Loop: The actual number of milliseconds it took to run the last program iteration. This value is only updated while stream is active (after the Start Stream button is pressed.)

Name: Specify the desired register Name for each row.  For example, the first row defaults to AIN0, but it could be set to any streamable register such as  AIN9 or EIO_STATE.  See Section 3.2 of the T7 Datasheet for a list of streamable registers.

Raw Value: The value read from the register entered in the Name column for the row. While streaming, the displayed value is the average of all scans returned during the current program iteration.  When not streaming, the value shown is from a command-response reading.

Scaling Equation: Scaling equation applied to the raw value for the row. The raw value for each row is mapped to a variable as follows:

row 0-15 → "a"-"p"

row 16-31 → "a2"-"p2"

row 32-47 → "a3"-"p3"

row 48-63 → "a4"-"p4"

row 64-79 → "a5"-"p5"

row 80-96 → "a6"-"p6"

For example, the default scaling equation for row0 is y=a, where y represents the scaled output value and a is a variable representing the raw value of the row. 

Everything in the scaling equation after the characters // is ignored if you want to add comments.  Examples:

y=c // Scaled value equal to raw value from 3rd row
y=100*c // EI-1034/LM34 voltage to deg F
y=c-273.15 // deg K to deg C
y=((c-273.15)*9/5)+32 // deg K to deg F
y=TCVoltsToTemp[K:c:a] // Type K, t/c voltage from 3rd row, CJ temp from 1st row

For more details see the LJLog/Stream Scaling Equations page.

Scaled Value: The value calculated from the scaling equation for the row. See Scaling Equation above.

Graph?: Determines whether the row is graphed. The row is graphed if the Graph? button is selected (lit up green), the row is active according to the # Channels value, and stream is active.

Data File Prefix:  The program uses this as the base string when it makes a file name.  When the program starts a new file, it appends a ‘_#' to the specified prefix, where '#' is the first unused number from 0-99999. For example, the default value for Data File Prefix is “data”. The first log file in an empty working directory would be named ‘data_0.dat’, the second log file would be named 'data_1.dat’, etc.

Log To File:  When this button is selected, data will be logged to file.  The resulting file is a tab-delimited ASCII-encoded file.  Files are written with a .dat extension.  To quickly open log files in Excel or Open Office Calc, change the extension to .xls or .ods.  To import the file to a Google Spreadsheet, change the extension to .tsv before uploading.

At the top of the first log file since starting stream is a human readable system timestamp of when you started writing to file. After the date/time formatted timestamp is a machine-readable timestamp in seconds since Jan 1, 1904. The timestamps do not reset when a new file is automatically created due to the file size exceeding Max File Size.

The first column of the log file is the time in seconds since starting stream, which is calculated using the formula: TimeSinceStreamStart = ScanNumber / ScanRate. See “Device Clock Scan Time” in the Stream Mode section of the T-Series datasheet for related information. Subsequent columns in the log file correspond to your channel sample data as determined by # Channels, your Name entries, and the DisableScaling control.

Each row of logged data requires approximately 10 bytes for the timestamp plus 10 bytes per channel.  For example, if you log 8 channels at 1000 scans/second for 60 seconds you could expect your log file to have a size of roughly (10 + 10*8) * 1000 * 60 = 54000000 bytes on the hard drive.

Max File Size (Bytes):  When the current data file exceeds this limit, the file is closed and a new file is started. See the Data File Prefix description above for information on file naming conventions.

Current Data File: This indicator shows the path to the current file that data is being written to. When log to file is not active, this indicator will say ‘Not Logging To File’. To the right of this indicator is a small folder icon that will open a Windows File Explorer window at the current working directory.

Program Config: The Program Config button opens a panel with program configuration options. See the “Program Config Panel” section below for more information.

Device Config: The Device Config button opens a panel with device configuration options. See the “Device Config Panel” section below for more information.

Command-Response Error Message: This indicator shows any errors that occurred in the most recent program iteration when stream is not active. Error messages will be displayed if there are LJM, Modbus, or scaling equation errors. If there are both LJM or Modbus errors, and scaling equation errors, only the LJM or Modbus error message will be displayed. LJM and Modbus errors should be resolved as soon as possible, and all errors should be resolved before starting stream. Note: when a scaling equation error occurs, the scaled value indicator for the channel will be set to zero.

Last Stream Error Message: This indicator shows any errors that occurred the last time stream was active. Only LJM and Modbus errors are displayed; scaling equation errors should be resolved while stream is inactive. Note: when a scaling equation error occurs, the scaled value indicator for the channel will be set to zero.

DisableScaling:  Scaling is computing intensive.  If LJMScanBacklog is growing, disable scaling. When this control is enabled (the small radio button is black) only raw data is written to file when Log To File is enabled. If this control is disabled (the small radio button is white) both raw and scaled data will be written to file when Log To File is enabled.

LJMScanBacklog: The number of stream scans[1] accumulated in the LJM stream-in buffer. If this value is continually growing, it indicates that the program is not iterating fast enough to consume the data being written from the device to LJM on your computer. If LJMScanBacklog is growing, disable scaling.

DeviceScanBacklog: The number of stream scans[1] accumulated in the device stream-in buffer. If this value is continually growing, it indicates that data is not being transferred from the device to your computer fast enough to keep up with the current streaming data rate.

# Scans On Graph: Controls how many scans[1] are shown on the graph.

Program Config Panel

The program config panel has controls to change the program working directory and save or load program configurations from file. The panel can be opened by clicking the Program Config button near the center-right of the main program window. Note: opening the panel stops channel acquisition and logging until the panel is closed.

programconfig.png

Program Config Panel

Program Configurations: The “Program Configurations” section allows you to save the current program configuration to file or load a configuration from an existing program configuration file. New program configuration files are saved to the current working directory; see the “Program Working Directory” section below. Program configuration files save the following program controls: # Channels, Scan Rate

, Name (for every row), Scaling Equation (for every row), Graph? (for every row), Data File Prefix, Log to File, Max File Size (Bytes), # Scans on Graph, Disable Scaling.

Program Working Directory: The “Program Working Directory” section displays the current working directory for the program. This determines the location of the program configuration file and where log files are saved.
The Change Working Directory button can be used to change the current working directory where program configuration files and log files are saved.  After navigating to the desired directory in the pop-up window, click Select Cur Dir at the bottom-right.  For more details see the LJLog/Stream Working Directory page.

Configuration Panel Messages: Any errors that occur while attempting to make changes in the configuration panel will be displayed in the “Configuration Panel Messages” section. Messages are also displayed upon successful configuration changes.

Device Config Panel

The device config panel has controls to write device registers, open a new device connection, and save or load device startup settings. The panel can be opened by clicking the Device Config button near the center-right of the main program window. Note: opening the panel stops channel acquisition and logging until the panel is closed.

deviceconfig.png

Device Config Panel

Current Device Connection: The “Current Device Connection” section describes the device connection currently claimed by the program.

Open a New Device Connection: The “Open a New Device Connection” section can be used to open a different device connection. Change each of the Device Type, Connection Type, and Identifier fields then click Open Device to attempt to open a new device connection. If the connection fails, an error message will be displayed and the previous device connection will be reestablished as long as the connection is still valid. If you successfully open a new device connection, the device open parameters will be saved to LJStreamM_open.cfg upon closing the program.

Write Device Registers: The “Write Device Registers” section allows you to write device registers without closing the program. Upon opening the configuration panel, the registers displayed in the ‘Registers’ column are read, and their values are displayed in the ‘Value’ column. When a register in the list is not readable, the value displayed will be zero. To change the value of a register, change any entry in the ‘Registers’ column to your desired register name, change the corresponding ‘Values’ entry to the desired register value, then click the corresponding ‘Write’ button. Note: the device register write functionality is meant for testing purposes and Kipling is recommended for most changes to device I/O configurations.

Device I/O Configuration: The “Device I/O Configuration” section features two buttons to save or load Device Configurations on the LabJack device. See the Device Configuration section of the T-Series Datasheet for more information about Device Configuration.

Configuration Panel Messages: Any errors that occur while attempting to make changes in the panel will be displayed in the “Configuration Panel Messages” section. Messages are also displayed upon successful configuration changes.

Revision History

1.15: Fixed an issue where very small readings were being displayed with scientific notation. Updated the folder boolean button so it looks more like a button. Split the Configuration panel into 'Device Config' and 'Program Config' panels. Updated the GUI for the two new config panels so their style is similar to Kipling. Fixed a bug where clicking the 'Save Program Config' button displays a 'saved config' message instead of a cancellation message when the cancel button is pressed. Fixed a bug where clicking the 'Load Program Config' button then cancel returns a bad config message. Added messages to the program config panel when the 'Change Working Directory' button is pressed. Changed the current device connection to display 'Opening...' while the connection is being made (after pressing the open new connection button or during the logger program initialization). Changed the 'currently open device' strings to display 'Not connected' on error. Limit logger string fields such as the scaling equations to a single line. Removed pop-ups that would trigger if the initial device open fails. Instead there is a message to go to the device config panel to open a new connection in the error message. Disabled window close in logger sub-panels. Shrunk logger windows slightly to better fit 1080p displays. Added a color toggle to the 'Device Config' button so it is emphasized on device open errors.

1.14: Added a button to open the current working directory in Windows File Explorer. Update logger GUIs. Change default logger graph precision to 9 digits.

1.13: If a program config file does not exist, load the defaults without warning the user. Rearranged logger graph palettes on the front panel.

1.12: Made minor Visual tweaks to the front panel. Made optimizations to scaling equation processing and front panel responsiveness.

1.11: Reworked configuration file handling, including adding the configuration panel. Moved the 'Change Working Directory' button to the configuration panel. Refactored the write to file functionality. Added scaling equation error messaging. Renamed the 'experiment' configuration file to 'program' configuration file. Added register write functionality to the configuration panel. Increased front panel text size, changed font to Arial (monospace), and set the minimum panel size. Added support for 96 channels. Added row modification controls. Note: a program configuration file with 96 channels from LJStreamM v1.11 would not be recognized as a valid configuration file in v1.10.

1.10: Fixed SignedMSWLSW scaling equation functionality. This was previously returning an unsigned 32-bit integer representation. It now returns a signed 32-bit integer representation.

1.09: Made change so that Inf values are assessed as 0 when used in scaling equations. This fixes an issue related to processing Inf values in scaling equations. Added error handling to recover from LJME_INVALID_NAME gracefully. Made a change to allow use of the LabVIEW graph palette (for advanced users only). When set to visible, the palette will be in the bottom right corner of the LJStreamM graph.

1.08: Updated buttons to load new configurations. Added factory setting config files (LJM_Default_Configs.cfg and LJM_Open_Any.cfg). Fixed LJStreamM channel index text size. Updated error handling. Changed TCVoltsToTemp error behavior from outputting 0.00 to 9999. Fixed the front panel (the device parameters were misplaced). Fixed minor path resolution bug.

1.07: Added configuration selection and save settings.

1.06:  Fixed problem where time reported on the chart and in logged file was twice the actual time.  Added separate error message displays for C-R and stream modes.

1.05:  Set minimum value of #Channels to 1.  Fixed problem where name of the exe was not detected properly.  Fixed issue where you could never decrease the number of channels shown on graph.  Changed version check sub-vi so it only shows prompt when new version available ... not on version check errors.  Changed scaling sub-VIs to use LJM thermocouple function rather than LJUD function.

1.04:  Added support for SignedLSWMSW[lsw:msw] function in scaling equations to handle quadrature reads.  For efficiency, scaling equations now skipped if no scaling is needed (e.g. y=a).

1.03:  Changed all text to Segoe UI font so screen items are aligned regardless of system font size.

1.02:  Fixed problem with saving of configuration settings.

1.01: Changed to use this application's filename (w/o extension) to create the names of the config files and registry entry.  Added "Write To File" control to items saved in config file.

1.00: Initial version.

[1] A scan consists of one sample from every channel in a scan list. As it relates to LJStreamM, a scan would consist of a sample from every register name (up to # Channels registers) in the Name column.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.