LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use CNC G-CODES and M-CODES in LabVIEW

I have a file containing G-CODE and M-CODE based program for CNC machine control. These G-code and M-code has special functions in CNC. Can LabVIEW directly understand G-codes and M-codes so that I can develop a logic to control multiaxes servo motors through NI-7344 Motion controller. If it is not possible, Please suggest a suitable method. We want to replace the CNC with a PC based control. Also, the operators understand on G-code and M-code. So we want to develop a LabVIEW application, in which the user enters G-code and M-code and the machine operates accordingly using the NI-7344 motion controller instead of the CNC controller.
 
Regards,
Cruiser Controls
Mumbai, India
Message 1 of 43
(34,378 Views)
G codes contain commands to enable CNC machines to performed desired functions ie increase spindle speed,  return to reference point etc. You will need to identify all salient commands that you wish to minic !!! Suggest that you first  identify functions in CNC file to understand magnitude of your project !!
If you arre not familiar with G code commands suggest you trawl net for basic explanations.
Good luck
 
Xseadog
 
0 Kudos
Message 2 of 43
(34,343 Views)
The answer to the first part is, no LabVIEW doesn't recognize the "G-Codes and M-codes" used in CNC machine controls, even if the code that is the basis of LabVIEW is refered to as "G". To build a PC equivalent of a CNC controller will not be trivial. The CNC controller does more than interpret the G and M codes, it also translates those into complex motions, accelerations, etc. For example the one that I last used (about a million years ago) would do the vector calculations to guide the tool (end mill) of a specified diameter around a curve of x radius with only a few commands. To do this in LabVIEW will require building a command parser, an interpreter and then translate that into the appropriate motion control commands for the motion control card. To do multi-axis, coordinated moves will add to the complexity multifold. I'm also a little nervous about a multi-axis machine tool being controlled by a PC, particularly a Windows based PC.  
 
Good luck, it will be an interesting project. Keep us posted!
 
P.M.
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 3 of 43
(34,333 Views)

Didn't see those! Guess that's what happens when you have been on the forum long enough to provide over 5000 answers!

 

P.M.

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



Message 5 of 43
(34,316 Views)

I built a toolpath checker in labview that takes in "G" codes and draws the cutter path.  It's pretty simple, and not a machine tool controller, but I'll be glad to share it.

I wrote it to take in TurboCNC flavor of G code.  because that's what my garage CNC machine uses as it's controller (on an HP 486 laptop).

 

Sheldon

Technical geek, engineer, research scientist, biodegradable...
Message 6 of 43
(34,320 Views)

hi,

thanks for your reply.

I will be thankful to you if you can send your G-code VI to my e-mail rajan.giridhar@gmail.com

Regards,

Cruiser Controls

Mumbai, India

0 Kudos
Message 7 of 43
(34,284 Views)
Hi Sheldon,
 
I have a Smithy that I have built mechanical drive that I can control manually via switches. I have yet to moun the linear encoders. I planned on eventually implelementing CNC for it.
 
It sounds like your code could help me with one of the more challenging parts of the projects.
 
If you are so inclined, please post or send your code to
 
 
Thank you,
 
Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 8 of 43
(34,270 Views)
IF that possible please send me copy of that software. Thanks.
0 Kudos
Message 9 of 43
(34,184 Views)
it was to Sheldon Stokes of course...
0 Kudos
Message 10 of 43
(34,182 Views)