Global Variables Array (ru)
- 9 years ago.
MyCNC software supports Global Variables Array. Values of this array represent current state and configuration of CNC control. There is access to this Array from MyCNC software, GUI components, G-code program, PLC procedures, 3rd party software through Server API etc. Values of this array can be used for inter-process communication as well. List of variables and short description shown below.
Number | Variable Name | Description, Comment |
0001... 5000 |
G-Code user parameters | Variables can be used in G-codes for Parameterized programming |
5021 ... 5029 | Current Machine Position | Current Machine coordinates for axes X,Y,Z,A,B,C,U,V,W |
5041 ... 5049 | Current Program Position | Current Program coordinates (in current coordinates system) for axes X,Y,Z,A,B,C,U,V,W |
5070... 5078 |
Result of probing G38.2 - G38.5 | If Probing commands G38.2-G38.5 finished, result of probing latched in this registers for every axes X, Y, Z, A, B, C |
5161 ... 5169 | G28/G28.1 Home Position |
Command G28.1 stores Current Machine position to this registers. Command G28 moves tool to "Home/G28" position (which is actually restored from this registers). |
5181 ... 5189 | G30/G30.1 Home Position | The same as Registers 5161...5169, but used for G30/G30.1 commands Command G30.1 stores Current Machine position to this registers. Command G30 moves tool to "Home/G30" position (which is actually restored from this registers). |
5211 ... 5219 | G92 Offset | |
5220 | Current coordinate system number | MyCNC control softwrae supports 9 Work Coordinate systems (G54, G55, G56, G57, G58, G59, G59.1, G59.2, G59.3). Register contains Current Work Coordinates system number. |
5221 ... 5229 | Offset for Coordinate System 1 (for G54) | Registers keep offset between Machine Coordnates and Work Coordinates for Coordinate System #1 |
5241 ... 5249 | Offset for Coordinate System 2 (for G55) | Registers keep offset between Machine Coordnates and Work Coordinates for Coordinate System #2 |
5261 ... 5269 | Offset for Coordinate System 3 (for G56) | Registers keep offset between Machine Coordnates and Work Coordinates for Coordinate System #3 |
5281 ... 5289 | Offset for Coordinate System 4 (for G57) | Registers keep offset between Machine Coordnates and Work Coordinates for Coordinate System #4 |
5301 ... 5309 | Offset for Coordinate System 5 (for G58) | Registers keep offset between Machine Coordnates and Work Coordinates for Coordinate System #5 |
5321 ... 5329 | Offset for Coordinate System 6 (for G59) | Registers keep offset between Machine Coordnates and Work Coordinates for Coordinate System #6 |
5341 ... 5349 | Offset for Coordinate System 7 (for G59.1) | Registers keep offset between Machine Coordnates and Work Coordinates for Coordinate System #7 |
5361 ... 5369 | Offset for Coordinate System 8 (for G59.2) | Registers keep offset between Machine Coordnates and Work Coordinates for Coordinate System #8 |
5381 ... 5389 | Offset for Coordinate System 9 (for G59.3) | Registers keep offset between Machine Coordnates and Work Coordinates for Coordinate System #9 |
5400 | Current Tool Number | Register keeps Current Tool Number |
5401 ... 5408 | Current Tool Offset | Registers keep Tool Offsets for axes X, Y, Z, A, B, C for Current Tool |
5409 | Scheduled (Next) Tool Number | Register keeps Scheduled (Next) Tool Number. Tool change procedure M6 uses Registers #5400, #5409 to know where to put old Tool and where from take New one. |
5410 | Current Tool Diameter | |
5411 | Tool Front Angle | Reserved |
5412 | Tool Back Angle | Reserved |
5413 | Tool Orientation | Reserved |
5415 | Tool Holder Orientation | Reserved, Can be used in Toolchange macro |
5421 ... 5429 | Working Cube/Working Area/Soft Limits - Minimum Point | CNC software controls current Tool position and can prevent movement outside of Working Area (Soft Limits Control). THis registes keep Maximum and Minimum Working Area coordinates (Machine). Macros may use this registers to send Tool to Work Limits position (for exmple move to Up Limit) |
5431 ... 5439 | Working Cube/Working Area/Soft Limits -Maximum Point | see above 5421...5429 |
5441 ... 5449 | Position Register 1 (for G28.2 save / G28.5 move-to) | The same as Registers 5161...5169, but used for G28.5/G28.2 commands Command G28.2 stores Current Machine position to this registers (Home2). Command G28.5 moves tool to Home1 position (which is actually restored from this registers). |
5451 ... 5459 | Home After Position Register | At the end of Homing procedure Current Machine Position is assigned to this registers values. |
5460 | Current number of G-codes line | This register represents Line Number of Currently running G-code file |
5461 ... 5469 | Current G-code Work Position | If G-code running was stopped, this registers keep Position at which it was happened. |
5471 ... 5479 | Tool Sensor Position | Registers keep Tool Length sensor Position and used in Tool Length Measure macro for Tool positioning toward the sensor. Can be used for Automatical and manual Tool change. |
5490 | Surface Sensor Width value | Register keeps Surface Sensor Width (Thickness). This value used for sendor thisckness correction while Surface measure procedure. |
5494 | Surface Sensor Number | |
5495 | Surface Sensor Type | Type of Surface Sensor: "0" - Normally opened, "1" - Noramlly closed |
5496 | Sheet Thickness | The Value used for custom Surface Measure macro procedure. |
5501 ... 5509 | Position Register 2 (for G28.3 save / G28.6 move-to) | The same as Registers 5161...5169, but used for G28.6/G28.3 commands Command G28.3 stores Current Machine position to this registers (Home2). Command G28.6 moves tool to Home2 position (which is actually restored from this registers). |
5511 ... 5519 | Position Register 3 (for G28.4 save / G28.7 move-to) | The same as Registers 5161...5169, but used for G28.7/G28.4 commands Command G28.2 stores Current Machine position to this registers (Home2). Command G28.5 moves tool to Home3 position (which is actually restored from this registers). |
5521 | End sensor ignoring | Writing "1" to this register turn off Hardware End Limits control. It's used for Homing procedures, if Limit and Home sensor can be actually the same sensor and "Stop Running" while "Limit Sensor" activated should be temporarily disabled. |
5522 | Jog step value | There are 2 jog modes - "continuos jog" and "step jog". THis register contains Step Value for step jog (or 88.88 for continuous jog mode) |
5524 | Spindle speed | |
5525 | Soft limits ignore (writting "1" to this register turn off Soft limits control. used for homing procedure) | Writing "1" to this register turn off Soft Limits control. It's used for Homing procedures to temporarily disable Soft Limits control. |
5526 | M30 scheduled | Writing "1" to this register will cause reset NC program current pointer after running stopped/paused. Register used for M30 implementation. |
5528 | Draw Mode | Used for Cutting Tables (Plasma, Oxyfulel, Laser, Waterjet). If "1" written in this register, Cutting ON/OFF functions (M03, M20, M71) are ignored. This mode is used when need to test g-code motion without actual cutting. |
5529 | Shock Sensor Ignore | Writing "1" to this register will put "Showck Sensor" state to ignore. |
5530... 5538 |
Pulse Per Unit | Registers store Current "Pulse per unit" values for each axis X, Y, Z, A, B, C |
5541 ... 5548 | Parking point #1 Position |
CNC control has macros for This registers are for Parking Position #1 |
5551 ... 5558 | Parking point #2 Position | See 5541...5548 |
5561 ... 5568 | Parking point #3 Position | See 5541...5548 |
5571 ... 5578 | Parking point #4 Position | See 5541...5548 |
5581 ... 5588 | Parking point #5 Position | See 5541...5548 |
5591 ... 5598 | Parking point #6 Position | See 5541...5548 |
5600 | Current toolchanger type | Register keeps Toolchanger Type. Through this register Automatic Toolchange (ATC) procedure can be disabled ("ignore" state) for test purpose. Used for M6Txx macros (0-manual, 1-linear, 2-rotary); used for M6 Txx macro procedures |
5601 ... 5609 | Toolchanger Unload Offset value | Distance between Tool Holder and Tool Release Position (No risk to hit ATC mechanism while move out to toolpath) |
5610... 5607 |
Toolchanger blow-off offset | Reserved for customized ATC prcedure. |
5701 | Current Technology | Register represents Current Technology process on the machine. It's used for some M-codes to identify current process. 0- flexible 1- plasma 2- oxyfuel (gas) 3- mill/router 4- lathe 5- laser engraving 6- laser cutting 7- waterjet |
5702 | THC Enabled | Register represents state of Torch Height Control (THC) in the system 0- THC disabled 1- THC Enabled |
5703 | IHC Enabled | Register represents state of Initial Height Control (IHC) in the system 0- IHC disabled 1- IHC Enabled |
5710 | CV Mode | 0- CV Mode disabled 1- CV Mode enabled |
5711 | CV Mode Tolerance | Register keeps CV Mode Tolerance value |
5714 | Soft Limits Checker | CNC control software may check entire g-code for toolpath goes outside of Working Area. For Big g-code files this process can take machine time and RAM. Soft Llimits Checker can be disabled through this register. 0- Soft Limits Checker disabled 1- Soft Limits Checker enabled |
5715 | Lathe Gear | Parameter represents state of Lathe Gears |
5720 | Single Block Mode | 0- Single Block Mode disabled 1- Single Block Mode enabled |
6060 | Command Code of Motion Control |
Parameter represent Command Code currently running by Motion Control. |
6064 | Total lines in G-code file | |
6071 | X Homing Finished | Value is set to "1" CNC control software started and reset to "0" in X-axis macro procedure. Parameter can be used to display if Homing procedure finished to axis or block starting g-code without Homing. |
6072 | Y Homing Finished | see #6071 |
6073 | Z Homing Finished | see #6071 |
6074 | A Homing Finished | see #6071 |
6075 | B Homing Finished | see #6071 |
6076 | C Homing Finished | see #6071 |
6080 | Mileage counter | Register reserved for Oil Pump control. |
6081 | Reverse counter | Register reserved for Oil Pump control. |
6101 ... 6108 | Current Tool Holder Position | Reserved for custom ATC procedure. Registers used to store position of Current Tool Holder (to Put previous Tool) |
6111 ... 6118 | Next Tool Holder | Reserved for custom ATC procedure. Registers used to store position of Next Tool Holder (where Next Tool should be taken) |
6121 ... 6128 | Tool Holder #1 Position | Position of Tool Holder #1. Used mostly for Linear-Style Toochange Procedure |
6131 ... 6138 | Tool Holder #2 Position | Position of Tool Holder #2. Used mostly for Linear-Style Toochange Procedure |
6141 ... 6148 | Tool Holder #3 Position | Position of Tool Holder #3. Used mostly for Linear-Style Toochange Procedure |
6151 ... 6158 | Tool Holder #4 Position | Position of Tool Holder #4. Used mostly for Linear-Style Toochange Procedure |
6161 ... 6168 | Tool Holder #5 Position | Position of Tool Holder #5. Used mostly for Linear-Style Toochange Procedure |
6171 ... 6178 | Tool Holder #6 Position | Position of Tool Holder #6. Used mostly for Linear-Style Toochange Procedure |
6181 ... 6188 | Tool Holder #7 Position | Position of Tool Holder #7. Used mostly for Linear-Style Toochange Procedure |
6191 ... 6198 | Tool Holder #8 Position | Position of Tool Holder #8. Used mostly for Linear-Style Toochange Procedure |
6201 ... 6208 | Tool Holder #9 Position | Position of Tool Holder #9. Used mostly for Linear-Style Toochange Procedure |
6211 ... 6218 | Tool Holder #10 Position | Position of Tool Holder #10. Used mostly for Linear-Style Toochange Procedure |
6221 ... 6228 | Tool Holder #11 Position | Position of Tool Holder #11. Used mostly for Linear-Style Toochange Procedure |
6231 ... 6238 | Tool Holder #12 Position | Position of Tool Holder #12. Used mostly for Linear-Style Toochange Procedure |
6241 ... 6248 | Tool Holder #13 Position | Position of Tool Holder #13. Used mostly for Linear-Style Toochange Procedure |
6251 ... 6258 | Tool Holder #14 Position | Position of Tool Holder #14. Used mostly for Linear-Style Toochange Procedure |
6261 ... 6268 | Tool Holder #15 Position | Position of Tool Holder #15. Used mostly for Linear-Style Toochange Procedure |
6271 ... 6278 | Tool Holder #16 Position | Position of Tool Holder #16. Used mostly for Linear-Style Toochange Procedure |
6280 ... 7000 | Reserved for big toolchanger | |
7005 | Tangent Knife Control | 0- Tangent Knife Control disabled 1- Tangent Knife Control enabled |
7006 | Hardware PLC Move Flag | Reserved for Hardware PLC Interprocesses communication |
7009 | THC Speed | Reserved for Torch Height Control(THC); THC Control Speed mapped to rhis register |
7010 | THC Arc Voltage | THC Measured Arc Voltage mapped to this register |
7011 | THC Arc Voltage Reference | THC Reference Voltage mapped to this register |
7020 | Safe Height | Register keep Safe Height Value. Macros can use this value to move Tool to safe height. Variable can be used in GUI configuration to display/edit the value. |
7030... 7037 |
Feed Speed | Registers represent Feed (Cutting, G1,G2,G3 Interpolation) Speed Settings for each axis |
7040... 7047 |
Rapid Speed | Registers represent Rapid (Positioning, G0) Speed Settings for each axis |
7050... 7057 |
Jog Speed | Registers represent Jog Speed Settings for each axis |
7060... 7067 |
Marking Speed | Registers reserved for Marking Speed Settings for each axis |
7070 | Jog Continuous mode | Register represents Jog Mode setup 0- jog continuous mode 1- jog step mode |
7071 | Disable Jog from Keyboard | 0- Jog events from keyboard (joystick, input pins, Server API) enabled 1- Jog events disabled |
7072 | Feed Overspeed value | Register represents Overspeed value |
7073 | Spindle Overspeed value | Register represents Spindle Overspeed value |
7075 | Edge Probe Sensor Diameter | Diameter value of Edge Probe sensor |
7076 | X Offset for Edge Probe sensor | X Offset value for Edge Probe sensor |
7077 | Y Offset value for Edge Probe sensor | Y Offset value for Edge Probe sensor |
7079 | G0/Positioning Overspeed | |
7080 | (PLC) Set Move Speed | Reserved for PLC |
7081 | (PLC) Set Move Acceleration | Reserved for PLC |
7082 | (PLC) Reset Coordinates | Reserved for PLC |
7090 | Camera Ready | |
7100 | (Multidev) Devices Mask | |
7101... 7132 |
(Multidev) Device #1... Device#32 Enable |