Just in case other people find this thread when looking for S7 PLC communication via TCP/IP:
User MarcoPolo5 shared a reference example back in 2009. As there is no easy way to collaborate on code posted to the Example Programs, I got in touch with MarcoPolo5, and with his consent republished the code he shared on a public GitLab repository:
https://gitlab.com/hampel-soft/hse/s7netcom
We started documenting and reworking the code, to make it more accessible and easier to use with our customer projects. Beware, it's still a long way from being finished and polished:
https://dokuwiki.hampel-soft.com/code/hse/s7netcom
https://dokuwiki.hampel-soft.com/kb/production/s7-communication