Skip to main content

Posts

Showing posts from July, 2013

ASCII TCP protocols in Windows ANSI C or C++

My recent project work included applications with a servo drive controller that offers a simple text-based protocol via TCP. We many times explain this to our clients as the fastest way to integrate the drive, especially if their part is a standalone Windows software project that does not already have any fieldbus communications up and running.  But to our own surprise, discussions went frequently like this: “We recommend the direct TCP interface - this is so much easier than adding extra Ethercat or Profinet equipment for this purpose.“ “Yes, but how does TCP work? ” “Easy. Just open a TCP client connection to the drive controller, and send these simple ASCII commands.” “Yes, but I have no idea about TCP connections. Don’t you have a simple DLL for this?” So we decided to help out and make a DLL indeed. Not one that implements the servo controller interface, but a simplistic and generic way of processing text-based protocols and dealing with the TCP socket connection. And I felt