LJStreamM - Windows Only
LJStreamM 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.
See the Communication section of the T-series Datasheet for background on streaming. Also see the Data Rates Appendix and the LJM library stream section.
Supported devices
Downloads
The application LJStreamM is included with the main installation package.
For LabVIEW programmers, the source code is available in the LabVIEW_LJM archive.
Overview
It is recommended 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 LJStreamM.cfg
in your current working directory. Open again, select Use default Configuration
in the experiment configuration selection window if using LJStreamM v1.07+, 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 LJStreamM v1.07+ or delete LJStreamM_open.cfg
and restart LJStreamM 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 LJLogM if possible, and only if you need to go too fast for LJLogM do you then switch to LJStreamM. LJLogM 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. LJStreamM 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 of the T7 datasheet.
LJStreamM vs. LJStreamUD: LJStreamM supports the T-series. LJStreamUD supports the U3, U6, and UE9.
Logging for Multiple Experiments (v1.06 and earlier): LJStreamM loads configurations from the last working directory. To keep configurations for multiple experiments, you can copy config files (LJStreamM_open.cfg
and LJStreamM.cfg
) into the last working directory before opening LJStreamM.
Logging for Multiple Experiments (v1.07+): LJStreamM v1.07 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 LJStreamM.cfg
. If default settings are selected and LJStreamM.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
LJStreamM generates the following configuration files in the current working directory. None of these files should be modified outside of the program:
LJStreamM.cfg: Contains logger experiment 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.
LJStreamM_open.cfg: Contains device open settings (DeviceType, ConnectionType, Identifier). This is a file that the program loads on startup.
LJM_Default_Configs.cfg: Contains the default experiment configurations for
LJStreamM.cfg
. These are the configurations you would see when you load the program for the very first time. If there is some issue withLJStreamM.cfg
and you want to start from a known working configuration, load this file as your experiment configuration using the configuration button(s). SeeSelect New Config
in the Control Descriptions section for more information about loading a configuration file.LJM_Open_Any.cfg: Contains device open configurations to open the first found device. If there is some issue opening your target device using
LJStreamM_open.cfg
, load this file as your device open configuration using the configuration button(s). SeeSelect 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 number of 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 about every 500 ms.
DevType, ConnType, & SerialNumber (Opening): These indicators display information about the device that has been opened. To control what device is opened, edit the LJStreamM_open.cfg
file that can be found in the working directory. If you don't see it, make sure you have opened & closed LJStreamM at least once after installation. Unlike LJStreamM.cfg
, LJStreamM_open.cfg
is intended to be directly edited by the user. This file has an intro line and then 3 lines to specify Device Type
, Connection Type
, and Identifier
. The default values are ANY
-ANY
-ANY
, meaning that LJStreamM will open the first device it can find. For further information see the Device Opening section of the LJM User's Guide. Example open configuration file:
[Main]
DeviceType=t7
ConnectionType=ethernet
Identifier=192.168.1.207
If the configuration file is ever rendered unusable, delete it then open and close the application so that it will make a new default configuration file.
Name: Specify the desired register Name for each row. For example, the first row defaults to AIN0, but could be any streamable register such as AIN9
, EIO_STATE
, or DIO2_EF_READ_A
. See Section 3.2 of the T7 Datasheet for a listing of streamable registers. Any related configuration, such as AIN#_RANGE
& STREAM_RESOLUTION_INDEX
for analog inputs, needs to be done in Kipling before running LJStreamM.
Voltage: This array displays the raw value for each row. Usually a voltage, but can be something else depending on the Name. The displayed value is actually the average of all scans returned each iteration. When not streaming, the value shown is from a command-response read.
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 LJStreamM_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 LJStreamM.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 output log file is a tab-delimited ASCII file. 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.
At the top of the log file is a system timestamp since 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.
Data File Prefix: LJStreamM uses this as the base string when it makes a file name. When LJStreamM 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 LJMScanBacklog is growing, disable scaling. When this control is enabled (the small radio button is black) only raw data is written to file if Write 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 if Write To File
is enabled.
Device I/O Configuration
LJStreamM does not support device configurations such as setting the range and resolution of an analog input to a non-default value. Use Kipling if you need to apply device configurations.
Device I/O Configuration Steps
Close LJStreamM
Run Kipling
Apply your configurations using Kipling. Most device configurations can be set using the Analog Inputs tab or Register Matrix tab in Kipling. The normal registers for AIN range and negative channel (single-ended / differential) also apply to stream mode and can be configured using the Kipling Analog Inputs tab or the Register Matrix tab. There are special stream registers for resolution index and settling time (STREAM_RESOLUTION_INDEX and STREAM_SETTLING_US) that can be configured using the Register Matrix tab.
Navigate to the Power-up Defaults tab of Kipling and follow the directions on the page to save the current settings as your Power-up Defaults.
Revision History
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.