Hello Guest it is April 19, 2024, 11:53:14 AM

Author Topic: Plugin Idea - TCP Listener  (Read 2795 times)

0 Members and 1 Guest are viewing this topic.

Plugin Idea - TCP Listener
« on: March 10, 2010, 11:44:41 PM »
I have an idea for a plugin.  A simple TCP listener.  This would just listen for incoming data on a specific port.  When data is received, it would parse the string which consists of a function code, a delimiter and a command string.  Function codes would be an integer and would tell the plugin what to do.  Codes could be something like this...

10001 = Jog
10002 = eStop
10003 = program run
etc.....

So a data string could look something like this...

"10001:X1.125Y3.375"

The plugin would parse this and jog the machine to the coordinates specified.  For functions not needing any other data, like eStop, the right side of the delimiter would be ignored.

This could be a very generic plugin that would enable non C++ savvy people to communicate with Mach.  I've been fumbling around in C++ but it's just not my thing.  I can write a TCP listener in VB.NET in 10 minutes.  A plugin like this would allow any program written in any language capable of TCP communication to communicate with mach.

I'm using the SDK .NET plugin written by Ed.  My plan is to keep plugging away at it, but at this point I can't even get a generated sample to debug, which makes writing the program just about impossible.  I have a cool application written in VB.NET and to write it in C++ using the SDK is just way beyond my immediate means, but I would like it to communicate with Mach.  I can easily add TCP connectivity to the app and I figured writing a TCP listener using the SDK would be a fairly small project.

Anyway...I'm going to keep at it, but if anyone else wants to have a go, I'd be eternally grateful.  At this point I'm still trying to get a handle on the file structure of a C++ project (.h, .cpp, etc.).  I haven't even got into actually using the SDK, other than generating the sample apps with Ed's plugin.