Initial commit
This commit is contained in:
89
TC3_CNCPLCBase/Messages/PRG_Messages.TcPOU
Normal file
89
TC3_CNCPLCBase/Messages/PRG_Messages.TcPOU
Normal file
@@ -0,0 +1,89 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4022.6">
|
||||
<POU Name="PRG_Messages" Id="{3add6422-7f87-47f0-a78a-763357959f3f}" SpecialFunc="None">
|
||||
<Declaration><![CDATA[PROGRAM PRG_Messages
|
||||
VAR
|
||||
bStart: BOOL;
|
||||
fbWarningMessages : FB_SimpleEventLog;
|
||||
fbAlarmMessages : FB_SimpleEventLog;
|
||||
//fbExAlarmMessages : FB_ExtSimpleEventLog;
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[(*
|
||||
TCEVENTCLASS_NONE :=0, No class
|
||||
TCEVENTCLASS_MAINTENANCE :=1, Maintenance hint
|
||||
TCEVENTCLASS_MESSAGE :=2, Message
|
||||
TCEVENTCLASS_HINT :=3, Hint
|
||||
TCEVENTCLASS_STATEINFO :=4, State information
|
||||
TCEVENTCLASS_INSTRUCTION :=5, Instruction
|
||||
TCEVENTCLASS_WARNING :=6, Warning
|
||||
TCEVENTCLASS_ALARM :=7, Alarm
|
||||
TCEVENTCLASS_PARAMERROR :=8 Parameter error
|
||||
*)
|
||||
|
||||
|
||||
(* Shows how to generate messages *)
|
||||
IF NOT bStart THEN
|
||||
bStart := TRUE;
|
||||
|
||||
fbWarningMessages
|
||||
(Init := TRUE,
|
||||
SourceId := 51,
|
||||
Class := TCEVENTCLASS_WARNING,
|
||||
QuitRequireD := FALSE,
|
||||
adrAlarmArray := ADR(MSG_WARNING_List),
|
||||
adrQuitArray := ADR(MSG_WARNING_ListQuit)
|
||||
);
|
||||
|
||||
fbAlarmMessages
|
||||
(Init := TRUE,
|
||||
SourceId := 50,
|
||||
Class := TCEVENTCLASS_ALARM,
|
||||
QuitRequired := FALSE,
|
||||
adrAlarmArray := ADR(MSG_ALARM_List),
|
||||
adrQuitArray := ADR(MSG_ALARM_ListQuit)
|
||||
);
|
||||
(*
|
||||
fbExAlarmMessages(
|
||||
Init:= TRUE,
|
||||
SourceId:= 52,
|
||||
Class:= TCEVENTCLASS_WARNING,
|
||||
QuitRequired:= FALSE,
|
||||
adrAlarmArray:= ADR(MSG_ExALARM_List),
|
||||
adrQuitArray:= ADR(MSG_ExALARM_ListQuit),
|
||||
adrEventData:= ADR(MSG_ExALARM_EventData),
|
||||
sFormatString:= '%d%s'
|
||||
);
|
||||
*)
|
||||
ELSE
|
||||
fbWarningMessages
|
||||
(Init := FALSE);
|
||||
|
||||
fbAlarmMessages
|
||||
(Init := FALSE);
|
||||
(*
|
||||
fbExAlarmMessages
|
||||
(Init := FALSE);
|
||||
*)
|
||||
END_IF
|
||||
|
||||
|
||||
]]></ST>
|
||||
</Implementation>
|
||||
<LineIds Name="PRG_Messages">
|
||||
<LineId Id="3" Count="33" />
|
||||
<LineId Id="53" Count="0" />
|
||||
<LineId Id="55" Count="1" />
|
||||
<LineId Id="74" Count="0" />
|
||||
<LineId Id="57" Count="5" />
|
||||
<LineId Id="54" Count="0" />
|
||||
<LineId Id="75" Count="0" />
|
||||
<LineId Id="37" Count="5" />
|
||||
<LineId Id="63" Count="2" />
|
||||
<LineId Id="76" Count="0" />
|
||||
<LineId Id="43" Count="2" />
|
||||
<LineId Id="2" Count="0" />
|
||||
</LineIds>
|
||||
</POU>
|
||||
</TcPlcObject>
|
||||
Reference in New Issue
Block a user