Div_by_zero

fundamental PLC communications (Modbus) question

4 posts in this topic

I have a Productivity 2000 PLC communicating with a 3rd party device (embedded C++) via Modbus.

If I want to do, say, holding register writes...

This may sound like a silly question, but how do I know what the value of a register is before I write a new value to it?

Do I have to execute a read before I write, or are PLC write commands usually set up to do that for you?

Agan, sorry for such a fundamental question.

 

Share this post


Link to post
Share on other sites

Hello,

>Do I have to execute a read before I write

Depends. Function code 23 executes a read and a write with one command but, most devices do not support it.

>PLC write commands usually set up to do that for you?

No.

Normally you want to write a value to the register regardless of the current register value

My2c

 

Share this post


Link to post
Share on other sites

Thanks Mark.

So it sounds like on my HMI, I will need a "Poll Parameters" button that will populate all the parameter values.

Then, the user will be able to see what they are and change the ones that need to be changed with numeric entries.  A "Write All Changes" button will facilitate that.

Sound about right?

Again, forgive me, I've never done this before.

Thanks again. 

Share this post


Link to post
Share on other sites

Hello,

To me, no. But, you have not defined who is using the device, the purpose of the communication, the level of security required, the design goals, etc..

 

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