Adoption of block number when subroutine is called (P-CHAN-00150)

P-CHAN-00150

Adopt block number 'N..' when subroutine is called

Description

When a subroutine is called, the internal value of the last block number read is set to zero in the basic setting.

As a result, a read access supplies the value 0 at the start of this subroutine via the variable V.G.BLOCK_NR.

When the parameter (1) is set, the value of the last block number read from the superior (main) program is retained internally when the subroutine is called.

The variable V.G.BLOCK_NR supplies a value > 0 as a result (when block numbers are used).

Parameter

remain_block_number_sub_prog_call

Data type

BOOLEAN

Data range

0: Internal value of the last block number programmed is set to zero at subroutine call.

1: Internal value of the last block number programmed is retained at subroutine call.

Dimension

----

Default value

0

Remarks

Programming example:

when remain_block_number_sub_prog_call     0

:

N1000 X100 Y200 Z300

N1010 LL SUB1.NC

-> V.G.BLOCK_NR access at start of SUB1.NC supplies 0 0

when remain_block_number_sub_prog_call     1

:

N1000 X100 Y200 Z300

N1010 LL SUB1.NC

-> V.G.BLOCK_NR access at start of SUB1.NC supplies 0 1010