Is CNC Macro it's own language, or would knowing other programming languages help?

Results 1 to 4 of 4

Thread: Is CNC Macro it's own language, or would knowing other programming languages help?

  1. #1
    Member Michael_Karvovski's Avatar
    Join Date
    Jun 2019
    Posts
    5
    Downloads
    0
    Uploads
    0

    Question Is CNC Macro it's own language, or would knowing other programming languages help?

    I can't find any organized regimented way of learning CNC Macro programming. There is nothing resembling this other than just 2 books written by Peter Smid and S K Sinha. Does this mean I would have to know other adjacent programming languages to really know what is going on?



  2. #2
    Member Jim Dawson's Avatar
    Join Date
    Dec 2013
    Posts
    3718
    Downloads
    0
    Uploads
    0

    Default Re: Is CNC Macro it's own language, or would knowing other programming languages help

    All programming languages are the same and all programming languages are different. Logic is logic and common to all languages. The syntax and format of languages are different and have a few different rules. But they all do the same thing: Process data to achieve an end result.

    The most powerful bit of code in any language is the ''If'' statement. All languages have this decision making functionality, only the syntax changes.

    If (some statement here)

    (If true, Execute some code here)

    Else

    (If false, Execute some code here)

    End If

    So yes, having an understanding of basic programming would be very helpful so you can structure the logic flow in a way that makes sense. Google GWBasic, this is probably the simplest language to learn to understand program flow, and is quite similar to many CNC macro languages.

    Jim Dawson
    Sandy, Oregon, USA


  3. #3
    Member Michael_Karvovski's Avatar
    Join Date
    Jun 2019
    Posts
    5
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by Jim Dawson View Post
    All programming languages are the same and all programming languages are different. Logic is logic and common to all languages.......Google GWBasic, this is probably the simplest language to learn to understand program flow, and is quite similar to many CNC macro languages.
    Thanks for the important lead!

    If the whole family of BASIC dialects applies to what you are saying, then this link will be most helpful:
    http://freecomputerbooks.com/sitemap.html

    How would you rank the Assembly language??



  4. #4
    Member
    Join Date
    Aug 2009
    Location
    USA
    Posts
    167
    Downloads
    0
    Uploads
    0

    Default Re: Is CNC Macro it's own language, or would knowing other programming languages help

    Um... there's quite a bit to be said here, but I only have a few minutes right now.

    There is no single standard macro language for CNC machines. Each control manufacturer has their own version. However, they do tend to copy each other somewhat, so jumping from one brand to another isn't that hard to do (however, don't expect your programs to run on one machine when they were written for another).

    Most CNC macro languages do resemble BASIC somewhat; so if CNC macro programming is what you are after, I agree that studying BASIC is a good starting point. However, for real computer programming; it's TERRIBLE!!!1! It will teach you some REALLY bad habits... so be prepared to un-learn (or set aside) about half of what you've picked up from BASIC. I would also suggest avoiding Java; at least initially; because it's frequently poorly taught.

    Assembly language is one step removed from the actual 1s and 0s that the processor chip deals with... it's basically a human-readable version of it. Mnemonic abbreviations are used; for example:
    Code:
    mov ax,5;
    add ax,7;
    The assembler program would then take your assembly language and convert it into the binary codes that can then be actually executed by the computer.

    That example above, if assembled and run on an Intel 8086 compatible processor, would put the number 5 into the CPU register AX; and then add 7 to it, leaving the result in AX.

    Because each kind of processor chip is different, there is no one single assembler language (and syntax varies between different assemblers on the same chip platform - GNU's 8086 assembler is different than Microsoft's; for example). The example above won't even assemble on an ARM processor; for one thing, ARMs don't have AX and BX registers, they have registers numbered R0, R1, etc; for another, they don't have the ability to load data in the same instruction as a math operation (they are RISC processors - they do smaller, simpler operations, but more of them per second - you would have to load the number 7 in an instruction before the add operation).

    Unless you are creating a program that must run as fast as absolutely possible (and even then, compilers these days are really good - writing in C and then hand-tuning the assembly language result is what's usually done instead of writing the whole thing from scratch in assembly language); or one that directly manipulates hardware features that higher-level languages like C can't get at; you don't need to write in assembly language. However, like knowing what pistons and gears are, even if you're not an auto mechanic; learning about it is a good idea, just so you have an appreciation of what's going on under the hood... even if you never write anything other than a simple CNC macro.





  5. #5
    Member Michael_Karvovski's Avatar
    Join Date
    Jun 2019
    Posts
    5
    Downloads
    0
    Uploads
    0

    Default

    __Britt if you were to design a curriculum for someone, so that someone could arrive at the knowledge of Fanuc Macro programming, what would that curriculum look like? What is the best approach, given that BASIC, Java, and Assembly are not ideal in your opinion.



Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

Is CNC Macro it's own language, or would knowing other programming languages help?

Is CNC Macro it's own language, or would knowing other programming languages help?

Is CNC Macro it's own language, or would knowing other programming languages help?