8/11/2014 2:20 PM | |
Joined: 12/1/2009 Last visit: 2/9/2025 Posts: 672 Rating:
|
Dear germynator, You should send 02 05 00 00 00 00 CRC to set the coil (Modbus Address 00001) toFALSE and 02 05 00 00 FF 00 CRC to set the coil (Modbus Address 00001) toTRUE Just simplyfollow this document (see page 41 /05 Force Single Coil) : http://web.eecs.umich.edu/~modbus/documents/PI_MBUS_300.pdf Best Regards. |
Last edited by: TIBI68 at: 8/11/2014 2:33 PMGive us your feedback and show us your respect! |
|
8/12/2014 5:58 AM | |
Posts: 28 Rating:
|
Thank You so much So I send 02 05 00 00 00 + CRC i sending it as a string over my RS232 port to CM1241 and nothing i try to send other command for e.g. 02 06 00 01 00 01 + CRC in my opinion it should activate Q0.0 but nothing gonna happend, I'm not shure that I use good adapter rs232-rs485http://www.amazon.com/RS232-Communication-Converter-Adapter-Terminal/dp/B005FOOVLA. I connect txd+ from adapter to pin 3 on the CM1241 and txd- to pin 8 on the CM1241, to the adapter I connect 5V+ and GND. I the attachment is my program in python
Attachmentexample.zip (170 Downloads) |
Last edited by: germynator at: 8/12/2014 12:43 PM |
|
This contribution was helpful to
1 thankful Users |
8/12/2014 1:11 PM | |
Joined: 12/1/2009 Last visit: 2/9/2025 Posts: 672 Rating:
|
Hi germynator, I think at this early stage of your development you should forget about the PLC at the moment and try to get your software work with a Modbus Slave Simulator. Is there any reasonthat you want to useyour own program? You should be able to find free libraries on the internet to use with your application. Check this out: Best Regards. |
Give us your feedback and show us your respect! |
|
8/12/2014 2:54 PM | |
Joined: 12/1/2009 Last visit: 2/9/2025 Posts: 672 Rating:
|
Dear germynator, if you configured your S7 as modbus slave correctly,the interface parameters are the same and you send avalid request to the S7 thenyou should receive an answer. It would be nice to see what frame the PLC receives. Anyway, check in the documentation what options of troubleshooting do you have on the S7 function blocks. I am sure that there is something you can check. Best Regards. |
Give us your feedback and show us your respect! |
|
8/14/2014 1:39 PM | |
Posts: 28 Rating:
|
Hi It works, my database in MB_Slave was incorrect but now works fine Thank You
|
This contribution was helpful to
1 thankful Users |
Follow us on