Troubleshooting Modbus Master Communication Issue on Siemens S7-300 PLC with OB35

Question:

Hello, I am configuring a Modbus master on an S7-300 PLC. The communication is successful in OB1, but not in OB35. I am wondering if this issue could be related to the process image selection in the CP cards hardware configuration. Any insights or suggestions would be greatly appreciated. Thank you, Russ.

Top Replies

Are you currently utilizing a CP341 as a Modbus master in your Siemens setup? Have you implemented any sample projects or library blocks for this purpose? In Siemens' documentation on "Master-Slave Communication with Modbus RTU Protocol for S7-300 and ET 200S Systems," the blocks Modbus_master and S_MODB are recommended to be called in OB1. It is essential to call these blocks cyclically to ensure smooth communication without any gaps. Have you considered using OB35 instead of OB1 for any specific reason? Could the selection of process image in the CP cards hardware configuration be a factor in this decision? For a better understanding, please provide more information about your hardware setup and the program in use.

JesperMP inquired about the use of a CP341 as a Modbus master and whether a sample project or library blocks were being utilized. In the Siemens document "Master-Slave Communication with Modbus RTU Protocol for S7-300 and ET 200S Systems," the blocks Modbus_master and S_MODB are called in OB1. It is speculated that these blocks must be called cyclically to maintain communication without gaps. Is there a specific reason for using OB35 instead of OB1? Please provide further details on the hardware setup and program. Regarding the hardware configuration, the CP card only has OB1-PI and PIP 1 for the process image. Thank you for your input, Jesper.

In response to russg, it is crucial to note that the system is designed to initiate Modbus communications every 60ms instead of with every scan of OB1. This timing is essential for the functionality of P_SND_RK and R_RCV_RK, which rely on a rising edge on the REQ pin to trigger their send or receive sequences. Failure to update the data exchange with the CP341 cyclically may lead to disruption in these processes, potentially causing operational issues. It is important to consider the impact of non-cyclical updates on the overall system performance.

The manual for the SIMATIC S7-300/S7-400 Loadable Driver for Point-to-Point CPs covers the usage of the MODBUS protocol in RTU format, with S7 acting as the master. To fully execute a MODBUS master job, it is necessary to repeatedly access the P_SND_RK and P_RCV_RK blocks. The frequency of opening these blocks depends on the amount of data being written or read. For optimal data exchange speed, it is recommended to open the blocks P_SND_RK and P_RCV_RK during the OB1 cycle of the CPU, rather than in slower cyclic interrupts. This allows for potential calling in OB35 if needed. Additionally, users may refer to the ERROR output pin for any error codes.

Have you configured the cyclic interrupt in the CPU hardware settings yet? Don't forget to set up this crucial feature to optimize your system's performance and ensure timely task execution.

Hi Russ! It sounds like you’re on the right track with checking the process image selection. In OB35, it's crucial to ensure that the data block you’re using is correctly configured since it handles time-critical tasks. Make sure that the Modbus communication function is still accessible in your cyclic program and that there are no conflicts or overlaps in your DB or memory usage that might affect timing. Additionally, verify that your CP card settings align with the specific requirements for OB35, as sometimes the communication settings can default differently than in OB1. Good luck!

More Replies β†’

Streamline Your Asset Management
See How Oxmaint Works!!

βœ…   Work Order Management

βœ…   Asset Tracking

βœ…   Preventive Maintenance

βœ…   Inspection Report

We have received your information. We will share Schedule Demo details on your Mail Id.

To add a comment, please sign in or register if you haven't already..   

Frequently Asked Questions (FAQ)

FAQ: FAQs:

Answer: 1. Q: What could be causing communication issues specifically in OB35 on an S7-300 PLC while configuring a Modbus master? The issue could potentially be related to the process image selection in the CP cards hardware configuration. Ensure that the correct process image is selected for proper communication.

FAQ: 2. How can I troubleshoot Modbus master communication problems on a Siemens S7-300 PLC?

Answer: You can start by checking the process image selection in the CP cards hardware configuration, ensuring proper configuration settings, and verifying the communication parameters such as baud rate, parity, and address.

FAQ: 3. What are some suggestions for resolving communication issues between a Modbus master and an S7-300 PLC in OB35?

Answer: It is recommended to double-check the hardware configuration settings, review the OB35 programming logic, ensure data consistency, and consider factors that may affect communication specifically in OB35.

FAQ: 4. Is there a common reason why communication might work in OB1 but not in OB35 on a Siemens S7-300 PLC?

Answer: The discrepancy in communication success between OB1 and OB35 could be due to differences in process image selection, data handling, or specific programming logic implemented in each organization block. Reviewing these aspects can help identify the root cause.

Ready to Simplify Maintenance?

Join hundreds of satisfied customers who have transformed their maintenance processes.
Sign up today and start optimizing your workflow.

Request Demo  β†’