influxdata / influxdata/telegraf

Modbus Data_Type = "BCD"

Open
#15,925 8 comments 0 reactions 0 assignees View on GitHub
area/modbus feature request help wanted size/s
Dominant language
Go
Stars
17.8k
Forks
5.8k
Avg merge
1d 20h
Merged PRs (30d)
161

Description

### Use Case

Hi.
A Modbus device delivers some Registers as data_type = **BCD**.
For example the "Date & Time" information via 3 Bytes (24bit) as BCD.

So far, I did not find a way to decode these registers :-(

Question is:
Is there a way to decode **BCD** coded registers?
or
could this become a **new feature**??

Thanks for your the brillliant "Telegraf"
Cheers
Jurgen

### Expected behavior

Decode for example:
Read 3-bytes and assign 4-bits per digit
and
assign 2 digits to the 1st number ( e.g.: the day)
assign 2 digits to the 2nd number (e.g.: the month)
assign 2 digits to the 3rd number ( e.g. 2 digit year)
etc.

### Actual behavior

??

### Additional info

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by locating Telegraf's Modbus input and its existing register data-type decoding. Review how register values are represented and how other data types are tested, then determine the supported BCD byte and digit layout from the issue's three-byte date example. Done means BCD registers can be decoded with documented behavior and coverage for the requested layout.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
embedded-iot
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.