Skip to content

This application connects devices via Modbus

License

Notifications You must be signed in to change notification settings

osiota/osiota-app-modbus

Repository files navigation

osiota application modbus

Osiota is a software platform capable of running distributed IoT applications written in JavaScript to enable any kind of IoT tasks. See osiota.

Configuration: modbus

This application connects devices via Modbus.

Additional Properties: not allowed

Option 1 (alternative): Modbus Serial Interface

Properties

Name Type Description Required
connect_type
(Connection Type)
string Enum: "RTU", "C701", "RTUBuffered", "AsciiSerial"
yes
connect_path string i.e. device path
yes
connect_options
(Serial Connect Options)
object Additional options for connecting to modbus, i.e. the baud rate settings
no
map
(Modbus devices)
object[] no

Example

{
    "connect_type": "RTUBuffered",
    "connect_path": "/dev/ttyUSB0",
    "connect_options": {
        "baudRate": 9600
    }
}


Option 2 (alternative): Modbus Network Interface

Properties

Name Type Description Required
connect_type
(Connection Type)
string Enum: "TCP", "Telnet"
yes
connect_path
(Host)
string i.e. an IP address or host name
yes
connect_options
(Network Connect Options)
object Additional options for connecting to modbus, i.e. the port settings
no
map
(Modbus devices)
object[] no

Example

{
    "connect_type": "Telnet",
    "connect_path": "192.168.1.101",
    "connect_options": {
        "port": 1234
    }
}

Option 1: connect_options: Serial Connect Options

Additional options for connecting to modbus, i.e. the baud rate settings

See SerialPort options

Properties

Name Type Description Required
baudRate
(Baud rate)
number no

Option 1: map: Modbus devices

Items: Modbus device

Item Properties

Name Type Description Required
node
(Node to map to)
string no
id
(Modbus Client ID)
number Minimum: 0
yes
address
(Modbus Field Address)
number Minimum: 0
yes
type
(Modbus Field Type)
string Enum: "input boolean", "input register", "output boolen", "output register"
no
datatype
(Field Data Type)
string Default: "uint16"
Enum: "boolean", "uint16"
yes
metadata
(Node Metadata)
object no

Example

[
    {
        "node": "/Lamp Switch",
        "id": 0,
        "address": 10,
        "type": "output boolean",
        "datatype": "boolean",
        "metadata": {
            "power": 60
        }
    }
]

Option 1: map.metadata: Node Metadata

Additional Properties: allowed

Option 2: connect_options: Network Connect Options

Additional options for connecting to modbus, i.e. the port settings

See Connect options

Properties

Name Type Description Required
port number Modbus Port
Default: 502
no

Example

{
    "port": 502
}

Option 2: map: Modbus devices

Items: Modbus device

Item Properties

Name Type Description Required
node
(Node to map to)
string no
id
(Modbus Client ID)
number Minimum: 0
yes
address
(Modbus Field Address)
number Minimum: 0
yes
type
(Modbus Field Type)
string Enum: "input boolean", "input register", "output boolen", "output register"
no
datatype
(Field Data Type)
string Default: "uint16"
Enum: "boolean", "uint16"
yes
metadata
(Node Metadata)
object no

Example

[
    {
        "node": "/Lamp Switch",
        "id": 0,
        "address": 10,
        "type": "output boolean",
        "datatype": "boolean",
        "metadata": {
            "power": 60
        }
    }
]

Option 2: map.metadata: Node Metadata

Additional Properties: allowed

How to setup

Add a configuration object for this application, see osiota configuration:

{
    "name": "modbus",
    "config": CONFIG
}

License

Osiota and this application are released under the MIT license.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

About

This application connects devices via Modbus

Resources

License

Stars

Watchers

Forks

Packages

No packages published