LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CNC laser, Gcode Interpreter

Hello, I am a beginner in this.
I am with a virtual laser cnc, the cad already has everything with Solidworks. The control move I am doing with labview (x axis, y axis).
The communication between solidworks and labview I already finish, I can move both axes by entering their coordinates.

My problems:
To generate the  G-code I use the grbl laser software, which already vectorizes and generates the g codes.

In the g-code, does anyone know how I can do the g-code interpreter with labview? Once I had the g-code, which I obtained with the laser grbl. That is, what would make Labview understand the G-codes generated with the software laser grbl.

Someone who already had this experience that can help me please! I'll be very greatful.
From already thank you very much, and sorry for my English.

0 Kudos
Message 1 of 5
(3,690 Views)

To do this well is probably quite a large task (maybe someone has already done it and will share their work here, but I'm not sure how good your chances of that are...).

However, if you have a text file and want to find all the matches for certain patterns, that's certainly possible with LabVIEW.

 

You can use the Read Text File, and then either Match Pattern or Match Regular Expression (the RE matching may be useful) along with a shift register holding the offset to get what you're looking for.

Assuming you want more than just G1 commands, you'd probably need a For loop to match each pattern desired. Perhaps something like the following:

Example_VI_BD.png

Here I search for two types of expression and then sort them by their position in the file.

Unfortunately, this kind of method will be very dependent on the regular expressions you use, and then if you have multiple types out output (here, a set of each optional X,Y,Z values, and no values) then you'd have to separately parse them.

A more reliable/robust method might involve a series of classes that each know how to handle their specific type of expression, and perhaps also how to generate the appropriate output for your motors. You could pass the entire file text to each of your set of classes and have them report all of their found operations, then sort those operations, then call an "Operate" function or similar over the array of "Operations.lvclass" objects, where "G1" and "G28" are children of Operations.lvclass.

 

Just remember there's likely to be considerable work (a sizeable chunk testing) with either option...

 

Other options might include John Wu's "LabVIEW GCode Parser" repository or this thread: G-code-interpreter-using-LabVIEW-done, but there no code is attached (at least to the OP) so I have no idea how good it might be (or how available it remains).


GCentral
Message 2 of 5
(3,618 Views)

Thanks for the help cbutcher.

I'm actually trying to use the gcode parser. I'll see if I can reuse that code,  I hope it can help me.

0 Kudos
Message 3 of 5
(3,558 Views)

Hi Cristhian, did you figure out how to do it? Can you share your methods here?

0 Kudos
Message 4 of 5
(3,144 Views)

did you manage to get, the gcode parser to work?

0 Kudos
Message 5 of 5
(3,055 Views)