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.

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. }