Support and Documentation
Breadcrumbs

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

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 VersionsDownload Delphi_LJM_2017_12_04.zip12/04/2017ReleaseUp to date with LJM version 1.16.Added new examples.Added T4 support to examples.Download Delphi_LJM_2015_06_18.zip06/18/2015ReleaseUp to date with LJM version 1.0803.Download Delphi_LJM_2013_12_30.zip12/30/2013ReleaseUp to date with LJM version 1.0200.File listDelphi_LJM_2017_12_04.zip contains:Delphi_LJM_2017_12_04\LICENSE.txtDelphi_LJM_2017_12_04\README.txtDelphi_LJM_2017_12_04\Examples\LJMUtilities.pasDelphi_LJM_2017_12_04\Examples\Basic\eAddresses.dprDelphi_LJM_2017_12_04\Examples\Basic\eNames.dprDelphi_LJM_2017_12_04\Examples\Basic\eReadAddress.dprDelphi_LJM_2017_12_04\Examples\Basic\eReadAddresses.dprDelphi_LJM_2017_12_04\Examples\Basic\eReadName.dprDelphi_LJM_2017_12_04\Examples\Basic\eReadNames.dprDelphi_LJM_2017_12_04\Examples\Basic\eWriteAddress.dprDelphi_LJM_2017_12_04\Examples\Basic\eWriteAddresses.dprDelphi_LJM_2017_12_04\Examples\Basic\eWriteName.dprDelphi_LJM_2017_12_04\Examples\Basic\eWriteNames.dprDelphi_LJM_2017_12_04\Examples\More\AIN\DualAINLoop.dprDelphi_LJM_2017_12_04\Examples\More\AIN\SingleAIN.dprDelphi_LJM_2017_12_04\Examples\More\AIN\SingleAINWithConfig.dprDelphi_LJM_2017_12_04\Examples\More\Config\ReadConfig.dprDelphi_LJM_2017_12_04\Examples\More\Config\ReadDeviceNameString.dprDelphi_LJM_2017_12_04\Examples\More\Config\WriteDeviceNameString.dprDelphi_LJM_2017_12_04\Examples\More\Config\WritePowerConfig.dprDelphi_LJM_2017_12_04\Examples\More\DIO\SingleDIORead.dprDelphi_LJM_2017_12_04\Examples\More\DIO\SingleDIOWrite.dprDelphi_LJM_2017_12_04\Examples\More\Ethernet\ReadEthernetConfig.dprDelphi_LJM_2017_12_04\Examples\More\Ethernet\ReadEthernetMAC.dprDelphi_LJM_2017_12_04\Examples\More\Ethernet\WriteEthernetConfig.dprDelphi_LJM_2017_12_04\Examples\More\I2C\I2CEeprom.dprDelphi_LJM_2017_12_04\Examples\More\ListAll\ListAll.dprDelphi_LJM_2017_12_04\Examples\More\SPI\SPI.dprDelphi_LJM_2017_12_04\Examples\More\Stream\StreamBasic.dprDelphi_LJM_2017_12_04\Examples\More\Stream\StreamBasicWithStreamOut.dprDelphi_LJM_2017_12_04\Examples\More\Stream\StreamBurst.dprDelphi_LJM_2017_12_04\Examples\More\Stream\StreamSequentialAIN.dprDelphi_LJM_2017_12_04\Examples\More\Testing\CRSpeedTest.dprDelphi_LJM_2017_12_04\Examples\More\Watchdog\ReadWatchdogConfig.dprDelphi_LJM_2017_12_04\Examples\More\Watchdog\WriteWatchdogConfig.dprDelphi_LJM_2017_12_04\Examples\More\WiFi\ReadWiFiConfig.dprDelphi_LJM_2017_12_04\Examples\More\WiFi\ReadWiFiMAC.dprDelphi_LJM_2017_12_04\Examples\More\WiFi\ReadWiFiRSSI.dprDelphi_LJM_2017_12_04\Examples\More\WiFi\WriteWiFiConfig.dprDelphi_LJM_2017_12_04\Wrapper\LJMDelphi.pas