Siemens SINUMERIK 828D Programming Manual page 160

Hide thumbs Also See for SINUMERIK 828D:
Table of Contents

Advertisement

Flexible NC programming
1.25 Subprogram technique
Syntax
PROC <program name> (VAR <parameter type> <parameter name>, etc.)
PROC <program name> (VAR <array type> <array name>, [<m>,<n>,<o>],
etc.)
Significance
PROC
VAR
<program name>
<parameter type>
<parameter name>
<array type>
<array name>
[<m>,<n>,<o>]
NOTICE
The program name specified after the
assigned on the user interface.
Note
With arrays of an undefined array length, subprograms can process arrays of variable length
as formal parameter. When defining a two-dimensional array as a formal parameter, for
example, the length of the 1st dimension is not specified. However, the comma must be
written.
Example:
Example
Definition of a subprogram with 2 parameters as reference to REAL type:
Program code
PROC SUB_PROG(VAR REAL LENGTH, VAR REAL WIDTH)
...
N100 RET
160
:
:
:
:
:
:
:
:
PROC <program name> (VAR REAL ARRAY[,5])
Definition operation at the beginning of a program
Keyword for parameter transfer via reference
Name of the program
Data type of the parameter (e.g. REAL, INT, BOOL)
Name of the parameter
Data type of the array elements (e.g. REAL, INT, BOOL)
Name of the array
Array size
Currently, up to 3-dimensional arrays are possible:
:
Array size for 1st dimension
<m>
:
Array size for 2nd dimension
<n>
:
Array size for 3rd dimension
<o>
keyword must match the program name
PROC
Comment
; Parameter 1: Reference to type: REAL,
name: LENGTH
Parameter 2: Reference to type: REAL,
name: WIDTH
Programming Manual, 07/2010, 6FC5398-2BP40-0BA0
Job planning

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents