Arithmetic and variables, 2 arithmetic and variables, Operating instructions – Parker Products COMPAX-M /-S (L) User Manual

Page 114: Compax-m / -s

Advertising
background image

Operating Instructions

COMPAX-M / -S

Arithmetic

114

8.4.30.2 Arithmetic and variables

Values can be linked with one another using the four basic types of calculation and
the result can be assigned to a parameter or a variable.

A simple arithmetic term is:

<Operand> <Operator> <Operand>

P10+10; V1-S1; 2*P13; P13/P14;

V7\V3; S12%P40

<Befehl> <Operand>

POSA .V10; SPEED .V30; ...

Operations are not allowed after commands; use variables instead for such cases,
e.g..

N001: V001= S1 + 100.5

not allowed

: POSA S1 + 100.5

N002: POSA .V001

Function

Example:

+

for addition

P10+10

-

for subtraction

V1-S1

*

for multiplication

2 * P13

/

for division

P13/P14

\

for whole number division
(formation of the whole number
component)

V7\V3

: where V7=30 and V3=7, the result

is:
V7\V3=4
V7/V3=4.2857...; whole number
component= 4

%

for the formation of the division
remainder (Modulo)

S12%P40

with S12=30 and P40=7, the

result is:
S12%P40=2
S12/P40=4 remainder 2; division remainder
= 2

The following operands may be used:

constants,

parameters,

status values, (S1-S15, S30, S40ff)

variables (V1-V39); after commands with preceding point (full stop): POSA .V1

Not all status values can be used as operands.
Status values S01 to S15, S30, and S40ff are permitted.

In addition to the 10 user parameters P40 to P49, 39 variables V1-V39 are
available. V0 is used for global assigning of a value to all variables.
The variables are automatically buffer-stored in the ZPRAM, i.e. after Power On
they contain the old value.

When the cam controller is switched off (V50=0), it is possible to use the variables
V51 ... V70 as free variables

After commands the variables (like user parameters P40 to P49) are
preceded by a "point" (full stop): POSA .V1, ACCEL .V22

V0 is used for globally assigning a value to all variables.
Example:
V0=0: V1...V70=0
V0=17: V1...V70=17

With the instruction V0=x, variables V50 ... V70 and therefore the settings of the
cam controller are also changed!

Syntax:

Operators:

Operands

Status values:

Variables:

Note:

Note:

Global assignment:

Note!

POSA

POSR

SPEED

ACCEL

OUTPUT

Password

SPEED

SYNC

Mark

reference

POSR

SPEED

POSR

OUTPUT

Cam

controller

WAIT

GOTO

GOSUB

RETURN

END

REPEAT

IF I..

Comparison

WAIT Start

GOTO /

GOSUB EXT

IF Error/ Stop

Arithmetic

Position

monitoring

Idle display

Speed

monitoring

Engage /

disengage

brake / final

stage

Variable

voltage

Advertising