Read & Write

Read Tag

POST /api/v2/read

Request Headers

Content—Type application/json

Authorization Bearer <token>

Response Status

  • 200

Body

json

  1. {
  2. //node name (required)
  3. "node": "modbus-tcp-1",
  4. //group name (required)
  5. "group": "config_modbus_tcp_sample_2",
  6. //synchronous read (optional, default false)
  7. "sync": false,
  8. //filter (optional)
  9. "query": {
  10. //tag name substring match (optional)
  11. "name": "data",
  12. //tag description substring match (optional)
  13. "description": "switch"
  14. }
  15. }

Response

json

  1. {
  2. "tags": [
  3. {
  4. //tag nmae
  5. "name": "data1",
  6. //tag value
  7. "value": 1,
  8. },
  9. {
  10. "name": "data2",
  11. "error": 2014
  12. },
  13. {
  14. "name": "data3",
  15. "value": true,
  16. }
  17. ]
  18. }

TIP

The value is displayed only when the value is read correctly, when the value is read incorrectly, the error code is displayed, not the value.

Read Tag(pagination)

POST /api/v2/read/paginate

Request Headers

Content—Type application/json

Authorization Bearer <token>

Response Status

  • 200

Body

json

  1. {
  2. //node name (required)
  3. "node": "modbus-tcp-1",
  4. //group name (required)
  5. "group": "config_modbus_tcp_sample_2",
  6. //synchronous read (optional, default false)
  7. "sync": false,
  8. //filter (optional)
  9. "query": {
  10. //tag name substring match (optional)
  11. "name": "data",
  12. //tag description substring match (optional)
  13. "description": "switch",
  14. //current page (optional)
  15. "currentPage": 1,
  16. //number of tags per page (optional)
  17. "pageSize": 10,
  18. //response error tags only (optional)
  19. "isError": true
  20. }
  21. }

Response

json

  1. {
  2. "meta": {"currentPage": 1, "pageSize": 10, "total": 1},
  3. "items": [ {
  4. "name": "tag1",
  5. "type": 4,
  6. "address": "1!400001",
  7. "attribute": 8,
  8. "description": "",
  9. "precison": 0,
  10. "decimal": 0,
  11. "bias": 0,
  12. "error": 3002 // "value": 123
  13. } ]
  14. }

TIP

The value is displayed only when the value is read correctly, when the value is read incorrectly, the error code is displayed with error.

TEST Reading Tag

POST /api/v2/read/test

Request Headers

Content—Type application/json

Authorization Bearer <token>

Response Status

  • 200

Body

json

  1. {
  2. "driver": "1",
  3. "group": "1",
  4. "tag": "tag1",
  5. "address": "1!400002",
  6. "attribute": 8,
  7. "type": 3,
  8. "precision": 0,
  9. "decimal": 0,
  10. "bias": 0.0
  11. }

Response

json

  1. {
  2. "value": 29540
  3. }

json

  1. {
  2. "error": 3022
  3. }

TIP

Only perform reading tests, no need to actually add the tag. Not compatible with tag and node byte order, does not calculate decimal and offset.

Write Tag

Write One Tag

POST /api/v2/write

Request Headers

Content-Type application/json

Authorization Bearer <token>

Response Status

  • 200 OK

Body

json

  1. {
  2. "node": "modbus-tcp-1",
  3. "group": "config_modbus_tcp_sample_2",
  4. "tag": "tag1",
  5. "value": 1234
  6. }

Response

json

  1. {
  2. "error": 0
  3. }

Write Multiple Tags

POST /api/v2/write/tags

TIP

Multiple tags writing currently only supports Mitsubishi 3E, Beckhoff ADS, Modbus TCP, Modbus RTU, Siemens S7 ISOTCP, Omron FINS TCP, OPC UA, BACnet/IP drivers.

Request Headers

Content-Type application/json

Authorization Bearer <token>

Response Status

  • 200 OK

Body

json

  1. {
  2. "node": "modbus-tcp-1",
  3. "group": "group1",
  4. "tags": [
  5. {
  6. "tag": "tag1",
  7. "value": 123
  8. },
  9. {
  10. "tag": "tag2",
  11. "value": 1233
  12. },
  13. {
  14. "tag": "tag3",
  15. "value": 7788
  16. },
  17. {
  18. "tag": "tag4",
  19. "value": 1
  20. },
  21. {
  22. "tag": "tag5",
  23. "value": "asdfda"
  24. }
  25. ]
  26. }

Response

json

  1. {
  2. "error": 0
  3. }