Forum > Packages and Libraries

How to use Lazserial

<< < (2/5) > >>

Jurassic Pork:
don't use SendInteger :

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure SendInteger(Data: integer); virtual;send four bytes as integer.Have you tried the totya's code ? it's the right way.
What is your target device ? have you the documentation of it ? May be you must send some characters at the end of each line (like  CRLF ) .

Friendly J.P

Jurassic Pork,

This device I have is PCE-845 Encoder for closing caption. This device required to send CTRL_A first then send N5 then send any Character we want to type which it will show up on TV Closing Caption.  It use 1200 Baudrate, 8 databits, 1 stopbits, none parity. My laptop use COM4 for USB adapter to RS232. (Beklins)

First of all it is my understand we need to set 1200, 8, 1, none in formcreate before we do anything else.

Here is my code which I couldn't get it working. It gives me some errors.

procedure TForm1.FormCreate(Sender: TObject);
  LazSerial1.BaudRate := br_1200;
  LazSerial1.DateBits := db8bits;
  LazSerial1.Device := COM4;
  LazSerial1.FlowControl := fcHardware;
  LazSerial1.Parity := pNone;
  LazSerial1.StopBits := sbOne;

I did try this LazSerial1.BaudRate := 1200;  It didn't work either. 

Also are there any example programs on LazSerial that I can take a look and see how it works?


Hello you can try this software:  This software written in lazarus/fpc and used Lazserial and LNet packages.

source codes are there:

You can use freely.

Jurassic Pork:
here is in attachment a small project to send binary data from a comma delimited string with TLazserial component.
1 - click on the port settings button -> Choose your COM port and configure it.
2 - click on the open button to open the port
2 - Write a hexa comma delimited  string in the Tedit field and check the HEXA checkbox
example :  01,4E,35,48,65,6C,6C,6F,20,74,68,65,72,65 for <CTRL-A>N5Hello There
3 - click on the send button to write your data on the serial port.
The project use a TLazserial component and a TKHexEditor component (from KControls package that you can install from the online package manager). The TKHexEditor is used to display the data coming from the serial port.
the project has been tested on Windows 10 Lazarus 1.8.2  with two serial ports (COM3 and COM4) connected each other with a null modem cable. See attachment.
Friendly, J.P


Your program muterm is nice but I am little confusing how to use it.  I tried to do something and it didn't work for me.  I will figure it out later..

Jurassic Pork,

I have some trouble to get it working. I think I got KControlsLaz.Ipr to addthe package. I couldn't get TKHexEditor working. I don't see Ipr on TKHexEditor.Ipr on list. How can we add it?



[0] Message Index

[#] Next page

[*] Previous page

Go to full version