Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
SYPT PRO User Guide / SYPT PRO User Guide.doc
Скачиваний:
244
Добавлен:
03.03.2016
Размер:
17.32 Mб
Скачать

Comments

Comments can be used to document the purpose of a program. They have no affect on the run-time operation of the program.

In DPL comments begin with either // or ; and continue to the end of the line. The following code fragment shows examples of comments.

See Also

  • Notes/ Description Section

  • DPL (Drive Programming Language) Reference

________________________________________________________________________________

Constructs

This section defines the DPL constructs such as assignment statements and loops.

In DPL the end of a text line is used as the statement delimiter. This means that it is not possible to place two statements on one line. For example:

A% = 1

B% = 23

is valid and will compile, but:

A% = 1 B% = 23

is invalid and will not compile.

For more information, see:

  • Variable Assignment

  • Array Element Assignment

  • Parameter Assignment

  • #INT Parameter Assignment

  • Parameter Pointer Assignment

  • DO WHILE Loop

  • EXIT

  • IF ... THEN

  • FOR Loop

  • Function Block Call

  • GOTO

  • SELECT

  • Subroutine Call

________________________________________________________________________________

Variable Assignment

A variable assignment construct copies an expression value into a non-array variable.

Target/ Language Restrictions

None.

See Also

  • Constructs

  • Array Element Assignment

________________________________________________________________________________

Array Element Assignment

An array element assignment construct copies an expression value into a single element in an array variable.

Target/ Language Restrictions

None.

See Also

  • Constructs

  • Variable Assignment

Parameter Assignment

A parameter assignment construct copies an expression value into a parameter

Target/ Language Restrictions

None.

See Also

  • Constructs

  • Variable Assignment

  • Parameters

  • #INT Parameter Assignment

________________________________________________________________________________

#INT Parameter Assignment

A #INT (or cast) parameter assignment construct copies an integer expression value into a parameter. The actual value written into the parameter depends on the number of decimal places defined for the parameter.

Target/ Language Restrictions

None.

See Also

  • Constructs

  • Variable Assignment

  • Parameter Assignment

  • Parameters

Parameter Pointer Assignment

A Parameter Pointer assignment construct copies an integer expression value into a parameter indexed by an integer variable.

The value of Variable% is used to identify a parameter. The value should be in the format MMPP, e.g 121 specifies parameter #1.21.

Example

Target/ Language Restrictions

None.

See Also

  • Constructs

  • Variable Assignment

  • Parameter Assignment

  • #INT Parameter Assignment

  • Parameters

________________________________________________________________________________

DO WHILE Loop

This construct performs a loop while a condition is true. These are three syntaxes for the WHILE loop.

Syntax 1 evaluates the condition first before any statements are executed. If the condition is false, the statements are not executed. If the condition is true the statements are executed and will continue to be executed as long as the condition is true.

Syntax 2 executes the statements once regardless of whether the condition is true. The statements will then continue to be executed until the condition becomes false.

Syntax 3 loops while the condition is true.

Target/ Language Restrictions

None.

See Also

  • Constructs

________________________________________________________________________________

EXIT

The EXIT statement is a flow-control statement which causes execution of a task to finish.

Note:

If the task is a real-time task (CLOCK, POS0 etc), the task will continue to be scheduled at its defined rate.

Example

Target/ Language Restrictions

None.

See Also

  • Constructs

  • IF ... THEN

_______________________________________________________________________________