With this mail I have attached the sample project for the modbus communication between CP341 (Modbus Master Module) and the third party slave devices with the one sample slave devices manual for what the sample project is made.
In this program I have used FB50 as the Modbus standard block; this block can be called multiple times in your program. One block call is for one number of CP341 Modbus master modules.
This program is the tested one and I am using it in my projects,
Blocks associated with the FB50 is,
FB 7 = Modbus_Rcv (Siemens standard block)
FB 8 = Modbus_Send (Siemens Standard Block)
DB1 = Send list DB (Modbus Queries list)
DB3 = Modbus Misc
DB4 = Modbus Data (Received Data’s)
Modbus Misc DB is used to feed inputs as well as status feedbacks form the FB50.
Advantages of using this block,
- You can set more then one query to the modbus slave devices upto 128 queries.
- Communication failure status for each query (available in Misc DB3).By using this, it is easy to get the healthiness of the slave devices located in various location of the plant.
- No need to use pulse time for query increment. Jump from one query to next query is depending on the reply for the previous query.
- Receive list offset can be entered directly in the Misc DB, no need of additional logic.
- You can call the FB 50 multiple times inside the program with the associated blocks for the one more Modbus Master module (CP341).
- Use Modbus variable table in the sample project for testing of your devices.
Use the Modbus block and achieve communication tasks quickly and easily without any problem.
Please revert back for any clarification.
"All for the Best"