« 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
12/04/2017

LJM Delphi Wrapper/Examples (Referencable)

Prerequisites

Instructions

  1. Download/extract the .zip file attached at the top of this page.
  2. Navigate to the extracted Delphi_LJM folder.
  3. 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.  

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.