dOPC Client Toolkit
Close
dOPCComn.TdOPCClient.OnLog

Occurs when logging event is fired.

property OnLog: TOnOPCLogEvent;
__property TOnOPCLogEvent OnLog;

Occurs only if you are connected to an OPC UA server.

function LogParamToStr(LogParam: cardinal): string; begin case LogParam of TdOPCLog.Debug : result := 'D'; TdOPCLog.Info : result := 'I'; TdOPCLog.Warning : result := 'W'; TdOPCLog.Error : result := 'F'; TdOPCLog.Exception : result := 'E'; TdOPCLog.Request : result := '<--'; TdOPCLog.RequestAsync : result := '<<-'; TdOPCLog.RequestSecure : result := '<<<'; TdOPCLog.Response : result := '-->'; TdOPCLog.ResponseAsync : result := '->>'; TdOPCLog.ResponseSecure : result := '>>>'; TdOPCLog.NilValue : result := 'NULL'; else result := LogParam.ToHexString; end; end; // Adds a log event to a list view object procedure TMainDlg.dOPCDAClientLog(Sender: TObject; LogMsg: TdOPCLogMsg); var LMsg : TdOPCLogMsg; Item : TListItem; begin LMsg := TdOPCLogMsg.Create; LMsg.Assign(LogMsg); // if you want to use it further on, // you have to copy Log object Item := Loglist.Items.Add; Item.Caption := TimeToStr(Now); Item.SubItems.Add(LogParamToStr(LogMsg.LogSeverity)); Item.SubItems.Add(LogParamToStr(LogMsg.LogType)); Item.SubItems.Add(LogMsg.Msg); Item.Data := LMsg; end;
Kassl GmbH Copyright © 2024. All rights reserved.