S.B.C. Elettronica S.p.A. - Engineering Division
HPDxxN – High Power User’s Manual
76
The memory area available for PLC instructions is 128 bytes, with addresses from 0h to 7Fh.
As the minimum length for each instruction is 2 bytes, the PLC program can hold a maximum of
64 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
Pr.40, b4=1 refers to Pr.70; the sixth bit (b5) of the first byte is used for negative logic 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 forward or, anyway, after any other instruction, it will be ignored
(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 Pr.31 (operating mode), and that the value of this
parameter is 9; assume the drive serial address is 0. The message to transmit is:
[$7E][$80][$01][$54][$D5]
The drive answers with the message:
[$7E][$20][$01][$54][$09][$7E][$00]
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