RichardK

Modbus Function Codes 3/4

10 posts in this topic

I am new to MRPLC forum, how can I be selective to registers which I want to read instead of reading all consecutive registers from a single slave device. Attached is how I wrote to read 11 consecutive registers from a soft starter using Function Code3.

RS485 Communication.png

Edited by RichardK

Share this post


Link to post
Share on other sites

Modbus function codes work on single registers or several consecutive registers.  If you need to jump around the address space, you simply need to issue more commands, each with its own start address and length.

1 person likes this

Share this post


Link to post
Share on other sites

Thank you very much PTurmel, I will try that

Share this post


Link to post
Share on other sites

pturmel, another question on the same subject,  I tried to read registers of four soft starters using a M221 PLC but I can't! Please would you explain me on these MSG1/2 to read all the soft starters' registers using master PLC (M221)

 

Thank you

Share this post


Link to post
Share on other sites

Unfortunately, while I am an expert on Modbus itself (see this), I am not an expert on Schneider PLCs.

1 person likes this

Share this post


Link to post
Share on other sites

Generally you will need to use timers as not to create multiple reads and writes at the same times. Normally a quick timer will trigger a read to a device...once the done is received it will trigger another and so on. 

2 people like this

Share this post


Link to post
Share on other sites

@pturmel Good day pturmel, How long does it take for a Modbus Master to read from/ write to its slaves?

 

Thank you

Edited by RichardK

Share this post


Link to post
Share on other sites

There's no specifics in the standard, other that timing on a true serial connection.  If you are using one of those, I recommend you read the standard docs over on modbus.org.  They are fairly short.  On serial, transmit time in both directions tends to dominate the total time.  Excluding transmission time, the real devices I've used tend to reply within single-digit milliseconds.

1 person likes this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now