Hello Guest it is March 29, 2024, 10:10:12 AM

Author Topic: Live feed gcode into mach3 - is there a plugin / vbscript / c++ code?  (Read 7885 times)

0 Members and 1 Guest are viewing this topic.

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!

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
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
fun times
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..
Re: Live feed gcode into mach3 - is there a plugin / vbscript / c++ code?
« Reply #3 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

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Live feed gcode into mach3 - is there a plugin / vbscript / c++ code?
« Reply #4 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
fun times
Re: Live feed gcode into mach3 - is there a plugin / vbscript / c++ code?
« Reply #5 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

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Live feed gcode into mach3 - is there a plugin / vbscript / c++ code?
« Reply #6 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
fun times
Re: Live feed gcode into mach3 - is there a plugin / vbscript / c++ code?
« Reply #7 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
« Last Edit: January 18, 2015, 08:45:32 AM by eatabean »
Re: Live feed gcode into mach3 - is there a plugin / vbscript / c++ code?
« Reply #8 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.
Regards,
Ray L.

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Live feed gcode into mach3 - is there a plugin / vbscript / c++ code?
« Reply #9 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