Examples
Used controlled or controlling station configuration parameters:
- Standard PC interface: COM1
 - 19200 Baud
 - Link address: 1
 - Link address size: 1 octet
 - Cause of transfer size: 1 octet
 - Originator address: not used
 - Common ASDU address: 7
 - Common ASDU address size: 1 octet
 - Information object address size: 2 octets
 
To compile this sample code you need the TwinCAT Version 2.10 Build > 1328!
The example applications contain two program parts:
P_MAIN_LowSpeed() implements the protocoll and P_SerialComm_HighSpeed implements the TwinCAT communication over serial communication interface.
Requirements
PLC Project  | TwinCAT System Manager Configuration  | Description  | 
|---|---|---|
(unbalanced mode) (balanced mode)  | (unbalanced mode) 
 LowLevelSlaveSampleBal.zip   | Simple Slave-Application which uses the TwinCAT IEC60870-5-101 Serial Link Interface. The function block FB_IEC870_5_101SServices implements test command, clock synchronisation command, general interrogation command and counter interrogation command (mode C). The bitstring datapoint (M_BO_TB_1, with time tag CP56Time2a, information object address: 100) is send every second to the controlling station with the cause of transfer: spontanous. One counter value (M_IT_NA_1, without time tag, information object address: 400) is send as response to counter interrogation command (mode C) to the controlling station.  | 
(unbalanced mode) 
 LowLevelMasterSampleBal.zip   | LowLevelMasterSample.zip  LowLevelMasterSampleBal.zip   | Simple Master-Application which uses the TwinCAT IEC60870-5-101 Serial Link Interface. 
 The function block FB_IEC870_5_101MServices implements test command, clock synchronisation command, general interrogation command and counter interrogation command.  |