📄 uaginfo.pas
字号:
unit uAGinfo;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, XPMan,uGlobdata, XPMenu;
type
TFrmAGinfo = class(TForm)
ButtonAGinfoSure: TButton;
ButtonAGinfoCancel: TButton;
Label1: TLabel;
Label2: TLabel;
EditAGinfo: TEdit;
EditPLCas: TEdit;
Label3: TLabel;
EditpgAS: TEdit;
XPMenu1: TXPMenu;
procedure ButtonAGinfoCancelClick(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure ButtonAGinfoSureClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
Procedure AGInfoerror(var message: TMessage); message CM_COMMSG;
end;
var
FrmAGinfo: TFrmAGinfo;
implementation
{$R *.dfm}
Uses Prodave60;
Procedure TFrmAGinfo.AGInfoerror(var message: TMessage);
var
Msg:TMessage;
Wp:integer;
begin
Msg:=message;
Wp:=msg.WParam;
if (Wp=AGInfoERR) then begin
Messagebox(AppHWD.Handle,Pchar(GetErrorMessage_ex6(msg.LParam)),
Pchar('错误代码 :0x'+ IntToHex(msg.LParam,4)),
MB_OK);
end;
end;
procedure TFrmAGinfo.ButtonAGinfoCancelClick(Sender: TObject);
begin
Close;
end;
procedure TFrmAGinfo.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action:=caFree;
end;
procedure TFrmAGinfo.ButtonAGinfoSureClick(Sender: TObject);
var
PLCINFO:PAS_INFO_TYPE;
BufferLEN,DataLen:Integer;
ConFlag:Integer;
begin
BufferLEN:=36;
try
New(PLCINFO);
ConFlag:=as_info_ex6(BufferLen,PLCINFO,@DataLen);
if (ConFlag<>0) AND (ConFlag<> 28801) then begin
PostMessage(AppHWD.Handle, CM_COMMSG, AGInfoERR, ConFlag);
end
else begin
EditAGinfo.Text:=TrimLeft(PLCINFO.mlfb);
EditplcAS.Text:=Format('%s %d.%d.%d',[PLCINFO.Plcas[1],ord(PLCINFO.Plcas[2])
,ord(PLCINFO.Plcas[3]),ord(PLCINFO.Plcas[4])]);
EditpgAS.Text:= IntToStr(Ord(PLCINFO.pgas[1]))+IntToStr(Ord(PLCINFO.pgas[2]));
end;
finally
Dispose(PLCINFO);
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -