
The program itself is the user interface of a 16-port dimmer steered by a serial link. Is there an example of code available to learn more about the use of LazSerial? ComException('can not write to a closed port.') if FSynSer.Handle=INVALID_HANDLE_VALUE then If (GetTickCount-t1) > FOutputTimeout thenįunction TLazSerial.WriteBuffer(var buf size: integer): integer IF DD>STRTODATE('99-07-01') THEN SHOWMESSAGE('ASDFASDFASDFSADFASDF') /// What does it means?įunction TCommPortDriver.SendData( DataPtr: pointer DataSize: dword ): dword The WriteBuffer is declared as : function WriteBuffer(var buf size: integer): integer I don’t see the problem but I don’t understand the meaning of in the body of the function. I am new in Pascal but I thought that means “the address of byte b” and that is a pointer. The compiler complains with: PCDIMMER.PAS(322,33) Error: Can't assign values to an address. The first try: replace into gives already troubles. I am now replacing the calls from ComDrv32 into LazSerial ones. the correction makes compilation go a bit further. Procedure TForm1.LazSerial1RxData(Sender: TObject) Procedure TForm1.btnCloseClick(Sender: TObject) Procedure TForm1.btnOpenClick(Sender: TObject) Procedure LazSerial1RxData(Sender: TObject) Procedure btnCloseClick(Sender: TObject) It uses two buttons, a memo component and the all important TLazSerial component to read a device.Ĭlasses, SysUtils, LazSerial, Forms, Controls, Graphics, Dialogs, StdCtrls Should it be useful to others, here is the code I used to test that I had successfully installed LazSerial. MANY THANKS to previous contributors who helped get me here! Next task is to do a clean install of Raspbian OS and install current versions of fpc, Lazarus and LazSerial to avoid any potentially remaining issues. This time, after a successful installation of LazSerial, Lazarus did a successful compile to install LazSerial into the IDE. I had to use the Update option on a dialog when trying to run Lazarus as it seems Raspbian had not deleted the previous version of Lazarus (This is probably down to me not getting the uninstall correct).įrom the Lazarus main menu I used Package | Online Package Manager to install LazSerial. I then followed the instructions at to install Lazarus 2.0.10. I kept the Raspbian installed 3.0.4 version of fpc (Free Pascal Compiler). I used Raspbian Preferences | Add / Remove programs to remove the previous 2.0.0 version installed by Rasbian OS by default. In case it helps others, I've solved my problem and successfully installed TLazSerial in Lazarus 2.0.10 running under Raspbian OS.
