S.B.C. Elettronica S.p.A. - Engineering Division
HPDxxN – High Power User’s Manual
54
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 have 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 will be treated as words, while in the second case they will be 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 rest 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.
Note that parameters Pr23, Pr24, Pr25, Pr26, Pr27, Pr29, Pr31 and Pr34 are bytes like Pb42
and Pb94; therefore, these parameters cannot be used for mathematical operations; logical
operations must be used to alter their values.
FIN instruction.
Three instructions are provided for high speed input acquisition: in this case the
scan is executed at 512
µ
s (normal scanning is 6.144mS). If used, FIN instructions must be the first
PLC instructions. The first FIN instruction copies digital input 1 into bit y of parameter Pb40 (second
operand=0) or Pb70 (second operand =1). The second FIN instruction copies digital input 2 into bit
y of parameter Pb40 (second operand=0) or Pb70 (second operand=1). The third FIN instruction
logical AND operations
bit A
bit B
result
0
0
0
0
1
0
1
0
0
1
1
1
logical OR operations
bit A
bit B
result
0
0
0
0
1
1
1
0
1
1
1
1