Comments (1)
SOLVED:
I extended ModbusMasterSerial to return the SerialPort wrapped alongside the ModbusMaster.
I then created an OutputStreamRTU as follows:
byte[] bytes = new byte[]{slaveId, 0x42};
OutputStreamRTU outputStreamRTU = new OutputStreamRTU(serialPort);
outputStreamRTU.write(bytes);
outputStreamRTU.flush();
This gives the desired outcome of resetting the energy counter, but without the niceties of the library, such as error handling and reading in the response. That stuff will have to be done from scratch for the specific instruction.
from jlibmodbus.
Related Issues (20)
- Serial RTU Slave doesn't work properly on multi device network. HOT 1
- SimpleMasterTCP How to obtain the Slave station original code?
- WARNING: Maximum PDU size is reached. : 1024
- Cannot create more than one slave under a TCP connection HOT 4
- A problem with FrameEventListener
- simplemasterRTU not running HOT 1
- Using jSerialComm Serial Communication is not working with stop bit 2.
- Problem of register value type HOT 1
- support negative value for register HOT 1
- java.lang.ArrayIndexOutOfBoundsException when accessing coil index HOT 1
- Inconsistency between the source code and the published JAR results in RTU access timeout HOT 1
- Publishing to maven central
- Error When connect to linux serial com
- Using Modbus RTU with custom Baudrate HOT 2
- java.lang.UnsatisfiedLinkError: when using old computer with windows 10 or 11 HOT 1
- Error when connecting to Modbus RTU and connecting with jSerialComm HOT 9
- No pom for latest release (1.2.9.9) HOT 2
- Why can't the slave receive data when the master station sends more than 12 bytes? HOT 1
- Possible update jssc version? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jlibmodbus.