APT Instructions P-S

This section provides basic information about the APT Instructions for for DELMIA SGPost processor.

Most of the examples are taken from the standard postprocessors provided.

PARTNO

Grammar:

PARTNO / ‘program number’

Action:

Defines the program number or reference; no default action. The PART.no variable is updated using the SEARCH/START and SEARCH/ALL instructions in the INIT macro

  • val2 = 0 The code is generated if necessary
  • val2 = 1 The code must be generated

Relevant variables: PART.no

Macro call: yes

PLANE

Syntax:

PLANE / point1, PERPTO, vector1 PLANE / 
PERPTO, plane, point1, point2

Action:

Definition of a plane entity

  • PLANE / point1, PERPTO, vector1 Plane passing through point1 and perpendicular to vector1.
  • PLANE/ PERPTO, plane, point1, point2 A plane passing through point1 and point2 and perpendicularto plane.

Relevant variables:none

Macro call: no

Example: Excerpt from an APT file.

INTOL /	.02500
OUTTOL/	.00000
PSIS/(PLANE/(POINT/ 70.49149, -9.12183, -30.93251),PERPTO,$
(VECTOR/ .000000, .000000, -1.000000))
INDIRV/	.00000, 1.00000,	.00000
TLON,GOFWD/(CYLNDR/ 70.49149, -9.12183, -30.93251,$
.00000,	.00000, -1.00000, 2.00000),ON,$ (PLANE/PERPTO,$
(PLANE/(POINT/ 70.49149, -9.12183, -30.93251),PERPTO,$
(VECTOR/ .000000, .000000, -1.000000)),$
(POINT/ 70.49149, -9.12183, -30.93251),$
(POINT/ 70.49149, -7.12183, -30.93251))
GOTO / 200.99785, -7.12183, -30.93251

POINT

Grammar:

POINT / val1, val2, val3

Action:

Definition of a point entity using these coordinates in the part coordinate system.

(val1, val2, val3): XYZ coordinates of the point

Relevant variables: none

Macro call: no

Example: see PLANE

Pole

Syntax:

If the NURBS is a 3-axis type:POLE / val1, val2, val3, val4, val5

  • (val1, val2, val3): pole coordinates
  • val4: homogeneous coordinate or weight of the pole
  • val5: node of the corresponding segment

If the NURBS is of the 5-axis type: POLE / val1, val2, val3, val4, val5, val6, val7, val8

  • (val1, val2, val3): pole coordinates
  • (val4, val5, val6): coordinates of the NURBS pole on the tool axis
  • val7: homogeneous coordinate or weight of the pole
  • val8: node of the corresponding segment

Action:

Definition of poles and nodes of the NURBS-activated curve / ON; the first and last multiple nodes are not defined.

Relevant variables:

Macro call: No

Example: XTmacro for the NURBS definition in CATIA V5

$$
text1 = STRXGET(ARG0,1,",")
pole1[1] = STRVAL(text1)
$$
text2 = STRXGET(ARG0,2,",") pole1[2] = STRVAL(text2[4,99])
$$
text3 = STRXGET(ARG0,3,",") pole1[3] = STRVAL(text3[4,99])
$$
text4 = STRXGET(ARG0,4,",") IF ( text4[1,3] = "XH=" ) THEN
type = 5
pole2[1] = STRVAL(text4[4,99])
$$
text5 = STRXGET(ARG0,5,",") pole2[2] = STRVAL(text5[4,99])
$$
text6 = STRXGET(ARG0,6,",") pole2[3] = STRVAL(text6[4,99])
$$
text7 = STRXGET(ARG0,7,",")
knod = STRVAL(text7[4,99])
$$
text8 = STRXGET(ARG0,8,",") h
= STRVAL(text8[3,99])
 
ELSE
type = 3
knod = STRVAL(text4[4,99])
$$
text5 = STRXGET(ARG0,5,",") h = STRVAL(text5[3,99]) ENDIF
nurbs_knod = nurbs_knod + knod
$$
text = " " pole1[1] " " pole1[2] " " pole1[3] text
= text " " h " " nurbs_knod
$$PRINT text
IF ( type = 5 ) THEN
POLE / pole1[1], pole1[2], pole1[3] $
, pole2[1] , pole2[2] , pole2[3] $
, h , nurbs_knod ELSE
POLE / pole1[1], pole1[2], pole1[3] $
, h, nurbs_knod ENDIF
$$
IF ( STATUS0.delete = 2 ) THEN RAPID
GOTO / pole1[1], pole1[2], pole1[3] ENDIF
$$

POLY

Grammar:

POLY / deg, tol1, tol2 
POLY / ON
POLY / OFF

Action:

Conversion of linear displacements into polynomial displacements to reduce the number of blocks and improve surface finish. The following conditions must be met:

  • Displacements are performed at working speed
  • The angle between two displacements must be less than tol2 in degrees
  • The distance from the segment to the curve is less than tol1
  • ON: the process is active
  • OFF: theprocess is disabled
  • deg: degree of the polynomial (2 or 3)
  • val1: maximum distance of each point from the calculated circle (default = 0.01)
  • val2: maximum angle between two linear displacements (default = 3.0)

Each smoothing operation calls the GOPOLY macro instead of the GOTO statement to use the coefficients POLY.x, POLY.y, and POLY.z

Relevant variables:

  • POLY.on: enable
  • POLY.tol[2]: values of tol1 and tol2
  • POLY.x[4]: coefficients on X = POLY.x[1] + t*POLY.x[2] + t2*POLY.x[3] + t3*POLY.x[4]
  • POLY.y[4]: coefficients on Y = POLY.y[1] + t*POLY.y[2] + t2*POLY.y[3] + t3*POLY.y[4]
  • POLY.z[4]: coefficients on Z = POLY.z[1] + t*POLY.z[2] + t2*POLY.z[3] + t3*POLY.z[4]
  • POLY.len: length of the curve POLY.rmin: minimum radius POLY.rmax: maximum radius

Macro call:no

Example: see GOPOLY.

POSITN

Syntax:

  • Fora ribbon file: POSITN / n1
  • POSITN/ NEXT
  • otherwise POSITN / val1, val2, val3, val10
  • POSITN/ NEXT

Action:

For a ribbon file: Move to the block with sequence number n1 or to the next block using NEXT. Otherwise: Move to the first block encountered whose major word is val1, val2, val3, or valn, or to the next block using NEXT. All intermediate blocks are ignored by the postprocessor.

If the key word does not exist in the file, postprocessing ends at this instruction.

Variables involved: none

Macro call: no

Example: COMMENT macro: removal of the GOTO at tool change for CATIA V5

$$
text = STRGET(ARG0,1)
$$
IF ( text = "TOOLCHANGEBEGINNING" ) THEN
IF ( catiav5 = 0 ) RETURN SEARCH / ON
SEARCH / MAJOR("GOTO"), MAJOR("LOADTL") IF ( SARG.num = MAJOR("GOTO")) THEN POSITN / MAJOR("GOTO")
POSITN / NEXT ENDIF
ELSE IF ( text[1,7] = "CATIAV5" )
catiav5 = 1
ELSE IF ( ARG0[4,9] = "CUTTER" ) diameter
= STRVAL(ARG0[12,25])
TOLIB / LOADTL.num, diameter ENDIF
$$

PPRINT

Grammar:

PPRINT / ‘comment’

Action:

Defines and writes a comment to the ribbon file; the comment will be enclosed by the characters defined in the ‘comment = 1’ field of the data file

Relevant variables: none

COMMENT1.start 
COMMENT1.end

Macro call: yes

PREFUN

Syntax:

PREFUN / val1

Action:

Writes a G-code on a single block, equivalent to GCODE / val1 + EOB

Related variables: see GCODE

Macro call: yes

PRINT

Syntax:

PRINT 'character string'

Action:

Displays a string on the screen. This string can consist of numeric or text variables.

Relevant variables: none

Macro call: no

Example:

PRINT "value of X = " X	" value of Y = " FORMAT(1,Y) print --> value of X = 1.0000 value of Y = 2

PSYS

Syntax:

PSYS / plane

Action:

Definition of the trajectory calculation plane.

Relevant variables: none

Macro call: no

Example: Excerpt from an APT file.

INTOL /	.02500
OUTTOL/	.00000
PSIS/(PLANE/(POINT/ 70.49149, -9.12183, -30.93251),PERPTO,$
(VECTOR/ .000000, .000000, -1.000000))
INDIRV/	.00000, 1.00000,	.00000
TLON,GOFWD/(CYLNDR/ 70.49149, -9.12183, -30.93251,$
.00000,	.00000, -1.00000, 2.00000),ON,$ (PLANE/PERPTO,$
(PLANE/(POINT/ 70.49149, -9.12183, -30.93251),PERPTO,$
(VECTOR/ .000000, .000000, -1.000000)),$
(POINT/ 70.49149, -9.12183, -30.93251),$
(POINT/ 70.49149, -7.12183, -30.93251)) GOTO

RAPID

Grammar:

RAPID

Action:

The next movement defined by GOTO or GODLTA will be a high-speed movement.

Related variables: ETAT0.move= 0

Macro call: yes

RCODE

Syntax:

RCODE / val1, val2

Action:

Write the value val1 to the "ribbon" file in R code (circle radius), while satisfying the output conditions val2.

  • val2 = 0 The code is generated if necessary
  • val2 = 1 The code must be generated

Relevant variables: CODE.used[15]

Macro call: no

Example: see KCODE

RENAME

Syntax:

RENAME / 'output file name'

Action:

The result file will be given the new name specified by the RENAME function; the FILOUT variables are updated. This function applies to the active channel.

Related variables:

  • FILOUT.dir: directory of the file
  • FILOUT.name: FILOUT file name
  • FILOUT.ext: file extension

Macro call: no

Example: See the READ function.

RETURN

Syntax:

RETURN / val

Action:

Immediate return to the calling file. The return value is used only for the GETARG macro, as the value of the corresponding variable. This statement simplifies programming and increases processing speed.

Relevant variables: none

Macro call: no

Example: Start of the GOTO 5-axis macro; the 3-axis operation is processed first to increase processing time.

$$
IF ( ARG1.nval = 3 ) THEN GOTO
RETURN ENDIF
$$

SCODE

Grammar:

SCODE / val1, val2, val3

Action:

Writes an S code (spindle rotation) with the value val1 to the ribbon file, subject to the output conditions val2.

  • val2 = 0 The code is generated if necessary
  • val2 = 1 The code must be generated
  • val2 = -1 The code is not generated, but the SPINDL variable is updated
  • val3 = 0 The code is generated in the block
  • val3 = 1 The code is generated in an XYZ motion block
  • val3 = 2 The code is generated in a block for movement perpendicular to the work plane
  • val3 = 3 The code is generated in a motion block in the work plane
  • val3 = 4 The code is generated in a block containing a linear and rotary motion axis
  • val3 = 5 The code is generated in a block containing a rotary axis
  • val3 = 5 The code is generated in a block containing a rotary axis
  • val3 = 11 The code is generated in a block containing an X-axis
  • val3 = 12 The code is generated in a block containing a Y-axis
  • val3 = 13 The code is generated in a block containing a Z-axis
  • val3 = 14 The code is generated in a block containing an A-axis
  • val3 = 15 The code is generated in a block containing a B-axis
  • val3 = 16 The code is generated in a block containing a B-axis

Relevant variables:

SPINDL.val 
CODE.used[17]

Macro call: no

Example: excerpt from the SPINDL macro

$$
IF ( SPINDL.on = 1 ) THEN
IF (val > 0.01) SCODE / val, 1.0 IF
(SPINDL.direction = 1) THEN MCODE / 4.0, 1.0
ELSE
MCODE / 3.0, 1.0 ENDIF
EOB ENDIF
$$

SMCODE

Grammar:

SMCODE / val1, val2, val3

Action:

Writes an S code (maximum spindle speed) with the value val1 to the ribbon file, subject to the output conditions val2.

  • val2 = 0 The code is generated if necessary
  • val2 = 1 The code must be generated
  • val2 = -1 The code is not generated, but the SPINDL variable is updated
  • val3 = 0 The code is generated in the block
  • val3 = 1 The code is generated in an XYZ motion block
  • val3 = 2 The code is generated in a block for movement perpendicular to the work plane
  • val3 = 3 The code is generated in a motion block in the work plane
  • val3 = 4 The code is generated in a block containing a linear and rotary axis
  • val3 = 5 The code is generated in a block containing a rotary axis
  • val3 = 11 The code is generated in a block containing an X-axis
  • val3 = 12 The code is generated in a block containing a Y axis
  • val3 = 13 The code is generated in a block containing a Z axis
  • val3 = 14 The code is generated in a block containing an A axis
  • val3 = 15 The code is generated in a block containing a B axis
  • val3 = 16The code is generated in a block containing a C axis

Relevant variables:

SPINDL.maxrpm CODE.used[27]

Macro call: no

Example: excerpt from the SPINDL macro

$$
$$ maximum rotation
$$
IF ( NVAL("MAXRPM") ) THEN maxrpm = VAL("MAXRPM",1)
IF ( maxrpm > SPINDL.max ) maxrpm = SPINDL.max IF ( maxrpm < SPINDL.min ) maxrpm = SPINDL.min GCODE / 92
SMCODE / maxrpm EOB
ENDIF

SEARCH

Grammar:

SEARCH / val1, val2, val3, val10
SEARCH / ON, nbloc 
SEARCH / NEXT 
SEARCH / START, val0 
SEARCH / ALL

Action:

Forward search in the main file.

  • SEARCH/ ON, nbloc: defines the starting point of the search; the search will be performed over n blocks (default = 1000)
  • SEARCH/ NEXT: Each call to this function decodes the information from the next line.
  • SEARCH/ val1 Searches until a major word is found that has a number corresponding to one of the values val1, val2 al10.
The search result can be accessed via SARG or the functions SARG(), SNVAL(), and SVAL().
  • SARG.num = major’s number
  • SARG1.on=existence of minor 1
  • SARG1.nval = number of values for minor 1
  • SARG1.val[]= values for minor 1
  • SARG(n).on = existence of minor n
  • SARG(n).nval = number of values for minor n
  • SARG(n).val[] = values for minor n
  • We are at the end of the file if SARG.num = EOF

SEARCH /START:

SEARCH/ ALL: searches for the first occurrence of each OFSTNO, FROM, GOTO,PARTNO to update the following variables:

  • OFSTNO:origin ETAT0.from[6]: startingpoint
  • ETAT0.pts[6]and ETAT1.pts[6]: current position
  • PART.no: program number

SEARCH/ ALL: updates the machining dimensioning variables:

  • SEARCH.xyzmin[3]: minimum on xyz
  • SEARCH.xyzmax[3]: maximum on xyz SEARCH.ijkmin[3]: minimum of ijk
  • SEARCH.ijkmax[3]: maximum on ijk

SEARCH/ ALL: Searches the entire file for the list of loaded tools, with the following information for each tool.

  • SELCTL.max:number of tools
  • SELCTL.n: index of the current selection for FCODE and FEDVAR
  • SELCTL.num[]:list of tools in the loading order
  • SELCTL.time[]: machining time per tool
  • SELCTL.dist[]: machining distance per tool SELCTL.ncycle[]:number of drilling operations per tool
  • SELCTL.fedrat[]:Index of the last tool feed rate in the feed rate list

If SELCTL.ident = 1, consecutive identical tools are taken into account

SEARCH/ ALL: Searches the entire file for a list of operations containing the following information:

  • OPER.max:number of operations
  • OPER.n:Index of the current operation for FCODE and FEDVAR
  • OPLST.num[]: Tool for each operation
  • OPLST.time[]: machining time for each operation
  • OPLST.dist[]: machiningdistance for each operation
  • OPLST.ncycle[]: number of drilling operations for each operation
  • OPLST.xyzmin[9*]: minimum machine axis values
  • OPLST.xyzmax[9*]: maximum machine axis values
  • OPLST.start[]: 0 (G0) or 1 (G1) feed mode for the 1ermovement of the operation
  • OPLST.last[]: 0 (G0) or 1 (G1) feed mode for the last movement
  • OPLST.fedrat[]: index of the last feed rate for each operation in
  • FEDLST OPLST.ref[]: comments for the operations, separated by the character ‘|’

SEARCH/ ALL: Creates the feed rate list based on the FEDLST.on value specified before it.

  • FEDLST.on = 1: creates the list of feeds for the program
  • FEDLST.on = 2:creates the list of feeds by tool
  • FEDLST.on = 3: creates the list of feeds by operation
  • FEDLST.max: Number of feed rates
  • FEDLST.val[]: List of feed rates FEDLST.start[]:default search start index (0)

In this case, the generated feed rates (FCODE and FEDVAR) are the index of the FEDLST.val[] array corresponding to the desired value. This value may be offset from FEDLST.first. If FEDLST.on = 2 or 3, you must define SELECT.n or OPER.n to obtain the feed rates corresponding to the active tool or operation.

Relevant variables:

SARG
PART.no[]
ETAT0.pts[6]
OFSTNO
SELCTL.on
SELCTL.ident
SELCTL.max
SELCTL.num[]
SELCTL.time[]
SELCTL.ncycle[]
SELCTL.dist[]
SELCTL.n
OPER.max
OPER.n
OPLST.num[]
OPLST.time[]
OPLST.ncycle[]
OPLST.dist[]
OPLST.start[]
OPLST.last[]
OPLST.xyzmin[]
OPLST.xyzmax[]
OPLST.ref[]
FEDLST.on
FEDLST.first
FEDLST.start
FEDLST.max
FEDLST.val[]
SEARCH.xyzmin[3]
SEARCH.xyzmax[3]
SEARCH.ijkmin[3]
SEARCH.ijkmax[3]

Macro call: no

Example: Search for spindle rotation.

$$
$$	spindle rotation
$$
SEARCH / ON
SEARCH / M_spindl, M_loadtl
IF ( SARG.num = M_spindl ) THEN
IF ( SNVAL("VALUE") ) SPINDL.val = SVAL("VALUE",1) IF ( SNVAL("RPM") ) SPINDL.val = SVAL("RPM",1) ENDIF SPINDL / OUT
$$

SETCODE

Grammar:

SETCODE / “n, noun”

Action:

Rename an existing code in the data file.

n= G-code number (1 ≤ n ≤ 99) name: new name of the code

Relevant variables: n

Macro call: no

SEQNO

Syntax:

SEQNO / val1 
SEQNO / ON SEQNO
/ ON, 1 SEQNO / OFF 
SEQNO / INCR, val2 
SEQNO / STEP, val3

Action:

Enables and disables block numbers.

  • val1 = number of the next block
  • val2 = increment for block numbers
  • val3 = block numbering skip
  • SEQNO/ ON , 1: Block number must be written to the next block

Relevant variables:

  • SEQNO.on: Enable or disable
  • SEQNO.num = val SEQNO.inc[1] = val2
  • SEQNO.step[1]= val3
  • SEQNO.block: Block numbers must be written

Macro call: yes

SETGCOM

Grammar:

SETGCOM / “n , text”

Action:

Defines the text comment associated with a G code n = G code number (1 ≤ n ≤ 99)

text = comment text

Relevant variables:

COMMENT1.start 
COMMENT1.end

Macro call: no

Example: see SETMCODE

SETMCOM

Syntax:

SETMCOM / “n , text”

Action:

Definition of the text comment associated with an M.

  • Code n = M code number (1 ≤ n ≤ 99)
  • Text= comment text

Relevant variables:

COMMENT1.start 
COMMENT1.end

Macro call: No

Example: Defining a pin comment.

The following lines:

$$
SETCOM / “3,Pin Setup”
$$
MCODE / 3 EOB
$$
Generatesin the output file: N** M3 (Spindle Start)

SGAXIS

Syntax:

SGAXIS / val1, val2, val3, ON, val4, val5, val6, START, val7, LAST, val8 SGAXIS / OFF

Action:

Instruction added by the SGTMP function to control movements with constant tool orientation.

  • (val1, val2, val3) = tool axis value
  • ON = start of fixed toolorientation
  • OFF= end of fixed tool orientation
  • val4= number of G1 movements in the group
  • val5= number of circles and offsets in the group
  • val6 = number of drilling operations
  • val7= 0 or 1: movement mode (G0 or G1) for thefirstmovement in the group
  • val8 = 0 or 1: movement mode (G0 or G1) for the first movement after SGAXIS/ OFF

To generate an SGAXIS instruction, the group must contain at least one ANALYSE.naxis GOTO in work mode, or at least one circle, or at least one drilling operation. By default, ANALYSE.naxis = 4.

This instruction allows you to validate or cancel an inclined plane

Relevant variables:

SGAXIS.on = 0 or 1
SGAXIS.ijk[] = (val1,val2,val3) 
SGAXIS.ngoto = val4 
SGAXIS.ncircle = val5 
SGAXIS.ncycle = val6 
SGAXIS.start = val7 
SGAXIS.last
= val8 ANALYSE.naxis

Macro call: yes

SGCOMP

Syntax:

SGCOMP / val1 where val1 = 2 or 3

Action:

Instruction added by the SGTMP function before a CUTCOM instruction to specify whether the corrector will be used with a tool axis variation.

  • val1 = 2: plane tool correction
  • val1 = 3: tool correction in space

Relevant variables: SGCOMP.val= val1

Macro call: yes

Example: SGCOMP macro for Siemens

$$
IF ( ARG1.val[1] = 3 ) THEN
IF ( CUTCOM.type = 3 ) RETURN SGAXIS
/ OFF
NWRITE / " CUT3DC"
CUTCOM.type = 3 ELSE
IF ( PLAN.on ) THEN
IF ( CUTCOM.type = 2 ) RETURN NWRITE / " CUT2DF"
CUTCOM.type = 2 ELSE
IF ( CUTCOM.type = 1 ) RETURN NWRITE / " CUT2D"
CUTCOM.type = 1 ENDIF
ENDIF
$$

SGPLAN

Grammar:

SGPLAN / val1, val2, val3, val4, val5, val6, ON, val7, val8, val9 SGAXIS / OFF

Action:

Instruction added by the SGTMP function to define movements with constant tool orientation within the same plane. In this case, ANALYSE.mode = 1 is required.

  • (val1, val2, val3) = plane position
  • (val4, val5,val6) = plane orientation
  • ON = start of plane
  • OFF= end of plane
  • val7= number of G1 movements in the group
  • val8= number of circles and offsets in the group
  • val9 = number of drilling operations

To generate an SGPLAN instruction, the group must contain at least one ANALYSE.ngoto GOTO in work mode, or at least one circle, or at least one drilling operation. By default, ANALYSE.ngoto = 4. This instruction defines the boundaries of the machining planes.

Relevant variables:

SGPLAN.on = 0 or 1
SGPLAN.plan[] = (vAm&,val2,val3,val4,val5,val6) 
SGPLAN.ngoto = val7
SGPLAN.ncircle = val8 
SGPLAN.ncycle = val9 
ANALYSE.ngoto 
ANALYSE.mode

Macro call: yes

SGROT

Syntax:

SGROT / val1 where val1 = 0 or 1

Action:

Instruction added by the SGTMP function before the Nth G0 movement or the1stG1 movement, where N = ANALYSE.nrapid = 2 by default.

  • val1 = 0: the next movement is G0 val1
  • = 1: the next movement is G1

This instruction allows you to perform travel tests in order to reposition the angular axes if necessary; it is therefore assumed that you are sufficiently far from the workpiece

Relevant variables:

  • SGROT.val= val1
  • ANALYSE.nrapid

Macro call: yes

SGTMP

Syntax:

SGTMP / ‘name of the new APT file’

Action:

This command creates a new APT file to add the following specific commands.

  • SGAXIS/ ON and SGAXIS / OFF: Delimitation of constant-axis zones
  • SGROT: Rotation reversal position for rotary axes
  • SGCOMP:2D or 3D tool compensation type
  • SGUGV: machining type for UGV activation

If ANALYSE.mode = 1

SGPLAN/ ON and SGPLAN / OFF: definition of constant-axis plane zones

This instruction must be included in the INIT file; the processed APT file becomes the newly created file. This operation is not possible with a CLFILE-type file.

  • To define an SGAXIS zone, you need at least N G1 movements or at least 1 circle or at least 1 drilling operation, with N = ANALYSE.naxis = 4 by default.
  • To define an SGPLAN zone, you need at least N G1 movements, or at least 1 circle, or at least 1 drilling operation, with N = ANALYSE.ngoto = 4 by default.
  • The SGROT instruction is placed before the Nth G0 or the1stG1,with N = ANALYSE.nrapid = 2 by default.

Related variables:

  • ANALYSE.mode= 0 or 1
  • ANALYSE.naxis= 4
  • ANALYSE.ngoto= 4
  • ANALYSE.nrapid= 2

Macro call: Yes

Example: INIT macro

$$ INITGL
SEARCH / START
$$
IF ( MACHIN.type ) SGTMP / SGP.output ".tmp"
$$
RENAME / SGP.output ".iso"
$$
number = STRVAL(STRGET(PART.no,1))
IF ( number = 0 ) number = 1
IF ( STRLEN(SOT.char) ) WRITE / SOT.char WRITE / "O" FORMAT(2,number) " (" PART.no " )"
$$

SGUGV

Grammar:

SGUGV / val1 where val1 = 1 or 3 or 5

Action:

Instruction added by the SGTMP function before G1 movements.

  • val1 = 1: the following movements are drilling cycles
  • val1 = 3: the following G1 movements are with a constant axis
  • val1 = 5: the following G1 movements are variable-axis

This instruction enables the appropriate high-speed mode based on the type of movement.

Related variables: SGUGV.val= val1

Macro call: yes

Example: Enabling UGV for FANUC

$$ SGUGV
$$
IF ( VAL("VALUE",1) = 1 ) THEN IF ( UGV.on ) UGV / OFF
ELSE IF ( VAL("VALUE",1) = 3 ) IF ( UGV.on = 0 ) UGV / ON ELSE IF ( VAL("VALUE",1) = 5 ) IF ( UGV.on ) UGV / OFF
ENDIF
$$

SLOWDN

Grammar:

SLOWDN / ON 
SLOWDN / OFF
SLOWDN / val1,val2

Action:

Manages the feed rate calculation process for circular interpolation when the radius correction is active. The calculated feed rate depends on the circle’s radius, the current tool radius, the direction of the circle, and the correction mode. The calculated feed rate must be between val1 and val2.

  • ON: Enables the process
  • OF: Deactivates this process
  • val1: minimum allowed feed rate
  • val2: maximum allowed feed rate

Related variables:

  • SLOWDN.on
  • SLOWDN.fedmin = val1
  • SLOWDN.fedmax = val2

Macro call: yes

SMOOTH

Syntax:

SMOOTH / ON, on 
SMOOTH / OFF
SMOOTH / val1,val2,val3,val4

Action:

  • OFF: Disables this process
  • ON,on: Enables the process

Ifon = 1, linear smoothing: removal of displacement points aligned under the same process conditions.

If on = 2, linear or angular smoothing: removal of aligned displacement points or successive angulardisplacements with the same technological conditions in the case of kinematics with a rotary table. Linearization remains active on the other rotary axes.

  • val: linear smoothing tolerance in G1
  • val2: maximumangular smoothing deviation
  • val3: angularsmoothing tolerance
  • val4: linear smoothing tolerance in G0
  • SMOOTH.mode = 0: smoothing of all axes in G0 and G1
  • 1: smoothing of all axes in G0
  • 2: smoothing of all axes in G1
  • 3: smoothing of axes other than the table in G0 and G1

Related variables:

  • SMOOTH.on
  • SMOOTH.tol[1] = val1 (default = 0.001)
  • SMOOTH.tol[2] = val2 (default = 80°)
  • SMOOTH.tol[3] = val3 (default = 0.001)
  • SMOOTH.tol[4] = val4 (default = 0.01)
  • SMOOH.mode (default = 0)

Macro call: yes

SPINDL

Syntax:

SPINDL / TYPE , n

Action:

  • If n = 1 Milling spindle activation.
  • If n = 2 Turn spindle activation.

There are two types of spindle data:

  • If n = 1, the associated spindle codes for M3, M4, and M5 are MCODE.val[3-4]
  • If n = 2, the associated spindle codes are MCODE.val[33-35]

Related variables:

  • SPINDL.type= 0, 1, 2
  • SPINDL.on= 0 = M5, 1 = M3 or M4, 2 = M19
  • SPINDL.mode = 1 (SMM) or 2 (RPM)
  • SPINDL.sens = 0 for M3, 1 for M4
  • SPINDL.val = rotation value
  • SPIND.maxrpm = programmed maximum speed
  • SPINDL.max = defined maximum speed

Macro call: no

STATIC

Syntax:

STATIC / variable1, variable2, variable3 …, variablen

Action:

Defines the variables as local to the macro. This allows the same variable to be used in multiple macros to avoid conflicts.

Affected variables: none

Example: loop index

STATIC / i, j LOOP(i,1,1,3)
LOOP(j,1,1,3)
GOTO / x[i], y[j], z ENDLOOP
ENDLOOP

SYSTEM

Grammar:

SYSTEM / ‘system command to execute’

Action:

Execution of the system command at the end of processing.

Relevant variables: none

Example: Copying files to another directory

text1 = STRGET(PART.no,1) text2 = STRGET(PART.no,2)
RENAME / text2 "/" text1
$$
name1 = "/BD/ISO-catia/forest/" text2 "/" text1 name2 = "/BD/ISO/"	text2 "/" text1
SYSTEM / "mkdir /BD/ISO/" text2 " ;cp " name1 " " name2

SYSTEMX

Grammar:

SYSTEMX / ‘system command to execute’

Action:

Immediate execution of the system command

Relevant variables: none

Example: see SYSTEM