Answer the question
In order to leave comments, you need to log in
How to read data via modbus protocol?
There is an Elemtro-Flomac meter that works on the Modbus protocol documentation
There is a library for working with the Modbus protocol on NODEJS I need to extract the value of the adders:
How can I send a request and how can I receive data?
I am working with ModBus
4 for the first time. The "TOTALIZERS"
block The "Totalizers" block consists of 4 totalizers: "Totalizer 1", "Totalizer 2", "Totalizer 3" and
"Totalizer 4". The configuration parameters of the totalizers are completely identical.
The SumFailsafeMode parameter is used to define the
behavior of the totalizers in the event of a fault .
SumFailsafeMode
MODBUS register: 700
Data type: Integer
Access: Read/Write
Defines the specific behavior of the totalizers when
an alarm occurs.
Parameters:
0 = STOP The totalizer stops accumulating until the error is cleared.
1 = HOLD VALUE The totalizer continues to accumulate, but the
last "correct value" is used as an increment.
2 = ACTUAL VALUE The totalizer continues to accumulate based on the actual current
flow value. The error event is ignored.
Factory setting: 0 = STOP
4.1 "TOTALIZER 1"
group
4.2 "TOTALIZER 2"
group
4.3 "TOTALIZER 3"
group 4.4 "TOTALIZER 4"
group
SUMMER → SUMMER 3 → CONFIGURATION
SUMMER → SUMMER 4 → CONFIGURATION
Note: configuration parameters for totalizer 1 are defined below.
Totalizers #3 and #4 are introduced in MP software sub-rev. 10.
SumAssign1
SumAssign2
SumAssign3
SumAssign4
MODBUS register: 701, 800,
750, 850
Data type : Integer
Access: Read/Write
The purpose of the totalizer.
Parameters:
0 = OFF not used
1 = MASS FLOW
2 = VOLUME FLOW volume flow
3 = CORRECTED VOLUME FLOW corrected volume flow
4 = TARGET MASS FLOW target mass flow
5 = CARRIER MASS FLOW carrier mass flow
6 = TARGET VOLUME FLOW volume flow of the target medium 7 =
CARRIER VOLUME
FLOW
volume flow of the carrier medium
Factory
setting: 0 = OFF 13.
SumUnit1
SumUnit2
SumUnit3
SumUnit4
MODBUS register: 702, 801,
751, 851
Data type: Integer
Access: Read/Write
Weight units when SumAssign = 1,4,5
Parameters:
Metric:
0 to 2 = g; kg; t
Factory setting: kg
Volume units at SumAssign = 2,6,7
Parameters:
Metric:
0 to 2 = cm3
; l; m3
Factory setting: m
3
Volume units when SumAssign = 3
Parameters:
Metric:
22
0 to 2 = Ncm3
; Nl; Nm3
Factory setting: Nm3
SumMode1
SumMode2
SumMode3
SumMode4
MODBUS register: 704, 803,
753, 853
Data type: Integer
Access: Read/Write
Totalizer operation mode.
Parameters:
0 = BIDIRECTIONAL both positive and negative
flow components are used (both positive and negative flow components are added together)
1 = FORWARD only positive flux components are accumulated by the totalizer
2 = REVERSE only negative flux components are accumulated by the totalizer
Factory setting: 1 = FORWARD
SumState1
SumState2
SumState3
SumState4
MODBUS register: 703, 802,
752, 852
Data type: Integer
Access: Read/Write
Status of the totalizer. The parameter indicates whether the totalizer is
currently running or stopped. When the totalizer is stopped , the
accumulated value remains unchanged.
Parameters:
0 = Active
1 = Stopped
Factory setting: 1 = Stopped
If the flowmeter is to be operated in register map mode
"MMI", by default the state of the totalizers is set according to the
instruction presented in section 13.
SumReset1
SumReset2
SumReset3
SumReset4
MODBUS register: 705, 804,
754, 854
Data type: Integer
Access: Read/Write
Resetting the totalizer (including
totalizer overflow value) .
If a binary input is configured for totalizer reset,
this parameter can be set to START
using this input.
Parameters:
0 = CANCEL Do not reset
1 = START Reset
Note!
Responsibility for resetting the totalizer is entirely the responsibility of the
operator.
Function description
SUMMER → SUMMER1 → PARAMETERS
SUMMER → SUMMER2 → PARAMETERS
SUMMER → SUMMER3 → PARAMETERS
SUMMER → SUMMER4 → PARAMETERS
Sum1, Sum2
Sum3
, Sum4
MODBUS register: 708, 807,
757, 857
Data type: Float
Access: Read
.
Note!
When changing SumAssign, SumUnit, SumMode, the value of the
adder does not change! Responsibility for resetting the
totalizer is entirely the responsibility of the operator.
SumOverflow1
SumOverflow2
SumOverflow3
SumOverflow4
MODBUS register: 706, 805,
755, 855
Data type: Float
Access: Read
Demonstrates totalizer overflow when
SumX > 107 (in current units) is exceeded.
The accumulated value of Q (including overflow) will be
represented by:
Q = SumOverflow * 107
+ Sum
Note!
When changing SumAssign, SumUnit, SumMode, the value of
SumOverflow does not change! Responsibility for resetting the
totalizer is entirely the responsibility of the operator.
SumTime1
SumTime2 SumTime3
Accumulation
time in seconds, including intervals in which the
value was not summed due to errors.
23
SumTime4
MODBUS register: 710, 809,
759, 859
Answer the question
In order to leave comments, you need to log in
Of the entire instruction, the most important thing is the lines of the form
MODBUS register: 702, 801,These are the register addresses you need to read/write.
751, 851
var ModbusRTU = require("modbus-serial");Replace address 5 with the address you need. It is possible to read/write multiple registers with consecutive addresses at a time. At what stage do the difficulties arise?
var client = new ModbusRTU();
// open connection to a serial port
client. connectRTU("/dev/ttyUSB0", {baudrate: 9600}, write);
function write() {
client.setID(1);
// write the values 0, 0xffff to registers starting at address 5
// on device number 1.
client.writeRegisters(5, [0 , 0xffff])
.then(read);
}
function read() {
// read the 2 registers starting at address 5
// on device number 1.
client.readHoldingRegisters(5, 2)
.then(console.log);
}
First you need to connect the device to the computer ...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question