-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgrbl.plc
48 lines (44 loc) · 1.1 KB
/
grbl.plc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#
# Test of GRBL plugin for g-code parsing
#
println('GRBL busy :', grbl_get_busy());
println('Parser busy :', grbl_get_parser_busy());
println('Error :', grbl_get_error());
println('Row :', grbl_get_code_row_num());
println('Ecmc error :', ax1.error, ax2.error);
println('All Enabled :', grbl_get_all_enabled());
ax1.reset:=0;
ax2.reset:=0;
# Enable axis in state 0
if(static.state==0) {
if(not(grbl_get_busy()) and not(grbl_get_error())) {
grbl_set_all_enable(1);
};
if(grbl_get_all_enabled()) {
static.state:=1;
};
};
# Trigg motion
if(static.state == 1) {
if(not(grbl_get_parser_busy())) {
static.counter+=1;
println('Retrigger g-code. Counter: ', static.counter);
grbl_set_execute(0);
grbl_set_execute(1);
};
};
#if(grbl_get_error()) {
# println('Try reset');
# grbl_reset_error();
# grbl_mc_resume(0);
# grbl_mc_resume(1);
# ax1.reset:=1;
# ax2.reset:=1;
# ax3.reset:=1;
#
#} else if(not(grbl_get_parser_busy())) {
# #static.counter+=1;
# #println('Retrigger g-code. Counter: ', static.counter);
# #grbl_set_execute(0);
# #grbl_set_execute(1);
#};