Go to your device Quickstart Tutorial and follow the steps to install LabJack software and confirm basic operation.
Download/extract the .zip file attached at the top of this page.
Navigate to the extracted Delphi_LJM folder.
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.
JavaScript errors detected
Please note, these errors can depend on your browser setup.
If this problem persists, please contact our support.