Skip to main content
Version: 2.3.x

Modbus Master App API (2.2.0)

Download OpenAPI specification:Download

Modbus Master App API

Authentication

bearerAuth

Security Scheme Type HTTP
HTTP Authorization Scheme bearer
Bearer format "JWT"

Master Parameters

Get general parameters of masters

Authorizations:

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Modify all general parameters of masters

The configuration which does not belong to the request would be the default value.

Authorizations:
Request Body schema: application/json
Array
masterParamId
integer

Unique master parameters ID.

configId
integer

Used as foreign key for master parameters table.

enableTcpMasters
integer
Default: 1
Enum: 0 1

Enable of all TCP masters.

enableSerMasters
integer
Default: 1
Enum: 0 1

Enable of all serial masters.

enableDevFailEvent
integer
Default: 1
Enum: 0 1

Enable of devices' fail event alarm.

enableCmdFailEvent
integer
Default: 1
Enum: 0 1

Enable of commands' fail event alarm.

Responses

Request samples

Content type
application/json
Example
{
  • "enableSerMasters": 1
}

Response samples

Content type
application/json
[
  • {
    }
]

Modify some general parameters of masters

The configuration which does not belong to the request would not be changed.

Authorizations:
Request Body schema: application/json
Array
masterParamId
integer

Unique master parameters ID.

configId
integer

Used as foreign key for master parameters table.

enableTcpMasters
integer
Default: 1
Enum: 0 1

Enable of all TCP masters.

enableSerMasters
integer
Default: 1
Enum: 0 1

Enable of all serial masters.

enableDevFailEvent
integer
Default: 1
Enum: 0 1

Enable of devices' fail event alarm.

enableCmdFailEvent
integer
Default: 1
Enum: 0 1

Enable of commands' fail event alarm.

Responses

Request samples

Content type
application/json
Example
{
  • "enableSerMasters": 1
}

Response samples

Content type
application/json
[
  • {
    }
]

Master TCP Interfaces

Get all of master TCPs' configurations

Authorizations:

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get specific master TCP's configuration

Authorizations:
path Parameters
masterTcpIfaceId
required
string

ID of TCP.

Responses

Response samples

Content type
application/json
{
  • "masterTcpIfaceId": 0,
  • "tcpMasterId": 0,
  • "initialDelay": 0,
  • "retryCount": 3,
  • "responseTout": 1000,
  • "remoteDevs": [
    ]
}

Modify all of master TCP configuration

The configuration which does not belong to the request would be the default value.

Authorizations:
path Parameters
masterTcpIfaceId
required
string

ID of TCP.

Request Body schema: application/json
Array
masterTcpIfaceId
integer

master TCP interface ID.

tcpMasterId
required
integer

Used as foreign key for master TCP table.

initialDelay
integer [ 0 .. 30000 ]
Default: 0

When Modbus module start, activate the TCP master after initial delay time (ms).

retryCount
integer [ 0 .. 5 ]
Default: 3

Modbus retry count. When Modbus command does not get response, resend the command by define times.

responseTout
integer [ 10 .. 120000 ]
Default: 1000

Modbus response timeout. Modbus master wait the request command time for response (ms).

Array of objects (remoteDevsForTcp) [ items ]

Responses

Request samples

Content type
application/json
{
  • "tcpMasterId": 1,
  • "initialDelay": 0,
  • "retryCount": 3,
  • "responseTout": 1000
}

Response samples

Content type
application/json
{
  • "masterTcpIfaceId": 0,
  • "tcpMasterId": 0,
  • "initialDelay": 0,
  • "retryCount": 3,
  • "responseTout": 1000,
  • "remoteDevs": [
    ]
}

Modify some of specific master TCP configuration

The configuration which does not belong to the request would not be changed.

Authorizations:
path Parameters
masterTcpIfaceId
required
string

ID of TCP.

Request Body schema: application/json
Array
masterTcpIfaceId
integer

master TCP interface ID.

tcpMasterId
required
integer

Used as foreign key for master TCP table.

initialDelay
integer [ 0 .. 30000 ]
Default: 0

When Modbus module start, activate the TCP master after initial delay time (ms).

retryCount
integer [ 0 .. 5 ]
Default: 3

Modbus retry count. When Modbus command does not get response, resend the command by define times.

responseTout
integer [ 10 .. 120000 ]
Default: 1000

Modbus response timeout. Modbus master wait the request command time for response (ms).

Array of objects (remoteDevsForTcp) [ items ]

Responses

Request samples

Content type
application/json
{
  • "tcpMasterId": 1,
  • "initialDelay": 0,
  • "retryCount": 3,
  • "responseTout": 1000
}

Response samples

Content type
application/json
{
  • "masterTcpIfaceId": 0,
  • "tcpMasterId": 0,
  • "initialDelay": 0,
  • "retryCount": 3,
  • "responseTout": 1000,
  • "remoteDevs": [
    ]
}

Master Serial Interfaces

Get all of master ports' configurations

Authorizations:

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get specific master port's configuration

Authorizations:
path Parameters
masterSerIfaceId
required
string

ID of port.

Responses

Response samples

Content type
application/json
{
  • "masterSerIfaceId": 0,
  • "serMasterId": 0,
  • "portValue": 0,
  • "format": 0,
  • "initialDelay": 0,
  • "retryCount": 3,
  • "responseTout": 1000,
  • "frameInterval": 0,
  • "charInterval": 0,
  • "remoteDevs": [
    ]
}

Modify all of master port configuration

The configuration which does not belong to the request would be the default value.

Authorizations:
path Parameters
masterSerIfaceId
required
string

ID of port.

Request Body schema: application/json
Array
masterSerIfaceId
integer

Master serial interface ID.

serMasterId
required
integer

Used as foreign key for master serial interface table.

portValue
required
integer

Serial port index which should be unique.

format
integer
Default: 0
Enum: 0 1

Modbus serial mode (RTU, ASCII).

initialDelay
integer [ 0 .. 30000 ]
Default: 0

When Modbus module start, activate the serial master after initial delay time (ms).

retryCount
integer [ 0 .. 5 ]
Default: 3

Modbus retry count. When Modbus command does not get response, resend the command by define times.

responseTout
integer [ 10 .. 120000 ]
Default: 1000

Modbus response timeout. Modbus master wait the request command time for response (ms).

integer or integer
Default: 0

Modbus frame interval (t3.5), 0 is used by auto baud rate setting (ms).

integer or integer
Default: 0

Modbus char interval (t1.5), 0 is used by auto baud rate setting (ms).

Array of objects (remoteDevsForSer) [ items ]

Responses

Request samples

Content type
application/json
Example
{
  • "serMasterId": 1,
  • "portValue": 0,
  • "format": 0,
  • "initialDelay": 0,
  • "retryCount": 3,
  • "responseTout": 1000,
  • "frameInterval": 0,
  • "charInterval": 0
}

Response samples

Content type
application/json
{
  • "masterSerIfaceId": 0,
  • "serMasterId": 0,
  • "portValue": 0,
  • "format": 0,
  • "initialDelay": 0,
  • "retryCount": 3,
  • "responseTout": 1000,
  • "frameInterval": 0,
  • "charInterval": 0,
  • "remoteDevs": [
    ]
}

Modify some of specific master port configuration

The configuration which does not belong to the request would not be changed.

Authorizations:
path Parameters
masterSerIfaceId
required
string

ID of port.

Request Body schema: application/json
Array
masterSerIfaceId
integer

Master serial interface ID.

serMasterId
required
integer

Used as foreign key for master serial interface table.

portValue
required
integer

Serial port index which should be unique.

format
integer
Default: 0
Enum: 0 1

Modbus serial mode (RTU, ASCII).

initialDelay
integer [ 0 .. 30000 ]
Default: 0

When Modbus module start, activate the serial master after initial delay time (ms).

retryCount
integer [ 0 .. 5 ]
Default: 3

Modbus retry count. When Modbus command does not get response, resend the command by define times.

responseTout
integer [ 10 .. 120000 ]
Default: 1000

Modbus response timeout. Modbus master wait the request command time for response (ms).

integer or integer
Default: 0

Modbus frame interval (t3.5), 0 is used by auto baud rate setting (ms).

integer or integer
Default: 0

Modbus char interval (t1.5), 0 is used by auto baud rate setting (ms).

Array of objects (remoteDevsForSer) [ items ]

Responses

Request samples

Content type
application/json
Example
{
  • "serMasterId": 1,
  • "portValue": 0,
  • "format": 0,
  • "initialDelay": 0,
  • "retryCount": 3,
  • "responseTout": 1000,
  • "frameInterval": 0,
  • "charInterval": 0
}

Response samples

Content type
application/json
{
  • "masterSerIfaceId": 0,
  • "serMasterId": 0,
  • "portValue": 0,
  • "format": 0,
  • "initialDelay": 0,
  • "retryCount": 3,
  • "responseTout": 1000,
  • "frameInterval": 0,
  • "charInterval": 0,
  • "remoteDevs": [
    ]
}

Remote Devices

Get all of remote devices' configurations

Authorizations:

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Add remote device(s) configuration

Authorizations:
query Parameters
autoCreate
string
Value: "tags"

/remote-devs?autoCreate=tags would create tags automatically. dataType must be added in payload of mcmds.

Request Body schema:

remote device data.

One of
remoteDevId
integer

Unique remote device ID.

masterSerIfaceId
required
integer

Master serial interface ID. Either "masterSerIfaceId" or "masterTcpIfaceId" should be set.

masterTcpIfaceId
required
integer

Master TCP interface ID. Either "masterSerIfaceId" or "masterTcpIfaceId" should be set.

name
string [ 1 .. 128 ] characters ^[\w\-.~]{1,128}$
Default: "device"

Device name. "name" should be unique.

enable
integer
Default: 1
Enum: 0 1

Enable all of this device's polling command.

slaveId
integer [ 0 .. 255 ]
Default: 1

Slave ID of remote device. "slaveId" should be unique in a masterSerIface. "slaveId + slaveIpaddr + slaveTcpPort" should be unique in a masterTcpIface.

slaveIpaddr
string
Default: "0.0.0.0"

Slave IP address of remote device.

slaveTcpPort
integer [ 1 .. 65535 ]
Default: 502

Slave IP port of remote device.

Array of objects (mcmds) [ items ]

Responses

Request samples

Content type
Example
{
  • "masterSerIfaceId": 1,
  • "name": "dev1",
  • "enable": 1,
  • "slaveId": 1
}

Response samples

Content type
application/json
Example
{
  • "remoteDevId": 1,
  • "masterSerIfaceId": 1,
  • "name": "dev1",
  • "enable": 1,
  • "slaveId": 1,
  • "slaveIpaddr": "192.168.127.254",
  • "slaveTcpPort": 502,
  • "mcmds": {
    }
}

Delete all remote devices configuration

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "error": {
    }
}

Get specific remote device's configuration

Authorizations:
path Parameters
remoteDevId
required
string

ID of remoteDev.

Responses

Response samples

Content type
application/json
{
  • "remoteDevId": 1,
  • "masterSerIfaceId": 1,
  • "name": "dev1",
  • "enable": 1,
  • "slaveId": 1,
  • "slaveIpaddr": "192.168.127.254",
  • "slaveTcpPort": 502,
  • "mcmds": {
    }
}

Delete specific remote device's configuration

Authorizations:
path Parameters
remoteDevId
required
string

ID of remoteDev.

Responses

Response samples

Content type
application/json
{
  • "error": {
    }
}

Modify all of remote device configuration

The configuration which does not belong to the request would be the default value.

Authorizations:
path Parameters
remoteDevId
required
string

ID of remoteDev.

Request Body schema: application/json
remoteDevId
integer

Unique remote device ID.

masterSerIfaceId
required
integer

Master serial interface ID. Either "masterSerIfaceId" or "masterTcpIfaceId" should be set.

masterTcpIfaceId
required
integer

Master TCP interface ID. Either "masterSerIfaceId" or "masterTcpIfaceId" should be set.

name
string [ 1 .. 128 ] characters ^[\w\-.~]{1,128}$
Default: "device"

Device name. "name" should be unique.

enable
integer
Default: 1
Enum: 0 1

Enable all of this device's polling command.

slaveId
integer [ 0 .. 255 ]
Default: 1

Slave ID of remote device. "slaveId" should be unique in a masterSerIface. "slaveId + slaveIpaddr + slaveTcpPort" should be unique in a masterTcpIface.

slaveIpaddr
string
Default: "0.0.0.0"

Slave IP address of remote device.

slaveTcpPort
integer [ 1 .. 65535 ]
Default: 502

Slave IP port of remote device.

Array of objects (mcmds) [ items ]

Responses

Request samples

Content type
application/json
Example
{
  • "masterSerIfaceId": 1,
  • "name": "dev1",
  • "enable": 1,
  • "slaveId": 1
}

Response samples

Content type
application/json
{
  • "remoteDevId": 1,
  • "masterSerIfaceId": 1,
  • "name": "dev1",
  • "enable": 1,
  • "slaveId": 1,
  • "slaveIpaddr": "192.168.127.254",
  • "slaveTcpPort": 502,
  • "mcmds": {
    }
}

Modify some of specific remote device configuration

The configuration which does not belong to the request would not be changed.

Authorizations:
path Parameters
remoteDevId
required
string

ID of remoteDev.

Request Body schema: application/json
remoteDevId
integer

Unique remote device ID.

masterSerIfaceId
required
integer

Master serial interface ID. Either "masterSerIfaceId" or "masterTcpIfaceId" should be set.

masterTcpIfaceId
required
integer

Master TCP interface ID. Either "masterSerIfaceId" or "masterTcpIfaceId" should be set.

name
string [ 1 .. 128 ] characters ^[\w\-.~]{1,128}$
Default: "device"

Device name. "name" should be unique.

enable
integer
Default: 1
Enum: 0 1

Enable all of this device's polling command.

slaveId
integer [ 0 .. 255 ]
Default: 1

Slave ID of remote device. "slaveId" should be unique in a masterSerIface. "slaveId + slaveIpaddr + slaveTcpPort" should be unique in a masterTcpIface.

slaveIpaddr
string
Default: "0.0.0.0"

Slave IP address of remote device.

slaveTcpPort
integer [ 1 .. 65535 ]
Default: 502

Slave IP port of remote device.

Array of objects (mcmds) [ items ]

Responses

Request samples

Content type
application/json
Example
{
  • "masterSerIfaceId": 1,
  • "name": "dev1",
  • "enable": 1,
  • "slaveId": 1
}

Response samples

Content type
application/json
{
  • "remoteDevId": 1,
  • "masterSerIfaceId": 1,
  • "name": "dev1",
  • "enable": 1,
  • "slaveId": 1,
  • "slaveIpaddr": "192.168.127.254",
  • "slaveTcpPort": 502,
  • "mcmds": {
    }
}

Master Commands

Get all of master commands' configurations

Authorizations:

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Add master command(s) configuration

Authorizations:
query Parameters
autoCreate
string
Value: "tags"

/mcmds?autoCreate=tags would create tags automatically. dataType must be added in payload.

Request Body schema: application/json

Master command data.

One of
mcmdId
integer

Unique Modbus command name.

remoteDevId
required
integer

Used as foreign key for mcmd table.

name
string [ 1 .. 120 ] characters ^[\w\-.~]{1,120}$
Default: "command"

Modbus command name. "name" should be unique in a remoteDev.

enable
integer
Default: 1
Enum: 0 1

Enable this polling command (disable, enable).

mode
integer
Default: 0
Enum: 0 1

Modbus command mode (cyclic, data change).

func
integer
Default: 3
Enum: 1 2 3 4 5 6 15 16 23

Function code

readAddress
integer [ 0 .. 65535 ]
Default: 0

Reading address.

readQuantity
integer [ 1 .. 2000 ]
Default: 10

Reading length (different maximum value depends on func. func 01, 02 - max 2000; func 03, 04, 23 - max 125).

writeAddress
integer [ 0 .. 65535 ]
Default: 0

Writing address.

writeQuantity
integer [ 1 .. 1968 ]
Default: 1

Writing length (different maximum value depends on func. func 05, 06 - max 1; func 15 - max 1968; func 16 - max 123; func 23 - max 121).

pollInterval
integer [ 100 .. 86400000 ]
Default: 1000

The polling interval for this Modbus command (ms).

swap
integer
Default: 0
Enum: 0 1 2 3

The swap mode for this Modbus command(none, byte, word, byte word).

fpFunc
integer
Default: 0
Enum: 0 1 2

Fault protection func (keep original data, all clear to zero, user define).

fpTout
integer [ 1 .. 86400 ]
Default: 3600

Fault protection timeout. After fault protection timeout, Modbus command data not update from other data will trigger fault protection function (s).

fpData
string
Default: "00 00"

User defined data for fault protection when fpFunc = 2. Data should be described as raw HEX, e.g. "1A 2B"

scalingFunc
integer
Default: 0
Enum: 0 1 2

Modbus scaling function, (disable, intercept, point).

interceptSlope
number
Default: 1

Slope for intercept of Modbus scaling function.

interceptOffset
number
Default: 0

Offset for intercept of Modbus scaling function.

pointSourceMin
number
Default: 0

Source minimum value for point of Modbus scaling function.

pointSourceMax
number
Default: 1

Source maximum value for point of Modbus scaling function.

pointTargetMin
number
Default: 0

Target minimum value for point of Modbus scaling function.

pointTargetMax
number
Default: 1

Target maximum value for point of Modbus scaling function.

Array of objects (tagsForMcmds) [ items ]

Responses

Request samples

Content type
application/json
Example
{
  • "remoteDevId": 1,
  • "name": "cmd1",
  • "mode": 1,
  • "func": 1,
  • "readAddress": 0,
  • "readQuantity": 10,
  • "pollInterval": 1000,
  • "swap": 0
}

Response samples

Content type
application/json
Example
{
  • "mcmdId": 1,
  • "remoteDevId": 2,
  • "name": "read_command_1",
  • "mode": 1,
  • "func": 3,
  • "readAddress": 0,
  • "readQuantity": 10,
  • "writeAddress": 0,
  • "writeQuantity": 1,
  • "pollInterval": 100,
  • "swap": 0,
  • "fpFunc": 0,
  • "fpTout": 60000,
  • "fpData": "00 00",
  • "scalingFunc": 0,
  • "interceptSlope": 1,
  • "interceptOffset": 0,
  • "pointSourceMin": 0,
  • "pointSourceMax": 1,
  • "pointTargetMin": 0,
  • "pointTargetMax": 1,
  • "tags": {
    }
}

Delete all master command configuration

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "error": {
    }
}

Get specific master command's configuration

Authorizations:
path Parameters
mcmdId
required
string

ID of mcmd.

Responses

Response samples

Content type
application/json
{
  • "mcmdId": 1,
  • "remoteDevId": 2,
  • "name": "read_command_1",
  • "mode": 1,
  • "func": 3,
  • "readAddress": 0,
  • "readQuantity": 10,
  • "writeAddress": 0,
  • "writeQuantity": 1,
  • "pollInterval": 100,
  • "swap": 0,
  • "fpFunc": 0,
  • "fpTout": 60000,
  • "fpData": "00 00",
  • "scalingFunc": 0,
  • "interceptSlope": 1,
  • "interceptOffset": 0,
  • "pointSourceMin": 0,
  • "pointSourceMax": 1,
  • "pointTargetMin": 0,
  • "pointTargetMax": 1,
  • "tags": {
    }
}

Delete specific master command's configuration

Authorizations:
path Parameters
mcmdId
required
string

ID of mcmd.

Responses

Response samples

Content type
application/json
{
  • "error": {
    }
}

Modify all of master command configuration

The configuration which does not belong to the request would be the default value.

Authorizations:
path Parameters
mcmdId
required
string

ID of mcmd.

query Parameters
autoCreate
string
Value: "tags"

/mcmds?autoCreate=tags would create tags automatically. dataType must be added in payload.

Request Body schema: application/json
One of
mcmdId
integer

Unique Modbus command name.

remoteDevId
required
integer

Used as foreign key for mcmd table.

name
string [ 1 .. 120 ] characters ^[\w\-.~]{1,120}$
Default: "command"

Modbus command name. "name" should be unique in a remoteDev.

enable
integer
Default: 1
Enum: 0 1

Enable this polling command (disable, enable).

mode
integer
Default: 0
Enum: 0 1

Modbus command mode (cyclic, data change).

func
integer
Default: 3
Enum: 1 2 3 4 5 6 15 16 23

Function code

readAddress
integer [ 0 .. 65535 ]
Default: 0

Reading address.

readQuantity
integer [ 1 .. 2000 ]
Default: 10

Reading length (different maximum value depends on func. func 01, 02 - max 2000; func 03, 04, 23 - max 125).

writeAddress
integer [ 0 .. 65535 ]
Default: 0

Writing address.

writeQuantity
integer [ 1 .. 1968 ]
Default: 1

Writing length (different maximum value depends on func. func 05, 06 - max 1; func 15 - max 1968; func 16 - max 123; func 23 - max 121).

pollInterval
integer [ 100 .. 86400000 ]
Default: 1000

The polling interval for this Modbus command (ms).

swap
integer
Default: 0
Enum: 0 1 2 3

The swap mode for this Modbus command(none, byte, word, byte word).

fpFunc
integer
Default: 0
Enum: 0 1 2

Fault protection func (keep original data, all clear to zero, user define).

fpTout
integer [ 1 .. 86400 ]
Default: 3600

Fault protection timeout. After fault protection timeout, Modbus command data not update from other data will trigger fault protection function (s).

fpData
string
Default: "00 00"

User defined data for fault protection when fpFunc = 2. Data should be described as raw HEX, e.g. "1A 2B"

scalingFunc
integer
Default: 0
Enum: 0 1 2

Modbus scaling function, (disable, intercept, point).

interceptSlope
number
Default: 1

Slope for intercept of Modbus scaling function.

interceptOffset
number
Default: 0

Offset for intercept of Modbus scaling function.

pointSourceMin
number
Default: 0

Source minimum value for point of Modbus scaling function.

pointSourceMax
number
Default: 1

Source maximum value for point of Modbus scaling function.

pointTargetMin
number
Default: 0

Target minimum value for point of Modbus scaling function.

pointTargetMax
number
Default: 1

Target maximum value for point of Modbus scaling function.

Array of objects (tagsForMcmds) [ items ]

Responses

Request samples

Content type
application/json
Example
{
  • "remoteDevId": 1,
  • "name": "cmd1",
  • "mode": 0,
  • "func": 1,
  • "readAddress": 0,
  • "readQuantity": 10,
  • "pollInterval": 1000,
  • "swap": 0
}

Response samples

Content type
application/json
{
  • "mcmdId": 1,
  • "remoteDevId": 2,
  • "name": "read_command_1",
  • "mode": 1,
  • "func": 3,
  • "readAddress": 0,
  • "readQuantity": 10,
  • "writeAddress": 0,
  • "writeQuantity": 1,
  • "pollInterval": 100,
  • "swap": 0,
  • "fpFunc": 0,
  • "fpTout": 60000,
  • "fpData": "00 00",
  • "scalingFunc": 0,
  • "interceptSlope": 1,
  • "interceptOffset": 0,
  • "pointSourceMin": 0,
  • "pointSourceMax": 1,
  • "pointTargetMin": 0,
  • "pointTargetMax": 1,
  • "tags": {
    }
}

Modify some of specific master command configuration

The configuration which does not belong to the request would not be changed.

Authorizations:
path Parameters
mcmdId
required
string

ID of mcmd.

query Parameters
autoCreate
string
Value: "tags"

/mcmds?autoCreate=tags would create tags automatically. dataType must be added in payload.

Request Body schema: application/json
One of
mcmdId
integer

Unique Modbus command name.

remoteDevId
required
integer

Used as foreign key for mcmd table.

name
string [ 1 .. 120 ] characters ^[\w\-.~]{1,120}$
Default: "command"

Modbus command name. "name" should be unique in a remoteDev.

enable
integer
Default: 1
Enum: 0 1

Enable this polling command (disable, enable).

mode
integer
Default: 0
Enum: 0 1

Modbus command mode (cyclic, data change).

func
integer
Default: 3
Enum: 1 2 3 4 5 6 15 16 23

Function code

readAddress
integer [ 0 .. 65535 ]
Default: 0

Reading address.

readQuantity
integer [ 1 .. 2000 ]
Default: 10

Reading length (different maximum value depends on func. func 01, 02 - max 2000; func 03, 04, 23 - max 125).

writeAddress
integer [ 0 .. 65535 ]
Default: 0

Writing address.

writeQuantity
integer [ 1 .. 1968 ]
Default: 1

Writing length (different maximum value depends on func. func 05, 06 - max 1; func 15 - max 1968; func 16 - max 123; func 23 - max 121).

pollInterval
integer [ 100 .. 86400000 ]
Default: 1000

The polling interval for this Modbus command (ms).

swap
integer
Default: 0
Enum: 0 1 2 3

The swap mode for this Modbus command(none, byte, word, byte word).

fpFunc
integer
Default: 0
Enum: 0 1 2

Fault protection func (keep original data, all clear to zero, user define).

fpTout
integer [ 1 .. 86400 ]
Default: 3600

Fault protection timeout. After fault protection timeout, Modbus command data not update from other data will trigger fault protection function (s).

fpData
string
Default: "00 00"

User defined data for fault protection when fpFunc = 2. Data should be described as raw HEX, e.g. "1A 2B"

scalingFunc
integer
Default: 0
Enum: 0 1 2

Modbus scaling function, (disable, intercept, point).

interceptSlope
number
Default: 1

Slope for intercept of Modbus scaling function.

interceptOffset
number
Default: 0

Offset for intercept of Modbus scaling function.

pointSourceMin
number
Default: 0

Source minimum value for point of Modbus scaling function.

pointSourceMax
number
Default: 1

Source maximum value for point of Modbus scaling function.

pointTargetMin
number
Default: 0

Target minimum value for point of Modbus scaling function.

pointTargetMax
number
Default: 1

Target maximum value for point of Modbus scaling function.

Array of objects (tagsForMcmds) [ items ]

Responses

Request samples

Content type
application/json
Example
{
  • "remoteDevId": 1,
  • "name": "cmd1",
  • "mode": 0,
  • "func": 1,
  • "readAddress": 0,
  • "readQuantity": 10,
  • "pollInterval": 1000,
  • "swap": 0
}

Response samples

Content type
application/json
{
  • "mcmdId": 1,
  • "remoteDevId": 2,
  • "name": "read_command_1",
  • "mode": 1,
  • "func": 3,
  • "readAddress": 0,
  • "readQuantity": 10,
  • "writeAddress": 0,
  • "writeQuantity": 1,
  • "pollInterval": 100,
  • "swap": 0,
  • "fpFunc": 0,
  • "fpTout": 60000,
  • "fpData": "00 00",
  • "scalingFunc": 0,
  • "interceptSlope": 1,
  • "interceptOffset": 0,
  • "pointSourceMin": 0,
  • "pointSourceMax": 1,
  • "pointTargetMin": 0,
  • "pointTargetMax": 1,
  • "tags": {
    }
}

Tags

Get all of tags' configurations

Authorizations:

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Add tag(s) configuration

Authorizations:
Request Body schema: application/json

Tag data.

One of
tagId
integer

Unique tag ID.

mcmdId
required
integer

Used as foreign key for tags table. Set either mcmdId or szoneId.

szoneId
required
integer

Used as foreign key for tags table. Set either mcmdId or szoneId.

name
string [ 1 .. 128 ] characters ^[\w\-.~]{1,128}$
Default: "tag"

Tag name for tag mapping used. "name" should be unique in a remoteDev. Tag name should not be 'status'.

dataType
string
Default: "raw"
Enum: "boolean" "int8" "int16" "int32" "int64" "uint8" "uint16" "uint32" "uint64" "float" "double" "string" "bytearray" "raw"

Data type of tag.

dataUnit
string

Real unit description of tag (e.g. ms, s, A, mA, ...).

access
string
Default: "rw"
Enum: "r" "w" "rw"

Tag access for publish or subscribe.

dataSize
integer >= 1

Data size for data type (string, bytearray, raw). dataSize must exist in payload if data type is string/bytearray/raw. dataSize must not exist in payload if data type is not string/bytearray/raw.

offset
integer
Default: 0

Tag's start byte offset in Modbus command.

Responses

Request samples

Content type
application/json
Example
{
  • "mcmdId": 1,
  • "name": "read_command_int16_tag",
  • "dataType": "int16",
  • "access": "r",
  • "offset": 0
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Delete all tags configuration

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "error": {
    }
}

Get specific tag's configuration

Authorizations:
path Parameters
tagId
required
string

ID of tag.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Delete specific tag's configuration

Authorizations:
path Parameters
tagId
required
string

ID of tag.

Responses

Response samples

Content type
application/json
{
  • "error": {
    }
}

Modify all of tag configuration

The configuration which does not belong to the request would be the default value.

Authorizations:
path Parameters
tagId
required
string

ID of tag.

Request Body schema: application/json
tagId
integer

Unique tag ID.

mcmdId
required
integer

Used as foreign key for tags table. Set either mcmdId or szoneId.

szoneId
required
integer

Used as foreign key for tags table. Set either mcmdId or szoneId.

name
string [ 1 .. 128 ] characters ^[\w\-.~]{1,128}$
Default: "tag"

Tag name for tag mapping used. "name" should be unique in a remoteDev. Tag name should not be 'status'.

dataType
string
Default: "raw"
Enum: "boolean" "int8" "int16" "int32" "int64" "uint8" "uint16" "uint32" "uint64" "float" "double" "string" "bytearray" "raw"

Data type of tag.

dataUnit
string

Real unit description of tag (e.g. ms, s, A, mA, ...).

access
string
Default: "rw"
Enum: "r" "w" "rw"

Tag access for publish or subscribe.

dataSize
integer >= 1

Data size for data type (string, bytearray, raw). dataSize must exist in payload if data type is string/bytearray/raw. dataSize must not exist in payload if data type is not string/bytearray/raw.

offset
integer
Default: 0

Tag's start byte offset in Modbus command.

Responses

Request samples

Content type
application/json
Example
{
  • "mcmdId": 1,
  • "name": "read_command_int16_tag",
  • "dataType": "int16",
  • "access": "r"
}

Response samples

Content type
application/json
{
  • "tagId": 1,
  • "szoneId": 1,
  • "mcmdId": 1,
  • "name": "read_command_tag1",
  • "dataType": "raw",
  • "dataUnit": "%",
  • "access": "rw",
  • "dataSize": 20,
  • "offset": 0
}

Control

Start the Modbus module, configuration will reload

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "error": {
    }
}

Stop the Modbus module

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "error": {
    }
}

Restart the Modbus module, configuration will reload

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "error": {
    }
}

Reset the configuration of Modbus module

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "error": {
    }
}

Apply the Modbus configuration(it will restart the modbus daemon)

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "error": {
    }
}

Undo the Modbus configuration for un-applied status.

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "error": {
    }
}

export the configuration of Modbus masters

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "error": {
    }
}

import a configuration file into Modbus masters

Authorizations:
Request Body schema: multipart/form-data
mastersFile
string

Modbus masters csv file.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "count": 0
}

export the configuration of master commands

Authorizations:
query Parameters
remoteDevId
integer

/export?remoteDevId=1.

Responses

Response samples

Content type
application/json
{
  • "error": {
    }
}

import a configuration file into master commands for a remote device

Authorizations:
Request Body schema: multipart/form-data
mcmdsFile
string

Master command csv file.

remoteDevId
any

Remote device ID.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "count": 0
}

Get current modbus daemon system log level

Authorizations:

Responses

Response samples

Content type
application/json
"ALL"

Diagnose

set modbus dameon system log level

Authorizations:
Request Body schema: application/json

system log level.

logLevel
string (log_level_str)
Enum: "ALL" "TRACE" "DEBUG" "INFO" "WARN" "ERROR" "FATAL" "OFF"

system log level.

Responses

Request samples

Content type
application/json
{
  • "logLevel": "DEBUG"
}

Get all of TCP connection diagnose information (include masters and slaves)

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "modbus_tcp": [
    ]
}

Get all of serial connection diagnose information (include masters and slaves)

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "modbus_serial": [
    ]
}

Start traffic modbus log.

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "error": {
    }
}

Stop traffic modbus log.

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "error": {
    }
}

Operate

trigger the tag's related command to polling and get the tag data result

Authorizations:
Request Body schema: application/json

Tag information.

prvdName
string

Provider name.

srcName
string

Source name.

tagName
string

Tag name.

Responses

Request samples

Content type
application/json
{
  • "prvdName": "modbus_tcp_master",
  • "srcName": "ieg_device",
  • "tagName": "command_1"
}

Response samples

Content type
application/json
Example
{
  • "prvdName": "modbus_tcp_master",
  • "srcName": "moxa_device",
  • "tagName": "command_float",
  • "timestamp": 939700,
  • "dataType": "float",
  • "dataValue": 3.14
}

trigger the tag's related command to polling and post the tag data

Authorizations:
Request Body schema: application/json

Tag information.

prvdName
string

Provider name.

srcName
string

Device name.

tagName
string

Tag name.

dataType
string
Enum: "boolean" "int8" "int16" "int32" "int64" "uint8" "uint16" "uint32" "uint64" "float" "double" "string" "bytearray" "raw"

Tag type.

string or number

Tag value.

Responses

Request samples

Content type
application/json
Example
{
  • "prvdName": "modbus_tcp_master",
  • "srcName": "moxa_device",
  • "tagName": "command_float",
  • "dataType": "float",
  • "dataValue": 3.14
}

Status

Get status of Modbus database was modified or not

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Get overview of Modbus master

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "version": "0.2.1",
  • "enableDevFailEvent": 1,
  • "enableCmdFailEvent": 1,
  • "tcp": {
    },
  • "serial": {
    }
}

Platform

Get tag list of Modbus master

Authorizations:

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]