1/19/2023 6:14 AM | |
Joined: 4/28/2015 Last visit: 10/30/2024 Posts: 10585 Rating: (825)
|
Hello,
no. For first and also as I said before, you want use Modbus RTU protocol or other type of protocol? In case of Modbus RTU you need use Modbus blocks for data exchange. In case you ask for data from PC Modbus application then your PLC is Slave so you need cfg your PLC in this way, with MB_SLAVE or Modbus_Slave block. For proper cfg of communication settings you need use MB_COMM_LOAD or Modbus_Comm_Load blocks. You can't use standard SEND/RECV blocks because there isn't Modbus protocol implemented. I recommend for first check web page www.simplymodbus.ca to improve knowledge and then TIA portal help to my mentioned blocks used. On other side, your RS232 cable need have TX/RX pins swapped at one side of cable of course. It is enough to have 3 pins in cable - TX,RX and GND for functionality. I'll attach some example prj link here after while... Example: How to configure Modbus RTU with S7-1200 CPU This example cover RS485 module but it is good example also to your situation because of used blocks and configuration. I expect differencies especially with different CM module interface type signals - RS422/485 to your actual RS232. |
Last edited by: Duris_I at: 01/19/2023 06:19:26With best regards... |
|
1/19/2023 6:22 AM | |
Joined: 3/30/2020 Last visit: 11/11/2024 Posts: 4940 Rating: (1010) |
Mr Duris has given you helpful direction:
Do not use the point-to-point instructions as you are doing now. Use the Modbus instructions. Attached is a piece that comes from the S7-1200 manual. Your case will use the RS232 port instead of the RS485 port. AN application note: How do you establish a MODBUS-RTU communication with STEP 7 (TIA Portal) for the SIMATIC S7-1200? Attachmentmodbus-slave.pdf (602 Downloads) |
Last edited by: qwazee at: 01/19/2023 06:24:15Last edited by: qwazee at: 01/19/2023 06:26:29Note: This note was published without knowing @Duris_I responded. Expect unintended overlap. Activities of this user is voluntary. There is no obligation or liability placed on this user. Though optional, your 'please' and 'thank you' is highly valued. |
|
This contribution was helpful to1 thankful Users |
1/19/2023 7:39 AM | |
Joined: 4/21/2022 Last visit: 5/31/2023 Posts: 27 Rating: (0) |
Hello, Thanks to your response, I tried exactly as you suggested but still i have the same status in my modscan as it shows received invalid response for modbus query. I am attaching the screenshots as a zip file for your reference. I turned off optimized block access to my holding register. The mode in the modbus comm load db is set to 0. what else am i missing. kindly guide me.please AttachmentScreenshots.zip (563 Downloads) |
1/19/2023 8:44 AM | |
Joined: 4/21/2022 Last visit: 5/31/2023 Posts: 27 Rating: (0) |
Hi, I have attached the config screenshots from the PC app that you asked. Kindly look into them The red indication is because I have forced the Analog inputs of the plc. I also checked the done/error in my comm_load block, but both are in false. I believe done should be true. what may be the cause. should I change the req in comm load block to clock pulse so that it can req more often? AttachmentScreenshots1.zip (589 Downloads) |
Follow us on