beckhoff TS6271 — 6.1.12 FB_PN_ALARM_DIAG

TwinCAT library and programming VAR_INPUT VAR_INPUT bEnable : BOOL; NETID : T_AmsNetId;(* AMS Net ID from Controller *) PORT : T_AmsPort; (* Port used by Controller to communicate with Device *) END_VAR bEnable : Activation of the function block NETID : AMS Net ID of the controller PORT : Port via which the controller communicates with the device (port = Device ID + 1000hex) VAR_OUTPUT VAR_OUTPUT bBusy : BOOL; stAlarmDiagData : ST_PN_AlarmDiagData; bError : BOOL; iErrorID : UDINT; iNrAlarms : INT; END_VAR bBusy : When the function block is activated this output is set. It remains set until a feedback is received. While Busy = TRUE, no new command will be accepted at the inputs.

stAlarmDiagData : Diagnosis messages are output via this structure. An alarm is output via the structure in each cycle as long as the status bit [0x0010 = at least one AlarmCR got a diagnosis alarm] is present at the PLC input. bError : If an error should occur during the transmission of the command, this output is set after the bBusy output has been reset. iErrorID : Supplies an ADS error number when the output bError is set. iNrAlarms : Number of alarms last read out. VAR VAR PnIoBoxDiag AT %I* : WORD; (*Hardware Input*) END_VAR PnIoBoxDiag : Hardware input: this variable must be linked to the PROFINET device.

A change of state of this variable indicates to the PLC program that there are new diagnosis alarms in the linked PROFINET device. TS6271 65 Version: 1.2