FUNCTION_BLOCK FB_TwinSAFE_KLx904_input

The function block FB_TwinSAFE_KLx904_input can be used for evaluation of TwinSAFE data sent from a KL1904 or KL2904 to a KL6904. The input parameter is doubly linked to the SafetyIn data of a KL1904 or KL2904 in the System Manager.
VAR_INPUT
VAR_INPUT
KLx904_SafetyIn AT%I* : TwinSAFE_Data; (* Additional link to "SafetyIn" *)
END_VAR
KLx904_SafetyIn: TwinSAFE telegram sent from a KL1904 or KL2904 to a KL6904. This parameter is doubly linked to SafetyIn in the System Manager (input data of the KLx904).
VAR_OUTPUT
VAR_OUTPUT
bInput1 : BOOL;
bInput2 : BOOL;
bInput3 : BOOL;
bInput4 : BOOL;
tCycleTime : TIME;
bConnectionInRun : BOOL;
END_VAR
bInput1: Returns input 1 of a KL1904. If this function block is used for connection to a KL2904, the value is always 0.
bInput2: Returns input 2 of a KL1904. If this function block is used for connection to a KL2904, the value is always 0.
bInput3: Returns input 3 of a KL1904. If this function block is used for connection to a KL2904, the value is always 0.
bInput4: Returns input 4 of a KL1904. If this function block is used for connection to a KL2904, the value is always 0.
tCycleTime: Returns the cycle time in ms for exchanging the TwinSAFE telegram between the devices.
bConnectionInRun: Returns TRUE if there is no error in the connection between the KLx904 and the KL6904.
Example of a call in the FBD:
PROGRAM MAIN
VAR
fbTwinSAFE_KLx904_input : FB_TwinSAFE_KLx904_input;
bInput1_KL1904_S_Address_113 : BOOL;
bInput2_KL1904_S_Address_113 : BOOL;
bInput3_KL1904_S_Address_113 : BOOL;
bInput4_KL1904_S_Address_113 : BOOL;
tCycleTime_KL1904_KL6904 : TIME;
bConnection3_In_Run : BOOL;
END_VAR

In the example the values of the KL1904 input data are written to the connected variables. If the output bConnectionInRun is FALSE, all outputs are set to FALSE.
To link the input data, select the parameter KLx904_SafetyIn and select "Modify link..." from the context menu.

and select the corresponding SafetyIn variable in the dialog that follows.

Development environment |
Target platform |
IO Hardware |
PLC libraries to include |
---|---|---|---|
TwinCAT v2.10.0 Build > 914 |
PC (i386) |
KLx904 |
TcTwinSAFE.Lib |
TwinCAT v2.10.0 Build > 914 |
BX series |
KLx904 |
TcTwinSAFE.LBX |