LJStreamUD - Windows Only | LabJack
« Close

Datasheets and User Guides

App Notes

Software & Driver


LJStreamUD - Windows Only

Supported devices

  • U3
  • U6
  • UE9


The application LJStreamUD is included with the main installation package.

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


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.

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 from Multiple Devices: It is possible to log from multiple devices at once by copying and renaming LJStreamUD.exe then running both the original and copied LJStreamUD applications. LJStreamUD.exe can be found by pasting %HOMEDRIVE%\Program Files (x86)\LabJack\Applications in the Windows File Explorer address bar.

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. Alternately, you can create a folder for each experiment and put a renamed copy LJStreamUD.exe in each of those folders. For example, you could use the following folder structure:


Then LJStreamUD_force.exe and LJStreamUD_temp.exe each keep their own working directory, with their own copy of config files and data files.

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.


# Channels: 1-16.

Scan Rate: Put in the desired scan rate.  Sample rate is scan rate times # channels.  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 Section 5.2.12 of the U6 User's Guide.

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).  See Section 4.3.1 of the U3/U6/UE9 User's Guide.  Example:  [Main] (1st line of config file), DeviceType=LJ_dtUE9 (2nd line), ConnectionType=LJ_ctUSB (3rd line), Identifier=1 (4th line).  If you mess up the config file, just delete it and then open & close the application so it will make a new default one.

This provides a way to run multiple instances at the same time talking to different devices.  Make a copy of LJStreamUD.exe called LJStreamUD2.exe, run LJStreamUD2, set the working directly as desired, and close LJStreamUD2.  Now edit both LJStreamUD_open.cfg and LJStreamUD2_open.cfg to get rid of all "ANY" strings and instead specify the device for each to open.  Requires LJStreamUD 1.19 or higher.

+Ch/-Ch:  +Ch is short for Positive Channel and -Ch is short for Negative Channel.  LJStream 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.

LJStream 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.

Hint!  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 rather than throwing an error.  For more information, see the AIN section in Section 2 of the U3/U6/UE9 User's Guide, and also see Section 4.3.3 of the applicable user's guide.  The U3 does not have normal range options, but does have the "Special" range which is enabled by setting the negative channel to 32.  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.

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

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.


Can I change the x-axis to be smaller than half a second?

Use "Graph History" to adjust the length of the x-axis, but it looks like 0.1 is the minimum.

I have four labjack U3 devices connected to a four port externally powered USB hub. I have used LJControlPannel to write unique local IDs to each U3 device (1,2,3 & 4 respectively). I would like to log all 64 chanels (four * 16 AIN inputs). Can I do this using LJStreamUD or LJLogUD? So far I have only been able to log from just one of the U3 devices, the one with local ID 1.

many thanks,


No, LJStreamUD and LJLogUD just work with a single device.  Besides writing your own program, you could check out DAQFactory or FlowStone.


Im using U6 (windows 7) and while trying to log data using LJstream V1.11 it is showing error such as,

LabJack Error # 1007:LabJack not found occured at LJUD_OpenLabJackS.vi

Why is it behaving so?Can you guide me through this problem?

Does it work for a while and then stop working with that error?  Or does it have that error right from the start?

Does the U6 work fine in LJControlPanel?  Make sure you are only running one program at a time, so for example make sure you close LJControlPanel before running LJStreamUD.

I suggest that if needed you continue this troubleshooting on the LabJack forum rather than in these user's guide comments.


I am trying to read in an analog signal from a microphone by connecting the 3.5mm end of the mic to AIN0 of the LabJack U6.  Do I need a preamplifier?  I ask because changing the range to BIP1V does not seem to increase the gain.

If you have a 5mV signal, it should read 5mV no matter what gain/range setting you use.  The difference is that the resolution will be better with the smaller ranges.  You can do a try it yourself in the test panel in LJControlPanel.  Jumper DAC0 to AIN0, set DAC0 to something like 50mV, then look at the reading from AIN0 at ranges +/-10V, +/-1V, and +/-0.1V.  You will read 50mV in all 3 cases, but the resolution should improve (noise will go down).  To do a better resolution test and recreate the figures from Appendix B, jumper AIN0 to GND.

Your microphone might need a special amplifier and/or signal-conditioning circuit.  If you have other problems with the mic signal, I suggest you post on our forum.

Is there a way to control where LJstreamUD stores the data file? I was looking for a UI spot associated with the Data File Prefix field which would allow me to specify the destination directory.

Putting the data & config files under c:\Program Files\LabJack is as bad under Windows XP Pro (32-bit) running as a Limited user as it is for Win7 / Vista. The same cure applies: give Users full control of that folder.

In any case I'd suggest a simple change to the program code to use the Windows symbolic name that means "the user's data" rather than "the program's install" for the default path of both data files and config files.

In LJStreamUD V1.12 you can now control the working directory.  You can get LJStreamUD V1.12 with the LabJack Installer 2013.2.11.

Hi, how i can install tools from LabJack like easy stream to LabView?

I am not sure what you are asking.  If you are looking for LabVIEW examples for the UD driver (U3, U6, UE9), start here:


I'm using the LJStreamUD on a U3 device and I had a couple of questions. I am sampling a 2v peak signal on AIN0 using this software. I set the scan rate to 25,000. With only one channel on, that should correspond to a 25,000 sample/second rate, correct?

Regardless, that is what I see in the output file, time steps between samples of 40us. However, I am starting and stopping data acquisition by hand. I sample for about 30 seconds as measured on my phone. What surprised me is that I did this ten times and all of my files are the same size with the same number of samples. I expected them to differ by a few samples at least.

Assuming I don't have microsecond reflexes, why are the data sets the same size? My concern is that the device is sending a burst of samples at a time and recording it and then missing samples while writing the first burst. The manual states that there would be dummy values in the results, values of -9999.0, but I don't see those in my data set.

I see, so it will complete a read cycle before stopping. It starts a read cycle, then takes one sample every 40us for one second. Regardless of when you stop it during the read cycle, it finishes that read cycle. And yes, you are correct, my data is 750k rows plus header. Thanks for the quick response.


I have a U3-HV device and want to get the frequency (Hz) of a continuous electrical signal. Can I do it? 

Connect the cable FIO4 and see the signal in volts, its graph and exported to excel using StreamUD, but I can not get a measure of the frequency (Hz) 

How do I do? 

Thank you very much

Once you have a waveform saved to file, the question is how to do the match to determine the frequency.  An FFT would be a likely option.  I am not sure what Excel is capable of, but something like Matlab could certainly do it.

Perhaps you could use a timer or counter to measure frequency?  What is the shape of the signal?  What is the max & min voltage?

Is a square wave that goes from [-0.03 to 2.42] V. It would be great to use a counter to show me the frequency, but not how to set it up. 

In the application LJControlPanel can add timers and counters, but not to see the results. 

Thanks for answering

See the Frequency Measurement forum topic #1105 to decide if you will count over time or time individual cycles.  Then see Section 2.9 of the U3 User's Guide about timers & counters.  Then try it using the test panel in LJControlPanel to see if it works.  Let us know how it goes in the test panel.

I've been looking at the various ways of measuring the frequency and have chosen to put a timer set to "output frequency" and a counter in FIO6 and FIO7. 

All this is set up in LJControlPanel, I keep it, but in the test panel does nothing, there is no area where the results go.Where do these results appear? 

I wish I could get the frequency directly with an application of Labjack, without using the Matlab FFT or having to get directly counting cycles and divide by the time.

Starting with a counter is a good idea to make sure the hardware is working.  In the LJCP test panel, click Config in the Timers and Counters area, check Enable for Counter0, and click OK.  You now have a counter enabled on FIO4, and the count will be displayed in the Counter0 display on the main test panel.  Connect your signal and see if you get counts.  If your signal is not working, remove it and instead just take a wire connected to GND and tap that wire inside the FIO4 terminal.

>> without ... counting cycles and divide by the time.

That was the point of forum topic #1105.  If you don't want to do counting over time, you can instead time individual pulses.  Using a timer in mode 2 will give you a measurement of period/frequency.

We are getting into off-topic details, so please continue this on our forum, rather than comments on this page.

Hey there,

I´m using the Labjack U6 to process data from two pressure sensors and one thermometer. I started using the ready-to-run LJstreamUD, but am not sure whether this will help me solve my task. What I want to do:

1) I want to retrieve the values at a specific sample rate (500Hz or higher), then average these values and just log this one averaged value on a file at a rate of perhaps two times a second or even once per second. Is this possible with little or no adaptions in the block diagram? If I need to make any adaptions, where exactly do I have to start? At the moment, the LJstreamUD logs exactly 500 values per second, but I do not need that many values at all. In addition to that, there is a significant level of noise. I would be very happy if someone was able to help me out. 

LJStreamUD will simply stream the data at the desired rate and write it to file at that rate.  If you want to modify LJStreamUD, the source code is in the LabVIEW_LJUD archive, but you need to be a decent LabVIEW programmer to dive in to that.  It would be easier to start with "U6 easy Stream.vi", so I suggest you start there if you want to make your own LabVIEW program.

As for noise, see the Noise and Resolution app note, and start by jumpering a channel to GND and replicate the numbers from Appendix B of the U6 User's Guide.  More details are beyond the scope of this page, so I suggest starting a topic on our forum.

Why does LJStreamUD only polling 4 channels in GUI?

Channel no 4 to 15 data is not being polled.

How to enable those?

See the "# Channels" control in the upper-left.  Most likely you have it set to 4.

Thanks, it's working now.

Currently I have set it to 2 channels.

12-199, 12-13. (AIN12-AIN13 is connected across a resistor.)

I am facing two more problems:

1. When I click Start Stream, I am getting error: LabJack Error #60:  Stream scans overlapped  occured at LJUD_eGetS (DBL Array).vi

2. After some time channel 1 (12-199) voltage value stops getting updated. Only 12-13 is getting updated.

How to resolve above?


1.  Stream overlap error means a new scan needs to start but the previous scan has not finished.  That is, your scan rate is too high.  Max scan rate depends on number of channels, resolution index, and the smallest range you are using on any of those channels.  See Section 3.2 of the U6 User's Guide.

2.  What do you mean by "stops getting updated".  Do you mean that after some time the numbers you see in the "Voltage" and "Scaled" columns are changing in the first row but not the second row?  Never heard of that.  I suggest you contact [email protected] and send some screenshots so we can get into more details.

1. regarding this, reason for this issue being my scan rate to high, ok then I shall lower my scan rate and try. Also I shall refer the table to set the scan rate.

   But, in coming time I am going to write code to use stream mode to read data from LJ U6, then do I always need to refer the table to set scan rate and settling time?

2. Yes, I have two channels. 12-199, 12-13. After some time, numbers we see in 'voltage' and 'scaled' are getting changed for only 12-13, for 12-199 they are not getting changed at all though I decrease/increase load across sense resistor.

I shall screenshot and details to support also.

If you stream too slow, you have to tweak communication parameters as mentioned above.  If you stream faster than the limits documented in Section 3.2, you will get an error, so yes you need to stay below the limits from Section 3.2.

I am using one channel, resolution index: 8 and scan rate: 10 Hz, range: LJ_rgBIPP01V still I get error:

LabJack Error #58:  Stream timedout before reading enough data  occured at LJUD_eGetS (DBL Array).vi

Section 3.2 states I can go at max 500 Hz. Value is instantaneously getting updated in GUI but start stream gives above error.

Most likely the problem is because you are going so slow.  You can see from Section 4.3.7 that the default samples-per-packet is 25.  You are streaming 1 channel at 10 Hz, so it will take 2.5 seconds for your stream to make 1 packet.  2.5 seconds is longer than the default stream read timeout, so you get the error you are seeing.  If you want to stream this slow, you will have to look at tweaking parameters such as LJ_chSTREAM_SAMPLES_PER_PACKET, LJ_chSTREAM_READS_PER_SECOND, and LJ_chSTREAM_COMMUNICATION_TIMEOUT.

We recommend that you use command-response mode first.  If you are going too fast and have to use stream mode, then try to use stream mode.

spark fun's picture

Hello, I need some help regarding the scan rate, so it says that the scan rate=sample rate / #channels so for example if I have one channel and the sample rate is always 50Khz then the scan rate gonna be 50Khz, if I have 2 channels then it's gonna be 25Khz and so on...so if this is correct and let's say I have one input channel, should I choose exactly 50Khz in the scan rate or do I have the entire [0-50Khz] interval to choose from?

labjack support's picture

The maximum sample rate is 50kHz (sample rate = scan rate * # channels). For a one channel stream you can configure the scan rate to 1-50kHz (the entire interval, integer values), for two channels the scan rate can be 1-25kHz, and so on.

spark fun's picture

And why is it preferable to use Command/Response over Stream in low-frequency applications? why not just use Stream mode all the time?

labjack support's picture

Here are a few reasons:

Our general philosophy is to leverage the power of computers whenever possible.  So in a slower application where software timing is just as good as hardware timing, we would typically want to let software control the timing.

Most users find command-response to be more straightforward and easier to understand than stream mode.

By default, stream packets have 25 samples each.  If you are streaming 1 channel at 1 scan/second, for example, you would only get a packet every 25 seconds.  To avoid timeouts and such infrequent data you would have to write to some advanced configuration parameters.

Stream does have a minimum scan rate.  The minimum is 0.24 scans/second for the U3 hardware, and could be further limited depending on software.


Imad Lehmidi's picture

what does "Identifier" signify in the "LJStreamUD_open.cfg" file?

labjack support's picture

Under normal circumstances you should not need to modify the open config since our loggers open the first available device. That said, the identifier is equivalent to the parameter pAddress in our OpenLabJack call described here:


Note that changing the identifier and connection type will not do anything if you do not also modify the device type parameter. This is because the device type parameter in the config file is used to select whether to use a specific open call or "FirstFound" call to connect to the device.