API Reference ExIEC60870 v#0.1.0

Copy Markdown View Source

Modules

Pure Elixir implementation of IEC 60870-5-101 and IEC 60870-5-104 (Master & Slave, Balanced & Unbalanced, full Information Objects, and bidirectional File Transfer Service), modeled after lib60870-C.

APCI (Application Protocol Control Information) parameters for IEC 60870-5-104. Corresponds to sCS104_APCIParameters in lib60870-C.

Application Service Data Unit (ASDU) shared by IEC 60870-5-101 and IEC 60870-5-104. Matches cs101_asdu.c in lib60870-C.

Application layer parameters shared by IEC 60870-5-101 and IEC 60870-5-104. Corresponds to sCS101_AppLayerParameters in lib60870-C.

IEC 60870-5-101 FT 1.2 frame codec and stream deframer (serial_transceiver_ft_1_2.c & link_layer.c).

IEC 60870-5-101 Link Layer state machines (link_layer.c), supporting

IEC 60870-5-101 Master (cs101_master.c), supporting both :balanced and :unbalanced link layer modes.

FIFO Queue for CS101 ASDUs (cs101_queue.c). Used for Class 1 / Class 2 queues in CS101.Slave and user data queue in CS101.Master.

IEC 60870-5-101 Slave (cs101_slave.c), supporting both :unbalanced and :balanced link layer modes.

Transport abstraction for IEC 60870-5-101 serial / virtual links.

Adapter for Circuits.UART hardware serial ports.

In-memory virtual serial bus (RS-232 / RS-485 bus simulator) for CS101 Master & Slave.

IEC 60870-5-104 Client / Master Connection (GenServer), equivalent to cs104_connection.c.

IEC 60870-5-104 APCI frame codec and stream deframer (cs104_frame.c).

Represents a connected Master (Client) peer on a CS104.Slave server (MasterConnection in cs104_slave.c).

Configuration for a CS104 redundancy group (CS104_RedundancyGroup in cs104_slave.c).

IEC 60870-5-104 Slave / Server (cs104_slave.c).

IEC 60870-5-101 / 104 File Transfer Client for Master stations.

Accumulator for receiving multi-section / multi-segment files during IEC 60870-5-101/104 file transfers (CS101_IFileReceiver in cs101_file_service.h).

In-memory file receiver container (CS101_IFileReceiver memory receiver).

IEC 60870-5-101 / 104 File Transfer Server (file_server.c) for Slave stations.

Represents a file composed of one or more binary sections for IEC 60870-5-101/104 File Transfer (CS101_IFileProvider / CS101_TransparentFile in cs101_file_service.h).

Control direction Process Command Information Objects (TypeIDs 45..51, 58..64). Matches cs101_information_objects.c in lib60870-C.

32-bit bitstring command (C_BO_NA_1, C_BO_TA_1).

Double command (C_DC_NA_1, C_DC_TA_1).

Normalized setpoint command (C_SE_NA_1, C_SE_TA_1).

Scaled setpoint command (C_SE_NB_1, C_SE_TB_1).

Short floating point setpoint command (C_SE_NC_1, C_SE_TC_1).

Single command (C_SC_NA_1, C_SC_TA_1).

Regulating step command (C_RC_NA_1, C_RC_TA_1).

File Transfer Information Objects (TypeIDs 120..127 and extended TypeID 210). Matches cs101_information_objects.c in lib60870-C.

Extended file packet for domestic 210 file transfer.

File transfer acknowledgement (F_AF_NA_1, TypeID 124).

Call directory, select file, call file, call section (F_SC_NA_1, TypeID 122).

Directory information response (F_DR_TA_1, TypeID 126).

Last section or last segment confirmation (F_LS_NA_1, TypeID 123).

File ready message (F_FR_NA_1, TypeID 120, and domestic F_FR_NA_2, TypeID 210).

File data segment (F_SG_NA_1, TypeID 125).

Query log / directory by time range (F_SC_NB_1, TypeID 127).

Section ready message (F_SR_NA_1, TypeID 121).

Monitoring direction Information Objects (TypeIDs 1..21, 30..41, 70). Matches cs101_information_objects.c in lib60870-C.

32-bit bitstring value with quality and optional timestamp (M_BO_NA_1, M_BO_TA_1, M_BO_TB_1).

Double point information with quality (:off, :on, etc.) and optional timestamp (M_DP_NA_1, M_DP_TA_1, M_DP_TB_1).

End of initialization indicator with cause of initialization (M_EI_NA_1, TypeID 70).

Event of protection equipment with relative elapsed time (M_EP_TA_1, M_EP_TD_1).

Integrated totals / counter value (BinaryCounterReading BCR) (M_IT_NA_1, M_IT_TA_1, M_IT_TB_1).

Security statistics totals with sequence number (S_IT_TC_1, TypeID 41).

Normalized measured value (-1.0..+1.0 / -32768..32767) (M_ME_NA_1, M_ME_TA_1, M_ME_TD_1, M_ME_ND_1).

16-bit scaled integer measured value (-32768..32767) (M_ME_NB_1, M_ME_TB_1, M_ME_TE_1).

IEEE 754 32-bit single precision floating point measured value (M_ME_NC_1, M_ME_TC_1, M_ME_TF_1).

Packed output circuit information of protection equipment (M_EP_TC_1, M_EP_TF_1).

Packed single-point information with status change detection (M_PS_NA_1, TypeID 20).

Packed start events of protection equipment (M_EP_TB_1, M_EP_TE_1).

Single point information with quality and optional timestamp (M_SP_NA_1, M_SP_TA_1, M_SP_TB_1).

Step position information with transient state and quality (M_ST_NA_1, M_ST_TA_1, M_ST_TB_1).

Parameter Information Objects in Control Direction (TypeIDs 110..113). Matches cs101_information_objects.c in lib60870-C.

Parameter activation command (P_AC_NA_1, TypeID 113).

Short float parameter (P_ME_NC_1, TypeID 112).

Normalized value parameter (P_ME_NA_1, TypeID 110).

Scaled value parameter (P_ME_NB_1, TypeID 111).

System Command Information Objects in Control Direction (TypeIDs 100..107). Matches cs101_information_objects.c in lib60870-C.

Clock synchronization command with CP56Time2a (C_CS_NA_1, TypeID 103).

Counter interrogation command (C_CI_NA_1, TypeID 101).

Delay acquisition command (C_CD_NA_1, TypeID 106).

General interrogation command (C_IC_NA_1, TypeID 100).

Read command (C_RD_NA_1, TypeID 102).

Reset process command (C_RP_NA_1, TypeID 105).

Test command (C_TS_NA_1, TypeID 104).

Test command with CP56Time2a timestamp (C_TS_TA_1, TypeID 107).

Unified dispatcher and helper functions for all IEC 60870-5-101/104 Information Objects.

Fallback representation for custom or security ASDU payloads.

Serial link layer parameters for IEC 60870-5-101. Corresponds to sLinkLayerParameters in lib60870-C.

Telemetry integration for IEC 60870 protocol events and metrics.

Binary Counter Reading (BinaryCounterReading, 5 bytes) according to IEC 60870-5-101 7.2.6.9. Matches cs101_bcr.c.

Cause of Transmission (CS101_CauseOfTransmission).

Binary time types CP16Time2a (2 bytes), CP24Time2a (3 bytes), CP32Time2a (4 bytes), and CP56Time2a (7 bytes). Matches cpXXtime2a.c in lib60870-C.

2-byte binary time: elapsed time in milliseconds (0..65535).

3-byte binary time: millisecond (0..999), second (0..59), minute (0..59), substituted flag (0x40), invalid flag (0x80).

4-byte binary time: millisecond, second, minute, substituted, invalid, hour (0..23), summer_time.

7-byte binary time (CP56Time2a) according to IEC 60870-5-101 7.2.6.18. Matches CP56Time2a_* functions in cpXXtime2a.c.

Quality descriptors, qualifiers, and value scaling helpers for IEC 60870-5-101/104. Matches cs101_information_objects.h and cs101_information_objects.c.

IEC 60870-5 ASDU Type Identifications (IEC60870_5_TypeID). Supports bidirectional conversion between integer codes (1..255) and descriptive atoms, as well as element byte size lookup and single-IO validation.