Ch05_DescriptionOfFunctionList.pdf
(
261 KB
)
Pobierz
Microsoft Word - 5-1-5-7_fp.DOC
Chapter 5 Descriptions of Function Instructions
5.1
The Format of Function Instructions
In this chapter we will introduce the function instructions of FBs-PLC in details. All the explanations for each function will
be divided into four parts including input control, instruction number/name, operand and function output. If use the FP-07
to input the mnemonic instruction, except for the T, C, SET, RST and SFC instructions that can be entered directly by
pressing a single key stroke on FP-07, other function instructions must be entered by key in the instruction number rather
than the instruction name. An example is shown in below.
Ladder Diagram
FP-07 Mnemonic code
Example 1: Single input instruction
15
FUN
15
D
:
R 0
Operation control
EN
(+1)
R
0
CY Carry(FO0)
Example 2: Multiple input instruction
Clock
CK
7.UDCTR
CV :
R
0
CUP
Count-Up(FO0)
FUN 7
CV:
R 0
PV:
10
Up/Down count
U/D
PV :
10
Clear control
CLR
Remark:The words inside the hollow box in mnemonic code field are the prompting message from FP-07 such as
D:
,
CV:
, and
Pr:
and are not entered by the user.
5.1.1
Input Control
Except for the seven function instructions that do not have input control, the number of the input control of other FBs-PLC
function instructions can be ranged from one to four. Execution of the instructions and operations is dependent on the
input control signal or the combinations of the several input control signals. The ladder programming software for FACON
PLC - Winprollader can help user to complete the complex design and document works. In the ladder program window we
can see all the function instructions were displayed by blocks surrounded with abbreviated words for ease of
comprehension, include inputs, outs, function name, and parameter names. As shown in example 2 above, the first input
mark "CK
↑
" indicates when the "CK
↑
" input changes from 0 to 1 (rising edge) the counter will be increased or
decreased by 1 (depending on the "U/D" status). The second input mark "U/D" with a status of 1 represents the word
above slash ("U") and the status 0 represents the word under slash ("D"), that is second input "U/D" states =1, the counter
will be increased by 1 when "CK
↑
" input from 0 to 1, and when "U/D"=0, the counter will be decreased by 1. The third
input mark "CLR" indicates when this input is 1, the counter will be cleared to 0. Chapter 8~9 give the descriptions of input
control of each function instruction.
Remark: There are total of seven instructions whose input control should be directly connected to the origin-line
those are MCE, SKPE, LBL, RTS, RTI, FOR, and NEXT. Please refer to chapter 6 and 7 for more
detailed explanations.
5-1
All input controls of the function instructions should be connected by the corresponding elements, otherwise a syntax
error will occur. As shown in example 3 below, the function instruction FUN7 has three inputs and three elements before
FUN7. ORG X0, LD X1 and LD X2 corresponds to the first input CK
↑
, second input U/D and third input CLR.
Example 3:
Ladder Diagram
FP-07 Mnemonic code
X0
7.UDCTR
CV :
ORG X 0
LD
X 1
LD
X 2
FUN
7
CK
R
0
CUP
FUN7 need three
elements because
it has three inputs
X1
U/D
PV :
10
CV :
R
0
PV :
10
X2
CLR
5.1.2 Instruction Number and Derivative Instructions
As mentioned before, except for the nine instructions that can be entered using the dedicated keys on the keyboard, other
function instructions must be entered using the "instruction number”. Follow the instruction number there are postfixes D,
P, DP can be added which can derive three additional function instructions.
D: Indicates a Double Word (32-bit). The 16-bit word is the basic unit of the registers in FBs-PLC. The data length of R, T
and C (except C200~C255) registers are 16-bit. If a register with 32-bit data length is required, then it is necessary to
combine two consecutive 16-bit registers together such as R1-R0, R3-R2 etc. and those registers are represented by
prefix a D letter before register name such as DR0 represents R1-R0 and DR2 represents R3-R2. If you enter DR0 or
DWY8 in the monitor mode of FP-07, then a 32-bit long value (R1-R0 or WY24-WY8) will be displayed.
B31
B16 B15
B0
DR0 =R1−R0
R1
R0
↑
↑
High Word register
Low Word register
B31
B16 B15
B0
DWY8 =WY24−WY8
WY24
WY8
=Y39
~
Y8
↑
↑
High Word register
Low Word register
5-2
Remark: In order to differentiate between 16-bit and 32-bit instructions while using the ladder diagram and
mnemonic code, we add the postfix letter D after the "Instruction number" to represent 32-bit instructions
and the size of their operand are 32-bit as shown in example 4 on P.6-6. The instruction FUN 11D has a
postfix letter D, therefore the source and destination operands need to prefix a letter D as well, such as
the augend Sa : R0 is actually Sa=DR0=R1-R0 and Sb=DR2=R3-R2. Please also pay special attention to
the length of the other operands except source and destination are only one word whether 16-bit or 32-bit
instructions are used.
P: indicates the pulse mode instruction. The instruction will be executed when the status of input control changes from 0
to1 (rising edge). As shown in example 1, if a postfix letter P is added to the instruction (FUN 15P), the instruction FUN
15P will only be executed when the status of input control signal changes from 0 to 1. The execution of the instruction
is in level mode if it does not have a P postfix, this means the instruction will be executed for every scan until the status
of input control changes from 1 to 0. The pulse input is indicated by a symbol "
↑
", such as CK
↑
, EN
↑
, TG
↑
etc.. In
this operation manual, an example of the operation statement of a function instruction is shown below.
●
When the operation control
〝
EN
〞
=1 or
〝
EN
↑〞(
P
instruction
)
from 0
→
1,
………
The first one indicates the execution requirement for non-P instruction (level mode) and the second one indicates the
execution requirement for P instruction (pulse mode). The following waveform shows the result (R0) of FUN15 and
FUN15P under the same input condition.
t is the scan time
t
t
t
t
t
t
t
t
t
t
Input control
1
Executes the FUN15P
2
(R0 initial is 0)
0001H
0002H
Executes the FUN15
3
(R0 initial is 0)
0001H 0002H
0003H
0004H
0005H
0006H
DP: Indicates the instruction is a 32-bit instruction operating with pulse mode.
Remark: P instruction is much more time saving than level instruction in program scanning, So user should use P
instruction as much as possible.
5.1.3
Operand
The operand is used for data reference and storage. The data of source (S) operand are only for reference and will not be
changed with the execution of the instruction. The destination (D) operand is used to store the result of operation and its
data may be changed after the execution of the instruction. The following table illustrates the names and functions of
FACON PLC function instruction's operands and types of contacts, coils, or registers that can be used as an operand.
5-3
The names and functions of the major operands:
Abbreviation
Name
Descriptions
S
Source
The data of source (S) operand are only for reading and reference and will not be
changed with the execution of the instruction. If there are more than one source
operands, each operand will be identified by the footnote such as Sa and Sb.
D
Destination
The destination (D) operand is used to store the result of operation. The original data
will be changed after operation. Only the coils and registers which are not write
prohibited can be the destination operand.
L
Length
Indicates the data size or the length of the table, usually are constants.
N
Number
A constant most often used as numbers and times. If there are more than one
constant, each constant will be identified by the footnotes such as Na, Nb, Ns etc..
Pr
Pointer
Used to point to a specific a block of data or a specific data or register in a table.
Generally the Pr value can be varied, therefore cannot be constant or input register.
(R3840~R3847)
CV
Current value
Used in T and C instruction to store the current value of T or C
PV
Set value
Used in T and C instructions for reference and comparison
T
Table
A combination of a set of consecutive registers forms a table. The basic operation
units are word and double word. If there is more than one table, each table will be
identified by footnotes such as Ta, Tb, Ts and Td etc..
M
Matrix
A combination of a set of consecutive registers forms a matrix. The basic operation
unit is bit. If there is more than one matrix, each matrix will be identified by footnotes
such as Ma, Mb, Ms and Md etc..
Besides the major operands mentioned above, there are other operands which are used for certain special purposes such
as the operand Fr for frequency, ST for stack, QU for Queue etc.. Please refer to the instruction descriptions for more
details.
The types of the operand and their range: The types of operand for the function instructions are discrete, register
and constant.
a) Discrete operand :
There are total five function instructions that reference the discrete operand, namely SET, RST, DIFU, DIFD
and TOGG. Those five instructions can only be used for operations of Y
(external output), M
the five function instructions.
(step) relays. The table shown below indicates the operands and ranges of
Range
Y
M
SM
S
Symbol "O" indicates the D (Destination operand) can use this type of
coils as operands. The "*" sign above the "O" shown in SM column
indicates that should exclude the write prohibited relays as operands.
Please refer to page I2-8 for introduction of the special relays.
Ope-
rand
S0
∣
S999
D
○
○
○
*
○
Y0
∣
Y255
M0
∣
M1911
M1912
∣
M2001
b) Register operand :
The major operand for function instructions is register operand. There are two types of register operands: the
native registers which already is of Words or Double Words data such as R, D, T, C. The other is derivative
registers (WX, WY, WM, WS) which are formed by discrete bits. The types of registers that can be used as
instruction operands and their ranges are all listed in the following table:
5-4
(internal and special) and S
Range
WX WY
WM
WS TMR CTR HR
IR OR SR ROR DR
K
XR
Ope-
rand
WX0
∣
WX240
WY0
∣
WY240
WM0
∣
WM1896
WS0
∣
WS984
T0
∣
T255
C0
∣
C255
R0
∣
R3839
R3840
∣
R3903
R3904
∣
R3967
R3968
∣
R4167
R5000
∣
R8071
D0
∣
D4095
16/32-bit
V
、
Z
P0~P9
+/- number
S
○
○
○
○
○ ○ ○ ○ ○ ○ ○
*
○ ○
○
D
○
○
○
○ ○ ○
○ ○
*
○
*
○
○
The "
○
" symbol in the table indicates can apply this kind of data as operand. The "
○
*" symbol indicates can apply this
kind of data except the write prohibited registers as operand. To learn more about write prohibited registers please refer
to page 3-6 for introduction of the special register.
When R5000
~
R8071 are not set to be read only registers, can used as normal registers (read, and write)
Remark 1: The registers with a prefix W, such as WX, WY, WM and WS are formed by 16 bits. For example, WX0
means the register is formed by X0(bit 0)~X15(bit 15). WY144 means the register is formed by Y144(bit
0)~Y159(bit 15). Please note that the discrete number must be the multiple of 8 such as 0, 8, 16, 24....
Remark 2: The last register (Word) in a table can not be represented as a 32-bit operand in the function because 2
Words are required for a 32-bit operand.
Remark 3: TMR(T0~T255)and CTR(C0~C255)are the registers of timers and counters respectively. Although
they can be used as general registers, they also complicate the systems and make debugging more
difficult. Therefore you should avoid writing anything into the TMR or CTR registers.
Remark 4: T0~T255 and C0~C199 are 16-bit register. But C200~C255 are 32-bit register, therefore can’t be
used as 16-bit operands.
Remark 5: Apart from being directly appointed by register’s number (address) as the foregoing discussions, the
register’s operand in the range of R0~R8071 can be combined with pointer register V or Z to make
indirect addressing. Please refer to the example in the next section (Section 5.2) for the description of
using pointer register (XR) to make indirect addressing.
c) Constantoperands:
The range of 16-bit constant is between -32768~32767. The range of 32-bit constant is between
-2147483648~2147483647. The constant for several function instructions can only be a positive constant. The
range of 16-bit and 32-bit constants are listed in the table shown below.
Classification
Range
16-bit signed number
-32768
~
32767
16-bit un-signed number
0
~
32767
32-bit signed number
-2147483648
~
2147483647
32-bit un-signed number
0
~
2147483647
16/32-bit signed number
-32768
~
32767 or
-2147483648
~
2147483647
16/32-bit un-signed number
0
~
32767 or
0
~
2147483647
It is possible that the length and size of a specific operand, such as L, bit size, N etc.., are different, and the
differences are all directly marked at the operand column. Please refer to the explanations of function
instructions
.
5-5
•
•
•
Plik z chomika:
artibe22
Inne pliki z tego folderu:
winproladder-tutorial.pdf
(760 KB)
Ch08_Test_Run_Monitoring.pdf
(168 KB)
Ch08_Step_Instruction_Description.pdf
(630 KB)
Ch07_Digital_Outputs.pdf
(290 KB)
Ch07_Advanced_Function_List.pdf
(2187 KB)
Inne foldery tego chomika:
Pliki dostępne do 09.04.2026
Benedikt
BHP
Dokumenty
Elektronika
Zgłoś jeśli
naruszono regulamin