Skip to Navigation

LJStreamUD - Windows Only

The application LJStreamUD V1.16 is included with the main installation package:

LabJack Windows Driver and Software Installation Package

49.99 MB
2014-10-14 11:45

LJStreamUD.exe is a ready-to-run executable that streams from 1-16 input channels on a U3, U6, or UE9. It displays selected channels on a graph and writes data to file.

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

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 already changed some settings and are having problems getting it to run, close the program and delete "ljstreamud.cfg", then open again and you will have the default settings.

 

 

LJLogUD vs. LJStreamUD: LJLogUD uses command/response mode as documented in Section 3.1 of any UD series user's guide.  It acquires and processes 1 scan at a time at the specified Interval.  Generally used for perhaps 10 scans/second or slower.  LJStreamUD uses stream mode as documented in Section 3.2 of any UD series user's guide.  Each iteration it retrieves and processes 1 seconds worth of scans.  Generally needed for perhaps 100 scans/second or faster.  For more discussion of command/response mode and stream mode see Section 3.0 of the applicable user's guide:  U3, U6, or UE9.

 

# 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.  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.  In the first 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 ANY is not in the first line, then a call to OpenLabJackS() is made with the specified strings.  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 to make a new default one.

+Ch/-Ch: Put in the desired positive and negative channel numbers.  This specifies which analog input to read.  To read other types of channels (DI, Timers, Counters), see the special channel support described in Section 3.2.1 or 3.2.2 (stream mode section) of the applicable User's Guide.

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.

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.

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.

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

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

 

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.

 

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.

Updates

The main LabJack installer, linked at the top of this page, includes LJStreamUD and also includes the needed LabVIEW 7.1 run-time engine (LVRTE 7.1). If an update to LJStreamUD is available, it will appear in a "File attachment:" section below.  Download and unzip to get the new exe, then find and replace the old exe.

 

tags:

Comments

#1

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. 

#2

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.

#3

Hello 

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

#4

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?

#5

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

#6

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.

#7

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.

#8

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.

#9

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.

#10

LJStreamUD uses the SLEEP wait mode and the number of scans per read is set to the scan rate.  So with your scan rate of 25k, the read loop reads 25k scans per iteration, so your file size will be in increments of 25k scans.  If you are always running for about 30 seconds you should see exactly 750k rows, but if you run a couple seconds longer you should see 800k rows.

No data is missed.  The U3 is always starting a new scan every 40us.

#11

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.

#12

The U3 will acquire a sample every 40us and put those in a small buffer on the U3.  In the background on the PC the UD driver is moving samples from the U3 to a RAM buffer on the PC, perhaps 25 samples per packet.  Those 2 things are happening continuously all the time once the stream is started, regardless of whether the application is reading any data or not.  If the application was not reading any data the UD buffer on the PC would just keep growing.

The application, LJStreamUD in this case, has a loop where it calls the stream read function requesting 25k scans.  As soon as that many scans are available in the UD buffer they are returned to LJStreamUD which processes them and updates the screen.  Because LJStreamUD is using the SLEEP wait type with numscans=25k, you always get multiples of 25k.

#13

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

#14

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

http://labjack.com/support/ud/examples/labview

#15

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.

#16

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

#17

Hello,

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.

#18

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.

#19

Hello,

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?

#20

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.

#21

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,

 

#22

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

#23

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

#24

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