#3011:This variable can be used to read the current date
(year/month/day).Year/month/day information is converted
to an apparent decimal number. For example, September
28, 1994 is represented as 19940928
#3012: This variable can be used to read the current time
(hours/minutes/seconds). Hours/minutes/seconds
information is converted to an apperent decimal number.
For example, 34 minutes and 56 seconds after 3 p.m.is
1、时间的用法(#3011)
如下图所示:要在7、8、9下方的空格中,用定点钻打点分别标识早班 (00:00~08:00)、中班(08:00~16:00)、夜班(16:00~24:00)
O0011
G90G80G40G49
T1 M6
G90G54G00X0YOM03S4500
G43G00H1Z30.0
#1=#3011---------------------------------(把当前时间赋于#1,如:时间为11:30时,#1=113000)
WHILE[[#1GE0]AND[#1LE80000]]DO1----------(当当前时间#1在00:00~08:00之间时运行下面一句,否则跳至END1)
G98G81X24.0Y3.0Z-5.0R-4.F500-----------(白班钻孔位置)
G80
M99---------------------------------------(子程序结束)
END1
WHILE[[#1GE80000]AND[#1LE160000]]DO2-----(当当前时间#1在08:00~16:00之间时运行下面一句,否则跳至END2)
G98G81X27.0Y3.0Z-5.0R-4.F500------------(中班钻孔位置)
G80
M99---------------------------------------(子程序结束)
END2
G98G81X30.0Y3.0Z-5.0R-4.F500---------(其余时间为夜班)
M99---------------------------------------(子程序结束)