Forum > Packages and Libraries
[SOLVED] TLazSerial - RTS/DTR
(1/1)
DelphiDinosaur:
Is there any active development of the TLazSerial/SynaSer component?
I'm using LazSerial v0.6 with SynaSer.pas with version 007.005.002.
The problem I'm having is that when the component is created the RTS/DTR lines are being toggled before the hand-shaking settings applied to the component take effect (TLazSerial.Flowcontrol := fcNone).
Normally this isn't a problem, but I've got some legacy hardware (which I can do nothing about) which uses the control lines to put it into an engineering mode resulting in all kind of related issues. The serial link is via USB so I can't just cut the control lines. ALL hardware issues have been considered!
Short of delving into the LazSerial & SynaSer code, is there a way of avoiding the RTS/DTR lines being activated before I've told the control how I want it to behave?
Haven't seen anything like this with the AsyncPro controls I used with Delphi 6 & XE3.
Are there any other cross-platform serial components that are worth considering for Lazarus?
DelphiDino.
Lazarus 2.2.2
FPC 3.2.2
Jurassic Pork:
Hello,
Have you code to show what is the problem ?
Friendly, J.P
tetrastes:
In synaser.pas in TBlockSerial.Config find
--- 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";}};} --- if hardflow then dcb.Flags := dcb.Flags or dcb_OutxCtsFlow or dcb_RtsControlHandshake else dcb.Flags := dcb.Flags or dcb_RtsControlEnable; dcb.Flags := dcb.Flags or dcb_DtrControlEnable;
and change it to
--- 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";}};} --- if hardflow then dcb.Flags := dcb.Flags or dcb_OutxCtsFlow or dcb_RtsControlHandshake; //else // dcb.Flags := dcb.Flags or dcb_RtsControlEnable; //dcb.Flags := dcb.Flags or dcb_DtrControlEnable;
DelphiDinosaur:
--- Quote from: tetrastes on April 19, 2023, 10:56:44 pm ---In synaser.pas in TBlockSerial.Config find
---------8<---------
--- End quote ---
Thanks tetrastes the change to TBlockSerial.Config worked. I've expanded it to include a new setting allowing me to revert to the original behaviour.
TBlockSerial.Connect also needed modifying to prevent the RTS and DTR lines being set when the port is opened.
DelphiDino.
Navigation
[0] Message Index