
Parker Hannifin S.p.A. - Divisione S.B.C. LVD User’s Manual
78
The memory area available for PLC instructions is 256 bytes, with addresses from 0h to
FFh.
As the minimum length for each instruction is 2 bytes, the PLC program can hold a
maximum of 128 instructions.
The first four bits of the first byte in each instruction (b0..b3) contain the instruction code.
For the first 8 instructions in the table (LD...ORN) and the SET and RES instructions, the
remaining 4 bits of the first byte (b4..b7) contain the value y, while the second byte contains
the value Pa.
For instructions ADD, SUB, MUL and DIV, the second byte contains the value Pa, the
third Pb, and the fourth Pc.
The second byte is not utilised for the END instruction.
For the FIN instruction the fifth bit (b4) of the first byte selects the parameter: b4=0 refers
to Pb40, b4=1 refers to Pb70; the sixth bit (b5) of the first byte is used for a logical inversion
(if required): b5=0 the bit is copied; b5=1 the bit is inverted and then copied. The second byte
of the FIN instruction contains the value of y.
If FIN instructions are used they must be the first of the program and there must be no
more than 3 so they will occupy addresses from 0h to 5h. If a FIN instruction is included from
address 6h onward or after any other instruction, it will lose its original functionality and be
disregarded (NOP).
The instructions must be one after the other starting from address 0h, without any free
bytes.
There is just one program and it terminates with the END instruction.
Serial line application examples
For a better understanding of how to implement the serial line communication protocol, we
have provided a few examples for each type of message.
The values are entered simply by way of example.
Case 1: reading a 1 byte parameter
Assume you want to read the value of parameter Pr31 (operating mode) and that the value of
the parameter is 9; assume also that the drive serial address is 0. The message to transmit is:
Instruction
code
length (bytes)
LD Pa.y
0
2
LDN Pa.y
1
2
OUT Pa.y
2
2
OUTN Pa.y
3
2
AND Pa.y
4
2
ANDN Pa.y
5
2
OR Pa.y
6
2
ORN Pa.y
7
2
ADD Pa, Pb, Pc
8
4
SUB Pa, Pb, Pc
9
4
MUL Pa, Pb, Pc
10
4
DIV Pa, Pb, Pc
11
4
SET Pa.y
12
2
RES Pa.y
13
2
FIN Pb40.y/Pb70.y
14
2
END
15
2