Skip to main content
Skip table of contents

LJStreamUD - Windows Only

LJStreamUD is a simple ready-to-run executable that streams up to 16 input channels from a single device. It displays selected channels on a graph and writes data to file. Generally used for >100 scans/second.

Supported devices

  • U3

  • U6

  • UE9

Downloads

The application LJStreamUD is included with the main installation package.

For LabVIEW programmers, the source code is available in the LabVIEW_LJUD archive.

Overview

See Section 3.2 of the applicable user's guide for background on streaming. Also see the analog input section (2.x) and the UD driver stream section (4.3.x).

It is recommend to initially just open and click Start Stream without changing any settings. If you have recently modified settings and are having problems, close the program and delete LJStreamUD.cfg in your current working directory. Open again, select Use default Configuration in the experiment configuration selection window if using LJStreamUD v1.20+, and you will have the default settings.  If you have problems related to opening the device, select Open First Available Device in the device configuration selection if using LJStreamUD v1.20+ or delete LJStreamUD_open.cfg and restart LJStreamUD if using an older program version.  For problems related to the working directory location, see "Change Working Directory" below.

LJStream vs. LJLog: We suggest that you use LJLogUD if possible, and only if you need to go too fast for LJLogUD do you then switch to LJStreamUD.  LJLogUD uses command-response mode, so it acquires and processes 1 scan at a time at the specified interval and is generally used for ≤100 scans/second.  LJStreamUD uses stream mode, so each iteration it retrieves and processes 1 seconds worth of scans and is generally used for >100 scans/second.  For more discussion of command-response mode and stream mode see Section 3.0 of the applicable user's guide:  U3U6, or UE9.

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

Logging for Multiple Experiments (v1.19 and earlier): LJStreamUD loads configurations from the last working directory. To keep configurations for multiple experiments, you can copy config files (LJStreamUD_open.cfg and LJStreamUD.cfg) into the last working directory before opening LJStreamUD.

Logging for Multiple Experiments (v1.20+): LJStreamUD v1.20 adds new configuration settings. When the program starts, a pop-up window will appear asking for a method to open a device. The Load Open Configs from a File selection is intended only for advanced use with custom open configuration files. See "Device Type & Address (Opening)".

Once the open configuration is selected, another window will appear asking for experiment configuration settings. By default, experiment configurations are saved to LJStreamUD.cfg.  If default settings are selected and LJStreamUD.cfg does not exist, default values will be loaded. 

When the program is closed, the selected experiment configuration file is written to the current working directory with the current experiment settings. For example, if  Load Experiment Configuration is selected in the experiment configuration window and a configuration file called MyExperiment.cfg is loaded,  a configuration file called MyExperiment.cfg will be written/overwritten in the current working directory when the program exits.

Experiment configuration files are not intended for direct editing. To make backup or alternate experiment settings see "Save Current Config" below.

Default Configuration Files

LJStreamUD generates the following configuration files in the current working directory. None of these files should be modified outside of the program:

  • LJStreamUD.cfg: Contains logger control configurations such as # Channels, Names, what channels to Graph, etc. This is a file that the program loads on startup, and it is the file that your control configurations are saved to when you close the program.

  • LJStreamUD_open.cfg: Contains device open settings (DeviceType, ConnectionType, Identifier). This is a file that the program loads on startup.

  • LJUD_Default_Configs.cfg: Contains the default experiment configurations for LJStreamUD.cfg. These are the configurations you would see when you load the program for the very first time. If there is some issue with LJStreamUD.cfg and you want to start from a known working configuration, load this file as your experiment configuration using the configuration button(s). See Select New Config in the Control Descriptions section for more information about loading a configuration file.

  • LJUD_Open_Any.cfg: Contains device open configurations to open the first found device. If there is some issue opening your target device using LJStreamUD_open.cfg, load this file as your device open configuration using the configuration button(s). See Select New Config in the Control Descriptions section for more information about loading a configuration file.

Control Descriptions

# Channels: 1-16.

Scan Rate: Put in the desired scan rate.  Sample rate is scan rate times # hannels.  See Section 3.2 of the U3/U6/UE9 User's Guide for more information.

Resolution: Affects the U6 only.  Increasing this index value decreases noise and increases sample time.  See Section 3.2 of the U6 User's Guide.

SettlingFactor: 0-255.  Affects the U6 only.  See StreamConfig.

Device Type & Address (Opening):  In the working directory there is a file called LJStreamUD_open.cfg.  If you don't see it, make sure you have opened & closed LJStreamUD at least once after installation. Unlike LJLogUD.cfg, LJLogUD_open.cfg is intended to be directly edited by the user.  In the 2nd line of this config file, if DeviceType=ANY, the application will search USB and then Ethernet for the first U3/U6/UE9 it can find.  If DeviceType is not ANY, then a call to OpenLabJackS() is made with the specified strings(FirstFound=FALSE).  Example:  

[Main]

DeviceType=LJ_dtUE9

ConnectionType=LJ_ctUSB

Identifier=1

If the configuration file becomes unusable/corrupted, delete it and then open & close the application. This will make a new default configuration file.

+Ch/-Ch:  +Ch is short for Positive Channel and -Ch is short for Negative Channel.  LJStreamUD is designed to read the voltage from analog input channels.  Voltage is the potential difference between 2 points, thus in each row you need to specify the 2 points.  For example, the default values for the first row are +Ch=0 and -Ch=199, which means the device will do a single-ended (versus GND) read of AIN0.

LJStreamUD is designed for analog inputs, but there are special analog input channel numbers that allow you to read other types of channels (DI, Timers, Counters).  See the special channel support described in the stream mode section of the applicable User's Guide.

For example, if you have a U3 and you want to read/log the state of the FIO & EIO lines, type the value 193 into the +Ch cell and you will read a 16 bit number that contains the state of all 16 I/O lines.

You can put any channel in any row.  For example, you could set the first row to +Ch=5 and -Ch=199 to do a single-ended read of AIN5, or you could set the first row to +Ch=193 (-Ch does not matter) to do a read of all FIO & EIO digital inputs.

Ranges: Select the desired range, which is related to gain.  Not all devices support all ranges, but starting with UD V3.19 the driver will select the best range available (next higher range) rather than throwing an error.

The U3 does not support any range settings.

Valid U6 Ranges:

  • LJ_rgBIP10V: ±10 V i.e. Gain=x1

  • LJ_rgBIP1V: ± 1 V i.e. Gain=x10

  • LJ_rgBIPP1V: ±0.1 V i.e. Gain=x100

  • LJ_rgBIPP01V: ±0.01 V i.e. Gain=x1000

Valid UE9 Ranges:

  • LJ_rgUNI5V: 0-5 V, LabJackUD Default

  • LJ_rgUNI2P5V: 0-2.5 V (not supported with resolution=18)

  • LJ_rgUNI1P25V: 0-1.25 V (not supported with resolution=18)

  • LJ_rgUNIP625V: 0-0.625 V (not supported with resolution=18)

  • LJ_rgBIP5V: ±5 V

Note that due to the way this program and the UD driver parse the channels list, all rows with the same number in +Ch will use the range set by the last row with that same +Ch.

Scaling Equations: Should be something like y=a, where y is the scaled output and a is the input voltage of the 1st row.  b through p would be the input voltage of the rest of the rows.  Everything after // is ignored, so use for comments.  A few 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.

Save Current Config: Click this to save your current experiment configurations. Once clicked, a pop up window will appear asking for a file name and an OK button that will create the file once pressed. The resulting file will be saved to the current working directory with a .cfg file extension.

Select New Config: Click this to load new device open and experiment configurations. Once clicked, a pop up window will appear asking “Would You Like to Open a Different Device Connection?“. If you select “Open a Different Device Connection” you will be prompted to select a new device open configuration file in the current working directory, which should have the same formatting as LJStreamUD_open.cfg. After making the device open selection, another window will pop up prompting you to “Please Select an Experiment Configuration“. If you select “Load Experiment Configuration” you will be prompted to open a new device control/experiment configuration file from the current working directory, which should have the same formatting as LJStreamUD.cfg. New experiment configuration files should only be generated using the Save Current Config button.

Write To File: Click this to start and stop writing to file.  The resulting file is a tab-delimited ASCII file.  The first column is elapsed time since you started writing to file (does not reset when a new file starts automatically due to Max File Size).  Files are written with a .dat extension.  To quickly open in Excel or Open Office Calc, change the extension to .xls or .ods.  To import to a Google Spreadsheet, make the extension .tsv before uploading.

Each row of logged data typically requires roughly 10 bytes for the timestamp plus roughly 10 bytes per channel.  So it you log 8 channels at 1000 scans/second for 60 seconds that would be about (10 + 10*8) * 1000 * 60 = 54000000 bytes on the hard drive.

The data file has the initial time, from the PC system clock, at the top.  Then each row has a timestamp which is ScanNumber / ScanRate, and thus based on the LabJack stream clock.

Data File Prefix:  LJStreamUD uses this as the base string when it makes a file name.  When LJStreamUD starts a new file, it appends a _# to the specified prefix, where # is an unused number from 0-99999.

Max File Size (Bytes):  When the current data file exceeds this limit, it is closed and a new file is started.  In theory the max value is 2^31 - 1, or 2147483647, but we have not tried a file that big ourselves.

Change Working Directory:  Click this to select the directory where the config file and data files will be 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.

Graph History: Controls how many scans are shown on the graph.

DisableScaling:  Scaling is computing intensive.  If UD Backlog is growing, disable scaling.

# Scans Read and ms Per Loop:  This program uses the LJ_swSLEEP wait mode and sets numScansToRead equal to Scan Rate.  That means # Scans Read should always be equal to Scan Rate, and ms Per Loop should be 1000 milliseconds on average.  For stream details see the Stream Mode section (U3/U6/UE9) and Stream Mode Example Pseudocode section (U3/U6/UE9) in the datasheet.

UD Backlog and Device Backlog:  These will often bounce around at low non-zero values, but if they are continuously growing it means data is not transferring fast enough and overflow will eventually happen.  See the stream details sections linked just above.

Revision History

1.06: Not compatible with older config files, so delete ljstreamud.cfg before running the first time!  Changed config file delimiter to "#!#" instead of "," for better international compatibility.  Made maximum file size a user control.  Scaled values now grayed-out if scaling is disabled.

1.07: Turned on scroll bars, for use on smaller monitors.

1.08:  Minor changes to the process used to find the next available file number.

1.09:  No longer disables timers and counters.  Added controls for Resolution and SettlingFactor.

1.10:  Makes error display red if there is an error.  Fixed typos in header for data files.

1.11:  Fixed jumbled display on Windows 7.  Comments now allowed in scaling equations starting with "//".

1.12:  Added support for registry storage of working directory.  Now shows errors in command/response
mode (when not streaming).

1.13:  Changed to maintain display of last stream error, and thus does not show command-response errors when not streaming.  Changed timestamp in header of data file to show seconds.

1.14:  Fixed bug in OpenAny where if it did not find any devices it would try 128 times to open a UE9 at 0.0.0.0.

1.15:  Two changes.  The first is that it now supports a config file that lets you specify a particular device to open.  See the description of "Device Type & Address" above.  The second is that it now uses the filename of the application to specify the names of the config files and to specify the location of the working directory registry key.  The former means if you make a copy of LJLogUD.exe called LJLogUD2.exe, the config files will be LJLogUD2.cfg and LJLogUD2_open.cfg and thus each copy has its own config files.  The latter means you can use a different working directory for each copy, although you don't have to.

1.16:  Added "Write To File" control to items saved in config file, so the application will now remember how this control was last set.

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

1.18:  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.19: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.

1.20: Added configuration selection and save options.

JavaScript errors detected

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

If this problem persists, please contact our support.