GC_USER_GCODE (175)
GC_USER_GCODE (175)
ID 175
Application: |
PLC |
Group: MOTION
Short description:
Function that executes the user's G-code.
Inputs:
no. |
type |
impulse |
mark |
notes |
1 |
B |
yes ( 0->1 ) |
exe |
Block activation |
Outputs:
no. |
type |
impulse |
mark |
notes |
1 |
B |
yes ( 0->1->0 ) |
Out1 |
Digital output no. 1 |
2 |
B |
yes ( 0->1->0 ) |
Out2 |
Digital output no. 2 |
3 |
B |
yes ( 0->1->0 ) |
Out3 |
Digital output no. 3 |
4 |
B |
yes ( 0->1->0 ) |
Out4 |
Digital output no. 4 |
5 |
B |
yes ( 0->1->0 ) |
Error |
Error - G-code was not defined by this function block |
Settings:
no. |
type |
mark |
notes |
1 |
I |
Code_1 |
G (=1) or M (=2) - code activating output Out1 |
2 |
I |
Value_1 |
Value activating output Out1 |
3 |
I |
Code _2 |
G (=1) or M (=2) - code activating output Out2 |
4 |
I |
Value_2 |
Value activating output Out2 |
5 |
I |
Code _3 |
G (=1) or M (=2) - code activating output Out3 |
6 |
I |
Value_3 |
Value activating output Out3 |
7 |
I |
Code _4 |
G (=1) or M (=2) - code activating output Out4 |
8 |
I |
Value_4 |
Value activating output Out4 |
Function operation:
After changing the exe signal from 0 to 1, the function checks the value of the M or G code written in the special registers R3071 or R3077 with the values defined in the block settings. If there is a value of 1 in the special register R3091 (the last code was the G code), then the R3071 register is checked, and if the value of 2 in the R3091 register (the last code was the M code), then the R3077 register is checked. When the values in the registers are consistent with the values from the block settings (R3091 = 1 & Code_n = 1 & Value_n = R3071 or R3091 = 2 & Code_n = 2 & Value_n = R3077, where n = 1 ... 4) then a corresponding digital output Out1 to Out4 is activated for one program cycle. If the G-code does not correspond to any defined for this block, then a high signal will appear on the 'Error' output for one controller cycle.
R registers and M markers used:
no. |
name |
description |
R-read, W-write |
R3071 |
_G_Code_G |
values taken from G-codes |
R |
R3077 |
_G_Code_M |
values taken from G-codes |
R |
R3091 |
_G_Code_MG |
1=G, 2=M |
R |