« Close

Datasheets and User Guides

App Notes

Software & Driver

 

Delphi for LJM - Windows

LJM Delphi Wrapper/Examples Windows/Mac/Linux (Software Platform)

Windows Delphi wrapper and examples for the LJM library.

Release

LJM Delphi Wrapper/Examples (Referencable)

Prerequisites

Instructions

  1. Go to the T4 or T7 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.  

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 Delphi Wrapper/Examples Bottom (Referencable)

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.

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