Welcome, Guest
Username: Password: Remember me

TOPIC: Modbus RTU tutorial

Modbus RTU tutorial 11 years 11 months ago #3713

  • ivanceccon
  • ivanceccon's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 44
  • Karma: 0
Hello Everybody I am trying to use Proview with some Modbus RTU devices, using Modbus_RTU_Master, Modbus_RTU_Slave and Modbus_RTU_Module.
I put all these object in NodeHier but I am new on that, can somebody help me?

For example where I put the slave address? I did not found it.
How to connect with the PlcProgram?

I try to follow Modbus TCP in the manual, but no success.

Thanks
Best Regards
The administrator has disabled public write access.

Re: Modbus RTU tutorial 11 years 11 months ago #3716

  • marc
  • marc's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 710
  • Thank you received: 70
  • Karma: 24
Did you found this tutorial?
maba.dk/tutorial_modbus_rtu.pdf
Please, use the Wiki if you succeeded your project or solved your problem. Share your work, so we can learn from each other.
The administrator has disabled public write access.
The following user(s) said Thank You: ivanceccon

Re: Modbus RTU tutorial 11 years 11 months ago #3719

  • ivanceccon
  • ivanceccon's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 44
  • Karma: 0
Hello MArc, yes I found but this one is not using Modbus_RTU_Master, Modbus_RTU_Slave and Modbus_RTU_Module. new Proview object, I guess with these object the task will be much easer when you have 100 slaves for example.

Other problem is that I did not find how to edit a subwindows, may be it is a bug, because I can't edit reaching the menu bar and put in edit it do not work, I have to learn more.

Thanks
BR
The administrator has disabled public write access.

Re: Modbus RTU tutorial 11 years 11 months ago #3723

  • cgarciaw
  • cgarciaw's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 16
  • Karma: 0
Hi,

In Master you set com port parameters. With Slave you group modules. With Module you specify Modbus ID and function code, so if you want to R/W to a slave you need at least 2 modules per slave. The address in Module is used as address offset in the standard Modbus table. Use Uint16 for channel representation.

I am attaching a acreenshot of a working example controlled by the PLC. If you want manual control of R/W, disable Continous and use SendOp flag.

C.
Attachments:
The administrator has disabled public write access.
The following user(s) said Thank You: ivanceccon

Re: Modbus RTU tutorial 11 years 11 months ago #3724

  • ivanceccon
  • ivanceccon's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 44
  • Karma: 0
Hello Cristian thanks for you reply your screenshot was very helpfull, but I still don't find where I put my modbus slave address, I have several devices with address 1, 2, 3, 4 and 5 for example.
How can I indentify witch one I am reading or right? What is the process attritube? is it the modbus ID slave? if not where to put modbus ID?

Thanks
Best Regards
Last Edit: 11 years 11 months ago by ivanceccon.
The administrator has disabled public write access.

Re: Modbus RTU tutorial 11 years 11 months ago #3725

  • cgarciaw
  • cgarciaw's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 16
  • Karma: 0
The modbus id goes in UnitId in module.

If you let the PLC control de R/W (Process=1 and specify PLC thread), then in each scan cycle the PLC will use the module properties to send a commands to all modules it controls. In the example case, the PLC will send one command to slave id = 1, command code = 03 (read holding registers), address = 0x0000 (default 40001). For Continous=1 R/W is automatic.

If you need manual control of read/write cyle, which is somewhat disarable for slow connections, you need to set Continous=0, and use the SendOp flag from PLC or application.

C.
The administrator has disabled public write access.
The following user(s) said Thank You: ivanceccon
Time to create page: 8.795 seconds