On this process from demo i tested and begin the status work but after close and open the port status is false not active
procedure TFormMain.actConnectExecute(Sender: TObject);
begin
if not Assigned(DataPort) then Exit;
if DataPort.Active then //here working status active when port was open
begin
DataPort.Close();
end
else
begin
if pgcMain.ActivePage = tsSerial then
begin
dpSerial.Port := cbSerialPort.Text;
dpSerial.BaudRate := StrToIntDef(cbSerialBitrate.Text, 9600);
end
else
if pgcMain.ActivePage = tsTCP then
begin
dpTCP.RemoteHost := edTCPHost.Text;
dpTCP.RemotePort := edTCPPort.Text;
end
else
if pgcMain.ActivePage = tsUDP then
begin
dpUDP.RemoteHost := edUDPHost.Text;
dpUDP.RemotePort := edUDPPort.Text;
end
else
if pgcMain.ActivePage = tsHTTP then
begin
dpHTTP.Url := edHTTPHost.Text;
end
else
if pgcMain.ActivePage = tsFile then
begin
dpFile.FileName := edFileName.Text;
end;
actConnect.Caption := 'Connecting..';
DataPort.Open();
if DataPort.Active then begin // here status false when port was open status not update when open port...
DataPort.Push(#27);
end;
if pgcMain.ActivePage = tsHTTP then
begin
// send HTTP request
DataPort.Push(#27);
end;
end;
end;