4-20ma / ModbusMaster

Enlighten your Arduino to be a Modbus master
http://4-20ma.io/ModbusMaster/
Apache License 2.0
603 stars 353 forks source link

help with modbus master, single register 8bit write #162

Open jaygrovr opened 3 years ago

jaygrovr commented 3 years ago

Hey guys, i have a project where i am trying to use an arduino mega, to connect over modbus rtu using serial port 1 or serial port 2 of the mega, 9600 baud to a client that is addressed as 1. The hex value of the register is 13. How can I just send this value repeatedly to my device.

I am running the latest version of modbusmaster, inside IDE 1.8.15

Can someone provide an example, this has to be super easy, but I am not seeing how to write this 8 bit value. The type is a uint8_t

Also does this library do the built in checksums for you?

Thanks again, sorry for the strange question. I have experience with modbus but only with something designed to communicate with it already.

ModbusMaster version

[Version of the project where you are encountering the issue]

Arduino IDE version

[Version of Arduino IDE in your environment]

Arduino Hardware

[Hardware information, including board and processor]

Platform Details

[Operating system distribution and release version]


Scenario:

[What you are trying to achieve and you can't?]

Steps to Reproduce:

[If you are filing an issue what are the things we need to do in order to repro your problem? How are you using this project or any resources it includes?]

Expected Result:

[What are you expecting to happen as the consequence of above reproduction steps?]

Actual Result:

[What actually happens after the reproduction steps? Include the error output or a link to a gist if possible.]


Feature Request

Narrative:

As a [role]
I want [feature]
So that [benefit]

Acceptance Criteria:

Scenario 1: Title
Given [context]
  And [some more context]...
When  [event]
Then  [outcome]
  And [another outcome]...