1:新建內(nèi)部,程序段宏程序:changeOrigin。激活多重原點功能。
2:新建嵌入式宏程序:Coordinate_system,內(nèi)部寫到:
lvi ir3, wpcs_id
jz out_G54
;--------------------引入wpcs_id變量,判斷如果是0,直接跳轉(zhuǎn)到輸出G54
sri ir2, 5
cmpi ir3, ir2
jg out_G54.1_P
;---------------------判斷ID大于6,將跳轉(zhuǎn)輸出G54.1 P坐標(biāo)
srs sr2, " G"
adds sr3, sr2
sri ir1, 54
addi ir3, ir1
srs sr1, "%1d"
call ltos
adds sr3, sr2
srs sr1, " "
adds sr3, sr1
;--------------------當(dāng)ID≤6,執(zhí)行輸出G(54+id)
jmp end
lbl out_G54.1_P
srs sr2, " G54.1 P"
adds sr3, sr2
subi ir3, ir2 ;整型數(shù)IR3-IR2相減,結(jié)果寄存在ir3
srs sr1, "%1d"
call ltos
adds sr3, sr2
srs sr1, " "
adds sr3, sr1
;--------------------當(dāng)id>6,執(zhí)行輸出G54.1 P(id-5)
jmp end
;--------------------無條件跳轉(zhuǎn)至竭束
lbl out_G54
srs sr1, " G54"
adds sr3, sr1
lbl end
承擔(dān)因您的行為而導(dǎo)致的法律責(zé)任,
本站有權(quán)保留或刪除有爭議評論。
參與本評論即表明您已經(jīng)閱讀并接受
上述條款。