DAQFactory for LJM - Windows | LabJack
« Close

Datasheets and User Guides

App Notes

Software & Driver


DAQFactory for LJM - Windows

LJM DAQFactory Examples Top (Referencable)

DAQFactory is measurement and automation software from AzeoTech.  It allows you to make a custom application with little or no programming.  DAQFactory Express is a free version with the key limitation of up to 8 channels.



LJM Examples Where Is An Example To Do XYZ Minimal (Referencable)

Communication Basics

With the LJM library, pretty much everything you might want to do with a device is accomplished by writing and/or reading some registers.  Look at the device's datasheet (T7 or T4) or the Modbus Map to determine what registers you need to write and read, then use eWriteName (or eWriteNames) to write the desired registers and eReadName (or eReadNames) to read the desired registers.

LJM DAQFactory Examples Bottom (Referencable)


Getting Started

  1. Go to the T4 or T7 Quickstart Tutorial and follow the steps to install LabJack software and confirm basic operation.
  2. Download LJM_Basic.ctl attached at the bottom of this page.
  3. Open the .ctl example in DAQFactory to edit and run.



The following image shows a typical view of DAQFactory with the LJM_Basic.ctl example open.  We have the Workspace window on the right, the Command / Alert window at the bottom so we can readily see any error messages, and in the main area we are looking at Page_0:

A "Page" in DAQFactory is where you make your virtual front panel by adding controls, indicators, buttons, graphs, and more.


Opening a Device

DAQFactory takes care of opening in the background, based on the D# (device number) specified in the Channels list or any LJM library calls in script.  DAQFactory makes a call to LJM_OpenS, where ANY is passed to both DeviceType and ConnectionType, and the specified D# string is passed to Identifier.  A D# that is blank, 0, or ANY, tells LJM to open the first device it can find.  D# can also be set to serial number, IP address, or device name.


Linking LabJack Inputs/Outputs to DAQFactory Channels

Creating a customized DAQ program is a simple process when using DAQFactory. The following image shows a view of the LJM_Basic.ctl example.  By clicking Local=>CHANNELS in the Workspace window we get the Channel Table View as shown here:

Use this Channel Table VIEW to define DAQFactory Channels which are usually linked to register names on the LabJack.

The most common registers (tagged "CORE"), are listed as I/O Type options in DAQFactory, but you can link to any register by using the I/O Type "Special" and putting the register name in the Quick Note / Special column.  See the LJM_Basic.ctl example.

  1. I/O Type can be set to one of the core register names or can be set to "Special".
  2. If I/O Type is set to "Special", then put the actual register name in the Quick Note / Special column.  This allows you to link any register that is a singular numeric value.
  3. If the register name contains a "#", then specify the channel number in the Chn # column.  This is true whether you have the register name in the I/O Type or Quick Note / Special column.

Once you have defined a channel, you can click on the particular channel name in the Workspace under Local=>CHANNELS=> and get a detailed tab view for a particular channel, as shown in the following with the Table tab for AIN0 active:

This Table tab and the Graph tab are a quick way to see value updates for a DAQFactory Channel.



DAQFactory supports a native scripting language that can make calls to functions from the LJM library.  At this time the functions LJM_eReadName and LJM_eWriteName are supported (and stream functions).  Script can be put various places in DAQFactory, but the most common place is in a Sequence.  The following view from LJM_Basic.ctl shows a Sequence called StartUp that has been set to Auto-Start, meaning that it will run when this ctl first loads.  This sequence is making calls to LJM_eWriteName to configure the range of AIN0-AIN3.

Note from the LJM documentation links above that the first parameter to eReadName and eWriteName is normally Handle, but since DAQFactory takes care of opening in the background (see "Opening a Device" above), the first parameter in DAQFactory is actually the Identifier parameter of LJM_OpenS.


Stream Mode

As opposed to the normal command-response mode, stream mode is used for the highest data rates.  To stream with DAQFactory and the LJM library, you use script to make the calls to start the stream, read stream data, and append stream data to DAQFactory Channels.  See the attached example "LJM_Stream.ctl".


Device Configuration

Device configuration is done by writing various registers.  There are 2 fundamental ways to do this:

  1. Use Kipling to configure the device and save the configuration as the power-up default.
  2. Configure at program start-up (or anytime) using script and/or channels within DAQFactory.

Method #1 is quick & easy, but each device you use with this program has to be pre-configured properly.

Method #2 is a little more effort, but has the advantage that any suitable device will work with your program without requiring pre-configuration.

Within method #2, there are 2 basic ways to do the configuration within DAQFactory:

2A: The technique demonstrated in the LJM_Basic.ctl example uses an LJM function call in script to write the desired values to the proper registers.  In the example, the script named "StartUp" is set to Auto-Start so that it runs when the program is first loaded and does the configuration at that time.

2B: The other technique is to define DAQFactory Channels for the proper registers and then use normal DAQFactory techniques (which might be a script) to write values to those DAQFactory Channels.



    Refer to the DAQFactory help for more information. To access DAQFactory's help for LabJackM devices, select the Help -> Help Topics, then select Devices -> LabJack M (T7).

    The AzeoTech forum is a great resource for DAQFactory related questions & answers.

    You can also refer to Sections 4-7 of the DAQFactory - LabJackUD Application guide.  Sections 1-3 and 8-11 are mostly specific to the UD library (U3/U6/UE9), but Sections 4-7 mostly apply to DAQFactory in general:

    • Section 4 - Displaying Data (indicators, graphs, scaling equations)
    • Section 5 - Logging (writing to file)
    • Section 6 - Intro To Scripting
    • Section 7 - Common Tasks (reacting to inputs, email, and more)



    File Attachment: 


    I don't see the zip file that it is supposed to be  attached to this page.

    However, my real question is about accessing the analog streaming mode  of the T7 from Daqfactory. Is that possible? Also, some clarity into how streaming mode works with Modbus. I see the commands, I don't quite get the paradigm about how to set up, capture a stream, then retrieve it to the client.

    This is through the Ethernet interface of the T7.

    Someone forgot to check the "list" box for the examples so I just did that.

    I don't believe AzeoTech is supporting stream yet.  We will ask them about it, and I suggest posting on AzeoTech's forum also.

    Streaming directly with Modbus is not trivial, and we have not provided much support for that yet.  If you want to pursue it, I would start a topic on our forum and we can fill in more details.

    Streaming with LJM is much easier.  Check out eStreamStart, eStreamRead, and eStreamStop, and the examples for various languages.

    What kind of performance can one expect to get with DAQFactory and a T7 in terms of sample rates over Ethernet?



    In general, I would not expect DF to be slower than any other environment:


    That is for command-response.  DF does not support stream mode yet, but I know AzeoTech is working on it so I am sure you could bug them about it.