Parker Hannifin S.p.A. - Divisione S.B.C. LVD User’s Manual
64
OPERATIONAL DESCRIPTION
The Pico-PLC program is scanned every 6.144 msec; at each sampling first the inputs are read,
then the two timers are updated (Pr92 Pr93 b99.0 and b99.1), the user program is scanned, and
finally the outputs are updated. Therefore, reading of the inputs and output updates can deviate
temporally by up to 6.144 mS with respect to the physical event. If the microprocessor workload is
excessive (operational mode active, frequent serial line demands, long PLC program) scanning of
the entire PLC program could take longer than 6.144 msec.
All pico-PLC instructions with the exception of mathematical instructions, operate on single bits;
moreover, available stack depth is a single bit.
Instruction LD (LDN) loads the bit defined as operand into the stack, while all other logical
instructions operate on the stack. Mathematical operations are executed only if the stack bit is at 1.
The following logic operations truth tables are provided for the user's convenience:
The relative inverted ANDN and ORN operations follow the same logic, except they use the
inverted value of the specified bit.
There are 8 bits with save facility from b90.8 to b90.15 reserved for the PLC; a further 8 bits
from b91.8 to b91.15 are available for the PLC; these are not stored and are always at zero at drive
power-up.
Also 10 word parameters are reserved, specifically from Pr80 to Pr89 with save facility and
option for use as 5 double word parameters. For mathematical operations the pico-PLC has 9
constants available, from Pr71 to Pr79 selected from those that are most frequently utilised in
standard applications.
When using mathematical instructions (ADD, SUB, MUL, DIV) note that operators are assumed
as words with their relative signs. If a double word operation is necessary, parameter b94.0 must be
set to 1 before the operation; after the operation the PLC will automatically set the bit to zero.
Parameters Pr60...Pr69 are considered as double words so an operation like [ADD 71 72 64] will
write the result -1 in the double word Pr64:65 without having to set b94.0=1 before the operation. If
Pr80=-1 and Pr81=0, the operation [ADD 80 72 64] will give the result Pr64:65=-1, while the same
operation performed with b94.0=1 will assume Pr81 as the high part of the double word Pr80:81 so
the result will be Pr64:65=65535. In the first case, therefore, operands other than Pr60...Pr69 are
treated as words, while in the second case they are treated as double words.
Note that in mathematical operations on double words, operands and results are defined as
follows: the operand parameter defines the least significant part while the most significant part is
represented by the word with the next serial address (see chapter Serial addresses and parameter
lengths). Parameters from Pr50 to Pr69 and from Pr80 to Pr89 are successive.
At the completion of each mathematical operation b99.2 is set to 0 if the result is positive, and to
1 if the result is negative; likewise, b99.3=0 if the result is zero and b99.3=1 if it is different from
zero. These settings remain valid until the next mathematical operation is performed (the operation
is executed only if the stack bit is equal to one). A mathematical operation can be performed, setting
the result in one of the constant parameters (Pr71...Pr79) in order to set bits b99.2 and b99.3.
In the case of the DIV operation, if it is executed on a double word the most significant part of
the result contains the remainder of the division, i.e. if you set b94.0=1 and perform [DIV 79 77 80]
the result will be Pr80=4 and Pr81=96.
logical AND operation
bit A bit B result
0 0 0
0 1 0
1 0 0
1 1 1
logical OR operation
bit A bit B result
0 0 0
0 1 1
1 0 1
1 1 1