• No results found

Overview

G-Codes supported by the Group Toolbox can be configured to pass execution of the command to user customizable code rather than executing code prepared by Yaskawa for a particular feature. A very common override is the T command for a tool changer. The build in T command simply assigns the new active tool number. If the machine requires the operation of a tool changer, this motion logic must be created by the OEM.

Overrides are declared by editing the OverrideList function block. Once the Overrides are declared, the process of handling overrides is nearly identical to the process of adding custom G and M codes. Two special function blocks are required to cus-tomize the solution. Custom_Code_Processor and Custom_Code_Execute. The help for these blocks contains detailed instruc-tions for customization. A key point of this customization technique is the ability to add any data structures necessary to the Custom_Code_Execute function block as VAR EXTERNAL, which gives the solution the ability to link G-Code instructions and parameters to application specific data which is unique to the equipment. See the examples included for each of the Custom function blocks.

Customizable Features

l Read / Write values into the MachineStruct.

l Read / Write G-Code 'VarData.'

l Reference the InputFlags.

l Read / Write values into a user defined data structure.

l Wait for specific conditions to be met

Non Customizable Features

The customization solution described here was not intended to allow the user to add standard G codes involving motion which are not already supported in the Toolbox. Contact Yaskawa Motion Application Engineering to discuss your application.

Controlling Program Flow

Custom_Code_Execute has the ability to control processing based on logical conditions. A VAR_OUTPUT named 'OKToIn-crement' is referenced by MC_MovePath after the call to Custom_Code_Execute to determine when it should advance to the next Segment instruction. By default, OKToIncrement is TRUE, meaning the custom code will complete in one scan. See the examples in Custom_Code_Execute for programmatically setting OKToIncrement.

Once the data is copied into the user defined data structure, the MotionWorks IEC application has full access to the data and can be programmed to use the information with the relevant components, such as a SLIO remote I/O, LIO card, third party Eth-ernet/IP device, etc.

Help version created 2/3/2022 Configuration and Customization

OverrideList

This is a special function block which must be copied and pasted from the Group Toolbox to the Logical POU tree of the main project for customization. Its purpose is to provide a way for the OEM to declare all supported G-Codes that are not be executed by the Group Toolbox, but via function blocks programmed by the OEM. While any command character can be declared, there are limitations to the design intention of the override feature, which is to allow the OEM to add machine specific operational sequences to features such as Tool changers and Spindle sequences. It is not designed to substitute other core operational features such as the G1 command.

Library

Group Toolbox

Parameters

The function block interface is shown for reference only. There is no need for the OEM to include this function block in the main project nor provide VAR_INPUTS or receive VAR_OUTPUTs from this function block. It's called from within the G-Code pro-cessor to determine if overrides are declared. The VAR_OUPTUTS report back to the G-Code Propro-cessor based on the CASE state-ment populated by the OEM.

* Parameter Data Type Description

VAR_INPUT Default

V Char INT

The Alpha character of the command to be overridden.

Example - the 'G' in G28.

n/a

V Parameter INT

The numeric portion of the command to be overridden.

Example - the '28' in G28.

n/a

V PrmSuffix INT

The numeric portion of the command to be overridden.

Example - the '1' in L30.1.

n/a

V RegFlags DWORD

Status bits indicating which register(s) were provided on a given line of G-Code. Bit 0 is set for A, bit 1 for B and so on, using 26 of the 32 bit DWORD.

n/a

VAR_OUTPUT

V ID BYTE

When adding override to the CASE statement, the OEM must provide a unique number to each of the overrides declared. This ID will be passed to the Custom_Code_Execute and Custom_Code_Processor function blocks.

V PreGCode STRING An optional command executed prior to passing control to Custom_

Code_Execute for the OEM to handle the override. For example, if a tool changer is programmed, it might be necessary to first disable tool height compensation by pre executing a G49.

V PostGCode STRING

An optional command executed after passing control to Custom_Code_

Execute. For example, if a tool changer is programmed, it might be necessary to re enable tool height compensation with a G43.

Procedure

1. Open the main project in MotionWorks IEC.

2. Open a second copy of MotionWorks IEC, and open the Group Toolbox, typically from the

"C:\User-s\Public\Documents\MotionWorks IEC 3 Pro\Libraries" folder. It is also possible to locate the Group Toolbox ref-erenced in your project by right clicking on the Group Toolbox User Library and viewing its Properties.

3. In the Project Tree Window of the second instance of MotionWorks IEC, locate the OverrideList function block in the Project Tree Window.

4. Copy it to the main project by right clicking on the Logical POUs section of the Project Tree Window and Pasting.

5. Important - Even though this function is called internally by the G-Code processor, it is necessary to add it to a POU in the main project so the compiler knows which instance to reference.

6. Add overrides to the CASE statement as necessary.

Example

Focusing on line 19, this sets an override for an M41 command, and assigns a unique ID to identify the override in the Cus-tom_Code_Execute function block.

Help version created 2/3/2022 Configuration and Customization

L10 Looping

L10 Looping provides a way to repeat G Code commands. A grid of identical operations can be performed with minimal instruc-tions. L10 Loops repeat all commands following an L10 until the end of the file OR until another L10 is reached. After each iter-ation through the loop, the machine moves to the next X Y starting position as specified by the X and Y values provided as parameters to the L10 command. The TCP will move to the next column or row at rapid velocity. The cycle repeats until all iter-ations have been processed.

l E or E0: The X & Y axes will not return to the starting location before the L10 command once all iterations have been completed.

l E omitted or E1: The X & Y axes will return to the starting location before the L10 command once all iterations have been completed.

Notes

l L10 specified without R C X Y values indicates the end a loop. Loops cannot be nested.

l M30 indicates the end a Loop.

l A G92 command is required after the L10 command for looping to work properly.

l X offset applies to Columns.

l Y offset applies to Rows.

l The L10 Looping feature is only supported when using emulation Mode2.

Related documents