PMAC中G代码示例 点击:3500 | 回复:3



jamesyoung77

    
  • 精华:0帖
  • 求助:0帖
  • 帖子:4帖 | 345回
  • 年度积分:0
  • 历史总积分:1565
  • 注册:2010年6月25日
发表于:2011-03-17 17:42:52
楼主
此例子介绍简单PMAC G代码程序。 Gxx 被解释成PROG 1000的标号为Nxx000 的子程序; Mxx被解释成PROG 1001的标号为Nxx000 的子程序;用户如果使用标准G代码则无需去些这些子程序,因为泰道公司已经提供了标准的程序;本例中写的子程序只是为了解释工作原理;用户如果要定制G代码,可以修改对应的子程序。
;******************** 设置和定义**************************


; ---------------G代码示例-------------------------
; This example Motion Program (Prog #1) demonstrates:
;
; A) Using G-Codes (G0, G1) to command motion
; B) Using M-codes to control PMAC digital I/O
; C) Download ‘associated‘ files using ‘#include‘
;
; To run this Motion Program, from the PEWIN terminal window enter:
; B1R <enter>
;
; This G-Code program will traverse a ‘square‘ in X & Y axes
; A solenoid activated pen is controlled by M-codes M03 & M05
;

Close
D_elete Gather ;删去"_"

;Included files provide G-Code & M-code definitions
#include "G-Code_Sub.pmc"     ;download G-code definitions, Prog 1000
#include "M-Code_Sub.pmc"     ;download M-code definitions, Prog 1001

&1                                                    ;Define Coordinate System
#1->2000X                                     ;Define Motor #1 - X axis
#2->2000Y                                     ;Define Motor #2 - YX axis

I5192=1                                          ;Isx92 ;Disable ‘Blending‘ for C.S #1


OPEN PROG 1
CLEAR

G90                                ;Absolute positioning
F5                                   ;Set Feedrate

M05                                ;Pen up
G00 X5 Y5                    ;Move to start
;Dwell 0                        ;not required if Isx92 = 1

M03                               ;Pen down
G01 X10 Y5
;Dwell 0                        ;not required if Isx92 = 1
G01 X10 Y10
;Dwell 0                          ;not required if Isx92 = 1
G01 X5 Y10
;Dwell 0                         ;not required if Isx92 = 1
G01 X5 Y5
;Dwell 0                         ;not required if Isx92 = 1

M05                         &



jxh

  • 精华:0帖
  • 求助:2帖
  • 帖子:7帖 | 253回
  • 年度积分:0
  • 历史总积分:1466
  • 注册:2003年10月23日
发表于:2011-03-29 11:39:39
1楼

N3000 M0==0 Return ;M03:
N5000 M0==1 Return ;M05:
;N30000 Return ;M30

不明白这几句

jamesyoung77

  • 精华:0帖
  • 求助:0帖
  • 帖子:4帖 | 345回
  • 年度积分:0
  • 历史总积分:1565
  • 注册:2010年6月25日
发表于:2011-03-29 15:13:21
2楼
==是同步赋值,与运动有关;=是异步赋值。
下面是详细解释。
This command allows the value of an M-variable to be set synchronously with the start of the next move
or dwell. This is useful especially with M-variables assigned to outputs, so the output changes
synchronously with beginning or end of the move. Non-synchronous calculations (with the single =) are
fully executed ahead of time, during previous moves.

我喜欢小七

  • 精华:0帖
  • 求助:0帖
  • 帖子:0帖 | 12回
  • 年度积分:0
  • 历史总积分:218
  • 注册:2019年7月23日
发表于:2019-07-23 15:28:49
3楼

厉害了,已经收藏了,谢谢


热门招聘
相关主题

官方公众号

智造工程师