Epson RC170 Guia do Utilizador Página 169

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 312
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 168
6. The SPEL+ Language
6.1 Overview
SPEL
+
is a BASIC-like programming language that runs in the controller. It supports
multitasking, motion control, I/O control.
Programs are written in ASCII text and then compiled into executable object files.
Several language instructions can also be executed in immediate mode from the Command
window.
6.2 Program structure
6.2.1 What is a SPEL+ program?
A SPEL+ program is a collection of functions, variables, and macros. Each line in a
program is a statement. The program statements are stored in one or more program text
files. Every program file has a .PRG extension and resides in the project directory on the
PC and optionally in the controller.
Each project must contain at least one program and there must be one function called
"main". This is the default function. A compile error will occur if function main is not
found.
In addition, seven more programs can be defined in the same project. Each program has its
own start function: main1, main2…main7. Each of the eight programs can be started from
the Operator window, from the remote console, or from VB Guide.
A function definition begins with the Function statement and ends with the Fend statement.
All source statements to be executed by a function must be included within the body of the
function.
The following program file contains two function definitions. Function Main calls
function Func1.
MAIN.PRG
Function Main
Call Func1
...
Fend
Function Func1
Jump pickpnt
...
Fend
6.2.2 Calling functions
You can execute a user function by using the Call statement. The function can reside in
any program file in the current project. To get a return value, you must use the function as
an argument in a statement. You can also omit the Call statement if you don't need the
return value. When Call is omitted, then parentheses for the arguments must not be
supplied
Here are some examples:
Call MyFunc(1, 2)
MyFunc 1, 2
Print MyFunc(1, 2)
EPSON RC+ 5.0 (Ver.5.4) User's Guide Rev.4 151
Vista de página 168
1 2 ... 164 165 166 167 168 169 170 171 172 173 174 ... 311 312

Comentários a estes Manuais

Sem comentários