Skip to main content
Skip table of contents

Delphi for LJM - Windows

Windows Delphi wrapper and examples for the LJM library.

Prerequisites

Latest Example Package

Download Delphi_LJM_2017_12_04.zip

  • Up to date with LJM version 1.16.

  • Added new examples.

  • Added T4 support to examples.

Instructions

  1. Go to your device Quickstart Tutorial and follow the steps to install LabJack software and confirm basic operation.

  2. Download/extract the .zip file attached at the top of this page.

  3. Navigate to the extracted Delphi_LJM folder.

  4. Open the dpr examples in Delphi to edit and run.

Refer to the download's README.txt file for requirements, usage, documentation and other details.  

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 T-series Datasheet 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.

Code Snippet

CODE
program ReadSerialNumber;

{$APPTYPE CONSOLE}

uses
  SysUtils,
  { The following are available in the Delphi examples download. }
  LJMDelphi in 'Wrapper\LJMDelphi.pas',
  LJMUtilities in 'Examples\LJMUtilities.pas'; { Provides ErrorHandler. }

const
  name: PAnsiChar = 'SERIAL_NUMBER';
var
  handle: Integer;
  error: Integer = 0;
  value: Double = 0.0;
begin
  { Open first found LabJack. }
  error := LJM_OpenS('Any', 'Any', 'Any', handle);
  ErrorHandler('LJM_Open', error);

  { Call LJM_eReadName to read the serial number from the LabJack. }
  error := LJM_eReadName(handle, name, value);
  ErrorHandler('LJM_eReadName', error);

  Writeln('LJM_eReadName result:');
  Writeln('  ' + name + ' = ' + FloatToStr(value));
end.

All Versions

Download Delphi_LJM_2017_12_04.zip

  • 12/04/2017

  • Release

  • Up to date with LJM version 1.16.

  • Added new examples.

  • Added T4 support to examples.

Download Delphi_LJM_2015_06_18.zip

  • 06/18/2015

  • Release

  • Up to date with LJM version 1.0803.

Download Delphi_LJM_2013_12_30.zip

  • 12/30/2013

  • Release

  • Up to date with LJM version 1.0200.

File list

Delphi_LJM_2017_12_04.zip contains:

Delphi_LJM_2017_12_04\LICENSE.txt
Delphi_LJM_2017_12_04\README.txt
Delphi_LJM_2017_12_04\Examples\LJMUtilities.pas
Delphi_LJM_2017_12_04\Examples\Basic\eAddresses.dpr
Delphi_LJM_2017_12_04\Examples\Basic\eNames.dpr
Delphi_LJM_2017_12_04\Examples\Basic\eReadAddress.dpr
Delphi_LJM_2017_12_04\Examples\Basic\eReadAddresses.dpr
Delphi_LJM_2017_12_04\Examples\Basic\eReadName.dpr
Delphi_LJM_2017_12_04\Examples\Basic\eReadNames.dpr
Delphi_LJM_2017_12_04\Examples\Basic\eWriteAddress.dpr
Delphi_LJM_2017_12_04\Examples\Basic\eWriteAddresses.dpr
Delphi_LJM_2017_12_04\Examples\Basic\eWriteName.dpr
Delphi_LJM_2017_12_04\Examples\Basic\eWriteNames.dpr
Delphi_LJM_2017_12_04\Examples\More\AIN\DualAINLoop.dpr
Delphi_LJM_2017_12_04\Examples\More\AIN\SingleAIN.dpr
Delphi_LJM_2017_12_04\Examples\More\AIN\SingleAINWithConfig.dpr
Delphi_LJM_2017_12_04\Examples\More\Config\ReadConfig.dpr
Delphi_LJM_2017_12_04\Examples\More\Config\ReadDeviceNameString.dpr
Delphi_LJM_2017_12_04\Examples\More\Config\WriteDeviceNameString.dpr
Delphi_LJM_2017_12_04\Examples\More\Config\WritePowerConfig.dpr
Delphi_LJM_2017_12_04\Examples\More\DIO\SingleDIORead.dpr
Delphi_LJM_2017_12_04\Examples\More\DIO\SingleDIOWrite.dpr
Delphi_LJM_2017_12_04\Examples\More\Ethernet\ReadEthernetConfig.dpr
Delphi_LJM_2017_12_04\Examples\More\Ethernet\ReadEthernetMAC.dpr
Delphi_LJM_2017_12_04\Examples\More\Ethernet\WriteEthernetConfig.dpr
Delphi_LJM_2017_12_04\Examples\More\I2C\I2CEeprom.dpr
Delphi_LJM_2017_12_04\Examples\More\ListAll\ListAll.dpr
Delphi_LJM_2017_12_04\Examples\More\SPI\SPI.dpr
Delphi_LJM_2017_12_04\Examples\More\Stream\StreamBasic.dpr
Delphi_LJM_2017_12_04\Examples\More\Stream\StreamBasicWithStreamOut.dpr
Delphi_LJM_2017_12_04\Examples\More\Stream\StreamBurst.dpr
Delphi_LJM_2017_12_04\Examples\More\Stream\StreamSequentialAIN.dpr
Delphi_LJM_2017_12_04\Examples\More\Testing\CRSpeedTest.dpr
Delphi_LJM_2017_12_04\Examples\More\Watchdog\ReadWatchdogConfig.dpr
Delphi_LJM_2017_12_04\Examples\More\Watchdog\WriteWatchdogConfig.dpr
Delphi_LJM_2017_12_04\Examples\More\WiFi\ReadWiFiConfig.dpr
Delphi_LJM_2017_12_04\Examples\More\WiFi\ReadWiFiMAC.dpr
Delphi_LJM_2017_12_04\Examples\More\WiFi\ReadWiFiRSSI.dpr
Delphi_LJM_2017_12_04\Examples\More\WiFi\WriteWiFiConfig.dpr
Delphi_LJM_2017_12_04\Wrapper\LJMDelphi.pas

JavaScript errors detected

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

If this problem persists, please contact our support.