KNOT Modbus Meanwell

Hi folks, anyone used Modbus RTU and sucessfully polled from any device?

I’m really struggling to get anything from the Meanwell DRS device I’m currently working on, no matter what setting or configuration I cannot get a response.

Using latest RoS (7.13rc3)

Meanwell Manual states:

Baud Rate: 115200
Data Bits: 8
Stop Bits: 1
Parity: None
Flow Control: None

Which is matched in the port settings of the KNOT.

I have attempted to use the transceive command for RTU but everytime I receive “failure: Timeout”

Some of the commands I’ve tried are:

iot/modbus/transceive address=3 function=4 values=80
iot/modbus/transceive address=0x83 function=0x04 values=0050
iot/modbus/transceive address=03 function=04 values=80

Slave ID being: 0x83 (Device Number)
Function Code: 0x04 (Read Input Register)
Register Address: 0x0050 (Read VIN)

Any advice or input would be very much appreciated!

See this post: http://forum.mikrotik.com/t/knot-modbus-mean-well-how/166588/9

Try swapping the A/B pins (+/-) between the DRS and KNOT. Also, I couldn’t get the /iot/modbus/transceive commands to work, but using a TCP app to connect to the KNOT works just fine.

Try this command

iot/modbus/transceive address=0x83 function=0x04 values=0,0x50,0,1

values=a,b,c,d
a - will be called function with number as sum (function + 128)
b - start register address
c - don’t understand yet
d - number of registers

And now the real explanation:
a + b: start register address, 16 bit / 2 bytes length, in this example a = 0x00 b = 0x50
c + d: number of registers, 16 bit / 2 bytes length, in this example c = 0x00 d = 0x01

If I read the manual correctly, this is also possible:

iot/modbus/transceive address=0x83 function=0x04 data=00500001

In any case, the biggest problem is that you forget to indicate how many registers you want to read.

Thanks, brambo123! I’m tired of guessing :smiley:
With my device (maybe it makes a difference), if pass (a) as non-zero value, then the function (passed function number + 128) will be called, this is probably the behavior of the device when accessing non-existent registers. Now it became clear to me why any (c) value causes an error.

@brambo123 thank you! It’s alive!

Now to figure out how to process and email the values…

ecdc, iot/modbus/transceive address=0x83 function=0x04 values=0,0x50,0,1 - will also work, values=0,0x50,0,1 and data=00500001 is equal