How can I communicate between a Siemens S7-1200 and python?

Megimoo picture Megimoo · Apr 27, 2012 · Viewed 32.9k times · Source

I am running a process on a S7-1200 plc and I need it to send a start signal to my python script, after the script is done running it needs to send something back to the plc to initiate the next phase. Oh, and it has to be done in ladder.

Is there a quick and dirty way to send things over profibus or am I better off using just a RS232 thing?

Answer

Megimoo picture Megimoo · May 28, 2012

After failing with libnodave and OPC, I created a TCON,TSEND and TRECV communication thing. It transmits a byte over TCP and it works.