Skip to main content

IEC60870-5-104

The iec60870-5-104 node-type creates a TCP server to provide data to a single IEC60870-5-104 "Master".

Note

The data is sent periodically and buffered until a a client connects. The internal buffer is of fixed size and will drop the oldest messages on overflow. (See high_priority_queue and low_priority_queue configuration)

Prerequisites

This node-type requires lib60870 (>= 2.3.1).

Configuration

object (Input configuration (received by VILLASnode))
object (Output configuration (sent out by VILLASnode))
address
string
Default: "localhost"

Hostname or IP address for the IEC60870 slave to listen on.

port
number
Default: 2404

Port number of the IEC60870 slave.

ca
number
Default: 1

Common Address of the IEC60870 slave.

low_priority_queue
number
Default: 100

Message queue size for the periodic messages (increase on dropped simulation data messages).

high_priority_queue
number
Default: 100

Message queue size for interrogation responses (increase on missing signals in interrogation response).

apci_t0
number
apci_t1
number
apci_t2
number
apci_t3
number
apci_k
number
apci_w
number
vectorize
integer
Default: 1

This setting allows to send multiple samples in a single message to the destination nodes.

The value of this setting determines how many samples will be combined into one packet.

Array of Hook Object (object) or Hook Name (string) (hook_list)
builtin
boolean (Builtin hook functions)
Default: true

By default, each node and paths has a couple of default hooks attached to them. With this setting the attachment of built-in hooks can be disabled.

{
  • "in": {
    },
  • "out": {
    },
  • "address": "localhost",
  • "port": 2404,
  • "ca": 1,
  • "low_priority_queue": 100,
  • "high_priority_queue": 100,
  • "apci_t0": 0,
  • "apci_t1": 0,
  • "apci_t2": 0,
  • "apci_t3": 0,
  • "apci_k": 0,
  • "apci_w": 0,
  • "vectorize": 1,
  • "hooks": [
    ],
  • "builtin": true
}

Example

node/etc/examples/nodes/iec60870-5-104.conf
nodes = {
iec104_node = {
type = "iec60870-5-104"

# Network address and port of the server
# 0.0.0.0 listens on all interfaces
address = "0.0.0.0"
port = 2404

# Common address of this IEC104 slave
ca = 41025

# Queue sizes for this node
low_priority_queue = 100
high_priority_queue = 100

out = {
# Map signals to information object addresses and ASDU data types
# one ASDU per specified asdu_type_id/asdu_type+with_timestamp is
# send for each sample. Signals of the same type are collected
# in a single ASDU
signals = (
{
# The ASDU data type
asdu_type = "normalized-float"

# Add 56 bit unix timestamp to ASDU
with_timestamp = false

# The information object address of this signal
ioa = 4202832
},
{
# Equivalent to the asdu_type above
asdu_type_id = "M_ME_NA_1"
ioa = 4202852
},
{
# A boolean value
asdu_type = "single-point"
with_timestamp = true
ioa = 4206948
}
)
}
}
}
node/etc/examples/nodes/iec60870-5-104-sequence.conf
nodes = {
iec104_node_seq = {
type = "iec60870-5-104"
address = "0.0.0.0"
port = 2404
ca = 1
out = {
# Create a sequence of 5 floats with identical IOAs
signals = {
asdu_type_id = "M_ME_NA_1"
ioa = 4202852
count = 5
}

# Interpret the duplicate IOAs as a sequence by incrementing the
# IOA with each duplication. This only applies to two adjacent
# signals with the same IOA. Specifying an IOA twice with other
# IOAs inbetween is an error
duplicate_ioa_is_sequence = true
}
}
}