Comments (2)
please tell me what I got wrong. and power meter (SMD 220 eastron )gives me integer register values but I couldn't convert it to real values. I m new to Modbus
from jlibmodbus.
Hi! JLibmodbus supports several uart connectors like jssc, rxtx, jserialcomm etc. Before you create a master you should set SerialPortFactory, for instance jssc:
SerialUtils.setSerialPortFactory(new SerialPortFactoryJSSC());
If you need to read float values you can use the code below:
ReadHoldingRegistersRequest request = new ReadHoldingRegistersRequest();
//Or ReadInputRegistersRequest request = new ReadInputRegistersRequest();
request.setServerAddress(slaveId);
request.setStartAddress(offset);
request.setQuantity(2);
ReadHoldingRegistersResponse response = (ReadHoldingRegistersResponse)
request.getResponse();
master.processRequest(request);
ModbusHoldingRegisters registers = response.getHoldingRegisters();
registers.getFloat32At(0);
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
- Custom function code HOT 1
- 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.