Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Damjan on May 20, 2013, 09:40:07 AM

Title: Live feed gcode into mach3 - is there a plugin / vbscript / c++ code?
Post by: Damjan on May 20, 2013, 09:40:07 AM
Hi,
is there a way to send gcode (lines or batches of lines) to mach3, which are then executed immediately?
I have a rather good knowledge of vb and c#, but none in c++.. so for now i tried the not very elegant way of having a vb script that reads a textfile in intervals, while another c# application writes them. Works pretty fine for 2 minutes or so, before either of them crashes because of read/write access violations.
Can anyone point me in the right direction - be it a plugin, vbscript or even some c++ code i can try to decipher.

In case you wonder why i would need this: basically i want to have my own application reading data / generating gcode on the fly, connect arduino sensors, interface with Rhino3d etc. which is all rather easy with c#, i just need the bridge to mach3

thank you!
Title: Re: Live feed gcode into mach3 - is there a plugin / vbscript / c++ code?
Post by: poppabear on May 21, 2013, 07:13:41 AM
hmmm,

I suspect you would be better off doing that in a plugin....
I would then run the snippit, through the MDI interface in M3.

scott
Title: Re: Live feed gcode into mach3 - is there a plugin / vbscript / c++ code?
Post by: Damjan on May 21, 2013, 08:04:04 AM
thanks, but when i execute gcode lines over vbscript it is basically the same?
Especially its important that i give it batches of lines, so the acceleration can be calculated accordingly - so that it doesn't stop after every line..
anyway - after a little vb research i found something called "named pipe" which is, as far as i understand, the same as a filestream, but without the access violation problems..
another way would be some kind of c# dll which can call from vb..
Title: Re: Live feed gcode into mach3 - is there a plugin / vbscript / c++ code?
Post by: scorpi on November 25, 2013, 08:37:52 AM
Hi Damjan,

do you found a plugin or a similar way to do the code injection? It is an interesting thing for people with knowledge in there own script language. I think it would be a nice feature.
I could need it in the moment ;-)

KS
Title: Re: Live feed gcode into mach3 - is there a plugin / vbscript / c++ code?
Post by: poppabear on November 25, 2013, 12:39:12 PM
I think I was unclear in what I was telling you, you CAN run G-Code from a plugin, that could read a file, and do it one line at a time if you want.
But........ what ever you want to do, that works is good
Title: Re: Live feed gcode into mach3 - is there a plugin / vbscript / c++ code?
Post by: scorpi on November 25, 2013, 01:20:06 PM
my question was pointing, is there a ready to run plugin (without the need of compiling it in ms visual studio) that I can use like a linux file pipe or a tcp socket connection? with this connections I would send gcodes that runs immediately.

an other, but more complicated way could be, if there is a opportunity to write plugins without ms visual studio?

ks
Title: Re: Live feed gcode into mach3 - is there a plugin / vbscript / c++ code?
Post by: poppabear on November 25, 2013, 01:55:32 PM
my question was pointing, is there a ready to run plugin (without the need of compiling it in ms visual studio) that I can use like a linux file pipe or a tcp socket connection?
>>>Not that I am aware of.......

with this connections I would send gcodes that runs immediately.
an other, but more complicated way could be, if there is a opportunity to write plugins without ms visual studio?
>>>Not that I am aware of.......

Scott
Title: Re: Live feed gcode into mach3 - is there a plugin / vbscript / c++ code?
Post by: eatabean on January 18, 2015, 08:34:15 AM
This is a topic I am also interested in, controlling my cnc with sensors and arduino. Did you ever get anywhere with this? I suspect a different way of driving the steppers, using the arduino output, but I don't know enough to get  the job done :P

Perhaps mapping the workspace and using video, assigning pixels to the x and y coordinates of the work table? Hmmm... that might work!
Have a look at this, basically doing what we are after: http://vimeo.com/20594424
Title: Re: Live feed gcode into mach3 - is there a plugin / vbscript / c++ code?
Post by: HimyKabibble on January 18, 2015, 10:53:10 AM
You can even do it with a simple CB macro, using file reads and the "code" statement.

Regards,
Ray L.
Title: Re: Live feed gcode into mach3 - is there a plugin / vbscript / c++ code?
Post by: BR549 on January 18, 2015, 02:20:10 PM
You can stream Gcode sements to Mach3 through its macro language Cypress Basic. I would NOT stream it directly with CODE"" statements as it is unstable.

I would write a CB interface that takes your Gcode and writes mini programs on the fly and LOAD it into Mach3 as a Gcode program, then run the file. THIS WAY you can take advantage of the CV features.

Also MAch3 is VERY stable running Gcode programs as compared to Gcode/CBmacro programs.

When the next Gcode segment is ready REPEAT the process Convert to Mach3 Gcode file, Load, Run,etc,etc

It would be similar in nature to DRIP feeding Mach3 Gcode Programs.

Just a thought, (;-) TP
Title: Re: Live feed gcode into mach3 - is there a plugin / vbscript / c++ code?
Post by: HimyKabibble on January 18, 2015, 03:42:51 PM
Terry,

Except, unless I'm mistaken, loading a new program will turn off the spindle and coolant, etc., and you'll lose a lot of "state".

Regards,
Ray L.
Title: Re: Live feed gcode into mach3 - is there a plugin / vbscript / c++ code?
Post by: BR549 on January 18, 2015, 05:24:13 PM
HIYA RAY, I don't think that is a problem .  IF you turn off all the cancel functions in General config I believe everything stays intact. At least with a quick test it did.

I will have to run a full test tonight to see IF it does.

(;-) TP