Skip to content

Added Enum support#2035

Merged
samson0v merged 2 commits intothingsboard:masterfrom
samson0v:issues/iotgw-616
Dec 2, 2025
Merged

Added Enum support#2035
samson0v merged 2 commits intothingsboard:masterfrom
samson0v:issues/iotgw-616

Conversation

@samson0v
Copy link
Contributor

@samson0v samson0v commented Dec 2, 2025

Added Enum support for Modbus connector.

Configuration example:

{
  "tag": "operational_mode",
  "type": "16int",
  "address": 1,
  "objectsCount": 1,
  "functionCode": 3,
  "variants": {
    "1": "Normal Mode",
    "2": "Service Mode",
    "3": "Calibration Mode"
  }
}

Result on ThingsBoard platform:
image

Configuration example for coil:

{
  "tag": "relay",
  "type": "bits",
  "address": 1,
  "objectsCount": 1,
  "functionCode": 1,
  "bitTargetType": "int",
  "variants": {
    "0": "OFF",
    "1": "ON"
  }
}

Result on ThingsBoard platform:
image

Also, the feature works as expected with uplink RPC to Device. For example:

"rpc": [
  {
    "tag": "getOperationalMode",
    "type": "16int",
    "address": 1,
    "objectsCount": 1,
    "functionCode": 3,
    "variants": {
      "1": "Normal Mode",
      "2": "Service Mode",
      "3": "Calibration Mode"
    }
  }
]

Result on ThingsBoard:
image

@samson0v samson0v removed the bug label Dec 2, 2025
@samson0v samson0v linked an issue Dec 2, 2025 that may be closed by this pull request
@github-actions github-actions bot added the bug label Dec 2, 2025
@samson0v samson0v removed the bug label Dec 2, 2025
@samson0v samson0v merged commit dd81e03 into thingsboard:master Dec 2, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Parsing enum in Modbus connector

1 participant