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. //tag name substring match (optional)
  7. "name": "hold_bit",
  8. //tag description substring match (optional)
  9. "desc": "switch",
  10. //synchronous read (optional, default false)
  11. "sync": false
  12. }

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.

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