1/1/2015 5:56 PM | |
Joined: 2/26/2013 Last visit: 4/25/2024 Posts: 38 Rating: (1) |
Hi everyone. Im trying to get a program working with 2 Modbus slaves. Im using a S7-1212 PLC and a CM1241 SB card. I have made my program from this program example https://support.automation.siemens.com/WW/llisapi.dll?func=cslib.csinfo&objId=59862419&load=treecontent&lang=en&siteid=cseus&aktprim=0&objaction=csview&extranet=standard&viewreg=WW The program is working, if i only have one slave on the modbus RTU. What i have done in the program, is that i have made a copy of the two MB_master blocks and inserted them below in a new network, and changed the USint to 3 and 4 and changed the modbus adress as well.. I thougth this should be enough to communicate with my second slave. But apparentlyit isn´t. Should i disable the "MB_COMM_LOAD_DB" everytime i make an adress shift ? My program ends up with the USint value of 3, and dosn´t get further. I never get a DONE from my MB_master 3 block, is just request, and nothing more happens. Please help me out, i dosnt have any more ideas to what can be wrong. If anyone has a program which includes communicating with more than one unit on the MODBUS RTU, i would be glad if i could see that for inspiration. Thank you. |
Last edited by: S_N at: 1/1/2015 5:57 PM |
|
1/1/2015 9:28 PM | |
Joined: 11/29/2011 Last visit: 5/3/2024 Posts: 1357 Rating: (229) |
Hi, The way I see it: You have a modbus master, one of your block instruct it to talk to slave 1 In the next network an other block instruct the same HW to do the same to the slave 2 By this time highly unlikely that the first communication job completed. I think that is what is causing your com's to fail. If you read the referenced thread, it propose that one master block is used. The slave addresses are dynamic based on the result of last operation. It may not happen in one execution. Modbus is slow. Cheers
|
- What you read here, please check with manuals and your requirements. |
|
1/2/2015 10:33 AM | |
Joined: 2/26/2013 Last visit: 4/25/2024 Posts: 38 Rating: (1) |
Hi. Please see my pdf file here. AttachmentModbus.pdf (185 Downloads) |
Follow us on