Denso RC5 Especificações Página 64

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 692
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 63
2-2
2.1.1 Calling a Subroutine
To use the same program at different positions in one program describe the
process as a subroutine. The subroutine can be used by calling it from the
different positions.
The subroutine must be described in the same file as the calling program.
If a subroutine is called using a GOSUB statement, control moves to the
subroutine. If control executes a RETURN statement on the last line of the
subroutine, it returns to the next line of the program that called the subroutine.
A subroutine can be called from another subroutine.
Because the subroutine is in the same file as the calling program, local
variables are common. Therefore, variables do not have to be transferred
when the subroutine is called. However, it cannot be called from other files
and it cannot be directly started from the pendant or an external device either.
Main routine
(Calling routine)
Main routine
(Calling routine)
Subroutine 1
Subroutine 1
Subroutine 2
Program example 1
Calls same program
many times.
Program example 2
Calls other subroutine from a
subroutine.
Fig. 2-2 Calling a Subroutine
Vista de página 63
1 2 ... 59 60 61 62 63 64 65 66 67 68 69 ... 691 692

Comentários a estes Manuais

Sem comentários