Siemens SINUMERIK 840D sl Programming Manual page 172

Job planning
Hide thumbs Also See for SINUMERIK 840D sl:
Table of Contents

Advertisement

Flexible NC programming
1.25 Subprogram technique
Checking the transfer parameters
System variable $P_SUBPAR [ n ] where n = 1, 2, etc., can be used to check whether a
parameter has been transferred explicitly or left out in the subprogram. The index n refers to
the sequence of the formal parameters. Index n = 1 refers to the first formal parameter, index
n = 2 to the second formal parameter, and so on.
The following program excerpt shows an example of how a check can be performed based
on the first formal parameter:
Programming
PROC SUB_PROG (REAL X, REAL Y, REAL Z)
N20 IF $P_SUBPAR[1]==TRUE
...
N40 ELSE
...
N60 ENDIF
...
N100 RET
172
Comment
; Formal parameters: X, Y, and Z
; Check of the first formal parameter
X.
; These actions are taken if the formal
parameter X has been transferred
explicitly.
; These actions are taken if the formal
parameter X has not been transferred.
; General actions
Programming Manual, 06/2009, 6FC5398-2BP20-0BA0
Job Planning

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sinumerik 828dSinumerik 840de sl

Table of Contents