mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
doc: Add OpenAPI specification for modbus node-type
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
This commit is contained in:
parent
2a82e7b388
commit
65cb2d612b
4 changed files with 157 additions and 0 deletions
|
@ -34,6 +34,7 @@ discriminator:
|
|||
influxdb: nodes/_influxdb.yaml
|
||||
kafka: nodes/_kafka.yaml
|
||||
loopback: nodes/_loopback.yaml
|
||||
modbus: nodes/_modbus.yaml
|
||||
mqtt: nodes/_mqtt.yaml
|
||||
nanomsg: nodes/_nanomsg.yaml
|
||||
ngsi: nodes/_ngsi.yaml
|
||||
|
|
3
doc/openapi/components/schemas/config/nodes/_modbus.yaml
Normal file
3
doc/openapi/components/schemas/config/nodes/_modbus.yaml
Normal file
|
@ -0,0 +1,3 @@
|
|||
allOf:
|
||||
- $ref: ../node_obj.yaml
|
||||
- $ref: modbus.yaml
|
108
doc/openapi/components/schemas/config/nodes/modbus.yaml
Normal file
108
doc/openapi/components/schemas/config/nodes/modbus.yaml
Normal file
|
@ -0,0 +1,108 @@
|
|||
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
|
||||
---
|
||||
|
||||
allOf:
|
||||
- type: object
|
||||
anyOf:
|
||||
- required: [transport, remote]
|
||||
properties:
|
||||
|
||||
transport:
|
||||
type: string
|
||||
enum:
|
||||
- tcp
|
||||
|
||||
remote:
|
||||
type: string
|
||||
description: The hostname or IP of the modbus TCP device.
|
||||
example: example.com
|
||||
|
||||
port:
|
||||
type: integer
|
||||
description: The port number of the modbus TCP device.
|
||||
default: 1883
|
||||
|
||||
unit:
|
||||
type: integer
|
||||
description: The addressed unit used for serial communication. This is optional for TCP.
|
||||
minimum: 0
|
||||
maximum: 65535
|
||||
example: 1
|
||||
|
||||
- required: [transport, device, baudrate, parity, data_bits, stop_bits, unit]
|
||||
properties:
|
||||
|
||||
transport:
|
||||
type: string
|
||||
enum:
|
||||
- rtu
|
||||
|
||||
device:
|
||||
type: string
|
||||
description: Path to the serial device file.
|
||||
example: /dev/ttyS0
|
||||
|
||||
baudrate:
|
||||
type: integer
|
||||
description: The baudrate used for serial communication.
|
||||
example: 9600
|
||||
|
||||
parity:
|
||||
type: string
|
||||
enum:
|
||||
- none
|
||||
- even
|
||||
- odd
|
||||
description: The parity used for serial communication.
|
||||
example: none
|
||||
|
||||
data_bits:
|
||||
type: integer
|
||||
description: The data bits used for serial communication.
|
||||
minimum: 5
|
||||
maximum: 8
|
||||
example: 5
|
||||
|
||||
stop_bits:
|
||||
type: integer
|
||||
description: The stop bits used for serial communication.
|
||||
minimum: 1
|
||||
maximum: 2
|
||||
example: 5
|
||||
|
||||
unit:
|
||||
type: integer
|
||||
description: The addressed unit used for serial communication. This is optional for TCP.
|
||||
minimum: 0
|
||||
maximum: 65535
|
||||
example: 1
|
||||
|
||||
properties:
|
||||
|
||||
response_timeout:
|
||||
type: number
|
||||
description: The timeout in seconds when waiting for responses from a modbus server.
|
||||
example: 1.0
|
||||
|
||||
rate:
|
||||
type: number
|
||||
description: The rate at which modbus device registers are queried for changes.
|
||||
example: 1.0
|
||||
|
||||
in:
|
||||
type: object
|
||||
properties:
|
||||
signals:
|
||||
type: array
|
||||
items:
|
||||
$ref: ./signals/modbus_signal.yaml
|
||||
|
||||
out:
|
||||
type: object
|
||||
properties:
|
||||
signals:
|
||||
type: array
|
||||
items:
|
||||
$ref: ./signals/modbus_signal.yaml
|
||||
|
||||
- $ref: ../node.yaml
|
|
@ -0,0 +1,45 @@
|
|||
# yaml-language-server: $schema=http://json-schema.org/draft-07/schema
|
||||
---
|
||||
|
||||
allOf:
|
||||
- type: object
|
||||
required: [type, address]
|
||||
properties:
|
||||
|
||||
address:
|
||||
type: integer
|
||||
description: The modbus register address.
|
||||
|
||||
word_endianess:
|
||||
type: string
|
||||
enum:
|
||||
- big
|
||||
- little
|
||||
description: The ordering of two modbus registers joined together to form a larger number.
|
||||
default: "big"
|
||||
|
||||
byte_endianess:
|
||||
type: string
|
||||
enum:
|
||||
- big
|
||||
- little
|
||||
description: The ordering of the bytes within a modbus register.
|
||||
default: "big"
|
||||
|
||||
scale:
|
||||
type: number
|
||||
description: The scale of the register's value.
|
||||
default: 1.0
|
||||
|
||||
offset:
|
||||
type: number
|
||||
description: The offset of the register's value.
|
||||
default: 0.0
|
||||
|
||||
bit:
|
||||
type: integer
|
||||
description: The bit index within a register.
|
||||
minimum: 0
|
||||
maximum: 15
|
||||
|
||||
- $ref: ../../signal.yaml
|
Loading…
Add table
Reference in a new issue