Program Control Instructions; Entry And End Statements; Sub And End Sub Statements - Hitachi SJ700-2 Series Instruction Manual

Easy-sequence programming software ezsq
Hide thumbs Also See for SJ700-2 Series:
Table of Contents

Advertisement

Chapter 5 Instruction Words

5.2 Program Control Instructions

This section explains the details of program control instructions.

entry and end statements

- Format
Format
entry
end
- Explanation
The entry and end statements indicate the beginning and end of the main program, respectively. Each
program always requires these instructions.
- Sample program
entry
    :
FW =
1
wait
10.00
stop
wait
10.00
    :
end

sub and end sub statements

- Format
Format
sub <subroutine name>
end sub
- Explanation
The sub and end sub statements indicate the beginning and end of a subroutine, respectively.
<subroutine name>: Specifies the name of a called subroutine. This subroutine name is the first
argument (branch destination) of the call instruction in the calling routine.
Note: Subroutines can be nested in up to eight layers. A subroutine programmed with a structured
instruction (i.e., sub, for, while, until, select, or ifs) is counted as one nesting layer. Therefore, when
a for-next loop statement is described in a subroutine, there are two nesting layers.
- Sample program
sub
sub1
    :
FW =
1
wait
10.00
stop
wait
10.00
    :
end sub
Instructions to start and end the main program
This instruction indicates the beginning of the main program.
(This instruction must be described at the top of the main program.)
This instruction indicates the end of the main program.
: The main program begins.
: Start forward rotation of the motor.
: Wait 10 seconds.
: Stop inverter output.
: Wait 10 seconds.
: The main program ends.
Instructions to start and end a subroutine
This instruction indicates the beginning of a subroutine.
This instruction indicates the end of a subroutine.
Control is returned to the calling routine.
: Subroutine "sub1" begins.
: Start forward rotation of the motor.
: Wait 10 seconds.
: Stop inverter output.
: Wait 10 seconds.
: Subroutine "sub1" ends.
5 - 4
Description
Description

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sj700 series

Table of Contents