You are on page 1of 613

NAiS Control 1131

FP0/FP1/FP–M
NAiS Control 1131 FP0/FP1/FP–M Instruction Set
Instruction Set
Matsushita Electric Works (Europe) AG
ACGM0130END V1.1 10/1999
is a global brand name of Matsushita Electric Works.
BEFORE BEGINNING
This manual and everything described in it are copyrighted. You may not copy thi
s manual, in whole or part, without written consent of Matsushita Electric Works
(Europe) AG. Matsushita Electric Works (Europe) AG pursues a policy of continuo
us improvement of the design and performance of its products, therefore, we rese
rve the right to change the manual/product without notice. In no event will Mats
ushita Electric Works (Europe) AG be liable for direct, special, incidental, or
consequential damage resulting from any defect in the product or its documentati
on, even if advised of the possibility of such damages.
LIMITED WARRANTY
All implied warranties on the product, including merchantability and fitness, ar
e limited to one year from the date of purchase. If physical defects caused by d
istribution are found, Matsushita Electric Works (Europe) AG, will replace/repai
r the product free of charge. Exceptions include: D When physical defects are du
e to different usage/treatment of the product other than described in the manual
. D When physical defects are due to defective equipment other than the distribu
ted product. D When physical defects are due to modifications/repairs by someone
other than Matsushita Electric Works (Europe) AG. D When physical defects are d
ue to natural disasters.
EMS–DOS and Windows are registered trademarks of Microsoft Corporation. EIBM Per
sonal Computer AT is registered trademark of the International Business Machines
Corporation.
Important Symbols
The following symbols are used in this manual:
!
Whenever the warning triangle is used, especially important safety instructions
are given. If they are not adhered to, the results could be: •personal injury an
d/or •significant damage to instruments or their contents, e.g. data
+ Note ,
Contains important additional information or indicates that you should proceed w
ith caution.
Example: Contains an illustrative example of the previous text section.
* next page Indicates that the text will be continued on the next page.
Table of Contents
Part 1
Chapter 1
Basics
1.1
Operands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . 1.1.1 In– /Outputs . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.1.2 Intern
al Relays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . 1.1.3 Special Internal Relays . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . 1.1.4 Timers and Counters . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.1.5 Data Registers (
DT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.1.6 Special Data Registers (DT) . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . 1.1.7 File Registers (FL) . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . 1.1.8 Link Relays and Registers (L/LD)
. . . . . . . . . . . . . . . . . . . . . . . . . . .
1–3 1–3 1–4 1–4 1–5 1–6 1–6 1–7 1–7
1.2
Addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . 1 – 8 1.2.1 Matsushita Addresses . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 – 9 1.2.2 IEC A
ddresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . 1 – 10 Constants . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.3.1 Decimal Constant
s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.
3.2 Hexadecimal Constants . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . 1.3.3 BCD Constants . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . Data Types . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.4.1 B
OOL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . 1.4.2 INTEGER . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . 1.4.3 DOUBLE INTEGER . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.4.4 STRING .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . 1.4.5 WORD . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . 1.4.6 DOUBLE WORD . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.4.7 ARRAY . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . 1.4.8 TIME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . 1.4.9 REAL . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1 1 1 1
1 1 1 1 1 1 1 1 1 – – – – – – – – – – – – – – 13 13 13 13 14 15 15 15 16 16 16
17 22 22
1.3
1.4
Matsushita Electric Works (Europe) AG
i
Table of Contents
NAiS Control 1131
Part 2 IEC Functions
Chapter 2
Conversion Functions
(E_)BOOL_TO_INT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . 2 – 3 (E_)BOOL_TO_DINT . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2 – 5 (E_)BOOL_TO_WORD . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . 2 – 7 (E_)BOOL_TO_DWORD . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
– 9 (E_)INT_TO_BOOL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . 2 – 11 (E_)INT_TO_DINT . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . 2 – 13 (E_)INT_TO_WORD . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . 2 – 15 (E_)INT_TO_DWORD . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . (E_)INT_TO_REAL . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . (E_)INT_TO_TIME . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . (E_)INT_TO_BCD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . (E_)DINT_TO_BOOL . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (E
_)DINT_TO_INT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . (E_)DINT_TO_WORD . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (E_)DINT_TO
_TIME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . (E_)DINT_TO_DWORD . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . (E_)DINT_TO_REAL . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . (E_)DINT_TO_BCD . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . (E_)WORD_TO_BOOL . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
(E_)WORD_TO_INT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . (E_)WORD_TO_DINT . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (E_)WORD_TO
_DWORD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . (E_)WORD_TO_TIME . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . (E_)DWORD_TO_BOOL . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
(E_)DWORD_TO_INT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . (E_)DWORD_TO_DINT . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (E_)DWORD_TO_WO
RD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . (E_)DWORD_TO_TIME . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . (E_)REAL_TO_INT . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. (E_)REAL_TO_DINT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . (E_)TIME_TO_INT . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (E_)
TIME_TO_DINT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . 2 2 2 2 – – – – 17 19 21 23
2 – 25 2 – 27 2 – 29 2 – 31 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 – – – – – – – – –
– – – – – – – – 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65
(E_)TIME_TO_WORD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . 2 – 67
ii Matsushita Electric Works (Europe) AG
NAiS Control 1131
Table of Contents
(E_)TIME_TO_DWORD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . 2 – 69 (E_)TRUNC_TO_INT . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 – 71
(E_)TRUNC_TO_DINT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . 2 – 74 (E_)BCD_TO_INT . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2 – 77 (E_)BCD_TO_DINT . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . 2 – 79 (E_)REAL_TO_TIME . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . 2 – 81 (E_)TIME_TO_REAL . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . 2 – 83
Chapter 3
Numerical Functions
(E_)ABS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . 3 – 3
Chapter 4
Arithmetic Functions
(E_)MOVE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . 4 – 3 (E_)ADD . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . 4 – 5 (E_)SUB . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
– 7 (E_)MUL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . 4 – 9 (E_)DIV . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . 4 – 11 (E_)MOD . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . 4 – 13 (E_)SQRT . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 – 15 (E_)SIN . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . 4 – 18 (E_)ASIN . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . 4 – 21 (E_)COS . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 – 24 (E_)A
COS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . 4 – 27 (E_)TAN . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . 4 – 30 (E_)ATAN . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 – 33 (E
_)LN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . 4 – 36 (E_)LOG . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . 4 – 39 (E_)EXP . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
– 42 (E_)EXPT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . 4 – 45
Matsushita Electric Works (Europe) AG
iii
Table of Contents
NAiS Control 1131
Chapter 5
Process Data Type Functions
(E_)ADD_TIME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . 5 – 3 (E_)SUB_TIME . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . 5 – 5 (E_)MUL_TIME_INT . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 – 7 (E_)MUL_TIME_DINT
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . 5 – 9 (E_)MUL_TIME_REAL . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 – 11 (E_)DIV_TIME_I
NT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . 5 – 13 (E_)DIV_TIME_DINT . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 – 15 (E_)D
IV_TIME_REAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . 5 – 17
Chapter 6
Bitshift Functions
(E_)SHL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . 6 – 3 (E_)SHR . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . 6 – 6 (E_)ROL . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. 6 – 9 (E_)ROR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 – 12
Chapter 7
Bitwise Boolean Functions
(E_)AND . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . 7 – 3 (E_)OR . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . 7 – 5 (E_)XOR . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. 7 – 7 (E_)NOT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 – 9
Chapter 8
Selection Function
(E_)MAX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . 8 – 3 (E_)MIN . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . 8 – 5 (E_)LIMIT . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . 8 – 7 (E_)MUX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 – 9
iv
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Table of Contents
Chapter 9
Comparison Functions
(E_)GT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . 9 – 3 (E_)GE . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . 9 – 5 (E_)EQ . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . 9 – 7 (E_)LE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 – 9 (E_)LT . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . 9 – 11 (E_)NE . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . 9 – 13
Part 3IEC Function Blocks
Chapter 10 Bistable Function Blocks
(E_)SR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . 10 – 3 (E_)RS . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . 10 – 7
Chapter 11
Edge Detection
(E_)R_TRIG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . 11 – 3 (E_)F_TRIG . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . 11 – 6
Chapter 12 Counter
(E_)CTU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . 12 – 3 (E_)CTD . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . 12 – 7 (E_)CTUD . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 –
12
Chapter 13 Timer
(E_)TP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . 13 – 3 (E_)TON . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . 13 – 8 (E_)TOF . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
3 – 13
Matsushita Electric Works (Europe) AG
v
Table of Contents
NAiS Control 1131
Part 4 Matsushita Instructions
Chapter 14 Matsushita Instructions
CT, Down Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . 14 – 9 DF, Leading Edge Differential .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
14 – 10 DFN, Trailing Edge Diffential . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . 14 – 11 ICTL, Interrupt Control . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . JP, Jump to label . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . KEEP, Serves as a relay with s
et and reset inputs . . . . . . . . . . . . . . . . . . . . . . . LBL, Label for
the JP and LOOP Instruction . . . . . . . . . . . . . . . . . . . . . . . . . .
. . LOOP, Loop to Label . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . LSR, Left shift register . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MC, Master Control relay . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . MCE, Master Conrol Relay End . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . TM_1ms, On Delay T
imer for 0.001s Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
TM_10ms, On Delay Timer for 0.01s Units . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . TM_100ms, On Delay Timer for 0.1s Units . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . TM_1s, On Delay Timer for 1s Units . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . F0 F1 F2 F3 F5 (MV)
, 16–bit data move . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . (DMV) 32–bit data move . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . (MVN) 16–bit data inversions
and move . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (DMVN) 32–bi
t data inversions and move . . . . . . . . . . . . . . . . . . . . . . . . . . .
(BTM) Bit data move . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14
14 14 14 14 14 14 14 14 14 14 14 14 14 – – – – – – – – – – – – – – – – – – – –
– – – – – – – – – 12 14 15 16 17 18 19 20 21 23 25 27 29 30 31 32 33 34 35 36 37
39 42 43 44 45 46 47 48
F6 (DGT) Digit data move . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . F10 (BKMV) Block transfer . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . F11 (COPY) Bloc
k copy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . F12 EPRD EEPROM read from memory . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . P13 EPWT EEPROM write to memory . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . F15 (XCH) 16–bit data exchan
ge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . F16
(DXCH) 32–bit data exchange . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . F17 (SWAP) Higher/lower byte in 16–bit data exchange . . .
. . . . . . . . . . . . . . . F20 F21 F22 F23 (ADD) 16–bit addition . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (DAD
D) 32–bit addition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . (ADD2) 16–bit addition, destination can be specified . .
. . . . . . . . . . . . . . (DADD2) 32–bit addition, destination can be specifie
d . . . . . . . . . . . . . . .
F25 (SUB) 16–bit subtraction . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . 14 – 49
vi Matsushita Electric Works (Europe) AG
NAiS Control 1131
Table of Contents
F26 (DSUB) 32–bit subtraction . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . 14 – 50 F27 (SUB2) 16–bit subtraction, destination
can be specified . . . . . . . . . . . . . . 14 – 51 F28 F30 F31 F32 F33 F35 F3
6 F37 F38 F40 F41 F42 F43 F45 F46 F47 F48 F50 F51 F52 F53 F55 F56 F57 F58 F60 F6
1 F62 (DSUB2) 32–bit subtraction, destination can be specified . . . . . . . . .
. . . (MUL) 16–bit multiplication, destination can be specified . . . . . . . .
. . . . . (DMUL) 32–bit multiplication, destination can be specified . . . . .
. . . . . . . (DIV) 16–bit division, destination can be specified . . . . . . .
. . . . . . . . . . . . (DDIV) 32–bit division, destination can be specified . .
. . . . . . . . . . . . . . . (INC) 16–bit increment . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (DINC) 32–bit increm
ent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . (DEC) 16–bit decrement . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . (DDEC) 32–bit decrement . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . (BADD) 4–digit BCD additi
on . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (DB
ADD) 8–digit BCD addition . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . (BADD2) 4–digit BCD addition, destination can be specified . .
. . . . . . . . (DBADD2) 8–digit BCD addition, destination can be specified . .
. . . . . . (BSUB) 4–digit BCD subtraction . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . (DBSUB) 8–digit BCD subtraction . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . (BSUB2) 4–digit BCD subtractio
n, destination can be specified . . . . . . . (DBSUB2) 8–digit BCD subtraction,
destination can be specified . . . . . . (BMUL) 4–digit BCD multiplication, dest
ination can be specified . . . . . . . (DBMUL) 8–digit BCD multiplication, desti
nation can be specified . . . . . (BDIV) 4–digit BCD division, destination can b
e specified . . . . . . . . . . . . (DBDIV) 8–digit BCD division, destination ca
n be specified . . . . . . . . . . . (BINC) 4–digit BCD increment . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . (DBINC) 8–digit BCD in
crement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (B
DEC) 4–digit BCD decrement . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . (DBDEC) 8–digit BCD decrement . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . (CMP) 16–bit data compare . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . (DCMP) 32–bit data compar
e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (WIN
) 16–bit data band compare . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14
14 14 14 14 14 14 – – – – – – – – – – – – – – – – – – – – – – – – – – – – 52 53
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
F63 (DWIN) 32–bit data band compare . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . 14 – 80 F64 (BCMP) Block data compare . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . 14 – 81 F65 (WAN) 6–bit data
AND . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . 14 – 82 F66 F67 F68 F70 (WOR) 16–bit data OR . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (XOR) 16–bit data
exclusive OR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
(XNR) 16–bit data exclusive NOR . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . (BCC) Block check code calculation . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . 14 14 14 14 – – – – 83 84 85 86
F71 (HEX2A) HEX → ASCII conversion . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . 14 – 87
Matsushita Electric Works (Europe) AG vii
Table of Contents
NAiS Control 1131
F72 (A2HEX) ASCII → HEX conversion . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . 14 – 88 F73 (BCD2A) BCD → ASCII conversion . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . 14 – 89 F74 F75 F76 F77 F78 F80 F8
1 F82 F83 F84 F85 F86 F87 F88 F89 F90 F91 F92 F93 F94 (A2BCD) ASCII → BCD conver
sion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (BIN2A) 16–
bit BIN → ASCII conversion . . . . . . . . . . . . . . . . . . . . . . . . . . .
(A2BIN) ASCII → 16–bit BIN conversion . . . . . . . . . . . . . . . . . . . . .
. . . . . . (DBIN2A) 32–bit BIN → ASCII conversion . . . . . . . . . . . . . .
. . . . . . . . . . . . (DA2BIN) ASCII → 32–bit BIN conversion . . . . . . . . .
. . . . . . . . . . . . . . . . . (BCD) 16–bit BIN → 4–digit BCD conversion . .
. . . . . . . . . . . . . . . . . . . . . (BIN) 4–digit BCD → 16–bit BIN conver
sion . . . . . . . . . . . . . . . . . . . . . . . . (BCD) 32–bit BIN → 8–digit
BCD conversion . . . . . . . . . . . . . . . . . . . . . . . 14 14 14 14 14 14 1
4 14 – – – – – – – – 90 92 93 94 95 96 97 98
(DBIN) 8–digit BCD → 32–bit BIN conversion . . . . . . . . . . . . . . . . . . .
. . . . 14 – 99 (INV) 16–bit data invert (one’s complement) . . . . . . . . . .
. . . . . . . . . . . . . 14 – 100 (NEG) 16–bit data two’s complement . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . 14 – 101 (DNEG) 32–bit data two
’s complement . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 – 102 (
ABS) 16–bit data absolute value . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . (DABS) 32–bit data absolute value . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . (EXT) 16–bit data sign extension . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . (DECO) Decode . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (
SEGT) 16–bit data 7–segment decode . . . . . . . . . . . . . . . . . . . . . . .
. . . . (ENCO) Encode . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . (UNIT) 16–bit data combine . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . (DIST) 16–bit data dis
tribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
14 14 14 14 – – – – 103 104 105 106
14 – 108 14 – 110 14 – 111 14 – 113 14 14 14 14 14 14 14 14 – – – – – – – – 116
117 118 119 120 121 122 123
F95 (ASC) Character → ASCII transfer . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . F96 (SRC) Table data search (16–bit search) . . . . . . . . .
. . . . . . . . . . . . . . . . . F100 (SHR) Right shift of 16–bit data in bit
units . . . . . . . . . . . . . . . . . . . . . . . F101 (SHL) Left shift of 16–
bit data in bit units . . . . . . . . . . . . . . . . . . . . . . . . . F105 (BS
R) Right shift of one hexadecimal digit (4 bits) of 16–bit data . . . . F106 (BS
L) Left shift of one hexadecimal digit (4 bits) of 16–bit data . . . . . . F110
(WSHR) Right shift of one word (16 bits) of 16–bit data range . . . . . . F111 (
WSHL) Left shift of one word (16 bits) of 16–bit data range . . . . . . . .
F112 (WBSR) Right shift of one hex. digit (4 bits) of 16–bit data range . . . .
14 – 124 F113 (WBSL) Left shift of one hex. digit (4 bits) of 16–bit data range
. . . . . . 14 – 125 F118 (UCD) Up/Down Counter . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . 14 – 126 F119 (LRSR) LEFT/RIGHT sh
ift register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . F120
(ROR) 16–bit data right rotate . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . F121 (ROL) 16–bit data left rotate . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . F122 (RCR) 16–bit data right rotat
e with carry–flag data . . . . . . . . . . . . . . . . 14 14 14 14 – – – – 127 1
29 130 131
F123 (RCL) 16–bit data left rotate with carry–flag data . . . . . . . . . . . .
. . . . . . 14 – 132
viii Matsushita Electric Works (Europe) AG
NAiS Control 1131
Table of Contents
F130 (BTS) 16–bit data bit set . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . 14 – 133 F131 (BTR) 16–bit data bit reset . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 – 134 F132 (
BTI) 16–bit data bit invert . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . 14 – 135 F133 (BTT) 16–bit data test . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 – 136 F135 (BC
U) Number of ON bits in 16–bit data . . . . . . . . . . . . . . . . . . . . . .
. . . 14 – 137 F136 (DBCU) Number of ON bits in 32–bit data . . . . . . . . . .
. . . . . . . . . . . . . . 14 – 138 F137 (STMR) Auxiliary timer (sets the ON– d
elay timer for 0.01s units) . . . 14 – 139 F138 (HMSS) h:min:s → s conversion .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 – 140 F139 (SHM
S) s → h:min:s conversion . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . 14 – 141 F140 (STC) Carry–flag set . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . 14 – 142 F141 (CLC) Carry–flag
reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . 14 – 143 F143 (IORF) Partial I/O update . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . 14 – 144 F144 (TRNS) Serial communic
ation (RS232C) . . . . . . . . . . . . . . . . . . . . . . . . . 14 – 145 F147 (
PR) Parallel printout . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . 14 – 147 F148 (ERR) Self–diagnostic error set . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 – 148 F149 (MSG) Me
ssage display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . 14 – 149 F157 (CADD) Time addition . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . 14 – 150 F158 (CSUB) Time subtr
action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . 14 – 151 F162 (HC0S) High–speed counter output set . . . . . . . . . . . .
. . . . . . . . . . . . . . 14 – 153 F163 (HC0R) High–speed counter output reset
. . . . . . . . . . . . . . . . . . . . . . . . 14 – 154 F164 (SPD0) Pulse outp
ut control; Pattern output control . . . . . . . . . . . . . . . 14 – 155 F165 (
CAM0) Cam control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . 14 – 156 F166 (HC1S) Sets Output of High– speed counter
(4Channels) . . . . . . . . . . 14 – 157 F167 (HC1R) Resets Output of High–speed
Counter (4 Channels) . . . . . . . 14 – 159 F168 (SPD1) Positioning Pulse Instr
uction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 – 161 F169 (PL
S) Pulse Width Modulation y 40 Hz . . . . . . . . . . . . . . . . . . . . . . .
. . . . 14 – 166 F170 (PWM) Pulse Width Modulation . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . 14 – 169 F183 (DSTM) Special 32–bit timer .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 – 172
F327 (INT) Floating point data → 16–bit integer data . . . . . . . . . . . . . .
. . . . 14 – 174 F328 (DINT) Floating point data → 32–bit integer data . . . .
. . . . . . . . . . . . . 14 – 176 F333 (FINT) Rounding the first decimal point
down . . . . . . . . . . . . . . . . . . . . . 14 – 178 F334 (FRINT) Rounding th
e first decimal point off . . . . . . . . . . . . . . . . . . . . . . 14 – 180 F
335 (FSIGN) Floating point data sign changes . . . . . . . . . . . . . . . . . .
. . . . . . 14 – 182 F337 (RAD) Conversion of angle units (Degrees → Radians) .
. . . . . . . . . . . 14 – 184 F338 (DEG) Conversion of angle units (Radians →
Degrees) . . . . . . . . . . . . 14 – 186 F355 (PID) PID processing instruction
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 – 188
Matsushita Electric Works (Europe) AG ix
Table of Contents
NAiS Control 1131
Chapter 15 Standard Matsushita Function Blocks
CT_FB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . 15 – 3 TM_1ms_FB . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . 15 – 6 TM_10ms_FB . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 – 9 TM_1
00ms_FB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . 15 – 12 TM_1s_FB . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . 15 – 15
Appendix A High–Speed Counter, Pulse and PWM Output
A.1 High–Speed Counter, Pulse and PWM Output . . . . . . . . . . . . . . . . . .
. . . . . A – 3 A.1.1 High–speed counter function . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . A – 3 A.1.2 Pulse output function . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . A – 3 A.1.3 PWM outpu
t function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . A – 4 Specifications and Restricted Items . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . A – 5 A.2.1 Specifications . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A – 5 A.2.2 Fu
nctions and Restrictions . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . A – 7 High–Speed Counter Function . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . A – 9 A.3.1 Types of Input Modes . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A – 9 A.3.2 I/O
Allocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . A – 11 Pulse Output Function . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . A – 12 A.4.1 SDT Variables .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. A – 12 A.4.2 Positioning Function F168 . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . A – 13 A.4.3 Pulse Output Function F169 . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . A – 14 A.4.4 High–Speed Counter Co
ntrol Instruction F0_MV . . . . . . . . . . . . A – 15 A.4.5 Elapsed Value Chang
e and Read Instruction F1_DMV . . . . . . . A – 16 Sample Program for Positionin
g Control . . . . . . . . . . . . . . . . . . . . . . . . . . . A – 17 A.5.1 Rel
ative Value Positioning Operation (Plus Direction) . . . . . . . . A – 18 A.5.2
Relative Value Positioning Operation (Minus Direction) . . . . . . . A – 19 A.5.
3 Absolute Value Positioning Operation . . . . . . . . . . . . . . . . . . . . .
. A – 20 A.5.4 Home Return Operation (Minus Direction) . . . . . . . . . . . .
. . . . . . A – 21 A.5.5 Home Return Operation (Plus Direction) . . . . . . . .
. . . . . . . . . . . . A – 22 A.5.6 JOG Operation (Plus Direction) . . . . . .
. . . . . . . . . . . . . . . . . . . . . A – 23 A.5.7 JOG Operation (Minus Dire
ction) . . . . . . . . . . . . . . . . . . . . . . . . . . A – 24 A.5.8 Emergenc
y Stop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . A – 24
A.2
A.3
A.4
A.5
Appendix B Glossar Alphabetical Index of All Instructions Record of Changes
x Matsushita Electric Works (Europe) AG
Part 1 Chapter 1 Basics
1.1 Operands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1 – 3 1.1.1 In–/Outputs . . . . . . . . . . . . . . . . . . . . . . . . . 1 – 3
1.1.2 Internal Relays . . . . . . . . . . . . . . . . . . . . . . 1 – 4 1.1.3 S
pecial Internal Relays . . . . . . . . . . . . . . . 1 – 4 1.1.4 Timers and Coun
ters . . . . . . . . . . . . . . . . . 1 – 5 1.1.5 Data Registers (DT) . . . . .
. . . . . . . . . . . . . 1 – 6 1.1.6 Special Data Registers (DT) . . . . . . .
. . . . 1 – 6 1.1.7 File Registers (FL) . . . . . . . . . . . . . . . . . . . 1
– 7 1.1.8 Link Relays and Registers (L/LD) . . . . . . 1 – 7 1.2 Addresses . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 – 8 1.2.1 Matsus
hita Addresses . . . . . . . . . . . . . . . . 1 – 9 1.2.2 IEC Addresses . . . .
. . . . . . . . . . . . . . . . . 1 – 10 1.3 Constants . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . 1 – 13 1.3.1 Decimal Constants . . . . .
. . . . . . . . . . . . . 1 – 13 1.3.2 Hexadecimal Constants . . . . . . . . .
. . . . 1 – 13 1.3.3 BCD Constants . . . . . . . . . . . . . . . . . . . . . 1 –
13
Basics
NAiS Control 1131
1.4 Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 –
14 1.4.1 BOOL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 – 15
1.4.2 INTEGER . . . . . . . . . . . . . . . . . . . . . . . . . . 1 – 15 1.4.3 D
OUBLE INTEGER . . . . . . . . . . . . . . . . . 1 – 15 1.4.4 STRING . . . . . .
. . . . . . . . . . . . . . . . . . . . . 1 – 16 1.4.5 WORD . . . . . . . . . .
. . . . . . . . . . . . . . . . . . 1 – 16 1.4.6 DOUBLE WORD . . . . . . . . . .
. . . . . . . . . . 1 – 16 1.4.7 ARRAY . . . . . . . . . . . . . . . . . . . .
. . . . . . . . 1 – 17 1.4.8 TIME . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . 1 – 22 1.4.9 REAL . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . 1 – 22
1–2
Matsushita Electric Works (Europe) AG
NAiS Control 1131 1.1
Basics Operands
1.1
Operands
In NAiS Control the following operands are available:
• • • • • • • •
in– and outputs (X/Y) as well as internal memory areas internal relays special i
nternal relays timers and counters data registers special data registers file re
gisters link registers and relays
The number of operands which are available depends on the PLC–type and its confi
guration. To see how many of the respective operands are available, refer to you
r hardware description.
1.1.1
In– /Outputs
The amount of in–/outputs available depends on the PLC and unit type. Each input
terminal corresponds to one input X, each output terminal corresponds to one ou
tput Y. In system register 20, the output is fixed as duplicated by NAiS Control
.
+ Note
Outputs which do not exist physically can be used like flags. These flags are no
n–holding, which means their contents will be lost, e.g. after a power failure.
Matsushita Electric Works (Europe) AG
1–3
Basics 1.1 Operands
NAiS Control 1131
1.1.2
Internal Relays
Internal Relays are memory areas where you can store interim results. Internal r
elays are treated like internal outputs. In system register no. 7 define which i
nternal relays are supposed to be holding/non–holding. Holding means that its va
lues will be retained even after a power failure. The number of available intern
al relays depends on the PLC type (* hardware description of your PLC).
1.1.3
Special Internal Relays
Special internal relays are memory areas which are reserved for special PLC func
tions. They are automatically set/reset by the PLC and are used:
• • • •
to indicate certain system states, e.g. errors as an impulse generator to initia
lize the system as ON/OFF control flag under certain conditions such as when som
e flags get a certain status if data are ready for transmission in a PLC network
.
The number of special internal relays available depends on the PLC type (* hardw
are description of your PLC).
+ Note
Special internal relays can only be read.
1–4
Matsushita Electric Works (Europe) AG
NAiS Control 1131 1.1
Basics Operands
1.1.4
Timers and Counters
Timers and Counters use one common memory and address area. Define in system reg
isters 5 and 6 how the memory area is to be divided between timers and counters
and which timers/counters are supposed to be holding or non–holding. Holding mea
ns that even after a power failure all data will be saved, which is not the case
in non–holding registers. Entering a number in system register 5 means that the
first counter is defined. All smaller numbers define timers. For example, if yo
u enter zero, you define counters only. If you enter the highest value possible,
you define timers only. In the default setting the holding area is defined by t
he start address of the counter area. This means all timers are holding and all
counters are non–holding. You can of course customize this setting and set a hig
her value for the holding area, which means some of the timers, or if you prefer
, all of them can be defined as holding. In addition to the timer/counter area,
there is a memory area reserved for the set value (SV) and the elapsed value (EV
) of each timer/counter contact. The size of both areas is 16 bits (WORD). In th
e SV and EV area one INTEGER value from 0 to 32,767 can be stored.
Timer/Counter No.
TM0 . . . TM99 CT100 . . .
SV
SV0 . . . SV99 SV100 . . .
EV
EV0 . . . EV99 EV100 . . .
Relay
T0 . . . T99 C100 . . .
While a timer or counter is being processed, the respective acual value can be r
ead and under certain conditions be edited.
+ Note
After changing the settings in system register 5, do not forget to adjust the ad
dresses of the timers/counters in your PLC program because they correspond to th
e TM/CT numbers.
Matsushita Electric Works (Europe) AG
1–5
Basics 1.1 Operands
NAiS Control 1131
1.1.5
Data Registers (DT)
Data registers have a width of 16 bits. You can use them, for example, to write
and read constants/parameters. If an instruction requires 32 bits, two 16–bit da
ta registers are used. If this is the case, enter the address of the first data
register with the prefix DDT instead of DT. The next data register (word) will b
e used automatically (* example 1.2.1).
2. word DT2 1. word DT1
32 bit data register
Data registers can be holding or non–holding. Holding means that even after a po
wer failure all data will be saved. Set the holding/non–holding areas in system
register 8 by entering the start address of the holding area. The amount of data
registers available depends on the PLC type (* hardware description).
1.1.6
Special Data Registers (DT)
Special data registers are like the special internal relays reserved for special
functions and are in most cases set/reset by the PLC. The register has a width
of 16 bits (data type = WORD). The amount of special data registers available de
pends on the PLC type (* hardware description). Most special data registers can
only be read. Here some exceptions:
• • • •
actual values of the high–speed counter (DT9044 and DT9045; for FP0–T32CP DT9004
4 and DT90045) control flag of the high–speed counter DT9052 (DT90053 for FP0–T3
2CP) real–time clock (DT9054 to DT9058; FP0–T32CP: DT90054 to DT90058) interrupt
s and scan time (DT9027, DT9023–DT9024; FP0–T32CP: DT90027, DT90023–DT90024)...
1–6
Matsushita Electric Works (Europe) AG
NAiS Control 1131 1.1
Basics Operands
1.1.7
File Registers (FL)
Some PLC–types (* hardware description) provide additional data registers which
can be used to increase the number of data registers. File registers are used in
the same way as data registers. Set the holding/non–holding area in system regi
ster 9. Holding means that even after a power failure all data will be saved.
1.1.8
Link Relays and Registers (L/LD)
Link relays have a width of 1 bit (BOOL). Set the:
• • •
transmission area amount of link relay words to be sent holding/non–holding area
in system registers 10–13 and 40–55. For a detailed description refer to the man
ual FP3/FP5 MEWNET Link Unit, ACGM0015. Link registers have a width of 16 bits (
WORD). Set the:
• • •
transmission area amount of link relay words to be sent holding/non–holding area
in system registers 10–13 and 40–55. For a detailed description refer to the man
ual FP3/FP5 MEWNET Link Unit, ACGM0015.
Matsushita Electric Works (Europe) AG
1–7
Basics 1.2 Addresses
NAiS Control 1131
1.2
Addresses
In the List of Global Variables, enter the physical address in the field “Addres
s” for each global variable used in the PLC program. The operand and the address
number are part of the address. In NAiS Control you can use either Matsushita a
nd/or IEC addresses. The following abbreviations are used:
Meaning
Input Output Memory (internal memory area) Timer relay Counter relay Set value E
lapsed value Data register Link relay Link register File register
Matsushita
X Y R T C SV EV DT/DDT L LD FL
IEC
I Q M0 M1 M2 M3 M4 M5 M6 M7 M8
You find the register numbers (e.g.: DT9000/90000) in your hardware description.
The next two sections show how Matsushita and IEC addresses are composed.
1–8
Matsushita Electric Works (Europe) AG
NAiS Control 1131 1.2
Basics Addresses
1.2.1
Matsushita Addresses
A Matsushita address represents the hardware address of an in–/output, register,
or counter. For example, the hardware address of the 1st input and the 4th outp
ut of an FP1 is:
• •
X0 (X = input, 0 = first relay) Y3 (Y = output, 3 = fourth relay)
Use the following Matsushita abbreviations for the memory areas:
Memory Area
Memory (internal memory area) Timer relay Counter relay Set value Elapsed value
Data register Link relay Link register File register
Abbr.
R T C SV EV DT L LD FL
Example
R9000: self diagnostic error T200: timer relay no. 200 (settings in system regis
ter 5+6) C100: counter relay no. 100 (settings in system register 5+6) SV200 (se
t value for counter relay 200) EV100 (elapsed value for timer relay 100) DT9001
(signals power failure) L1270 LD255 FL8188
You find the register numbers in your hardware description.
Matsushita Electric Works (Europe) AG
1–9
Basics 1.2 Addresses
NAiS Control 1131
1.2.2
IEC Addresses
The composition of an IEC–1131 address depends on:
PLC type In– and Outputs are the most important components of a programmable log
ic controller (PLC). The PLC receives signals from the input relays and processe
s them in the PLC program. The results can either be stored or sent to the outpu
t relays, which means the PLC controls the outputs. A PLC provides special memor
y areas, in short “M”, to store interim results, for example. If you want to rea
d the status of the input 1 of the first module and control the output 4 of the
second module, for example, you need the physical address of each in–/output. Ph
ysical NAiS Control addresses are composed of the per cent sign, an abbreviation
for in–/output, an abbreviation for the data type and of the word and bit addre
ss:
• • • • •
operand type data type slot no. of the unit (word address) relay no. (bit addres
s)
,
Example:
IEC address for an input
%IX0.0 Physical Address Input Data Type=BOOL Bit Address Word Address
The per cent sign is the indicator of a physical address. “I” means input, “X” m
eans data type BOOL. The first zero represents the word address (slot no.) and t
he second one the bit address. Note that counting starts with zero and that coun
ting word and bit addresses differs among the PLC types. Each PLC provides inter
nal memory areas (M) to store interim results, for example. When using internal
memory areas such as data registers, do not forget the additional number (here 5
) for the memory type: Example: IEC address for an internal memory area
%MW5.0 Physical Address Word Address Internal Memory Area Data Type Memory Type
,
Bit addresses do not have to be defined for data registers, counters, timers, or
the set and actual values.
1 – 10 Matsushita Electric Works (Europe) AG
NAiS Control 1131 1.2
Basics Addresses
According to IEC 1131, abbreviations for in– and output are “I” and “O”, respect
ively. Abbreviations for the memory areas are as follows:
Memory Type
Internal Relay (R) Timer (T) Counter (C) Set Value counters/timers (SV) Elapsed
Value counters/timers (EV) Data Registers (DT)
No.
0 1 2 3 4 5
Example
%MX0.900.0 = internal relay R9000 %MX1.200 = counter no. 200 %MX2.100 = counter
no. 100 %MW3.200 = set value of the counter no. 200 %MW4.100 = elapsed value of
the timer no. 100 %MW5.9001 = data register DT9001
+ Note
Tables with hardware addresses can be found in the hardware description of your
PLC.
The following data types are available:
Data Type
BOOL INTEGER DOUBLE INTEGER WORD DOUBLE WORD TIME 16 bit TIME 32 bit REAL
Abbreviation
BOOL INT DINT WORD DWORD TIME TIME REAL
Range of Values
0 (FALSE), 1 (TRUE) –32,768 to 32,768 –2,147,438,648 to 2,147,438,647 0 to 65,53
5 0 to 4,294,987,295 T#0.00s to T#327.67s T#0,00s to T#21 474 836.47s –1,175494
x 10–38 to –3,402823 x 10–38 1,175494 x 10–38 to 3,402823 x 10–38 and
Data Width
1 bit 16 bit 32 bit 16 bit 32 bit 16 bit* 32 bit* 32 bit
*depends on your PLC
+ Note
Please take into account that not all data types can be used with each IEC comma
nd.
* next page
Matsushita Electric Works (Europe) AG
1 – 11
Basics 1.2 Addresses
NAiS Control 1131
Numbering of in–/output addresses depends on the type of PLC used (* respective
hardware description). For FP0/FP1/FP–M the addresses are not serially numbered.
Counting restarts with zero at the first output. Supposing you have one FP1–C24
with 16 inputs and 8 outputs, the resulting addresses are: for the input: %IX0.
0 – %IX0.15, and for the output: %QX0.0 – %QX0.7. In other words the counting fo
r the word and bit number begins at zero for the outputs.
+ Notes
• • •
Find the tables with all memory areas in your hardware description. When using t
imers, counters, set/elapsed values, and data registers, the bit address does no
t have to be indicated. You can also enter the register number (R9000, DT9001/90
001) or the Matsushita address e.g. “X0” (input 0) instead of the IEC–address.
1 – 12
Matsushita Electric Works (Europe) AG
NAiS Control 1131 1.3
Basics Constants
1.3
Constants
A constant represents a fixed value. Depending on the application, a constant ca
n be used as a addend, multiplier, address, in–/output number, set value, etc. T
here are 3 types of constants:
• • •
1.3.1
decimal hexadecimal BCD
Decimal Constants
Decimal constants can have a width of either 16 or 32 bits. Range 16 bit: –32,76
8 to 32,768 Range 32 bit: –2,147,483,648 to 2,147,483,648 Constants are internal
ly changed into 16–bit binary numbers including character bit and are processed
as such. Simply enter the decimal number in your program.
1.3.2
Hexadecimal Constants
Hexadecimal constants occupy fewer digit positions than binary data. 16 bit cons
tants can be represented by 4–digit, 32–bit constants by 8–digit hecadecimal con
stants. Range 16 bit: 8000 to 7FFF Range 32 bit: 80000000 to 7FFFFFFFF Enter e.g
.: 16#7FFF for the hexadecimal value 7FFF in your program.
1.3.3
BCD Constants
BCD is the abbreviation for Binary Coded Decimal. Range 16 bit: 0 to 9999 Range
32 bit: 0 to 99999999 Enter BCD constants in the program either as: binary: 2#00
01110011100101 or hexadecimal: 16#9999
Matsushita Electric Works (Europe) AG
1 – 13
Basics 1.4 Data Types
NAiS Control 1131
1.4
Data Types
NAiS Control provides elementary and user defined data types. Elementary data ty
pes
Data Type
BOOL INTEGER DOUBLE INTEGER WORD DOUBLE WORD STRING TIME 16 bit TIME 32 bit REAL
Abbreviation
BOOL INT DINT WORD DWORD STRING TIME TIME REAL
Value Range
0 (FALSE) or 1 (TRUE) –32,768 to 32,768 –2,147,483,648 to 2,147,483,647 0 to 65,
535 0 to 4,294,967,295 1 to 255 bytes (ASCII) T#0,00s to T#327.67s T#0,00s to T#
21 474 836,47s –1,175494 x 10–38 to –3,402823 x 10–38 1,175494 x 10–38 to 3,4028
23 x 10–38 and
Data Width
1 bit 16 bit 32 bit 16 bit 32 bit 8 bits per byte 16 bit* 32 bit* 32 bit
*depends on your PLC A data type has to be assigned to each variable. User defin
ed data types We differentiate between array and Data Unit Types (DUT). An array
consists of several elementary data types which are all of the same type. A DUT
consists of several elementary data types but of different data types. Each rep
resents a new data type.
1 – 14
Matsushita Electric Works (Europe) AG
NAiS Control 1131 1.4
Basics Data Types
1.4.1
BOOL
Variables of the data type BOOL are binary switches. They either have the status
0 or 1 and have a width of 1 bit. The status 0 corresponds to FALSE and means t
hat the variable has the status OFF. The status 1 corresponds to TRUE and means
that the variable has the status ON. The default initial value, e.g. for the var
iable declaration in the POU header or in the List of Global Variables = 0 (FALS
E). In this case the variable has the status FALSE at the moment the PLC program
starts. If it should be TRUE at the start, reset the initial value to TRUE.
1.4.2
INTEGER
Variables of the data type INTEGER are integral natural numbers (without comma)
and in WORD format. The range for INTEGER values is –32,768 to 32,768 (decimal).
The default intial value, e.g. for the variable declaration in the POU header o
r in the List of Global Variables = 0 (FALSE). You can enter INTEGER numbers in
DEC, HEX– or BIN format:
Decimal
1,234 –1,234
Hexadecimal
16#4D2
Binary
2#10011010010 2#1111101100101110
16#FB2E
1.4.3
DOUBLE INTEGER
Variables of the data type DOUBLE INTEGER are 32–bit natural numbers without com
mas and in DOUBLD WORD format. The range for INTEGER values is –2,147,483,648 an
d 2,147,483,648 decimal. The default intial value, e.g. for the variable declara
tion in the POU header or in the List of Global Variables, = 0 (FALSE). You can
enter DOUBLE INTEGER numbers in DEC, HEX– or BIN format:
Decimal
123,456,789 –123,456,789
Hexadecimal
16#75BCD15
Binary
2#111010110111100110100010101 2#1111100010100100001 100101110
16#F8A432EB
Matsushita Electric Works (Europe) AG
1 – 15
Basics 1.4 Data Types
NAiS Control 1131
1.4.4
STRING
The data type STRING consists of a series, i.e. string, of ASCII characters. You
can store a maximum of 255 characters in one string. Each character of the stri
ng is stored in a byte.
+ Notes
• • •
The data type STRING is only available for the FP2 and FP10SH. For the PLCs FP0,
FP1 and FP–M you can only enter the data type STRING as a constant in the POU b
ody (* F95_ASC of the Matsushita Library). For detailed information, * Online He
lp in NAiS Control.
1.4.5
WORD
A variable of the data type WORD consists of 16 bits. The states of 16 in–/outpu
ts can be represented by one word (WORD), for example. The default intial value,
e.g. for the variable declaration in the POU header or in the List of Global Va
riables, = 0 (FALSE). Enter WORD values in (DEC), HEX– or BIN format:
Decimal
1,234 –1,234
Hexadecimal
16#4D2
Binary
2#10011010010 2#1111101100101110
16#FB2E
1.4.6
DOUBLE WORD
A variable of the data type DOUBLE WORD consists of 32 bits. The states of 32 in
–/outputs can be represented by one DOUBLE WORD, for example. The default intial
value, e.g. for the variable declaration in the POU header or in the List of Gl
obal Variables, = 0 (FALSE). Enter numbers in (DEC), HEX– or BIN format:
Decimal
123,456,789 –123,456,789
Hexadecimal
16#75BCD15
Binary
2#111010110111100110100010101 2#1111100010100100001 100101110
16#F8A432EB
1 – 16
Matsushita Electric Works (Europe) AG
NAiS Control 1131 1.4
Basics Data Types
1.4.7
ARRAY
An array is a combination of variables, all of which have the same data type. Th
is combination represents a variable itself, and therefore it has to be declared
. This means that in order to make an array available for the entire project, it
has to be declared in the List of Global Variables. If an array is used within
a POU only, declare it in the POU header only. Data types valid for arrays are:
• BOOL
• • • • • • • • •
INT DINT WORD DWORD TIME REAL 1–dimensional 2–dimensional 3–dimensional 1–dimens
ional ARRAY Declaration in the global variable list:
Arrays may be:
,
Example:
Declare in the global variable list: • identifier (name for calling up the array
in the program)
• • • •
initial address where array is saved in the memory number of elements and data t
ype of an array initial values of individual array elements and comment
onedim_array[0] element 1 onedim_array[2] element 3 onedim_array[14] element 15
The declared array can be imagined as follows:
onedim_array[1] element 2
onedim_array[15] element 16
* next page
Matsushita Electric Works (Europe) AG 1 – 17
Basics 1.4 Data Types
NAiS Control 1131
Initialize Arrays with Values
The initialisation of arrays with values starts with the first array element (el
ement 1) and ends with the last array element (element 16). The initialisation v
alues are entered one after another into the field initial and are separated fro
m each other by commas. If subsequent array elements are initialised with the sa
me value, the abbreviated writing number(value) is possible. * number stands for
the number of array elements * value stands for the initialisation value In the
example, element 1 was initialised with value 1, element 2 with value 2 etc.
Use Array Elements in the Program
You may use a 1–dimensional array element by entering identifier[Var1]. * identi
fier (name of the array, see field Identifier) * Var1 is a variable of the type
INT or a constant which has to be located in the value range of the array declar
ation. For this example Var1 is assigned to the range 0...15 In the example you
call up the third array element (Element 3) with onedim_array[2]. If you wish to
assign a value to this element in an IL program for example, you enter the foll
owing: LD current_temperature ST onedim_array[2]
Addresses of Array Elements
The array elements of the 1–dimensional array are subsequently saved in the PLC’
s memory starting with element 1. This means for the example described above:
Matsushita Address
DTO DT1 DT2 DT3 DT4 ... DT13 DT14 DT15
IEC–Address
%MW5.0 %MW5.1 %MW5.2 %MW5.3 %MW5.4 ... %MW5.13 %MW5.14 %MW5.15
Array Element
element 1 element 2 element 3 element 4 element 5 ... element 14 element 15 elem
ent 16
Array Element Name
onedim_array(0) onedim_array(1) onedim_array(2) onedim_array(3) onedim_array(4)
... onedim_array(13) onedim_array(14) onedim_array(15)
1 – 18
Matsushita Electric Works (Europe) AG
NAiS Control 1131 1.4
Basics Data Types
,
Example:
2–dimensional ARRAY
Declaration in the global variable list:
The declared array can be imagined as follows:
twodim_array[3,1] element 1 twodim_array[3,2] element 2
twodim_array[4,6] element 12
twodim_array[5,6] element 18
Initialize arrays with values
The initialisation of arrays with values starts with the first array element (el
ement 1) and ends with the last array element (element 18). The initialisation v
alues are entered one after another into the field initial and are separated fro
m each other by commas. If subsequent array elements are initialised with the sa
me value, the abbreviated writing number(value) is possible. * number stands for
the number of array elements * value stands for the initialisation value In the
example element 1 was initialised with the value FALSE, element 2 with the valu
e TRUE and the remaining array elements are initialised with FALSE.
Use array elements in the program
You may use a 2–dimensional array element by entering identifier[Var1Var2]. * id
entifier (name of the array, see field Identifier) * Var1 and Var2 are variables
of the type INT or constants which have to be located in the value range of the
array declaration. For this example Var1 is assigned to the range 3...5 and Var
2 to the range 1...6. In the example you call up the element 12 with twodim_arra
y[4,6]. If you wish to assign a value to this element in an IL program for examp
le, you enter the following: LD ST current_temperature twodim_array[4,6]
* next page
Matsushita Electric Works (Europe) AG 1 – 19
Basics 1.4 Data Types
NAiS Control 1131
Addresses of array elements
The array elements of the 2–dimensional array are subsequently saved in the PLC’
s memory starting with element 1. The following storage occupation results for t
he example described above:
Matsushita Address
R0 R1 R2 ... R5 R6 R7 ... RF R10 R11
IEC–Address
%MX0.0.0 %MX0.0.1 %MX0.0.2 ... %MX0.0.5 %MX0.0.6 %MX0.0.7 ... %MX0.0.15 %MX0.1.0
%MX0.1.1
Array Element
element 1 element 2 element 3 ... element 6 element 7 element 8 ... element 16 e
lement 17 element 18
Array Element Name
twodim_array[3,1] twodim_array[3,2] twodim_array[3,3] ... twodim_array[3,6] twod
im_array[4,1] twodim_array[4,2] ... twodim_array[5,4] twodim_array[5,5] twodim_a
rray[5,6]
,
Example:
3–dimensional ARRAY
Declaration in the global variable list:
The declared array can be imagined as follows:
threedim_array[1,0,4] element 111
threedim_array[–7,0,2] element 13
threedim_array[–8,0,2] element 1 threedim_array[–8,0,3] element 2
1 – 20
Matsushita Electric Works (Europe) AG
NAiS Control 1131 1.4
Basics Data Types
Initialize arrays with values
The initialisation of arrays with values starts with the first array element (el
ement 1) and ends with the last array element (element 120). The initialisation
values are entered one after another into the field initial and are separated fr
om each other by commas. If subsequent array elements are initialised with the s
ame value, the abbreviated writing number(value) is possible. * number stands fo
r the number of array elements * value stands for the initialisation value In th
e example all array elements were initialised with the value 123.
Use array elements in the program
Access to a 3–dimensional array is possible by entering identifier[Var1,Var2,Var
3,Var4]. * identifier is the name of the array, (see field Identifier) * Var1, V
ar 2 and Var3 are variables of the type INT or constants which have to be locate
d in the value range of the array declaration (see field Type). For this example
Var1 is assigned to the range 8...1 and Var2 to the range 0...3 and Var3 to the
range 2...4. In the example you call up element 15 with threedim_array[–7,0,4].
If you wish to assign a value to this element in an IL program, for example, yo
u enter the following: LD current_temperature ST threedim_array[–7,0,4]
Addresses of array elements
The array elements of the 3–dimensional array are subsequently saved in the PLC’
s memory starting with element 1. The following storage occupation results for t
he example described above:
Matsushita Address
DT0 DT1 DT2 DT3 DT4 ... DT10 DT11 DT12 DT13 ... DT117 DT118 DT119
IEC–Address
%MW5.0 %MW5.1 %MW5.2 %MW5.3 %MW5.4 ... %MW5.10 %MW5.11 %MW5.12 %MW5.13 ... %MW5.
117 %MW5.118 %MW5.119
Array Element
element 1 element 2 element 3 element 4 element 5 ... element 11 element 12 elem
ent 13 element 14 ... element 118 element 119 element 120
Array Element Name
threedim_array[–8,0,2] threedim_array[–8,0,3] threedim_array[–8,0,4] threedim_ar
ray[–8,1,2] threedim_array[–8,1,3] ... threedim_array[–8,3,3] threedim_array[–8,
3,4] threedim_array[–7,0,2] threedim_array[–7,0,3] ... threedim_array[1,3,2] thr
eedim_array[1,3,3] threedim_array[1,3,4]
Matsushita Electric Works (Europe) AG
1 – 21
Basics 1.4 Data Types
NAiS Control 1131
1.4.8
TIME
For variables of the data type TIME (16 Bit), using FP1 or FP–M, you can indicat
e an interval of 0.01 to 327.67 seconds. The resolution amounts to 10ms. For var
iables of the data type TIME (32 Bit), using FP0, you can indicate an interval o
f 0.01 to 21 474 836.47 seconds. The resolution amounts to 10ms. Default ( 16 an
d 32 bit) = T#0 (corresponds to 0 seconds)
+ Note ,
Times with negative signs cannot be processed. T#–2s is e.g. interpreted as T#10
m53s350ms.
Example: T#321,12s T#321120ms T#0,01s T#3d5h10m3s100ms
1.4.9
REAL
Variables of the data type REAL are real numbers or floating point constants. Th
e value range for REAL values is between –1,175494 x 10–38 to –3,402823 x 10–38
and 1,175494 x 10–38 to 3,402823 x 10–38. The default for the initial value, e.g
. for the variable declaration in the POU header or in the global variable list
= 0.0 You can enter REAL values in the following format: [+–] Integer.Integer [(
Ee) [+–] Integer]
,
Example: 5.983e–7 –33.876e12 3.876e3 0.000123 123.0
+ Note
The REAL value always has to be entered with a decimal point (e.g. 123.0).
1 – 22
Matsushita Electric Works (Europe) AG
Part 2 IEC Functions
Chapter 2 Conversion Functions
(E_)BOOL_TO_INT . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 3 (E_)BO
OL_TO_DINT . . . . . . . . . . . . . . . . . . . . . . . . 2 - 5 (E_)BOOL_TO_WOR
D . . . . . . . . . . . . . . . . . . . . . . 2 - 7 (E_)BOOL_TO_DWORD . . . . .
. . . . . . . . . . . . . . . . 2 - 9 (E_)INT_TO_BOOL . . . . . . . . . . . . .
. . . . . . . . . . . . 2 - 11 (E_)INT_TO_DINT . . . . . . . . . . . . . . . . .
. . . . . . . . . 2 - 13 (E_)INT_TO_WORD . . . . . . . . . . . . . . . . . . .
. . . . . 2 - 15 (E_)INT_TO_DWORD . . . . . . . . . . . . . . . . . . . . . . 2
- 17 (E_)INT_TO_REAL . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 19 (E
_)INT_TO_TIME . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 21 (E_)INT
_TO_BCD . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 23 (E_)DINT_TO_B
OOL . . . . . . . . . . . . . . . . . . . . . . . 2 - 25 (E_)DINT_TO_INT . . . .
. . . . . . . . . . . . . . . . . . . . . . 2 - 27 (E_)DINT_TO_WORD . . . . . .
. . . . . . . . . . . . . . . . 2 - 29 (E_)DINT_TO_TIME . . . . . . . . . . . .
. . . . . . . . . . . . 2 - 31 (E_)DINT_TO_DWORD . . . . . . . . . . . . . . .
. . . . . . 2 - 33 (E_)DINT_TO_REAL . . . . . . . . . . . . . . . . . . . . . .
. . 2 - 35 (E_)DINT_TO_BCD . . . . . . . . . . . . . . . . . . . . . . . . . 2 -
37 (E_)WORD_TO_BOOL . . . . . . . . . . . . . . . . . . . . . 2 - 39 (E_)WORD_T
O_INT . . . . . . . . . . . . . . . . . . . . . . . . 2 - 41 (E_)WORD_TO_DINT .
. . . . . . . . . . . . . . . . . . . . . 2 - 43 (E_)WORD_TO_DWORD . . . . . . .
. . . . . . . . . . . . 2 - 45 (E_)WORD_TO_TIME . . . . . . . . . . . . . . . .
. . . . . . 2 - 47 -
IEC Functions
NAiS Control 1131
(E_)DWORD_TO_BOOL . . . . . . . . . . . . . . . . . . . . 2 - 49 (E_)DWORD_TO_IN
T . . . . . . . . . . . . . . . . . . . . . . 2 - 51 (E_)DWORD_TO_DINT . . . . .
. . . . . . . . . . . . . . . . 2 - 53 (E_)DWORD_TO_WORD . . . . . . . . . . .
. . . . . . . . 2 - 55 (E_)DWORD_TO_TIME . . . . . . . . . . . . . . . . . . . .
. 2 - 57 (E_)REAL_TO_INT . . . . . . . . . . . . . . . . . . . . . . . . . 2 -
59 (E_)REAL_TO_DINT . . . . . . . . . . . . . . . . . . . . . . . . 2 - 61 (E_)T
IME_TO_INT . . . . . . . . . . . . . . . . . . . . . . . . . . 2 - 63 (E_)TIME_T
O_DINT . . . . . . . . . . . . . . . . . . . . . . . . 2 - 65 (E_)TIME_TO_WORD .
. . . . . . . . . . . . . . . . . . . . . 2 - 67 (E_)TIME_TO_DWORD . . . . . .
. . . . . . . . . . . . . . . 2 - 69 (E_)TRUNC_TO_INT . . . . . . . . . . . . .
. . . . . . . . . . 2 - 71 (E_)TRUNC_TO_DINT . . . . . . . . . . . . . . . . . .
. . . . 2 - 74 (E_)BCD_TO_INT . . . . . . . . . . . . . . . . . . . . . . . . .
. 2 - 77 (E_)BCD_TO_DINT . . . . . . . . . . . . . . . . . . . . . . . . . 2 -
79 (E_)REAL_TO_TIME . . . . . . . . . . . . . . . . . . . . . . . 2 - 81 (E_)TIM
E_TO_REAL . . . . . . . . . . . . . . . . . . . . . . . 2 - 83 -
2 -- 2
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Functions Conversion Functions
(E_)BOOL_TO_INT
Outline
BOOL_TO_INT converts a value of the data type BOOL into a value of the data type
INT. If you require an enable output and an enable input: E_BOOL_TO_INT
J Data Types
Input Variable
BOOL
Output Variable
INTEGER
,
Example
BOOL_TO_INT In this example the function BOOL_TO_INT is programmed in ladder dia
gram (LD) and instruction list (IL). The same POU header is used for both progra
mming languages. POU Header All input and output variables which are required fo
r programming the function are declared in the POU header.
In this example the input variable (Boolean_value) has been declared. However, y
ou may enter a constant directly at the input contact of the function. LD The Bo
olean_value of the data type BOOL is converted into a value of the data type INT
EGER. The converted value is written into INT_value.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not. * next page
Matsushita Electric Works (Europe) AG
2–3
IEC Functions Conversion Functions
NAiS Control 1131
Outline
Anything stated under BOOL_TO_INT also applies to E_BOOL_TO_INT. The function E_
BOOL_TO_INT, however, has in addition an enabled input (EN = enable) and an enab
led output (ENO = enable output) of the data type BOOL. If EN is set (TRUE), E_B
OOL_TO_INT will be activated. If EN is reset (FALSE), the status of the variable
will be frozen until EN is set again. ENO will adopt the status of EN. Therefor
e, you may connect further function blocks/functions with ENO which are controll
ed by the status of EN.
E_BOOL_TO_INT In this example the function E_BOOL_TO_INT is programmed in ladder
diagram (LD) and instruction list (IL). The same POU header is used for both pr
ogramming languages. POU Header All input and output variables which are require
d for programming the function are declared in the POU header.
,
Example
In this example the input variables (Boolean_value and enable) have been declare
d. However, you may enter constants directly at the input contact of the functio
n (enable input e.g. for tests). LD If enable is set (TRUE), the Boolean_value (
1 bit) will be converted into an INTEGER value. The converted value is written i
nto INT_value.
IL If you want to call up the function in an instruction list, enter the followi
ng:
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not.
2–4
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Functions Conversion Functions
(E_)BOOL_TO_DINT
Outline
BOOL_TO_DINT converts a value of the data type BOOL into a value of the data typ
e DINT. If you require an enable output and an enable input: E_BOOL_TO_DINT
J Data Types
Input Variable
BOOL
Output Variable
DOUBLE INTEGER
,
Example
BOOL_TO_DINT In this example the function BOOL_TO_DINT is programmed in ladder d
iagram (LD) and instruction list (IL). The same POU header is used for both prog
ramming languages. POU Header All input and output variables which are required
for programming the function are declared in the POU header.
In this example the input variable (Boolean_value) has been declared. However, y
ou may enter a constant directly at the input contact of the function. LD The Bo
olean_value of the data type BOOL is converted into a DOUBLE INTEGER value. The
converted value is written into DINT_value.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not. * next page
Matsushita Electric Works (Europe) AG
2–5
IEC Functions Conversion Functions
NAiS Control 1131
Outline
Anything stated under BOOL_TO_DINT also applies to E_BOOL_TO_DINT. The function
E_BOOL_TO_DINT, however, has in addition an enabled input (EN = enable) and an e
nabled output (ENO = enable output) of the data type BOOL. If EN is set (TRUE),
E_BOOL_TO_DINT will be activated. If EN is reset (FALSE), the status of the vari
able will be frozen until EN is set again. ENO will adopt the status of EN. Ther
efore, you may connect further function blocks/functions with ENO which are cont
rolled by the status of EN.
E_BOOL_TO_DINT In this example the function E_BOOL_TO_DINT is programmed in ladd
er diagram (LD) and instruction list (IL). The same POU header is used for both
programming languages. POU Header All input and output variables which are requi
red for programming the function are declared in the POU header.
,
Example
In this example the input variables (Boolean_value and enable) have been declare
d. However, you may enter constants directly at the input contact of the functio
n (enable input e.g. for tests). LD If enable is set (TRUE), the Boolean_value (
1 bit) is converted into a DOUBLE INTEGER value (32 bit). The converted value is
written into DINT_value.
IL If you want to call the function in an instruction list, enter the following:
+ Note
2–6
It does not matter whether the function names in the IL editor are capitalized o
r not.
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Functions Conversion Functions
(E_)BOOL_TO_WORD
Outline
BOOL_TO_WORD converts a value of the data type BOOL into a value of the data typ
e WORD. If you require an enable output and an enable input: E_BOOL_TO_WORD
J Data Types
Input Variable
BOOL
Output Variable
WORD
,
Example
BOOL_TO_WORD In this example the function BOOL_TO_WORD is programmed in ladder d
iagram (LD) instruction list (IL) programmiert. The same POU header is used for
both programming languages. POU Header All input and output variables which are
required for programming the function are declared in the POU header.
In this example the input variable (Boolean_value) has been declared. However, y
ou may enter a constant directly at the input contact of the function. LD The Bo
olean_value of the data type BOOL is converted into a value of the data type WOR
D. The converted value is written into WORD_value.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not. * next page
Matsushita Electric Works (Europe) AG
2–7
IEC Functions Conversion Functions
NAiS Control 1131
Outline
Anything stated under BOOL_TO_WORD also applies to E_BOOL_TO_WORD. The function
E_BOOL_TO_WORD, however, has in addition an enabled input (EN = enable) and an e
nabled output (ENO = enable output) of the data type BOOL. If EN is set (TRUE),
E_BOOL_TO_WORD will be activated. If EN is reset (FALSE), the status of the vari
able will be frozen until EN is set again. ENO will adopt the status of EN. Ther
efore, you may connect further function blocks/functions with ENO which are cont
rolled by the status of EN.
E_BOOL_TO_WORD In this example the function E_BOOL_TO_WORD is programmed in ladd
er diagram (LD) and instruction list (IL). The same POU header is used for both
programming languages. POU Header All input and output variables which are requi
red for programming the function are declared in the POU header.
,
Example
In this example the input variables (Boolean_value and enable) have been declare
d. However, you may enter constants directly at the input contact of the functio
n (enable input e.g. for tests). LD Boolean_value (1 bit) is converted into a va
lue of the data type WORD (16 bit). The converted value is written into WORD_val
ue.
IL If you want to call the function in an instruction list, enter the following:
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not.
2–8
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Functions Conversion Functions
(E_)BOOL_TO_DWORD
Outline
BOOL_TO_DWORD converts a value of the data type BOOL into a value of the data ty
pe DWORD. If you require an enable output and an enable input: E_BOOL_TO_DWORD
J Data Types
Input Variable
BOOL
Output Variable
DOUBLE WORD
,
Example
BOOL_TO_DWORD In this example the function BOOL_TO_DWORD is programmed in ladder
diagram (LD) and instruction list (IL). The same POU header is used for both pr
ogramming languages. POU Header All input and output variables which are require
d for programming the function are declared in the POU header.
In this example the input variable (Boolean_value) has been declared. However, y
ou may enter a constant directly at the input contact of the function. LD The Bo
olean_value of the data type BOOL is converted into a value of the data type DOU
BLE INTEGER. The converted value is written into DWORD_value.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not. * next page
Matsushita Electric Works (Europe) AG
2–9
IEC Functions Conversion Functions
NAiS Control 1131
Outline
Anything stated under BOOL_TO_DWORD also applies to E_BOOL_TO_DWORD. The functio
n E_BOOL_TO_DWORD, however, has in addition an enabled input (EN = enable) and a
n enabled output (ENO = enable output) of the data type BOOL. If EN is set (TRUE
), E_BOOL_TO_DWORD will be activated. If EN is reset (FALSE), the status of the
variable will be frozen until EN is set again. ENO will adopt the status of EN.
Therefore, you may connect further function blocks/functions with ENO which are
controlled by the status of EN.
E_BOOL_TO_DWORD In this example the function E_BOOL_TO_DWORD is programmed in la
dder diagram (LD) and instruction list (IL). The same POU header is used for bot
h programming languages. POU Header All input and output variables which are req
uired for programming the function are declared in the POU header.
,
Example
In this example the input variables (Boolean_value and enable) have been declare
d. However, you may enter constants directly at the input contact of the functio
n (enable input e.g. for tests). LD If enable is set (TRUE), the Boolean_value (
1 bit) is converted into a value of the data type DOUBLE WORD. The converted val
ue is written into DWORD_value.
IL If you want to call up the function in an instruction list, enter the followi
ng:
+ Note
2 – 10
It does not matter whether the function names in the IL editor are capitalized o
r not.
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Functions Conversion Functions
(E_)INT_TO_BOOL
Outline
INT_TO_BOOL converts a value of the type INT into a value of the type BOOL. If y
ou require an enable output and an enable input: E_INT_TO_BOOL
J Data Types
Input Variable
INTEGER
Output Variable
BOOL
,
Example
INT_TO_BOOL In this example the function INT_TO_BOOL is programmed in ladder dia
gram (LD) and instruction list (IL). The same POU header is used for both progra
mming languages. POU Header All input and output variables which are required fo
r programming the function are declared in the POU header.
In this example the input variable (INT_value) has been declared. Instead, you m
ay enter a constant directly at the input contact of the function. LD INT_value
(16 bit) of the data type INTEGER is converted into a Boolean value. The result
is written into Boolean_value.
IL If you want to call the function in an instruction list, enter the following:
* Notes next page
Matsushita Electric Works (Europe) AG
2 – 11
IEC Functions Conversion Functions
NAiS Control 1131
Outline
Anything stated under INT_TO_BOOL also applies to E_INT_TO_BOOL. The function E_
INT_TO_BOOL, however, has in addition an enabled input (EN = enable) and an enab
led output (ENO = enable output) of the data type BOOL. If EN is set (TRUE), E_I
NT_TO_BOOL will be activated. If EN is reset (FALSE), the status of the variable
will be frozen until EN is set again. ENO will adopt the status of EN. Therefor
e, you may connect further function blocks/functions with ENO which are controll
ed by the status of EN.
E_INT_TO_BOOL In this example the function E_INT_TO_BOOL is programmed in ladder
diagram (LD) and instruction list (IL). The same POU header is used for both pr
ogramming languages. POU Header All input and output variables which are require
d for programming the function are declared in the POU header.
,
Example
In this example the input variables (INT_value and enable) have been declared. I
nstead, you may enter constants directly at the input contact of the function (e
nable input e.g. for tests). LD If enable is set (TRUE), the INT_value of the da
ta type INTEGER (16 bit) is converted into a Boolean value (1 bit). The converte
d value is written into Boolean_value.
IL If you want to call the function in an instruction list, enter the following:
+ Notes
• •
If INT_value has the value 0, the conversion result will be 0 (FALSE), in any ot
her case it will be 1 (TRUE). It does not matter whether the function names in t
he IL editor are capitalized or not.
Matsushita Electric Works (Europe) AG
2 – 12
NAiS Control 1131
IEC Functions Conversion Functions
(E_)INT_TO_DINT
Outline
INT_TO_DINT converts a value of the type INT into a value of the type DINT. If y
ou require an enable output and an enable input: E_INT_TO_DINT
J Data Types
Input Variable
INTEGER
Output Variable
DOUBLE INTEGER
,
Example
INT_TO_DINT In this example the function INT_TO_DINT is programmed in ladder dia
gram (LD) and instruction list (IL). The same POU header is used for both progra
mming languages. POU Header All input and output variables which are required fo
r programming the function are declared in the POU header.
In this example the input variable (INT_value) has been declared. However, you m
ay enter a constant directly at the input contact of the function. LD INT_value
of the data type INTEGER is converted into a value of the data type DOUBLE INTEG
ER. The result will be written into DINT_value.
IL If you want to call the function in an instruction list, enter the following:
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not. * next page
Matsushita Electric Works (Europe) AG
2 – 13
IEC Functions Conversion Functions
NAiS Control 1131
Outline
Anything stated under INT_TO_DINT also applies to E_INT_TO_DINT. The function E_
INT_TO_DINT, however, has in addition an enabled input (EN = enable) and an enab
led output (ENO = enable output) of the data type BOOL. If EN is set (TRUE), E_I
NT_TO_DINT will be activated. If EN is reset (FALSE), the status of the variable
will be frozen until EN is set again. ENO will adopt the status of EN. Therefor
e, you may connect further function blocks/functions with ENO which are controll
ed by the status of EN.
E_INT_TO_DINT In this example the function E_INT_TO_DINT is programmed in ladder
diagram (LD) and instruction list (IL). The same POU header is used for both pr
ogramming languages. POU Header All input and output variables which are require
d for programming the function are declared in the POU header.
,
Example
In this example the input variables (INT_value and enable) have been declared. H
owever, you may enter constants directy at the input contact ofthe function (ena
ble input e.g. for tests). LD If enable is set (TRUE), the INT_value of the data
type INTEGER (16 bit) is converted into a value of the data type DOUBLE INTEGER
(32 bit). The converted value is written into DINT_value.
IL If you want to call the function in an instruction list, enter the following:
+ Note
2 – 14
It does not matter whether the function names in the IL editor are capitalized o
r not.
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Functions Conversion Functions
(E_)INT_TO_WORD
Outline
INT_TO_WORD converts a value of the type INT into a value of the type WORD. If y
ou require an enable output and an enable input: E_INT_TO_WORD
J Data Types
Input Variable
INTEGER
Output Variable
WORD
,
Example
INT_TO_WORD In this example the function INT_TO_WORD is programmed in ladder dia
gram (LD) and instruction list (IL). The same POU header is used for both progra
mming languages. POU Header All input and output variables which are required fo
r programming the function are declared in the POU header.
This example uses variables. You may also use constants for the input variables.
LD INT_value of the data type INTEGER is converted into a value of the data typ
e WORD. The result is written in WORD_value.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
* Notes next page
Matsushita Electric Works (Europe) AG
2 – 15
IEC Functions Conversion Functions
NAiS Control 1131
Outline
Anything stated under INT_TO_WORD also applies to E_INT_TO_WORD. The function E_
INT_TO_WORD, however, has in addition an enabled input (EN = enable) and an enab
led output (ENO = enable output) of the data type BOOL. If EN is set (TRUE), E_I
NT_TO_WORD will be activated. If EN is reset (FALSE), the status of the variable
will be frozen until EN is set again. ENO will adopt the status of EN. Therefor
e, you may connect further function blocks/functions with ENO which are controll
ed by the status of EN.
E_INT_TO_WORD In this example the function E_INT_TO_WORD is programmed in ladder
diagram (LD) and instruction list (IL). The same POU header is used for both pr
ogramming languages. POU Header All input and output variables which are require
d for programming the function are declared in the POU header.
,
Example
This example uses variables. You may also use constants for the input variables.
LD If enable is set (TRUE), the INT_value of the data type INTEGER (16 bit) is
converted into a value of the data type WORD (16 bit). The converted value is wr
itten in WORD_value.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
+ Notes
• •
The bit combination of the input variable will be assigned to the output variabl
e. It does not matter whether the function names in the IL editor are capitalize
d or not.
Matsushita Electric Works (Europe) AG
2 – 16
NAiS Control 1131
IEC Functions Conversion Functions
(E_)INT_TO_DWORD
Outline
INT_TO_DWORD converts a value of the type INT into a value of the type DWORD. If
you require an enable output and an enable input: E_INT_TO_DWORD
J Data Types
Input Variable
INTEGER
Output Variable
DOUBLE WORD
,
Example
INT_TO_DWORD In this example the function INT_TO_DWORD is programmed in ladder d
iagram (LD) and instruction list (IL). The same POU header is used for both prog
ramming languages. POU Header All input and output variables which are required
for programming the function are declared in the POU header.
This example uses variables. You may also use constants for the input variables.
LD INT_value of the data type INTEGER is converted into a value of the data typ
e DOUBLE WORD (32 bit). The result is written in DWORD_value.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not. * next page
Matsushita Electric Works (Europe) AG
2 – 17
IEC Functions Conversion Functions
NAiS Control 1131
Outline
Anything stated under INT_TO_DWORD also applies to E_INT_TO_DWORD. The function
E_INT_TO_DWORD, however, has in addition an enabled input (EN = enable) and an e
nabled output (ENO = enable output) of the data type BOOL. If EN is set (TRUE),
E_INT_TO_DWORD will be activated. If EN is reset (FALSE), the status of the vari
able will be frozen until EN is set again. ENO will adopt the status of EN. Ther
efore, you may connect further function blocks/functions with ENO which are cont
rolled by the status of EN.
E_INT_TO_DWORD In this example the function E_INT_TO_DWORD is programmed in ladd
er diagram (LD) and instruction list (IL). The same POU header is used for both
programming languages. POU Header All input and output variables which are requi
red for programming the function are declared in the POU header.
,
Example
This example uses variables. You may also use constants for the input variables.
LD If enable is set (TRUE), the INT_value of the data type INTEGER (16 bit) is
converted into a value of the data type DOUBLE WORD (32 bit). The converted valu
e is written in DWORD_value.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
+ Note
2 – 18
It does not matter whether the function names in the IL editor are capitalized o
r not.
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Functions Conversion Functions
(E_)INT_TO_REAL
Outline
INT_TO_REAL converts a value of the data type INTEGER into a value of the data t
ype REAL. If you require an enable input (EN) and an enable output (ENO): E_INT_
TO_REAL
J Data Types
Input Variable
INTEGER
Output Variable
REAL
,
Example
INT_TO_REAL In this example the function INT_TO_REAL is programmed in ladder dia
gram (LD) and instruction list (IL). The same POU header is used for both progra
mming languages. POU Header All input and output variables which are required fo
r programming the function are declared in the POU header.
In this example the input variable (INT_value) has been declared. Instead, you m
ay enter a constant directy at the input contact ofthe function. LD INT_value of
the data type INTEGER is converted into a value of the data type REAL.The conve
rted value is stored in REAL_value.
IL If you want to call the function in an instruction list, enter the following:
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not. * next page
Matsushita Electric Works (Europe) AG
2 – 19
IEC Functions Conversion Functions
NAiS Control 1131
Outline
Anything stated under INT_TO_REAL also applies to E_INT_TO_REAL. However, in add
ition to the INT_TO_REAL function, E_INT_TO_REAL has an enable input (EN) and an
enable output (ENO) of the data type BOOL. If EN is set (TRUE), E_INT_TO_REAL w
ill be activated. If EN is reset (FALSE), the status of the variable will be fro
zen until EN is set again. ENO will adopt the status of EN. Therefore, you may c
onnect further function blocks/functions with ENO which are controlled by the st
atus of EN.
J Data Types
Input Variable
INTEGER
Output Variable
REAL
,
Example
E_INT_TO_REAL In this example the function E_INT_TO_REAL is programmed in ladder
diagram (LD) and instruction list (IL). The same POU header is used for both pr
ogramming languages. POU Header All input and output variables which are require
d for programming the function are declared in the POU header.
In this example the input variables (INT_value and enable) have been declared. I
nstead, you may enter constants directy at the input contact ofthe function (ena
ble input e.g. for tests). LD If enable is set (TRUE), INT_value of the data typ
e INTEGER is converted into a value of the data type REAL. The converted value i
s written into REAL_value.
IL If you want to call the function in an instruction list, enter the following:
+ Note
2 – 20
It does not matter whether the function names in the IL editor are capitalized o
r not.
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Functions Conversion Functions
(E_)INT_TO_TIME
Outline
INT_TO_TIME converts a value of the type INT into a value of the type TIME. The
resolution is 10ms, e.g. when the INTEGER value = 350, the TIME value = 3s500ms.
If you require an enable output and an enable input: E_INT_TO_TIME.
J Data Types
Input Variable
INTEGER
Output Variable
TIME
,
Example
INT_TO_TIME In this example the function INT_TO_TIME is programmed in ladder dia
gram (LD) and instruction list (IL). The same POU header is used for both progra
mming languages. POE Header All input and output variables which are required fo
r programming the function are declared in the POU header.
This example uses variables. You may also use constants for the input variables.
LD INT_value of the data type INTEGER is converted into a value of the data typ
e TIME. The result will be written into the output variable time_value.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not. * next page
Matsushita Electric Works (Europe) AG
2 – 21
IEC Functions Conversion Functions
NAiS Control 1131
Outline
Anything stated under INT_TO_TIME also applies to E_INT_TO_TIME. The function E_
WORD_TO_DWORD, however, has in addition an enabled input (EN = enable) and an en
abled output (ENO = enable output) of the data type BOOL. If EN is set (TRUE), E
_INT_TO_TIME will be activated. If EN is reset (FALSE), the status of the variab
le will be frozen until EN is set again. ENO will adopt the status of EN. Theref
ore, you may connect further function blocks/functions with ENO which are contro
lled by the status of EN.
E_INT_TO_TIME In this example the function E_INT_TO_TIME is programmed in ladder
diagram (LD) and instruction list (IL). The same POU header is used for both pr
ogramming languages. POE Header All input and output variables which are require
d for programming the function are declared in the POU header.
,
Example
This example uses variables. You may also use constants for the input variables.
LD If enable is set (TRUE), INT _value of the data type INTEGER will be convert
ed into a value of the data type TIME. The result will be written into the outpu
t variable time_value. Once the function has been processed, ENO will be set.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
+ Note
2 – 22
It does not matter whether the function names in the IL editor are capitalized o
r not.
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Functions Conversion Functions
(E_)INT_TO_BCD
Outline
INT_TO_BCD converts a binary value of the type INTEGER in a BCD value (binary co
ded decimal integer) of the type WORD in order to be able to output BCD values i
n word format. If you require an enable output and an enable input: E_INT_TO_BCD
J Data Types
Input Variable
INTEGER
Output Variable
WORD
,
Example
INT_TO_BCD In this example the function INT_TO_BCD is programmed in ladder diagr
am (LD) and instruction list (IL). The same POU header is used for both programm
ing languages. POU Header All input and output variables which are required for
programming the function are declared in the POU header.
In this example the input variable (INT_value) has been declared. Instead, you m
ay enter a decimal constant (0 – 9999) directly at the input contact of the func
tion. LD INT_value of the data type INTEGER is converted into a BCD value of the
data type WORD. The converted value is written into BCD_value_16bit.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
* Notes next page
Matsushita Electric Works (Europe) AG
2 – 23
IEC Functions Conversion Functions
NAiS Control 1131
Outline
Anything stated under INT_TO_BCD also applies to E_INT_TO_BCD. E_INT_TO_BCD, how
ever, has in addition an enabled input (EN = enable) and an enabled output (ENO
= enable output) of the type BOOL. If EN is set (TRUE), E_INT_TO_BCD will be act
ivated. If EN is reset (FALSE), the status of the variable will be frozen until
EN is set again. ENO will adopt the status of EN. Therefore, you may connect fur
ther function blocks/functions with ENO which are controlled by the status of EN
.
E_INT_TO_BCD E_INT_TO_BCD is programmed in ladder diagram (LD) and instruction l
ist (IL). The same POU header is used for both programming languages. POU Header
All input and output variables which are required for programming the function
are declared in the POU header.
,
Example
In this example the input variables (INT_value and enable) have been declared. I
nstead, you may enter decimal constants (0 – 9999) for INT_value and a constant
for the enable input (e.g. for tests) directly at the input contact of the funct
ion instead. LD If enable is set (TRUE), INT_value of the data type INTEGER is c
onverted into a BCD value of the data type WORD. The converted value is written
into BCD_value_16bit. IL If you wish to call up the function in an instruction l
ist, enter the following:
+ Notes
• •
Since the output variable is of the type WORD and 16 bits wide, the value of the
input variable should have a maximum of 4 decimal places and should thus be loc
ated between 0 and 9999. It does not matter whether the function names in the IL
editor are capitalized or not.
Matsushita Electric Works (Europe) AG
2 – 24
NAiS Control 1131
IEC Functions Conversion Functions
(E_)DINT_TO_BOOL
Outline
DINT_TO_BOOL converts a value of the data type DINT into a value of the data typ
e BOOL. If you require an enable output and an enable input: E_DINT_TO_BOOL
J Data Types
Input Variable
DOUBLE INTEGER
Output Variable
BOOL
,
Example
DINT_TO_BOOL In this example the function DINT_TO_BOOL is programmed in ladder d
iagram (LD) and instruction list (IL). The same POU header is used for both prog
ramming languages. POU Header All input and output variables which are required
for programming the function are declared in the POU header.
This example uses variables. You may also use constants for the input variables.
LD DINT_value of the data type DOUBLE INTEGER is converted into a value of the
data type BOOL. The converted value in written in Boolean_value.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
* Notes next page
Matsushita Electric Works (Europe) AG
2 – 25
IEC Functions Conversion Functions
NAiS Control 1131
Outline
Anything stated under DINT_TO_BOOL also applies to E_DINT_TO_BOOL. E_DINT_TO_BOO
L, however, has in addition an enabled input (EN = enable) and an enabled output
(ENO = enable output) of the data type BOOL. If EN is set (TRUE), E_DINT_TO_BOO
L will be activated. If EN is reset (FALSE), the status of the variable will be
frozen until EN is set again. ENO will adopt the status of EN. Therefore, you ma
y connect further function blocks/functions with ENO which are controlled by the
status of EN.
E_DINT_TO_BOOL In this example the function E_DINT_TO_BOOL is programmed in ladd
er diagram (LD) and instruction list (IL). The same POU header is used for both
programming languages. POU Header All input and output variables which are requi
red for programming the function are declared in the POU header.
,
Example
This example uses variables. You may also use constants for the input variables.
LD DINT_value of the data type DOUBLE INTEGER (32 bit) is converted into a Bool
ean value (1 bit). The converted value is written in Boolean_value.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
+ Notes
• •
If the variable DINT_value has the value 0, the conversion result = FALSE, in an
y other case it will be TRUE. It does not matter whether the function names in t
he IL editor are capitalized or not.
Matsushita Electric Works (Europe) AG
2 – 26
NAiS Control 1131
IEC Functions Conversion Functions
(E_)DINT_TO_INT
Outline
DINT_TO_INT converts a value of the data type DINT into a value of the data type
INT. If you require an enable output and an enable input: E_DINT_TO_INT
J Data Types
Input Variable
DOUBLE INTEGER
Output Variable
INTEGER
,
Example
DINT_TO_INT In this example the function DINT_TO_INT is programmed in ladder dia
gram (LD) and instruction list (IL). The same POU header is used for both progra
mming languages. POU Header All input and output variables which are required fo
r programming the function are declared in the POU header.
This example uses variables. You may also use constants for the input variables.
LD DINT_value of the data type DOUBLE INTEGER (32 bit) is converted into a valu
e of the data type INTEGER (16 bit). The converted value is written in INT_value
.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
* Notes next page
Matsushita Electric Works (Europe) AG
2 – 27
IEC Functions Conversion Functions
NAiS Control 1131
Outline
Anything stated under DINT_TO_INT also applies to E_DINT_TO_INT. The function E_
DINT_TO_INT, however, has in addition an enabled input (EN = enable) and an enab
led output (ENO = enable output) of the data type BOOL. If EN is set (TRUE), E_D
INT_TO_INT will be activated. If EN is reset (FALSE), the status of the variable
will be frozen until EN is set again. ENO will adopt the status of EN. Therefor
e, you may connect further function blocks/functions with ENO which are controll
ed by the status of EN.
E_DINT_TO_INT In this example the function E_DINT_TO_INT is programmed in ladder
diagram (LD) and instruction list (IL). The same POU header is used for both pr
ogramming languages. POU Header All input and output variables which are require
d for programming the function are declared in the POU header.
,
Example
This example uses variables. You may also use constants for the input variables.
LD If enable is set (TRUE), the DINT_value of the data type DOUBLE INTEGER (32
bit) will be converted into a value of the data type INTEGER (16 bit). The conve
rted value will be written in INT_value.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
+ Notes
• •
The value of the input variable should be between –32768 and 32767. It does not
matter whether the function names in the IL editor are capitalized or not.
Matsushita Electric Works (Europe) AG
2 – 28
NAiS Control 1131
IEC Functions Conversion Functions
(E_)DINT_TO_WORD
Outline
DINT_TO_WORD converts a value of the data type DINT into a value of the data typ
e WORD. If you require an enable output and an enable input: E_DINT_TO_WORD
J Data Types
Input Variable
DOUBLE INTEGER
Output Variable
WORD
,
Example
DINT_TO_WORD In this example the function DINT_TO_WORD is programmed in ladder d
iagram (LD) and instruction list (IL). The same POU header is used for both prog
ramming languages. POU Header All input and output variables which are required
for programming the function are declared in the POU header.
This example uses variables. You may also use constants for the input variables.
LD DINT_value of the data type DOUBLE INTEGER (32 bit) is converted into a valu
e of the data type WORD (16 bit). The converted value is written in WORD_value.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
* Notes next page
Matsushita Electric Works (Europe) AG
2 – 29
IEC Functions Conversion Functions
NAiS Control 1131
Outline
Anything stated under DINT_TO_WORD also applies to E_DINT_TO_WORD. E_DINT_TO_WOR
D, however, has in addition an enabled input (EN = enable) and an enabled output
(ENO = enable output) of the data type BOOL. If EN is set (TRUE), E_DINT_TO_WOR
D will be activated. If EN is reset (FALSE), the status of the variable will be
frozen until EN is set again. ENO will adopt the status of EN. Therefore, you ma
y connect further function blocks/functions with ENO which are controlled by the
status of EN.
E_DINT_TO_WORD In this example the function E_DINT_TO_WORD is programmed in ladd
er diagram (LD) and instruction list (IL). The same POU header is used for both
programming languages. POU Header All input and output variables which are requi
red for programming the function are declared in the POU header.
,
Example
This example uses variables. You may also use constants for the input variables.
LD If enable is set (TRUE), the DINT_value of the data type DOUBLE INTEGER (32
bit) will be converted into a value of the data type WORD (15 bit). The converte
d value will be written in WORD_value.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
+ Notes
• •
The first 16 bits of the input variable are assigned to the output variable. It
does not matter whether the function names in the IL editor are capitalized or n
ot.
Matsushita Electric Works (Europe) AG
2 – 30
NAiS Control 1131
IEC Functions Conversion Functions
(E_)DINT_TO_TIME
Outline
DINT_TO_TIME bzw. E_DINT_TO_TIME converts a value of the data type DINT into a v
alue of the data type TIME. A value of 1 corresponds to a time of 10ms, e.g. an
input value of 123 is converted to a TIME T#1s230.00ms.
J Data types
input variable
DINT
output variable
TIME
,
Example
DINT_TO_TIME In this example the function DINT_TO_TIME is programmed in ladder d
iagram (LD) and instruction list (IL). The same POU header is used for both prog
ramming languages. POU Header In the POU header, all input and output variables
are declared that are used for programming this function.
In this example, the input variable DINT_value is declared. However, you can wri
te a constant directly at the input contact of the function instead. Body DINT_v
alue of the data type DOUBLE INTEGER is converted to value of the data type TIME
. The result is written into the output variable time_value. LD Body
IL Body If you wish to call up the function using instruction list, enter the fo
llowing:
* Note next page
Matsushita Electric Works (Europe) AG
2 – 31
IEC Functions Conversion Functions
NAiS Control 1131
Outline
E_DINT_TO_TIME has in addition an enabled input (EN) and an enable output (ENO)
of the data type BOOL. If EN is set (TRUE), the function is activated. If EN is
reset (FALSE), the status of the variable will be frozen until EN is set again.
ENO will adopt the status of EN. Hence, you can connect further FP/FUN to the EN
O that are determined by EN.
E_DINT_TO_TIME POU Header In the POU header, all input and output variables are
declared that are used for programming this function.
,
Example
In this example, the input variables start and DINT_value have been declared. Ho
wever, you can write a constant directly at the input contact of the function in
stead. Body When start is set (TRUE), DINT_value of the data type DOUBLE INTEGER
is converted to a value of the data type TIME. The result is written into the o
utput variable time_value. After the function has been processed, ENO is set. LD
Body
IL Body If you wish to call up the function using instruction list, enter the fo
llowing:
+ Note
It does not matter whether the names of the functions are capitalized in the IL
editor or not.
2 – 32
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Functions Conversion Functions
(E_)DINT_TO_DWORD
Outline
DINT_TO_DWORD converts a value of the data type DINT into a value of the data ty
pe DWORD. If you require an enable output and an enable input: E_DINT_TO_DWORD
J Data Types
Input Variable
DOUBLE INTEGER
Output Variable
DOUBLE WORD
,
Example
DINT_TO_DWORD In this example the function DINT_TO_DWORD is programmed in ladder
diagram (LD) and instruction list (IL). The same POU header is used for both pr
ogramming languages. POU Header All input and output variables which are require
d for programming the function are declared in the POU header.
This example uses variables. You may also use constants for the input variables.
LD DINT_value of the data type DOUBLE INTEGER is converted into a value of the
data type DOUBLE WORD. The converted value is written in DWORD_value.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
* Notes next page
Matsushita Electric Works (Europe) AG
2 – 33
IEC Functions Conversion Functions
NAiS Control 1131
Outline
Anything stated under DINT_TO_DWORD also applies to E_DINT_TO_DWORD. E_DINT_TO_D
WORD, however, has in addition an enabled input (EN = enable) and an enabled out
put (ENO = enable output) of the data type BOOL. If EN is set (TRUE), E_DINT_TO_
DWORD will be activated. If EN is reset (FALSE), the status of the variable will
be frozen until EN is set again. ENO will adopt the status of EN. Therefore, yo
u may connect further function blocks/functions with ENO which are controlled by
the status of EN.
E_DINT_TO_DWORD In this example the function E_DINT_TO_DWORD is programmed in la
dder diagram (LD) and instruction list (IL). The same POU header is used for bot
h programming languages. POU Header All input and output variables which are req
uired for programming the function are declared in the POU header.
,
Example
This example uses variables. You may also use constants for the input variables.
LD If enable is set (TRUE), the DINT_value of the data type DOUBLE INTEGER (32
bit) will be converted into a value of the data type DOUBLE WORD (32 bit). The c
onverted value will be written in DWORD_value.|
IL If you wish to call up the function in an instruction list, enter the followi
ng:
+ Notes
• •
The bit combination of the input variable is assigned to the output variable. It
does not matter whether the function names in the IL editor are capitalized or
not.
Matsushita Electric Works (Europe) AG
2 – 34
NAiS Control 1131
IEC Functions Conversion Functions
(E_)DINT_TO_REAL
Outline
DINT_TO_REAL converts a value of the data type DOUBLE INTEGER into a value of th
e data type REAL. If you require an enable input (EN) and an enable output (ENO)
: E_DINT_TO_REAL
+ Note
J Data Types
This function is only available for the FP0.
Input Variable
DOUBLE INTEGER
Output Variable
REAL
,
Example
DINT_TO_REAL In this example the function DINT_TO_REAL is programmed in ladder d
iagram (LD) and instruction list (IL). The same POU header is used for both prog
ramming languages. POU Header All input and output variables which are required
for programming the function are declared in the POU header.
In this example the input variable (DINT_value) has been declared. Instead, you
may enter a constant directly at the input contact of the function. LD DINT_valu
e of the data type DOUBLE INTEGER is converted into a value of the data type REA
L. The converted value is stored in REAL_value.
IL If you want to call the function in an instruction list, enter the following:
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not.
2 – 35
Matsushita Electric Works (Europe) AG
IEC Functions Conversion Functions
NAiS Control 1131
Outline
Anything stated under DINT_TO_REAL also applies to E_DINT_TO_REAL. However, in a
ddition to the DINT_TO_REAL function, E_DINT_TO_REAL has an enable input (EN) an
d an enable output (ENO) of the data type BOOL. If EN is set (TRUE), E_DINT_TO_R
EAL will be activated. If EN is reset (FALSE), the status of the variable will b
e frozen until EN is set again. ENO will adopt the status of EN. Therefore, you
may connect further function blocks/functions with ENO which are controlled by t
he status of EN.
J Data Types
Input Variable
DOUBLE INTEGER
Output Variable
REAL
,
Example
E_DINT_TO_REAL In this example the function E_DINT_TO_REAL is programmed in ladd
er diagram (LD) and instruction list (IL). The same POU header is used for both
programming languages. POU Header All input and output variables which are requi
red for programming the function are declared in the POU header.
In this example the input variables (DINT_value and enable) have been declared.
Instead, you may enter constants directly at the input contact of the function (
enable input e.g. for tests). LD If enable is set (TRUE), DINT_value of the data
type DOUBLE INTEGER is converted into a value of the data type REAL. The conver
ted value is stored in REAL_value.
IL If you want to call the function in an instruction list, enter the following:
+ Note
2 – 36
It is not important whether the function names in the IL editor are capitalized
or not.
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Functions Conversion Functions
(E_)DINT_TO_BCD
Outline
DINT_TO_BCD converts a value of the data type DINT into a BCD value of the data
type DWORD. If you require an enable output and an enable input: E_DINT_TO_BCD
J Data Types
Input Variable
DOUBLE INTEGER
Output Variable
DOUBLE WORD
,
Example
DINT_TO_BCD In this example the function DINT_TO_BCD is programmed in ladder dia
gram (LD) and instruction list (IL). The same POU header is used for both progra
mming languages. POU Header All input and output variables which are required fo
r programming the function are declared in the POU header.
This example uses variables. You may also use constants. LD DINT_value of the da
ta type DOUBLE INTEGER is converted into a BCD value of the data type DOUBLE WOR
D. The converted value is written in BCD_value_32bit.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
* Notes next page
Matsushita Electric Works (Europe) AG
2 – 37
IEC Functions Conversion Functions
NAiS Control 1131
Outline
Anything stated under DINT_TO_BCD also applies to E_DINT_TO_BCD. The function E_
DINT_TO_BCD, however, has in addition an enabled input (EN = enable) and an enab
led output (ENO = enable output) of the data type BOOL. If EN is set (TRUE), E_B
CD_TO_INT will be activated. If EN is reset (FALSE), the status of the variable
will be frozen until EN is set again. ENO will adopt the status of EN. Therefore
, you may connect further function blocks/functions with ENO which are controlle
d by the status of EN.
E_DINT_TO_BCD In this example the function E_DINT_TO_BCD is programmed in ladder
diagram (LD) and instruction list (IL). The same POU header is used for both pr
ogramming languages. POU Header All input and output variables which are require
d for programming the function are declared in the POU header.
,
Example
This example uses variables. You may also use constants for the input variables.
LD If enable is set (TRUE), the DINT_value of the data type DOUBLE INTEGER (32
bit) will be converted into a BCD value of the data type DOUBLE WORD (32 bit). T
he converted value will be written in BCD_value_32bit.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
+ Notes
• •
The value for the input variable should be between 0 and 99999999. It is not imp
ortant whether the function names in the IL editor are capitalized or not.
Matsushita Electric Works (Europe) AG
2 – 38
NAiS Control 1131
IEC Functions Conversion Functions
(E_)WORD_TO_BOOL
Outline
WORD_TO_BOOL converts a value of the type WORD into a value of the type BOOL. If
you require an enable output and an enable input: E_WORD_TO_BOOL
J Data Types
Input Variable
WORD
Output Variable
BOOL
,
Example
WORD_TO_BOOL In this example the function WORD_TO_BOOL is programmed in ladder d
iagram (LD) and instruction list (IL). The same POU header is used for both prog
ramming languages. POU Header All input and output variables which are required
for programming the function are declared in the POU header.
This example uses variables. You may also use constants for the input variables.
LD WORD_value_16bit of the data type WORD is converted into a Boolean value (1
bit). The result will be written in Boolean_value.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
* Notes next page
Matsushita Electric Works (Europe) AG
2 – 39
IEC Functions Conversion Functions
NAiS Control 1131
Outline
Anything stated under WORD_TO_BOOL also applies to E_WORD_TO_BOOL. E_WORD_TO_BOO
L, however, has in addition an enabled input (EN = enable) and an enabled output
(ENO = enable output) of the data type BOOL. If EN is set (TRUE), E_WORD_TO_BOO
L will be activated. If EN is reset (FALSE), the status of the variable will be
frozen until EN is set again. ENO will adopt the status of EN. Therefore, you ma
y connect further function blocks/functions with ENO which are controlled by the
status of EN.
E_WORD_TO_BOOL In this example the function E_WORD_TO_BOOL is programmed in ladd
er diagram (LD) and instruction list (IL). The same POU header is used for both
programming languages. POU Header All input and output variables which are requi
red for programming the function are declared in the POU header.
,
Example
This example uses variables. You may also use constants for the input variables.
LD If enable is set, the value WORD _value (16 bit) of the data type WORD will
be converted into a Boolean value. The result will be written in Boolean_value.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
+ Notes
• •
If the variable WORD_value has the value 0 (16#0000), the conversion result will
be = 0 (FALSE), in any other case it will be 1 (TRUE). It does not matter wheth
er the function names in the IL editor are capitalized or not.
Matsushita Electric Works (Europe) AG
2 – 40
NAiS Control 1131
IEC Functions Conversion Functions
(E_)WORD_TO_INT
Outline
WORD_TO_INT converts a value of the type WORD into a value of the type INT. If y
ou require an enable output and an enable input: E_WORD_TO_INT
J Data Types
Input Variable
WORD
Output Variable
INTEGER
,
Example
WORD_TO_INT In this example the function WORD_TO_INT is programmed in ladder dia
gram (LD) and instruction list (IL). The same POU header is used for both progra
mming languages. POU Header All input and output variables which are required fo
r programming the function are declared in the POU header.
This example uses variables. You may also use constants/variables. LD WORD_value
of the data type WORD is converted into a value of the data type INTEGER. The r
esult will be written in INT_value.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not.
Matsushita Electric Works (Europe) AG
2 – 41
IEC Functions Conversion Functions
NAiS Control 1131
Outline
Anything stated under WORD_TO_INT also applies to E_WORD_TO_INT. The function E_
WORD_TO_INT, however, has in addition an enabled input (EN = enable) and an enab
led output (ENO = enable output) of the data type BOOL. If EN is set (TRUE), E_W
ORD_TO_INT will be activated. If EN is reset (FALSE), the status of the variable
will be frozen until EN is set again. ENO will adopt the status of EN. Therefor
e, you may connect further function blocks/functions with ENO which are controll
ed by the status of EN.
E_WORD_TO_INT In this example the function E_WORD_TO_INT is programmed in ladder
diagram (LD) and instruction list (IL). The same POU header is used for both pr
ogramming languages. POU Header All input and output variables which are require
d for programming the function are declared in the POU header.
,
Example
This example uses variables. You may also use constants for the input variables.
LD If enable is set, the value in WORD _value (16 bit) of the data type WORD wi
ll be converted into an INTEGER value. The result will be written in INT_value.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
+ Notes
• •
The bit combination of WORD_value is assigned to INT_value. It does not matter w
hether the function names in the IL editor are capitalized or not.
2 – 42
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Functions Conversion Functions
(E_)WORD_TO_DINT
Outline
WORD_TO_DINT converts a value of the type WORD into a value of the type DINT. If
you require an enable output and an enable input: E_WORD_TO_DINT
J Data Types
Input Variable
WORD
Output Variable
DOUBLE INTEGER
,
Example
WORD_TO_DINT In this example the function WORD_TO_DINT is programmed in ladder d
iagram (LD) and instruction list (IL). The same POU header is used for both prog
ramming languages. POU Header All input and output variables which are required
for programming the function are declared in the POU header.
This example uses variables. You may also use constants/variables. LD WORD_value
of the data type WORD is converted into a value of the data type INTEGER. The r
esult will be written in DINT_value.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not.
Matsushita Electric Works (Europe) AG
2 – 43
IEC Functions Conversion Functions
NAiS Control 1131
Outline
Anything stated under WORD_TO_DINT also applies to E_WORD_TO_DINT. E_WORD_TO_DIN
T, however, has in addition an enabled input (EN = enable) and an enabled output
(ENO = enable output) of the data type BOOL. If EN is set (TRUE), E_WORD_TO_DIN
T will be activated. If EN is reset (FALSE), the status of the variable will be
frozen until EN is set again. ENO will adopt the status of EN. Therefore, you ma
y connect further function blocks/functions with ENO which are controlled by the
status of EN.
E_WORD_TO_DINT In this example the function E_WORD_TO_DINT is programmed in ladd
er diagram (LD) and instruction list (IL). The same POU header is used for both
programming languages. POU Header All input and output variables which are requi
red for programming the function are declared in the POU header.
,
Example
This example uses variables. You may also use constants for the input variables.
LD If enable is set, the value WORD _value (16 bit) of the data type WORD will
be converted into a value of the data type DOUBLE INTEGER. The result will be wr
itten in DINT_value.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
+ Note
2 – 44
It does not matter whether the function names in the IL editor are capitalized o
r not.
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Functions Conversion Functions
(E_)WORD_TO_DWORD
Outline
WORD_TO_DWORD converts a value of the type WORD into a value of the type DWORD.
If you require an enable output and an enable input: E_WORD_TO_DWORD
J Data Types
Input Variable
WORD
Output Variable
DOUBLE WORD
,
Example
WORD_TO_DWORD In this example the function WORD_TO_DWORD is programmed in ladder
diagram (LD) and instruction list (IL). The same POU header is used for both pr
ogramming languages. POU Header All input and output variables which are require
d for programming the function are declared in the POU header.
This example uses variables. You may also use constants/variables. LD WORD_value
of the data type WORD is converted into a value of the data type DOUBLE WORD. T
he result will be written in DWORD_value.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
+ Notes
• •
The bit combination of WORD_value is assigned to DWORD_value. It does not matter
whether the function names in the IL editor are capitalized or not.
2 – 45
Matsushita Electric Works (Europe) AG
IEC Functions Conversion Functions
NAiS Control 1131
Outline
Anything stated under WORD_TO_DWORD also applies to E_WORD_TO_DWORD. E_WORD_TO_D
WORD, however, has in addition an enabled input (EN = enable) and an enabled out
put (ENO = enable output) of the data type BOOL. If EN is set (TRUE), E_WORD_TO_
DWORD will be activated. If EN is reset (FALSE), the status of the variable will
be frozen until EN is set again. ENO will adopt the status of EN. Therefore, yo
u may connect further function blocks/functions with ENO which are controlled by
the status of EN.
WORD_TO_DWORD In this example the function E_WORD_TO_DWORD is programmed in ladd
er diagram (LD) and instruction list (IL). The same POU header is used for both
programming languages. POU Header All input and output variables which are requi
red for programming the function are declared in the POU header.
,
Example
This example uses variables. You may also use constants for the input variables.
LD If enable is set, the value in WORD _value (16 bit) of the data type WORD wi
ll be converted into a value of the data type DOUBLE WORD (32 bit). The result w
ill be written in DWORD_value.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
+ Note
2 – 46
It does not matter whether the function names in the IL editor are capitalized o
r not.
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Functions Conversion Functions
(E_)WORD_TO_TIME
Outline
WORD_TO_TIME converts a value of the type WORD into a value of the type TIME. If
you require an enable output and an enable input: E_WORD_TO_TIME
J Data Types
Input Variable
WORD
Output Variable
TIME
,
Example
WORD_TO_TIME input variable 12345 ⇒ output variable: T#123.45s or input variable
16#0012 ⇒ output variable: T#180ms In this example the function WORD_TO_TIME is
programmed in ladder diagram (LD) and instruction list (IL). The same POU heade
r is used for both programming languages. POU Header All input and output variab
les which are required for programming the function are declared in the POU head
er.
This example uses variables. You may also use constants for the input variables.
LD WORD_value of the data type WORD (16 bit) is converted into a value of the d
ata type TIME (16 bit). The result will be written into the output variable time
_value.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
* Note next page
Matsushita Electric Works (Europe) AG
2 – 47
IEC Functions Conversion Functions
NAiS Control 1131
Outline
Anything stated under WORD_TO_TIME also applies to E_WORD_TO_TIME. E_WORD_TO_TIM
E, however, has in addition an enabled input (EN = enable) and an enabled output
(ENO = enable output) of the data type BOOL. If EN is set (TRUE), E_WORD_TO_TIM
E will be activated. If EN is reset (FALSE), the status of the variable will be
frozen until EN is set again. ENO will adopt the status of EN. Therefore, you ma
y connect further function blocks/functions with ENO which are controlled by the
status of EN.
E_WORD_TO_TIME Input variable: 4444 ⇒ output variable: T#44.44s In this example
the function E_WORD_TO_TIME is programmed in ladder diagram (LD) and instruction
list (IL). The same POU header is used for both programming languages. POU Head
er All input and output variables which are required for programming the functio
n are declared in the POU header.
,
Example
This example uses variables. You may also use constants for the input variables.
LD If enable is set (TRUE), WORD _value of the data type WORD will be converted
into a value of the data type TIME. The result will be written into the output
variable time_value. Once the function has been processed, ENO will be set.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
+ Note
2 – 48
It does not matter whether the function names in the IL editor are capitalized o
r not.
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Functions Conversion Functions
(E_)DWORD_TO_BOOL
Outline
DWORD_TO_BOOL converts a value of the data type DOUBLE WORD into a value of the
data type BOOL. If you require an enable output and an enable input: E_DWORD_TO_
BOOL
J Data Types
Input Variable
DOUBLE WORD
Output Variable
BOOL
,
Example
DWORD_TO_BOOL In this example the function DWORD_TO_BOOL is programmed in ladder
diagram (LD) and instruction list (IL). The same POU header is used for both pr
ogramming languages. POU Header All input and output variables which are require
d for programming the function are declared in the POU header.
This example uses variables. You may also use constants for the input variables.
LD DWORD_value of the data type DOUBLE WORD is converted into a Boolean value (
1 bit). the converted value is written in Boolean_value.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
* Notes next page
Matsushita Electric Works (Europe) AG
2 – 49
IEC Functions Conversion Functions
NAiS Control 1131
Outline
E_DWORD_TO_BOOL converts a value of the data type DOUBLE WORD into a value of th
e data type BOOL. In addition to the DWORD_TO_BOOL function, E_DWORD_TO_BOOL has
an enable input (EN) and an enable output (ENO) of the data type BOOL. If EN is
set (TRUE), E_DWORD_TO_BOOL will be activated. If EN is not set (FALSE), the st
atus of the output variable will remain unchanged until EN is set. ENO will adop
t the status of EN. Therefore, you may connect further function blocks/functions
with ENO which are controlled by the status of EN.
E_DWORD_TO_BOOL In this example the function E_DWORD_TO_BOOL is programmed in la
dder diagram (LD) and instruction list (IL). The same POU header is used for bot
h programming languages. POU Header All input and output variables which are req
uired for programming the function are declared in the POU header.
,
Example
This example uses variables. You may also use constants for the input variables.
LD If enable is set (TRUE), the DWORD_value of the data type DOUBLE WORD will b
e converted into a Boolean value (1 bit). The converted value will be written in
Boolean_value.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
+ Notes
• •
If the variable DWORD_value has the value 0 (16#00000000), the conversion result
will be = FALSE; in any other case it will be TRUE. It does not matter whether
the function names in the IL editor are capitalized or not.
Matsushita Electric Works (Europe) AG
2 – 50
NAiS Control 1131
IEC Functions Conversion Functions
(E_)DWORD_TO_INT
Outline
DWORD_TO_INT converts a value of the data type DWORD into a value of the data ty
pe INT. If you require an enable output and an enable input: E_DWORD_TO_INT
J Data Types
Input Variable
DOUBLE WORD
Output Variable
INTEGER
,
Example
DWORD_TO_INT In this example the function DWORD_TO_INT is programmed in ladder d
iagram (LD) and instruction list (IL). The same POU header is used for both prog
ramming languages. POU Header All input and output variables which are required
for programming the function are declared in the POU header.
This example uses variables. You may also use constants for the input variables.
LD DWORD_value of the data type DOUBLE WORD (32 bit) is converted into an INTEG
ER value (16 bit). The converted value is written in INT_value.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
* Notes next page
Matsushita Electric Works (Europe) AG
2 – 51
IEC Functions Conversion Functions
NAiS Control 1131
Outline
Anything stated under DWORD_TO_INT also applies to E_DWORD_TO_INT. E_DWORD_TO_IN
T, however, has in addition an enabled input (EN = enable) and an enabled output
(ENO = enable output) of the data type BOOL. If EN is set (TRUE), E_DWORD_TO_IN
T will be activated. If EN is reset (FALSE), the status of the variable will be
frozen until EN is set again. ENO will adopt the status of EN. Therefore, you ma
y connect further function blocks/functions with ENO which are controlled by the
status of EN.
E_DWORD_TO_INT In this example the function E_DWORD_TO_INT is programmed in ladd
er diagram (LD) and instruction list (IL). The same POU header is used for both
programming languages. POU Header All input and output variables which are requi
red for programming the function are declared in the POU header.
,
Example
This example uses variables. You may also use constants for the input variables.
LD If enable is set (TRUE), the DWORD_value of the data type DOUBLE WORD (32 bi
t) will be converted into a value of the data type INTEGER (16 bit). The convert
ed value will be written in INT_value.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
+ Notes
• •
The first 16 bit of the input variable are assigned to the output variable. It d
oes not matter whether the function names in the IL editor are capitalized or no
t.
Matsushita Electric Works (Europe) AG
2 – 52
NAiS Control 1131
IEC Functions Conversion Functions
(E_)DWORD_TO_DINT
Outline
DWORD_TO_DINT converts a value of the data type DOUBLE WORD into a value of the
data type DOUBLE INTEGER. If you require an enable output and an enable input: E
_DWORD_TO_DINT
J Data Types
Input Variable
DOUBLE WORD
Output Variable
DOUBLE INTEGER
,
Example
DWORD_TO_DINT In this example the function DWORD_TO_DINT is programmed in ladder
diagram (LD) and instruction list (IL). The same POU header is used for both pr
ogramming languages. POU Header All input and output variables which are require
d for programming the function are declared in the POU header.
This example uses variables. You may also use constants for the input variables.
LD DWORD_value of the data type DOUBLE WORD is converted into a DOUBLE INTEGER
value. The converted value is written in DINT_value.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
* Notes next page
Matsushita Electric Works (Europe) AG
2 – 53
IEC Functions Conversion Functions
NAiS Control 1131
Outline
Anything stated under DWORD_TO_DINT also applies to E_DWORD_TO_DINT. The functio
n E_DWORD_TO_DINT, however, has in addition an enabled input (EN = enable) and a
n enabled output (ENO = enable output) of the data type BOOL. If EN is set (TRUE
), E_DWORD_TO_DINT will be activated. If EN is reset (FALSE), the status of the
variable will be frozen until EN is set again. ENO will adopt the status of EN.
Therefore, you may connect further function blocks/functions with ENO which are
controlled by the status of EN.
E_DWORD_TO_DINT In this example the function E_DWORD_TO_DINT is programmed in la
dder diagram (LD) and instruction list (IL). The same POU header is used for bot
h programming languages. POU Header All input and output variables which are req
uired for programming the function are declared in the POU header.
,
Example
This example uses variables. You may also use constants for the input variables.
LD If enable is set (TRUE), the DWORD _value of the data type DOUBLE WORD (32 b
it) will be converted into a value of the data type DOUBLE INTEGER (32 bit). The
converted value will be written in DINT_value.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
+ Notes
• •
The bit combination of the input variable will be assigned to the output variabl
e. It does not matter whether the function names in the IL editor are capitalize
d or not.
Matsushita Electric Works (Europe) AG
2 – 54
NAiS Control 1131
IEC Functions Conversion Functions
(E_)DWORD_TO_WORD
Outline
DWORD_TO_WORD converts a value of the data type DOUBLE WORD into a value of the
data type WORD. If you require an enable output and an enable input: E_DWORD_TO_
WORD
J Data Types
Input Variable
DOUBLE WORD
Output Variable
WORD
,
Example
DWORD_TO_WORD In this example the function DWORD_TO_WORD is programmed in ladder
diagram (LD) and instruction list (IL). The same POU header is used for both pr
ogramming languages. POU Header All input and output variables which are require
d for programming the function are declared in the POU header.
This example uses variables. You may also use constants for the input variables.
LD DWORD_value of the data type DOUBLE WORD (32 bit) is converted into a value
of the data type WORD (16 bit). The converted value is written in WORD_value.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
* Notes next page
Matsushita Electric Works (Europe) AG
2 – 55
IEC Functions Conversion Functions
NAiS Control 1131
Outline
Anything stated under DWORD_TO_WORD also applies to E_DWORD_TO_WORD. E_DWORD_TO_
WORD, however, has in addition an enabled input (EN = enable) and an enabled out
put (ENO = enable output) of the data type BOOL. If EN is set (TRUE), E_DWORD_TO
_WORD will be activated. If EN is reset (FALSE), the status of the variable will
be frozen until EN is set again. ENO will adopt the status of EN. Therefore, yo
u may connect further function blocks/functions with ENO which are controlled by
the status of EN.
E_DWORD_TO_WORD In this example the function E_DWORD_TO_WORD is programmed in la
dder diagram (LD) and instruction list (IL). The same POU header is used for bot
h programming languages. POU Header All input and output variables which are req
uired for programming the function are declared in the POU header.
,
Example
This example uses variables. You may also use constants for the input variables.
LD If enable is set (TRUE), the DWORD _value of the data type DOUBLE WORD (32 b
it) will be converted into a value of the data type WORD (16 bit). The converted
value will be written in WORD_value.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
+ Notes
• •
The first 16 bits of the input variable are assigned to the output variable. It
does not matter whether the function names in the IL editor are capitalized or n
ot.
Matsushita Electric Works (Europe) AG
2 – 56
NAiS Control 1131
IEC Functions Conversion Functions
(E_)DWORD_TO_TIME
Outline
DWORD_TO_TIME bzw. E_DWORD_TO_TIME converts a value of the data type DWORD into
a value of the data type TIME. A value of 1 corresponds to a time of 10ms, e.g.
the input value 12345 (16#3039) is converted to a TIME T#2m3s450.00ms.
J Data types
input variable
DWORD
output variable
TIME
,
Example
DWORD_TO_TIME In this example the function DWORD_TO_TIME is programmed in ladder
diagram (LD) and instruction list (IL). The same POU header is used for both pr
ogramming languages. POU Header In the POU header, all input and output variable
s are declared that are used for programming this function.
In this example, the input variable DWORD_value is declared. However, you can wr
ite a constant directly at the input contact of the function instead. Body DWORD
_value of the data type DWORD (32 bits) is converted into a value of the data ty
pe TIME (16 bits). The result is written into the output variable time_value. LD
Body
IL Body If you wish to call up the function using instruction list, enter the fo
llowing:
* Note next page
Matsushita Electric Works (Europe) AG
2 – 57
IEC Functions Conversion Functions
NAiS Control 1131
Outline
E_DWORD_TO_TIME has in addition an enabled input (EN) and an enable output (ENO)
of the data type BOOL. If EN is set (TRUE), the function is activated. If EN is
reset (FALSE), the status of the variable will be frozen until EN is set again.
The status of EN is assumed by ENO. Hence you can connect further FB/FUN that a
re determined by EN.
E_DWORD_TO_TIME POU Header In the POU header, all input and output variables are
declared that are used for programming this function.
,
Example
In this example, the input variables start and DWORD_value have been declared. H
owever, you can write a constant directly at the input contact of the function i
nstead. Body When start is set (TRUE), DWORD_value of the data type DWORD is con
verted to a value of the data type TIME. The result is written into the output v
ariable time_value. After the function has been processed, ENO is set. LD Body
IL Body If you wish to call up the function using instruction list, enter the fo
llowing:
+ Note
It does not matter whether the names of the functions are capitalized in the IL
editor or not.
2 – 58
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Functions Conversion Functions
(E_)REAL_TO_INT
Outline
REAL_TO_INT converts a value of the data type REAL into a value of the data type
INTEGER. If you require an enable input (EN) and an enable output (ENO): E_REAL
_TO_INT
+ Note
J Data Types
This function is only available for the FP0.
Input Variable
REAL
Output Variable
INTEGER
,
Example
REAL_TO_INT In this example the function REAL_TO_INT is programmed in ladder dia
gram (LD) and instruction list (IL). The same POU header is used for both progra
mming languages. POU Header All input and output variables which are required fo
r programming the function are declared in the POU header.
In this example the input variable (REAL_value) has been declared. Instead, you
may enter a constant directly at the input contact of the function. LD REAL_valu
e of the data type REAL is converted into a value of the data type INTEGER. The
converted value is stored in INT_value.
IL If you want to call the function in an instruction list, enter the following:
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not.
2 – 59
Matsushita Electric Works (Europe) AG
IEC Functions Conversion Functions
NAiS Control 1131
Outline
Anything stated under REAL_TO_INT also applies to E_REAL_TO_INT. However, in add
ition to the REAL_TO_INT function, E_REAL_TO_INT has an enable input (EN) and an
enable output (ENO) of the data type BOOL. If EN is set (TRUE), E_REAL_TO_INT w
ill be activated. If EN is reset (FALSE), the status of the variable will be fro
zen until EN is set again. ENO will adopt the status of EN. Therefore, you may c
onnect further function blocks/functions with ENO which are controlled by the st
atus of EN.
J Data Types
Input Variable
REAL
Output Variable
INTEGER
,
Example
E_REAL_TO_INT In this example the function E_REAL_TO_INT is programmed in ladder
diagram (LD) and instruction list (IL). The same POU header is used for both pr
ogramming languages. POU Header All input and output variables which are require
d for programming the function are declared in the POU header.
In this example the input variables (REAL_value and enable) have been declared.
Instead, you may enter constants directly at the input contact of the function (
enable input e.g. for tests). LD If enable is set (TRUE), REAL_value of the data
type REAL is converted into a value of the data type INTEGER. The converted val
ue is stored in INT_value.
IL If you want to call the function in an instruction list, enter the following:
+ Note
2 – 60
It does not matter whether the function names in the IL editor are capitalized o
r not.
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Functions Conversion Functions
(E_)REAL_TO_DINT
Outline
REAL_TO_DINT converts a value of the data type REAL into a value of the data typ
e DOUBLE INTEGER. If you require an enable input (EN) and an enable output (ENO)
: E_REAL_TO_DINT
+ Note
J Data Types
This function is only available for the FP0.
Input Variable
REAL
Output Variable
DOUBLE INTEGER
,
Example
REAL_TO_DINT In this example the function REAL_TO_DINT is programmed in ladder d
iagram (LD) and instruction list (IL). The same POU header is used for both prog
ramming languages. POU Header All input and output variables which are required
for programming the function are declared in the POU header.
In this example the input variable (REAL_value) has been declared. Instead, you
may enter a constant directly at the input contact of the function. LD REAL_valu
e of the data type REAL is converted into a value of the data type DOUBLE INTEGE
R. The converted value is stored in DINT_value.
IL If you want to call the function in an instruction list, enter the following:
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not.
2 – 61
Matsushita Electric Works (Europe) AG
IEC Functions Conversion Functions
NAiS Control 1131
Outline
Anything stated under REAL_TO_DINT also applies to E_REAL_TO_DINT. However, in a
ddition to the REAL_TO_DINT function, E_REAL_TO_DINT has an enable input (EN) an
d an enable output (ENO) of the data type BOOL. If EN is set (TRUE), E_REAL_TO_D
INT will be activated. If EN is reset (FALSE), the status of the variable will b
e frozen until EN is set again. ENO will adopt the status of EN. Therefore, you
may connect further function blocks/functions with ENO which are controlled by t
he status of EN.
J Data Types
Input Variable
REAL
Output Variable
DOUBLE INTEGER
,
Example
E_REAL_TO_DINT In this example the function E_REAL_TO_DINT is programmed in ladd
er diagram (LD) and instruction list (IL). The same POU header is used for both
programming languages. POU Header All input and output variables which are requi
red for programming the function are declared in the POU header.
In this example the input variables (REAL_value and enable) have been declared.
Instead, you may enter constants directly at the input contact of the function (
enable input e.g. for tests). LD If enable is set (TRUE), REAL_value of the data
type REAL is converted into a value of the data type DOUBLE INTEGER. The conver
ted value is stored in DINT_value.
IL If you want to call the function in an instruction list, enter the following:
+ Note
2 – 62
It does not matter whether the function names in the IL editor are capitalized o
r not.
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Functions Conversion Functions
(E_)TIME_TO_INT
Outline
TIME_TO_INT converts a value of the type TIME into a value of the type INT. If y
ou require an enable output and an enable input: E_TIME_TO_INT
J Data Types
Input Variable
TIME
Output Variable
INTEGER
,
Example
TIME_TO_INT Input variable: T#12.34s ⇒ output variable: 1234 In this example the
function TIME_TO_INT is programmed in ladder diagram (LD) and instruction list
(IL). The same POU header is used for both programming languages. POU Header All
input and output variables which are required for programming the function are
declared in the POU header.
This example uses variables. You may also use constants for the input variables.
LD Time_value of the data type TIME is converted into a value of the data type
INTEGER. The result will be written into the output variable INT_value.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not.
2 – 63
Matsushita Electric Works (Europe) AG
IEC Functions Conversion Functions
NAiS Control 1131
Outline
Anything stated under TIME_TO_INT also applies to E_TIME_TO_INT. The function E_
TIME_TO_INT, however, has in addition an enabled input (EN = enable) and an enab
led output (ENO = enable output) of the data type BOOL. If EN is set (TRUE), E_T
IME_TO_INT will be activated. If EN is reset (FALSE), the status of the variable
will be frozen until EN is set again. ENO will adopt the status of EN. Therefor
e, you may connect further function blocks/functions with ENO which are controll
ed by the status of EN.
E_TIME_TO_INT Input variable: T#0.34s ⇒ output variable: 34 or input variable: T
#22.22s ⇒ output variable: 2222 In this example the function E_TIME_TO_INT is pr
ogrammed in ladder diagram (LD) and instruction list (IL). The same POU header i
s used for both programming languages. POU Header All input and output variables
which are required for programming the function are declared in the POU header.
,
Example
This example uses variables. You may also use constants for the input variables.
LD If enable is set (TRUE), time_value of the data type TIME will be converted
into a value of the data type INTEGER. The result will be written into the outpu
t variable INT_value. Once the function has been processed, ENO will be set.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
+ Note
2 – 64
It does not matter whether the function names in the IL editor are capitalized o
r not.
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Functions Conversion Functions
(E_)TIME_TO_DINT
Outline
TIME_TO_DINT bzw. E_TIME_TO_DINT converts a value of the data type TIME into a v
alue of the data type DINT. The time 10ms corresponds to the value 1, e.g. an in
put value of T#1m0s is converted to the value 6000.
J Data types
input variable
TIME
output variable
DINT
,
Example
TIME_TO_DINT In this example the function TIME_TO_DINT is programmed in ladder d
iagram (LD) and instruction list (IL). The same POU header is used for both prog
ramming languages. POU Header In the POU header, all input and output variables
are declared that are used for programming this function.
In this example, the input variable time_value is declared. However, you can wri
te a constant directly at the input contact of the function instead. Body time_v
alue of the data type TIME is converted to value of the data type DOUBLE INTEGER
. The result is written into the output variable DINT_value. LD Body
IL Body If you wish to call up the function using instruction list, enter the fo
llowing:
* Note next page
Matsushita Electric Works (Europe) AG
2 – 65
IEC Functions Conversion Functions
NAiS Control 1131
Outline
E_TIME_TO_DINT has in addition an enabled input (EN) and an enable output (ENO)
of the data type BOOL. If EN is set (TRUE), the function is activated. If EN is
reset (FALSE), the status of the variable will be frozen until EN is set again.
ENO will adopt the status of EN. Hence, you can connect further FP/FUN to the EN
O that are determined by EN.
E_TIME_TO_DINT POU Header In the POU header, all input and output variables are
declared that are used for programming this function.
,
Example
In this example, the input variables start and time_value have been declared. Ho
wever, you can write a constant directly at the input contact of the function in
stead. Body When start is set (TRUE), time_value of the data type TIME is conver
ted to a value of the data type DOUBLE INTEGER. The result is written into the o
utput variable DINT_value. After the function has been processed, ENO is set. LD
Body
IL Body If you wish to call up the function using instruction list, enter the fo
llowing:
+ Note
It does not matter whether the names of the functions are capitalized in the IL
editor or not.
2 – 66
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Functions Conversion Functions
(E_)TIME_TO_WORD
Outline
TIME_TO_WORD converts a value of the type TIME into a value of the type WORD. If
you require an enable output and an enable input: E_TIME_TO_WORD
J Data Types
Input Variable
TIME
Output Variable
WORD
,
Example
TIME_TO_WORD Input variable: T#12.34s ⇒ output variable: 1234 or input variable:
T#1.00s ⇒ output variable: 16#0064 In this example the function TIME_TO_WORD is
programmed in ladder diagram (LD) and instruction list (IL). The same POU heade
r is used for both programming languages. POU Header All input and output variab
les which are required for programming the function are declared in the POU head
er.
This example uses variables. You may also use constants for the input variables.
LD Time_value of the data type TIME is converted into a value of the data type
WORD. The result will be written into the output variable WORD_value.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
* Note next page
Matsushita Electric Works (Europe) AG 2 – 67
IEC Functions Conversion Functions
NAiS Control 1131
Outline
Anything stated under TIME_TO_WORD also applies to E_TIME_TO_WORD. The function
E_TIME_TO_WORD, however, has in addition an enabled input (EN = enable) and an e
nabled output (ENO = enable output) of the data type BOOL. If EN is set (TRUE),
E_TIME_TO_WORD will be activated. If EN is reset (FALSE), the status of the vari
able will be frozen until EN is set again. ENO will adopt the status of EN. Ther
efore, you may connect further function blocks/functions with ENO which are cont
rolled by the status of EN. Input variable: T#1.44s ⇒ output variable: 144 or in
put variable: T#1.44s ⇒ output variable: 16#90
E_TIME_TO_WORD In this example the function TIME_TO_WORD is programmed in ladder
diagram (LD) and instruction list (IL). The same POU header is used for both pr
ogramming languages. POU Header All input and output variables which are require
d for programming the function are declared in the POU header.
,
Example
This example uses variables. You may also use constants for the input variables.
LD If enable is set (TRUE), the time _value of the data type TIME will be conve
rted into a value of the data type WORD. The result will be written into the out
put variable WORD_value. Once the function has been processed, ENO will be set.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
+ Note
2 – 68
It does not matter whether the function names in the IL editor are capitalized o
r not.
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Functions Conversion Functions
(E_)TIME_TO_DWORD
Outline
TIME_TO_DWORD bzw. E_TIME_TO_DWORD converts a value of the data type TIME into a
value of the data type DWORD. The time 10ms corresponds to the value 1, e.g. an
input value of T#1s is converted to the value 100 (16#64).
J Data types
input variable
TIME
output variable
DWORD
,
Example
TIME_TO_DWORD In this example the function TIME_TO_DWORD is programmed in ladder
diagram (LD) and instruction list (IL). The same POU header is used for both pr
ogramming languages. POU Header In the POU header, all input and output variable
s are declared that are used for programming this function.
In this example, the input variable time_value is declared. However, you can wri
te a constant directly at the input contact of the function instead. Body time_v
alue of the data type TIME is converted to a value of the data type DWORD and wr
itten into the output variable DWORD_value. LD Body
IL Body If you wish to call up the function using instruction list, enter the fo
llowing:
* Note next page
Matsushita Electric Works (Europe) AG
2 – 69
IEC Functions Conversion Functions
NAiS Control 1131
Outline
E_TIME_TO_DWORD has in addition an enabled input (EN) and an enable output (ENO)
of the data type BOOL. If EN is set (TRUE), the function is activated. If EN is
reset (FALSE), the status of the variable will be frozen until EN is set again.
ENO will adopt the status of EN. Hence, you can connect further FP/FUN to the E
NO that are determined by EN.
E_ TIME_TO_DWORD POU Header In the POU header, all input and output variables ar
e declared that are used for programming this function.
,
Example
In this example, the input variables start and time_value have been declared. Ho
wever, you can write a constant directly at the input contact of the function in
stead. Body When start is set (TRUE), time_value of the data type TIME is conver
ted to a value of the data type DWORD. The result is written into the output var
iable DWORD_value. After the function has been processed, ENO is set. LD Body
IL Body If you wish to call up the function using instruction list, enter the fo
llowing:
+ Note
It does not matter whether the names of the functions are capitalized in the IL
editor or not.
2 – 70
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Functions Conversion Functions
(E_)TRUNC_TO_INT
Outline
TRUNC_TO_INT cuts off the decimal digits of a REAL number and delivers an output
variable of the data type INTEGER. If you require an enable input (EN) and an e
nable output (ENO): E_TRUNC_TO_INT
+ Note
J Data Types
This function is only available for the FP0.
Input Variable
REAL
Output Variable
INTEGER
,
Example
TRUNC_TO_INT In this example the function TRUNC_TO_INT is programmed in ladder d
iagram (LD) and instruction list (IL). The same POU header is used for both prog
ramming languages. POU Header All input and output variables which are required
for programming the function are declared in the POU header.
In this example the input variable (REAL _value) has been declared. Instead, you
may enter a constant directly at the input contact of the function. LD The deci
mal digits of REAL_value are cut off. The result is stored as a 16–bit INTEGER i
n INT_value.
IL If you want to call the function in an instruction list, enter the following:
+ Note
Please see notes at the end of this section.
* next page
2 – 71
Matsushita Electric Works (Europe) AG
IEC Functions Conversion Functions
NAiS Control 1131
Outline
Anything stated under TRUNC_TO_INT also applies to E_TRUNC_TO_INT. However, in a
ddition to the TRUNC_TO_INT function, E_TRUNC_TO_INT has an enable input (EN) an
d an enable output (ENO) of the data type BOOL. If EN is set (TRUE), E_TRUNC_TO_
INT will be activated. If EN is reset (FALSE), the status of the variable will b
e frozen until EN is set again. ENO will adopt the status of EN. Therefore, you
may connect further function blocks/functions with ENO which are controlled by t
he status of EN.
J Data Types
Input Variable
REAL
Output Variable
INTEGER
,
Example
E_TRUNC_TO_INT In this example the function E_TRUNC_TO_INT is programmed in ladd
er diagram (LD) and instruction list (IL). The same POU header is used for both
programming languages. POU Header All input and output variables which are requi
red for programming the function are declared in the POU header.
In this example the input variables (REAL _value and enable) have been declared.
Instead, you may enter constants directly at the input contact of the function
(enable input e.g. for tests). LD If enable is set (TRUE), the decimal digits of
REAL_value are cut off. The result is stored as a 16–bit INTEGER in INT_value.
IL If you want to call the function in an instruction list, enter the following:
2 – 72
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Functions Conversion Functions
+ Notes
• • •
Cutting off the decimal digits decreases a positive number towards zero and incr
eases a negative number towards zero. It does not matter whether the function na
mes in the IL editor are capitalized or not. The following error flags apply to
(E_)TRUNC_TO_INT:
No.
R9007 R9008 R9009
IEC Address
%MX0.900.7 %MX0.900.8 %MX0.900.9
set
permanently for an instant for an instant
if
input variable does not have the data type REAL output variable is greater than
a 16–bit INTEGER output variable is zero
Matsushita Electric Works (Europe) AG
2 – 73
IEC Functions Conversion Functions
NAiS Control 1131
(E_)TRUNC_TO_DINT
Outline
TRUNC_TO_DINT cuts off the decimal digits of a REAL number and delivers an outpu
t variable of the data type DOUBLE INTEGER. If you require an enable input (EN)
and an enable output (ENO): E_TRUNC_TO_DINT
+ Note
J Data Types
This function is only available for the FP0.
Input Variable
REAL
Output Variable
DOUBLE INTEGER
,
Example
TRUNC_TO_DINT In this example the function TRUNC_TO_DINT is programmed in ladder
diagram (LD) and instruction list (IL). The same POU header is used for both pr
ogramming languages. POU Header All input and output variables which are require
d for programming the function are declared in the POU header.
In this example the input variable (REAL _value) has been declared. Instead, you
may enter a constant directly at the input contact of the function. LD The deci
mal digits of REAL_value are cut off. The result is stored as a 32–bit DOUBLE IN
TEGER in DINT_value.
IL If you want to call the function in an instruction list, enter the following:
+ Note
2 – 74
Please see notes at the end of this section.
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Functions Conversion Functions
Outline
E_TRUNC_TO_DINT cuts off the decimal digits of a REAL number and delivers an out
put variable of the data type DOUBLE INTEGER. In addition to the TRUNC_TO_DINT f
unction, E_TRUNC_TO_DINT has an enable input (EN) and an enable output (ENO) of
the data type BOOL. If EN is set (TRUE), E_TRUNC_TO_DINT will be activated. If E
N is reset (FALSE), the status of the variable will be frozen until EN is set ag
ain. ENO will adopt the status of EN. Therefore, you may connect further functio
n blocks/functions with ENO which are controlled by the status of EN.
J Data Types
Input Variable
REAL
Output Variable
DOUBLE INTEGER
,
Example
E_TRUNC_TO_DINT In this example the function E_TRUNC_TO_DINT is programmed in la
dder diagram (LD) and instruction list (IL). The same POU header is used for bot
h programming languages. POU Header All input and output variables which are req
uired for programming the function are declared in the POU header.
In this example the input variables (REAL_value and enable) have been declared.
Instead, you may enter constants directy at the input contact ofthe function (en
able input e.g. for tests).
* next page
Matsushita Electric Works (Europe) AG
2 – 75
IEC Functions Conversion Functions
NAiS Control 1131
LD If enable is set (TRUE), the decimal digits of REAL_value are cut off. The re
sult is stored as a 32–bit DOUBLE INTEGER in DINT_value.
IL If you want to call the function in an instruction list, enter the following:
+ Notes
• • •
Cutting off the decimal digits decreases a positive number towards zero and incr
eases a negative number towards zero. It does not matter whether the function na
mes in the IL editor are capitalized or not. The following error flags apply to
(E_)TRUNC_TO_DINT:
No.
R9007 R9008 R9009
IEC Address
%MX0.900.7 %MX0.900.8 %MX0.900.9
set
permanently for an instant for an instant
if
input variable does not have the data type REAL output variable is greater than
a 32–bit DOUBLE INTEGER output variable is zero
2 – 76
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Functions Conversion Functions
(E_)BCD_TO_INT
Outline
BCD_TO_INT converts binary coded decimal numbers (BCD) into binary values of the
type INTEGER. If you require an enable input (EN) and an enable output (ENO): E
_BCD_TO_INT
J Data Types
Input Variable
WORD
Output Variable
INTEGER
,
Example
BCD_TO_INT In this example the function BCD_TO_INT is programmed in ladder diagr
am (LD) and instruction list (IL). The same POU header is used for both programm
ing languages. POU Header All input and output variables which are required for
programming the function are declared in the POU header.
In this example the input variable (BCD_value_16bit) has been declared. Instead,
you may enter a constant directly at the input contact of the function. BCD con
stants can be indicated in NAiS Control as follows: 2#0001100110010101 or 16#199
5
LD BCD_value_16bit of the data type WORD is converted into an INTEGER value. The
converted value is written into output variable INT_value.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
* Note next page
Matsushita Electric Works (Europe) AG 2 – 77
IEC Functions Conversion Functions
NAiS Control 1131
Outline
Anything stated under BCD_TO_INT also applies to E_BCD_TO_INT. The function E_BC
D_TO_INT, however, has in addition an enabled input (EN = enable) and an enabled
output (ENO = enable output) of the type BOOL. If EN is set (TRUE), E_BCD_TO_IN
T will be activated. If EN is reset (FALSE), the status of the variable will be
frozen until EN is set again. ENO will adopt the status of EN. Therefore, you ma
y connect further function blocks/functions with ENO which are controlled by the
status of EN.
E_BCD_TO_INT In this example the function BCD_TO_INT is programmed in ladder dia
gram (LD) and instruction list (IL). The same POU header is used for both progra
mming languages. POU Header All input and output variables which are required fo
r programming the function are declared in the POU header.
,
Example
In this example the input variables (BCD_value_16bit and enable) have been decla
red. Instead, you may enter constants directly at the input contact of the funct
ion (enable input e.g. for tests). BCD constants can be indicated in NAiS Contro
l as follows: 2#0001100110010101 or 16#1995 LD If enable is set (TRUE), BCD_valu
e_16bit of the data type WORD is converted into an INTEGER value. The converted
value is written into variable INT_value.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
+ Note
2 – 78
It does not matter whether the function names in the IL editor are capitalized o
r not.
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Functions Conversion Functions
(E_)BCD_TO_DINT
Outline
BCD_TO_DINT converts a BCD value (binary coded decimal integer) of the data type
DOUBLE WORD in a binary value of the data type DOUBLE INTEGER in order to proce
ss a BCD value in double word format. If you require an enable output and an ena
ble input: E_BCD_TO_DINT
J Data Types
Input Variable
DOUBLE WORD
Output Variable
DOUBLE INTEGER
,
Example
BCD_TO_DINT In this example the function BCD_TO_INT is programmed in ladder diag
ram (LD) and instruction list (IL). The same POU header is used for both program
ming languages. POU Header All input and output variables which are required for
programming the function are declared in the POU header.
In this example the input variable (BCD _value_32bit) has been declared. Instead
, you may enter a constant directly at the input contact of the function. BCD co
nstants can be indicated in NAiS Control as follows: 2#0001100110010101000110011
0010101 or 16#19951995 LD BCD_value_32bit of the data type DOUBLE WORD is conver
ted into a DOUBLE INTEGER value. The converted value is written into DINT_value.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
* Note next page
Matsushita Electric Works (Europe) AG 2 – 79
IEC Functions Conversion Functions
NAiS Control 1131
Outline
Anything stated under BCD_TO_DINT also applies to E_BCD_TO_DINT. The function E_
BCD_TO_DINT, however, has in addition an enabled input (EN = enable) and an enab
led output (ENO = enable output) of the type BOOL. If EN is set (TRUE), E_BCD_TO
_DINT will be activated. If EN is reset (FALSE), the status of the variable will
be frozen until EN is set again. ENO will adopt the status of EN. Therefore, yo
u may connect further function blocks/functions with ENO which are controlled by
the status of EN.
E_BCD_TO_DINT In this example the function BCD_TO_INT is programmed in ladder di
agram (LD) and instruction list (IL). The same POU header is used for both progr
amming languages. POU Header All input and output variables which are required f
or programming the function are declared in the POU header.
,
Example
In this example the input variables (BCD_value_32bit and enable) have been decla
red. Instead, you may enter constants directly at the input contact of the funct
ion (enable input e.g. for tests). BCD constants can be indicated in NAiS Contro
l as follows: 2#00011001100101010001100110010101 or 16#19951995 LD If enable is
set (TRUE), BCD_value_32bit of the data type DOUBLE WORD will be converted into
a DOUBLE INTEGER value. The converted value will be written into DINT_value.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
+ Note
2 – 80
It does not matter whether the function names in the IL editor are capitalized o
r not.
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Functions Conversion Functions
(E_)REAL_TO_TIME
Outline
REAL_TO_TIME converts a value of the data type REAL to a value of the data time
TIME. 10ms of the data type TIME correspond to 1.0 REAL unit, e.g. when REAL = 1
.0, TIME = 10ms; when REAL = 100.0, TIME = 1s. The value of the data type real i
s rounded off to the nearest whole number for the conversion. If you require an
enable output and an enable input: E_REAL_TO_TIME.
+ Note
J Data Types
This function is only available for the FP0.
Input Variable
REAL
Output Variable
TIME
,
Example
REAL_TO_TIME In this example the function REAL_TO_TIME is programmed in ladder d
iagram (LD) and instruction list (IL). Since constants are entered directly at t
he function’s input contact pins, only the output variable need be declared in t
he header. POU Header All input and output variables which are required for prog
ramming the function are declared in the POU header.
Body By clicking on the view icon while in the online mode, you can see the resu
lt 0.00ms immediately. Since the value at the REAL input contact is less than 0.
5, it is rounded down to 0.0. LD Body
IL Body
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not. * next page
Matsushita Electric Works (Europe) AG
2 – 81
IEC Functions Conversion Functions
NAiS Control 1131
Outline
Anything stated under REAL_TO_TIME also applies to E_REAL TO_TIME. The function
E_REAL_TO_TIME, however, has in addition an enabled input (EN = enable) and an e
nabled output (ENO = enable output) of the type BOOL. If EN is set (TRUE), E_REA
L_TO_TIME will be activated. If EN is reset (FALSE), the status of the variable
will be frozen until EN is set again. ENO will adopt the status of EN. Therefore
, you may connect further function blocks/functions with ENO which are controlle
d by the status of EN.
E_REAL_TO_TIME In this example the function E_REAL_TO_TIME is programmed in ladd
er diagram (LD) and instruction list (IL). The same POU header is used for both
programming languages. POU Header All input and output variables which are requi
red for programming the function are declared in the POU header.
,
Example
Body In this example the input variables start and input_real have been declared
. Instead, you may enter constants directly at the contact pins of the function
(enable input e.g. for tests). If start is set (TRUE), input_real of the data ty
pe REAL will be converted into a TIME value. The converted value will be written
into result_time. LD Body
IL Body If you wish to call up the function in an instruction list, enter the fo
llowing:
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not.
2 – 82
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Functions Conversion Functions
(E_)TIME_TO_REAL
Outline
TIME_TO_REAL converts a value of the data type TIME to a value of the data time
REAL. 10ms of the data type TIME correspond to 1.0 REAL unit, e.g. when TIME = 1
0ms, REAL = 1.0; when TIME = 1s, REAL = 100.0. The resolution amounts to 10ms. I
f you require an enable output and an enable input: E_TIME_TO_REAL.
+ Note
J Data Types
This function is only available for the FP0.
Input Variable
TIME
Output Variable
REAL
,
Example
TIME_TO_REAL In this example the function TIME_TO_REAL is programmed in ladder d
iagram (LD) and instruction list (IL). POU Header All input and output variables
which are required for programming the function are declared in the POU header.
In this example the input variable input_time has been declared. Instead, you ma
y enter constants directly at the contact pins of the function (enable input e.g
. for tests). LD Body
IL Body
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not. * next page
Matsushita Electric Works (Europe) AG
2 – 83
IEC Functions Conversion Functions
NAiS Control 1131
Outline
Anything stated under TIME_TO_REAL also applies to E_TIME_TO_REAL. The function
E_TIME_TO_REAL, however, has in addition an enabled input (EN = enable) and an e
nabled output (ENO = enable output) of the type BOOL. If EN is set (TRUE), E_TIM
E_TO_REAL will be activated. If EN is reset (FALSE), the status of the variable
will be frozen until EN is set again. ENO will adopt the status of EN. Therefore
, you may connect further function blocks/functions with ENO which are controlle
d by the status of EN.
E_TIME_TO_REAL In this example the function E_TIME_TO_REAL is programmed in ladd
er diagram (LD) and instruction list (IL). The same POU header is used for both
programming languages. POU Header All input and output variables which are requi
red for programming the function are declared in the POU header.
,
Example
In this example the input variables start and input_real have been declared. Ins
tead, you may enter constants at the contact pins of the function (enable input
e.g. for tests). Body If start is set (TRUE), input_time of the data type TIME w
ill be converted into a REAL value. The converted value will be written into res
ult_real. Since the value for the input_time is less than 10ms, the multiplicand
is rounded down to zero. LD Body
IL Body If you wish to call up the function in an instruction list, enter the fo
llowing:
+ Note
2 – 84
It does not matter whether the function names in the IL editor are capitalized o
r not.
Matsushita Electric Works (Europe) AG
Chapter 3 Numerical Functions
(E_)ABS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3 - 3 -
IEC Functions Numerical Functions
NAiS Control 1131
3–2
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Functions Numerical Functions
(E_)ABS
Outline
ABS calculates the value in the accumulator into an absolute value. The result i
s saved in the output variable. If you require an enable output and an enable in
put: E_ABS
J Data Types
Input Variable
INTEGER DOUBLE INTEGER REAL
Output Variable
as input data type
,
Example
ABS In this example the function ABS is programmed in ladder diagram (LD) and in
struction list (IL). The same POU header is used for both programming languages.
POU Header All input and output variables which are required for programming th
e function are declared in the POU header.
This example uses variables. You may also use constants for the input variables.
LD Input_value of the data type INTEGER is converted into an absolute value of
the data type INTEGER. The converted value is written in absolute_value.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not.
3–3
Matsushita Electric Works (Europe) AG
IEC Functions Numerical Functions
NAiS Control 1131
Outline
Anything stated under ABS also applies to E_ABS. E_ABS, however, has in addition
an enabled input (EN = enable) and an enabled output (ENO = enable output) of t
he data type BOOL. If EN is set (TRUE), E_ABS will be activated. If EN is reset
(FALSE), the status of the variable will be frozen until EN is set again. ENO wi
ll adopt the status of EN. Therefore, you may connect further function blocks/fu
nctions with ENO which are controlled by the status of EN.
E_ABS In this example the function E_ABS is programmed in ladder diagram (LD) an
d instruction list (IL). The same POU header is used for both programming langua
ges. POU Header All input and output variables which are required for programmin
g the function are declared in the POU header.
,
Example
This example uses variables. You may also use constants for the input variables.
LD If enable is set (TRUE), the input_value is converted into an absolute value
. The converted value is written in absolute_value.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not.
3–4
Matsushita Electric Works (Europe) AG
Chapter 4 Arithmetic Functions
(E_)MOVE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 -
3 (E_)ADD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. 4 - 5 (E_)SUB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . 4 - 7 (E_)MUL . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . 4 - 9 (E_)DIV
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 - 11 -
(E_)MOD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
- 13 (E_)SQRT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. 4 - 15 (E_)SIN
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 - 18 -
(E_)ASIN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
- 21 (E_)COS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . 4 - 24 (E_)ACOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . 4 - 27 (E_)TAN . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . 4 - 30 (E_)ATAN . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . 4 - 33 (E_)LN
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 - 36 -
(E_)LOG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
- 39 (E_)EXP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. 4 - 42 (E_)EXPT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . 4 - 45 -
IEC Functions Arithmetic Functions
NAiS Control 1131
4–2
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Functions Arithmetic Functions
(E_)MOVE
Outline
MOVE assigns the unchanged value of the input variable to the output. If you req
uire an enable output and an enable input: E_MOVE
J Data Types
Input Variable
all data types
Output Variable
as input data type
,
Example
MOVE In this example the function MOVE is programmed in ladder diagram (LD) and
instruction list (IL). The same POU header is used for both programming language
s. POU Header All input and output variables which are required for programming
the function are declared in the POU header.
This example uses variables. You may also use constants for the input variables.
LD Input_value is assigned to output_value without being modified.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not.
Matsushita Electric Works (Europe) AG
4–3
IEC Functions Arithmetic Functions
NAiS Control 1131
Outline
Anything stated under MOVE also applies to E_MOVE. E_MOVE, however, has in addit
ion an enabled input (EN = enable) and an enabled output (ENO = enable output) o
f the data type BOOL. If EN is set (TRUE), E_MOVE will be activated. If EN is re
set (FALSE), the status of the variable will be frozen until EN is set again. EN
O will adopt the status of EN. Therefore, you may connect further function block
s/functions with ENO which are controlled by the status of EN.
E_MOVE In this example the function E_MOVE is programmed in ladder diagram (LD)
and instruction list (IL). The same POU header is used for both programming lang
uages. POU Header All input and output variables which are required for programm
ing the function are declared in the POU header.
,
Example
This example uses variables. You may also use constants for the input variables
LD If enable is set (TRUE), input_value is transferred to the variable output_va
lue. E_MOVE serves as assignment operator in the LD and FBC.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not.
4–4
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Functions Arithmetic Functions
(E_)ADD
Outline
J Data Types
Input Variable
INTEGER DOUBLE INTEGER REAL
The content of the accumulator is added to the operand defined in the operand fi
eld. The result is transferred to the accumulator.
Output Variable
as input data type
Input and output variables have to be of the same data type.
,
Example
ADD POU Header Class Identifier
0 1 2 VAR VAR VAR var_1 var_2 var_3
Type
INT INT INT
Initial
0 0 0
Comment
Input_1 Input_2 Output
IL Body
LD ADD ST var_1 var_2 var_3 (* Load var_1 in accu *) (* Add var_2 to accu; store
result in accu *) (* Store accu in var_3 *)
LD Body
+ Notes
• •
var_1, var_2 and op3 must be one of the above noted data types. All operands mus
t be of the same data type. It is not important whether the function names in th
e IL editor are capitalized or not.
Matsushita Electric Works (Europe) AG
4–5
IEC Functions Arithmetic Functions
NAiS Control 1131
Outline
E_ADD adds the input variables IN1 + IN2 + ... and writes the addition result in
to the output variable. E_ADD operates just like the standard operator ADD (see:
Online Help: Help > Index > Standard Operators). However, E_ADD has an addition
al enabled input (EN = enable) and an enabled output (ENO = enable output) of th
e data type BOOL. If EN is set (TRUE), E_ADD will be activated. If EN is reset (
FALSE), the variable’s status will be frozen until EN is set again. ENO will ado
pt the status of EN. Therefore, you may connect further function blocks/function
s with ENO which are controlled by the status of EN.
E_ADD In this example the function E_ADD is programmed in ladder diagram (LD) an
d instruction list (IL). The same POU header is used for both programming langua
ges. POU Header All input and output variables which are required for programmin
g the function are declared in the POU header.
,
Example
This example uses variables. You may also use constants for the input variables.
LD Body If enable is set (TRUE), summand_1 is added to summand_2. The result is
written in sum.
IL Body If you wish to call up the function in an instruction list, enter the fo
llowing:
+ Notes
• •
The number of input contacts a_NumN lies in the range of 2 to 28. It does not ma
tter whether the function names in the IL editor are capitalized or not.
Matsushita Electric Works (Europe) AG
4–6
NAiS Control 1131
IEC Functions Arithmetic Functions
(E_)SUB
Outline
The content of the accumulator is subtracted from the operand defined in the ope
rand field. The result is transferred to the accumulator.
J Data Types
Input Variable
INTEGER DOUBLE INTEGER REAL
Output Variable
as input data type
Input and output variables have to be of the same data type.
,
Example
SUB POU Header Class Identifier
0 1 2 VAR VAR VAR var_1 var_2 var_3
Type
INT INT INT
Initial
0 0 0
Comment
Input_1 Input_2 Output
IL Body
LD SUB ST var_1 var_2 var_3 (* Load var_1 in accu *) (* Subtract var_2 from accu
; store result in accu *) (* Store accu in var_3 *)
LD Body
+ Notes
• •
var_1, var_2 and op3 must be one of the above noted data types. All operands mus
t be of the same data type. It is not important whether the function names in th
e IL editor are capitalized or not.
Matsushita Electric Works (Europe) AG
4–7
IEC Functions Arithmetic Functions
NAiS Control 1131
Outline
E_SUB operates just as the standard operator SUB (Online Help: Help > Index > St
andard Operators). E_SUB, however, has in addition an enabled input (EN = enable
) and an enabled output (ENO = enable output) of the data type BOOL. If EN is se
t (TRUE), E_SUB will be activated. If EN is reset (FALSE), the status of the var
iable will be frozen until EN is set again. ENO will adopt the status of EN. The
refore, you may connect further function blocks/functions with ENO which are con
trolled by the status of EN.
E_SUB In this example the function E_SUB is programmed in ladder diagram (LD) an
d instruction list (IL). The same POU header is used for both programming langua
ges. POU Header All input and output variables which are required for programmin
g the function are declared in the POU header.
,
Example
This example uses variables. You may also use constants for the input variables
LD Body If enable is set, subtrahend (data type INT) is subracted from minuend.
The result will be written in result (data type INT).
IL Body If you wish to call up E_SUB in an instruction list, enter the following
:
+ Note
4–8
It does not matter whether the function names in the IL editor are capitalized o
r not.
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Functions Arithmetic Functions
(E_)MUL
Outline
J Data Types
Input Variable
INTEGER DOUBLE INTEGER REAL
The content of the accumulator is multiplied by the operand defined in the opera
nd field. The result is transferred to the accumulator.
Output Variable
as input data type
Input and output variables have to be of the same data type.
,
Example
MUL POU Header Class Identifier
0 1 2 VAR VAR VAR var_1 var_2 var_3
Type
INT INT INT
Initial
0 0 0
Comment
Input_1 Input_2 Output
IL Body
LD MUL ST var_1 var_2 var_3 (* Load var_1 in accu *) (* Multiply var_2 by accu;
store result in accu *) (* Store accu in var_3 *)
LD Body
+ Notes
• •
var_1, var_2 and var_3 must be of one of the above noted data types. All operand
s must be of the same data type. It is not important whether the function names
in the IL editor are capitalized or not.
Matsushita Electric Works (Europe) AG
4–9
IEC Functions Arithmetic Functions
NAiS Control 1131
Outline
E_MUL multiplies the values of the input variables with each other. E_MUL operat
es just as the standard operator MUL (Online Help: Help > Index > Standard Opera
tors). E_MUL, however, has in addition an enabled input (EN = enable) and an ena
bled output (ENO = enable output) of the data type BOOL. If EN is set (TRUE), E_
MUL will be activated. If EN is reset (FALSE), the status of the variable will b
e frozen until EN is set again. ENO will adopt the status of EN. Therefore, you
may connect further function blocks/functions with ENO which are controlled by t
he status of EN.
E_MUL In this example the function E_MUL is programmed in ladder diagram (LD) an
d instruction list (IL). The same POU header is used for both programming langua
ges. POU Header All input and output variables which are required for programmin
g the function are declared in the POU header.
,
Example
This example uses variables. You may also use constants for the input variables
LD Body If enable is set (TRUE), the multiplicant is multiplied with the multipl
icator. The result will be written in result.
IL Body If you wish to call up the function in an instruction list, enter the fo
llowing:
+ Notes
• •
The number of input contacts a_NumN lies in the range of 2 to 28. It does not ma
tter whether the function names in the IL editor are capitalized or not.
Matsushita Electric Works (Europe) AG
4 – 10
NAiS Control 1131
IEC Functions Arithmetic Functions
(E_)DIV
Outline
J Data Types
Input Variable
INTEGER DOUBLE INTEGER REAL
The content of the accumulator is divided by the operand defined in the operand
field. The result is transferred to the accumulator.
Output Variable
as input dada type
Input and output variables have to be of the same data type.
,
Example
DIV POU Header Class Identifier
0 1 2 VAR VAR VAR var_1 var_2 var_3
Type
INT INT INT
Initial
0 0 0
Comment
Input_1 Input_2 Output
IL Body
LD DIV ST var_1 var_2 var_3 (* Load var_1 in accu *) (* Divide accu by var_2; st
ore result in accu *) (* Store accu in var_3 *)
LD Body
+ Notes
• •
var_1, var_2 and op3 must be one of the above noted data types. All operands mus
t be of the same data type. It is not important whether the function names in th
e IL editor are capitalized or not.
Matsushita Electric Works (Europe) AG
4 – 11
IEC Functions Arithmetic Functions
NAiS Control 1131
Outline
E_DIV divides the value of the first input variable by the value of the second.
E_DIV operates just as the standard operator DIV (Online Help: Help > Index > St
andard Operators), however, it has in addition an enabled input (EN = enable) an
d an enabled output (ENO = enable output) of the data type BOOL. If EN is set (T
RUE), E_DIV will be activated. If EN is reset (FALSE), the status of the variabl
e will be frozen until EN is set again. ENO will adopt the status of EN. Therefo
re, you may connect further function blocks/functions with ENO which are control
led by the status of EN.
+ Note ,
Example
With FP1–C14/C16 E_DIV cannot be used for a 32–bit division (DINT) as this will
cause a compiler error.
E_DIV In this example the function E_DIV is programmed in ladder diagram (LD) an
d instruction list (IL). The same POU header is used for both programming langua
ges. POU Header All input and output variables which are required for programmin
g the function are declared in the POU header.
This example uses variables. You may also use constants for the input variables.
LD If enable is set (TRUE), dividend is divided by divisor. The result is writt
en in result.
IL If you wish to call up the function in an instruction list, enter the followi
ng:
+ Note
4 – 12
It does not matter whether the function names in the IL editor are capitalized o
r not.
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Functions Arithmetic Functions
(E_)MOD
Outline
MOD divides the value of the first input variable by the value of the second. Th
e rest of the integral division (5 : 2 : 2 + rest = 1) is written in the output
variable. If you require an enable output and an enable input: E_MOD
J Data Types
Input Variable
INTEGER DOUBLE INTEGER
Output Variable
as input data type
Input and output variables have to be of the same data type.
,
Example
MOD In this example the function MOD is programmed in ladder diagram (LD) and in
struction list (IL). The same POU header is used for both programming languages.
POU Header All input and output variables which are required for programming th
e function are declared in the POU header.
This example uses variables. You may also use constants for the input variables.
LD Body Dividend is divided by divisor. The integal rest of the division is wri
tten in division_rest.
IL Body If you wish to call up the function in an instruction list, enter the fo
llowing:
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not.
4 – 13
Matsushita Electric Works (Europe) AG
IEC Functions Arithmetic Functions
NAiS Control 1131
Outline
Anything stated under MOD also applies to E_MOD. E_MOD, however, has in addition
an enabled input (EN = enable) and an enabled output (ENO = enable output) of t
he data type BOOL. If EN is set (TRUE), E_MOD will be activated. If EN is reset
(FALSE), the status of the variable will be frozen until EN is set again. ENO wi
ll adopt the status of EN. Therefore, you may connect further function blocks/fu
nctions with ENO which are controlled by the status of EN.
E_MOD In this example the function E_MOD is programmed in ladder diagram (LD) an
d instruction list (IL). The same POU header is used for both programming langua
ges. POU Header All input and output variables which are required for programmin
g the function are declared in the POU header.
,
Example
This example uses variables. You may also use constants for the input variables
LD Body If enable is set (TRUE), dividend is divided by divisor. The rest of the
division is written in division_rest (e.g: 5 : 2 = 2; rest = 1).
IL Body If you wish to call up the function in an instruction list, enter the fo
llowing:
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not.
4 – 14
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Functions Arithmetic Functions
(E_)SQRT
Outline
SQRT calculates the square root of an input variable of the data type REAL (valu
e ≥ 0.0). The result is written into the output variable. If you require an enab
le input (EN) and an enable output (ENO): E_SQRT.
+ Note
J Data Types
This function is only available for the FP0.
Input Variable
REAL
Output Variable
as input data type
,
Example
SQRT In this example the function SQRT is programmed in ladder diagram (LD) and
instruction list (IL). The same POU header is used for both programming language
s. POU Header All input and output variables which are required for programming
the function are declared in the POU header.
In this example the input variable (input_value) has been declared. Instead, you
may enter a constant at the input contact of the function. LD Body The square r
oot of input_value is calculated and written into output_value.
IL Body If you want to call the function in an instruction list, enter the follo
wing:
+ Note
Please see notes at the end of this section.
Matsushita Electric Works (Europe) AG
4 – 15
IEC Functions Arithmetic Functions
NAiS Control 1131
Outline
Anything stated under SQRT also applies to E_SQRT. However, in addition to the S
QRT function, E_SQRT has an enable input (EN) and an enable output (ENO) of the
data type BOOL. If EN is set (TRUE), E_SQRT will be activated. If EN is not set
(FALSE), the status of the output variable will remain unchanged until EN is set
. ENO will adopt the status of EN. Therefore, you may connect further function b
locks/functions with ENO which are controlled by the status of EN.
Input Variable
REAL
J Data Types
Output Variable
as input data type
,
Example
E_SQRT In this example the function E_SQRT is programmed in ladder diagram (LD)
and instruction list (IL). The same POU header is used for both programming lang
uages. POU Header All input and output variables which are required for programm
ing the function are declared in the POU header.
In this example the input variables (input_value and enable) have been declared.
Instead, you may enter a constant at the input contact of the function (enable
input e.g. for tests). LD Body If enable is set (TRUE), the square root of input
_value is calculated and written into output_value.
IL Body If you want to call the function in an instruction list, enter the follo
wing:
* next page
4 – 16
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Functions Arithmetic Functions
+ Notes
• •
It does not matter whether the function names in the IL editor are capitalized o
r not. The following error flags apply to (E_)SQRT:
No.
R9007 R9008 R900B R9009
IEC Address
%MX0.900.7 %MX0.900.8 %MX0.900.1 1 %MX0.900.9
set
permanently for an instant permanently for an instant
if
input variable does not have the data type REAL or input variable is not w 0.0 o
utput variable is zero processing result overflows the output variable
Matsushita Electric Works (Europe) AG
4 – 17
IEC Functions Arithmetic Functions
NAiS Control 1131
(E_)SIN
Outline
SIN calculates the sine of the input variable and writes the result into the out
put variable. The angle data has to be specified in radians (value < 52707176).
If you require an enable input (EN) and an enable output (ENO): E_SIN.
+ Note
J Data Types
This function is only available for the FP0.
Input Variable
REAL
Output Variable
as input data type
,
Example
SIN In this example the function SIN is programmed in ladder diagram (LD) and in
struction list (IL). The same POU header is used for both programming languages.
POU Header All input and output variables which are required for programming th
e function are declared in the POU header.
In this example the input variable (input_value) has been declared. Instead, you
may enter a constant at the input contact of the function. LD Body The sine of
input_value is calculated and written into output_value.
IL Body If you want to call the function in an instruction list, enter the follo
wing:
+ Note
4 – 18
Please see notes at the end of this section.
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Functions Arithmetic Functions
Outline
Anything stated under SIN also applies to E_SIN. However, in addition to the SIN
function, E_SIN has an enable input (EN) and an enable output (ENO) of the data
type BOOL. If EN is set (TRUE), E_SIN will be activated. If EN is not set (FALS
E), the status of the output variable will remain unchanged until EN is set. ENO
will adopt the status of EN. Therefore, you may connect further function blocks
/functions with ENO which are controlled by the status of EN.
J Data Types
Input Variable
REAL
Output Variable
as input data type
,
Example
E_SIN In this example the function E_SIN is programmed in ladder diagram (LD) an
d instruction list (IL). The same POU header is used for both programming langua
ges. POU Header All input and output variables which are required for programmin
g the function are declared in the POU header.
In this example the input variables (input_value and enable) have been declared.
Instead, you may enter a constant at the input contact of the function (enable
input e.g. for tests). LD Body If enable is set (TRUE), the sine of input_value
is calculated and written into output_value.
IL Body If you want to call the function in an instruction list, enter the follo
wing:
Matsushita Electric Works (Europe) AG
4 – 19
IEC Functions Arithmetic Functions
NAiS Control 1131
+ Notes
• • •
The accuracy of the calculation decreases as the angle data specified in the inp
ut variable increases. Therefore, we recommend entering angle data in radians ≥
–2π and ≤ 2π. It does not matter whether the function names in the IL editor are
ca italized or not. The following error flags a ly to (E_)SIN:
No.
R9007 R9008 R900B R9009
IEC Address
%MX0.900.7 %MX0.900.8 %MX0.900.1 1 %MX0.900.9
set
ermanently for an instant ermanently for an instant
if
in ut variable does not have the data ty e REAL or in ut variable is w 52707176
out ut variable is zero rocessing result overflows the out ut variable
4 – 20
Matsushita Electric Works (Euro e) AG
NAiS Control 1131
IEC Functions Arithmetic Functions
(E_)ASIN
Outline
ASIN calculates the arc sine of the in ut variable and writes the angle data in
radians into the out ut variable. The function returns a value from –π/2 to π/2.
If you require an enable in ut (EN) and an enable out ut (ENO): E_ASIN.
+ Note
J Data Ty es
This function is only available for the FP0.
In ut Variable
REAL
Out ut Variable
as in ut data ty e
,
Exam le
ASIN In this exam le the function ASIN is rogrammed in ladder diagram (LD) and
instruction list (IL). The same POU header is used for both rogramming language
s. POU Header All in ut and out ut variables which are required for rogramming
the function are declared in the POU header.
In this exam le the in ut variable (in ut_value) has been declared. Instead, you
may enter a constant at the in ut contact of the function. LD Body The arc sine
of in ut_value is calculated and written into out ut_value.
IL Body If you want to call the function in an instruction list, enter the follo
wing:
+ Note
Please see notes at the end of this section.
Matsushita Electric Works (Euro e) AG
4 – 21
IEC Functions Arithmetic Functions
NAiS Control 1131
Outline
Anything stated under ASIN also a lies to E_ASIN. However, in addition to the A
SIN function, E_ASIN has an enable in ut (EN) and an enable out ut (ENO) of the
data ty e BOOL. If EN is set (TRUE), E_ASIN will be activated. If EN is not set
(FALSE), the status of the out ut variable will remain unchanged until EN is set
. ENO will ado t the status of EN. Therefore, you may connect further function b
locks/functions with ENO which are controlled by the status of EN.
J Data Ty es
In ut Variable
REAL
Out ut Variable
as in ut data ty e
,
Exam le
E_ASIN In this exam le the function E_ASIN is rogrammed in ladder diagram (LD)
and instruction list (IL). The same POU header is used for both rogramming lang
uages. POU Header All in ut and out ut variables which are required for rogramm
ing the function are declared in the POU header.
In this exam le the in ut variables (in ut_value and enable) have been declared.
Instead, you may enter a constant at the in ut contact of the function (enable
in ut e.g. for tests). LD Body If enable is set (TRUE), the arc sine of in ut_va
lue is calculated and written into out ut_value.
IL Body If you want to call the function in an instruction list, enter the follo
wing:
* next age
4 – 22
Matsushita Electric Works (Euro e) AG
NAiS Control 1131
IEC Functions Arithmetic Functions
+ Notes
• •
It does not matter whether the function names in the IL editor are ca italized o
r not. The following error flags a ly to (E_)ASIN:
No.
R9007 R9008 R900B R9009
IEC Address
%MX0.900.7 %MX0.900.8 %MX0.900.1 1 %MX0.900.9
set
ermanently for an instant ermanently for an instant
if
in ut variable does not have the data ty e REAL or in ut variable is not  –1.0 an
d  1.0 out ut variable is zero rocessing result overflows the out ut variable
Matsushita Electric Works (Euro e) AG
4 – 23
IEC Functions Arithmetic Functions
NAiS Control 1131
(E_)COS
Outline
COS calculates the cosine of the in ut variable and writes the result into the o
ut ut variable. The angle data has to be s ecified in radians (value <52707176).
If you require an enable in ut (EN) and an enable out ut (ENO): E_COS.
+ Note
J Data Ty es
This function is only available for the FP0.
In ut Variable
REAL
Out ut Variable
as in ut data ty e
,
Exam le
COS In this exam le the function COS is rogrammed in ladder diagram (LD) and in
struction list (IL). The same POU header is used for both rogramming languages.
POU Header All in ut and out ut variables which are required for rogramming th
e function are declared in the POU header.
In this exam le the in ut variable (in ut_value) has been declared. Instead, you
may enter a constant at the in ut contact of the function. LD Body The cosine o
f in ut_value is calculated and written into out ut_value.
IL Body If you want to call the function in an instruction list, enter the follo
wing:
+ Note
4 – 24
Please see notes at the end of this section.
Matsushita Electric Works (Euro e) AG
NAiS Control 1131
IEC Functions Arithmetic Functions
Outline
Anything stated under COS also a lies to E_COS. However, in addition to the COS
function, E_COS has an enable in ut (EN) and an enable out ut (ENO) of the data
ty e BOOL. If EN is set (TRUE), E_COS will be activated. If EN is not set (FALS
E), the status of the out ut variable will remain unchanged until EN is set. ENO
will ado t the status of EN. Therefore, you may connect further function blocks
/functions with ENO which are controlled by the status of EN.
J Data Ty es
In ut Variable
REAL
Out ut Variable
as in ut data ty e
,
Exam le
E_COS In this exam le the function E_COS is rogrammed in ladder diagram (LD) an
d instruction list (IL). The same POU header is used for both rogramming langua
ges. POU Header All in ut and out ut variables which are required for rogrammin
g the function are declared in the POU header.
In this exam le the in ut variables (in ut_value and enable) have been declared.
Instead, you may enter a constant at the in ut contact of the function (enable
in ut e.g. for tests). LD Body If enable is set (TRUE), the cosine of in ut_valu
e is calculated and written into out ut_value.
IL Body If you want to call u the function in an instruction list, enter the fo
llowing:
Matsushita Electric Works (Euro e) AG
4 – 25
IEC Functions Arithmetic Functions
NAiS Control 1131
+ Notes
• • •
The accuracy of the calculation decreases as the angle data s ecified in the in
ut variable increases. Therefore, we recommend to enter angle data in radians ≥
–2π and ≤ 2π. It is not im ortant whether the function names in the IL editor ar
e ca italized or not. The following error flags a ly to (E_)COS:
No.
R9007 R9008 R900B R9009
IEC Address
%MX0.900.7 %MX0.900.8 %MX0.900.1 1 %MX0.900.9
set
ermanently for an instant ermanently for an instant
if
in ut variable does not have the data ty e REAL or in ut variable  52707176 out u
t variable is zero rocessing result overflows the out ut variable
4 – 26
Matsushita Electric Works (Euro e) AG
NAiS Control 1131
IEC Functions Arithmetic Functions
(E_)ACOS
Outline
ACOS calculates the arc cosine of the in ut variable and writes the angle data i
n radians into the out ut variable. The function returns a value from 0.0 to π.
If you require an enable in ut (EN) and an enable out ut (ENO): E_ACOS.
+ Note
J Data Ty es
This function is only available for the FP0.
In ut Variable
REAL
Out ut Variable
as in ut data ty e
,
Exam le
ACOS In this exam le the function ACOS is rogrammed in ladder diagram (LD) and
instruction list (IL). The same POU header is used for both rogramming language
s. POU Header All in ut and out ut variables which are required for rogramming
the function are declared in the POU header.
In this exam le the in ut variable (in ut_value) has been declared. Instead, you
may enter a constant at the in ut contact of the function. LD Body The arc cosi
ne of in ut_value is calculated and written into out ut_value.
IL Body If you want to call the function in an instruction list, enter the follo
wing:
+ Note
Please see notes at the end of this section.
4 – 27
Matsushita Electric Works (Euro e) AG
IEC Functions Arithmetic Functions
NAiS Control 1131
Outline
Anything stated under ACOS also a lies to E_ACOS. However, in addition to the A
COS function, E_ACOS has an enable in ut (EN) and an enable out ut (ENO) of the
data ty e BOOL. If EN is set (TRUE), E_ACOS will be activated. If EN is not set
(FALSE), the status of the out ut variable will remain unchanged until EN is set
. ENO will ado t the status of EN. Therefore, you may connect further function b
locks/functions with ENO which are controlled by the status of EN.
J Data Ty es
In ut Variable
REAL
Out ut Variable
as in ut data ty e
,
Exam le
E_ACOS In this exam le the function E_ACOS is rogrammed in ladder diagram (LD)
and instruction list (IL). The same POU header is used for both rogramming lang
uages. POU Header All in ut and out ut variables which are required for rogramm
ing the function are declared in the POU header.
In this exam le the in ut variables (in ut_value and enable) have been declared.
Instead, you may enter a constant at the in ut contact of the function (enable
in ut e.g. for tests). LD Body If enable is set (TRUE), the arc cosine of in ut_
value is calculated and written into out ut_value.
IL Body If you want to call the function in an instruction list, enter the follo
wing:
* next age
4 – 28
Matsushita Electric Works (Euro e) AG
NAiS Control 1131
IEC Functions Arithmetic Functions
+ Notes
• •
It does not matter whether the function names in the IL editor are ca italized o
r not. The following error flags a ly to (E_)ACOS:
No.
R9007 R9008 R900B R9009
IEC Address
%MX0.900.7 %MX0.900.8 %MX0.900.1 1 %MX0.900.9
set
ermanently for an instant ermanently for an instant
if
in ut variable does not have the data ty e REAL or in ut variable is not  –1.0 an
d  1.0 out ut variable is zero rocessing result overflows the out ut variable
Matsushita Electric Works (Euro e) AG
4 – 29
IEC Functions Arithmetic Functions
NAiS Control 1131
(E_)TAN
Outline
TAN calculates the tangent of the in ut variable and writes the result into the
out ut variable. The angle data has to be s ecified in radians (value < 52707176
). If you require an enable in ut (EN) and an enable out ut (ENO): E_TAN.
+ Note
J Data Ty es
This function is only available for the FP0.
In ut Variable
REAL
Out ut Variable
as in ut data ty e
,
Exam le
TAN In this exam le the function TAN is rogrammed in ladder diagram (LD) and in
struction list (IL). The same POU header is used for both rogramming languages.
POU Header All in ut and out ut variables which are required for rogramming th
e function are declared in the POU header.
In this exam le the in ut variable (in ut_value) has been declared. Instead, you
may enter a constant at the in ut contact of the function. LD Body The tangent
of in ut_value is calculated and written into out ut_value.
IL Body If you want to call the function in an instruction list, enter the follo
wing:
+ Note
4 – 30
Please see notes at the end of this section.
Matsushita Electric Works (Euro e) AG
NAiS Control 1131
IEC Functions Arithmetic Functions
Outline
Anything stated under TAN also a lies to E_TAN. However, in addition to the TAN
function, E_TAN has an enable in ut (EN) and an enable out ut (ENO) of the data
ty e BOOL. If EN is set (TRUE), E_TAN will be activated. If EN is not set (FALS
E), the status of the out ut variable will remain unchanged until EN is set. ENO
will ado t the status of EN. Therefore, you may connect further function blocks
/functions with ENO which are controlled by the status of EN.
J Data Ty es
In ut Variable
REAL
Out ut Variable
as in ut data ty e
,
Exam le
E_TAN In this exam le the function E_TAN is rogrammed in ladder diagram (LD) an
d instruction list (IL). The same POU header is used for both rogramming langua
ges. POU Header All in ut and out ut variables which are required for rogrammin
g the function are declared in the POU header.
In this exam le the in ut variables (in ut_value and enable) have been declared.
Instead, you may enter a constant at the in ut contact of the function (enable
in ut e.g. for tests). LD Body If enable is set (TRUE), the tangent of in ut_val
ue is calculated and written into out ut_value.
IL Body If you want to call the function in an instruction list, enter the follo
wing:
Matsushita Electric Works (Euro e) AG
4 – 31
IEC Functions Arithmetic Functions
NAiS Control 1131
+ Notes
• • •
The accuracy of the calculation decreases as the angle data s ecified in the in
ut variable increases. Therefore, we recommend to enter angle data in radians ≥
–2π and ≤ 2π. It does not matter whether the function names in the IL editor are
ca italized or not. The following error flags a ly to (E_)TAN:
No.
R9007 R9008 R900B R9009
IEC Address
%MX0.900.7 %MX0.900.8 %MX0.900.1 1 %MX0.900.9
set
ermanently for an instant ermanently for an instant
if
in ut variable does not have the data ty e REAL or in ut variable is w 52707176
out ut variable is zero rocessing result overflows the out ut variable
4 – 32
Matsushita Electric Works (Euro e) AG
NAiS Control 1131
IEC Functions Arithmetic Functions
(E_)ATAN
Outline
ATAN calculates the arc tangent of the in ut variable (value  52707176) and wri
tes the angle data in radians into the out ut variable. The function returns a v
alue greater than –π/2 and smaller than π/2. If you require an enable in ut (EN)
and an enable out ut (ENO): E_ATAN.
+ Note
J Data Ty es
This function is only available for the FP0.
In ut Variable
REAL
Out ut Variable
as in ut data ty e
,
Exam le
ATAN In this exam le the function ATAN is rogrammed in ladder diagram (LD) and
instruction list (IL). The same POU header is used for both rogramming language
s. POU Header All in ut and out ut variables which are required for rogramming
the function are declared in the POU header.
In this exam le the in ut variable (in ut_value) has been declared. Instead, you
may enter a constant at the in ut contact of the function. LD Body The arc tang
ent of in ut_value is calculated and written into out ut_value.
IL Body If you want to call the function in an instruction list, enter the follo
wing:
+ Note
Please see notes at the end of this section.
4 – 33
Matsushita Electric Works (Euro e) AG
IEC Functions Arithmetic Functions
NAiS Control 1131
Outline
Anything stated under ATAN also a lies to E_ATAN. However, in addition to the A
TAN function, E_ATAN has an enable in ut (EN) and an enable out ut (ENO) of the
data ty e BOOL. If EN is set (TRUE), E_ATAN will be activated. If EN is not set
(FALSE), the status of the out ut variable will remain unchanged until EN is set
. ENO will ado t the status of EN. Therefore, you may connect further function b
locks/functions with ENO which are controlled by the status of EN.
J Data Ty es
In ut Variable
REAL
Out ut Variable
as in ut data ty e
,
Exam le
E_ATAN In this exam le the function E_ATAN is rogrammed in ladder diagram (LD)
and instruction list (IL). The same POU header is used for both rogramming lang
uages. POU Header All in ut and out ut variables which are required for rogramm
ing the function are declared in the POU header.
In this exam le the in ut variables (in ut_value and enable) have been declared.
Instead, you may enter a constant at the in ut contact of the function (enable
in ut e.g. for tests). LD Body If enable is set (TRUE), the arc tangent of in ut
_value is calculated and written into out ut_value.
IL Body If you want to call the function in an instruction list, enter the follo
wing:
* next age
4 – 34
Matsushita Electric Works (Euro e) AG
NAiS Control 1131
IEC Functions Arithmetic Functions
+ Notes
• •
It does not matter whether the function names in the IL editor are ca italized o
r not. The following error flags a ly to (E_)ATAN:
No.
R9007 R9008 R900B R9009
IEC Address
%MX0.900.7 %MX0.900.8 %MX0.900.1 1 %MX0.900.9
set
ermanently for an instant ermanently for an instant
if
in ut variable does not have the data ty e REAL or in ut variable  52707176 out u
t variable is zero rocessing result overflows the out ut variable
Matsushita Electric Works (Euro e) AG
4 – 35
IEC Functions Arithmetic Functions
NAiS Control 1131
(E_)LN
Outline
LN calculates the logarithm of the in ut variable (value > 0.0) to the base e (E
uler’s number = 2.7182818) and writes the result into the out ut variable. This
function is the reversion of the EXP function. If you require an enable in ut (E
N) and an enable out ut (ENO): E_LN.
+ Note
J Data Ty es
This function is only available for the FP0.
In ut Variable
REAL
Out ut Variable
as in ut data ty e
,
Exam le
LN In this exam le the function LN is rogrammed in ladder diagram (LD) and inst
ruction list (IL). The same POU header is used for both rogramming languages. P
OU Header All in ut and out ut variables which are required for rogramming the
function are declared in the POU header.
In this exam le the in ut variable (in ut_value) has been declared. Instead, you
may enter a constant directly at the in ut contact of the function. Body The lo
garithm of in ut_value is calculated to the base e and written into out ut_value
. LD Body
IL Body If you want to call the function in an instruction list, enter the follo
wing:
+ Note
4 – 36
Please see notes at the end of this section.
Matsushita Electric Works (Euro e) AG
NAiS Control 1131
IEC Functions Arithmetic Functions
Outline
Anything stated under LN also a lies to E_LN. However, in addition to the LN fu
nction, E_LN has an enable in ut (EN) and an enable out ut (ENO) of the data ty
e BOOL. If EN is set (TRUE), E_LN will be activated. If EN is not set (FALSE), t
he status of the out ut variable will remain unchanged until EN is set. ENO will
ado t the status of EN. Therefore, you may connect further function blocks/func
tions with ENO which are controlled by the status of EN.
J Data Ty es
In ut Variable
REAL
Out ut Variable
as in ut data ty e
,
Exam le
E_LN In this exam le the function E_LN is rogrammed in ladder diagram (LD) and
instruction list (IL). The same POU header is used for both rogramming language
s. POU Header All in ut and out ut variables which are required for rogramming
the function are declared in the POU header.
In this exam le the in ut variables (in ut_value and enable) have been declared.
Instead, you may enter a constant directly at the in ut contact of the function
(enable in ut e.g. for tests). LD Body If enable is set (TRUE), the logarithm o
f in ut_value is calculated to the base e and written into out ut_value.
IL Body If you want to call the function in an instruction list, enter the follo
wing:
Matsushita Electric Works (Euro e) AG
4 – 37
IEC Functions Arithmetic Functions
NAiS Control 1131
+ Notes
• •
It does not matter whether the function names in the IL editor are ca italized o
r not. The following error flags a ly to (E_)LN:
No.
R9007 R9008 R900B R9009
IEC Address
%MX0.900.7 %MX0.900.8 %MX0.900.1 1 %MX0.900.9
set
ermanently for an instant ermanently for an instant
if
in ut variable does not have the data ty e REAL or in ut variable is not > 0.0 o
ut ut variable is zero rocessing result overflows the out ut variable
4 – 38
Matsushita Electric Works (Euro e) AG
NAiS Control 1131
IEC Functions Arithmetic Functions
(E_)LOG
Outline
LOG calculates the logarithm of the in ut variable (value > 0.0) to the base 10
and writes the result into the out ut variable. If you require an enable in ut (
EN) and an enable out ut (ENO): E_LOG.
+ Note
J Data Ty es
This function is only available for the FP0.
In ut Variable
REAL
Out ut Variable
as in ut data ty e
,
Exam le
LOG In this exam le the function LOG is rogrammed in ladder diagram (LD) and in
struction list (IL). The same POU header is used for both rogramming languages.
POU Header All in ut and out ut variables which are required for rogramming th
e function are declared in the POU header.
In this exam le the in ut variable (in ut_value) has been declared. Instead, you
may enter a constant directly at the in ut contact of the function. LD Body The
logarithm of in ut_value is calculated to the base 10 and written into out ut_v
alue.
IL Body If you want to call the function in an instruction list, enter the follo
wing:
+ Note
Please see notes at the end of this section.
Matsushita Electric Works (Euro e) AG
4 – 39
IEC Functions Arithmetic Functions
NAiS Control 1131
Outline
Anything stated under LOG also a lies to E_LOG. However, in addition to the LOG
function, E_LOG has an enable in ut (EN) and an enable out ut (ENO) of the data
ty e BOOL. If EN is set (TRUE), E_LOG will be activated. If EN is not set (FALS
E), the status of the out ut variable will remain unchanged until EN is set. ENO
will ado t the status of EN. Therefore, you may connect further function blocks
/functions with ENO which are controlled by the status of EN.
J Data Ty es
In ut Variable
REAL
Out ut Variable
as in ut data ty e
,
Exam le
E_LOG In this exam le the function E_LOG is rogrammed in ladder diagram (LD) an
d instruction list (IL). The same POU header is used for both rogramming langua
ges. POU Header All in ut and out ut variables which are required for rogrammin
g the function are declared in the POU header.
In this exam le the in ut variables (in ut_value and enable) have been declared.
Instead, you may enter a constant directly at the in ut contact of the function
(enable in ut e.g. for tests). LD If enable is set (TRUE), the logarithm of in
ut_value is calculated to the base 10 and written into out ut_value.
IL If you want to call the function in an instruction list, enter the following:
* next age
4 – 40
Matsushita Electric Works (Euro e) AG
NAiS Control 1131
IEC Functions Arithmetic Functions
+ Notes
• •
It does not matter whether the function names in the IL editor are ca italized o
r not. The following error flags a ly to (E_)LOG:
No.
R9007 R9008 R900B R9009
IEC Address
%MX0.900.7 %MX0.900.8 %MX0.900.1 1 %MX0.900.9
set
ermanently for an instant ermanently for an instant
if
in ut variable does not have the data ty e REAL or in ut variable is not > 0.0 o
ut ut variable is zero rocessing result overflows the out ut variable
Matsushita Electric Works (Euro e) AG
4 – 41
IEC Functions Arithmetic Functions
NAiS Control 1131
(E_)EXP
Outline
EXP calculates the ower of the in ut variable to the base e (Euler’s number = 2
.7182818) and writes the result into the out ut variable. The in ut variable has
to be greater than –87.33 and smaller than 88.72. This function is the reverse
of the LN function. If you require an enable in ut (EN) and an enable out ut (EN
O): E_EXP.
+ Note
J Data Ty es
This function is only available for the FP0.
In ut Variable
REAL
Out ut Variable
as in ut data ty e
,
Exam le
EXP In this exam le the function EXP is rogrammed in ladder diagram (LD) and in
struction list (IL). The same POU header is used for both rogramming languages.
POU Header All in ut and out ut variables which are required for rogramming th
e function are declared in the POU header.
In this exam le the in ut variable (in ut_value) has been declared. Instead, you
may enter a constant directly at the in ut contact of the function. LD Body The
ower of in ut_value is calculated to the base e and written into out ut_value.
IL Body If you want to call the function in an instruction list, enter the follo
wing:
+ Note
4 – 42
Please see notes at the end of this section.
Matsushita Electric Works (Euro e) AG
NAiS Control 1131
IEC Functions Arithmetic Functions
Outline
Anything stated under EXP also a lies to E_EXP. However, in addition to the EXP
function, E_EXP has an enable in ut (EN) and an enable out ut (ENO) of the data
ty e BOOL. If EN is set (TRUE), E_EXP will be activated. If EN is not set (FALS
E), the status of the out ut variable will remain unchanged until EN is set. ENO
will ado t the status of EN. Therefore, you may connect further function blocks
/functions with ENO which are controlled by the status of EN.
J Data Ty es
In ut Variable
REAL
Out ut Variable
as in ut data ty e
,
Exam le
E_EXP In this exam le the function E_EXP is rogrammed in ladder diagram (LD) an
d instruction list (IL). The same POU header is used for both rogramming langua
ges. POU Header All in ut and out ut variables which are required for rogrammin
g the function are declared in the POU header.
In this exam le the in ut variables (in ut_value and enable) have been declared.
Instead, you may enter a constant directly at the in ut contact of the function
(enable in ut e.g. for tests). LD Body If enable is set (TRUE), the ower of in
ut_value is calculated to the base of e and written into out ut_value.
IL Body If you want to call the function in an instruction list, enter the follo
wing:
Matsushita Electric Works (Euro e) AG
4 – 43
IEC Functions Arithmetic Functions
NAiS Control 1131
+ Notes
• •
It does not matter whether the function names in the IL editor are ca italized o
r not. The following error flags a ly to (E_)EXP:
No.
R9007 R9008 R900B R9009
IEC Address
%MX0.900.7 %MX0.900.8 %MX0.900.1 1 %MX0.900.9
set
ermanently for an instant ermanently for an instant
if
in ut variable does not have the data ty e REAL or in ut variable is not > –87.3
3 and < 88.72 out ut variable is zero rocessing result overflows the out ut var
iable
4 – 44
Matsushita Electric Works (Euro e) AG
NAiS Control 1131
IEC Functions Arithmetic Functions
(E_)EXPT
Outline
EXPT raises the first in ut variable to the ower of the second in ut variable (
OUT = IN1IN2) and writes the result into the out ut variable. In ut variables ha
ve to be within the range –1.70141 x 1038 to 1.70141 x 1038. If you require an e
nable in ut (EN): and an enable out ut (ENO): E_EXPT.
+ Note
J Data Ty es
This function is only available for the FP0.
In ut Variable
1st in ut variable 2nd in ut variable REAL REAL
Out ut Variable
as 1st in ut data ty e
,
Exam le
EXPT In this exam le the function EXPT is rogrammed in ladder diagram (LD) and
instruction list (IL). The same POU header is used for both rogramming language
s. POU Header All in ut and out ut variables which are required for rogramming
the function are declared in the POU header.
In this exam le the in ut variables (in ut_value_1 and in ut_value_2) have been
declared. Instead, you may enter constants directly at the in ut contacts of the
function. LD Body in ut_value_1 is raised to the ower of in ut_value_2. The re
sult is written into out ut_value.
IL Body If you want to call the function in an instruction list, enter the follo
wing:
+ Note
Please see notes at the end of this section.
4 – 45
Matsushita Electric Works (Euro e) AG
IEC Functions Arithmetic Functions
NAiS Control 1131
Outline
Anything stated under EXPT also a lies to E_EXPT. However, in addition to the E
XPT function, E_EXPT has an enable in ut (EN) and an enable out ut (ENO) of the
data ty e BOOL. If EN is set (TRUE), E_EXPT will be activated. If EN is not set
(FALSE), the status of the out ut variable will remain unchanged until EN is set
. ENO will ado t the status of EN. Therefore, you may connect further function b
locks/functions with ENO which are controlled by the status of EN.
J Data Ty es
In ut Variable
1st in ut variable 2nd in ut variable REAL REAL
Out ut Variable
as 1st in ut data ty e
,
Exam le
E_EXPT In this exam le the function E_EXPT is rogrammed in ladder diagram (LD)
and instruction list (IL). The same POU header is used for both rogramming lang
uages. POU Header All in ut and out ut variables which are required for rogramm
ing the function are declared in the POU header.
In this exam le the in ut variables (in ut_value_1, in ut_value_2 and enable) ha
ve been declared. Instead, you may enter constants directly at the in ut contact
s of the function (enable in ut e.g. for tests).
4 – 46
Matsushita Electric Works (Euro e) AG
NAiS Control 1131
IEC Functions Arithmetic Functions
LD Body If enable is set (TRUE), in ut_value_1 is raised to the ower of in ut_v
alue_2. The result is written into out ut_value.
IL Body If you want to call u the function in an instruction list, enter the fo
llowing:
+ Notes
• •
It does not matter whether the function names in the IL editor are ca italized o
r not. The following error flags a ly to (E_)EXPT:
No.
R9007 R9008 R900B R9009
IEC Address
%MX0.900.7 %MX0.900.8 %MX0.900.1 1 %MX0.900.9
set
ermanently for an instant ermanently for an instant
if
first and the second in ut variable do not have the data ty e REAL out ut variab
le is zero rocessing result overflows the out ut variable
Matsushita Electric Works (Euro e) AG
4 – 47
IEC Functions Arithmetic Functions
NAiS Control 1131
4 – 48
Matsushita Electric Works (Euro e) AG
Cha ter 5 Process Data Ty e Functions
(E_)ADD_TIME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 - 3 (
E_)SUB_TIME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 - 5 (E
_)MUL_TIME_INT . . . . . . . . . . . . . . . . . . . . . . . . . 5 - 7 (E_)MUL_T
IME_DINT . . . . . . . . . . . . . . . . . . . . . . . 5 - 9 (E_)MUL_TIME_REAL .
. . . . . . . . . . . . . . . . . . . . . 5 - 11 (E_)DIV_TIME_INT . . . . . . .
. . . . . . . . . . . . . . . . . . 5 - 13 (E_)DIV_TIME_DINT . . . . . . . . .
. . . . . . . . . . . . . . 5 - 15 (E_)DIV_TIME_REAL . . . . . . . . . . . . . .
. . . . . . . . . 5 - 17 -
IEC Functions Process Data Ty e Functions
NAiS Control 1131
5–2
Matsushita Electric Works (Euro e) AG
NAiS Control 1131
IEC Functions Process Data Ty e Functions
(E_)ADD_TIME
Outline
ADD_TIME adds the times of the two in ut variables and writes the sum in the out
ut variable. If you require an enable out ut and an enable in ut: E_ADD_TIME.
J Data Ty es
In ut Variable
TIME
Out ut Variable
TIME
,
Exam le
ADD_TIME In this exam le the function ADD_TIME is rogrammed in ladder diagram (
LD) and instruction list (IL). The same POU header is used for both rogramming
languages. POU Header All in ut and out ut variables which are required for rog
ramming the function are declared in the POU header.
LD Body time_value_1 and time_value_2 are added. The result is written in time_v
alue_3.
IL Body If you wish to call u the function in an instruction list, enter the fo
llowing:
+ Note
It does not matter whether the function names in the IL editor are ca italized o
r not.
Matsushita Electric Works (Euro e) AG
5–3
IEC Functions Process Data Ty e Functions
NAiS Control 1131
Outline
Anything stated under ADD_TIME also a lies to E_ADD_TIME. The function E_ADD_TI
ME, however, has in addition an enabled in ut (EN = enable) and an enabled out u
t (ENO = enable out ut) of the data ty e BOOL. If EN is set (TRUE), E_ADD_TIME w
ill be activated. If EN is reset (FALSE), the status of the variable will be fro
zen until EN is set again. ENO will ado t the status of EN. Therefore, you may c
onnect further function blocks/functions with ENO which are controlled by the st
atus of EN.
E_ADD_TIME In this exam le the function E_ADD_TIME is rogrammed in ladder diagr
am (LD) and instruction list (IL). The same POU header is used for both rogramm
ing languages. POU Header All in ut and out ut variables which are required for
rogramming the function are declared in the POU header.
,
Exam le
LD Body If enable is set (TRUE), time _value_1 and time_value_2 are added. The r
esult is written in time_value_3. Once the function has been rocessed, ENO will
be set.
IL Body If you wish to call u the function in an instruction list, enter the fo
llowing:
+ Note
5–4
It does not matter whether the function names in the IL editor are ca italized o
r not.
Matsushita Electric Works (Euro e) AG
NAiS Control 1131
IEC Functions Process Data Ty e Functions
(E_)SUB_TIME
Outline
SUB_TIME subtracts the value of the second in ut variable from the value of the
first. If you require an enable out ut and an enable in ut: E_SUB_TIME.
J Data Ty es
In ut Variable
TIME
Out ut Variable
TIME
,
Exam le
SUB_TIME In this exam le the function SUB_TIME is rogrammed in ladder diagram (
LD) and instruction list (IL). The same POU header is used for both rogramming
languages. POU Header All in ut and out ut variables which are required for rog
ramming the function are declared in the POU header.
LD Body Subtrahend is subtracted from minuend. The result will be written in res
ult.
IL Body If you wish to call u the function in an instruction list, enter the fo
llowing:
+ Note
It does not matter whether the function names in the IL editor are ca italized o
r not.
Matsushita Electric Works (Euro e) AG
5–5
IEC Functions Process Data Ty e Functions
NAiS Control 1131
Outline
Anything stated under SUB_TIME also a lies to E_SUB_TIME. The function E_SUB_TI
ME, however, has in addition an enabled in ut (EN = enable) and an enabled out u
t (ENO = enable out ut) of the data ty e BOOL. If EN is set (TRUE), E_SUB_TIME w
ill be activated. If EN is reset (FALSE), the status of the variable will be fro
zen until EN is set again. ENO will ado t the status of EN. Therefore, you may c
onnect further function blocks/functions with ENO which are controlled by the st
atus of EN.
E_SUB_TIME In this exam le the function E_SUB_TIME is rogrammed in ladder diagr
am (LD) and instruction list (IL). The same POU header is used for both rogramm
ing languages. POU Header All in ut and out ut variables which are required for
rogramming the function are declared in the POU header.
,
Exam le
LD Body If enable is set (TRUE), subtrahend is subtracted from minuend. The resu
lt will be written in result. Once the function has been rocessed, ENO will be
set.
IL Body If you wish to call u the function in an instruction list, enter the fo
llowing:
+ Note
5–6
It does not matter whether the function names in the IL editor are ca italized o
r not.
Matsushita Electric Works (Euro e) AG
NAiS Control 1131
IEC Functions Process Data Ty e Functions
(E_)MUL_TIME_INT
Outline
MUL_TIME_INT multi lies the values of the two in ut variables with each other an
d writes the result into the out ut variable. If you require an enable out ut an
d an enable in ut: E_MUL_TIME_INT.
J Data Ty es
In ut Variable
TIME INTEGER
Out ut Variable
TIME TIME
,
Exam le
MUL_TIME_INT In this exam le the function MUL_TIME_INT is rogrammed in ladder d
iagram (LD) and instruction list (IL). The same POU header is used for both rog
ramming languages. POU Header All in ut and out ut variables which are required
for rogramming the function are declared in the POU header.
LD Body time_value_1 is multi lied with multi licator. The result is written in
time_value_2.
IL Body If you wish to call u the function in an instruction list, enter the fo
llowing:
+ Note
It does not matter whether the function names in the IL editor are ca italized o
r not.
Matsushita Electric Works (Euro e) AG
5–7
IEC Functions Process Data Ty e Functions
NAiS Control 1131
Outline
Anything stated under MUL_TIME_INT also a lies to E_MUL_TIME_INT. The function
E_MUL_TIME_INT, however, has in addition an enabled in ut (EN = enable) and an e
nabled out ut (ENO = enable out ut) of the data ty e BOOL. If EN is set (TRUE),
E_MUL_TIME_INT will be activated. If EN is reset (FALSE), the status of the vari
able will be frozen until EN is set again. ENO will ado t the status of EN. Ther
efore, you may connect further function blocks/functions with ENO which are cont
rolled by the status of EN.
E_MUL_TIME_INT In this exam le the function E_MUL_TIME_INT is rogrammed in ladd
er diagram (LD) and instruction list (IL). The same POU header is used for both
rogramming languages. POU Header All in ut and out ut variables which are requi
red for rogramming the function are declared in the POU header.
,
Exam le
LD Body If enable is set (TRUE), the time_value_1 is multi lied with multi licat
or. The result will be written in time_value_2. Once the function has been roce
ssed, ENO will be set.
IL Body If you wish to call u the function in an instruction list, enter the fo
llowing:
+ Note
5–8
It does not matter whether the function names in the IL editor are ca italized o
r not.
Matsushita Electric Works (Euro e) AG
NAiS Control 1131
IEC Functions Process Data Ty e Functions
(E_)MUL_TIME_DINT
Outline
MUL_TIME_DINT multi lies the values of the in ut variables and writes the result
to the out ut variable. If you require an enable out ut (EN) and an enable in u
t (ENO), use: E_MUL_TIME_DINT.
J Data ty es
in ut variable
TIME, DINT
out ut variable
TIME
,
Exam le
MUL_TIME_DINT In this exam le the function MUL_TIME_DINT is rogrammed in ladder
diagram (LD) and instruction list (IL). The same POU header is used for both r
ogramming languages. POU Header In the POU header, all in ut and out ut variable
s are declared that are used for rogramming this function.
In this exam le, the in ut variables time_value and multi lier have been declare
d. However, you can write a constant directly at the in ut contact of the functi
on instead. Body time_value_1 is multi lied by multi lier. The result is written
in time_value_2. LD Body
IL Body If you wish to call u the function using instruction list, enter the fo
llowing:
* Note next age
Matsushita Electric Works (Euro e) AG
5–9
IEC Functions Process Data Ty e Functions
NAiS Control 1131
Outline
E_MUL_TIME_DINT multi lies the values of the in ut variables and writes the resu
lt to the out ut variable. E_MUL_TIME_DINT has in addition an enabled in ut (EN)
and an enable out ut (ENO) of the data ty e BOOL. If EN is set (TRUE), the func
tion is activated. If EN is not set (FALSE), the function is not executed and th
e value of the out ut variable remains unchanged until EN is set. ENO will ado t
the status of EN. Therefore, you may connect further functions and function blo
cks that are controlled by the status of EN.
E_MUL_TIME_DINT In this exam le the function E_MUL_TIME_DINT is rogrammed in la
dder diagram (LD) and instruction list (IL). The same POU header is used for bot
h rogramming languages. POU Header In the POU header, all in ut and out ut vari
ables are declared that are used for rogramming this function.
,
Exam le
In this exam le, the in ut variables start, time_value_1, and multi lier have be
en declared. However, you can write a constant directly at the in ut contact of
the function instead. Body When start is set (TRUE), time_value_1 is multi lied
by multi lier. The result is written in time_value_2. After the function has bee
n rocessed, ENO is set. LD Body
IL Body If you wish to call u the function using instruction list, enter the fo
llowing:
+ Note
5 – 10
It does not matter whether the names of the functions are ca italized in the IL
editor or not.
Matsushita Electric Works (Euro e) AG
NAiS Control 1131
IEC Functions Process Data Ty e Functions
(E_)MUL_TIME_REAL
Outline
MUL_TIME_REAL multi lies the value of the first in ut variable of the data ty e
TIME by the value of the second in ut variable of the data ty e REAL. The REAL v
alue is rounded off to the nearest whole number. The result is written into the
out ut variable. If you require an enable out ut and an enable in ut: E_MUL_TIME
_REAL.
+ Note
J Data Ty es
This function is only available for the FP0.
In ut Variable
TIME REAL
Out ut Variable
TIME
,
Exam le
MUL_TIME_REAL In this exam le the function MUL_TIME_REAL is rogrammed using the
ladder diagram (LD) editor. Since constants are entered directly at the in ut f
unction ins, only the out ut variable need be declared in the header. POU Heade
r All in ut and out ut variables that are required for rogramming the function
are declared in the POU header.
Body The constant T#1h30m is multi lied by the value 3.5, which is rounded off t
o 4.0 in the actual calculation. The result is written in mul_result. By clickin
g on the view icon while in the online mode, you can see the result T#6h0m0s0.00
ms immediately. LD Body
IL Body
+ Note
It does not matter whether the function names in the IL editor are ca italized o
r not.
5 – 11
Matsushita Electric Works (Euro e) AG
IEC Functions Process Data Ty e Functions
NAiS Control 1131
Outline
Anything stated under MUL_TIME_REAL also a lies to E_MUL_TIME_REAL. The functio
n E_MUL_TIME_REAL, however, has in addition an enabled in ut (EN = enable) and a
n enabled out ut (ENO = enable out ut) of the data ty e BOOL. If EN is set (TRUE
), E_MUL_TIME_REAL will be activated. If EN is reset (FALSE), the status of the
variable will be frozen until EN is set again. ENO will ado t the status of EN.
Therefore, you may connect further function blocks/functions with ENO which are
controlled by the status of EN.
E_MUL_TIME_REAL In this exam le the function E_MUL_TIME_REAL is rogrammed in la
dder diagram (LD) and instruction list (IL). The same POU header is used for bot
h rogramming languages. POU Header All in ut and out ut variables which are req
uired for rogramming the function are declared in the POU header.
,
Exam le
Body If start is set (TRUE), in ut_time is multi lied by in ut_real. The result
is written in mul_result. Once the function has been rocessed, ENO will be set.
In this exam le the in ut variables have been declared in the POU header. Howev
er, you may enter constants directly at the contact ins of the function. LD Bod
y
IL Body If you wish to call u the function in an instruction list, enter the fo
llowing:
+ Note
It does not matter whether the function names in the IL editor are ca italized o
r not.
5 – 12
Matsushita Electric Works (Euro e) AG
NAiS Control 1131
IEC Functions Process Data Ty e Functions
(E_)DIV_TIME_INT
Outline
DIV_TIME_INT divides the value of the first in ut variable by the value of the s
econd in ut variable and writes the result into the out ut variable. If you requ
ire an enable out ut and an enable in ut: E_DIV_TIME_INT.
J Data Ty es
In ut Variable
TIME INTEGER
Out ut Variable
TIME TIME
,
Exam le
DIV_TIME_INT In this exam le the function DIV_TIME_INT is rogrammed in ladder d
iagram (LD) and instruction list (IL). The same POU header is used for both rog
ramming languages. POU Header All in ut and out ut variables which are required
for rogramming the function are declared in the POU header.
LD Body time_value_1 is divided by INT_value. The result is written in time_valu
e_2.
IL Body If you wish to call u the function in an instruction list, enter the fo
llowing:
+ Note
It does not matter whether the function names in the IL editor are ca italized o
r not.
Matsushita Electric Works (Euro e) AG
5 – 13
IEC Functions Process Data Ty e Functions
NAiS Control 1131
Outline
Anything stated under DIV_TIME_INT also a lies to E_DIV_TIME_INT. The function
E_DIV_TIME_INT, however, has in addition an enabled in ut (EN = enable) and an e
nabled out ut (ENO = enable out ut) of the data ty e BOOL. If EN is set (TRUE),
E_DIV_TIME_INT will be activated. If EN is reset (FALSE), the status of the vari
able will be frozen until EN is set again. ENO will ado t the status of EN. Ther
efore, you may connect further function blocks/functions with ENO which are cont
rolled by the status of EN.
E_DIV_TIME_INT In this exam le the function E_DIV_TIME_INT is rogrammed in ladd
er diagram (LD) and instruction list (IL). The same POU header is used for both
rogramming languages. POU Header All in ut and out ut variables which are requi
red for rogramming the function are declared in the POU header.
,
Exam le
LD Body If enable is set (TRUE), time_value_1 is divided by INT_value. The resul
t is written in time_value_2. Once the function has been rocessed, ENO will be
set.
IL Body If you wish to call u the function in an instruction list, enter the fo
llowing:
+ Note
5 – 14
It does not matter whether the function names in the IL editor are ca italized o
r not.
Matsushita Electric Works (Euro e) AG
NAiS Control 1131
IEC Functions Process Data Ty e Functions
(E_)DIV_TIME_DINT
Outline
DIV_TIME_DINT divides the value of the first in ut variable by the value of the
second and writes the result into the out ut variable. If you require an enable
out ut (EN) and an enable in ut (ENO), use: E_DIV_TIME_DINT.
J Data ty es
in ut variable
TIME, DINT
out ut variable
TIME
,
Exam le
DIV_TIME_DINT In this exam le the function DIV_TIME_DINT is rogrammed in ladder
diagram (LD) and instruction list (IL). The same POU header is used for both r
ogramming languages. POU Header In the POU header, all in ut and out ut variable
s are declared that are used for rogramming this function.
In this exam le, the in ut variables time_value_1 and DINT_value have been decla
red. However, you can write a constant directly at the in ut contact of the func
tion instead. Body time_value_1 is divided by DINT_value. The result is written
in time_value_2. LD Body
IL Body If you wish to call u the function using instruction list, enter the fo
llowing:
* Note next age
Matsushita Electric Works (Euro e) AG
5 – 15
IEC Functions Process Data Ty e Functions
NAiS Control 1131
Outline
E_DIV_TIME_DINT divides the value of the first in ut variable by the value of th
e second and writes the result into the out ut variable. E_DIV_TIME_DINT has in
addition an enabled in ut (EN) and an enable out ut (ENO) of the data ty e BOOL.
If EN is set (TRUE), the function is activated. If EN is not set (FALSE), the f
unction is not executed and the value of the out ut variable remains unchanged u
ntil EN is set. ENO will ado t the status of EN. Therefore, you may connect furt
her functions and function blocks that are controlled by the status of EN.
E_DIV_TIME_DINT In this exam le the function E_DIV_TIME_DINT is rogrammed in la
dder diagram (LD) and instruction list (IL). The same POU header is used for bot
h rogramming languages. POU Header In the POU header, all in ut and out ut vari
ables are declared that are used for rogramming this function.
,
Exam le
In this exam le, the in ut variables start, time_value_1, and DINT_value have be
en declared. However, you can write a constant directly at the in ut contact of
the function instead. Body When start is set (TRUE), time_value_1 is divided by
DINT_value. The result is written in time_value_2. After the function has been
rocessed, ENO is set. LD Body
IL Body If you wish to call u the function using instruction list, enter the fo
llowing:
+ Note
5 – 16
It does not matter whether the names of the functions are ca italized in the IL
editor or not.
Matsushita Electric Works (Euro e) AG
NAiS Control 1131
IEC Functions Process Data Ty e Functions
(E_)DIV_TIME_REAL
Outline
DIV_TIME_REAL divides the value of the first in ut variable of the data ty e TIM
E by the value of the second in ut variable of the data ty e REAL. The REAL valu
e is rounded off to the nearest whole number. The result is written into the out
ut variable. If you require an enable out ut and an enable in ut: E_DIV_TIME_RE
AL.
+ Note
J Data Ty es
This function is only available for the FP0.
In ut Variable
TIME REAL
Out ut Variable
TIME
,
Exam le
DIV_TIME_REAL Here the function DIV_TIME_REAL is rogrammed in ladder diagram (L
D) and instruction list (IL). The same POU header is used for both rogramming l
anguages. POU Header All in ut and out ut variables that are required for rogra
mming the function are declared in the POU header.
Body The value of variable in ut_time is divided by the value of the variable in
ut_real. The result is written in div_result. In this exam le the in ut variabl
es have been declared in the POU header. However, you may enter constants direct
ly at the contact ins of the function. LD Body
IL Body If you wish to call u the function in an instruction list, enter the fo
llowing:
+ Note
It does not matter whether the function names in the IL editor are ca italized o
r not.
5 – 17
Matsushita Electric Works (Euro e) AG
IEC Functions Process Data Ty e Functions
NAiS Control 1131
Outline
Anything stated under DIV_TIME_REAL also a lies to E_DIV_TIME_REAL. The functio
n E_DIV_TIME_REAL, however, has in addition an enabled in ut (EN = enable) and a
n enabled out ut (ENO = enable out ut) of the data ty e BOOL. If EN is set (TRUE
), E_DIV_TIME_REAL will be activated. If EN is reset (FALSE), the status of the
variable will be frozen until EN is set again. ENO will ado t the status of EN.
Therefore, you may connect further function blocks/functions with ENO which are
controlled by the status of EN.
E_DIV_TIME_REAL In this exam le the function E_DIV_TIME_REAL is rogrammed in la
dder diagram (LD) and instruction list (IL). The same POU header is used for bot
h rogramming languages. POU Header All in ut and out ut variables which are req
uired for rogramming the function are declared in the POU header.
,
Exam le
Body If start is set (TRUE), in ut_time is divided by in ut_real. The result is
written in div_result. Once the function has been rocessed, ENO will be set. In
this exam le the in ut variables have been declared in the POU header. However,
you may enter constants directly into the function. LD Body
IL Body If you wish to call u the function in an instruction list, enter the fo
llowing:
+ Note
It does not matter whether the function names in the IL editor are ca italized o
r not.
5 – 18
Matsushita Electric Works (Euro e) AG
Cha ter 6 Bitshift Functions
(E_)SHL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. 6 - 3 (E_)SHR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . 6 - 6 (E_)ROL . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . 6 - 9 (E_)ROR . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . 6 - 12 -
IEC Functions Bitshift Functions
NAiS Control 1131
6–2
Matsushita Electric Works (Euro e) AG
NAiS Control 1131
IEC Functions Bitshift Functions
(E_)SHL
Outline
SHL shifts a bit value by a defined number of ositions (n) to the left and fill
s the vacant ositions with zeros. Bit shift to the left, zero–filled on right
source register (n = 4 bit) bit DT0 15 . . 12 11 . . 8 7..4 3. .0
target register bit DT0 15 . . 12 11 . . 8 7..4 3. .0
0000 these 4 bits are filled u with zeros
E_SHL shifts a bit value by a defined number of ositions (n) to the left and fi
lls the vacant ositions with zeros when EN ist set (TRUE).
source register (n = 4 bit) bit DT0 EN = TRUE target register bit DT0 15 . . 12
11 . . 8 7..4 3. .0 15 . . 12 11 . . 8 7..4 3. .0
0000 these 4 bits are filled u with zeros
J Data Ty es
1. + 2. In ut Variable
BOOL WORD DOUBLE WORD
Out ut Variable
as data ty e of the two in ut variables
In ut and out ut variables have to be of the same data ty e.
Matsushita Electric Works (Euro e) AG
6–3
IEC Functions Bitshift Functions
NAiS Control 1131
,
Exam le
SHL In this exam le the function SHL is rogrammed in ladder diagram (LD) and in
struction list (IL). The same POU header is used for both rogramming languages.
POU Header All in ut and out ut variables which are required for rogramming th
e function are declared in the POU header.
This exam le uses variables. You may also use constants for the in ut variables.
LD Body The first n bits (here 3) of source_register are left–shifted, the vaca
nt ositions on the right are filled with zeros. The result is written in target
_register.
IL Body If you wish to call u the function in an instruction list, enter the fo
llowing:
+ Note
It does not matter whether the function names in the IL editor are ca italized o
r not.
* next age
6–4
Matsushita Electric Works (Euro e) AG
NAiS Control 1131
IEC Functions Bitshift Functions
Outline
Anything stated under SHL also a lies to E_SHL. The function E_SHL, however, ha
s in addition an enabled in ut (EN = enable) and an enabled out ut (ENO = enable
out ut) of the data ty e BOOL. If EN is set (TRUE), E_SHL will be activated. If
EN is reset (FALSE), the status of the variable will be frozen until EN is set
again. ENO will ado t the status of EN. Therefore, you may connect further funct
ion blocks/functions with ENO which are controlled by the status of EN. Left shi
ft by bits:
E_SHL In this exam le the function E_SHL is rogrammed in ladder diagram (LD) an
d instruction list (IL). The same POU header is used for both rogramming langua
ges. POU Header All in ut and out ut variables which are required for rogrammin
g the function are declared in the POU header.
,
Exam le
This exam le uses variables. You may also use constants for the in ut variables.
LD Body All bits of source_register are left–shifted by n ositions (here 3) an
d the vacant ositions on the right are zero filled. The result is written in ta
rget_register.
IL Body If you wish to call u the function in an instruction list, enter the fo
llowing:
+ Note
It does not matter whether the function names in the IL editor are ca italized o
r not.
Matsushita Electric Works (Euro e) AG
6–5
IEC Functions Bitshift Functions
NAiS Control 1131
(E_)SHR
Outline
SHR shifts a bit value by a defined number of ositions (n) to the right and fil
ls the vacant ositions with zeros. Bit shift to the right, zero–filled on left:
source register (n = 4 bit) 15 . . 12 11 . . 8 7..4 3. .0
bit
DT0
target register bit 15 . . 12 11 . . 8 DT0 0000
7..4
3. .0
the 4 most significant bits are filled u with zeros
E_SHR shifts a bit value by a defined number of ositions (n) to the right and f
ills the vacant ositions with zeros when EN is set (TRUE).
source register (n = 4 bit) 15 . . 12 11 . . 8 7..4 3. .0
bit
DT0
EN = TRUE target register bit 15 . . 12 11 . . 8 DT0 0000
7..4
3. .0
the 4 most significant bits are filled u with zeros
J Data Ty es
1. + 2. In ut Variable
BOOL WORD DOUBLE WORD
Out ut Variable
as data ty e of the two in ut variables
In ut and out ut variables have to be of the same data ty e.
* next age
6–6
Matsushita Electric Works (Euro e) AG
NAiS Control 1131
IEC Functions Bitshift Functions
,
Exam le
SHR In this exam le the function SHR is rogrammed in ladder diagram (LD) and in
struction list (IL). The same POU header is used for both rogramming languages.
POU Header All in ut and out ut variables which are required for rogramming th
e function are declared in the POU header.
This exam le uses variables. You may also use constants for the in ut variables.
LD Body The last n bits (here 3) of source_register are right–shifted. The vaca
nt ositions on the left are filled with zeros. The result is written in target_
register.
IL Body If you wish to call u the function SHR in an instruction list, enter th
e following:
+ Note
It does not matter whether the function names in the IL editor are ca italized o
r not.
Matsushita Electric Works (Euro e) AG
6–7
IEC Functions Bitshift Functions
NAiS Control 1131
Outline
Anything stated under SHR also a lies to E_SHR. The function E_SHR, however, ha
s in addition an enabled in ut (EN = enable) and an enabled out ut (ENO = enable
out ut) of the data ty e BOOL. If EN is set (TRUE), E_SHR will be activated. If
EN is reset (FALSE), the status of the variable will be frozen until EN is set
again. ENO will ado t the status of EN. Therefore, you may connect further funct
ion blocks/functions with ENO which are controlled by the status of EN.
E_SHR In this exam le the function E_SHR is rogrammed in ladder diagram (LD) an
d instruction list (IL). The same POU header is used for both rogramming langua
ges. POU Header All in ut and out ut variables which are required for rogrammin
g the function are declared in the POU header.
,
Exam le
This exam le uses variables. You may also use constants for the in ut variables.
LD Body If enable is set (TRUE), all bits of source_register (data ty e WORD) w
ill be right–shifted by n ositions (in this case 3). The vacant ositions on th
e right are zero filled. The result is written in target_register (data ty e WOR
D).
IL Body If you wish to call u E_SHR in an instruction list, enter the following
:
+ Note
6–8
It does not matter whether the function names in the IL editor are ca italized o
r not.
Matsushita Electric Works (Euro e) AG
NAiS Control 1131
IEC Functions Bitshift Functions
(E_)ROL
Outline
ROL rotates a defined number (n) of bits to the left.
source register bit DT0 (n = 4 bit) 15 . . 12 11 . . 8 0001 0010 7..4 0011 3..0
0100
target register bit DT0 15 . . 12 11 . . 8 0010 0011
7..4
0100
3..0
0001
E_ROL rotates a defined number (n) of bits to the left when EN is set (TRUE).
source register bit DT0 (n = 4 bit) 15 . . 12 11 . . 8 0001 0010 7..4 0011 3..0
0100 EN = TRUE 15 . . 12 11 . . 8 0010 0011
target register bit DT0
7..4
0100
3..0
0001
J Data Ty es
1. + 2. In ut Variable
BOOL WORD DOUBLE WORD
Out ut Variable
as data ty e of the two in ut variables
In ut and out ut variables have to be of the same data ty e.
Matsushita Electric Works (Euro e) AG
6–9
IEC Functions Bitshift Functions
NAiS Control 1131
,
Exam le
ROL In this exam le the function ROL is rogrammed in ladder diagram (LD) and in
struction list (IL). The same POU header is used for both rogramming languages.
POU Header All in ut and out ut variables which are required for rogramming th
e function are declared in the POU header.
This exam le uses variables. You may also use constants/variables. LD Body The l
ast n bits (here 3) of source_register are left–rotated. The result will be writ
ten in target_register.
IL Body If you wish to call u the function in an instruction list, enter the fo
llowing:
+ Note
It does not matter whether the function names in the IL editor are ca italized o
r not.
* next age
6 – 10
Matsushita Electric Works (Euro e) AG
NAiS Control 1131
IEC Functions Bitshift Functions
Outline
Anything stated under ROL also a lies to E_ROL. The function E_ROL, however, ha
s in addition an enabled in ut (EN = enable) and an enabled out ut (ENO = enable
out ut) of the data ty e BOOL. If EN is set (TRUE), E_ROL will be activated. If
EN is reset (FALSE), the status of the variable will be frozen until EN is set
again. ENO will ado t the status of EN. Therefore, you may connect further funct
ion blocks/functions with ENO which are controlled by the status of EN.
E_ROL In this exam le the function E_ROL is rogrammed in ladder diagram (LD) an
d instruction list (IL). The same POU header is used for both rogramming langua
ges. POU Header All in ut and out ut variables which are required for rogrammin
g the function are declared in the POU header.
,
Exam le
This exam le uses variables. You may also use constants for the in ut variables
LD Body If enable is set (TRUE), all bits of source_register are left–rotated by
n– ositions (in this case 3). The result will be written in target_register.
IL Body If you wish to call u the function in an instruction list, enter the fo
llowing:
+ Note
It does not matter whether the function names in the IL editor are ca italized o
r not.
Matsushita Electric Works (Euro e) AG
6 – 11
IEC Functions Bitshift Functions
NAiS Control 1131
(E_)ROR
Outline
ROR rotates a defined number (n) of bits to the right.
source register bit DT0 15 . . 12 11 . . 8 0001 0010 7..4 0011 ( n = 4 bit) 3..0
0100
target register bit DT0 15 . . 12 11 . . 8 0100
7..4 0010
3 . .0 0011
0001
E_ROR rotates a defined number (n) of bits to the right when EN ist set (TRUE).
source register bit DT0 ( n = 4 bit) 7..4 0011 3..0 0100 15 . . 12 11 . . 8 0001
0010
EN = TRUE target register bit DT0 15 . . 12 11 . . 8 0100
7..4 0010
3 . .0 0011
0001
J Data Ty es
1. + 2. In ut Variable
BOOL WORD DOUBLE WORD
Out ut Variable
as data ty e of the two in ut variables
In ut and out ut variables have to be of the same data ty e.
* next age
6 – 12
Matsushita Electric Works (Euro e) AG
NAiS Control 1131
IEC Functions Bitshift Functions
,
Exam le
ROR In this exam le the function ROR is rogrammed in ladder diagram (LD) and in
struction list (IL). The same POU header is used for both rogramming languages.
POU Header All in ut and out ut variables which are required for rogramming th
e function are declared in the POU header.
This exam le uses variables. You may also use constants for the in ut variables.
LD Body The first n bits (here n = 3) of source_register are right–rotated. The
result will be written in target_register.
IL Body If you wish to call u the function in an instruction list, enter the fo
llowing:
+ Note
It does not matter whether the function names in the IL editor are ca italized o
r not.
Matsushita Electric Works (Euro e) AG
6 – 13
IEC Functions Bitshift Functions
NAiS Control 1131
Outline
Anything stated under ROR also a lies to E_ROR. The function E_ROR, however, ha
s in addition an enabled in ut (EN = enable) and an enabled out ut (ENO = enable
out ut) of the data ty e BOOL. If EN is set (TRUE), E_ROR will be activated. If
EN is reset (FALSE), the status of the variable will be frozen until EN is set
again. ENO will ado t the status of EN. Therefore, you may connect further funct
ion blocks/functions with ENO which are controlled by the status of EN.
E_ROR In this exam le the function E_ROR is rogrammed in ladder diagram (LD) an
d instruction list (IL). The same POU header is used for both rogramming langua
ges. POU Header All in ut and out ut variables which are required for rogrammin
g the function are declared in the POU header.
,
Exam le
This exam le uses variables. You may also use constants for the in ut variables
LD Body If enable is set (TRUE), all bits of source_register are right–rotated b
y n– ositions (in this case 3). The result will be written in target_register.
IL Body If you wish to call u the function in an instruction list, enter the fo
llowing:
+ Note
6 – 14
It does not matter whether the function names in the IL editor are ca italized o
r not.
Matsushita Electric Works (Euro e) AG
Cha ter 7 Bitwise Boolean Functions
(E_)AND . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7 - 3 (E_)OR
.................................... 7 - 5 -
(E_)XOR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7 - 7 (E_)NOT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . 7 - 9 -
IEC Functions Bitwise Boolean Functions
NAiS Control 1131
7–2
Matsushita Electric Works (Euro e) AG
NAiS Control 1131
IEC Functions Bitwise Boolean Functions
(E_)AND
Outline
The content of the accumulator is connected with the o erand defined in the o er
and field by a logical AND o eration. The result is transferred to the accumulat
or.
J Data Ty es
In ut Variable
BOOL WORD DWORD
Out ut Variable
as in ut data ty e
In ut and out ut variables have to be of the same data ty e.
,
Exam le
AND POU Header Class Identifier
0 1 2 VAR VAR VAR var_1 var_2 var_3
Ty e
BOOL BOOL BOOL
Initial
FALSE FALSE FALSE
Comment
In ut_1 In ut_2 Out ut
IL Body
LD AND ST var_1 var_2 var_3 (* Load var_1 in accu *) (* Perform an AND of accu w
ith var_2; store result in accu *) (* Store accu in var_3 *)
LD Body
+ Notes
• • •
var_1, var_2 and var_3 must be of one of the above noted data ty es. All o erand
s must be of the same data ty e. The number of in ut contacts lies in the range
of 2 to 28. It is not im ortant whether the function names in the IL editor are
ca italized or not.
Matsushita Electric Works (Euro e) AG
7–3
IEC Functions Bitwise Boolean Functions
NAiS Control 1131
Outline
E_AND links the in ut variables with a logical AND. E_AND o erates just as the s
tandard o erator AND (see: Online Hel : Hel > Index > Standard O erators). Howe
ver, E_AND has an additional enabled in ut (EN = enable) and an enabled out ut (
ENO = enable out ut) of the data ty e BOOL. If EN is set (TRUE), E_AND will be a
ctivated. If EN is reset (FALSE), the variable’s status will be frozen until EN
is set again. ENO will ado t the status of EN. Therefore, you may connect furthe
r function blocks/functions with ENO which are controlled by the status of EN.
E_AND In this exam le the function E_AND is rogrammed in ladder diagram (LD) an
d instruction list (IL). The same POU header is used for both rogramming langua
ges. POU Header All in ut and out ut variables which are required for rogrammin
g the function are declared in the POU header.
,
Exam le
This exam le uses variables. You may also use constants for the in ut variables.
LD Body If enable is set (TRUE), o erand_1 will be logically AND–linked with o
erand_2. The result will be written into the out ut variable result.
IL Body If you wish to call u the function in an instruction list, enter the fo
llowing:
+ Notes
• •
The number of in ut contacts a_BitN lies in the range of 2 to 28. It does not ma
tter whether the function names in the IL editor are ca italized or not.
Matsushita Electric Works (Euro e) AG
7–4
NAiS Control 1131
IEC Functions Bitwise Boolean Functions
(E_)OR
Outline
The content of the accumulator is connected with the o erand defined in the o er
and field by a logical OR o eration. The result is transferred to the accumulato
r.
J Data Ty es
In ut Variable
BOOL WORD DWORD
Out ut Variable
as in ut data ty e
In ut and out ut variables have to be of the same data ty e.
,
Exam le
OR POU Header Class Identifier
0 1 2 VAR VAR VAR var_1 var_2 var_3
Ty e
BOOL BOOL BOOL
Initial
FALSE FALSE FALSE
Comment
In ut_1 In ut_2 Out ut
IL Body
LD OR ST var_1 var_2 var_3 (* Load var_1 in accu *) (* Perform an OR of accu wit
h var_2; store result in accu *) (* Store accu in var_3 *)
LD Body
+ Notes
• • •
var_1, var_2 and var_3 must be of one of the above noted data ty es. All o erand
s must be of the same data ty e. The number of in ut contacts lies in the range
of 2 to 28. It is not im ortant whether the function names in the IL editor are
ca italized or not.
Matsushita Electric Works (Euro e) AG
7–5
IEC Functions Bitwise Boolean Functions
NAiS Control 1131
Outline
E_OR o erates just as the standard o erator OR (Online Hel : Hel > Index > Stan
dard O erators). E_OR, however, has in addition an enabled in ut (EN = enable) a
nd an enabled out ut (ENO = enable out ut) of the data ty e BOOL. If EN is set (
TRUE), E_OR will be activated. If EN is reset (FALSE), the status of the variabl
e will be frozen until EN is set again. ENO will ado t the status of EN. Therefo
re, you may connect further function blocks/functions with ENO which are control
led by the status of EN.
E_OR In this exam le the function E_OR is rogrammed in ladder diagram (LD) and
instruction list (IL). The same POU header is used for both rogramming language
s. POU Header All in ut and out ut variables which are required for rogramming
the function are declared in the POU header.
,
Exam le
This exam le uses variables. You may also use constants for the in ut variables
LD Body If enable is set (TRUE), o erand_1 and o erand_2 are linked with a logic
al OR. The result will be written in result.
IL Body If you wish to call u the function in an instruction list, enter the fo
llowing:
+ Notes
• •
The number of in ut contacts a_BitN lies in the range of 2 to 28. It does not ma
tter whether the function names in the IL editor are ca italized or not.
Matsushita Electric Works (Euro e) AG
7–6
NAiS Control 1131
IEC Functions Bitwise Boolean Functions
(E_)XOR
Outline
The content of the accumulator is connected with the o erand defined in the o er
and field by a logical XOR o eration. The result is transferred to the accumulat
or.
J Data Ty es
In ut Variable
BOOL WORD DWORD
Out ut Variable
as in ut data ty e
In ut and out ut variables have to be of the same data ty e.
,
Exam le
XOR POU Header Class Identifier
0 1 2 VAR VAR VAR var_1 var_2 var_3
Ty e
BOOL BOOL BOOL
Initial
FALSE FALSE FALSE
Comment
In ut_1 In ut_2 Out ut
IL Body
LD XOR ST var_1 var_2 var_3 (* Load var_1 in accu *) (* Perform an XOR of accu w
ith var_2; store result in accu *) (* Store accu in var_3 *)
LD Body
+ Notes
• • •
var_1, var_2 and var_3 must be of one of the above noted data ty es. All o erand
s must be of the same data ty e. The number of in ut contacts lies in the range
of 2 to 28. It is not im ortant whether the function names in the IL editor are
ca italized or not.
Matsushita Electric Works (Euro e) AG
7–7
IEC Functions Bitwise Boolean Functions
NAiS Control 1131
Outline
E_XOR o erates as the standard o erator XOR (Online Hel : Hel > Index > Standar
d O erators. The function E_XOR, however, has in addition an enabled in ut (EN =
enable) and an enabled out ut (ENO = enable out ut) of the data ty e BOOL. If E
N is set (TRUE), E_WORD_TO_DWORD will be activated. If EN is reset (FALSE), the
status of the variable will be frozen until EN is set again. ENO will ado t the
status of EN. Therefore, you may connect further function blocks/functions with
ENO which are controlled by the status of EN.
E_XOR In this exam le the function E_XOR is rogrammed in ladder diagram (LD) an
d instruction list (IL). The same POU header is used for both rogramming langua
ges. POU Header All in ut and out ut variables which are required for rogrammin
g the function are declared in the POU header.
,
Exam le
This exam le uses variables. You may also use constants for the in ut variables.
LD Body If enable is set, the Boolean variables o erand_1 and o erand_2 are log
ically EXCLUSIVE–OR linked and the result is written in result.
IL Body If you wish to call u the function in an instruction list, enter the fo
llowing:
+ Notes
• •
The number of in ut contacts a_BitN lies in the range of 2 to 28. It does not ma
tter whether the function names in the IL editor are ca italized or not.
Matsushita Electric Works (Euro e) AG
7–8
NAiS Control 1131
IEC Functions Bitwise Boolean Functions
(E_)NOT
Outline
NOT erforms a bit inversion of in ut variables. The result will be written in t
he out ut variable. If you require an enable out ut and an enable in ut: E_NOT.
J Data Ty es
In ut Variable
BOOL WORD DWORD
Out ut Variable
as in ut data ty e
In ut and out ut variables have to be of the same data ty e.
,
Exam le
NOT In this exam le the function NOT is rogrammed in ladder diagram (LD) and in
struction list (IL). The same POU header is used for both rogramming languages.
POU Header All in ut and out ut variables which are required for rogramming th
e function are declared in the POU header.
This exam le uses variables. You may also use constants for the in ut variables.
LD Body The bits of in ut_value are inversed (0 is inversed to 1 and vice versa
). The inversed result is written in negation.
IL Body If you wish to call u the function in an instruction list, enter the fo
llowing:
* Note next age
Matsushita Electric Works (Euro e) AG 7–9
IEC Functions Bitwise Boolean Functions
NAiS Control 1131
Outline
Anything stated under NOT also a lies to E_NOT. The function E_NOT, however, ha
s in addition an enabled in ut (EN = enable) and an enabled out ut (ENO = enable
out ut) of the data ty e BOOL. If EN is set (TRUE), E_NOT will be activated. If
EN is reset (FALSE), the status of the variable will be frozen until EN is set
again. ENO will ado t the status of EN. Therefore, you may connect further funct
ion blocks/functions with ENO which are controlled by the status of EN.
E_NOT In this exam le the function E_NOT is rogrammed in ladder diagram (LD) an
d instruction list (IL). The same POU header is used for both rogramming langua
ges. POU Header All in ut and out ut variables which are required for rogrammin
g the function are declared in the POU header.
,
Exam le
This exam le uses variables. You may also use constants for the in ut variables
LD Body If enable is set (TRUE), each bit of in ut_value will be inverted, i.e.
0 is inverted to 1 and vice versa. The result will be written in negation.
IL Body If you wish to call u the function in an instruction list, enter the fo
llowing:
+ Note
7 – 10
It does not matter whether the function names in the IL editor are ca italized o
r not.
Matsushita Electric Works (Euro e) AG
Cha ter 8 Selection Functions
(E_)MAX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8 - 3 (E_)MIN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . 8 - 5 (E_)LIMIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . 8 - 7 (E_)MUX . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . 8 - 9 -
IEC Functions Selection Functions
NAiS Control 1131
8–2
Matsushita Electric Works (Euro e) AG
NAiS Control 1131
IEC Functions Selection Functions
(E_)MAX
Outline
J Data Ty es
In ut Variable
any data ty e exce t String, but all of the same ty e
MAX determines the in ut variable with the highest value. If you require an enab
le out ut and an enable in ut: E_MAX.
Out ut Variable
as in ut data ty e
,
Exam le
MAX In this exam le the function MAX is rogrammed in ladder diagram (LD) and in
struction list (IL). The same POU header is used for both rogramming languages.
POU Header All in ut and out ut variables which are required for rogramming th
e function are declared in the POU header.
This exam le uses variables. You may also use constants for the in ut variables.
LD Body value_1 and value_2 are com ared with each other. The higher value of t
he two is written in maximum_value.
IL Body If you wish to call u the function in an instruction list, enter the fo
llowing:
+ Notes
• •
The number of in ut contacts a_NumN lies in the range of 2 to 28. It does not ma
tter whether the function names in the IL editor are ca italized or not.
8–3
Matsushita Electric Works (Euro e) AG
IEC Functions Selection Functions
NAiS Control 1131
Outline
Anything stated under MAX also a lies to E_MAX. The function E_MAX, however, ha
s in addition an enabled in ut (EN = enable) and an enabled out ut (ENO = enable
out ut) of the data ty e BOOL. If EN is set (TRUE), E_MAX will be activated. If
EN is reset (FALSE), the status of the variable will be frozen until EN is set
again. ENO will ado t the status of EN. Therefore, you may connect further funct
ion blocks/functions with ENO which are controlled by the status of EN.
E_MAX In this exam le the function E_MAX is rogrammed in ladder diagram (LD) an
d instruction list (IL). The same POU header is used for both rogramming langua
ges. POU Header All in ut and out ut variables which are required for rogrammin
g the function are declared in the POU header.
,
Exam le
This exam le uses variables. You may also use constants for the in ut variables
LD Body If enable is set (TRUE), value_1 is com ared with value_2. The higher va
lue will be written in maximum_value.
IL Body If you wish to call u the function in an instruction list, enter the fo
llowing:
+ Notes
• •
The number of in ut contacts a_NumN lies in the range of 2 to 28. It does not ma
tter whether the function names in the IL editor are ca italized or not.
Matsushita Electric Works (Euro e) AG
8–4
NAiS Control 1131
IEC Functions Selection Functions
(E_)MIN
Outline
J Data Ty es
In ut Variable
any data ty e exce t String, but all of the same ty e
MIN dectects the in ut variable with the lowest value. If you require an enable
out ut and an enable in ut: E_MIN.
Out ut Variable
as in ut data ty e
,
Exam le
MIN In this exam le the function MIN is rogrammed in ladder diagram (LD) and in
struction list (IL). The same POU header is used for both rogramming languages.
POU Header All in ut and out ut variables which are required for rogramming th
e function are declared in the POU header.
This exam le uses variables. You may also use constants for the in ut variables.
LD Body value_1 and value_2 are com ared with each other. The lower value of th
e two is written in minimum_value.
IL Body If you wish to call u the function in an instruction list, enter the fo
llowing:
+ Notes
• •
The number of in ut contacts a_NumN lies in the range of 2 to 28. It does not ma
tter whether the function names in the IL editor are ca italized or not.
8–5
Matsushita Electric Works (Euro e) AG
IEC Functions Selection Functions
NAiS Control 1131
Outline
Anything stated under MIN also a lies to E_MIN. The function E_MIN, however, ha
s in addition an enabled in ut (EN = enable) and an enabled out ut (ENO = enable
out ut) of the data ty e BOOL. If EN is set (TRUE), E_MIN will be activated. If
EN is reset (FALSE), the status of the variable will be frozen until EN is set
again. ENO will ado t the status of EN. Therefore, you may connect further funct
ion blocks/functions with ENO which are controlled by the status of EN.
E_MIN In this exam le the function E_MIN is rogrammed in ladder diagram (LD) an
d instruction list (IL). The same POU header is used for both rogramming langua
ges. POU Header All in ut and out ut variables which are required for rogrammin
g the function are declared in the POU header.
,
Exam le
This exam le uses variables. You may also use constants for the in ut variables
LD Body If enable is set (TRUE), value_1 is com ared with value_2. The smaller v
alue will be written into minimum_value.
IL Body If you wish to call u the function in an instruction list, enter the fo
llowing:
+ Notes
• •
The number of in ut contacts a_NumN lies in the range of 2 to 28. It does not ma
tter whether the function names in the IL editor are ca italized or not.
8–6
Matsushita Electric Works (Euro e) AG
NAiS Control 1131
IEC Functions Selection Functions
(E_)LIMIT
Outline
In LIMIT the 1. in ut variable forms the lower and the 3. in ut variable the u
er limit value. If the 2. in ut variable is within this limit, it will be transf
erred to the out ut variable. If it is above this limit, the u er limit value w
ill be transferred, if it is below this limit the lower limit value will be tran
sferred. If you require an enable out ut and an enable in ut: E_LIMIT.
J Data Ty es
In ut Variable
any data ty e, but all of the same ty e
Out ut Variable
as in ut data ty e
,
Exam le
LIMIT In this exam le the function LIMIT is rogrammed in ladder diagram (LD) an
d instruction list (IL). The same POU header is used for both rogramming langua
ges. POU Header All in ut and out ut variables which are required for rogrammin
g the function are declared in the POU header.
This exam le uses variables. You may also use constants for the in ut variables.
LD Body lower_limit_val and u er_limit_val form the range where the com arison
_value has to be, if it has to be transferred to result. If the com arison_value
is above the u er_limit_val, the value of u er_limit_val will be transferred
to result. If it is below the lower_limit_val, the value of lower_limit_val will
be transferred to result.
IL Body If you wish to call u the function in an instruction list, enter the fo
llowing:
* Note next age
Matsushita Electric Works (Euro e) AG 8–7
IEC Functions Selection Functions
NAiS Control 1131
Outline
Anything stated under LIMIT also a lies to E_LIMIT. E_LIMIT, however, has in ad
dition an enabled in ut (EN = enable) and an enabled out ut (ENO = enable out ut
) of the data ty e BOOL. If EN is set (TRUE), E_LIMIT will be activated. If EN i
s reset (FALSE), the status of the variable will be frozen until EN is set again
. ENO will ado t the status of EN. Therefore, you may connect further function b
locks/functions with ENO which are controlled by the status of EN.
E_LIMIT In this exam le the function E_LIMIT is rogrammed in ladder diagram (LD
) and instruction list (IL). The same POU header is used for both rogramming la
nguages. POU Header All in ut and out ut variables which are required for rogra
mming the function are declared in the POU header.
,
Exam le
| This example uses variables. You may also use constants for the input variable
s LD Body If enable is set (TRUE), comparison_value is compared with lower_limit
_val and upper_limit_val. If the comparison_value is within the limit values, th
e value of comparison_value is written in result. If the comparison_value surpas
ses the value in lower_limit_val, the value of lower_limit_val will be transferr
ed in result. If it exceeds the value of upper_limit_val , the value of upper_li
mit_val will be transferred into result.
IL Body If you wish to call up the function in an instruction list, enter the fo
llowing:
+ Note
8–8
It does not matter whether the function names in the IL editor are capitalized o
r not.
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Functions Selection Functions
(E_)MUX
Outline
The function Multiplexer selects an input variable and writes its value into the
output variable. With the 1. input variable is determines which input variable
it to be written into the output variable. The function MUX can be configured fo
r any desired number of inputs. If you require an enable output and an enable in
put: E_MUX.
J Data Types
Input Variable
1. input variable 2. + 3. input variable INTEGER any desired, but both of the id
entical type
Output Variable
as data type of 2. or 3. input variable
+ Note
The difference between the functions E_MUX and E_SEL is that in E_MUX you can se
lect between multiple channels with an integer value, while in E_SEL you can onl
y choose between two channels with a Boolean value.
Matsushita Electric Works (Europe) AG
8–9
IEC Functions Selection Functions
NAiS Control 1131
,
Example
MUX In this example the function MUX is programmed in ladder diagram (LD) and in
struction list (IL). The same POU header is used for both programming languages.
POU Header All input and output variables which are required for programming th
e function are declared in the POU header.
This example uses variables. You may also use constants for the input variables.
LD Body In channel_select you find the integer value (0, 1...n) for the selecti
on of channel_0 or channel_1. The result will be written in output.
IL Body If you wish to call up the function in an instruction list, enter the fo
llowing:
+ Notes
• •
The number of input contacts aNumN lies in the range of 2 to 28. It does not mat
ter whether the function names in the IL editor are capitalized or not. * next p
age
8 – 10
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Functions Selection Functions
Outline
Anything stated under MUX also applies to E_MUX. E_MUX, however, has in addition
an enabled input (EN = enable) and an enabled output (ENO = enable output) of t
he data type BOOL. If EN is set (TRUE), E_MUX will be activated. If EN is reset
(FALSE), the status of the variable will be frozen until EN is set again. ENO wi
ll adopt the status of EN. Therefore, you may connect further function blocks/fu
nctions with ENO which are controlled by the status of EN.
E_MUX In this example the function E_MUX is programmed in ladder diagram (LD) an
d instruction list (IL). The same POU header is used for both programming langua
ges. POU Header All input and output variables which are required for programmin
g the function are declared in the POU header.
,
Example
This example uses variables. You may also use constants for the input variables
LD Body If enable is set (TRUE), E_MUX will be executed. In channel_select you f
ind the value for the selection of channel_0 or channel_1. In E_MUX the number o
f channels is not limited.
IL Body If you wish to call up the function in an instruction list, enter the fo
llowing:
+ Notes
• •
The number of input contacts aNumN lies in the range of 2 to 28. It does not mat
ter whether the function names in the IL editor are capitalized or not.
8 – 11
Matsushita Electric Works (Europe) AG
IEC Functions Selection Functions
NAiS Control 1131
8 – 12
Matsushita Electric Works (Europe) AG
Chapter 9 Comparison Functions
(E_)GT (E_)GE ................................. 9 – 3 ..........................
....... 9 – 5
(E_)EQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 – 7
(E_)LE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 –
9 (E_)LT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 –
11 (E_)NE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 – 1
3
IEC Functions Comparison Functions
NAiS Control 1131
9–2
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Functions Comparison Functions
(E_)GT
Outline
The content of the accumulator is compared with the operand defined in the opera
nd field. If the accumulator is greater, ”TRUE” is stored in the accumulator, el
se ”FALSE”.
J Data Types
Input Variable
any data type, but all of the same type
Output Variable
BOOL
,
Example
GT POU Header Class Identifier
0 1 2 VAR VAR VAR var_1 var_2 var_3
Type
BOOL BOOL BOOL
Initial
FALSE FALSE FALSE
Comment
Input_1 Input_2 Output
IL Body
LD GT var_1 var_2 (* Load var_1 in accu *) (* Compare accu with var_2; store BOO
L result of comparison in accu; if accu > var_2, TRUE is stored in accu, else fa
lse *) ST var_3 (* Store accu in var_3 *)
LD Body
+ Notes
• • •
var_1, var_2 can be of any data type; both variables must be of the same data ty
pe though. var_3 must be of type BOOL. The number of input contacts lies in the
range of 2 to 28. It is not important whether the function names in the IL edito
r are capitalized or not.
Matsushita Electric Works (Europe) AG
9–3
IEC Functions Comparison Functions
NAiS Control 1131
Outline
E_GT compares the two input variables. If the first is greater than the second,
the result will be TRUE, otherwise FALSE. E_GT operates just as the standard ope
rator GT (Online Help: Help > Index > Standard Operators). E_GT has in addition
an enable input (EN) and an enable output (ENO) of the data type BOOL. If EN is
set (TRUE), E_GT will be activated. If EN is not set (FALSE), the status of the
output variable will remain unchanged until EN is set. ENO will adopt the status
of EN. Therefore, you may connect further function blocks/functions with ENO wh
ich are controlled by the status of EN.
E_GT In this example the function E_GT is programmed in ladder diagram (LD) and
instruction list (IL). The same POU header is used for both programming language
s. POU Header All input and output variables which are required for programming
the function are declared in the POU header.
,
Example
In this example the input variables (comparison_value, reference_value and enabl
e) have been declared. Instead, you may enter constants directly at the input co
ntacts of a function (enable input e.g. for tests). LD Body If enable is set (TR
UE), the comparison_value is compared with the reference_value. If the compariso
n_value is greater than the reference_value, the value TRUE will be written into
result, otherwise FALSE.
IL Body If you want to call the function in an instruction list, enter the follo
wing:
+ Notes
• •
The number of input contacts a_NumN lies in the range of 2 to 28. It does not ma
tter whether the function names in the IL editor are capitalized or not.
Matsushita Electric Works (Europe) AG
9–4
NAiS Control 1131
IEC Functions Comparison Functions
(E_)GE
Outline
The content of the accumulator is compared with the operand defined in the opera
nd field. If the accumulator is greater or equal, ”TRUE” is stored in the accumu
lator, else ”FALSE”.
J Data Types
Input Variable
any data type, but all of the same type
Output Variable
BOOL
,
Example
GE POU Header Class Identifier
0 1 2 VAR VAR VAR var_1 var_2 var_3
Type
BOOL BOOL BOOL
Initial
FALSE FALSE FALSE
Comment
Input_1 Input_2 Output
IL Body
LD GE var_1 var_2 (* Load var_1 in accu *) (* Compare accu with var_2; store BOO
L result of comparison in accu; if accu ≥ var_2, TRUE is stored in accu, else fa
lse *) ST var_3 (* Store accu in var_3 *)
LD Body
+ Notes
• • •
var_1, var_2 can be of any data type; both variables must be of the same data ty
pe though. var_3 must be of type BOOL. The number of input contacts lies in the
range of 2 to 28. It is not important whether the function names in the IL edito
r are capitalized or not.
Matsushita Electric Works (Europe) AG
9–5
IEC Functions Comparison Functions
NAiS Control 1131
Outline
E_GE compares the two input variables with each other. If the first value is gre
ater than or equal to the second value, the result will be TRUE, otherwise FALSE
. E_GE operates just as the standard operator GE (Online Help: Help > Index > St
andard Operators). E_GE has in addition an enable input (EN) and an enable outpu
t (ENO) of the data type BOOL. If EN is set (TRUE), E_GE will be activated. If E
N is not set (FALSE), the status of the output variable will remain unchanged un
til EN is set. ENO will adopt the status of EN. Therefore, you may connect furth
er function blocks/functions with ENO which are controlled by the status of EN.
E_GE In this example the function E_GE is programmed in ladder diagram (LD) and
instruction list (IL). The same POU header is used for both programming language
s. POU Header All input and output variables which are required for programming
the function are declared in the POU header.
,
Example
This example uses variables. You may also use constants for the input variables.
LD Body If enable is set (TRUE), the comparison_value is compared with the refe
rence_value. If the comparison_value is greater than or equal to the reference_v
alue, the value TRUE will be written in result, otherwise FALSE.
IL Body If you wish to call up the function in an instruction list, enter the fo
llowing:
+ Notes
• •
The number of input contacts a_NumN lies in the range of 2 to 28. It does not ma
tter whether the function names in the IL editor are capitalized or not.
Matsushita Electric Works (Europe) AG
9–6
NAiS Control 1131
IEC Functions Comparison Functions
(E_)EQ
Outline
The content of the accumulator is compared with the operand defined in the opera
nd field. If both values are equal, ”TRUE” is stored in the accumulator, else ”F
ALSE”.
J Data Types
Input Variable
any data type, but all of the same type
Output Variable
BOOL
,
Example
EQ POU Header Class Identifier
0 1 2 VAR VAR VAR var_1 var_2 var_3
Type
BOOL BOOL BOOL
Initial
FALSE FALSE FALSE
Comment
Input_1 Input_2 Output
IL Body
LD EQ var_1 var_2 (* Load var_1 in accu *) (* Compare accu with var_2; store BOO
L result of comparison in accu; if accu = var_2, TRUE is stored in accu, else fa
lse *) ST var_3 (* Store accu in var_3 *)
LD Body
+ Notes
• • •
var_1, var_2 can be of any data type; both variables must be of the same data ty
pe though. var_3 must be of type BOOL. The number of input contacts lies in the
range of 2 to 28. It is not important whether the function names in the IL edito
r are capitalized or not.
Matsushita Electric Works (Europe) AG
9–7
IEC Functions Comparison Functions
NAiS Control 1131
Outline
E_EQ compares the value of the two input variables with each other. In case they
are identical, the result will be TRUE, otherwise FALSE. E_EQ operates just as
the standard operator EQ (Online Help: Help > Index > Standard Operators). E_EQ
has in addition an enable input (EN) and an enable output (ENO) of the data type
BOOL. If EN is set (TRUE), E_EQ will be activated. If EN is not set (FALSE), th
e status of the output variable will remain unchanged until EN is set. ENO will
adopt the status of EN. Therefore, you may connect further function blocks/funct
ions with ENO which are controlled by the status of EN.
E_EQ In this example the function E_EQ is programmed in ladder diagram (LD) and
instruction list (IL). The same POU header is used for both programming language
s. POU Header All input and output variables which are required for programming
the function are declared in the POU header.
,
Example
This example uses variables. You may also use constants for the input variables.
LD Body If enable is set (TRUE), the variable comparison_value is compared with
the variable reference_value. If the values of the two variables are identical,
the value TRUE will be written in result, otherwise FALSE.
IL Body If you wish to call up the function in an instruction list, enter the fo
llowing:
+ Notes
• •
The number of input contacts a_NumN lies in the range of 2 to 28. It does not ma
tter whether the function names in the IL editor are capitalized or not.
Matsushita Electric Works (Europe) AG
9–8
NAiS Control 1131
IEC Functions Comparison Functions
(E_)LE
Outline
The content of the accumulator is compared with the operand defined in the opera
nd field. If the accumulator is lower or equal, ”TRUE” is stored in the accumula
tor, else ”FALSE”.
J Data Types
Input Variable
any data type, but all of the same type
Output Variable
BOOL
,
Example
LE POU Header Class Identifier
0 1 2 VAR VAR VAR var_1 var_2 var_3
Type
BOOL BOOL BOOL
Initial
FALSE FALSE FALSE
Comment
Input_1 Input_2 Output
IL Body
LD LE var_1 var_2 (* Load var_1 in accu *) (* Compare accu with var_2; store BOO
L result of comparison in accu; if accu ≤ var_2, TRUE is stored in accu, else fa
lse *) ST var_3 (* Store accu in var_3 *)
LD Body
+ Notes
• • •
var_1, var_2 can be of any data type; both variables must be of the same data ty
pe though. var_3 must be of type BOOL. The number of input contacts lies in the
range of 2 to 28. It is not important whether the function names in the IL edito
r are capitalized or not.
Matsushita Electric Works (Europe) AG
9–9
IEC Functions Comparison Functions
NAiS Control 1131
Outline
E_LE compares the two input variables. If the first value is less than or equal
to the second value, the result will be TRUE, otherwise FALSE. E_LE operates jus
t as the standard operator LE (Online Help: Help > Index > Standard Operators).
E_LE has in addition an enable input (EN) and an enable output (ENO) of the data
type BOOL. If EN is set (TRUE), E_LE will be activated. If EN is not set (FALSE
), the status of the output variable will remain unchanged until EN is set. ENO
will adopt the status of EN. Therefore, you may connect further function blocks/
functions with ENO which are controlled by the status of EN.
E_LE In this example the function E_LE is programmed in ladder diagram (LD) and
instruction list (IL). The same POU header is used for both programming language
s. POU Header All input and output variables which are required for programming
the function are declared in the POU header.
,
Example
This example uses variables. You may also use constants for the input variables.
LD Body If enable is set (TRUE), the comparison_value is compared with the vari
able reference_value. If the comparison_value is less than or equal to the refer
ence_value, TRUE will be written in result, otherwise FALSE.
IL Body If you wish to call up the function in an instruction list, enter the fo
llowing:
+ Notes
• •
The number of input contacts a_NumN lies in the range of 2 to 28. It does not ma
tter whether the function names in the IL editor are capitalized or not.
Matsushita Electric Works (Europe) AG
9 – 10
NAiS Control 1131
IEC Functions Comparison Functions
(E_)LT
Outline
The content of the accumulator is compared with the operand defined in the opera
nd field. If the accumulator is lower than the operand, ”TRUE” is stored in the
accumulator, else ”FALSE”.
J Data Types
Input Variable
any data type, but all of the same type
Output Variable
BOOL
,
Example
LT POU Header Class Identifier
0 1 2 VAR VAR VAR var_1 var_2 var_3
Type
BOOL BOOL BOOL
Initial
FALSE FALSE FALSE
Comment
Input_1 Input_2 Output
IL Body
LD LT var_1 var_2 (* Load var_1 in accu *) (* Compare accu with var_2; store BOO
L result of comparison in accu; if accu < var_2, TRUE is stored in accu, else fa
lse *) ST var_3 (* Store accu in var_3 *)
LD Body
+ Notes
• • •
var_1, var_2 can be of any data type; both variables must be of the same data ty
pe though. var_3 must be of type BOOL. The number of input contacts lies in the
range of 2 to 28. It is not important whether the function names in the IL edito
r are capitalized or not.
Matsushita Electric Works (Europe) AG
9 – 11
IEC Functions Comparison Functions
NAiS Control 1131
Outline
E_LT compares two input variables with each other. If the first value is less th
an the second value, the result is TRUE, otherwise FALSE. E_LT operates just as
the standard operator LT (Online Help: Help > Index > Standard Operators). E_LT
has in addition an enable input (EN) and an enable output (ENO) of the data type
BOOL. If EN is set (TRUE), E_LT will be activated. If EN is not set (FALSE), th
e status of the output variable will remain unchanged until EN is set. ENO will
adopt the status of EN. Therefore, you may connect further function blocks/funct
ions with ENO which are controlled by the status of EN.
E_LT In this example the function E_LT is programmed in ladder diagram (LD) and
instruction list (IL). The same POU header is used for both programming language
s. POU Header All input and output variables which are required for programming
the function are declared in the POU header.
,
Example
This example uses variables. You may also use constants for the input variables
LD Body If enable is set (TRUE), the comparison_value is compared with the refer
ence_value. If the comparison_value is less than or equal to the reference_value
, TRUE will be written in result, otherwise FALSE.
IL Body If you wish to call up the function in an instruction list, enter the fo
llowing:
+ Notes
• •
The number of input contacts a_NumN lies in the range of 2 to 28. It does not ma
tter whether the function names in the IL editor are capitalized or not.
Matsushita Electric Works (Europe) AG
9 – 12
NAiS Control 1131
IEC Functions Comparison Functions
(E_)NE
Outline
J Data Types
Input Variable
any data type, but all of the same type
The content of the accumulator is compared with the operand defined in the opera
nd field. If both values are not equal, ”TRUE” is stored in the accumulator, els
e ”FALSE”.
Output Variable
BOOL
,
Example
NE POU Header Class Identifier
0 1 2 VAR VAR VAR var_1 var_2 var_3
Type
BOOL BOOL BOOL
Initial
FALSE FALSE FALSE
Comment
Input_1 Input_2 Output
IL Body
LD NE var_1 var_2 (* Load var_1 in accu *) (* Compare accu with var_2; store BOO
L result of comparison in accu; if accu ≠ var_2, TRUE is stored in accu, else fa
lse *) ST var_3 (* Store accu in var_3 *)
LD Body
+ Notes
• • •
var_1, var_2 can be of any data type; both variables must be of the same data ty
pe though. var_3 must be of type BOOL. The number of input contacts lies in the
range of 2 to 28. It is not important whether the function names in the IL edito
r are capitalized or not.
Matsushita Electric Works (Europe) AG
9 – 13
IEC Functions Comparison Functions
NAiS Control 1131
Outline
E_NE compares the two input variables with each other. If they are unequal, the
result is TRUE, otherwise FALSE. E_NE operates just as the standard operator NE
(Online Help: Help > Index > Standard Operators). E_NE has in addition an enable
input (EN) and an enable output (ENO) of the data type BOOL. If EN is set (TRUE
), E_NE will be activated. If EN is not set (FALSE), the status of the output va
riable will remain unchanged until EN is set. ENO will adopt the status of EN. T
herefore, you may connect further function blocks/functions with ENO which are c
ontrolled by the status of EN.
E_NE In this example the function E_NE is programmed in ladder diagram (LD) and
instruction list (IL). The same POU header is used for both programming language
s. POU Header All input and output variables which are required for programming
the function are declared in the POU header.
,
Example
In this example the input variables (comparison_value, reference_value and enabl
e) have been declared. However, you may enter constants directly into the functi
on (enable input e.g. for tests). LD Body If enable is set (TRUE), the compariso
n_value is compared with the reference_value. If the two values are unequal, TRU
E will be written into result, otherwise FALSE.
IL Body If you want to call up the function in an instruction list, enter the fo
llowing:
+ Note
9 – 14
It does not matter whether the function names in the IL editor are capitalized o
r not.
Matsushita Electric Works (Europe) AG
Part 3 IEC Function Blocks
Chapter 10 Bistable Function Blocks
(E_)SR (E_)RS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
– 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 – 7
IEC Function Blocks Bistable Function Blocks
NAiS Control 1131
10 – 2
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Function Blocks Bistable Function Blocks
(E_)SR
Outline
The function block SR (set/reset) or E_SR allows you to both set and reset an ou
tput. For the SR you declare the following: SET: set The output Q is set for eac
h rising edge at SET. RESET: reset The output Q is reset for each rising edge de
tected at RESET, except SET is set (see time chart) Q: signal output is set, if
a rising edge is detected at SET, is reset, if a rising edge is detected at RESE
T, and if the SET is not set.
J Data Types
Input Variable
BOOL (SET and RESET)
Output Variable
BOOL (Q)
+ Notes
J Time Chart
D Q is set if a rising edge is detected at both inputs (Set and Reset) D Upon in
itialising, Q always has the status zero (reset).
SET
RESET
Q
Matsushita Electric Works (Europe) AG
10 – 3
IEC Function Blocks Bistable Function Blocks
NAiS Control 1131
,
Example
SR In the following example, the function block SR is programmed in ladder diagr
am (LD) and in the instruction list (IL). The same POU header is used for both p
rogramming languages. POU Header All input and output variables which are used f
or programming the function block SR are declared in the POU header. This also i
ncludes the function block (FB) itself. By declaring the FB you create a copy of
the original FB. This copy is saved under copy_name, and a separate data area i
s reserved.
LD Body If set is set (status = TRUE), signal_output will be set. If only reset
is set, the signal_output will be reset (status = FALSE). If both set and reset
are set, signal_output will be set.
IL Body If you wish to call up SR: copy_name in the instruction list, you enter
the following:
The nomination copy_name.SET or copy_name.RESET etc. has to be maintained in the
IL.
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not. * next page
10 – 4
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Function Blocks Bistable Function Blocks
Outline
Anything stated for SR also applies to E_SR. The function block E_SR, however, f
urther contains an enabled input (EN = enable) and an enabled output (ENO = enab
le output). If EN is set (TRUE), E_SR will be activated. If EN is reset (FALSE),
the variable’s condition is frozen until EN is set again (see time chart). ENO
will adopt the status of EN. Therefore, you can connect further function blocks/
functions to ENO which are controlled by the status of EN.
J Time Chart
EN
SET
RESET
Q
,
Example
E_SR If the same variables are used for programming as described under SR , the
program for E_SR would be designed as follows: POU Header In the POU Header the
input enable is declared additionally.
Matsushita Electric Works (Europe) AG
10 – 5
IEC Function Blocks Bistable Function Blocks
NAiS Control 1131
LD Body If enable is set, E_SR will be as described for SR. The condition will b
e frozen, if enable is reset, as shown in the above time chart. As soon enable i
s set E_SR will continue working in the previous status.
You can now connect a further function block to ENO which will be activated only
, if EN is set by this E_SR (TRUE). IL Body
The status of enable is loaded in the IL, and copy_name.EN is assigned to it. Th
e nomination copy_name.EN or copy_name.PT etc. has to be maintained in the IL.
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not.
10 – 6
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Function Blocks Bistable Function Blocks
(E_)RS
Outline
The function block RS (reset/set) or E_RS allows you to both reset and set an ou
tput. For the RS you declare the following: SET: set The output Q is set for eac
h rising edge at SET, if RESET is not set. RESET: reset The output Q is reset fo
r each rising edge at RESET. Q: signal output is set, if a rising edge is detect
ed at SET and if RESET is not set; is reset, if a rising edge is detected at RES
ET.
J Data Types
Input Variable
BOOL (SET and RESET)
Output Variable
BOOL (Q)
+ Note
J Time Chart
Q is reset if a rising edge is detected at both inputs.
SET
RESET
Q
Matsushita Electric Works (Europe) AG
10 – 7
IEC Function Blocks Bistable Function Blocks
NAiS Control 1131
,
Example
RS In the following example, the function block RS is programmed in ladder diagr
am (LD) and instruction list (IL). The same POU header is used for both programm
ing languages. POU Header All input and output variables which are used for prog
ramming the function block RS are declared in the POU header. This also includes
the function block (FB) itself. By declaring the FB you create a copy of the or
iginal FB. This copy is saved under copy_name, and a separate data area is reser
ved.
LD Body If set is set (status = TRUE) the signal_output will be set. If only res
et is set, the signal_output will be reset (status = FALSE). If both set and res
et are set, the signal_output will be reset to FALSE.
IL Body If you wish to call up RS: copy_name instruction list, you enter the fol
lowing:
The nomination copy_name.SET or copy_name.RESET etc. has to be maintained in the
IL.
+ Note
10 – 8
It does not matter whether the function names in the IL editor are capitalized o
r not. * next page
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Function Blocks Bistable Function Blocks
Outline
Anything stated for RS also applies to E_RS. The function block E_RS has in addi
tion an enable input (EN) and an enable output (ENO) of the data type BOOL. If E
N is set (TRUE), E_RS will be activated. If EN is not set (FALSE), the status of
the output variable will remain unchanged until EN is set. ENO will adopt the s
tatus of EN. Therefore, you can connect further function blocks/functions to ENO
which are controlled by the condition of EN.
J Time Chart
EN
SET
RESET
Q
,
Example
E_RS If the same variables are used for programming as described under RS, the p
rogram would be designed as follows: POU Header In the POU header the input enab
le is additionally declared.
Matsushita Electric Works (Europe) AG
10 – 9
IEC Function Blocks Bistable Function Blocks
NAiS Control 1131
LD Body If enable is set, E_RS will be as described under RS. If enable is reset
, as shown in the above time chart, the condition will be frozen. As soon as ena
ble is set again, E_SR continues working in the previous status.
You can now connect a further function block with ENO which will be activated on
ly if EN is set by this E_RS (TRUE). IL Body
The status of enable is loaded in the IL and assigned to copy_name.EN. The nomin
ation copy_name.EN or copy_name.PT etc. has to be maintained in the IL.
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not.
10 – 10
Matsushita Electric Works (Europe) AG
Chapter 11 Edge Detection
(E_)R_TRIG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 – 3 (E_)
F_TRIG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 – 6
IEC Function Blocks Edge Detection
NAiS Control 1131
11 – 2
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Function Blocks Edge Detection
(E_)R_TRIG
Outline
The function block R_TRIG (rising edge trigger) or E_R_TRIG allows you to recogn
ize a rising edge at an input. For R_TRIG declare the following: CLK: signal inp
ut the output Q is set for each rising edge at the signal input (clk = clock) Q:
signal output is set when a rising edge is detected at CLK.
J Data Types
Input Variable
BOOL (CLK)
Output Variable
BOOL (Q)
+ Note
The output Q of a function block (E_)R_TRIG remains set for a complete PLC cycle
after the occurrence of a rising edge (status change FALSE –> TRUE) at the CLK
input and is then reset in the following cycle.
Matsushita Electric Works (Europe) AG
11 – 3
IEC Function Blocks Edge Detection
NAiS Control 1131
,
Example
R_TRIG In the following example, the function block R_TRIG is programmed in ladd
er diagram (LD) and instruction list (IL). The same POU header is used for both
programming languages. POU Header All input and output variables which are used
for programming the function block R_TRIG are declared in the POU header. This a
lso includes the function block (FB) itself. By declaring the FB you create a co
py of the original FB. This copy is saved under copy_name, and a separate data a
rea is reserved.
LD Body signal_output will be set, if a rising edge is detected at signal_input.
IL Body If you wish to call up R_TRIG: copy_name instruction list, enter the fol
lowing:
The nomination copy_name.CLK or copy_name.Q has to be maintained in the IL.
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not.
* next page
11 – 4
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Function Blocks Edge Detection
Outline
Anything stated for R_TRIG also applies to E_R_TRIG. The function block E_R_TRIG
has in addition an enable input (EN) and an enable output (ENO) of the data typ
e BOOL. If EN is set (TRUE), E_R_TRIG will be activated. If EN is not set (FALSE
), the status of the output variable will remain unchanged until EN is set. ENO
will adopt the status of EN. Therefore, you may connect further function blocks/
functions to ENO which are controlled by the condition of EN.
E_R_TRIG If the same variables are used for programming as described under R_TRI
G, the program for E_R_TRIG would be designed as follows: POU Header In the POU
Header the input enable is declared additionally.
,
Example
LD Body If enable is set, E_R_TRIG will be as described for R_TRIG.
If enable is reset, the status will be frozen. As soon as enable is set again, E
_R_TRIG continuous working in the previous status (see time chart). You may now
connect a further function block with ENO which will be activated only, if the E
N of this E_R_TRIG is set (TRUE). IL Body
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not.
11 – 5
Matsushita Electric Works (Europe) AG
IEC Function Blocks Edge Detection
NAiS Control 1131
(E_)F_TRIG
Outline
The function block F_TRIG (falling edge trigger) or E_F_TRIG allows you to recog
nize a falling edge at an input. For F_TRIG declare the following: CLK: signal i
nput the output Q is set for each falling edge at the signal input (clk = clock)
Q: signal output is set, if a falling edge is detected at CLK.
J Data Types
Input Variable
BOOL (CLK)
Output Variable
BOOL (Q)
+ Note
The output Q of a function block (E_)F_TRIG remains set for a complete PLC cycle
after the occurrence of a rising edge (status change FALSE –> TRUE) at the CLK
input and is then reset in the following cycle.
* next page
11 – 6
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Function Blocks Edge Detection
,
Example
F_TRIG In the following example, the function block F_TRIG is programmed in ladd
er diagram (LD) and instruction list (IL). The same POU header is used for both
programming languages. POU Header All input and output variables which are used
for programming the function block F_TRIG are declared in the POU header. This a
lso includes the function block (FB) itself. By declaring the FB you create a co
py of the original FB. This copy is saved under copy_name, and a separate data a
rea is reserved.
LD Body signal_output will be set, if a falling edge is detected at signal_input
.
IL Body If you want to call the F_TRIG: copy_name in an instruction list, enter
the following:
The nomination copy_name.CLK or copy_name.Q has to be continued in the IL.
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not.
Matsushita Electric Works (Europe) AG
11 – 7
IEC Function Blocks Edge Detection
NAiS Control 1131
Outline
Anything stated for F_TRIG also applies to E_F_TRIG. The function block E_F_TRIG
has in addition an enable input (EN) and an enable output (ENO) of the data typ
e BOOL. If EN is set (TRUE), E_F_TRIG will be activated. If EN is not set (FALSE
), the status of the output variable will remain unchanged until EN is set. ENO
will adopt the status of EN. Therefore, you can connect further function blocks/
functions to ENO which are controlled by the status of EN.
E_F_TRIG If the same variables are used for programming as described under F_TRI
G, the program for E_R_TRIG would be designed as follows: POU Header In the POU
Header the input enable is declared additionally.
,
Example
LD Body If enable is set, E_F_TRIG will be as described for F_TRIG.
If enable is reset, the status will be frozen. As soon as enable is set again, E
_F_TRIG continuous working in the previous state (see time chart). You may now c
onnect a further function block with ENO which will be activated only, if the EN
of this E_F_TRIG is set (TRUE). IL Body
The status of enable is loaded in the IL and assigned to copy_name.EN. The nomin
ation copy_name.EN or PT etc. has to be maintained in the IL.
+ Note
11 – 8
It does not matter whether the function names in the IL editor are capitalized o
r not.
Matsushita Electric Works (Europe) AG
Chapter 12 Counter
(E_)CTU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 – 3 (
E_)CTD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 – 7 (E
_)CTUD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 – 12
IEC Function Blocks Counter
NAiS Control 1131
12 – 2
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Function Blocks Counter
(E_)CTU
Outline
The function block CTU (count up) or E_CTU allows you to program counting proced
ures. For CTU declare the following: CU: clock generator the value 1 is added to
CV for each rising edge at CU, except RESET is set
RESET: reset CV is reset to zero for each rising edge at RESET PV: Q: CV: J Data
Types
Input Variable
BOOL (CV and RESET) INT (PV)
set value if PV (preset value) is reached, Q is set signal output is set, if CV
is greater than/equal to PV current value contains the addition result (CV = cur
rent value)
Output Variable
BOOL (Q) INT (CV)
J Time Chart
CU
Q
RESET
CV PV
,
Example
CTU In the following example, the function block CTU is programmed in ladder dia
gram (LD) and instruction list (IL). The same POU header is used for both progra
mming languages.
Matsushita Electric Works (Europe) AG
12 – 3
IEC Function Blocks Counter
NAiS Control 1131
POU Header All input and output variables which are used for programming the fun
ction block CTU are declared in the POU header. This also includes the function
block (FB) itself. By declaring the FB you create a copy of the original FB. Thi
s copy is saved under copy_name. A separate data area is reserved for this copy.
LD Body If reset is set (status = TRUE), current_value (CV) will be reset. If a
rising edge is detected at clock, the value 1 will be added to current_value. If
a rising edge is detected at clock, this procedure will be repeated until curre
nt_value is greater than/equal to set_value. Then, signal_output will be set.
IL Body
The nomination coyp name.CU or copy_name.RESET etc. has to be maintained in the
IL.
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not. * next page
12 – 4
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Function Blocks Counter
Outline
Anything stated under CTU also applies to E_CTU. The function block E_CTU has in
addition an enable input (EN) and an enable output (ENO) of the data type BOOL.
If EN is set (TRUE), E_CTU will be activated. If EN is not set (FALSE), the sta
tus of the output variable will remain unchanged until EN is set (see time chart
). ENO will adopt the status of EN. Therefore, you may connect further function
blocks/functions to ENO which are controlled by the status of EN.
J Time Chart
EN
CU
Q
RESET CV PV
,
Example
E_CTU If the same variables are used for programming as described under CTU, the
program for E_CTU would be designed as follows: POU Header In the POU Header th
e input enable is additionally declared.
Matsushita Electric Works (Europe) AG
12 – 5
IEC Function Blocks Counter
NAiS Control 1131
LD Body If enable is set, E_CTU will be as described for CTU.
If enable is reset, as shown in the above time chart, the condition will be froz
en and CU ignored. As soon as enable is set, E_CTU continues working with the pr
evious status. You may now connect a further function block with ENO which will
be activated only, if the EN of this E_CTU is set (TRUE). IL Body
The status of enable is loaded in the IL and assigned to copy_name.EN. The nomin
ation copy_name.EN or copy_name.PT etc.has to be maintained in the IL.
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not.
12 – 6
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Function Blocks Counter
(E_)CTD
Outline
The function block CTD (count down) or E_CTD allows you to program counting proc
edures. For CTD declare the following: CD: clock generator input the value 1 is
subtracted from the current value CV for each rising edge detected at CD, except
LOAD is set or CV has reached the value zero. LOAD: set with LOAD the counter s
tate is reset to PV PV: preset value is the value subjected to subtraction durin
g the first counting procedure Q: signal output is set if CV = zero CV: current
value contains the current subtraction result (CV = current value)
J Data types
Input Variable
BOOL (CD and LOAD) INT (PV)
Output Variable
BOOL (Q) INT (CV)
J Time Chart
CU
LOAD
Q CV
PV
Matsushita Electric Works (Europe) AG
12 – 7
IEC Function Blocks Counter
NAiS Control 1131
,
Example
CTD In the following example the function block CTD is programmed in ladder diag
ram (LD) and instruction list (IL). The same POU header is used for both program
ming languages. POU Header All input and output variables which are used for pro
gramming the function block CTD are declared in the POU header. This also includ
es the function block (FB) itself. By declaring the FB you create a copy of the
original FB. This copy is saved under copy_name, and a separate data area is res
erved.
LD Body If set is set (status = TRUE), the preset_value (PV) is loaded in the cu
rrent_value (CV). The value 1 will be subtracted from the current_value each tim
e a rising edge is detected at clock. This procedure will be repeated until the
current_value is greater than/equal to zero. Then, signal_output will be set.
* next page
12 – 8
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Function Blocks Counter
IL Body If you want to call up the CTD: copy_name in an instruction list, enter
the following:
The nomination copy_name.CD or copy_name.LOAD etc. has to be maintained in the I
L.
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not.
Matsushita Electric Works (Europe) AG
12 – 9
IEC Function Blocks Counter
NAiS Control 1131
Outline
Anything stated under CTD also applies to E_CTD. The function block E_CTD has in
addition an enable input (EN) and an enable output (ENO) of the data type BOOL.
If EN is set (TRUE), E_CTD will be activated. If EN is not set (FALSE), the sta
tus of the output variable will remain unchanged until EN is set (see time chart
). ENO will adopt the status of EN. Therefore, you may connect further function
blocks/functions to ENO which are controlled by the condition of EN.
J Time Chart
CD
EN
LOAD
Q
PV
,
Example
E_CTD If the same variables are used for programming as described under CTD the
program for E_CTD would be designed as follows: POU Header In the POU Header the
input enable is additionally declared.
* next page
12 – 10 Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Function Blocks Counter
LD Body If enable is set, E_CTD will be as described for CTD.
If enable is reset, as shown in the above time chart, the status will be frozen
and CD ignored. As soon as enable is set again, E_CTD continuous working with th
e previous counter state. You may now connect a further function block with ENO
which will be activated only if the EN of this E_CTD is set (TRUE). IL Body
The status of enable is loaded in the IL and assigned to copy_name.EN. The nomin
ation copy_name.EN or copy_name.PT etc.has to be maintained in the IL.
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not.
Matsushita Electric Works (Europe) AG
12 – 11
IEC Function Blocks Counter
NAiS Control 1131
(E_)CTUD
Outline
The function block CTUD (count up/down) or E_CTUD allows you to program counting
procedures (up and down). For CTUD declare the following: CU: count up the valu
e 1 is added to the current CV for each rising edge detected at CU, except RESET
and/or LOAD is/are set. CD: count down the value 1 is subtracted from the curre
nt CV for each rising edge detected at CD, except RESET and/or LOAD is/are set a
nd if CU and CD are simultaneously set. In the latter case counting will be upwa
rds. RESET: reset if RESET is set, CV will be reset LOAD: set if LOAD is set, PV
is loaded to CV. This, however, does not apply, if RESET is set simultaneously.
In this case, LOAD will be ignored. PV: preset value defines the preset value w
hich is to be attained with the addition or subtraction (PV = preset value) QU:
signal output – count up is set, if CV is greater than/equal to PV QD: signal ou
tput – count down is set, if CV = zero CV: current value is the addition/subtrac
tion result (CV = current value)
J Data Types
Input Variable
BOOL (CU, CD, RESET, LOAD) INT (PV)
Output Variable
BOOL (QU and QD) INT (CV)
* next page
12 – 12
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Function Blocks Counter
J Time Chart
CU
CD
RESET
LOAD
QU
QD CV PV
,
Example
CTUD In the following example, the function block CTUD is programmed in ladder d
iagram (LD) and instruction list (IL). The same POU header is used for both prog
ramming languages. POU Header All input and output variables which are used for
programming the function block CTUD are declared in the POU header. This also in
cludes the function block (FB) itself. By declaring the FB you create a copy of
the original FB. This copy is saved under copy_name. A separate data area is res
erved for this copy.
Matsushita Electric Works (Europe) AG
12 – 13
IEC Function Blocks Counter
NAiS Control 1131
LD Body Count up: If reset is set, the current_value (CV) will be reset. If up_c
lock is set, the value 1 is added to the current_value. This procedure is repeat
ed for each rising edge detected at up_clock until the current value is greater
than/equal to the set_value. Then output_up is set. The procedure is not conduct
ed, if reset and/or set is/are set. Count down: If set is set (status = TRUE), t
he set_value (PV = preset value) will be loaded in the current_value (CV). If do
wn_clock is set, the value 1 is subtracted from set_value at each clock. This pr
ocedure is repeated at each clock until the current_value is smaller than/equal
to zero. Then, signal_output is set. The procedure will not be conducted, if res
et and/or set is/are set or if CU and CV are set at the same time. In the latter
case, counting will be downwards.
IL Body If you want to call the CTD: copy_name in an instruction list, enter the
following:
The nomination copy_name.CU or copy_name.RESET etc. has to be maintained in the
IL.
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not. * next page
12 – 14
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Function Blocks Counter
Outline
Anything stated under CTUD also applies to E_CTUD. The function block E_CTUD has
in addition an enable input (EN) and an enable output (ENO) of the data type BO
OL. If EN is set (TRUE), E_CTUD will be activated. If EN is not set (FALSE), the
status of the output variable will remain unchanged until EN is set (see time c
hart). ENO will adopt the status of EN. Therefore, you may connect further funct
ion blocks/functions to ENO which are controlled by the condition of EN.
J Time Chart
EN
CU
CD
RESET
LOAD
QU
QD
CV PV
,
Example
E_CTUD If the same variables are used for programming as described under CTUD th
e program for E_CTUD would be designed as follows.
Matsushita Electric Works (Europe) AG
12 – 15
IEC Function Blocks Counter
NAiS Control 1131
POU Header In the POU Header the input enable is declared additionally.
LD Body If enable is set, E_CTUD will be as described under CTUD.
If enable is reset, as shown in the time chart, the status will be frozen and CU
/CD ignored. As soon as enable is set again, E_CTUD continues working with the p
revious counter state. You may now connect a further function block with ENO whi
ch will be activated only, if the EN of this E_CTUD is set (TRUE). IL Body
The status of enable is loaded in the IL and assigned to copy_name.EN. The nomin
ation copy_name.EN or copy_name.PT etc.has to be maintained in the IL.
+ Note
12 – 16
It does not matter whether the function names in the IL editor are capitalized o
r not.
Matsushita Electric Works (Europe) AG
Chapter 13 Timer
(E_)TP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 – 3
(E_)TON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 – 8 (
E_)TOF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 – 13
IEC Function Blocks Timer
NAiS Control 1131
13 – 2
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Function Blocks Timer
(E_)TP
Outline
The function block TP or E_TP allows you to program a clock timer with a defined
clock period. For TP declare the following: IN: clock generator if a rising edg
e is detected at IN, a clock is generated having the period as defined in PT PT:
clock period (16–bit value: 0 – 327.27s, 32–bit value: 0 –21,474,836.47s; resol
ution 10ms each) a clock having the period PT is caused for each rising edge at
IN. A new rising edge detected at PT within the pulse period does not cause a ne
w clock (see time chart, section C) Q: signal output is set for the period of PT
as soon as a rising edge is detected at IN ET: current value contains the elaps
ed clock period. If PT = ET, Q will be reset
J Data Types
Input Variable
BOOL (IN) TIME (PT)
Output Variable
BOOL (Q) TIME (ET)
Matsushita Electric Works (Europe) AG
13 – 3
IEC Function Blocks Timer
NAiS Control 1131
J Time Chart
IN
TP
Q ET PT
t0
t1 + PT
t2
t2 + PT
t0 A
t1 + PT
t2 B
t3
A + B) Independent of the turn–on period of the IN signal, a clock is generated
at the output Q having a length defined by PT. The function block TP is started
(triggered), if a rising edge is detected at the input IN. C) A rising edge at t
he input IN does not have any influence during the processing of PT.
J Time Chart
EN
E_TP
IN
t0
t1
t2
t3
t4
Q ET PT
t0
t0 + PT t2
t2 + PT
t4
t4 + PT
t0 A
t0 + PT
t2 B
t3
t4 C
t4 + PT
13 – 4
Matsushita Electric Works (Europe) AG
ÉÉÉ ÉÉÉ
t4 t4 C t5
ÉÉÉ ÉÉÉ
ÉÉÉÉ ÉÉÉÉ ÉÉÉÉ ÉÉÉÉ ÉÉ ÉÉÉÉÉÉ ÉÉ ÉÉÉÉÉÉ
t0
t1
t2
t3
t4 t5 t6 t7
t4 + PT
t
t4 + PT
t6
t5
t5
t6
* next page
NAiS Control 1131
IEC Function Blocks Timer
,
Example
TP In the following example the function block TP is programmed in ladder diagra
m (LD) and instruction list (IL). The same POU header is used for both programmi
ng languages. POU Header All input and output variables which are used for progr
amming the function block TP are declared in the POU header. This also includes
the function block (FB) itself. By declaring the FB you create a copy of the ori
ginal FB. This copy is saved under copy_name. A separate data area is reserved f
or this copy.
LD Body If start is set (status = TRUE), the clock is emitted at signal_output u
ntil the set_value for the clock period is reached.
IL Body If you want to call TP: copy_name in an instruction list, enter the foll
owing:
The nomination copy_name.IN or copy_name.ET etc. has to be maintained in the IL.
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not.
Matsushita Electric Works (Europe) AG
13 – 5
IEC Function Blocks Timer
NAiS Control 1131
Outline
Anything stated under TP also applies to E_TP. The function block E_TP has in ad
dition an enable input (EN) and an enable output (ENO) of the data type BOOL. If
EN is set (TRUE), E_TP will be activated. If EN is not set (FALSE), the status
of the output variable will remain unchanged until EN is set. ENO will adopt the
status of EN. Therefore, you can connect further function blocks/functions to E
NO which are controlled by the status of EN.
E_TP If the same variables are used for programming as described under TP, the p
rogram for E_TP would be designed as follows: POU Header In the POU Header the i
nput enable is declared additionally.
,
Example
LD Body If enable is set, E_TP will be as described for TP.
If enable is reset, the status will be frozen and the start signal IN will be ig
nored. As soon as enable is set again, E_TP continues processing. You may now co
nnect a further function block with ENO which will be activated only if the EN o
f this E_TP is set (TRUE).
* next page
13 – 6
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Function Blocks Timer
IL Body
The status of enable is loaded in the IL and assigned to copy_name.EN. The nomin
ation copy_name.EN or copy_name.PT etc. has to be maintained in the IL.
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not.
Matsushita Electric Works (Europe) AG
13 – 7
IEC Function Blocks Timer
NAiS Control 1131
(E_)TON
Outline
The function block TON or E_TON allows you to program a switch on delay as is de
monstrated in our Start–Up Manual ”First Steps”. For TON declare the following:
IN: timerON an internal timer is started for each rising edge detected at IN PT:
switch on delay (16–bit value: 0 – 327.27s, 32–bit value: 0 – 21,474,836.47s; r
esolution 10ms each) the desired switch on delay is defined here(PT = preset tim
e) Q: signal output is set if PT = ET ET: current value is the actually elapsed
time (ET = elapsed time)
J Data Types
Input Variable
BOOL (IN) TIME (PT)
Output Variable
BOOL (Q) ITIME (ET)
+ Note
This function is not available for FP1–C14/C16/C24/C40 and FP5 (version 1.0 to 1
.9).
* next page
13 – 8
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Function Blocks Timer
J Time Chart
IN t0 t1
TON
t2
t3
Q
t0
t0 + PT
t1
ET PT
t0 A
t1
A) Q is set delayed with the time defined in PT. Resetting is without any delay.
B) If the input IN is only set for the period of the delay time PT or even for
a shorter period of time (t3 – t2 < PT), Q will not be set. J Time Chart
EN
E_TON
IN t0 Q t1 t2 t3 t4 t5 t6
t0
t0+PT t1
t4
t4+PT
t5
t6
ET PT
t0
t1 A
t2
t3
t4
t5 B
t6
Matsushita Electric Works (Europe) AG
ÉÉÉ ÉÉÉ
t2 t3 t t2 B t3
ÉÉÉ ÉÉÉ
ÉÉ ÉÉ ÉÉÉ ÉÉ ÉÉ ÉÉÉ
ÉÉÉÉÉ ÉÉÉÉÉ
t6 + PT
t
13 – 9
IEC Function Blocks Timer
NAiS Control 1131
,
Example
TON In the following example the function block TON is programmed in ladder diag
ram (LD) and instruction list (IL). The same POU header is used for both program
ming languages. POU Header All input and output variables which are used for pro
gramming the function block TON are declared in the POU header. This also includ
es the function block (FB) itself. By declaring the FB you create a copy of the
original FB. This copy is saved under copy_name. A separate data area is reserve
d for this copy.
LD Body If start is set (status = TRUE), the input signal is transferred to sign
al_output with a delay by the time period set_value.
IL Body If you want to call the TON: copy_name in an instruction list, enter the
following: |
The nomination copy_name.IN or copy_name.ET etc. has to be maintained in the IL.
+ Note
13 – 10
It is not important whether the function names in the IL editor are capitalized
or not. * next page
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Function Blocks Timer
Outline
Anything stated under TON also applies to E_TON. The function block E_TON has in
addition an enable input (EN) and an enable output (ENO) of the data type BOOL.
If EN is set (TRUE), E_TON will be activated. If EN is not set (FALSE), the sta
tus of the output variable will remain unchanged until EN is set. ENO will adopt
the status of EN. Therefore, you may connect further function blocks/functions
to ENO which are controlled by the status of EN.
E_TON If the same variables are used for programming as described under TON the
program for E_TON would be designed as follows: POU Header In the POU Header the
input enable is declared additionally.
,
Example
LD Body If enable is set, E_TON will be as described for TON.
If enable is reset, the status will be frozen and the start signal at IN will be
ignored. As soon as enable is set again, E_TON continues working. You may now c
onnect a further function block with ENO which will be activated only if the EN
of this E_TON is set (TRUE).
Matsushita Electric Works (Europe) AG
13 – 11
IEC Function Blocks Timer
NAiS Control 1131
IL Body
The status of enable is loaded in the IL and assigned to copy_name.EN. The nomin
ation copy_name.EN or copy_name.PT etc. has to be maintained in the IL.
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not.
13 – 12
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Function Blocks Timer
(E_)TOF
Outline
The function block TOF or E_TOF allows you to program a switch off delay, e.g. t
o switch off the ventilator of a machine at a later point of time than the machi
ne itself. For TON declare the following: IN: timerON an internal time measuring
device is started, if a falling edge is detected at IN. If a rising edge is det
ected at IN before PT has reached its value, Q will not be switched off (see tim
e chart, section B) PT: switch–off delay (16–bit value: 0 – 327.27s, 32–bit valu
e: 0 – 21,474,836.47s; resolution 10ms each) the intended switch–off delay is de
fined here (PT = preset time) Q: signal output is reset, if PT = ET ET: current
value represents the actually elapsed time (ET = elapsed time)
J Data Types
Input Variable
BOOL (IN) TIME (PT)
Output Variable
BOOL (Q) TIME (ET)
+ Note
This function is not available for FP1–C14/C16/C24/C40 and FP5 (version 1.0 to 1
.9).
Matsushita Electric Works (Europe) AG
13 – 13
IEC Function Blocks Timer
NAiS Control 1131
J Time Chart
IN t0 Q ET PT t0 t1 t2 t3
TOF
t4
t5
t1 + PT
t2
t0 A
t1
t2
t3 B
t4
A) Q is switched off with a delay corresponding to the time defined in PT. Switc
hing on is carried out without delay. B) If IN (as in the time chart on top for
t3 to t4) is set prior to the lapse of the delay time PT, Q remains set (time ch
art for t2 to t3). J Time Chart
EN t7 IN Q t0 ET PT t8
E_TOF
t1 + PT
t2
t5 + PT
t6
t0 t1
t2 t3
t4
t5
t6
13 – 14
Matsushita Electric Works (Europe) AG
ÉÉ ÉÉ ÉÉ ÉÉ
ÉÉÉÉÉ ÉÉ ÉÉÉÉÉ ÉÉ
t0 t1
t2
t3
t4
t5
t6
t7 + PT
t7
ÉÉÉÉ ÉÉÉÉ
t5
ÉÉ ÉÉÉÉ ÉÉ ÉÉÉÉ
t5 + PT
t8
* next page
NAiS Control 1131
IEC Function Blocks Timer
,
Example
TOF In the following example, the function block TOF is programmed in ladder dia
gram (LD) and instruction list (IL). The same POU header is used for both progra
mming languages. POU Header All input and output variables which are used for pr
ogramming the function block TOF are declared in the POU header. This also inclu
des the function block (FB) itself. By declaring the FB you create a copy of the
original FB. This copy is saved under copy_name. A separate data area is reserv
ed for this copy.
LD Body If start is set, this signal is transferred to signal_output with a dela
y corresponding to the period of time set_value.
IL Body If you want to call the TOF: copy_name in an instruction list, enter the
following:
The nomination copy_name.IN or copy_name.ET etc. has to be maintained in the IL.
+ Note
It is not important whether the function names in the IL editor are capitalized
or not.
Matsushita Electric Works (Europe) AG
13 – 15
IEC Function Blocks Timer
NAiS Control 1131
Outline
Anything stated under TOF also applies to E_TOF. The function block E_TOF has in
addition an enable input (EN) and an enable output (ENO) of the data type BOOL.
If EN is set (TRUE), E_TOF will be activated. If EN is not set (FALSE), the sta
tus of the output variable will remain unchanged until EN is set. ENO will adopt
the status of EN. Therefore, you may connect further function blocks/functions
to ENO which are controlled by the condition of EN.
E_TOF If the same variables are used for programming as described under TOF the
program for E_TOF would be designed as follows: POU Header In the POU Header the
input enable is declared additionally.
,
Example
LD Body If enable is set, E_TOF will be as described for TOF.
If enable is reset, the status will be frozen and CD ignored. As soon as enable
is set again, E_TOF continues working. You may now connect a further function bl
ock with ENO which will be activated only if the EN of this E_TOF is set (TRUE).
* next page
13 – 16
Matsushita Electric Works (Europe) AG
NAiS Control 1131
IEC Function Blocks Timer
IL Body
The status of enable is loaded in the IL and assigned to copy_name.EN. The nomin
ation copy_name.EN or copy_name.PT etc. has to be maintained in the IL.
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not.
Matsushita Electric Works (Europe) AG
13 – 17
IEC Function Blocks Timer
NAiS Control 1131
13 – 18
Matsushita Electric Works (Europe) AG
Part 4 Matsushita Instructions
Chapter 14 Matsushita Instructions
CT, Down Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 – 9
DF, Leading Edge Differential . . . . . . . . . . . . . . . . . . 14 – 10 DFN, T
railing Edge Diffential . . . . . . . . . . . . . . . . . . . 14 – 11 ICTL, Inte
rrupt Control . . . . . . . . . . . . . . . . . . . . . . . . 14 – 12 JP, Jump t
o label . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 – 14 KEEP,
Serves as a relay with set and reset inputs 14 – 15 LBL, Label for the JP and LO
OP Instruction . . . . . 14 – 16 LOOP, Loop to Label . . . . . . . . . . . . . .
. . . . . . . . . . . 14 – 17 LSR, Left shift register . . . . . . . . . . . .
. . . . . . . . . . . . 14 – 18 MC, Master Control relay . . . . . . . . . . . .
. . . . . . . . . . 14 – 19 MCE, Master Conrol Relay End . . . . . . . . . . .
. . . . . 14 – 20 TM_1ms, On Delay Timer for 0.001s Units . . . . . . 14 – 21 TM
_10ms, On Delay Timer for 0.01s Units . . . . . . 14 – 23 TM_100ms, On Delay Tim
er for 0.1s Units . . . . . . 14 – 25 TM_1s, On Delay Timer for 1s Units . . . .
. . . . . . . . 14 – 27 F0 (MV), 16–bit data move . . . . . . . . . . . . . . .
. . . . . 14 – 29 F1 (DMV) 32–bit data move . . . . . . . . . . . . . . . . . .
. 14 – 30 F2 (MVN) 16–bit data inversions and move . . . . . . 14 – 31 F3 (DMVN
) 32–bit data inversions and move . . . . 14 – 32 F5 (BTM) Bit data move . . . .
. . . . . . . . . . . . . . . . . . . 14 – 33 F6 (DGT) Digit data move . . . .
. . . . . . . . . . . . . . . . . 14 – 34 F10 (BKMV) Block transfer . . . . . .
. . . . . . . . . . . . . . 14 – 35 F11 (COPY) Block copy . . . . . . . . . . .
. . . . . . . . . . . . 14 – 36
Matsushita Instruction Set
NAiS Control 1131
F12 EPRD EEPROM read from memory . . . . . . . . 14 – 37 P13 EPWT EEPROM write t
o memory . . . . . . . . . . 14 – 39 F15 (XCH) 16–bit data exchange . . . . . .
. . . . . . . . 14 – 42 F16 (DXCH) 32–bit data exchange . . . . . . . . . . . .
. 14 – 43 F17 (SWAP) Higher/lower byte in 16–bit data exchange . . . . . . . . .
. . . . . . . . . . . . . . . . 14 – 44 F20 (ADD) 16–bit addition . . . . . . .
. . . . . . . . . . . . . . 14 – 45 F21 (DADD) 32–bit addition . . . . . . . .
. . . . . . . . . . . 14 – 46 F22 (ADD2) 16–bit addition, destination can be spe
cified . . . . . . . . . . . . . . . . . . . . . . . . 14 – 47 F23 (DADD2) 32–bi
t addition, destination can be specified . . . . . . . . . . . . . . . . . . . .
. . . . 14 – 48 F25 (SUB) 16–bit subtraction . . . . . . . . . . . . . . . . .
. 14 – 49 F26 (DSUB) 32–bit subtraction . . . . . . . . . . . . . . . . 14 – 50
F27 (SUB2) 16–bit subtraction, destination can be specified . . . . . . . . . .
. . . . . . . . . . . . . . 14 – 51 F28 (DSUB2) 32–bit subtraction, destination
can be specified . . . . . . . . . . . . . . . . . . . . . . . . 14 – 52 F30 (MU
L) 16–bit multiplication, destination can be specified . . . . . . . . . . . . .
. . . . . . . . . . . 14 – 53 F31 (DMUL) 32–bit multiplication, destination can
be specified . . . . . . . . . . . . . . . . . . . . . . . . 14 – 54 F32 (DIV)
16–bit division, destination can be specified . . . . . . . . . . . . . . . . .
. . . . . . . 14 – 55 F33 (DDIV) 32–bit division, destination can be specified .
. . . . . . . . . . . . . . . . . . . . . . . 14 – 56 F35 (INC) 16–bit incremen
t . . . . . . . . . . . . . . . . . . . . 14 – 57 F36 (DINC) 32–bit increment .
. . . . . . . . . . . . . . . . . 14 – 58 F37 (DEC) 16–bit decrement . . . . . .
. . . . . . . . . . . . 14 – 59 F38 (DDEC) 32–bit decrement . . . . . . . . . .
. . . . . . . 14 – 60 F40 (BADD) 4–digit BCD addition . . . . . . . . . . . . .
. 14 – 61
14 – 2 Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set
F41 (DBADD) 8–digit BCD addition . . . . . . . . . . . . . 14 – 62 F42 (BADD2) 4
–digit BCD addition, destination can bespecified . . . . . . . . . . . . . . . .
. . . . . . . . . 14 – 63 F43 (DBADD2) 8–digit BCD addition, destination can be
specified . . . . . . . . . . . . . . . . . . . . . . . . 14 – 64 F45 (BSUB) 4–
digit BCD subtraction . . . . . . . . . . . 14 – 65 F46 (DBSUB) 8–digit BCD subt
raction . . . . . . . . . . 14 – 66 F47 (BSUB2) 4–digit BCD subtraction, destina
tion can be specified . . . . . . . . . . . . . . . . . . . . . . . . 14 – 67 F4
8 (DBSUB2) 8–digit BCD subtraction, destination can be specified . . . . . . . .
. . . . . . . . . . . . . . . . 14 – 68 F50 (BMUL) 4–digit BCD multiplication,
destination can be specified . . . . . . . . . . . . . . . . . . . . . . . . 14
– 69 F51 (DBMUL) 8–digit BCD multiplication, destination can be specified . . .
. . . . . . . . . . . . . . . . . . . . . 14 – 70 F52 (BDIV) 4–digit BCD divisio
n, destination can be specified . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . 14 – 71 F53 (DBDIV) 8–digit BCD division, destination can be specified
. . . . . . . . . . . . . . . . . . . . . . . . 14 – 72 F55 (BINC) 4–digit BCD
increment . . . . . . . . . . . . . 14 – 73 F56 (DBINC) 8–digit BCD increment .
. . . . . . . . . . . 14 – 74 F57 (BDEC) 4–digit BCD decrement . . . . . . . . .
. . . 14 – 75 F58 (DBDEC) 8–digit BCD decrement . . . . . . . . . . 14 – 76 F60
(CMP) 16–bit data compare . . . . . . . . . . . . . . . 14 – 77 F61 (DCMP) 32–b
it data compare . . . . . . . . . . . . . . 14 – 78 F62 (WIN) 16–bit data band c
ompare . . . . . . . . . . . 14 – 79 F63 (DWIN) 32–bit data band compare . . . .
. . . . . 14 – 80 F64 (BCMP) Block data compare . . . . . . . . . . . . . . 14
– 81 F65 (WAN) 6–bit data AND . . . . . . . . . . . . . . . . . . . . 14 – 82 F6
6 (WOR) 16–bit data OR . . . . . . . . . . . . . . . . . . . . 14 – 83
Matsushita Electric Works (Europe) AG
14 – 3
Matsushita Instruction Set
NAiS Control 1131
F67 (XOR) 16–bit data exclusive OR . . . . . . . . . . . 14 – 84 F68 (XNR) 16–bi
t data exclusive NOR . . . . . . . . . . 14 – 85 F70 (BCC) Block check code calc
ulation . . . . . . . . 14 – 86 F71 (HEX2A) HEX " ASCII conversion . . . . . . .
. . 14 – 87 F72 (A2HEX) ASCII " HEX conversion . . . . . . . . . 14 – 88 F73 (B
CD2A) BCD " ASCII conversion . . . . . . . . 14 – 89 F74 (A2BCD) ASCII " BCD con
version . . . . . . . . 14 – 90 F75 (BIN2A) 16–bit BIN " ASCII conversion . . .
. 14 – 92 F76 (A2BIN) ASCII " 16–bit BIN conversion . . . . 14 – 93 F77 (DBIN2A)
32–bit BIN " ASCII conversion . . . 14 – 94 F78 (DA2BIN) ASCII " 32–bit BIN con
version . . . 14 – 95 F80 (BCD) 16–bit BIN " 4–digit BCD conversion 14 – 96 F81
(BIN) 4–digit BCD " 16–bit BIN conversion . 14 – 97 F82 (BCD) 32–bit BIN " 8–dig
it BCD conversion 14 – 98 F83 (DBIN) 8–digit BCD " 32–bit BIN conversion 14 – 99
F84 (INV) 16–bit data invert (one’s complement) 14 – 100 F85 (NEG) 16–bit data
two’s complement . . . . . . 14 – 101 F86 (DNEG) 32–bit data two’s complement .
. . . . 14 – 102 F87 (ABS) 16–bit data absolute value . . . . . . . . . 14 – 103
F88 (DABS) 32–bit data absolute value . . . . . . . . 14 – 104 F89 (EXT) 16–bit
data sign extension . . . . . . . . . . 14 – 105 F90 (DECO) Decode . . . . . .
. . . . . . . . . . . . . . . . . . 14 – 106 F91 (SEGT) 16–bit data 7–segment de
code . . . . 14 – 108 F92 (ENCO) Encode . . . . . . . . . . . . . . . . . . . .
. . . . 14 – 110 F93 (UNIT) 16–bit data combine . . . . . . . . . . . . . . 14 –
111 F94 (DIST) 16–bit data distribution . . . . . . . . . . . . 14 – 113 F95 (A
SC) Character " ASCII transfer . . . . . . . . 14 – 116
14 – 4 Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set
F96 (SRC) Table data search (16–bit search) . . . 14 – 117 F100 (SHR) Right shif
t of 16–bit data in bit units 14 – 118 F101 (SHL) Left shift of 16–bit data in b
it units . . 14 – 119 F105 (BSR) Right shift of one hexadecimal digit (4 bits) o
f 16–bit data . . . . . . . . . . . . . . . . . . . 14 – 120 F106 (BSL) Left shi
ft of one hexadecimal digit (4 bits) of 16–bit data . . . . . . . . . . . . . .
. . . . . 14 – 121 F110 (WSHR) Right shift of one word (16 bits) of 16–bit data
range . . . . . . . . . . . . . . . . . . . 14 – 122 F111 (WSHL) Left shift of o
ne word (16 bits) of 16–bit data range . . . . . . . . . . . . . . . . . . . . 1
4 – 123 F112 (WBSR) Right shift of one hex. digit (4 bits) of 16–bit data range
. . . . . . . . . . . . . . . . . . . . 14 – 124 F113 (WBSL) Left shift of one h
ex. digit (4 bits) of 16–bit data range . . . . . . . . . . . . . . . . . . . .
14 – 125 F118 (UCD) Up/Down Counter . . . . . . . . . . . . . . . . 14 – 126 F11
9 (LRSR) LEFT/RIGHT shift register . . . . . . . 14 – 127 F120 (ROR) 16–bit data
right rotate . . . . . . . . . . . 14 – 129 F121 (ROL) 16–bit data left rotate
. . . . . . . . . . . . . 14 – 130 F122 (RCR) 16–bit data right rotate with carr
y–flag data . . . . . . . . . . . . . . . . . . . . . . . . 14 – 131 F123 (RCL)
16–bit data left rotate with carry–flag data . . . . . . . . . . . . . . . . . .
. . . . . . 14 – 132 F130 (BTS) 16–bit data bit set . . . . . . . . . . . . . .
. . 14 – 133 F131 (BTR) 16–bit data bit reset . . . . . . . . . . . . . . 14 –
134 F132 (BTI) 16–bit data bit invert . . . . . . . . . . . . . . . 14 – 135 F13
3 (BTT) 16–bit data test . . . . . . . . . . . . . . . . . . 14 – 136 F135 (BCU)
Number of ON bits in 16–bit data . . 14 – 137 F136 (DBCU) Number of ON bits in
32–bit data . 14 – 138 F137 (STMR) Auxiliary timer (sets the ON– delay timer for
0.01s units) . 14 – 139
Matsushita Electric Works (Europe) AG 14 – 5
Matsushita Instruction Set
NAiS Control 1131
F138 (HMSS) h:min:s " s conversion . . . . . . . . . 14 – 140 F139 (SHMS) s " h:
min:s conversion . . . . . . . . . 14 – 141 F140 (STC) Carry–flag set . . . . .
. . . . . . . . . . . . . . 14 – 142 F141 (CLC) Carry–flag reset . . . . . . . .
. . . . . . . . . . 14 – 143 F143 (IORF) Partial I/O update . . . . . . . . . .
. . . . . 14 – 144 F144 (TRNS) Serial communication (RS232C) . . 14 – 145 F147
(PR) Parallel printout . . . . . . . . . . . . . . . . . . . 14 – 147 F148 (ERR)
Self–diagnostic error set . . . . . . . . . . 14 – 148 F149 (MSG) Message displ
ay . . . . . . . . . . . . . . . . 14 – 149 F157 (CADD) Time addition . . . . .
. . . . . . . . . . . . . 14 – 150 F158 (CSUB) Time subtraction . . . . . . . .
. . . . . . . 14 – 151 F162 (HC0S) High–speed counter output set . . . 14 – 153
F163 (HC0R) High–speed counter output reset . 14 – 154 F164 (SPD0) Pulse output
control; Pattern output control . . . . . . . . . . . . . . . . . . 14 – 155 F16
5 (CAM0) Cam control . . . . . . . . . . . . . . . . . . . 14 – 156 F166 (HC1S)
Sets Output of High– speed counter (4Channels) . . . . . . . . . . . . . . . . .
. . . . . . . . . . 14 – 157 F167 (HC1R) Resets Output of High–speed Counter (4
Channels) . . . . . . . . . . . . . . . . . . . . . . . . . . 14 – 159 F168 (SP
D1) Positioning Pulse Instruction . . . . . 14 – 161 F169 (PLS) Pulse Width Modu
lation y 40 Hz . . . 14 – 166 F170 (PWM) Pulse Width Modulation . . . . . . . .
. . 14 – 169 F183 (DSTM) Special 32–bit timer . . . . . . . . . . . . . 14 – 172
F327 (INT) Floating point data " 16–bit integer data . . . . . . . . . . . . .
. . . . . . . . . . . . . 14 – 174 F328 (DINT) Floating point data " 32–bit inte
ger data . . . . . . . . . . . . . . . . . . . . . . . . . . 14 – 176 F333 (FINT
) Rounding the first decimal point down . . . . . . . . . . . . . . . . . . . .
. . . . . . . . 14 – 178
14 – 6 Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set
F334 (FRINT) Rounding the first decimal point off . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . 14 – 180 F335 (FSIGN) Floating point data sign c
hanges . 14 – 182 F337 (RAD) Conversion of angle units (Degrees " Radians) . . .
. . . . . . . . . . . . . . . 14 – 184 F338 (DEG) Conversion of angle units (Ra
dians " Degrees) . . . . . . . . . . . . . . . . . . 14 – 186 F355 (PID) PID pro
cessing instruction . . . . . . . . . 14 – 188
Matsushita Electric Works (Europe) AG
14 – 7
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
14 – 8
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
FP0
CT
Outline
Down Counter
3–4
The CT instruction is a down type preset counter. The Count trigger subtracts on
e count from the elapsed value area EV each time its leading edges are detected.
The Reset trigger resets the counter when it is ON. The constant SV (1 to 32767
) can be set as preset (Set) value.
J Data Types
Variable
Count, Reset, C Num*, SV INT, WORD
Data Types
BOOL
J Operands
For
Count, Reset
Relais
X x – WX Y x x WY – R x x WR – L x x WL – T x –
T/C
C x – EV – DT – – DT – x: –:
Register
LD – – LD – FL – – FL –
C SV
SV x

,
available not available
Example
+ Notes
D It is not possible to use this function in a function block POU. D Every used
counter must have a separate constant Num*. Available Num* addresses depend on s
ystem registers 5 and 6. D As input/output relays X and Y are sometimes handled
in units of 16 points, they are expressed as a combination of decimal and hexade
cimal numbers as shown below.
Matsushita Electric Works (Europe) AG
14 – 9
Matsushita Instruction Set Basic and High–level Instructions Steps
NAiS Control 1131
DF
Outline
Availability
FP0
Leading Edge Differntial
1
DF is a leading edge differential instruction. The DF instruction executes and t
urns ON output o for a singular scan duration if the trigger i changes from an O
FF to an ON state.
J Data Types
Variable
i, o
Output Variable
BOOL
J Operands
For
i o
Relais
X x – Y x x R x x L x x x: –: T x –
T/C
C x –
,
available not available
Example
14 – 10
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions
DFN
Outline
Steps
Availability
FP0
Trailing Edge Diffential
1
DFN is trailing edge differential instruction. The DFN instruction executes and
turns ON output o for a singular scan duration if the trigger i changes from an
ON to an OFF state.
J Data Types
Variable
i, o
Data Type
BOOL
J Operands
For
i o
Relais
X x – Y x x R x x L x x x: –: T x –
T/C
C x –
,
available not available
Example
LD DFN ST Var_1 Var_0 (* i = Var_0 *) (* Trailing edge differential for variable
Var_0. *) (* o = Var_1 *) (* At valid event the output variable Var_1 *) (* is
in the ON–state for one scan duration. *)
Matsushita Electric Works (Europe) AG
14 – 11
Matsushita Instruction Set Basic and High–level Instructions Steps
NAiS Control 1131
ICTL
Outline
Availability
FP0
Interrupt Control
5
The ICTL (Interrupt Control) instruction sets all interrupts to enable or disabl
e. Each time the ICTL instruction is executed, it is possible to set parameters
like the type and validity of interrupt programs. Settings can be specified by s
1 and s2. D s1: 16–bit equivalent constant or 16–bit area for interrupt control
setting D s2: 16–bit equivalent constant or 16–bit area for interrupt trigger co
ndition setting The number of interrupt programs available is: D 16 interrupt mo
dule initiated interrupt programs (INT 0 to INT 15) D 8 advanced module (special
modules, like positioning,...) initiated interrupt programs (INT 16 to INT 23)
D 1 time–initiated interrupt program (INT 24) (Time base 0.5 ms and 10ms selecta
ble for FP10SH) Be sure to use ICTL instructions so that they are executed once
at the leading edge of the ICTL trigger using the DF instruction. Two or more IC
TL instructions can have the same trigger.
Bit
s1 16#
15 .. 8
Selection of control function 00: Interrupt ”enable/disable” control 01: Interru
pt trigger reset control
7 .. 0
Interrupt type selection 00: Interrupt module initiated interrupt (INT 0–15) 01:
Advanced module initiated interrupt (INT 16–23) 02: Time–initiated interrupt (I
NT 24) 00
s1 16# s2 2#
00 Bit 0: 0 Interrupt program 0 disabled Bit 0: 1 Interrupt program 0 enabled Bi
t 1: 0 Interrupt program 1 disabled ... Bit 15: 1 Interrupt program 15 enabled ,
Example: s2 = 2#0000000000001010
+ Notes
D The current enable/disable status of each interrupt module initiated interrupt
can be checked by monitoring the special data register DT90025. D The current e
nable/disable status of each non–interrupt module initiated interrupt can be che
cked by monitoring the special data register DT90026. * next page
14 – 12
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions
D The current interrupt interval of the time–interrupt can be checked by monitor
ing the special data register DT90027. D If a program is written into an interru
pt task, the interrupt concerned will be enabled automatically during the initia
lization routine when starting the program. D With the ICTL instruction an inter
rupt task can be enabled or disabled by the program. J Data Types
Variable
s1, s2
Data Types
INT, WORD
J Operands
For
s1, s2
Relais
WX x WY x WR x WL x
T/C
SV x EV x DT x
Register
LD x FL x x: –: available not available
,
Example
POU Header
IL Body
LD DF ICTL start Var_1,Var_2 (* Load value of EN–input *) (* Leading edge detect
ion *) (* Execute ICTL *)
LD Body
The interval for executing INT 24 program is specified as 100 ms (10ms time base
selected) when the leading edge of start is detected.
Matsushita Electric Works (Europe) AG
14 – 13
Matsushita Instruction Set Basic and High–level Instructions Steps
NAiS Control 1131
JP
Outline
Availability
All 3
Jump to label
2–3
The JP (Jump to Label) instruction skips to the Label (LBL) function that has th
e same number Num* as the JP function when the predetermined trigger EN is in th
e ON–state. The JP function will skip all instructions between a JP and an LBL o
f the same number. When the JP instruction is executed, the execution time of th
e skipped instructions is not included in the scan time. Two or more JP function
s with the same number Num* can be used in a program. However, no two LBL instru
ctions may be identically numbered. LBL instructions are specified as destinatio
ns of JP, LOOP and F19_SJP instructions. One JP and LBL instruction pair can be
programmed between another pair. This construction is called nesting.
J Data Types
Variable
NUM*
Data Types
INT, WORD
,
Example
LD JP start 1 (* EN = start; Starting signal for the JP function. *) (* Num* = 1
(Address of Label) *)
+ Notes
D It is not possible to use this function in a function block POU. D The JP and
LBL instruction numbers Num* must be a constant between: 0 and 31 for FP1–C14/16
0 and 64 for FP1–C24/40/56/72 and FP–M
14 – 14
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps
1
KEEP
Outline
Serves as a relay with set and reset inputs
Availability
FP0
KEEP serves as a relay with set and reset points. When the SetTrigger turns ON,
output of the specified relay goes ON and maintains its condition. Output relay
goes OFF when the ResetTrigger turns ON. The output relay’s ON state is maintain
ed until a ResetTrigger turns ON regardless of the ON or OFF states of the SetTr
igger. If the SetTrigger and ResetTrigger turn ON simultaneously, the ResetTrigg
er is given priority.
J Data Types
Variable
Set Trigger Reset Trigger Address BOOL
Data Types
BOOL
J Operands
For
Set Trigger Reset Trigger Address – x x x x: –: – –
Relais
X x Y x R x L x T x
T/C
C x
,
available not available
Example
POU Header
LD Body
Matsushita Electric Works (Europe) AG
14 – 15
Matsushita Instruction Set Basic and High–level Instructions Steps
1
NAiS Control 1131
LBL
Outline
Label for the JP and LOOP Instruction
Availability
All 3
The LBL (Label for the JP and LOOP) instruction skips to the LBL instruction wit
h the same number Num* as the JUMP instruction if the predetermined trigger EN i
s in the ON–state. It skips to the LBL instruction with the same number Num* as
the LOOP instruction and repeats execution of what follows until the data of a s
pecified operand becomes ”0”.
J Data Types
Variable
NUM*
Data Types
INT, WORD
,
Example
+ Notes
D It is not possible to use this function in a function block POU. D The LBL, JP
and LOOP instruction numbers Num* must be a constant between 0 and 31 for FP1–C
14/16 0 and 64 for FP1–C24/40/56/72 and FP–M
14 – 16
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
All 3
LOOP
Outline
Loop to Label
4
The LOOP (Loop to Label) instruction skips to the LBL instruction with the same
number Num* as the LOOP instruction and repeats execution of what follows until
the data of a specified operand becomes ”0”. The LBL instructions are specified
as destination of the LOOP instruction. It is not possible to specify two or mor
e LBL instructions with the same number Num* within a program. If the set value
s in the data area is ”0” from the beginning, the LOOP instruction is not execut
ed (ignored).
J Data Types
Variable
NUM*, s
Data Types
INT, WORD
J Operands
For
s
Relais
WX x WY x WR x WL x
T/C
SV x EV x DT x
Register
LD x FL x x: –: available not available
Num*
numerical constant
,
Example
+ Notes
D It is not possible to use this function in a function block POU. D The LOOP an
d LBL instruction numbers Num* must be a constant between 0 and 31 for FP1–C14/1
6 0 and 64 for FP1–C24/40/56/72 and FP–M
Matsushita Electric Works (Europe) AG
14 – 17
Matsushita Instruction Set Basic and High–level Instructions Steps
NAiS Control 1131
LSR
Outline
Availability
FP0
Left shift register
Shifts 1 bit of the specified data area (WR) to the left (to the higher bit posi
tion). When programming the LSR instruction, be sure to program the data input (
DataInput), shift (shiftTrigger) and reset triggers (ReSetTrigger). DataInput: s
pecifies the state of new shift–in data: new shift–in data 1: when the input is
ON new shift–in data 0: when the input is OFF shiftTrigger: shifts 1 bit to the
left when the leading edge of the trigger is detected ReSetTrigger: turns all th
e bits of the data area to 0 if the trigger is in the ON–state. The area availab
le for this instruction is only the word internal relay (WR).
J Data Types
Variable
DataInput, Shift Trigger, Reset Trigger WR INT, WORD
Data Types
BOOL
J Operands
For
DataInput Shift Trigger, Reset Trigger WX WR – – x – x: –: – – WY WR WL SV EV
Relais
X x Y x R x L x T x
T/C
C x
,
available not available
Example
+ Note
D Word internal relay (WR) number range, depends on the free area in the Project
–> Compile Options menu.
14 – 18
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
All 3
MC
Outline
Master Control relay
2–3
The MC (Master Control Relay) instruction executes the program between the maste
r control relay MC and master control relay end MCE instructions of the same num
ber Num* only if the trigger EN is in the ON–state. When the predetermined trigg
er EN is in the OFF state, the program between the master control relay MC and m
aster control relay end MCE instructions are not executed. A master control inst
ruction (MC and MCE) pair may also be programmed in between another pair of mast
er control instructions. This construction is called ”nesting”.
J Data Types
Variable
NUM*
Data Types
INT, WORD
,
Example
+ Notes
D It is not possible to use this function in a function block POU. D The MC inst
ruction number Num* must be a constant between 0 and 15 for FP1–C14/16 0 and 31
for FP1–C24/40/56/72 und FP–M
Matsushita Electric Works (Europe) AG
14 – 19
Matsushita Instruction Set Basic and High–level Instructions Steps
NAiS Control 1131
MCE
Outline
Availability
All 3
Master Conrol Relay End
2
The MCE (Master Control Relay End) instruction executes the program between the
master control relay MC and master control relay end MCE instructions of the sam
e number Num* only if the trigger EN is in the ON–state. When the predetermined
trigger EN is in the OFF state, the program between the master control relay MC
and master control relay end MCE instructions are not executed. A master control
instruction (MC and MCE) pair may also be programmed in between another pair of
master control instructions. This construction is called ”nestin,3g”.
J Data Types
Variable
NUM*
Data Types
INT, WORD
,
Example
MCE
LD MC start 1 (* EN = start; Starting signal for the MC/MCE function. *) (* 1 =
Num* *) (* ... *) (* Execute or execute not this program part. *) (* ... *) (* 1
= Num* *)
MCE
1
+ Notes
D It is not possible to use this function in a function block POU. D The MCE ins
truction number Num* must be a constant between 0 and 31 for FP1–C14/16 0 and 64
for FP1–C24/40/56/72 and FP–M
14 – 20
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps
3–4
TM_1ms
Outline
On Delay Timer for 0.001s Units
Availability
FP0
The TM_10ms instruction sets the ON–delay timer for 0.001s units (0 to 32.767s).
The areas used for the instruction are: • Preset (Set) value area: SV • Count (
Elapsed) value area: EV When the mode is set to RUN mode, the Preset (Set) value
is transferred to the SV. If the trigger of the timer instruction start is in t
he ON–state, the Preset (Set) value is transferred to the EV from the SV. During
the timing operation, the time is subtracted from the EV. The scan time is also
subtracted from the EV in the next scan. The timer contact T turns ON, when the
EV becomes 0.
J Data Types
Variable
start, T Num*, SV
Data Types
BOOL INT, WORD
J Operands
For
start
Relais
X x – WX Y x x WY – R x x WR – L x x WL – T x –
T/C
C x – EV – DT – – DT –
Register
LD – – LD – FL – – FL – x: –: available not available
T SV Num*
SV x

numerical constant
,
Example
Matsushita Electric Works (Europe) AG
14 – 21
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
+ Notes
D It is not possible to use this function in a function block POU. D Every used
timer must have a separate constant Num*. Available Num* addresses depend on sys
tem registers 5 and 6. Timers of type TM_1s, TM_100ms, TM_10ms, TM_1ms use the s
ame Num* address range. D The Matsushita timer functions (TM_1s, TM_100ms, TM_10
ms, and TM_1s) use the same NUM* address area as the Matsushita timer function b
locks (TM_1s_FB, TM_100ms_FB, TM_10ms_FB, and TM_1s_FB). For the timer function
blocks the compiler automatically assigns a NUM* address to every timer instance
. The addresses are assigned counting downwards, starting at the highest possibl
e address. In order to avoid errors (address conflicts), these timer functions a
nd function blocks should not be used together in a project.
14 – 22
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions
TM_10ms
Outline
On Delay Timer for 0.01s Units
Steps
3–4
Availability
FP0
The TM_10ms instruction sets the ON–delay timer for 0.01s units (0 to 327.67s).
The areas used for the instruction are: • Preset (Set) value area: SV • Count (E
lapsed) value area: EV When the mode is set to RUN mode, the Preset (Set) value
is transferred to the SV. If the trigger of the timer instruction start is in th
e ON–state, the Preset (Set) value is transferred to the EV from the SV. During
the timing operation, the time is subtracted from the EV. The scan time is also
subtracted from the EV in the next scan. The timer contact T turns ON, when the
EV becomes 0.
J Data Types
Variable
start, T Num*, SV
Data Types
BOOL INT, WORD
J Operands
For
start
Relais
X x – WX Y x x WY x R x x WR x L x x WL x T x –
T/C
C x – EV – DT – – DT –
Register
LD – – LD – FL – – FL – x: –: available not available
T SV Num*
SV –

numerical constant
,
Example
Matsushita Electric Works (Europe) AG
14 – 23
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
+ Notes
D It is not possible to use this function in a function block POU. D Every used
timer must have a separate constant Num*. Available Num* addresses depend on sys
tem registers 5 and 6. Timers of type TM_1s, TM_100ms, TM_10ms, TM_1ms use the s
ame Num* address range. D The Matsushita timer functions (TM_1s, TM_100ms, TM_10
ms, and TM_1s) use the same NUM* address area as the Matsushita timer function b
locks (TM_1s_FB, TM_100ms_FB, TM_10ms_FB, and TM_1s_FB). For the timer function
blocks the compiler automatically assigns a NUM* address to every timer instance
. The addresses are assigned counting downwards, starting at the highest possibl
e address. In order to avoid errors (address conflicts), these timer functions a
nd function blocks should not be used together in a project.
14 – 24
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions
TM_100ms
Outline
On Delay Timer for 0.1s Units
Steps
3–4
Availability
FP0
The TM_100s instruction sets the ON–delay timer for 0.1s units (0 to 3276.7s). T
he TM instruction is a down type preset timer. The areas used for the instructio
n are: • Preset (Set) value area: SV • Count (Elapsed) value area: EV When the m
ode is set to RUN mode, the Preset (Set) value is transferred to the SV. If the
trigger of the timer instruction start is in the ON–state, the Preset (Set) valu
e is transferred to the EV from the SV. During the timing operation, the time is
subtracted from the EV. The scan time is also subtracted from the EV in the nex
t scan. The timer contact T turns ON, when the EV becomes 0.
J Data Types
Variable
start, T Num*, SV
Data Types
BOOL INT, WORD
J Operands
For
start
Relais
X x – WX Y x x WY x R x x WR x L x x WL x T x –
T/C
C x – EV x DT – – DT x
Register
LD – – LD x FL – – FL x x: –: available not available
T SV Num*
SV x
x
numerical constant
,
Example
LD TM_100ms ST start 16,32123 Var_0 (* EN = start; Starting signal for the TM_10
0ms function. *) (* Num* = 16 (Address of the timer) *) (* SV = 32123 (Time, cor
responding 3212,3 sec. ) *) (* T = Var_0; The variable Var_0 turns ON, *) (* whe
n the EV becomes 0. *)
Matsushita Electric Works (Europe) AG
14 – 25
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
+ Notes
D It is not possible to use this function in a function block POU. D Every used
timer must have a separate constant Num*. Available Num* addresses depend on sys
tem registers 5 and 6. Timers of type TM_1s, TM_100ms, TM_10ms, TM_1ms use the s
ame Num* address range. D The Matsushita timer functions (TM_1s, TM_100ms, TM_10
ms, and TM_1s) use the same NUM* address area as the Matsushita timer function b
locks (TM_1s_FB, TM_100ms_FB, TM_10ms_FB, and TM_1s_FB). For the timer function
blocks the compiler automatically assigns a NUM* address to every timer instance
. The addresses are assigned counting downwards, starting at the highest possibl
e address. In order to avoid errors (address conflicts), these timer functions a
nd function blocks should not be used together in a project.
14 – 26
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions
TM_1s
Outline
Steps
Availability
FP0
On Delay Timer for 1s Units
4–5
The TM_1s instruction sets the ON–delay timer for 1s units (0 to 32767s). The ar
eas used for the instruction are: • Preset (Set) value area: SV • Count (Elapsed
) value area: EV When the mode is set to RUN mode, the Preset (Set) value is tra
nsferred to the SV. If the trigger of the timer instruction start is in the ON–s
tate, the Preset (Set) value is transferred to the EV from the SV. During the ti
ming operation, the time is subtracted from the EV. The scan time is also subtra
cted from the EV in the next scan. The timer contact T turns ON, when the EV bec
omes 0.
J Data Types
Variable
start, T Num*, SV
Data Types
BOOL INT, WORD
J Operands
For
start T SV
Relais
X x – WX x Y x x WY x R x x WR x L x x WL x T x –
T/C
C x – EV x DT – – DT x
Register
LD – – LD x FL – – FL x x: –: available not available
SV x
Num*
numerical constant
,
Example
LD TM_1s ST start 13,SV13 Var_0 (* EN = start; Starting signal for the TM_1s fun
ction. *) (* Num* = 13 (Address of the timer) *) (* SV = SV13 (containing the ti
me for the timer) *) (* T = Var_0; The variable Var_0 turns ON, *) (* when the E
V becomes 0. *)
Matsushita Electric Works (Europe) AG
14 – 27
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
+ Notes
D It is not possible to use this function in a function block POU. D Every used
timer must have a separate constant Num*. Available Num* addresses depend on sys
tem registers 5 and 6. Timers of type TM_1s, TM_100ms, TM_10ms, TM_1ms use the s
ame Num* address range. D The Matsushita timer functions (TM_1s, TM_100ms, TM_10
ms, and TM_1s) use the same NUM* address area as the Matsushita timer function b
locks (TM_1s_FB, TM_100ms_FB, TM_10ms_FB, and TM_1s_FB). For the timer function
blocks the compiler automatically assigns a NUM* address to every timer instance
. The addresses are assigned counting downwards, starting at the highest possibl
e address. In order to avoid errors (address conflicts), these timer functions a
nd function blocks should not be used together in a project.
14 – 28
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps
5
F0
Availability
All 3
(MV)
16–bit data move
Outline
The 16–bit data or 16 bit equivalent constant specified by s is copied to the 16
–bit area specified by d, if the trigger EN is in the ON–state.
J Data Types
Variable
s, d
Data Types
INT, WORD
J Operands
For
s d
Relay
WX x – WY x x WR x x WL x x
T/C
SV x x EV x x DT x x
Register
LD x x x: –: FL x x
,
available not available
Example
+ Note
The variables s and d have to be of the same data type.
Matsushita Electric Works (Europe) AG
14 – 29
Matsushita Instruction Set Basic and High–level Instructions Steps
NAiS Control 1131
F1
Availability
All 3
(DMV)
32–bit data move
7
Outline
The 32 bit data or 32 bit equivalent constant specified by s is copied to the 32
–bit area specified by d, if the trigger EN is in the ON–state.
J Data Types
Variable
s, d
Data Types
DINT, DWORD
J Operands
For
s d
Relay
T/C
DEV x x
Register
DDT x x x: –: DLD x x DFL x x
DWX DWY DWR DWL DSV x – x x x x x x x x
,
available not available
Example
LD F1_DMV start Var_0,Var_1 (* EN = start; Starting signal for the F1_DMV functi
on. *) (* s = Var_0 (source) *) (* d = Var_1 (destination) *) (* 32–bit data mov
e from Var_0 to Var_1 *) (* option *)
ST
out
+ Note
The variables s and d have to be of the same data type.
14 – 30
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps
5
F2
(MVN)
16–bit data inversions and move
Availability
All 3
Outline
The 16 bit data or 16 bit equivalent constant specified by s is inverted and tra
nsferred to the 16–bit area specified by d if the trigger EN is in the ON–state.
J Data Types
Variable
s, d
Data Types
INT, WORD
J Operands
For
s d
Relay
WX x – WY x x WR x x WL x x
T/C
SV x x EV x x DT x x
Register
LD x x x: –: FL x x
,
available not available
Example
LD F2_MVN start Var_0, Var_1 out (* EN = start; Starting signal for the F2_MVN f
unction. *) (* s = Var_0 (source) *) (* d = Var_1 (destination) *) (* 16–bit inv
ert and move from Var_0 to Var_1 *) (* option *)
ST
+ Note
The variables s and d have to be of the same data type.
Matsushita Electric Works (Europe) AG
14 – 31
Matsushita Instruction Set Basic and High–level Instructions Steps
7
NAiS Control 1131
F3 (DMVN)
Outline
32–bit data inversions and move
Availability
All 3
The 32–bit data or 32–bit equivalent constant specified by s is inverted and tra
nsferred to the 32–bit area specified by d if the trigger EN is in the ON–state.
J Data Types
Variable
s, d
Data Types
DINT, DWORD
J Operands
For
s d
Relay
DWX x – DWY x x DWR x x DWL x x
T/C
DSV x x DEV x x DDT x x
Register
DLD x x x: –: DFL x x available not available
,
Example
+ Note
The variables s and d have to be of the same data type.
14 – 32
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
All 3
F5 (BTM)
Outline
Bit data move
7
1 bit of the 16–bit data or constant value specified by s is copied to a bit of
the 16–bit area specified by d according to the content specified by n if the tr
igger EN is in the ON–state. When the 16–bit equivalent constant is specified by
s, the bit data move operation is performed internally converting it to 16–bit
binary expression. The operand n specifies the bit number as follows: • Bit No.
0 to 3: source bit No. (0 hex to F hex) • Bit No. 8 to 11: destination bit No. (
0 hex to F hex) (The bits from 4 to 7 and 12 to 15 are invalid).
J Data Types
Variable
s, n, d
Data Types
INT, WORD
J Operands
For
s, n d
Relay
WX x – WY x x WR x x WL x x
T/C
SV x x EV x x DT x x
Register
LD x x x: –: FL x x
,
available not available
Example
LD F5_BTM start Var_0,Var_1 Var_2 (* EN = start; Starting signal for the F5_BTM
function. *) (* s = Var_0 (source) *) (* n = Var_1; e. g. Var_1 = 16#0A0B *) (*
11 source bit (B) ⇒ 10 destination bit (A) *) (* d = Var_2 (destination) *) (* o
ption *)
ST
out
+ Note
The variables s and d have to be of the same data type.
Matsushita Electric Works (Europe) AG
14 – 33
Matsushita Instruction Set Basic and High–level Instructions Steps
NAiS Control 1131
F6
Availability
All 3
(DGT)
Digit data move
7
Outline
The digits of the 16–bit data or constant value specified by s are copied to the
digits of the 16–bit area specified by d if the trigger EN is in the ON–state.
Copying multiple digits is also possible. 1 digit means 4–bit unit. The operand
n specifies the bit number as follows: • Bit No. 0 and 1: source digit No. (0 he
x to 3 hex) • Bit No. 4 and 5: number of digits to be copied (0 hex to 3 hex) 0
= move 1 digit 1 = move 2 digit (1 byte) 2 = move 3 digit 3 = move 4 digit (2 by
te) • Bit No. 8 and 9: destination digit No. (0 hex to 3 hex) (The bits 2,3,6,7
and 10 through 15 are invalid).
J Data Types
Variable
s, n, d
Data Types
INT, WORD
J Operands
For
s, n d
Relay
WX x – WY x x WR x x WL x x
T/C
SV x x EV x x DT x x
Register
LD x x x: –: FL x x
,
available not available
Example
+ Note
The variables s and d have to be of the same data type.
14 – 34
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
All 3
F10
Outline
(BKMV)
Block transfer
7
The data block specified by the 16–bit starting area specified by s1 and the 16–
bit ending area specified by s2 are copied to the block starting from the 16–bit
area specified by d if the trigger EN is in the ON–state. The operands s1 and s
2 should be: • in the same operand • s1 x s2 Whenever s1, s2 and d are in the sa
me data area: • s1 = d: data will be re–copied to the same data area.
J Data Types
Variable
s1, s2, d
Data Types
INT, WORD
J Operands
For
s1, s2 d
Relay
WX x – WY x x WR x x WL x x
T/C
SV x x EV x x DT x x
Register
LD x x x: –: FL x x
,
available not available
Example
LD F10_BKMV start Var_0,Var_1 Var_2 (* EN = start; Starting signal for the F10_B
KMV function. *) (* s1 = Var_0 (source 1) *) (* s2 = Var_1 (source 2) *) (* d =
Var_2 (destination) *) (* Var_0 to Var_1 ⇒ Var_2 *) (* option *)
ST
out
+ Note
The variables s1, s2 and d have to be of the same data type.
Matsushita Electric Works (Europe) AG
14 – 35
Matsushita Instruction Set Basic and High–level Instructions Steps
NAiS Control 1131
F11
Outline
Availability
All 3
(COPY)
Block copy
7
The 16–bit equivalent constant or 16–bit area specified by s is copied to all 16
–bit areas of the block specified by d1 and d2 if the trigger EN is in the ON–st
ate. The operands d1 and d2 should be: • in the same operand • d1 x d2
J Data Types
Variable
s, d1, d2
Data Types
INT, WORD
J Operands
For
s d1, d2
Relay
WX x – WY x x WR x x WL x x
T/C
SV x x EV x x DT x x
Register
LD x x x: –: FL x x
,
available not available
Example
+ Note
The variables s, d1 and d2 have to be of the same data type.
14 – 36
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
Fp0 (from Ver. 2.0)
F12
Outline
EPRD
EEPROM read from memory
11
This instruction is used to read information from the EEPROM. Before executing t
he F12_EPRD instruction, make sure that you have valid data in the EEPROM memory
location being read to the destination area. Otherwise the values being read wi
ll not make any sense. Also ensure that there at least 64 free data registers (1
block = 64 words (DTs)) reserved for the destination area.
J Data Types
Parameter
Input EN
Data Type
BOOL
Comment Activation of the function block (when EN has the state TRUE, the functi
on block will be executed at every PLC scan) EEPROM start block number Number of
blocks to write (1 block = 64 words (DTs)) DT start address for information to
be written When the function block was executed, ENO is set to TRUE. Helpful at
cascading of function blocks with EN–functionality
Input s1 Input s2 Eingang d IOutput ENO
INT, WORD DINT, DWORD DINT, DWORD BOOL
+ Note
J Operands
D One of the two inputs ’s1’ or ’s2’ has to be assigned constant number value.
Relais For
s1, s2 d – – – – –
T/C
DEV x EV –
Register
DDT x DT x DLD – LD – DFL – FL –
DWX DWY DWR DWL DSV x WX x WY x WR – WL x SV
x: available –: not available
Matsushita Electric Works (Europe) AG
14 – 37
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
J PLC–specific information
PLC type FP0 2,7k FP0 5k C32 C10/C14/C16
64 words (64 x 16 bit ) 0 to 9 1 to 2 20 ms each block Less than 1 ms each block
100,000 64 words ( 64 x 16 bit ) 0 to 95 1 to 8 5 ms each block Less than 1ms e
ach block 10,000
FP0 10k T32CP
64 words (64 x 16 bit ) 0 to 255 1 to 255 5 ms each block Less than 1ms each blo
ck 10,000
Block size (1 block) EEPROM start block number Number of blocks to be read / wri
tten each execution Write duration (Additional scan time) Read duration (Additio
nal scan time) Max number of writing events Note Power down RUN –> Prog mode cha
nges are also counted Max read times
No limit
No limit
No limit
,
Example
In this example the function F12_EPRD is programmed in ladder diagram (LD) and i
nstruction list (IL). The same POU header is used for both programming languages
. POU Header In the POU header, all input and output variables are declared that
are used for programming this function.
Body When the variable start changes from FALSE to TRUE, the function is carried
out. The function reads the first block (= 64 words) after start block number 0
from the EEPROM and writes the information into the data fields from data field
[0] until data field[63]. LD Body
IL Body
14 – 38
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
FP0 (from Ver. 2.0)
P13
b
EPWT
EEPROM write to memory
11
Outline
This instructions are used to save your PID profiles, timer profiles, counter pr
ofiles or positioning profiles ... into the built–in EEPROM. The EEPROM memory i
s not the same as the hold area. The hold area stores data real time. Whenever t
he power shuts down, the hold data is stored in the EEPROM memory. The P13_EPWT
instruction sends data into the EEPROM only when the instruction is executed. It
also has a limitation of the number of times you can write to it (see table bel
ow). You must make sure that the P13_EPWT instruction will not be executed more
often than the specified number of writes. For example, if you execute P13_EPWT
with R901A relay (pulse time 0.1s), the EEPROM will become inoperable after 100,
000 * 0.1 sec=10,000 sec (2.8 hours). However if you want to hold your profile d
ata such as positioning parameters or any other parameter values that are change
d infrequently, you will find this instruction very useful.
J Data Types
Parameter
Input EN
Data Type
BOOL
Comment Activation of the function block (when EN changes from FALSE to TRUE, th
e function block will be executed one time) DT start address of the block(s) tha
t you want to save Number of blocks to write (1 block = 64 words (DTs)) EEPROM s
tart block number When the function block was executed, ENO is set to TRUE. Help
ful at cascading of function blocks with EN–functionality
Input s1 Input s2 Input d IOutput ENO
INT, WORD DINT, DWORD DINT, DWORD BOOL
+ Note
D One of the two input variables s2 or d has to be assigned constant number valu
e.
Matsushita Electric Works (Europe) AG
14 – 39
Matsushita Instruction Set Basic and High--level Instructions
NAiS Control 1131
J Operands
For
s1 s2, s2 d
Relais
WX WY WR WL -
T/C
SV EV DEV x DT x
Register
LD DLD FL DFL -
DWX DWY DWR DWL DSV x x x x
DDT x
J PLC-specific information
PLC type
Block size (1 block) EEPROM start block number Number of blocks to be read / wri
tten each execution Write duration (Additional scan time) Read duration (Additio
nal scan time) Max write times Note: Power down, RUN -> PROG mode changes are al
so counted Max read times No limit
x: available - not available -:
FP0 2,7k C10/C14/C16
64 words (64x16bit) 0 to 9 1 to 2 20 ms each block Less than 1ms each block 100,
000
FP0 5k C32
64 words (64x16bit) 0 to 95 1 to 8 5 ms each block less than 1 ms each block 10,
000
FP0 10k T32CP
64 words (64x16bit) 0 to255 1 to 255 5 ms each block Less than 1ms each block 10
,000
No limit
No Limit

Example
In this example the function P13_EPWT is programmed in ladder diagram (LD) and i
nstruction list (IL). The same POU header is used for both programming languages
.POU HeaderIn the POU header, all input and output variables are declared that a
re used for programming this function.
Body When the variable start changes from FALSE to TRUE, the function is carried
out. The function reads the contents of data field[0] until data field[63] (s2*
= 1 => 1 block = 64 words) and writes the information after start block number
0 into the EEPROM.
next page
14 -- 40
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions
LD Body
IL Body
Matsushita Electric Works (Europe) AG
14 – 41
Matsushita Instruction Set Basic and High–level Instructions Steps
NAiS Control 1131
F15
Outline
Availability
All 3
(XCH)
16–bit data exchange
5
The contents in the 16–bit areas specified by d1 and d2 are exchanged if the tri
gger EN is in the ON–state.
J Data Types
Variable
d1, d2
Data Types
INT, WORD
J Operands
For
d1 d2
Relay
WX – – WY x x WR x x WL x x
T/C
SV x x EV x x DT x x
Register
LD x x x: –: FL x x
,
available not available
Example
+ Note
The variables d1 and d2 have to be of the same data type.
14 – 42
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
All 3
F16
Outline
(DXCH)
32–bit data exchange
5
Two 32–bit data specified by d1 and d2 are exchanged if the trigger EN is in the
ON–state.
J Data Types
Variable
d1, d2
Data Types
DINT, DWORD
J Operands
For
d1, d2
Relay
T/C
DEV x
Register
DDT x x: –: DLD x DFL x
DWX DWY DWR DWL DSV – x x x x
,
available not available
Example
LD F16_DXCH ST start Var_0 Var_1 out (* EN = start; Starting signal for the F16_
DXCH function. *) (* d1=Var_0 (source/destination 1) *) (* d2=Var_1 (source/dest
ination 2) *) (* option *)
+ Note
The variables d1 and d2 have to be of the same data type.
Matsushita Electric Works (Europe) AG
14 – 43
Matsushita Instruction Set Basic and High–level Instructions Steps
3
NAiS Control 1131
F17
Outline
(SWAP)
Higher/lower byte in 16–bit data exchange
Availability
All 3
The high order of 1 byte (higher 8–bit) and low order of 1 byte (lower 8–bit) of
16–bit area specified by d are exchanged if the trigger EN is in the ON–state.
1 byte means 8 bits.
J Data Types
Variable
d
Data Types
INT, WORD
J Operands
For
d
Relay
WX – WY x WR x WL x
T/C
SV x EV x DT x
Register
LD x x: –: FL x
,
available not available
Example
LD F17_SWAP ST start Var_0 out (* EN = start; Starting signal for the F17_SWAP f
unction. *) (* d = Var_0 (source/destination) *) (* Byte1Byte0 ⇒ Byte0Byte1 *) (
* optional *)
14 – 44
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
All 3
F20
Outline
(ADD)
16–bit addition
5
The 16–bit equivalent constant or 16–bit area specified by s and the 16–bit area
specified by d are added together if the trigger EN is in the ON–state. The add
ed result is stored in d.
J Data Types
Variable
s, d
Data Types
INT, WORD
J Operands
For
s d
Relay
WX x – WY x x WR x x WL x x
T/C
SV x x EV x x DT x x
Register
LD x x x: –: FL x x
,
available not available
Example
+ Note
The variables s and d have to be of the same data type.
Matsushita Electric Works (Europe) AG
14 – 45
Matsushita Instruction Set Basic and High–level Instructions Steps
NAiS Control 1131
F21
Outline
Availability
All 3
(DADD)
32–bit addition
7
The 32–bit equivalent constant or 32–bit area specified by s and the 32–bit data
specified by d are added together if the trigger EN is in the ON–state. The add
ed result is stored in d.
J Data Types
Variable
s, d
Data Types
DINT, DWORD
J Operands
For
s d
Relay
T/C
DEV x x
Register
DDT x x x: –: DLD x x DFL x x
DWX DWY DWR DWL DSV x – x x x x x x x x
,
available not available
Example
+ Note
The variables s and d have to be of the same data type.
14 – 46
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps
7
F22
Outline
(ADD2)
16–bit addition, destination can be specified
Availability
All 3
The 16–bit data or 16–bit equivalent constant specified by s1 and s2 are added t
ogether if the trigger EN is in the ON–state. The added result is stored in d.
J Data Types
Variable
s1, s2, d
Data Types
INT, WORD
J Operands
For
s1, s2 d
Relay
WX x – WY x x WR x x WL x x
T/C
SV x x EV x x DT x x
Register
LD x x x: –: FL x x
,
available not available
Example
+ Note
The variables s1, s2 and d have to be of the same data type.
Matsushita Electric Works (Europe) AG
14 – 47
Matsushita Instruction Set Basic and High–level Instructions Steps
11
NAiS Control 1131
F23
Outline
(DADD2)
32–bit addition, destination can be specified
Availability
All 3
The 32–bit data or 32–bit equivalent constant specified by s1 and s2 are added t
ogether if the trigger EN is in the ON–state. The added result is stored in d.
J Data Types
Variable
s1, s2, d
Data Types
DINT, DWORD
J Operands
For
s1, s2 d
Relay
T/C
DEV x x
Register
DDT x x x: –: DLD x x DFL x x
DWX DWY DWR DWL DSV x – x x x x x x x x
,
available not available
Example
LD F23_DADD2 start Var_0,Var_1Var_2 (* EN = start; Starting signal for the F23_D
ADD2 function. *) (* s1 = Var_0 (source1) *) (* s2 = Var_1 (source2) *) (* d = V
ar_2 (destination) *) (*s1 + s2 = d *) (* optional *)
ST
out
+ Note
The variables s1, s2 and d have to be of the same data type.
14 – 48
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
All 3
F25
Outline
(SUB)
16–bit subtraction
5
Subtracts the 16–bit equivalent constant or 16–bit area specified by s from the
16–bit area specified by d if the trigger EN is in the ON– state. The subtracted
result is stored in d (minuend area).
J Data Types
Variable
s, d
Data Types
INT, WORD
J Operands
For
s d
Relay
WX x – WY x x WR x x WL x x
T/C
SV x x EV x x DT x x
Register
LD x x x: –: FL x x
,
available not available
Example
LD F25_SUB start Var_0 Var_1 out (* EN = start; Starting signal for the F25_SUB
function. *) (* s = Var_0 (source) *) (* d = Var_1 (destination) *) (* d – s = d
*) (* optional *)
ST
+ Note
The variables s and d have to be of the same data type.
Matsushita Electric Works (Europe) AG
14 – 49
Matsushita Instruction Set Basic and High–level Instructions Steps
NAiS Control 1131
F26
Outline
Availability
All 3
(DSUB)
32–bit subtraction
7
Subtracts the 32–bit equivalent constant or 32–bit data specified by s from the
32–bit data specified by d if the trigger EN is in the ON–state. The subtracted
result is stored in d (minuend area).
J Data Types
Variable
s, d
Data Types
DINT, DWORD
J Operands
For
s d
Relay
T/C
DEV x x
Register
DDT x x x: –: DLD x x DFL x x
DWX DWY DWR DWL DSV x – x x x x x x x x
,
available not available
Example
+ Note
The variables s and d have to be of the same data type.
14 – 50
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps
7
F27
Outline
(SUB2)
16–bit subtraction, destination can be specified
Availability
All 3
Subtracts the 16–bit data or 16–bit equivalent constant specified by s2 from the
16–bit data or 16–bit equivalent constant specified by s1 if the trigger EN is
in the ON–state. The subtracted result is stored in d.
J Data Types
Variable
s1, s2, d
Data Types
INT, WORD
J Operands
For
s1, s2 d
Relay
WX x – WY x x WR x x WL x x
T/C
SV x x EV x x DT x x
Register
LD x x x: –: FL x x
,
available not available
Example
LD F27_SUB2 start Var_0,Var_1 Var_2 (* EN = start; Starting signal for the F27_S
UB2 function. *) (* s1 = Var_0 (source1) *) (* s2 = Var_1 (source2) *) (* d = Va
r_2 (destination) *) (* s1 – s2 = d *) (* optional *)
ST
out
+ Note
The variables s1, s2 and d have to be of the same data type.
Matsushita Electric Works (Europe) AG
14 – 51
Matsushita Instruction Set Basic and High–level Instructions Steps
11
NAiS Control 1131
F28
Outline
(DSUB2)
32–bit subtraction, destination can be specified
Availability
All 3
Subtracts the 32–bit data or 32–bit equivalent constant specified by s2 from the
32–bit data or 32–bit equivalent constant specified by s1 if the trigger is in
the ON–state. The subtracted result is stored in d.
J Data Types
Variable
s1, s2, d
Data Types
DINT, DWORD
J Operands
For
s1, s2 d
Relay
T/C
DEV x x
Register
DDT x x x: –: DLD x x DFL x x
DWX DWY DWR DWL DSV x – x x x x x x x x
,
available not available
Example
+ Note
The variables s1, s2 and d have to be of the same data type.
14 – 52
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps
7
F30
Outline
(MUL)
16–bit multiplication, destination can be specified
Availability
All 3
Multiplies the 16–bit data or 16–bit equivalent constant s1 and the 16–bit data
or 16–bit equivalent constant specified by s2 if the trigger EN is in the ON–sta
te. The multiplied result is stored in d (32–bit area).
J Data Types
Variable
s1, s2 d
Data Types
INT, WORD DINT, DWORD
J Operands
For
s1, s2 d
Relay
WX x WY x WR x WL x
T/C
SV x EV x DEV x DT x
Register
LD x DLD x x: –: FL x DFL x
DWX DWY DWR DWL DSV – x x x x
DDT x
,
available not available
Example
LD F30_MUL start Var_0,Var_1Var_2 (* EN = start; Starting signal for the F30_MUL
function. *) (* s1 = Var_0 (source1) *) (* s2 = Var_1 (source2) *) (* d = Var_2
(destination) *) (* s1 * s2 = d *) (* optional *)
ST
out
+ Note
The variables s1, s2 and d have to be of the same data type (INT/DINT or WORD/DW
ORD).
Matsushita Electric Works (Europe) AG
14 – 53
Matsushita Instruction Set Basic and High–level Instructions Steps
NAiS Control 1131
Availability
All 3, except FP1–C14/16 and FP–M0.9k
F31
Outline
(DMUL)
32–bit multiplication, destination can be specified
11
Multiplies the 32–bit data or 32–bit equivalent constant specified by s1 and the
one specified by s2 if the trigger EN is in the ON–state. The multiplied result
is stored in d[1], d[2] (64–bit area).
J Data Types
Variable
s1, s2 d
Data Types
DINT, DWORD ARRAY [1..2] OF DINT or DWORD
J Operands
For
s1, s2 d
Relay
T/C
DEV x x
Register
DDT x x x: –: DLD x x DFL x x
DWX DWY DWR DWL DSV x – x x x x x x x x
,
available not available
Example
POU Header
Class
0 1 2 3 VAR VAR VAR VAR
Identifier
start var_0 var_1 var_2
Type
BOOL DINT DINT ARRAY [0..1] OF DINT
Initial
FALSE 0 0 2(0)
Comment Enable signal Variable 0 Variable 1 Result of multiplication
IL Body
LD F31_DMUL start var_0,var_1,var_2 (* Load value of EN–input *) (* Execute F31_
DMUL *)
LD Body
Access to the result is possible with var_2[0] and var_2[1].
+ Note
The variables s1, s2 and d have to be of the same data type.
14 – 54
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps
7
F32
Outline
(DIV)
16–bit division, destination can be specified
Availability
All 3
The 16–bit data or 16–bit equivalent constant specified by s1 is divided by the
16–bit data or 16–bit equivalent constant specified by s2 if the trigger EN is i
n the ON–state. The quotient is stored in d and the remainder is stored in the s
pecial data register DT9015 (DT90015 for FP10/10S).
J Data Types
Variable
s1, s2, d
Data Types
INT, WORD
J Operands
For
s1, s2 d
Relay
WX x – WY x x WR x x WL x x
T/C
SV x x EV x x DT x x
Register
LD x x x: –: FL x x
,
available not available
Example
LD F32_DIV start Var_0,Var_1,Var_2 (* EN = start; Starting signal for the F32_DI
V function. *) (* s1 = Var_0 (source1) *) (* s2 = Var_1 (source2) *) (* d = Var_
2 (destination) *) (* s1 / s2 = d *) (* optional *)
ST
out
+ Note
The variables s1, s2 and d have to be of the same data type.
Matsushita Electric Works (Europe) AG
14 – 55
Matsushita Instruction Set Basic and High–level Instructions Steps
NAiS Control 1131
Availability
All 3, except FP1–C14/16 and FP–M0.9k
F33
Outline
(DDIV)
32–bit division, destination can be specified
11
The 32–bit data or 32–bit equivalent constant specified by s1 is divided by the
32–bit data or 32–bit equivalent constant specified by s2 if the trigger EN is i
n the ON–state. The quotient is stored in d and the remainder is stored in the s
pecial data registers DT9016 and DT9015 (DT90016 and DT90015 for FP10/10S).
J Data Types
Variable
s1, s2, d
Data Types
DINT, DWORD
J Operands
For
s1, s2 d
Relay
T/C
DEV x x
Register
DDT x x x: –: DLD x x DFL x x
DWX DWY DWR DWL DSV x – x x x x x x x x
,
available not available
Example
+ Note
The variables s1, s2 and d have to be of the same data type.
14 – 56
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
All 3
F35
Outline
(INC)
16–bit increment
3
Adds ”1” to the 16–bit data specified by d if the trigger EN is in the ON–state.
The added result is stored in d.
J Data Types
Variable
d
Data Types
INT, WORD
J Operands
For
d
Relay
WX – WY x WR x WL x
T/C
SV x EV x DT x
Register
LD x x: –: FL x
,
available not available
Example
LD F35_INC ST start Var_0 out (* EN = start; Starting signal for the F35_INC fun
ction. *) (* d = Var_0 (destination) *) (* d + 1 = d *) (* optional *)
Matsushita Electric Works (Europe) AG
14 – 57
Matsushita Instruction Set Basic and High–level Instructions Steps
NAiS Control 1131
Availability
All 3
F36
Outline
(DINC)
32–bit increment
3
Adds ”1” to the 32–bit data specified by d if the trigger EN is in the ON–state.
The added result is stored in d.
J Data Types
Variable
d
DataTypes
DINT, DWORD
J Operands
For
d
Relay
DWX – DWY x DWR x DWL x
T/C
DSV x DEV x DDT x
Register
DLD x x: –: DFL x available not available
,
Example
14 – 58
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
All 3
F37
Outline
(DEC)
16–bit decrement
3
Subtracts ”1” from the 16–bit data specified by d if the trigger EN is in the ON
–state. The result is stored in d.
J Data Types
Variable
d
Data Types
INT, WORD
J Operands
For
d
Relay
WX – WY x WR x WL x
T/C
SV x EV x DT x
Register
LD x x: –: FL x
,
available not available
Example
LD F37_DEC ST start Var_0 out (* EN = start; Starting signal for the F37_DEC fun
ction. *) (* d = Var_0 (destination) *) (* d – 1 = d *) (* optional *)
Matsushita Electric Works (Europe) AG
14 – 59
Matsushita Instruction Set Basic and High–level Instructions Steps
NAiS Control 1131
F38
Outline
Availability
All 3
(DDEC)
32–bit decrement
3
Subtracts ”1” to the 32–bit data specified by d if the trigger EN is in the ON–s
tate. The added result is stored in d.
J Data Types
Variable
d
Data Types
DINT, DWORD
J Operands
For
d
Relay
DWX – DWY x DWR x DWL x
T/C
DSV x DEV x DDT x
Register
DLD x x: –: DFL x available not available
,
Example
14 – 60
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
F40
Outline
(BADD)
4–digit BCD addition
5
All 3, except FP–M 0.9k
The 4–digit BCD equivalent constant or 16–bit area for 4–digit BCD data specifie
d by s and the 16–bit area for 4–digit BCD data specified by d are added togethe
r if the trigger EN is in the ON–state. The added result is stored in d.
J Data Types
Variable
s, d
Data Types
WORD
J Operands
For
s d
Relay
WX x – WY x x WR x x WL x x SV x x
T/C
EV x x DT x x
Register
LD x x x: –: FL x x available not available
,
Example
LD F40_BADD start Var_0,Var_1 (* EN = start; Starting signal for the F40_BADD fu
nction. *) (* s = Var_0 (source) *) (* d = Var_1 (destination) *) (* s + d = d *
) (* optional *)
ST
out
Matsushita Electric Works (Europe) AG
14 – 61
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
F41
Outline
Steps Availability
(DBADD)
8–digit BCD addition
7
All 3, except FP–M 0.9k
The 8–digit BCD equivalent constant or 8–digit BCD data specified by s and the 8
–digit BCD data specified by d are added together if the trigger EN is in the ON
–state. The added result is stored in d.
J Data Types
Variable
s, d
Data Types
DWORD
J Operands
For
s d
Relay
T/C
DEV x x
Register
DDT x x x: –: DLD x x DFL x x
DWX DWY DWR DWL DSV x – x x x x x x x x
,
available not available
Example
14 – 62
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
7 All 3, except FP–M 0.9k
F42
Outline
(BADD2)
4–digit BCD addition, destination can be specified
The 4–digit BCD equivalent constant or 16–bit area for 4–digit BCD data specifie
d by s1 and s2 are added together if the trigger EN is in the ON–state. The adde
d result is stored in d.
J Data Types
Variable
s1, s2, d
Data Types
WORD
J Operands
For
s1, s2 d
Relay
WX x – WY x x WR x x WL x x
T/C
SV x x EV x x DT x x
Register
LD x x x: –: FL x x
,
available not available
Example
Matsushita Electric Works (Europe) AG
14 – 63
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
F43
Outline
(DBADD2)
8–digit BCD addition, destination can be specified
Steps Availability
11 All 3, except FP–M 0.9k
The 4–digit BCD equivalent constant or 16–bit area for 4–digit BCD data specifie
d by s1 and s2 are added together if the trigger EN is in the ON–state. The adde
d result is stored in d.
J Data Types
Variable
s1, s2, d
Data Types
DWORD
J Operands
For
s1, s2 d
Relay
T/C
DEV x x
Register
DDT x x x: –: DLD x x DFL x x
DWX DWY DWR DWL DSV x – x x x x x x x x
,
available not available
Example
LD F43_DBADD2 start Var_0,Var_1Var_2 (* EN = start; Starting signal for the F43_
DBADD2 function. *) (* s1 = Var_0 (source1) *) (* s2 = Var_1 (source2) *) (* d =
Var_2 (destination) *) (* s1 + s2 = d *) (* optional *)
ST
out
14 – 64
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
F45
Outline
(BSUB)
4–digit BCD subtraction
5
All 3, except FP–M 0.9k
Subtracts the 4–digit BCD equivalent constant or 16–bit area for 4–digit BCD dat
a specified by s from the 16–bit area for 4–digit BCD data specified by d if the
trigger EN is in the ON–state. The subtracted result is stored in d.
J Data Types
Variable
s, d
Data Types
WORD
J Operands
For
s d
Relay
WX x – WY x x WR x x WL x x
T/C
SV x x EV x x DT x x
Register
LD x x x: –: FL x x
,
available not available
Example
Matsushita Electric Works (Europe) AG
14 – 65
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
F46
Outline
Steps Availability
(DBSUB)
8–digit BCD subtraction
7
All 3, except FP–M 0.9k
Subtracts the 8–digit BCD equivalent constant or 8–digit BCD data specified by s
from the 8–digit BCD data specified by d if the trigger EN is in the ON–state.
The subtracted result is stored in d.
J Data Types
Variable
s, d
Data Types
DWORD
J Operands
For
s d
Relay
WX x – WY x x WR x x WL x x
T/C
SV x x EV x x DT x x
Register
LD x x x: –: FL x x
,
available not available
Example
14 – 66
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
7 All 3, except FP–M 0.9k
F47
Outline
(BSUB2)
4–digit BCD subtraction, destination can be specified
Subtracts the 4–digit BCD equivalent constant or 16–bit area for 4–digit BCD dat
a specified by s2 from the 4–digit BCD equivalent constant or 16–bit area for 4–
digit BCD data specified by s1 if the trigger EN is in the ON–state. The subtrac
ted result is stored in d.
J Data Types
Variable
s1, s2, d
Data Types
WORD
J Operands
For
s1, s2 d
Relay
WX x – WY x x WR x x WL x x
T/C
SV x x EV x x DT x x
Register
LD x x x: –: FL x x
,
available not available
Example
LD F47_BSUB2 start Var_0,Var_1Var_2 (* EN = start; Starting signal for the F47_B
SUB2 function. *) (* s1 = Var_0 (source1) *) (* s2 = Var_1 (source2) *) (* d = V
ar_2 (destination) *) (* s1 – s2 = d *) (* optional *)
ST
out
Matsushita Electric Works (Europe) AG
14 – 67
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
F48
Outline
(DBSUB2)
8–digit BCD subtraction, destination can be specified
Steps Availability
11 All 3, except FP–M 0.9k
Subtracts the 8–digit BCD equivalent constant or 8–digit BCD data specified by s
2 from the 8–digit BCD equivalent constant or 8–digit BCD data specified by s1 i
f the trigger EN is in the ON–state. The subtracted result is stored in d.
J Data Types
Variable
s1, s2, d
Data Types
DWORD
J Operands
For
s1, s2 d
Relais
T/C
DEV x x
Register
DDT x x x: –: DLD x x DFL x x
DWX DWY DWR DWL DSV x – x x x x x x x x
,
available not available
Example
14 – 68
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
7 All 3, except FP–M 0.9k
F50
Outline
(BMUL)
4–digit BCD multiplication, destination can be specified
Multiplies the 4–digit BCD equivalent constant or 16–bit area for 4–digit BCD da
ta specified by s1 and s2 if the trigger EN is in the ON–state. The multiplied r
esult is stored in d (8–digit area).
J Data Types
Variable
s1, s2 d
Data Types
WORD DWORD
J Operands
For
s1, s2 d
Relay
WX x WY x WR x WL x
T/C
SV x EV x DEV x DT x
Register
LD x DLD x x: –: FL x DFL x
DWX DWY DWR DWL DSV – x x x x
DDT x
,
available not available
Example
LD F50_BMUL start Var_0,Var_1Var_2 (* EN = start; Starting signal for the F50_BM
UL function. *) (* s1 = Var_0 (source1) *) (* s2 = Var_1 (source2) *) (* d = Var
_2 (destination) *) (* s1 * s2 = d *) (* optional *)
ST
out
Matsushita Electric Works (Europe) AG
14 – 69
Matsushita Instruction Set Basic and High–level Instructions Steps
11
NAiS Control 1131
F51
Outline
(DBMUL)
8–digit BCD multiplication, destination can be specified
Availability
All 3, except FP–C14/16 and FP–M 0.9k
Multiplies the 8–digit BCD equivalent constant or 8–digit BCD data specified by
s1 and the one specified by s2 if the trigger EN is in the ON–state. The multipl
ied result is stored in the ARRAY d[1], d[2] (64–digit area).
J Data Types
Variable
s1, s2 d
Data Types
DWORD ARRAY [1...2] OF DWORD
J Operands
For
s1, s2 d
Relay
T/C
DEV x x
Register
DDT x x x: –: DLD x x DFL x x
DWX DWY DWR DWL DSV x – x x x x x x x x
,
available not available
Example
14 – 70
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
7 All 3, except FP–M 0.9k
F52
Outline
(BDIV)
4–digit BCD division, destination can be specified
The 4–digit BCD equivalent constant or the 16–bit area for 4–digit BCD data spec
ified by s1 is divided by the 4–digit BCD equivalent constant or the 16–bit area
for 4–digit BCD data specified by s2 if the trigger EN is in the ON–state. The
quotient is stored in the area specified by d and the remainder is stored in spe
cial data register DT9015 (DT90015 for FP0–T32CP).
J Data Types
Variable
s1, s2, d
Data Types
WORD
J Operands
For
s1, s2 d
Relay
WX x – WY x x WR x x WL x x
T/C
SV x x EV x x DT x x
Register
LD x x x: –: FL x x
,
available not available
Example
LD F52_BDIV start Var_0,Var_1 Var_2 (* EN = start; Starting signal for the F52_B
DIV function. *) (* s1 = Var_0 (source1) *) (* s2 = Var_1 (source2) *) (* d = Va
r_2 (destination) *) (* s1 / s2 = d *) (* optional *)
ST
out
Matsushita Electric Works (Europe) AG
14 – 71
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
Steps Availability
F53
Outline
(DBDIV)
8–digit BCD division, destination can be specified
11
All 3, except FP– C14/16 and FP–M 0.9k
The 8–digit BCD equivalent constant or the 8–digit BCD data specified by s1 is d
ivided by the 8–digit BCD equivalent constant or the 8–digit BCD data specified
by s2 if the trigger EN is in the ON–state. The result is stored in the areas sp
ecified by d, and the remainder is stored in the special data registers DT9016 a
nd DT9015 (DT90016 and DT90015 for FP0–T32CP).
J Data Types
Variable
s1, s2, d
Data Types
DWORD
J Operands
For
s1, s2 d
Relay
T/C
DEV x x
Register
DDT x x x: –: DLD x x DFL x x
DWX DWY DWR DWL DSV x – x x x x x x x x
,
available not available
Example
14 – 72
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
F55
Outline
(BINC)
4–digit BCD increment
3
All 3, except FP–M 0.9k
Adds ”1” to the 4–digit BCD data specified by d if the trigger EN is in the ON–s
tate. The result is stored in d.
J Data Types
Variable
d
Data Types
WORD
J Operands
For
d
Relay
WX – WY x WR x WL x
T/C
SV x EV x DT x
Register
LD x x: –: FL x
,
available not available
Example
LD F55_BINC ST start Var_0 out (* EN = start; Starting signal for the F55_BINC f
unction. *) (* d = Var_0 (destination) *) (* d + 1 = d *) (* optional *)
Matsushita Electric Works (Europe) AG
14 – 73
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
F56
Outline
Steps Availability
(DBINC)
8–digit BCD increment
3
All 3, except FP–M 0.9k
Adds ”1” to the 8–digit BCD data specified by d if the trigger EN is in the ON–s
tate. The result is stored in d.
J Data Types
Variable
d
Data Types
DWORD
J Operands
For
d
Relay
T/C
DEV x
Register
DDT x x: –: DLD x DFL x
DWX DWY DWR DWL DSV – x x x x
,
available not available
Example
14 – 74
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
F57
Outline
(BDEC)
4–digit BCD decrement
3
All 3, except FP–M 0.9k
Subtracts ”1” from the 4–digit BCD data specified by d if the trigger EN is in t
he ON–state. The result is stored in d.
J Data Types
Variable
d
Data Types
WORD
J Operands
For
d
Relay
WX – WY x WR x WL x
T/C
SV x EV x DT x
Register
LD x x: –: FL x
,
available not available
Example
LD F57_BDEC ST start Var_0 out (* EN = start; Starting signal for the F57_BDEC f
unction. *) (* d = Var_0 (destination) *) (* d – 1 = d *) (* optional *)
Matsushita Electric Works (Europe) AG
14 – 75
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
F58
Outline
Steps Availability
(DBDEC)
8–digit BCD decrement
3
All 3, except FP–M 0.9k
Subtracts ”1” from the 8–digit BCD data specified by d if the trigger EN is in t
he ON–state. The result is stored in d.
J Data Types
Variable
d
Data Types
DWORD
J Operands
For
d
Relay
T/C
DEV x
Register
DDT x x: –: DLD x DFL x
DWX DWY DWR DWL DSV – x x x x
,
available not available
Example
14 – 76
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
F60
Outline
(CMP)
16–bit data compare
5
All 3
Compares the 16–bit data specified by s1 with one specified by s2 if the trigger
EN is in the ON–state. The compare operation result is stored in special intern
al relays R9009, R900A to R900C.
Flag Data comparison between s1 and s2
s1ts2 16–bit data with sign s1=s2 s1us2 s1ts2 16–bit data without sign s1=s2 s1u
s2 R900A (uflag) OFF OFF ON # OFF # R900B (=flag) OFF ON OFF OFF ON OFF R900C (t
flag) ON OFF OFF # OFF # R9009 (carry–flag) # OFF # ON OFF OFF
#: turns ON or OFF depending on the conditions
J Data Types
Variable
s1, s2
Data Types
INT, WORD
J Operands
For
s1, s2
Relay
WX x WY x WR x WL x
T/C
SV x EV x DT x
Register
LD x x: –: FL x
,
available not available
Example
LD F60_CMP start Var_0 Var_1 out (* EN = start; Starting signal for the F60_CMP
function. *) (* s1 = Var_0 (source1) *) (* s2 = Var_1 (source2) *) (* s1 < s2; s
1 = s2; s1 > s2 ? *) (* optional *)
ST
+ Note
The variables s1 and s2 have to be of the same data type.
Matsushita Electric Works (Europe) AG
14 – 77
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
F61
Outline
Steps Availability
(DCMP)
32–bit data compare
9
All 3
Compares the 32–bit data or 32–bit equivalent constant specified by s1 with one
specified by s2 if the trigger EN is in the ON–state. The compare operation resu
lt is stored in special internal relays R9009, R900A to R900C.
Flag Data comparison between s1 and s2
s1ts2 32–bit data with sign s1=s2 s1us2 s1ts2 32–bit data without sign s1=s2 s1u
s2 R900A (uflag) OFF OFF ON # OFF # R900B (=flag) OFF ON OFF OFF ON OFF R900C (t
flag) ON OFF OFF # OFF # R9009 (carry–flag) # OFF # ON OFF OFF
#: turns ON or OFF depending on the conditions
J Data Types
Variable
s1, s2
Data Types
DINT, DWORD
J Operands
For
s1, s2
Relay
T/C
DEV x
Register
DDT x x: –: DLD x DFL x
DWX DWY DWR DWL DSV x x x x x
,
available not available
Example
+ Note
The variables s1 and s2 have to be of the same data type.
14 – 78
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
F62
Outline
(WIN)
16–bit data band compare
7
All 3
Compares the 16–bit equivalent constant or 16–bit data specified by s1 with the
data band specified by s2 and s3, if the trigger EN is in the ON–state. This ins
truction checks that s1 is in the data band between s2 (lower limit) and s3 (hig
her limit), larger than s3, or smaller than s2. The compare operation considers
+/– sign. Since the BCD data is also treated as 16–bit data with sign, we recomm
end the use of the BCD data within the range of 0 to 7999 to avoid confusion. Th
e compare operation result is stored in special internal relays R900A, R900B, an
d R900C.
Flag Comparison between s1 , s2 and s3
s1ts2 s2xs1xs3 s1us3 R900A (uflag) OFF OFF ON R900B (=flag) OFF ON OFF R900C (tf
lag) ON OFF OFF
J Data Types
Variable
s1, s2, s3
Data Types
INT, WORD
J Operands
For
s1, s2, s3
Relay
WX x WY x WR x WL x
T/C
SV x EV x DT x
Register
LD x x: –: FL x
,
available not available
Example
LD F62_WIN start Var_0,Var_1 Var_2 (* EN = start; Starting signal for the F62_WI
N function. *) (* s1 = Var_0 (source1) *) (* s2 = Var_1 (source2) *) (* s3 = Var
_2 (source3) *) (* s1 < s2; s2 ≤ s1 ≤ s3; s3 < s1; ? *) (* optional *)
ST
out
+ Note
The variables s1, s2 and s3 have to be of the same data type.
Matsushita Electric Works (Europe) AG
14 – 79
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
F63
Outline
Steps Availability
(DWIN)
32–bit data band compare
13
All 3
Compares the 32–bit equivalent constant or 32–bit data specified by s1 with the
data band specified by s2 and s3, if the trigger EN is in the ON–state. This ins
truction checks that s1 is in the data band between s2 (lower limit) and s3 (hig
her limit), larger than s3, or smaller than s2. The compare operation considers
+/– sign. Since the BCD data is also treated as 16–bit data with sign, we recomm
end the use of the BCD data within the range of 0 to 79999999 to avoid confusion
. The compare operation result is stored in special internal relays R900A, R900B
, and R900C.
Flag Comparison between s1 , s2 and s3
s1ts2 s2xs1xs3 s1us3 R900A (uflag) OFF OFF ON R900B (=flag) OFF ON OFF R900C (tf
lag) ON OFF OFF
J Data Types
Variable
s1, s2, s3
Data Types
DINT, DWORD
J Operands
For
s1, s2, s3
Relay
T/C
DEV x
Register
DDT x x: –: DLD x DFL x
DWX DWY DWR DWL DSV x x x x x
,
available not available
Example
+ Note
The variables s1, s2 and s3 have to be of the same data type.
14 – 80
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
All 3, except FP– C14/16 and FP–M 0.9k
F64
Outline
(BCMP)
Block data compare
7
Compares the contents of data block specified by s2 with the contents of data bl
ock specified by s3 according to the contents specified by s1 if the trigger EN
is in the ON–state. The compare operation result is stored in the special intern
al relay R900B. When s2 = s3, the special internal relay is in the ON–state.
J Data Types
Variable
s1 s2, s3
Data Types
WORD INT, WORD
J Operands
For
s1 s2, s3
Relay
WX x x WY x x WR x x WL x x
T/C
SV x x EV x x DT x x
Register
LD x x x: –: FL x x
,
available not available
Example
s1= 1 ⇑ A 0 ⇑ B 04 ⇑ C hex A = Starting byte position of data block specified by
s3 1: Starting from higher byte 0: Starting from lower byte B = Starting byte p
osition of data block specified by s2 1: Starting from higher byte 0: Starting f
rom lower byte C = Number of bytes to be compared range: 01 hex to 99 hex (BCD)
,
Example
LD F64_BCMP start Var_0,Var_1 Var_2 out (* EN = start; Starting signal for the F
64_BCMP function. *) (* s1 = Var_0 (source1) *) (* s2 = Var_1 (source2) *) (* s3
= Var_2 (source3) *) (* optional *)
ST
+ Note
The variables s2 and s3 have to be of the same data type.
Matsushita Electric Works (Europe) AG
14 – 81
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
F65
Outline
Steps Availability
(WAN)
16–bit data AND
7
All 3
Executes AND operation of each bit in 16–bit equivalent constant or 16–bit data
specified by s1 and s2 if the trigger EN is in the ON–state. The AND operation r
esult is stored in the 16–bit area specified by d. When 16–bit equivalent consta
nt is specified by s1 or s2, the AND operation is performed internally convertin
g it to 16–bit binary expression. You can use this instruction to turn OFF certa
in bits of the 16–bit data.
J Data Types
Variable
s1, s2, d
Data Types
INT, WORD
J Operands
For
s1, s2 d
Relay
WX x – WY x x WR x x WL x x
T/C
SV x x EV x x DT x x
Register
LD x x x: –: FL x x
,
available not available
Example
+ Note
The variables s1, s2 and d have to be of the same data type.
14 – 82
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
F66
Outline
(WOR)
16–bit data OR
7
All 3
Executes OR operation of each bit in 16–bit equivalent constant or 16–bit data s
pecified by s1 and s2 if the trigger EN is in the ON–state. The OR operation res
ult is stored in the 16–bit area specified by d. When 16–bit equivalent constant
is specified by s1 or s2, the OR operation is performed internally converting i
t to 16–bit binary expression. You can use this instruction to turn ON certain b
its of the 16–bit data.
J Data Types
Variable
s1, s2, d
Data Types
INT, WORD
J Operands
For
s1, s2 d
Relay
WX x – WY x x WR x x WL x x
T/C
SV x x EV x x DT x x
Register
LD x x x: –: FL x x
,
available not available
Example
LD F66_WOR start Var_0,Var_1 Var_2 (* EN = start; Starting signal for the F66_WO
R function. *) (* s1 = Var_0 (source1) *) (* s2 = Var_1 (source2) *) (* d = Var_
2 (destination) *) (* s1 ODER s2 = d *) (* optional *)
ST
out
+ Note
The variables s1, s2 and d have to be of the same data type.
Matsushita Electric Works (Europe) AG
14 – 83
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
F67
Outline
Steps Availability
(XOR)
16–bit data exclusive OR
7
All 3
Executes exclusive OR operation of each bit in 16–bit equivalent constant or 16–
bit data specified by s1 and s2 if the trigger EN is in the ON–state. The exclus
ive OR operation result is stored in the 16–bit area specified by d. When 16–bit
equivalent constant is specified by s1 or s2, the exclusive OR operation is per
formed internally converting it to 16–bit binary expression.You can use this ins
truction to review the number of identical bits in the two 16–bit data.
J Data Types
Variable
s1, s2, d
Data Types
INT, WORD
J Operands
For
s1, s2 d
Relay
WX x – WY x x WR x x WL x x
T/C
SV x x EV x x DT x x
Register
LD x x x: –: FL x x
,
available not available
Example
LD F67_XOR start Var_0,Var_1 Var_2 (* EN = start; Starting signal for the F67_XO
R function. *) (* s1 = Var_0 (source1) *) (* s2 = Var_1 (source2) *) (* d = Var_
2 (destination) *) (* s1 XOR s2 = d *) (* optional *)
ST
out
+ Note
The variables s1, s2 and d have to be of the same data type.
14 – 84
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
F68
Outline
(XNR)
16–bit data exclusive NOR
7
All 3
Executes exclusive NOR operation of each bit in 16–bit equivalent constant or 16
–bit data specified by s1 and s2 if the trigger EN is in the ON–state. The exclu
sive NOR operation result is stored in the 16–bit area specified by d. When 16–b
it equivalent constant is specified by s1 or s2, the exclusive NOR operation is
performed internally converting it to 16–bit binary expression. You can use this
instruction to review the number of identical bits in the two 16–bit data.
J Data Types
Variable
s1, s2, d
Data Types
INT, WORD
J Operands
For
s1, s2 d
Relay
WX x – WY x x WR x x WL x x
T/C
SV x x EV x x DT x x
Register
LD x x x: –: FL x x
,
available not available
Example
+ Note
The variables s1, s2 and d have to be of the same data type.
Matsushita Electric Works (Europe) AG
14 – 85
Matsushita Instruction Set Basic and High–level Instructions Steps
NAiS Control 1131
Availability
All 3, except FP1– C14/16 and FP–M 0.9k
F70
Outline
(BCC)
Block check code calculation
9
Calculates the Block Check Code (BCC) of s3 bytes of ASCII data starting from th
e 16–bit area specified by s2 according to s1 if the trigger EN is in the ON–sta
te. The Block Check Code (BCC) is stored in the lower byte of the 16–bit area sp
ecified by d. s1 specifies the Block Check Code (BCC) calculation method using d
ecimal data as follows: 0: Addition 1: Subtraction 2: Exclusive OR operation 10:
Cyclic Redundancy Check (CRC) calculation (only FH10SH from version 3.02 onward
s)
Variable
s1, s3 s2, d
J Data Types
Data Types
INT INT, WORD
J Operands
For
s1, s3 s2 d
Relay
WX x x – WY x x x WR x x x WL x x x
T/C
SV x x x EV x x x DT x x x
Register
LD x x x x: –: FL x x x
,
Example
LD F70_BCC start Var_0,Var_1Var_2, Var_3
available not available
ST
out
(* EN = start; Starting signal for the F70_BCC function. *) (* s1 = Var_0 (sourc
e) *) (* (0 = ADD, 1 = SUB, 2 = XOR) *) (* Content e.g. 2 *) (* s2 = Var_1 (sour
ce) *) (* s3 = Var_2 (source) *) (* Content e.g. 12 *) (* d = Var_3 (destination
) *) (* optional *)
Calculates the Block Check Code (BCC) of 12 bytes of ASCII data starting with th
e content of Var_1 by exclusive OR operation if the trigger start is in the ON–s
tate. The Block Check Code (BCC) is stored in the lower byte of Var_3.
+ Note
14 – 86
The variables s2 and d have to be of the same data type.
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
All 3, except FP1– C14/16 and FP–M 0.9k
F71
Outline
(HEX2A)
HEX  ASCII conversion
7
Converts the data of s2 bytes starting from the 16–bit area specified by s1 to A
SCII codes that express the equivalent hexadecimals if the trigger EN is in the
ON–state. The number of bytes to be converted is specified by s2. The converted
result is stored in the area starting with the 16–bit area specified by d. ASCII
code requires 8 bits (one byte) to express one hexadecimal character. Upon conv
ersion to ASCII, the data length will thus be twice the length of the source dat
a.
J Data Types
Variable
s1 s2 d
Data Types
INT, WORD INT WORD
J Operands
For
s1 s2 d
Relay
WX x x – WY x x x WR x x x WL x x x
T/C
SV x x x EV x x x DT x x x
Register
LD x x x x: –: FL x x x
,
available not available
Example
Matsushita Electric Works (Europe) AG
14 – 87
Matsushita Instruction Set Basic and High–level Instructions Steps
NAiS Control 1131
Availability
All 3, except FP1– C14/16 and FP–M 0.9k
F72
Outline
(A2HEX)
ASCII  HEX conversion
7
Converts the ASCII codes that express the hexadecimal characters starting from t
he 16–bit area specified by s1 to hexadecimal numbers if the trigger EN is in th
e ON–state. s2 specifies the number of ASCII (number of characters) to be conver
ted. The converted result is stored in the area starting from the 16–bit area sp
ecified by d. ASCII code requires 8 bits (one byte) to express one hexadecimal c
haracter. Upon conversion to a hexadecimal number, the data length will thus be
half the length of the ASCII code source data.
J Data Types
Variable
s1 s2 d
Data Types
WORD INT INT, WORD
J Operands
For
s1 s2 d
Relay
WX x x – WY x x x WR x x x WL x x x
T/C
SV x x x EV x x x DT x x x
Register
LD x x x x: –: FL x x x
,
available not available
Example
LD F72_A2HEX start Var_0,Var_1Var_2 (* EN = start; Starting signal for the F72_A
2HEX function. *) (* s1 = Var_0 (source1) *) (* s2 = Var_1 (source2) *) (* Conte
nt e.g. 4 *) (* d = Var_2 (destination) *) (* optional *)
ST
out
Converts 4 ASCII codes starting with the content of Var_0 to hexadecimal numbers
if the trigger start is in the ON–state. The converted data is stored in Var_2.
14 – 88
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
F73
Outline
(BCD2A)
BCD  ASCII conversion
7
All 3, except FP1– C14/16 and FP–M 0.9k
Converts the BCD code starting from the 16–bit area specified by s1 to the ASCII
code that expresses the equivalent decimals according to the contents specified
by s2 if the trigger EN is in the ON–state. s2 specifies the number of source d
ata bytes and the direction of converted data (normal/reverse).
S2 = 16# j 0 0 j
1
Number of bytes for BCD data 1: 1 byte (BCD code that expresses a 2-digit decima
l) 2: 2 byte (BCD code that expresses a 4-digit decimal) 3: 3 byte (BCD code tha
t expresses a 6-digit decimal) 4: 4 byte (BCD code that expresses a 8-digit deci
mal)
2
Direction of converted data 0: Normal direction 1: Reverse direction
The converted result is stored in the area specified by d. ASCII code requires 8
bits (one byte) to express one BCD character. Upon conversion to ASCII, the dat
a length will thus be twice the length of the BCD source data. J Data Types
Variable
s1 s2 d
Data Types
WORD INT, WORD WORD, ARRAY OF WORD
J Operands
For
s1 s2 d
Relay
WX x x – WY x x x WR x x x WL x x x
T/C
SV x x x EV x x x DT x x x
Register
LD x x x x: –: FL x x x
,
Example
available not available
Matsushita Electric Works (Europe) AG
14 – 89
Matsushita Instruction Set Basic and High–level Instructions Steps
NAiS Control 1131
Availability
All 3, except FP1– C14/16 and FP–M 0.9k
F74
Outline
(A2BCD)
ASCII  BCD conversion
9
Converts the ASCII codes that express the decimal characters starting from the s
pecified by s1 to BCD if the trigger EN is in the ON–state. s2 specifies the num
ber of source data bytes and the direction of converted code source data.
S2 = 16# j 0 0 j
1
Number of bytes for ASCII character 1: 1 byte (1 ASCII character) 2: 2 byte (2 A
SCII characters) 3: 3 byte (3 ASCII characters) 4: 4 byte (4 ASCII characters) 5
: 5 byte (5 ASCII characters) 6: 6 byte (6 ASCII characters) 7: 7 byte (7 ASCII
characters) 8: 8 byte (8 ASCII characters)
2
Direction converted data 0: Normal direction 1: Reverse direction
The converted result is stored in the area starting from the 16–bit area specifi
ed by d. ASCII code requires 8 bits (1 byte) to express 1 BCD character. Upon co
nversion to a BCD number, the data length will thus be half the length of the AS
CII code source data. J Data Types
Variable
s1 s2 d
Data Types
WORD, ARRAY OF WORD INT, WORD WORD
J Operands
For
s1 s2 d
Relay
WX x x – WY x x x WR x x x WL x x x
T/C
SV x x x EV x x x DT x x x
Register
LD x x x x: –: FL x x x
available not available
* next page
14 – 90
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions
,
Example
LD F74_A2BCD start Var_0,Var_1Var_2 (* EN = start; Starting signal for the F74_A
2BCD function. *) (* s1 = Var_0 (source1) *) (* s2 = Var_1 (source2) *) (* Conte
nt e.g. 16#0004 *) (* d = Var_2 (destination) *) (* optional *)
ST
out
Converts 4 ASCII codes in normal direction starting with the content of Var_0 to
BCD data if the trigger start is in the ON–state. The converted data is stored
in Var_2.
Matsushita Electric Works (Europe) AG
14 – 91
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
Steps Availability
F75
Outline
(BIN2A)
16–bit BIN  ASCII conversion
7
All 3, except FP1– C14/16 and FP–M 0.9k
Converts the 16–bit data specified by s1 to ASCII codes that express the equival
ent decimals if the trigger EN is in the ON–state. s2 specifies the length in by
tes. The converted result is stored in the area starting from the 16–bit area sp
ecified by d. In the destination area d, the data are stored starting with the h
ighest byte and the digit order of the source data s1 is reversed. When data is
stored, a sign data is added at the head (–: 2DH; +: omitted) and unused destina
tion area d is filled with SPACE (20H).
J Data Types
Variable
s1 s2 d
Data Types
INT, WORD INT WORD
J Operands
For
s1, s2 d
Relay
WX x – WY x x WR x x WL x x
T/C
SV x x EV x x DT x x
Register
LD x x x: –: FL x x
,
available not available
Example
LD F75_BIN2A start Var_0,Var_1Var_2 (* EN = start; Starting signal for the F75_B
IN2A function. *) (* s1 = Var_0 (source1) *) (* s2 = Var_1 (source2) *) (* Conte
nt e.g. 4 *) (* d = Var_2 (destination) *) (* optional *)
ST
out
Converts the 16–bit data stored in Var_0 to 4 ASCII characters that express the
equivalent decimals if the trigger start is in the ON–state. The converted data
is stored starting with Var_2.
14 – 92
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
F76
Outline
(A2BIN)
ASCII  16–bit BIN conversion
7
All 3, except FP1– C14/16 and FP–M 0.9k
Converts the ASCII codes that express the decimal characters starting from the 1
6–bit area specified by s1 to 16–bit data if the trigger EN is in the ON–state.
s2 specifies the number of source data bytes to be converted using a decimal num
ber. The converted result is stored in the area specified by d. The digital orde
r of the source data is reversed and converted to 16–bit data.
J Data Types
Variable
s1 s2 d
Data Types
WORD INT INT, WORD
J Operands
For
s1 s2 d
Relay
WX x x – WY x x x WR x x x WL x x x
T/C
SV x x x EV x x x DT x x x
Register
LD x x x x: –: FL x x x
,
available not available
Example
Matsushita Electric Works (Europe) AG
14 – 93
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
Steps Availability
F77
Outline
(DBIN2A)
32–bit BIN  ASCII conversion
11
All 3, except FP1– C14/16 and FP–M 0.9k
Converts the 32–bit data specified by s1 to ASCII codes that express the equival
ent decimals if the trigger EN is in the ON–state. s2 specifies the number of by
tes used to express the destination data using decimal. The converted result is
stored in d. In the destination area d, the data are stored starting from the hi
ghest byte and the digit order of the source data s1 is reversed. When data is s
tored, a sign data is added at the head (–: 2DH; +: omitted) and unused destinat
ion area d is filled with SPACE (20H).
J Data Types
Variable
s1 s2 d
Data Types
DINT, DWORD INT WORD
J Operands
For
s1 s2 d
Relay
T/C
DEV x EV x x
Register
DDT x DT x x x: –: DLD x LD x x DFL x FL x x
DWX DWY DWR DWL DSV x WX x – x WY x x x WR x x x WL x x x SV x x
,
Example
LD F77_ DBIN2A start Var_0,Var_1Var_2
available not available
ST
out
(* EN = start; Starting signal for the F77_DBIN2A function. *) (* s1 = Var_0 (so
urce1) *) (* s2 = Var_1 (source2) *) (* Content e.g. 10 *) (* d = Var_2 (destina
tion) *) (* optional *)
Converts the 32–bit data starting with the content of Var_0 to 10 ASCII characte
rs that express the equivalent decimals if the trigger start is in the ON– state
. The converted data is stored starting with Var_2. If destination area is great
er than necessary (10 characters, necessary are 8 characters) the unused destina
tion area is filled with ASCII character 20H (SPACE). After execution Var_2 cont
ains 2020 H.
14 – 94
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions
F78
Outline
(DA2BIN)
ASCII  32–bit BIN conversion
Steps
11
Availability
All 3, except FP1– C14/16 and FP–M 0.9k
Converts the ASCII codes that express the decimal characters starting with the 1
6–bit area specified by s1 to 32–bit data if the trigger EN is in the ON–state.
s2 specifies the number of source data bytes to be converted. The converted resu
lt is stored in d. You can add a sign to ASCII codes. When data is plus, the sig
n can be omitted.
J Data Types
Variable
s1 s2 d
Data Types
WORD INT DINT, DWORD
J Operands
For
s1 s2 d
Relay
WX x x WY x x WR x x WL x x
T/C
SV x x EV x x DEV x DT x x
Register
LD x x DLD x x: –: FL x x DFL x
DWX DWY DWR DWL DSV – x x x x
DDT x
,
Example
available not available
Matsushita Electric Works (Europe) AG
14 – 95
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
F80 (BCD)
Outline
16–bit BIN  4–digit BCD conversion
Steps Availability
5 All 3
Converts the 16–bit binary data specified by s to the BCD code that expresses 4–
digit decimals if the trigger EN is in the ON–state. The converted data is store
d in d. The binary data that can be converted to BCD code are in the range of 0
(0 hex) to 9,999 (270F hex).
J Data Types
Variable
s d
Data Types
INT, WORD INT
J Operands
For
s d
Relay
WX x – WY x x WR x x WL x x
T/C
SV x x EV x x DT x x
Register
LD x x x: –: FL x x
,
available not available
Example
LD F80_BCD ST start Var_0, Var_1 out (* EN = start; Starting signal for the F80_
BCD function. *) (* s = Var_0 (source) *) (* d = Var_1 (destination) *) (* optio
nal *)
14 – 96
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
5 All 3
F81
Outline
(BIN)
4–digit BCD " 16–bit BIN conversion
Converts the BCD code that expresses 4–digit decimals specified by s to 16–bit b
inary data if the trigger EN is in the ON–state. The converted result is stored
in the area specified by d.
J Data Types
Variable
s d
Data Types
WORD INT, WORD
J Operands
For
s d
Relay
WX x – WY x x WR x x WL x x
T/C
SV x x EV x x DT x x
Register
LD x x x: –: FL x x
,
available not available
Example
Matsushita Electric Works (Europe) AG
14 – 97
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
F82
Outline
(BCD)
32–bit BIN " 8–digit BCD conversion
Steps Availability
7 All 3
Converts the 32–bit binary data specified by s to the BCD code that expresses 8–
digit decimals if the trigger EN is in the ON–state. The converted result is sto
red in the area specified by d. The binary data that can be converted to BCD cod
e are in the range of 0 (0 hex) to 99,999,999 (5F5E0FF hex).
J Data Types
Variable
s d
Data Types
DINT, DWORD DWORD
J Operands
For
s d
Relay
T/C
DEV x x
Register
DDT x x x: –: DLD x x DFL x x
DWX DWY DWR DWL DSV x – x x x x x x x x
,
Example
LD F82_DBCD ST start Var_0,Var_1 out
available not available
(* EN = start; Starting signal for the F82_DBCD function. *) (* s = Var_0 (sourc
e) *) (* d = Var_1 (destination) *) (* optional *)
14 – 98
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions
F83
Outline
(DBIN)
8–digit BCD " 32–bit BIN conversion
Steps Availability
7 All 3
Converts the BCD code that expresses 8–digit decimals specified by s to 32–bit b
inary data if the trigger EN is in the ON–state. The converted result is stored
in the area specified by d.
J Data Types
Variable
s d
Data Types
DWORD DINT, DWORD
J Operands
For
s d
Relay
T/C
DEV x x
Register
DDT x x x: –: DLD x x DFL x x
DWX DWY DWR DWL DSV x – x x x x x x x x
,
Example
available not available
Matsushita Electric Works (Europe) AG
14 – 99
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
F84
Outline
(INV)
16–bit data invert (one’s complement)
Steps Availability
3 All 3
Inverts each bit (0 or 1) of the 16–bit data specified by d if the trigger EN is
in the ON–state. The inverted result is stored in the 16–bit area specified by
d. This instruction is useful for controlling an external device that uses negat
ive logic operation.
J Data Types
Variable
d
Data Types
INT, WORD
J Operands
For
d
Relay
WX – WY x WR x WL x
T/C
SV x EV x DT x
Register
LD x x: –: FL x
,
available not available
Example
14 – 100
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
F85
Outline
(NEG)
16–bit data two’s complement
3
All 3
Gets the two’s complement of 16–bit data specified by d if the trigger EN is in
the ON–state. The two’s complement of the original 16–bit data is stored in d. T
wo’s complement: A number system used to express positive and negative numbers i
n binary. In this system, the number becomes negative if the most significant bi
t (MSB) of data is 1. The two’s complement is obtained by inverting all bits and
adding 1 to the inverted result. This instruction is useful for inverting the s
ign of 16–bit data from positive to negative or from negative to positive.
J Data Types
Variable
d
Data Types
INT, WORD
J Operands
For
d
Relay
WX – WY x WR x WL x
T/C
SV x EV x DT x
Register
LD x x: –: FL x
,
available not available
Example
LD F85_NEG ST start Var_0 out (* EN = start; Starting signal for the F85_NEG fun
ction. *) (* d = Var_0 (destination) *) (* optional *)
Matsushita Electric Works (Europe) AG
14 – 101
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
F86
Outline
Steps Availability
(DNEG)
32–bit data two’s complement
3
All 3
Gets the two’s complement of 32–bit data specified by d if the trigger EN is in
the ON–state. The two’s complement of the original 32–bit data is stored in d. T
wo’s complement: A number system used to express positive and negative numbers i
n binary. In this system, the number becomes negative if the most significant bi
t (MSB) of data is 1. The two’s complement is obtained by inverting all bits and
adding 1 to the inverted result. This instruction is useful for inverting the s
ign of 16–bit data from positive to negative or from negative to positive.
J Data Types
Variable
d
Data Types
DINT, DWORD
J Operands
For
d
Relay
T/C
DEV x
Register
DDT x x: –: DLD x DFL x
DWX DWY DWR DWL DSV – x x x x
,
available not available
Example
14 – 102
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
F87
Outline
(ABS)
16–bit data absolute value
3
All 3
Gets the absolute value of 16–bit data with the sign specified by d if the trigg
er EN is in the ON–state. The absolute value of the 16–bit data with +/– sign is
stored in d. This instruction is useful to operate the data whose sign (+/–) ma
y vary.
J Data Types
Variable
d
Data Types
INT, WORD
J Operands
For
d
Relay
WX – WY x WR x WL x
T/C
SV x EV x DT x
Register
LD x x: –: FL x
,
available not available
Example
LD F87_ABS ST start Var_0 out (* EN = start; Starting signal for the F87_ABS fun
ction. *) (* d = Var_0 (destination) *) (* optional *)
Matsushita Electric Works (Europe) AG
14 – 103
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
F88
Outline
(DABS)
Steps Availability
32–bit data absolute value
3
All 3
Gets the absolute value of 32–bit data with the sign specified by d if the trigg
er EN is in the ON–state. The absolute value of the 32–bit data with sign is sto
red in d. This instruction is useful to operate the data whose sign (+/–) may va
ry.
J Data Types
Variable
d
Data Types
DINT, DWORD
J Operands
For
d
Relay
T/C
DEV x
Register
DDT x x: –: DLD x DFL x
DWX DWY DWR DWL DSV – x x x x
,
Example
available not available
14 – 104
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
F89
Outline
(EXT)
16–bit data sign extension
3
All 3
F89 copies the sign bit of the specified 16–bit data to all the bits of the high
er 16–bit area (extended 16–bit area).
J Data Types
Variables
s d
Data Types
BOOL, INT DINT
J Operands
For
s d
Relay
WX – WY x WR x WL x
T/C
SV x EV x DEV x DT x
Register
LD x DLD x x: –: FL x DFL x
DWX DWY DWR DWL DSV – x x x x
DDT x
,
Example
available not available
Sign bit (0: positive, 1: negative)
Destination
DT0 Bit position 15   1211   8 7   4 3   0 Binary data 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 0 K–2 R20: ON
Decimal data
Destination
DT1 DT0 Bit position 15   1211   8 7   4 3   0 15   1211   8 7   4
3   0 Binary data 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 0
Decimal data
K–2 Higher 16-bit area (extended 16-bit area) Lower 16-bit area
Matsushita Electric Works (Europe) AG
14 – 105
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
F90
Outline
Steps Availability
(DECO)
Decode
7
All 3
Decodes the contents of 16–bit data specified by s according to the contents of
n if the trigger EN is in the ON–state. The decoded result is stored in the area
starting with the 16–bit area specified by d. n specifies the starting bit posi
tion and the number of bits to be decoded using hexadecimal data: Bit No. 0 to 3
: number of bits to be decoded Bit No. 8 to 11: starting bit position to be deco
ded (The bits No. 4 through No. 7 and No. 12 through No. 15 are invalid.) Relati
onship between number of bits and occupied data area for decoded result:
Number of bits to be decoded
1 2 3 4 5 6 7 8
Data area required for the result
1-word 1-word 1-word 1-word 2-word 4-word 8-word 16-word
Valid bits in the area for the result
2-bit* 4-bit* 8-bit* 16-bit 32-bit 64-bit 128-bit 256-bit
*Invalid bits in the data area required for the result are set to 0.
J Data Types
Variable
s, n, d
Data Types
INT, WORD
J Operands
For
s, n d
Relay
WX x – WY x x WR x x WL x x
T/C
SV x x EV x x DT x x
Register
LD x x x: –: FL x x
available not available
* next page
14 – 106
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions
,
Example
+ Note
The variables s, n and d have to be of the same data type.
Matsushita Electric Works (Europe) AG
14 – 107
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
F91
Outline
(SEGT)
Steps Availability
16–bit data 7–segment decode
5
All 3
Converts the 16–bit equivalent constant or 16–bit data specified by s to 4–digit
data for 7–segment indication if the trigger EN is in the ON–state. The convert
ed data is stored in the area starting with the 16–bit area specified by d. The
data for 7–segment indication occupies 8 bits (1 byte) to express 1 digit. 7–seg
ment conversion table:
One digit data to be converted
Hexadecimal H0 H1 H2 H3 H4 H5 H6 H7 H8 H9 HA HB HC HD HE HF Binary 0000 0001 001
0 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111
8-bit data for 7-segment indication
0011 0000 0101 0100 0110 0110 0111 0010 0111 0110 0111 0111 0011 0101 0111 0111
Organization 7-segment of 7-segment indication indication gfedcba
1111 0110 0011 1111 0110 1101 1101
a f g b c d
0111 1111 1111 0111 1100 1000 1110 1001 0001
e
J Data Types
Variable
s d
Data Types
INT, WORD DINT, DWORD
* next page
14 – 108
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions
J Operands
For
s d – x x x x x x x: –: x x
Relay
WX x WY x WR x WL x
T/C
SV x EV x DEV DT x
Register
LD x DLD FL x DFL
DWX DWY DWR DWL DSV
DDT
,
available not available
Example
LD F91_SEGT ST start Var_0,Var_1 out (* EN = start; Starting signal for the F91_
SEGT function. *) (* s = Var_0 (source) *) (* d = Var_1 (destination) *) (* opti
onal *)
Matsushita Electric Works (Europe) AG
14 – 109
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
Steps Availability
F92
Outline
(ENCO)
Encode
7
All 3
Encodes the contents of data specified by s according to the contents of n if th
e trigger EN is in the ON–state. The encoded result is stored in the 16–bit area
specified by d starting with the specified bit position. Invalid bits in the ar
ea specified for the encoded result are set to 0. n specifies the starting bit p
osition of destination data d and the number of bits to be decoded using hexadec
imal data: Bit No. 0 to 3: number of bits to be encoded Bit No. 8 to 11: startin
g bit position of destination data to be encoded (The bits No. 4 through No. 7 a
nd No. 12 through No. 15 are invalid.)
J Data Types
Variable
s, n, d
Data Types
INT, WORD
J Operands
For
s n d
Relay
WX x x – WY x x x WR x x x WL x x x
T/C
SV x x x EV x x x DT x x x
Register
LD x x x x: –: FL x x x
,
available not available
Example
+ Note
The variables s, n and d have to be of the same data type.
14 – 110
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
F93
Outline
(UNIT)
16–bit data combine
7
All 3
Extracts each lower 4 bits (bit position 0 to 3) starting with the 16–bit area s
pecified by s and combines the extracted data into 1 word if the trigger EN is i
n the ON–state.. The result is stored in the 16–bit area specified by d. n speci
fies the number of data to be extracted The range of n is 0 to 4. The programmin
g example provided below can be envisioned thus:
Source
Bit position 15  Array[0] at s Array[1] at s Array[2] at s  12 11  87  43
 0 0000000000000001 0000000000000010 0000000000000100 start: ON

Destination
Bit position 15  value at d  12 11  87  43  0 0000010000100001 Bit posit
ions 12 to 15 are filled with 0s.
J Data Types
Variable
s, d n
Data Types
WORD INT
J Operands
For
s n d
Relay
WX x x – WY x x x WR x x x WL x x x
T/C
SV x x x EV x x x DT x x x
Register
LD x x x x: –: FL x x x
,
available not available
Example
In this example the function F93_UNIT is programmed in ladder diagram (LD) and i
nstruction list (IL). The same POU header is used for both programming languages
.
Matsushita Electric Works (Europe) AG
14 – 111
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
POU Header In the POU header, all input and output variables are declared that a
re used for programming this function.
Body When the variable start is set to TRUE, the function is carried out. The bi
nary values in the illustration on the previous page serve as the array values i
n data_input. In this example, variables are declared in the POU header. However
, you may assign constants directly at the input function’s contact pins instead
. LD Body In this example, the view icon was activated so you can see the result
s immediately.
IL Body
+ Note
The following error flags apply to F/P93:
No.
R9007 R9008
IEC Address
%MX0.900.7 %MX0.900.8
set
permanently for an instant
if
–the area specified using the index modifier exceeds the limit –the value at n w
5
14 – 112
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
F94
Outline
(DIST)
16–bit data distribution
7
All 3
Divides the 16–bit data specified by s into 4–bit units and distributes the divi
ded data into the lower 4 bits (bit position 0 to 3) of 16–bit areas starting wi
th d if the trigger EN is in the ON–state. n specifies the number of data to be
divided. The range of n is 0 to 4). When 0 is specified by n, this instruction i
s not executed. The programming example provided below can be envisioned thus:
Source
Bit position 15  value at s  12 11 
n: 4
87  43  0
0111001100010000
X0: ON
Destination
Bit position 15  Array[0] at d Array[1] at d Array[2] at d Array[3] at d  12 1
1  87  43  0 0000000000000000 0000000000000001 0000000000000011 0000000000
000 111
J Data Types
Variable
s, d n
Data Types
WORD INT
J Operands
For
s, n d
Relay
WX x – WY x x WR x x WL x x
T/C
SV x x EV x x DT x x
Register
LD x x x: –: FL x x
,
available not available
Example
In this example the function F94_DIST is programmed in ladder diagram (LD) and i
nstruction list (IL). The same POU header is used for both programming languages
.
Matsushita Electric Works (Europe) AG
14 – 113
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
POU Header In the POU header, all input and output variables are declared that a
re used for programming this function.
Body When the variable start is set to TRUE, the function is carried out. The bi
nary values in the illustration on the previous page serve as the values calcula
ted. In this example, variables are declared in the POU header. Also, a constant
value of 4 is assigned directly at the contact pin for n. LD Body In this examp
le, the view icon was activated so you can see the results immediately.
* next page
14 – 114
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions
IL Body Activating the Monitor Header window (Monitor " Monitor Header) while on
line also allows you to see results immediately.
+ Note
The following error flags apply to F/P94:
No.
R9007 R9008
IEC Address
%MX0.900.7 %MX0.900.8
set
permanently for an instant
if
–the area specified using the index modifier exceeds the limit –the value at n w
5 –the last area for the result exceeds the limit
Matsushita Electric Works (Europe) AG
14 – 115
Matsushita Instruction Set Basic and High–level Instructions Steps
NAiS Control 1131
Availability
All 3, except FP1– C14/16 and FP–M 0.9k
F95
Outline
(ASC)
Character " ASCII transfer
15
Converts the character constants specified by s to ASCII codes if the trigger EN
is in the ON–state. The converted ASCII codes are stored in six 16–bit areas st
arting with the 16–bit area specified by d.
J Data Types
Variable
s d
Data Types
STRING (12) INT, WORD
+ Notes
D The output d is the start address for an Array [0..5] of INT or WORD (e. g. ar
rayname[0]). D If character constant s is an empty character string (this means
s = ’’) 12 x 20 hex will be written into the destination area d. 20 hex is the A
SCII–code for space. D If the number of character constants specified by s is le
ss than 12 (e. g. s = ‘12345’), the ASCII code 20 hex (SPACE) is stored in the d
estination area d (e. g. d = ’32 31 34 33 20 35
20 20 20 20 20 20’).
J Operands
For
s d
Relay
WX – – WY – x WR – x WL – x
T/C
SV – x EV – x DT – x
Register
LD – x x: –: FL – x
,
available not available
Example
LD F95_ASC start ’ABCDEFGH’, Var_0[0] (* EN = start; Starting signal for the F95
_ASC function. *) (* s = ’ABCDEFGH’ *) (* d = Var_0[0] (destination) *) (* Var_0
[0] start address for an ARRAY [0..n] of WORD *) (* The content of n must be at
least 5 *) (* 0 to 5 are six 16–bit areas! *) (* option *)
ST
out
14 – 116
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
7 All 3
F96
Outline
(SRC)
Table data search (16–bit search)
Searches the value that is the same as s1 in the block of 16–bit areas specified
by s2 (starting area) through s3 (ending area) if the trigger EN is in the ON–s
tate. When the search operation is performed, the searching results are stored a
s follows: The number of data that is the same as s1 is transferred to special d
ata register DT9037 (DT90037 for FP10/10S). The position the data is first found
in, counting from the starting 16–bit area, is transferred to special data regi
ster DT9038 (DT90038 for FP10/10S). Be sure that s2 ≤ s3.
J Data Types
Variable
s1, s2, s3
Data Types
INT, WORD
J Operands
For
s1 s2, s3
Relay
WX x – WY x x WR x x WL x x
T/C
SV x x EV x x DT x x
Register
LD x x x: –: FL x x
,
available not available
Example
+ Note
The variables s1, s2 and s3 have to be of the same data type.
Matsushita Electric Works (Europe) AG
14 – 117
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
F100
Outline
(SHR)
Right shift of 16–bit data in bit units
Steps Availability
5 All 3
Shifts n bits of 16–bit data area specified at d to the right (to the lower bit
position) if the trigger EN is in the ON–state. When n bits are shifted to the r
ight, the data in the nth bit is transferred to special internal relay R9009 (ca
rry–flag) and the higher n bits of the 16–bit data area specified by d are fille
d with 0s.
J Data Types
Variable
d n
Data Types
INT, WORD INT
J Operands
For
d n
Relay
WX – x WY x x WR x x WL x x
T/C
SV x x EV x x DT x x
Register
LD x x x: –: FL x x
,
available not available
Example
14 – 118
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
5 All 3
F101
Outline
(SHL)
Left shift of 16–bit data in bit units
Shifts n bits of 16–bit data area specified at d to the left (to the higher bit
position) if the trigger EN is in the ON–state. When n bits are shifted to the l
eft, the data in the nth bit is transferred to special internal relay R9009 (car
ry–flag) and n bits starting with bit position 0 are filled with 0s.
J Data Types
Variable
d n
Data Types
INT, WORD INT
J Operands
For
d n
Relay
WX – x WY x x WR x x WL x x
T/C
SV x x EV x x DT x x
Register
LD x x x: –: FL x x
,
available not available
Example
LD F101_SHL ST start Var_1,Var _0 out (* EN = start; Starting signal for the F10
1_SHL function. *) (* d = Var_0 (destination) *) (* n = Var_1 (number of bits sh
ifted to the left) *) (* option *)
Matsushita Electric Works (Europe) AG
14 – 119
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
F105
Outline
(BSR)
Right shift of one hexadecimal digit (4 bits) of 16–bit data
Steps Availability
3 All 3
Shifts one hexadecimal digit (4 bits) of the 16–bit area specified by d to the r
ight (to the lower digit position) if the trigger EN is in the ON–state. When on
e hexadecimal digit (4 bits) is shifted to the right, • hexadecimal digit positi
on 0 (bit position 0 to 3) of the data specified by d is shifted out and is tran
sferred to the lower digit (bit position 0 to 3) of special data register DT9014
) and • hexadecimal digit position 3 (bit position 12 to 15) of the 16–bit area
specified by d becomes 0. This instruction is useful when the hexadecimal or BCD
data is treated.
J Data Types
Variable
d
Data Types
INT, WORD
J Operands
For
d
Relay
WX – WY x WR x WL x
T/C
SV x EV x DT x
Register
LD x x: –: FL x
,
available not available
Example
14 – 120
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions
F106
Outline
(BSL)
Left shift of one hexadecimal digit (4 bits) of 16–bit data
Steps Availability
3 All 3
Shifts one hexadecimal digit (4 bits) of the 16–bit area specified by d to the l
eft (to the higher digit position) if the trigger EN is in the ON–state. When on
e hexadecimal digit (4 bits) is shifted to the left, • hexadecimal digit positio
n 3 (bit position 12 to 15) of the data specified by d is shifted out and is tra
nsferred to the lower digit (bit position 0 to 3) of special data register DT901
4 (DT90014 for FP10/10S). • hexadecimal digit position 0 (bit position 0 to 3) o
f the 16–bit area specified by d becomes 0. This instruction is useful when the
hexadecimal or BCD data is treated.
J Data Types
Variable
d
Data Types
INT, WORD
J Operands
For
d
Relay
WX – WY x WR x WL x
T/C
SV x EV x DT x
Register
LD x x: –: FL x
,
available not available
Example
LD F106_BSL ST start Var_0 out (* EN = start; Starting signal for the F106_BSL f
unction. *) (* d = Var_0 (destination) *) (* optional *)
Matsushita Electric Works (Europe) AG
14 – 121
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
F110
Outline
(WSHR)
Right shift of one word (16 bits) of 16–bit data range
Steps Availability
5 All 3
Shifts one word (16 bits) of the data range specified by d1 (starting) and d2 (e
nding) to the right (to the lower word address) if the trigger EN is in the ON–s
tate. When one word (16 bits) is shifted to the right, • the starting word is sh
ifted out • the data in the ending word becomes 0 d1 and d2 should be: • in the
same operand • d1 ≤ d2
J Data Types
Variable
d1, d2
Data Types
INT, WORD
J Operands
For
d1, d2
Relay
WX – WY x WR x WL x
T/C
SV x EV x DT x
Register
LD x x: –: FL x
,
available not available
Example
+ Note
The variables d1 and d2 have to be of the same data type.
14 – 122
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
5 All 3
F111
Outline
(WSHL)
Left shift of one word (16 bits) of 16–bit data range
Shifts one word (16 bits) of the data range specified by d1 (starting) and d2 (e
nding) to the left (to the higher word address) if the trigger EN is in the ON–s
tate. When one word (16 bits) is shifted to the left, • the ending word is shift
ed out • the data in the starting word becomes 0 d1 and d2 should be: • in the s
ame operand • d1 ≤ d2
J Data Types
Variable
d1, d2
Data types
INT, WORD
J Operands
For
d1, d2
Relay
WX – WY x WR x WL x
T/C
SV x EV x DT x
Register
LD x x: –: FL x
,
available not available
Example
LD F111_WSHL ST start Var_0,Var _1 out (* EN = start; Starting signal for the F1
11_WSHL function. *) (* d1 = Var_0 (destination1) *) (* d2 = Var_1 (destination2
) *) (* optional *)
+ Note
The variables d1 and d2 have to be of the same data type.
Matsushita Electric Works (Europe) AG
14 – 123
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
F112
Outline
(WBSR)
Right shift of one hex. digit (4 bits) of 16–bit data range
Steps Availability
5 All 3
Shifts one hexadecimal digit (4 bits) of the data range specified by d1 (startin
g) and d2 (ending) to the right (to the lower digit position) if the trigger EN
is in the ON–state. When one hexadecimal digit (4 bits) is shifted to the right,
• the data in the lower hexadecimal digit (bit position 0 to 3) of the 16–bit d
ata specified by d1 is shifted out • the data in the higher hexadecimal digit (b
it position 12 to 15) of the 16–bit data specified by d2 becomes 0 d1 and d2 sho
uld be: • in the same operand • d1 ≤ d2
J Data Types
Variable
d1, d2
Data Types
INT, WORD
J Operands
For
d1, d2
Relay
WX – WY x WR x WL x
T/C
SV x EV x DT x
Register
LD x x: –: FL x
,
available not available
Example
+ Note
The variables d1 and d2 have to be of the same data type.
14 – 124
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions
F113
Outline
(WBSL)
Left shift of one hex. digit (4 bits) of 16–bit data range
Steps Availability
5 All 3
Shifts one hexadecimal digit (4 bits) of the data range specified by d1 (startin
g) and d2 (ending) to the left (to the higher digit position) if the trigger EN
is in the ON–state. When one hexadecimal digit (4 bits) is shifted to the left,
• the data in the higher hexadecimal digit (bit position 12 to 15) of the 16–bit
data specified by d2 is shifted out. • the data in the lower hexadecimal digit
(bit position 0 to 3) of the 16–bit data specified by d1 becomes 0. d1 and d2 sh
ould be: • in the same operand • d1 ≤ d2
J Data Types
Variable
d1, d2
Data Types
INT, WORD
J Operands
For
d1, d2
Relay
WX – WY x WR x WL x
T/C
SV x EV x DT x
Register
LD x x: –: FL x
,
available not available
Example
LD F113_WBSL ST start Var_0,Var_ 1 out (* EN = start; Starting signal for the F1
13_WBSL function. *) (* d1 = Var_0 (destination1) *) (* d2 = Var_1 (destination2
) *) (* optional *)
+ Note
The variables d1 and d2 have to be of the same data type.
Matsushita Electric Works (Europe) AG
14 – 125
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
F118
Outline
Steps Availability
(UCD)
Up/Down Counter
5
All 3
UD_Trig: DOWN counting if the trigger is in the OFF state. UP counting if the tr
igger is in the ON state. Cnt_Trig: Adds or subtracts one count at the leading e
dge of this trigger. Rst_Trig: The condition is reset when this signal is on. Th
e area for the elapsed value d becomes 0 when the leading edge of the trigger is
detected (OFF –> ON). The value in s is transferred to d when the trailing edge
of the trigger is detected (ON –>s OFF). s: Preset (Set) value or area for Pres
et (Set) value. d: Area for count (elapsed) value. J Data Types
Variable
UD_Trig, Cnt_Trig, Rst_Trig s, d
Data Types
BOOL INT, WORD
J Operands
For
UD_Trig, Cnt_Trig, Rst_Trig s d
Relais
X x Y x R x L x T x
T/C
C x DT –
Register
LD – FL –
WX x –
WY x x
WR x x
WL x x
SV x x
EV x x
DT x x
LD x x
FL x x
,
x: available –: not available
Example
+ Note
14 – 126
The variables s and d have to be of the same data type.
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
F119
Outline
(LRSR)
LEFT/RIGHT shift register
5
All 3
LR_trig:
DataInp:
Sh_trig: Rst_trig: d1: d2: Carry: J Data Types
Variable
Left/right trigger; specifies the direction of the shift–out. LR_trig = ON: shif
ting out to the left, LR_trig = OFF: shifting out to the right. Specifies the ne
w shift–in data. New shift–in data = 1: when the data input is in the ON–state.
New shift–in data = 0: when the data input is in the OFF–state. Shifts 1 bit to
the left or right when the leading edge of the trigger is detected (OFF → ON). T
urns all the bits of the data range specified by d1 and d2 to 0 if this trigger
is in the ON–state. Start of 16 bit area. End of 16 bit area. Shifted–out bit.
Data Types
BOOL INT, WORD
LR_trig, DataInp, Sh_trig, Rst_trig, Carry d1, d2
J Operands
For
LR_trig, DataInp, Sh_trig, Rst_trig Carry d1, d2
Relay
X x Y x R x L x T x
T/C
C x DT –
Register
LD – FL –
– WX –
x WY x
x WR x
x WL x
x SV x
x EV x
– DT x x: –:
– LD x
– FL x
available not available
Matsushita Electric Works (Europe) AG
14 – 127
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
,
Example
+ Note
The variables d1 and d2 have to be of the same data type.
14 – 128
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
F120
Outline
(ROR)
16–bit data right rotate
5
All 3
Rotates n bits of the 16–bit data specified by d to the right if the trigger EN
is in the ON–state. When n bits are rotated to the right, • the data in bit posi
tion n–1 (nth bit starting from bit position 0) is transferred to the special in
ternal relay R9009 (carry–flag) • n bits starting from bit position 0 are shifte
d out to the right and into the higher bit positions of the 16–bit data specifie
d by d.
J Data Types
Variable
d n
Data Types
INT, WORD INT
J Operands
For
d n
Relay
WX – x WY x x WR x x WL x x
T/C
SV x x EV x x DT x x
Register
LD x x x: –: FL x x
,
available not available
Example
LD F120_ROR ST start Var_0,Var_ 1 out (* EN = start; Starting signal for the F12
0_ROR function. *) (* d = Var_0 *) (* n = Var_1 *) (* optional *)
Matsushita Electric Works (Europe) AG
14 – 129
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
Steps Availability
F121
Outline
(ROL)
16–bit data left rotate
5
All 3
Rotates n bits of the 16–bit data specified by d to the left if the trigger EN i
s in the ON–state. When n bits are rotated to the left, • the data in bit positi
on 16–n (nth bit starting from bit position 15) is transferred to special intern
al relay R9009 (carry–flag) • n bits starting from bit position 15 are shifted o
ut to the left and into the lower bit positions of the 16–bit data specified by
d.
J Data Types
Variable
d n
Data Types
INT, WORD INT
J Operands
For
d n
Relay
WX – x WY x x WR x x WL x x
T/C
SV x x EV x x DT x x
Register
LD x x x: –: FL x x
,
available not available
Example
14 – 130
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
5 All 3
F122
Outline
(RCR)
16–bit data right rotate with carry–flag data
Rotates n bits of the 16–bit data specified by d including the data of carry–fla
g to the right if the trigger EN is in the ON–state. When n bits with carry–flag
data are rotated to the right, • the data in bit position n–1 (nth bit starting
from bit position 0) are transferred to special internal relay R9009 (carry–fla
g) • n bits starting from bit position 0 are shifted out to the right and carry–
flag data and n–1 bits starting from bit position 0 are subsequently shifted int
o the higher bit positions of the 16–bit data specified by d.
J Data Types
Variable
d n
Data Types
INT, WORD INT
J Operands
For
d n
Relay
WX – x WY x x WR x x WL x x
T/C
SV x x EV x x DT x x
Register
LD x x x: –: FL x x
,
available not available
Example
LD F122_RCR ST start Var_0,Var_1 out (* EN = start; Starting signal for the F122
_RCR function. *) (* d = Var_0 *) (* n = Var_1 *) (* optional *)
Matsushita Electric Works (Europe) AG
14 – 131
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
F123
Outline
(RCL)
16–bit data left rotate with carry–flag data
Steps Availability
5 All 3
Rotates n bits of the 16–bit data specified by d including the data of carry–fla
g to the left if the trigger EN is in the ON–state. When n bits with carry–flag
data are rotated to the left, • the data in bit position 16–n (nth bit starting
from bit position 15) is transferred to special internal relay R9009 (carry–flag
). • n bits starting from bit position 15 are shifted out to the left and carry–
flag data and n–1 bits starting from bit position 15 are shifted into lower bit
positions of the 16–bit data specified by d.
J Data Types
Variable
d n
Data Types
INT, WORD INT
J Operands
For
d n
Relay
WX – x WY x x WR x x WL x x
T/C
SV x x EV x x DT x x
Register
LD x x x: –: FL x x
,
available not available
Example
14 – 132
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
F130
Outline
(BTS)
16–bit data bit set
5
All 3
Turns ON the bit specified by the bit position at n of the 16–bit data specified
by d if the trigger EN is in the ON–state. Bits other than the bit specified do
not change. The range of n is 0 to 15.
J Data Types
Variable
d n
Data Types
INT, WORD INT
J Operands
For
d n
Relay
WX – x WY x x WR x x WL x x
T/C
SV x x EV x x DT x x
Register
LD x x x: –: FL x x
,
available not available
Example
LD F130_BTS ST start word1, bit_number out (* EN = start; Starting signal for th
e F130_BTS function. *) (* d = word1 *) (* n = bit_number *) (* optional *)
Matsushita Electric Works (Europe) AG
14 – 133
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
F131
Outline
(BTR)
Steps Availability
16–bit data bit reset
5
All 3
Turns OFF the bit specified by the bit position at n of the 16–bit data specifie
d by d if the trigger EN is in the ON–state. Bits other than the bit specified d
o not change. The range of n is 0 to 15.
J Data Types
Variable
d n
Data Types
INT, WORD INT
J Operands
For
d n
Relay
WX – x WY x x WR x x WL x x
T/C
SV x x EV x x DT x x
Register
LD x x x: –: FL x x
,
available not available
Example
14 – 134
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
F132
Outline
(BTI)
16–bit data bit invert
5
All 3
Inverts [1 (ON) → 0 (OFF) or 0 (OFF) → 1 (ON)] the bit at bit position n in the
16–bit data area specified by d if the trigger EN is in the ON–state. Bits other
than the bit specified do not change. The range of n is 0 to 15.
J Data Types
Variable
d n
Data Types
INT, WORD INT
J Operands
For
d n
Relay
WX – x WY x x WR x x WL x x
T/C
SV x x EV x x DT x x
Register
LD x x x: –: FL x x
,
available not available
Example
LD F132_BTI ST start Var_0,Var_1 out (* EN = start; Starting signal for the F132
_BTI function. *) (* d = Var_0 *) (* n = Var_1 *) (* optional *)
Matsushita Electric Works (Europe) AG
14 – 135
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
F133
Outline
Steps Availability
(BTT)
16–bit data test
5
All 3
Checks the state [1 (ON) or 0 (OFF)] of bit position n in the 16–bit data specif
ied by d if the trigger EN is in the ON–state. The specified bit is checked by s
pecial internal relay R900B. • When specified bit is 0 (OFF), special internal r
elay R900B (=flag) turns ON. • When specified bit is 1 (ON), special internal re
lay R900B (=flag) turns OFF. n specifies the bit position to be checked in decim
al data. Range of n: 0 to 15
J Data Types
Variable
d n
Data Types
INT, WORD INT
J Operands
For
d n
Relay
WX – x WY x x WR x x WL x x
T/C
SV x x EV x x DT x x
Register
LD x x x: –: FL x x
,
available not available
Example
14 – 136
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
5 All 3
F135
Outline
(BCU)
Number of ON bits in 16–bit data
Counts the number of bits in the ON state (1) in the 16–bit data specified by s
if the trigger EN is in the ON–state. The number of 1 (ON) bits is stored in the
16–bit area specified by d.
J Data Types
Variable
s d
Data Types
INT, WORD INT
J Operands
For
s d
Relay
WX – x WY x x WR x x WL x x
T/C
SV x x EV x x DT x x
Register
LD x x x: –: FL x x
,
available not available
Example
Matsushita Electric Works (Europe) AG
14 – 137
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
F136
Outline
(DBCU)
Number of ON bits in 32–bit data
Steps Availability
7 All 3
Counts the number of bits in the ON state (1) in the 32–bit data specified by s
if the trigger EN is in the ON–state. The number of 1 (ON) bits is stored in the
16–bit area specified by d.
J Data Types
Variable
s d
Data Types
DINT, DWORD INT
J Operands
For
s d – x x x x x x x: –: x x
Relay
T/C
DEV x EV
Register
DDT x DT DLD x LD DFL x FL
DWX DWY DWR DWL DSV x WX x WY x WR x WL x SV
,
available not available
Example
LD F136_DBCU ST start Var_0,Var_1 out (* EN = start; Starting signal for the F13
6_DBCU function. *) (* s = Var_0 (source) *) (* d = Var_1 (destination) *) (* op
tional *)
14 – 138
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps
5
F137 (STMR)
Outline
Auxiliary timer (sets the ON– delay timer for 0.01s units)
Availability
FP0, FP1–C56/C72 and FP–M 2.7k/5k
The auxiliary timer instruction F137 (STMR) is a down type timer. The formula of
the timer–set time is 0.01 sec. * set value s (time can be set from 0.01 to 327
.67 sec.). If you use the special internal relay R900D as the timer contact, be
sure to program it at the address immediately after the instruction. Timer opera
tion: • If the trigger EN of the auxiliary timer instruction (STMR) is in the ON
–state, the constant or value specified by s is transferred to the area specifie
d by d. • During the timing operation, the time is subtracted from the value in
the area specified by d. • The output ENO turns ON when the value in the area sp
ecified by d becomes 0.
J Data Types
Variable
s, d
Data Types
INT, WORD
J Operands
For
s d
Relay
WX x – WY x x WR x x WL x x
T/C
SV x x EV x x DT x x
Register
LD x x x: –: FL x x
,
available not available
Example
+ Notes
D The variables s and d have to be the same data type. D This function cannot be
used in a function block. D Each timer used has to have its own constant Num*.
System registers 5 and 6 determine the Num* addresses available. The timer funct
ions TM_1s, TM_100ms, TM_10ms and TM_1s use the same Num* address area.
14 – 139
Matsushita Electric Works (Europe) AG
Matsushita Instruction Set Basic and High–level Instructions Steps
NAiS Control 1131
Availability
FP1–C24/40,FP1–C56/ 72 and FP–M 2.7k/5k
F138
Outline
(HMSS)
h:min:s  s conversion
7
Converts the hours, minutes, and seconds data stored in the 32–bit area specifie
d by s to seconds data if the trigger EN is in the ON–state. The converted secon
ds data is stored in the 32–bit area specified by d. All hours, minutes, and sec
onds data to convert and the converted seconds data is BCD. The max. data input
value is 9,999 hours, 59 minutes and 59 seconds, which will be converted to 35,9
99,999 seconds in BCD format.
J Data Types
Variable
s, d
Data Types
DWORD
J Operands
For
s d
Relay
T/C
DEV x x
Register
DDT x x x: –: DLD x x DFL x x
DWX DWY DWR DWL DSV x – x x x x x x x x
,
available not available
Example
14 – 140
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
FP1–C24/40,FP1–C56/72 and FP–M 2.7k/5k
F139
Outline
(SHMS)
s  h:min:s conversion
5
Converts the second data stored in the 32–bit area specified by s to hours, minu
tes, and seconds data if the trigger EN is in the ON– state. The converted hours
, minutes, and seconds data is stored in the 32–bit area specified by d. The sec
onds prior to conversion and the hours, minutes, and seconds after conversion ar
e all BCD data. The maximum data input value is 35,999,999 seconds, which is con
verted to 9,999 hours, 59 minutes and 59 seconds.
J Data Types
Variable
s, d
Data Types
DWORD
J Operands
For
s d
Relais
T/C
DEV x x
Register
DDT x x x: –: DLD x x DFL x x
DWX DWY DWR DWL DSV x – x x x x x x x x
,
available not available
Example
LD F139_SHMS ST start Var_0,Var_ 1 out (* EN = start; Starting signal for the F1
39_SHMS function. *) (* s = Var_0 (source) *) (* d = Var_1 (destination) *) (* o
ptional *)
Matsushita Electric Works (Europe) AG
14 – 141
Matsushita Instruction Set Basic and High–level Instructions Steps
NAiS Control 1131
Availability
All 3, except FP1– C14/16 and FP–M 0.9k
F140
Outline
(STC)
Carry–flag set
1
Special internal relay R9009 (carry–flag) goes ON if the trigger EN is in the ON
–state. This instruction can be used to control data using carry–flag R9009 (e.g
. F122_RCR and F123_RCL instructions).
,
Example
14 – 142
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
All 3, except FP1– C14/16 and FP–M 0.9k
F141
Outline
(CLC)
Carry–flag reset
1
Special internal relay R9009 (carry–flag) goes OFF if the trigger EN is in the O
N–state. This instruction can be used to control data using carry–flag R9009 (e.
g. F122_RCR and F123_RCL instructions).
,
Example
LD F141_CLC ST start out (* EN = start; Starting signal for the F141_CLC functio
n. *) (* optional *)
Matsushita Electric Works (Europe) AG
14 – 143
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
F143
Outline
Steps Availability
(IORF)
Partial I/O update
1
All 3, except FP1–C14/16
Updates the inputs or outputs specified by d1 and d2 immediately after the trigg
er EN is in the ON–state even in the program execution stage. Using this instruc
tion, you can update inputs or outputs without the time–lag caused by scanning.
Specify the word address as 0 ≤ d1 ≤ d2 ≤ 127. The partial I/O update instructio
n is executed only for the I/O units on the master backplane or expansion backpl
ane. It is not executed for the I/O unit in the slave station of the Remote I/O
System.
J Data Types
Variable
d1, d2
Data Types
INT, WORD
J Operands
For
d1 d2
Relay
WX(1) WY(1) x x x x WR x x WL x x
T/C
SV x x EV x x DT x x
Register
LD x x x: –: FL x x
,
available not available
Example
+ Note
If variables are used for the inputs d1 and d2 then NAiS Control internally uses
index registers.
14 – 144
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
C types of FP0 and FP1– C24/40–C56/72, FP–M5k
F144
Outline
(TRNS)
Serial communication (RS232C)
5
• Based on bytes specified by n, the data of the data area (register) which foll
ows the DT specified by s is transmitted from the RS232C port. (Set n so that it
may not exceed maximum of data register.) • You cannot use the first word of th
e transmission source to set the transmission bytes (n). The transmission bytes
(n) decrease one by one at every transmission. When the transmission is complete
d, the transmission bytes become 0 and the end–of–transmission flag (R9039) turn
s ON. • The first word of the transmission source data area (register) is regard
ed the transmission bytes. • Set 2 (for general port) to system register No. 412
to execute the F144 (TRNS) instruction. • You can set the transmission baudrate
and protocol by system register No. 413, 414. • Header and terminator are autom
atically added to the transmission data. • R9039 is OFF during transmission, it
is in the ON–state after the end of transmission. • The executing of F144 (TRNS)
instruction clears the receiving end flag and receiving pointer, and starts the
receiving process. • When the transmission bytes are at 0, execution of the F14
4 (TRNS) instruction clears the receiving end flag and receiving pointer, and st
arts the receiving process without performing the transmission process. Use F144
(TRNS) instruction in this state when you exclusively receive repeat data. J Da
ta Types
Variable
s n
Data Types
WORD INT, WORD
Matsushita Electric Works (Europe) AG
14 – 145
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
J Operands
For
s n
Relay
WX – x WY – x WR – x WL – –
T/C
SV – x EV – x DT x x
Register
LD – x x: –: FL – x
,
available not available
Example
LD F144_TRNS ST start Var_0,Var_1 out (* EN = start; Starting signal for the F14
4_TRNS function. *) (* s = Var_0 *) (* n = Var_1 *) (* optional *)
14 – 146
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
F147
Outline
(PR)
5
Parallel printout
FP0 + TR–Types of FP1–C24/40–C56/72, FP–M2.7k/5k
Outputs the ASCII codes for 12 characters stored in the 6–word area specified by
s via the word external output relay specified by d if the trigger EN is in the
ON–state. If a printer is connected to the output specified by d, a character c
orresponding to the output ASCII code is printed. Only bit positions 0 to 8 of d
are used in the actual printout. ASCII code is output in sequence starting with
the lower byte of the starting area. Three scans are required for 1 character c
onstant output. Therefore, 37 scans are required until all characters constants
are output. Since it is not possible to execute multiple F147 (PR) instructions
in one scan, use print–out flag R9033 to be sure they are not executed simultane
ously. If the character constants convert to ASCII code, use of the F95_ASC inst
ruction is recommended.
J Data Types
Variable
s d
Data Types
INT, WORD WORD
J Operands
For s
d
Relay
WX x – WY x x WR x – WL x –
T/C
SV x – EV x – DT x –
Register
LD x – x: –: FL x –
,
available not available
Example
Matsushita Electric Works (Europe) AG
14 – 147
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
Steps Availability
F148
Outline
(ERR)
Self–diagnostic error set
3
All 3, except FP1– C14/16 and FP–M 0.9k
The error No. specified by n* is placed into special data register DT9000 (DT900
00 for FP10/10S). At the same time, the self–diagnostic error–flag R9000 is set
and ERROR LED on the CPU is turned ON. The contents of the error–flag R9000 can
be read and checked using NAiS Control (Monitor → Display Special Relays → Error
Flag). The error No., special data register DT9000 (DT90000 for FP10/10S), can
be read and checked using NAiS Control (Monitor → Display Special Registers → Ba
sic Error Messages). When n* = 0, the error is reset. (only for operation contin
ue errors, n* = 200 to 299.) The ERROR LED is turned OFF and the contents of spe
cial data register DT9000 (DT90000 for FP10/10S) are cleared with 0. When n* = 1
00 to 199, the operation is halted. When n* = 200 to 299, the operation is conti
nued. Flag condition: • Error–flag (R9007): Turns ON and keeps the ON state when
the n exceeds the limit. • Error–flag (R9008): Turns ON for an instant when the
n exceeds the limit.
J Data Types
Variable
n*
Data Types
INT, WORD
J Operands
For n* Relay
WX – WY – WR – WL –
T/C
SV – EV – DT –
Register
LD – x: –: FL –
,
available not available
Example
LD F148_ERR ST start 100 out (* EN = start; Starting signal for the F148_ERR fun
ction. *) (* n* = 100 *) (* optional *)
14 – 148
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
F149
Outline
(MSG)
Message display
13
All 3, except FP1– C14/16 and FP–M 0.9k
This instruction is used for displaying the message on the FP Programmer II scre
en. After executing F149 (MSG) instruction, you can see the message specified by
s on the FP Programmer II screen. When the F149 (MSG) instruction is executed,
the message–flag R9026 is set and the message specified by s is set in special d
ata registers DT9030 to DT9035 (DT90030 to DT90035 for FP10/10S). Once the messa
ge is set in special data registers, the message can’t be changed even if the F1
49 (MSG) instruction is executed again. You can clear the message with the FP Pr
ogrammer II.
J Data Types
Variable
s
Data Types
STRING(12)
J Operands
For
s
Relay
WX – WY – WR – WL –
T/C
SV – EV – DT –
Register
LD – x: –: FL –
,
available not available
Example
Matsushita Electric Works (Europe) AG
14 – 149
Matsushita Instruction Set Basic and High–level Instructions Steps
NAiS Control 1131
Availability
FP1– C24/40, FP1– C56/72, FP–M 2.7k/5k
F157
Outline
(CADD)
Time addition
9
The date/clock data (3 words) specified by s1 and the time data (2 words) specif
ied by s2 are added together if the trigger EN is in the ON–state. The result is
stored in the area (3 words, same format as s1) specified by d. All the data us
ed in the F157 (CADD) instruction are handled in form of BCD.
Clock/calendar data: August 1, 1992 s1[1]: s1[2]: s1[3]: Time: 14:23:31 (hour:mi
nutes:seconds) 2331 hex (minutes/seconds) 0114 hex (day/hour) 9208 hex (year/mon
th)
,
Example
Time data: 32 hours; 50 minutes; and 45 seconds s2 lower byte: 5045 hex (minutes
/seconds) s2 higher byte: 0032 hex (32 hours) You cannot specify special data re
gisters DT9054 to DT9056 (DT90054 to DT90056 for FP10/10S) for the operand d. Th
ese registers store built–in calendar timer values. To change the built–in calen
dar timer value, first store the added result in other memory areas and transfer
them to the special data registers using the F0_MV instruction.
J Data Types
Variable
s1, d s2
Data Types
ARRAY [1..3] OF WORD DWORD
J Operands
For
s1 d s2 x x x x x x x x: –: x x
Relay
WX x – WY x x WR x x WL x x
T/C
SV x x EV x x DEV DT x x
Register
LD x x DLD FL x x DFL
DWX DWY DWR DWL DSV
DDT
,
Example
available not available
14 – 150
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
F158
Outline
(CSUB)
Time subtraction
9
FP1– C24/40, FP1– C56/72, FP–M 2.7k/5k
Subtracts time data (2 words) specified by s2 from the date/clock data (3 words)
specified by s1 if the trigger EN is in the ON–state. The result is stored in t
he area (3 words, same format than s1) specified by d. All the data used in the
F158 (CSUB) instruction are handled in form of BCD.
Clock/calendar data: August 1, 1992 Time: 14:23:31 (hour:minutes:seconds) s1[1]:
2331 hex (minutes/seconds) s1[2]: 0114 hex (day/hour) s1[3]: 9208 hex (year/mon
th) Time data: 32 hours; 50 minutes; and 45 seconds s2 lower byte: 5045 hex (min
utes/seconds) s2 higher byte: 0032 hex (32 hours) You cannot specify special dat
a registers DT9054 to DT9056 (DT90054 to DT90056 for FP10/10S) for the operand d
. These registers store built–in Calendar timer values. To change the built–in C
alendar timer value, first store the added result in other memory areas and tran
sfer them to the special data registers using the F0_MV instruction.
,
Example
J Data Types
Variable
s1, d s2
Data Types
ARRAY [1..3] OF WORD DWORD
J Operands
For
s1 d s2
Relay
WX x – WY x x WR x x WL x x
T/C
SV x x EV x x DEV x DT x x
Register
LD x x DLD x x: –: FL x x DFL x
DWX DWY DWR DWL DSV x x x x x
DDT x
available not available
Matsushita Electric Works (Europe) AG
14 – 151
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
,
Example
LD F158_CSUB start Var_0,Var_1Var_2 (* EN = start; Starting signal for the F158_
CSUB function. *) (* s1 = Var_0 (source1)*) (* s2 = Var_1 (source2) *) (* d = Va
r_2 (destination) *) (*s1 – s2 = d *) (* optional *)
ST
out
14 – 152
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
7 FP1, FP–M
F162
Outline
(HC0S)
High–speed counter output set
Sets the value specified by s as target value of the high–speed counter if the t
rigger EN is in the ON–state. When the elapsed value (DT9045 and DT9044) of the
high–speed counter agrees with the target value (DT9047 and DT9046), the externa
l output relay specified by d turns ON. You can use 8 external output relays (Y0
to Y7). The target value is stored in special data registers DT9047 and DT9046
when the F162 (HC0S) instruction is executed and it is cleared when the elapsed
value of the high–speed counter agrees with the target value. Use 24 bit binary
data with sign data for the target value of HSC (FF800000 hex to 007FFFFF hex /
–8,388,608 to 8,388,607). Special internal relay R903A turns ON and stays ON whi
le the F162 (HC0S) instruction is executed and it is cleared when the elapsed va
lue of the high–speed counter coincides with the target value. Even if the reset
operation of the high–speed counter is performed after executing the F162 (HC0S
) instruction, the target value setting is not cleared until the elapsed value o
f the high–speed counter coincides with the target value. To reset the external
output relay, which is set ON by the F162 (HC0S) instruction, use the F163_HC0R
instruction. You can use the same external output relay specified by the F162 (H
C0S) instruction in other parts of program. It is not regarded duplicate use of
the same output. While special internal relay R903A is in ON state, no other hig
h–speed counter instructions F162 (HC0S), F163_HC0R, F164_SPD0, F165_CAM0 can be
executed.
J Data Types
Variable
s d
Data Types
DINT, DWORD BOOL
J Operands
For
s d – x – – – – – x: –: – –
Relais
T/C
DEV x C
Register
DDT x DT DLD – LD DFL – FL
DWX DWY DWR DWL DSV x X x Y x R – L x T
,
available not available
Example
Matsushita Electric Works (Europe) AG
14 – 153
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
F163
Outline
Steps Availability
(HC0R)
High–speed counter output reset
7
FP1, FP–M
Sets the value specified by s as target value of the high–speed counter if the t
rigger EN is in the ON–state. When the elapsed value (DT9045 and DT9044) of the
high–speed counter agrees with the target value (DT9047 and DT9046), the externa
l output relay specified by d turns OFF. You can use 8 external output relays (Y
0 to Y7). When the F163 (HC0R) instruction is executed, the target value is stor
ed in special data registers DT9047 and DT9046 and it is cleared when the elapse
d value of the high–speed counter agrees with the target value. Use 24 bit binar
y data with sign data for the target value of HSC (FF800000 hex to 007FFFFF hex
/ –8,388,608 to 8,388,607). Once the F163 (HC0R) instruction is executed, specia
l internal relay R903A turns ON and stays ON. It is cleared when the elapsed val
ue of the high–speed counter agrees the target value. Even if the reset operatio
n of the high–speed counter is performed after executing the F163 (HC0R) instruc
tion, the target value setting is not cleared until the elapsed value of the hig
h–speed counter agrees with the target value. You can use the same external outp
ut relay specified by the F163 (HC0R) instruction in other parts of program. It
is not considered duplicate use of the same output. While special internal relay
R903A is in ON state, no other high–speed counter instructions F162_HC0S, F163
(HC0R), F164_SPD0, F165_CAM0 can be executed.
J Data Types
Variable
s d
Data Types
DINT, DWORD BOOL
J Operands
For
s d – x – – – – – x: –: – –
Relais
T/C
DEV x C
Register
DDT x DT DLD – LD DFL – FL
DWX DWY DWR DWL DSV x X x Y x R – L x T
,
available not available
Example
LD
F163_HC0R ST
start
Var_0, Var_1 out
(*EN = start; Starting signal for the F163_HC0R function*) (* s = Var_0*) (* d =
Var_1 *) (* option *)
14 – 154
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
pulse; Tr Types FP1/FP–M 2.7k/5k, + FP–M 0.9k pattern: FP1 and FP–M
F164
Outline
(SPD0)
Pulse output control; Pattern output control
3
Outputs the pattern of the pulse corresponding to the elapsed value of HSC. When
the executing condition is ON and HSC control–flag (R903A) is OFF, this instruc
tion starts operation. This instruction executes pattern output or pulse output
corresponding to the data of the data table registered at the data register spec
ified by s. You can use pulse output for positioning with a pulse motor and patt
ern output for controlling an inverter. When you execute pulse output with this
instruction, input the pulse of Y7 directly to HSC or input the encoder output p
ulse. When you execute pattern output, input the encoder output pulse to HSC. Sp
ecify at system register No. 400 whether you will use HSC or not. It is not poss
ible to execute this instruction without setting. The output coils of pattern ou
tput are within the 8 points Y0 to Y7. The output coil of pulse output is Y7 onl
y. Select either pattern outputs or pulse outputs by the content of the first wo
rd of the data table. When you input 0 for one word of the first address (all bi
ts are 0), it will be the pulse output. When you execute pattern output, an erro
r occurs unless the No. of the control steps is 1 to F or unless the No. of cont
rol points is 1 to 8. An error occurs when the first target value is not FF80000
0 to 7FFFFF. An error does not occur when the first target value on and after th
e second one are not FF800000 to 7FFFFF. The operation, however, is stopped and
R903A turns OFF. When the frequency data is ”0”, pulse output ends. It will also
end if the area is exceeded during its execution.
J Data Types
Variable
s
Data Types
INT, WORD
J Operands
For
s
Relais
WX – WY – WR – WL –
T/C
SV – EV – DT x x: –:
Register
LD – FL –
,
available not available
Example
Matsushita Electric Works (Europe) AG
14 – 155
Matsushita Instruction Set Basic and High–level Instructions Steps
NAiS Control 1131
Availability
All 3, except FP0 and FP–M 0.9k
F165
Outline
(CAM0)
Cam control
3
Converts ON/OFF of output specified on the table corresponding to the elapsed va
lue of HSC. This instruction controls the output up to 8 points (Y0 to Y7), corr
esponding to ON/OFF target value of each coil on the table, which is for the con
trol of cam position specified by s. The target value is within the range of 23–
bits data and 0 to 8388607. If you execute cam control, you have to specify the
operating mode as addition counter. (If it is not addition counter, you will not
be able to execute the control properly.) The target value is maximum 32 steps
with FP1–C16, maximum 64 steps with FP1–C24/C40. If you cancel hard reset, soft
reset, and control maximum value you can set the initial pattern at output, set
the elapsed value to 0 and restart Cam control. You can output the initial patte
rn at the start of control. However, you cannot clear the elapsed value to 0.
J Data Types
Variable
s
Data Types
INT, WORD
J Operands
Für
s
Relais
WX – WY – WR – WL –
T/C
SV – EV – DT x x: –:
Register
LD – FL –
,
available not available
Example
LD
F165_CAM0 ST
start
Var_0 out
(*EN = start; Starting signal for the F165_CAM0 function*) (* s = Var_0*) (* opt
ion *)
14 – 156
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
11 FP0
F166
Outline
(HC1S)
Sets Output of High– speed counter (4Channels)
If the trigger EN of the instruction F166 has the status TRUE, pulses at the HSC
will be counted. If the elapsed value of the high–speed counter equals the targ
et value s, an interrupt will be executed and the output relay d of the PLC will
be set. In addition to this the special relay for the HSC n (R903A/B/C/D) will
be reset and F166 is deactivated.
Target Value (s) Elapsed value of HSC F166_start Special relay (n) R903A/B/C/D P
LC output (d)
If the high–speed counter is reset (reset input of HSC from 0 to 1, see system r
egister 400/401 in the project navigator) before the elapsed value has reached t
he target value s, the elapsed value will be reset to zero. F166 remains active
and counting restarts at zero.The duplicate use of an external output relay in o
ther instructions (OUT, SET, RST, KEEP and other F instructions) is not verifyed
by NAiS Control and will not be detected.While the special relay(s) R903A/B/C/D
is/ are in ON state no other high–speed counter instructions can be executed.FP
0 provides 4 HSC channels. The channel number is specified by n (0 to 3).
n values
Elapsed value register: Target value register: Used channel: ON during execution
:
0
DDT9044 DDT9046 CH0 of HSC0 R903A
1
DDT9048 DDT9050 CH1 of HSC0 R903B
2
DDT9104 DDT9106 CH0 of HSC1 R903C
3
DDT9108 DDT9110 CH1 of HSC1 R903D
s values
–8388608 or 16#FF800000 ... 8388607 or 16#7FFFFF
d values
0 ... 7
output Y0 ... Y7
Matsushita Electric Works (Europe) AG
14 – 157
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
J Data Types
Variable
n s d
Data Types
DINT, DWORD DINT, DWORD BOOL
J Operands
For
s
Relais
T/C
DEV x C –
Register
DDT x DT – x: –: DLD – LD – DFL – FL –
DWX DWY DWR DWL DSV x X d – x – – – x Y x R – L x T
,
available not available
Example
Globale Variable List:
Identifier
0 out_0
Address
%QX0.0
Type
BOOL
Initial
FALSE
Comment
output Y0 of PLC
POU–Header:
Class
0 1 VAR_EXTERNAL VAR
Identifier
out_0 F166_start
Type
BOOL BOOL
Initial
FALSE FALSE
Comment
output Y0 of PLC F166 start condition
POU Body (Instruction list)
LD F166_HC1S F166_start 0,10000,out_0 Load start condition execute F166
POU Body (Ladder Diagramm)
+ Notes
D Assign a number to the input variable (e.g. Monitor " Monitor Header, click th
e variable, enter the value, press <Enter>) or replace the input variables by nu
mbers. D Error Flags:
Nr.
R9007 R9008
IEC–Address
%MX0.900.7 %MX0.900.8
set
ON ON
if
index is too high parameter s exceeds the valid range
14 – 158
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
11 FP0
F167
Outline
(HC1R)
Resets Output of High–speed Counter (4 Channels)
If the trigger EN of the instruction F167 has the status TRUE, pulses at the HSC
will be counted. If the elapsed value of the high–speed counter equals the targ
et value s, an interrupt will be executed and the output relay d of the PLC will
be reset. In addition to this the special relay for the HSC n (R903A/B/C/D) wil
l be reset and F167 is deactivated.
Target Value (s) F167_start Special Relay (n) R903A/B/C/D PLCOutput (d)
If the high–speed counter is reset (reset input of HSC from 0 to 1, see system r
egister 400/401 in the project navigator) before the elapsed value has reached t
he target value s, the elapsed value will be reset to zero. F167 remains active
and counting restarts at zero. The duplicate use of an external output relay d i
n other instructions (OUT, SET, RST, KEEP and other F instructions) is not verif
yed by NAiS Control and will not be detected. While the special relay(s) R903A/B
/C/D is/ are in ON state no other high–speed counter instructions can be execute
d. FP0 provides 4 HSC channels. The channel number is specified by n (0 to 3).
n values
Elapsed value register: Target value register: Used channel: ON during execution
:
0
DDT9044 DDT9046 CH0 of HSC0 R903A
1
DDT9048 DDT9050 CH1 of HSC0 R903B
2
DDT9104 DDT9106 CH0 of HSC1 R903C
3
DDT9108 DDT9110 CH1 of HSC1 R903D
s values
–8388608 or 16#FF800000 ... 8388607 or 16#7FFFFF
d values
0 ... 7
output
Y0 ... Y7
Matsushita Electric Works (Europe) AG
14 – 159
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
J Data Types
Variable
n s d
Data Types
DINT, DWORD DINT, DWORD BOOL
J Operands
For
s
Relais
T/C
DEV x C –
Register
DDT x DT – x: –: DLD – LD – DFL – FL –
DWX DWY DWR DWL DSV x X d – x – – – x Y x R – L x T
,
available not available
Example
POU Header
Class
0 VAR
Identifier
PLS
Type
Bool
Initial
Comment
16#0410,1000 output Y0 of PLC
1
VAR
F169_start
BOOL
FALSE
F169 start condition
POU Body (Instruction List):
LD F167_HC1R F167_start 0,–200,out_0 load start condition execute F167
POU Body (Ladder Diagramm):
+ Note
D Assign a number to the input variable (e.g. Monitor –> Monitor Header, click t
he variable, enter the value, press <Enter>) or replace the input variables by n
umbers. D Error Flags:
Nr.
R9007 R9008
IEC–Address set
%MX0.900.7 %MX0.900.8 ON ON
if
index is too high parameter s exceeds the valid range
14 – 160
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
F168
Outline
(SPD1)
Positioning Pulse Instruction
5
TR Type of FP0
The function generates a pulse train through the PLC outputs Y0 or Y1 as defined
in a look up table.
D When starting the function (EN = TRUE) the frequence Fmin is sent to the ouput
of the PLC and the special relays R903A/R903B defined by n* will be set. D Afte
r that, the frequence will be increased from Fmin to Fmax during the period Tdel
ay. D The frequence Fmax remains unchanged until the number of pulses DImp are o
utput. Counting of the pulses starts at the moment Fmax is reached. DImp = (Fmax
+Fmin)/2*Tdelay*2–TargetPulseCount D Afterwards, the frequence will be reduced f
rom Fmax to Fmin during the period Tdelay. D If the value of Fmin is reached, th
e special relays R903A/R903B (defined by n*) and the PLC ouput will be reset. D
In addition to the pulse output a direction output can be realized as well (see
parameter init of DUT).
+ Note
D If DImp has a positive value, processing is executed as described above. D If
DImp = 0, Fmax will be reduced to Fmin without delay. D If DImp has a negative v
alue, Fmin will be reduced before Fmax is reached but the number of TargetPulseC
ount pulses will be output.
Matsushita Electric Works (Europe) AG
14 – 161
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
J Data Types
Variable
s n*
Data Types
SDT (Strukturierter Datentyp) INT, WORD
J Operands
For
s n*
Relais
WX – – WY – – WR – – WL – –
T/C
SV – – EV – – DT x – x: –:
Register
LD – – FL – –
available not available
Values for n
Uses output: Elapsed value register: Target value register: Used channel: Specia
l relay (ON during execution): Local range input enabled: Local range input:
0
Y0 (direction Y2) DDT9044 DDT9046 CH0 of HSC0 R903A DT9052 bit 2 ON X0
1
Y1 (direction Y3) DDT9048 DDT9050 CH1 of HSC0 R903B DT9052 bit 6 ON X1
DUT for parameter s Create the data table of the function by creating a DUT:
Enter the DUT into the list of global variables:
* next page
14 – 162
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions
Parameter Init of DUT = 16#0XYZ X = Pulse width (ON/OFF time):
X values
0 1
ON time
50 % 80 µs ON ON
OFF time
50 % rest OFF OFF
Comment
max. Fmax = 6 kHz max. Fmax = 9.5 kHz
Y = Pulse count mode: Z = Direction output:
YZ values
00 02 03 10 12 13 20 22 23
Pulse count mode
Incremental counting Incremental counting Incremental counting Absolute counting
Absolute counting Absolute counting Return to origin point Return to origin poi
nt Return to origin point
Direction output
Not used OFF if TargetPulseCount value positive ON if TargetPulseCount value neg
ative ON if TargetPulseCount value positive OFF if TargetPulseCount value negati
ve Not used OFF if TargetPulseCount value positive ON if TargetPulseCount value
negative ON if TargetPulseCount value positive OFF if TargetPulseCount value neg
ative Not used OFF ON
Incremental counting:
target value = elapsed value + TargetPulseCount (target value register) (elapsed
value register)
Absolute counting:
target value = 0 + TargetPulseCount (target value register)
Parameter Fmin of the DUT
Fmin values 40 ... 5000 frequency 40 Hz ... 5.0 kHz
Parameter Fmax of DUT
Fmax values 40 ... 9500 frequency 40 Hz ... 9.5 kHz
Parameter Tdelay of DUT
Tdelay values 30 ... 32767 ramp time 30 ms ... 327.67 s
Matsushita Electric Works (Europe) AG
14 – 163
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
Parameter TargetPulseCount of DUT
TargetPulseCount values –8388608 or 16#FF800000 ... 8388607 or 16#7FFFFF
,
Example
DUT: Define the DUT as described before and enter the parameter s (Init, Fmin, .
..) into the data table. List of global variables: Enter the DUT into the list o
f global variables as described before. Either set the initalizing parameters or
assign the initialization values to the DUT elements (e.g.: SPD_DUT.Init=16#010
2) in you PLC programming code. POU Header:
Class Identifier Type Initial
SPD Init:=16#0102 Fmin:=500 Fmax:=5000 Tdelay:=4000 TargetPulseCount: =15000
Comment
SDT für F68_SPD1
0 VAR_EXTERNAL SPD_DUT
1 VAR
F168_start
BOOL FALSE
F168 start condition
POU Body (Instruction List):
LD F168_SPD1 F168_start SPD_DUT.Init,0 Load start condition execute F168
POU Body (Ladder Diagramm):
* next page
14 – 164
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions
+ Notes
D The message ’Function executed’ (R903A/B) appears during the PLC program, and
not when the function is merely called up. D While the registers R903A/B have th
e status TRUE, no further HSC commands can be executed (calling F168 has no effe
ct). D Pulses are output by the HSC until the elapsed value equals the target va
lue. D If you edit your program online (RUN mode), the number of output pulses m
ay be wrong. D Error Flags:
No.
R9007 R9008
IEC–Address
%MX0.900.7 %MX0.900.8
set
ON ON
if
index is too high Fmin > Fmax
Matsushita Electric Works (Europe) AG
14 – 165
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
F169
Outline
Steps Availability
(PLS)
Pulse Width Modulation y 40 Hz
5
TR type of FP0
PLC outputs pulses greater than/equal to 40Hz to a PLC output according to the p
arameters defined in a data table.
J Data Types
Variable
s n*
Data Types
ARRAY [0..1] OF INT or WORD INT, WORD
J Operands
For
s n*
Relais
WX – – WY – – WR – – WL – –
T/C
SV – – EV – – DT – – x: –:
Register
LD – – FL – –
available not available
Values for n
Used output: Elapsed value register: Used channel: ON during execution:
0
Y0 (direction Y2) DDT9044 CH0 of HSC0 R903A
1
Y1 (direction Y3) DDT9048 CH1 of HSC0 R903B
+ Note
If R903A/R903B has the status TRUE, no other high–speed counter related instruct
ions can be executed (calling the F169 instruction has no effect).
The frequency can be changed during execution of F169. The new settings will be
used after the actual ON/OFF period has finished. Use F170_PWM function for freq
uency smaller than/equal to 38Hz. Values for s ARRAY: ARRAY[0] = 16#0XYZ X = pul
se width (ON/OFF time):
X values
1 2 ... 8 9
ON time
10 20 ... ON 80 90 % ON % ON % % ON % ON
OFF time
90 80 ... OFF 20 10 % OFF % OFF % % OFF % OFF
* next page
14 – 166
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions
Y = pulse count mode Z = direction output
YZ values
00 10 12 13 20 22 23
Pulse count mode
No counting Incremental counting Incremental counting Incremental counting Decre
mental counting Decremental counting Decremental counting
Direction output
Not used Not used OFF ON Not used ON OFF
The pulse count mode and the direction output parameters cannot be changed durin
g the execution of F169. Restart the function to activate newly set parameters.
ARRAY[1] value
40 41 ... 9999 10000
Frequency
40 41 ... 9.99 10 Hz Hz kHz kHz
The frequency can be changed during execution of F169. The new settings will be
used after the actual ON/OFF period has finished. Use F170_PWM function for freq
uency smaller than/equal to 38Hz.
+ Notes
D If R903A/R903B has the status TRUE, no other high–speed counter related instru
ctions can be executed (calling the F169 instruction has no effect). D If the fr
equency (see ARRAY[1]) is high, very small or very high pulse width values (see
ARRAY[0]) can deformat the pulse output as a result of the limited edge steepnes
s of the PLC outputs.
D The frequency and the pulse–width repetition rate can be changed in each PLC c
ycle. D If incremental counting is choosen, pulse output stops as soon as the va
lue of the register exceeds the value 16#7FFFFF.
Matsushita Electric Works (Europe) AG
14 – 167
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
The pulse width (ON/OFF time) can be changed during execution of F169. The new s
ettings will be used after the end of the actual ON/OFF period.
D If decremental counting is choosen, pulse output stops as soon as the value of
the register is less than the value 16#FF800000. D Pulse output may be stopped
if the PLC program is changed online (RUN mode).
,
Example
POU Header Class
0 VAR
Identifier
PLS
Type
ARRAY [0..1] OF INT
Initial
16#0410,100 0
Comment
PLS ARRAY: 40% ON 60%OFF incremental counting – no direction output
1
VAR
F169_start
BOOL
FALSE
F169 Start condition
IL Body
LD F169_PLS F169_start PLS,0 Load start condition execute F169
LD Body
+ Note
Assign a number to the input variable (e.g. Monitor –> Monitor Header, click the
variable, enter the value, press <Enter>) or replace the input variables by num
bers.
14 – 168
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions Steps Availability
F170
Outline
J Data Types
(PWM)
Pulse Width Modulation
5
TR type of FP0
This function outputs outputs defined in a data table to an output of a PLC.
Variable
s n*
Data Types
ARRAY [0..1] OF INT or WORD INT, WORD
J Operands
For
s n*
Relais
WX – – WY – – WR – – WL – –
T/C
SV – – EV – – DT – – x: –:
Register
LD – – FL – –
available not available
Values for n
Used output: Used channel: ON during execution:
0
Y0 CH0 of HSC0 R903A
1
Y1 CH1 of HSC0 R903B
Values for s ARRAY
ARRAY[0] values
0 (16#0) 1 (16#1) 2 (16#2) 3 (16#3) 4 (16#4) 5 (16#5) 6 (16#6) 7 (16#7) 8 (16#8)
17 (16#11) 18 (16#12) 19 (16#13) 20 (16#14) 21 (16#15) 22 (16#16)
Frequency
38 19 9.5 4.8 2.4 1.2 0.6 0.3 0.15 1 714 500 400 200 100 Hz Hz Hz Hz Hz Hz Hz Hz
Hz Hz Hz Hz Hz Hz Hz
Cycle duration
(26 (52 (105 (210 (420 (840 (1.6 (3.4 (6.7 (1 (1.4 (2 (2.5 (5 (10 ms) ms) ms) ms
) ms) ms) s) s) s) ms)* ms)* ms)* ms)* ms)* ms)*
(* Available beginning with Version 2.0). The frequency cannot be changed during
execution of F170. Restart the function to aktivate newly set parameters.
Use F169_PLS function for frequency f > 38Hz.
Matsushita Electric Works (Europe) AG
14 – 169
Matsushita Instruction Set Basic and High–level Instructions ARRAY[1] values
0 1 2 ... 998 999 1000
NAiS Control 1131
ON time
0 0.1 0.2 ... 99.8 99.9 100 % ON % ON % ON % ON % ON % ON % ON
OFF time
100 99.9 99.8 ... 0.2 0.1 0 % OFF % OFF % OFF % OFF % OFF % OFF % OFF
The pulse width (ON/OFF time) can be changed during execution of F170. The chang
es are valid after the current periode is finished.
+ Notes
D If the special relays R903A/B have the status TRUE, no other high–speed counte
r related instructions can be executed (calling the F170 instruction has no effe
ct). D If the frequency (see ARRAY[1]) is high, very small or very high pulse wi
dth values (see ARRAY[0]) can deformat the pulse output as a result of the limit
ed edge steepness of the PLC outputs.
D The period can be changed in each PLC cycle. The frequency is only assumed whe
n this function is started.
,
Example
POU Header
Class
0 VAR
Identifier
PWM
Type
ARRAY [0..1] OF INT BOOL
Initial 2(0)
Comment
PWM ARRAY
1
VAR
F170_start
FALSE
F170 start condition
POU Body (Instruction List):
LD ST LD ST LD F170_PWM 5 PWM [0] 500 PWM [1] F170_start PWM,0 load start condit
ion execute F170 define PWM parameters 5 = Frequency 1.2 Hz 500 = ON time 50% OF
F time 50%
* next page
14 – 170
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions
POU Body (Ladder Diagram):
+ Note
Assign a number to the input variable (e.g. Monitor –> Monitor Header, click the
variable, enter the value, press <Enter>) or replace the input variables by num
bers.
Matsushita Electric Works (Europe) AG
14 – 171
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
F183
Outline
(DSTM)
Steps Availability
Special 32–bit timer
FP0
The F183 instruction activates an upward counting 32 bit timer which works on–de
layed. The smallest counting unit is 0.01s. During execution of F183 (start = TR
UE), elapsing time is added to the elapsed value d. The timer output q and the s
pecial internal relay R900D will be set if the elapsed value d equals the set va
lue s. If the start condition start is set to FALSE, execution will be interrupt
ed and the elapsed value d will be reset to zero. The set value s can be changed
during execution of F183.
In(start) Elapsed value(d) Set value(s)
Out(q)
The delay time of the timer can be calculated using the following formula: (Set
Value s) * (0.01s) = on–delay
+ Note
If you use R900D as the timer contact, be sure to program it immediately after t
he timer instruction.
start :Timer operation condition s: Set Value (0 to 2147483647), other values ar
e considered as 0. d : Elapsed Value (0 to 2147483647) q : Timer output J Data T
ypes
Variable
start, q s
Data Types
BOOL DINT, DWORD
* next page
14 – 172
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions
J Operands
For
s start q
Relay
T/C
DEV x C x –
Register
DDT x DT – – x: –: DLD – LD – – DFL – FL – –
DWX DWY DWR DWL DSV x X x – x Y x x x R x x – L – – x T x –
,
available not available
Example
POU–Header:
Class
0 1 2 3 VAR VAR VAR VAR
Identifier
In Out Set_Value Elapsed_Value
Type
BOOL BOOL DINT DINT
Initial
FALSE FALSE 10000 0
Comment
start condition ON if timer runs out set value for timer (100 s) elapsed value o
f timer
POU–Body (Instruction List):
LD F183_DSTM ST In Set_Value Elapsed_Value Out load starting condition execute t
he timer store result of timer
POU–Body (Ladder Diagram):
+ Note
Assign a number to the input variable (for example: Monitor"Monitor Header, clic
k the variable, enter the value, press <Enter>) or replace the input variables b
y numbers.
Matsushita Electric Works (Europe) AG
14 – 173
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
F327 (INT)
Outline
Floating point data " 16–bit integer data (the largest integer not exceeding the
floating point data)
Steps Availability
8 FP0
The function converts a floating point data at input s in the range –32767.99 to
32767.99 into integer data (including +/– sign). The result of the function is
returned at output d. The converted integer value at output d is always less tha
n or equal to the floating point value at input s: When there is a positive floa
ting point value at the input, a positive pre–decimal value is returned at the o
utput. When there is a negative floating point value at the input, the next smal
lest pre–decimal value is returned at the output. If the floating point value ha
s only zeros after the decimal point, its pre–decimal point value is returned. T
he difference between the F and the P instruction is that the P instruction is o
nly executed at the leading edge scan of the EN trigger.
J Data Types
Variable
s d
Data Types
REAL INT
J Operands
For
s d – x x x x x x x: –: x x
Relay
T/C
DEV x EV
Register
DDT x DT DLD x LD DFL x FL
DWX DWY DWR DWL DSV x WX x WY x WR x WL x SV
,
available not available
Example
In this example the function F327_INT is programmed in ladder diagram (LD) and i
nstruction list (IL). The same POU header is used for both programming languages
.
* next page
14 – 174
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions
POU Header In the POU header, all input and output variables are declared that a
re used for programming this function.
In this example, the input variable input_value is declared. However, you can wr
ite a constant directly at the input contact of the function instead. Body When
the variable start is set to TRUE, the function is carried out. It converts the
floating point value –1.234 into the whole number value –2, which is transferred
to the variable output_value at the output. Since the whole number may not exce
ed the floating point value, the function rounds down here. LD Body
IL Body
+ Note
The following error flags apply to F/P327:
No.
R9007 R9008 R900B
IEC Address
%MX0.900.7 %MX0.900.8 %MX0.900.1 1
set
permanently for an instant to TRUE
if
the value at input s is not a REAL number, or the converted result exceeds the r
ange of output d the result is 0
Matsushita Electric Works (Europe) AG
14 – 175
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
F328 (DINT)
Outline
Floating point data " 32–bit Steps Availability integer data (the largest intege
r not FP0 8 exceeding the floating point data)
The function converts a floating point data at input s in the range –2147483000
to 214783000 into integer data (including +/– sign). The result of the function
is returned at output d. The converted integer value at output d is always less
than or equal to the floating point value at input s: When there is a positive f
loating point value at the input, a positive pre–decimal value is returned at th
e output. When there is a negative floating point value at the input, the next s
mallest pre–decimal value is returned at the output. If the floating point value
has only zeros after the decimal point, its pre–decimal point value is returned
. The difference between the F and the P instruction is that the P instruction i
s only executed at the leading edge scan of the EN trigger.
J Data Types
Variable
s d
Data Types
REAL DINT
J Operands
For
s d
Relay
T/C
DEV x x
Register
DDT x x x: –: DLD x x DFL x x
DWX DWY DWR DWL DSV x – x x x x x x x x
,
available not available
Example
In this example the function F328_DINT is programmed in ladder diagram (LD) and
instruction list (IL). The same POU header is used for both programming language
s.
* next page
14 – 176
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions
POU Header In the POU header, all input and output variables are declared that a
re used for programming this function.
In this example, the input variable input_value is declared. However, you can wr
ite a constant directly at the input contact of the function instead. Body When
the variable start is set to TRUE, the function is carried out. It converts the
floating point value –1234567.89 into the whole number value –1234568, which is
transferred to the variable output_value at the output. Since the whole number m
ay not exceed the floating point value, the function rounds down here. LD Body
IL Body
+ Note
The following error flags apply to F/P328:
No.
R9007 R9008 R900B
IEC Address
%MX0.900.7 %MX0.900.8 %MX0.900.1 1
set
permanently for an instant to TRUE
if
the value at input s is not a REAL number, or the converted result exceeds the r
ange of output d the result is 0
Matsushita Electric Works (Europe) AG
14 – 177
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
F333 (FINT)
Outline
Rounding the first decimal point down
Steps Availability
8 FP0
The function rounds down the decimal part of the real number data and returns it
at output d. The difference between the F and the P instruction is that the P i
nstruction is only executed at the leading edge scan of the EN trigger.
J Data Types
Variable
s d
Data Types
REAL REAL
J Operands
For
s d
Relay
T/C
DEV x x
Register
DDT x x x: –: DLD x x DFL x x
DWX DWY DWR DWL DSV x – x x x x x x x x
,
available not available
Example
In this example the function F333_FINT is programmed in ladder diagram (LD) and
instruction list (IL). The same POU header is used for both programming language
s. POU Header In the POU header, all input and output variables are declared tha
t are used for programming this function.
In this example, the input variable input_value is declared. However, you can wr
ite a constant directly at the input contact of the function instead.
* next page
14 – 178
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions
Body The value 1234.888 is assigned to the variable input_value. When the variab
le start is set to TRUE, the function is carried out. It rounds down the input_v
alue after the decimal point and returns the result (here: 1234.000) at the vari
able output_value. LD Body
IL Body
+ Note
The following error flags apply to F/P333:
No.
R9007 R9008 R900B R9009
IEC Address
%MX0.900.7 %MX0.900.8 %MX0.900.1 1 %MX0.900.9
set
permanently for an instant to TRUE for an instant
if
the value at input s is not a REAL number
the result is 0 the result causes an overflow
Matsushita Electric Works (Europe) AG
14 – 179
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
F334 (FRINT)
Outline
Rounding the first decimal point off
Steps Availability
8 FP0
The function rounds off the decimal part of the real number data and returns it
at output d. The difference between the F and the P instruction is that the P in
struction is only executed at the leading edge scan of the EN trigger.
J Data Types
Variable
s d
Data Types
REAL REAL
J Operands
Relay For
s d
T/C
DEV x x
Register
DDT x x x: –: DLD x x DFL x x
DWX DWY DWR DWL DSV x – x x x x x x x x
,
available not available
Example
In this example the function F334_FRINT is programmed in ladder diagram (LD) and
instruction list (IL). The same POU header is used for both programming languag
es. POU Header In the POU header, all input and output variables are declared th
at are used for programming this function.
In this example, the input variable input_value is declared. However, you can wr
ite a constant directly at the input contact of the function instead.
* next page
14 – 180
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions
Body When the variable start is set to TRUE, the function is carried out. It rou
nds off the input_value = 1234.567 after the decimal point and returns the resul
t (here: 1235.000) at the variable output_value. LD Body
IL Body
+ Note
The following error flags apply to F/P334:
No.
R9007 R9008 R900B R9009
IEC Address
%MX0.900.7 %MX0.900.8 %MX0.900.1 1 %MX0.900.9
set
permanently for an instant to TRUE for an instant
if
the value at input s is not a REAL number
the result is 0 the result causes an overflow
Matsushita Electric Works (Europe) AG
14 – 181
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
F335
Outline
(FSIGN)
Floating point data sign changes (negative/positive conversion)
Steps Availability
8 FP0
The function changes the sign of the floating point value at input s and returns
the result at output d. The difference between the F and the P instruction is t
hat the P instruction is only executed at the leading edge scan of the EN trigge
r.
J Data Types
Variable
s d
Data Types
REAL REAL
J Operands
Relay For
s d
T/C
DEV x x
Register
DDT x x x: –: DLD x x DFL x x
DWX DWY DWR DWL DSV x – x x x x x x x x
,
available not available
Example
In this example the function F335_FSIGN is programmed in ladder diagram (LD) and
instruction list (IL). The same POU header is used for both programming languag
es. POU Header In the POU header, all input and output variables are declared th
at are used for programming this function.
In this example, the input variable input_value is declared. However, you can wr
ite a constant directly at the input contact of the function instead.
* next page
14 – 182
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions
Body The value 333.4 is assigned to the variable input_value. When the variable
start is set to TRUE, the function is carried out. The output_value is then –333
.4. LD Body
IL Body
+ Note
The following error flags apply to F/P335:
No.
R9007 R9008 R9009
IEC Address
%MX0.900.7 %MX0.900.8 %MX0.900.9
set
permanently for an instant for an instant
if
the value at input s is not a REAL number
the result causes an overflow
Matsushita Electric Works (Europe) AG
14 – 183
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
F337
Outline
(RAD)
Conversion of angle units (Degrees " Radians)
Steps Availability
8 FP0
The function converts the value of an angle entered at input s from degrees to r
adians and returns the result at output d.The difference between the F and the P
instruction is that the P instruction is only executed at the leading edge scan
of the EN trigger.
J Data Types
Variable
s d
Data Types
REAL REAL
J Operands
For
s d
Relay
T/C
DEV x x
Register
DDT x x x: –: DLD x x DFL x x
DWX DWY DWR DWL DSV x – x x x x x x x x
,
available not available
Example
In this example the function F337_RAD is programmed in ladder diagram (LD) and i
nstruction list (IL). The same POU header is used for both programming languages
. POU Header In the POU header, all input and output variables are declared that
are used for programming this function.
In this example, the input variable input_value is declared. However, you can wr
ite a constant directly at the input contact of the function instead.
* next page
14 – 184
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions
Body When the variable start is set to TRUE, the function is carried out. LD Bod
y
IL Body
+ Note
The following error flags apply to F/P337:
No.
R9007 R9008 R900B R9009
IEC Address
%MX0.900.7 %MX0.900.8 %MX0.900.1 1 %MX0.900.9
set
permanently for an instant to TRUE for an instant
if
the value at input s is not a REAL number
the result is 0 the result causes an overflow
Matsushita Electric Works (Europe) AG
14 – 185
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
F338 (DEG)
Outline
Conversion of angle units (Radians " Degrees)
Steps Availability
8 FP0
The function converts the value of an angle entered at input s from radians to d
egrees and returns the result at output d. The difference between the F and the
P instruction is that the P instruction is only executed at the leading edge sca
n of the EN trigger.
J Data Types
Variable
s d
Data Types
REAL REAL
J Operands
For
s d
Relay
T/C
DEV x x
Register
DDT x x x: –: DLD x x DFL x x
DWX DWY DWR DWL DSV x – x x x x x x x x
,
available not available
Example
In this example the function F338_DEG is programmed in ladder diagram (LD) and i
nstruction list (IL). The same POU header is used for both programming languages
. POU Header In the POU header, all input and output variables are declared that
are used for programming this function.
In this example, the input variable input_value is declared. However, you can wr
ite a constant directly at the input contact of the function instead.
* next page
14 – 186
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions
Body When the variable start is set to TRUE, the function is carried out. LD Bod
y
IL Body
+ Note
The following error flags apply to F/P338:
No.
R9007 R9008 R900B R9009
IEC Address
%MX0.900.7 %MX0.900.8 %MX0.900.1 1 %MX0.900.9
set
permanently for an instant to TRUE for an instant
if
the value at input s is not a REAL number
the result is 0 the result causes an overflow
Matsushita Electric Works (Europe) AG
14 – 187
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
F355
Outline
Steps Availability
(PID)
PID processing instruction
4
FP0
The PID processing instruction is used to regulate a process (e.g. a heater) giv
en a measured value (e.g. temperature) and a predetermined output value (e.g. 20
_C). The function calculates a PID algorithm whose parameters are determined in
a data table in the form of an ARRAY with 30 elements that is entered at input s
. The data table contains the following parameters: ARRAY[0]: Control mode ARRAY
[1]: Set value (SP) ARRAY[2]: Measured value (PV) ARRAY[3]: Output value (MV) AR
RAY[4]: Output lower limit ARRAY[5]: Output upper limit ARRAY[6]: Proportional g
ain (Kp) ARRAY[7]: Integral time (Ti) ARRAY[8]: Derivative time (Td) ARRAY[9]: C
ontrol cycle (Ts) ARRAY[10]: Auto–tuning progress ARRAY[11] through ARRAY[29]: a
re utilized internally by the PID controller. The difference between the F and t
he P instruction is that the P instruction is only executed at the leading edge
scan of the EN trigger.
J Detailed description of the data table for F355_PID ARRAY[0]: Control mode Wit
h this you select the type of PID processing and the activation (X = 8) of the a
uto–tuning. 16#X000: Reverse operation PI–D 16#X001: Forward operation PI–D 16#X
002: Reverse operation I–PD 16#X003: Forward operation I–PD
* next page
14 – 188
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions
+ Note
The I–PD processing is somewhat more flexible than the PI–D processing and there
fore needs more time to adjust. Forward and Reverse operation: The output value
(MV) rises when the measured value (PV) sinks (e.g. heating). Forward operation:
The output value (MV) rises when the measured value (PV) rises (e.g. cooling).
Auto–tuning When the most significant bit (MSB) in ARRAY[0] is set to 1, the aut
o tuning is activated. The optimum values for the PID parameters Kp, Ti, and Td
are determined by measuring the responses of the process and are stored in ARRAY
[6], ARRAY[7] and in ARRAY[8]. Thereafter the auto tuning is deactivated (MSB in
ARRAY[0] is set to 0). Since some operations do not permit auto tuning, the MSB
in ARRAY[0] can be reset to 0 during the auto tuning process, thereby stopping
the auto tuning. In this case the processing is carried out based on the origina
l parameters. ARRAY[1]: Set value (SP) Here you set the target value that should
be reached through the control process. It should fall within the range of the
measured value. When using an analogue input, you can use a range between 0 and
4000. ARRAY[2]: Measured value (PV) Here you enter the measured value that you w
ant to be corrected via the operation. An analogue–digital converter is necessar
y for this. Adjust it so that the range of the measured value corresponds to tha
t of the set value. ARRAY[3]: Output value (MV) The output value (the result of
the PID operation) is stored in this data word. When using an analogue output, t
he range lies between 0 and 4000 or between –2000 and +2000. ARRAY[4]: Output lo
wer limit Here you enter a lower limit of the output value between 0 and 10000.
The value must be smaller than the output value’s upper limit.
Matsushita Electric Works (Europe) AG
14 – 189
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
ARRAY[5]: Output upper limit Here you enter a lower limit of the output value be
tween 1 and 10000. The value must be larger than the output value’s lower limit.
ARRAY[6]: Proportional gain (Kp) In this data word, you write the parameter Kp.
The stored value multiplied by 0.1 corresponds to the actual value of Kp. Value
s in the range of 1 to 9999 (0.1 to 999.9 in 0.1 steps) can be entered. If the a
uto tuning control is activated, this value is automatically adjusted and rewrit
ten. ARRAY[7]: Integral time (Ti) In this data word, you write the parameter Ti.
The stored value multiplied by 0.1 corresponds to the actual value of Ti. Value
s in the range of 1 to 30000 (0.1 to 3000s in 0.1s steps) can be entered. If the
auto tuning control is activated, this value is automatically adjusted and rewr
itten. ARRAY[8]: Derivative time (Td) In this data word, you write the parameter
Td. The stored value multiplied by 0.1 corresponds to the actual value of Td. V
alues in the range of 1 to 10000 (0.1 to 1000s in 0.1s steps) can be entered. If
the auto tuning control is activated, this value is automatically adjusted and
rewritten. ARRAY[9]: Control cycle (Ts) Here you set the cycle for executing PID
processing. The value of the data word multiplied by 0.01 corresponds to the ac
tual value of Ts. Values in the range of 1 to 6000 (0.01s to 60.0s in 0.01s step
s) can be entered. ARRAY[10]:Auto–tuning progress When auto tuning is selected f
or the specified control mode (ARRAY[0]), a value from 1 to 5 will be stored ind
icating the progress of auto tuning. ARRAY[11..29]: PID work area The function F
355_PID uses this work area internally to calculate the PID operation.
* next page
14 – 190
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions
J Explanation of the operation of F355_PID
Standard structure of the controller loop with PID processing instruction.
The above POU body represents the standard control loop.The control input is det
ermined by the user (e.g. desired room temperature of 22_C). After the A/D conve
rsion the set value (SP) is entered as the input value for the PID processing in
struction.The measured value (PV) (e.g. current room temperature) is normally tr
ansmitted via a sensor and entered as the input value for the PID processor. F35
5_PID calculates the standard tolerance e from the set value and the measured va
lue (e = set value – measured value). With the parameters given (proportional ga
in Kp, integral time Ti, ...) a new output value (MV) is calculated in increment
s set by the control cycle Ts. This result is then applied to the actuator (e.g.
a fan that regulates room temperature) after the D/A conversion.The analogue se
ction represents the system’s actuator, e.g. heater and temperature regulation o
f a room. A PID operation consists of three components: 1. Proportional part (P
part) A proportional part generates an output that is proportional to the input.
The proportional gain Kp determines by how much the input value is increased or
decreased.
,
Example
A proportional part can be a simple electric resistor or a linear amplifier, for
example.
The P part displays a relatively large maximum overshot, a long settling time an
d a constant standard tolerance.
Matsushita Electric Works (Europe) AG
14 – 191
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
2. Integral part (I part) An integral part produces an output quantity that corr
esponds to the time integral and input quantity (area of the input quantity). Th
e integral time thus evaluates the output quantity MVi. The integral part can be
a quantity scale of a tank that is filled by a volume flow, for example. Becaus
e of the slow reaction time of the integral part, it has a larger maximum oversh
ot than the P component, but no constant standard tolerance.
, Example:
Input quantity e and the output quantity MVi produced.
3. Derivative part (D part) The derivative part produces an output quantity that
corresponds to the time derivation of the input quantity. The derivative time c
orresponds to the weighting of the derived input quantity. A derivative componen
t can be an RC–bleeder (capacitor hooked up in series and resistance in parallel
), for example.
* next page
14 – 192
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions
,
Example
Input quantity e and the output quantity MVd produced.
4. PID controller A PID controller is a combination of a P component, an I compo
nent and a D component. When the parameters Kp, Ti and Td are optimally adjusted
, a PID controller can quickly control and maintain a quantity at a predetermine
d set value.
Reference equations for calculating the controller output MV The following equat
ions are used to calculate the controller output MV under the following conditio
ns: In general: The output value at time period n is calculated from the previou
s output value (n–1) and the change in the output value in this time interval.
Reverse operation PI–D
ARRAY[0] = 16#X000
Matsushita Electric Works (Europe) AG
14 – 193
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
Forward operation PI–D
ARRAY[0] = 16#X001
Reverse operation I–PD
ARRAY[0] = 16#X002
Forward operation I–PD
ARRAY[0] = 16#X003
J Data Types
Variable
s
Data Type
ARRAY [0..29] of INT or WORD
J Operands
Relay For
s WX – WY – WR x WL x
T/C
SV x EV x DT x
Register
LD x x: –: FL x
available not available
* next page
14 – 194
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Basic and High–level Instructions
,
Example
In this example the function F355_PID is programmed in ladder diagram (LD) and i
nstruction list (IL). The same POU header is used for both programming languages
. Global Variable List
POU Header In the POU header, all input and output variables are declared that a
re used for programming this function.
In the initialization of the ARRAY Lookup_Table, the upper limit of the controll
er output is set to 4000. The proportional gain Kp is initially set at 80 (8), T
i and Td at 200 (20s) and the control cycle Ts at 100 (1s). Body The standard fu
nction E_MOVE copies the value 16#8000 to the first element of the Lookup_Table
when the variable activeautotuning is set from FALSE to TRUE (i.e. activates the
control mode auto tuning in the function F355_PID). The variables Set_Value_SP
and Process_Value_PV are assigned to the second and third elements of data table
. They receive their values from the A/D converter CH0 and CH1. Because of EN in
put of F355_PID is connected to the power rail, the function is carried out, whe
n the PLC is in RUN mode. The calculated controller output is stored in the four
th element of data table and assigned to the variable Output_Value_MV. Its value
is returned via a D/A converter from the PLC to the output of the system.
Matsushita Electric Works (Europe) AG
14 – 195
Matsushita Instruction Set Basic and High–level Instructions
NAiS Control 1131
LD Body
IL Body
+ Note
The following error flags apply to F/P355:
No.
R9007 R9008
IEC Address
%MX0.900.7 %MX0.900.8
set
permanently for an instant
if
the parameter settings are outside the allowed range.
14 – 196
Matsushita Electric Works (Europe) AG
Chapter 15 Standard Matsushita Function Blocks
CT_FB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 – 3 T
M_1ms_FB . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 – 6 TM_10ms_
FB . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 – 9 TM_100ms_FB . .
. . . . . . . . . . . . . . . . . . . . . . . 15 – 12 TM_1s_FB . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . 15 – 15
Matsushita Instruction Set
NAiS Control 1131
15 – 2
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Standard Matsushita Function Blocks
CT_FB
Outline
Counters realized with the CT_FB function block are down counters. The count are
a SV (set value) is 1 to 32767. For the CT_FB function block declare the followi
ng: Count: count contact each time a rising edge is detected at Count, the value
1 is subtracted from the elapsed value EV until the value 0 is reached reset co
ntact each time a rising edge is detected at Reset, the value 0 is assigned to E
V and the signal output C is reset; each time a falling edge is detected at Rese
t, the value at SV is assigned to EV set value value of EV after a reset procedu
re signal output is set when EV becomes 0 elapsed value current counter value
Reset:
SV: C: EV: J Data Types
Input Variable
Count, Reset, C SV, EV
Output Variable
BOOL INT, WORD
J Time Chart
Matsushita Electric Works (Europe) AG
15 – 3
Matsushita Instruction Set Standard Matsushita Function Blocks
NAiS Control 1131
+ Notes
D In order to work correctly, the CT_FB function block needs to be reset each ti
me before it is used. D The number of available counters is limited and depends
on the settings in the system registers 5 and 6. The compiler assigns a NUM* add
ress to every counter instance. The addresses are assigned counting downwards, s
tarting at the highest possible address. D The Matsushita CT function (down coun
ter) uses the same NUM* address area (Num* input). In order to avoid errors (add
ress conflicts), the CT function and the CT_FB function block should not be used
together in a project.
,
Example
CT_FB In the following example the function block CT_FB is programmed in ladder
diagram (LD) and instruction list (IL). The same POU header is used for both pro
gramming languages. POU Header All input and output variables which are used for
programming the function block CT_FB are declared in the POU header. This also
includes the function block (FB) itself. By declaring the FB you create a copy o
f the original FB. This copy is saved under copy_name, and a separate data area
is reserved.
This example uses variables. You may also use constants for the input variables.
* next page
15 – 4
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Standard Matsushita Function Blocks
LD Body
IL Body If you want to call up the function block in an instruction list, enter
the following:
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not.
Matsushita Electric Works (Europe) AG
15 – 5
Matsushita Instruction Set Standard Matsushita Function Blocks
NAiS Control 1131
TM_1ms_FB
Outline
This timer for 0.001s units works as an ON–delay timer. If the start contact of
the function block is in the ON state, the preset time SV (set value) is started
. When this time has elapsed, the timer contact T turns ON. For the TM_1ms_FB fu
nction block declare the following: start: start contact each time a rising edge
is detected, the set value SV is copied to the elapsed value EV and the timer i
s started set value the defined ON–delay time (0 to 32.767s) timer contact is se
t when the time defined at SV has elapsed, this means when EV becomes 0 elapsed
value count value from which 1 is subtracted every 0.001s while the timer is run
ning
SV: T:
EV:
J Data Types
Input Variable
BOOL (start) INT, WORD (SV)
Output Variable
BOOL (T) INT, WORD (EV)
+ Notes
D The number of available timers is limited and depends on the settings in the s
ystem registers 5 and 6. D The Matsushita timer functions (TM_1s, TM_100ms, TM_1
0ms, and TM_1s) use the same NUM* address area as the Matsushita timer function
blocks (TM_1s_FB, TM_100ms_FB, TM_10ms_FB, and TM_1s_FB). For the timer function
blocks the compiler automatically assigns a NUM* address to every timer instanc
e. The addresses are assigned counting downwards, starting at the highest possib
le address. In order to avoid errors (address conflicts), these timer functions
and function blocks should not be used together in a project.
* next page
15 – 6 Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Standard Matsushita Function Blocks
J Time Chart
start ON OFF X SV 0 X EV T 0 ON OFF RUN mode
download PROG mode
, Example
TM_1ms_FB In the following example the function block TM_1ms_FB is programmed in
ladder diagram (LD) and instruction list (IL). The same POU header is used for
both programming languages. POU Header All input and output variables which are
used for programming the function block TM_1ms_FB are declared in the POU header
. This also includes the function block (FB) itself. By declaring the FB you cre
ate a copy of the original FB. This copy is saved under Alarm_Control, and a sep
arate data area is reserved.
This example uses variables. You may also use constants for the input variables.
Matsushita Electric Works (Europe) AG
15 – 7
Matsushita Instruction Set Standard Matsushita Function Blocks
NAiS Control 1131
LD Body
IL Body If you want to call up the function block in an instruction list, enter
the following:
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not.
15 – 8 Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Standard Matsushita Function Blocks
TM_10ms_FB
Outline
This timer for 0.01s units works as an ON–delay timer. If the start contact of t
he function block is in the ON state, the preset time SV (set value) is started.
When this time has elapsed, the timer contact T turns ON. For the TM_10ms_FB fu
nction block declare the following: start: start contact each time a rising edge
is detected, the set value SV is copied to the elapsed value EV and the timer i
s started set value the defined ON–delay time (0 to 327.67s) timer contact is se
t when the time defined at SV has elapsed, this means when EV becomes 0 elapsed
value count value from which 1 is subtracted every 0.01s while the timer is runn
ing
SV: T:
EV:
J Data Types
Input Variable
BOOL (start) INT, WORD (SV)
Output Variable
BOOL (T) INT, WORD (EV)
+ Notes
D The number of available timers is limited and depends on the settings in the s
ystem registers 5 and 6. D The Matsushita timer functions (TM_1s, TM_100ms, TM_1
0ms, and TM_1s) use the same NUM* address area as the Matsushita timer function
blocks (TM_1s_FB, TM_100ms_FB, TM_10ms_FB, and TM_1s_FB). For the timer function
blocks the compiler automatically assigns a NUM* address to every timer instanc
e. The addresses are assigned counting downwards, starting at the highest possib
le address. In order to avoid errors (address conflicts), these timer functions
and function blocks should not be used together in a project.
Matsushita Electric Works (Europe) AG
15 – 9
Matsushita Instruction Set Standard Matsushita Function Blocks
NAiS Control 1131
J Time Chart:
start ON OFF X SV 0 X EV T 0 ON OFF RUN mode
download PROG mode
, Example
TM_10ms_FB In the following example the function block TM_10ms_FB is programmed
in ladder diagram (LD) and instruction list (IL). The same POU header is used fo
r both programming languages. POU Header All input and output variables which ar
e used for programming the function block TM_10ms_FB are declared in the POU hea
der. This also includes the function block (FB) itself. By declaring the FB you
create a copy of the original FB. This copy is saved under Alarm_Control, and a
separate data area is reserved.
This example uses variables. You may also use constants for the input variables.
* next page
15 – 10
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Standard Matsushita Function Blocks
LD Body
IL Body If you want to call up the function block in an instruction list, enter
the following:
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not.
Matsushita Electric Works (Europe) AG 15 – 11
Matsushita Instruction Set Standard Matsushita Function Blocks
NAiS Control 1131
TM_100ms_FB
Outline
This timer for 0.1s units works as an ON–delay timer. If the start contact of th
e function block is in the ON state, the preset time SV (set value) is started.
When this time has elapsed, the timer contact T turns ON. For the TM_100ms_FB fu
nction block declare the following: start: start contact each time a rising edge
is detected, the set value SV is copied to the elapsed value EV and the timer i
s started set value the defined ON–delay time (0 to 3276.7s) timer contact is se
t when the time defined at SV has elapsed, this means when EV becomes 0 elapsed
value count value from which 1 is subtracted every 0.1s while the timer is runni
ng
SV: T:
EV:
J Data Types
Input Variable
BOOL (start) INT, WORD (SV)
Output Variable
BOOL (T) INT, WORD (EV)
+ Notes
D The number of available timers is limited and depends on the settings in the s
ystem registers 5 and 6. D The Matsushita timer functions (TM_1s, TM_100ms, TM_1
0ms, and TM_1s) use the same NUM* address area as the Matsushita timer function
blocks (TM_1s_FB, TM_100ms_FB, TM_10ms_FB, and TM_1s_FB). For the timer function
blocks the compiler automatically assigns a NUM* address to every timer instanc
e. The addresses are assigned counting downwards, starting at the highest possib
le address. In order to avoid errors (address conflicts), these timer functions
and function blocks should not be used together in a project.
* next page
15 – 12
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Standard Matsushita Function Blocks
J Time Chart:
start ON OFF X SV 0 X EV T 0 ON OFF RUN mode
download PROG mode
, Example
TM_100ms_FB In the following example the function block TM_100ms_FB is programme
d in ladder diagram (LD) and instruction list (IL). The same POU header is used
for both programming languages. POU Header All input and output variables which
are used for programming the function block TM_100ms_FB are declared in the POU
header. This also includes the function block (FB) itself. By declaring the FB y
ou create a copy of the original FB. This copy is saved under Alarm_Control, and
a separate data area is reserved.
This example uses variables. You may also use constants for the input variables.
Matsushita Electric Works (Europe) AG
15 – 13
Matsushita Instruction Set Standard Matsushita Function Blocks
NAiS Control 1131
LD Body
IL Body If you want to call up the function block in an instruction list, enter
the following:
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not.
15 – 14 Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Standard Matsushita Function Blocks
TM_1s_FB
Outline
This timer for 1s units works as an ON–delay timer. If the start contact of the
function block is in the ON state, the preset time SV (set value) is started. Wh
en this time has elapsed, the timer contact T turns ON. For the TM_1s_FB functio
n block declare the following: start: start contact each time a rising edge is d
etected, the set value SV is copied to the elapsed value EV and the timer is sta
rted set value the defined ON–delay time (0 to 32767s) timer contact is set when
the time defined at SV has elapsed, this means when EV becomes 0 elapsed value
count value from which 1 is subtracted every 1s while the timer is running
SV: T:
EV:
J Data Types
Input Variable
BOOL (start) INT, WORD (EV)
Output Variable
BOOL (T) INT, WORD (EV)
+ Notes
D The number of available timers is limited and depends on the settings in the s
ystem registers 5 and 6. D The Matsushita timer functions (TM_1s, TM_100ms, TM_1
0ms, and TM_1s) use the same NUM* address area as the Matsushita timer function
blocks (TM_1s_FB, TM_100ms_FB, TM_10ms_FB, and TM_1s_FB). For the timer function
blocks the compiler automatically assigns a NUM* address to every timer instanc
e. The addresses are assigned counting downwards, starting at the highest possib
le address. In order to avoid errors (address conflicts), these timer functions
and function blocks should not be used together in a project.
Matsushita Electric Works (Europe) AG
15 – 15
Matsushita Instruction Set Standard Matsushita Function Blocks
NAiS Control 1131
J Time Chart:
start ON OFF X SV 0 X EV T 0 ON OFF RUN mode
download PROG mode
, Example
TM_1s_FB In the following example the function block TM_1s_FB is programmed in l
adder diagram (LD) and instruction list (IL). The same POU header is used for bo
th programming languages. POU Header All input and output variables which are us
ed for programming the function block TM_1s_FB are declared in the POU header. T
his also includes the function block (FB) itself. By declaring the FB you create
a copy of the original FB. This copy is saved under Alarm_Control, and a separa
te data area is reserved.
This example uses variables. You may also use constants for the input variables.
* next page
15 – 16
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Matsushita Instruction Set Standard Matsushita Function Blocks
LD Body
IL Body If you want to call up the function block in an instruction list, enter
the following:
+ Note
It does not matter whether the function names in the IL editor are capitalized o
r not.
Matsushita Electric Works (Europe) AG 15 – 17
Matsushita Instruction Set
NAiS Control 1131
15 – 18
Matsushita Electric Works (Europe) AG
Appendix A
High–Speed Counter, Pulse and PWM Output
A.1 High–Speed Counter, Pulse and PWM Output A – 3 A.1.1 A.1.2 A.1.3 A.2 High–sp
eed counter function . . . . . . . A – 3 Pulse output function . . . . . . . . .
. . . . . A – 3 PWM output function . . . . . . . . . . . . . . A – 4
Specifications and Restricted Items . . . . . . . . . A – 5 A.2.1 A.2.2 Specific
ations . . . . . . . . . . . . . . . . . . . . . A – 5 Functions and Restriction
s . . . . . . . . . A – 7
A.3
High–Speed Counter Function . . . . . . . . . . . . . . A – 9 A.3.1 A.3.2 Types
of Input Modes . . . . . . . . . . . . . . A – 9 I/O Allocation . . . . . . . .
. . . . . . . . . . . . A – 11
A.4
Pulse Output Function . . . . . . . . . . . . . . . . . . . . A – 12 A.4.1 A.4.2
A.4.3 A.4.4 A.4.5 SDT Variables . . . . . . . . . . . . . . . . . . . A – 12 Po
sitioning Function F168 . . . . . . . . . A – 13 Pulse Output Function F169 . .
. . . . . A – 14 High–Speed Counter Control Instruction F0_MV . . . . . . . . .
. . . . . . . . . . . . . . . . . A – 15 Elapsed Value Change and Read Instructi
on F1_DMV . . . . . . . . . . . . . . . . A – 16
A.5
Sample Program for Positioning Control . . . . A – 17 A.5.1 A.5.2 A.5.3 Relative
Value Positioning Operation (Plus Direction) . . . . . . . . . . . . . . . . .
. . A – 18 Relative Value Positioning Operation (Minus Direction) . . . . . . .
. . . . . . . . . . . A – 19 Absolute Value Positioning Operation . . . . . . .
. . . . . . . . . . . . . . . . A – 20
Appendix A
NAiS Control 1131
A.5.4 A.5.5 A.5.6 A.5.7 A.5.8
Home Return Operation (Minus Direction) . . . . . . . . . . . . . . . . . . . .
. . . . A – 21 Home Return Operation (Plus Direction) . . . . . . . . . . . . .
. . . . . . . . . . . A – 22 JOG Operation (Plus Direction) . . . . A – 23 JOG O
peration (Minus Direction) . . . A – 24 Emergency Stop . . . . . . . . . . . . .
. . . . A – 24
A–2
Matsushita Electric Works (Europe) AG
NAiS Control 1131 A.1
Appendix A High–Speed Counter, Pulse and PWM Output
A.1
High–Speed Counter, Pulse and PWM Output
There are three functions available when using the high–speed counter built into
the FP0 programmable controller. There are four channels for the built–in high–
speed counter. The channel number allocated for the high–speed counter will chan
ge depending on the function being used. The counting range is: K–8388608 to K83
88607 (HFF8000 to H7FFFFF), coded 24–bit binary.
A.1.1
High–speed counter function
The high–speed counter function counts external inputs such as those from sensor
s or encoders. When the count reaches the target value, this function turns the
desired output ON and OFF.
Roller Cutter
Wire Motor Encoder Inverter START STOP signal FP0
Encoder output is input to the high– speed counter
Cutter blade control signal
A.1.2
Pulse output function
Combined with a commercially available motor, the pulse output function enables
positioning control. With the appropriate instruction, you can perform trapezoid
al control, origin return, and JOG operation.
FP0 Y0 Y2 CW/CCW Motor Pulse output Motor driver 1
Pulse output Y1 CW/CCW Y3 Motor driver 2 Motor
Matsushita Electric Works (Europe) AG
A–3
Appendix A A.1 Outline of Functions
NAiS Control 1131
A.1.3
PWM output function
By using the appropriate instruction, the PWM output function enables a pulse ou
tput of the desired duty ratio.
When you increase the pulse width...
When you decrease it...
heating increases.
heating decreases.
A–4
Matsushita Electric Works (Europe) AG
NAiS Control 1131 A.2
Appendix A Specifications and Restricted Items
A.2
Specifications and Restricted Items
A.2.1
Specifications
High–Speed Counter
Input/output contact number being used Input contact number (value in parenthesi
s is reset input) X0 (X2) Specify the desired output from Y0 to Y7 X1 (X2) X3 (X
5) X4 (X5) Specify the desired output from Y0 to Y7 2–phase input Incremental/ d
ecremental input Directional distinction X0 X1 (X2) X3 X4 (X5)
Memory area used Built–in high– speed counter Control Elapsed value channel flag
area no.
Performance specifications Related Maximum instructions counting speed
ON/OFF output
Count mode
Target value area
Minimum input pulse width
CH0
R903A
Incremental input Decremental input
CH1
R903B
50 ms DT9048 DT9050 <10 kHz> to to DT9049 DT9051 DT9104 DT9106 to to DT9105 DT91
07 DT9108 DT9110 to to DT9109 DT9111
DT9044 to DT9045
DT9046 to DT9047
CH2
R903C
Total of 4 CH with max. 10 kHz
F0(MV) F1(DMV) F166(HC1S) F167(HC1R)
100 ms <5 kHz>
CH3
R903D
CH0
R903A
DT9044 DT9046 50 ms to to <10 kHz> DT9045 DT9047 DT9104 DT9106 to to DT9105 DT91
07 100ms <5 kHz>
CH2
R903C
Total of 2 CH with max. 2 kHz
+ Note
Reset input X2 can be set to either CH0 or CH1. Reset input X5 can be set to eit
her CH2 or CH3.
* next page
Matsushita Electric Works (Europe) AG
A–5
Appendix A A.2 Specifications and Restricted Items
NAiS Control 1131
Pulse Output
Input/output contact number being used Pulse Directional output output Home inpu
t Home proximity input DT9052 <bit2> DT9052 <bit6> Built–in Memory area used hig
h– speed counter Control Elapsed Target value value channel flag area area no. C
H0 R903A Performance specifications for maximum output frequency
Related instructions
Y0
Y2
X0
Y1
Y3
X1
CH1
R903B
DT9044 DT9046 Max. to to 10 kHz for DT9045 DT9047 1–point output DT9048 DT9050 M
ax. 5 kHz for 2–point to to DT9049 DT9051 output
F0(MV) F1(DMV) F168(SPD1) F169(PLS)
+ Note
The maximum 1–point output for instruction F168 (SPD1) is 9.5 kHz.
PWM Output
Output number being used Built–in high–speed counter channel no. CH0 CH1 Memory
area used Control flag R903A R903B Performance specifications for output frequen
cy Frequency: 0.15 Hz to 38 Hz Duty: 0.1 % to 99.9 % Related instructions
Y0 Y1
F0(MV) F1(DMV) F170(PWM)
A–6
Matsushita Electric Works (Europe) AG
NAiS Control 1131 A.2
Appendix A Specifications and Restricted Items
A.2.2
Functions and Restrictions
The same channel cannot be used by more than one function, e.g. CH0 cannot be sh
ared by the high–speed counter and pulse output functions. The number allocated
to each function cannot be used for normal input or outputs. Therefore the follo
wing examples are NOT possible: D When using CH0 for 2–phase inputting with the
high–speed counter function, you cannot allot X0 and X1 to normal inputs. D When
using Y0 for the pulse output function, you cannot allot origin input X0 to a n
ormal input. D When using Y0 for the pulse output (with directional output opera
ting) function, you cannot allot Y2 (directional output) to a normal input or ou
tput. When using the high–speed counter with a mode that does not use the reset
input, you can allot the inputs listed in parenthesis in the specifications tabl
e to a normal input.
,
Example: When using the high–speed counter with no reset input and 2–phase input
, you can allot X2 to a normal input.
When any of the instructions related to the high–speed counter (F166 to F170) ar
e executed, the control flag (special internal relay: R903A to R903D) correspond
ing to the used channel turns ON. When the flag for a channel turns ON, another
instruction cannot be executed using that same channel. For example, while execu
ting F166 (target value match ON instruction) and flag R903A is in the ON state,
F167 (target value match OFF instruction) CANNOT be executed with CH0. The coun
ting speed when using the high–speed counter function will differ depending on t
he counting mode as shown in the table. Therefore, the following restrictions ap
ply: D While in the incremental input mode and using the two channels CH0 and CH
1, if CH0 is being used at 8 kHz, then CH1 can be used up to 2 kHz. D While in t
he 2–phase input mode and using the two channels CH0 and CH2, if CH0 is being us
ed at 1 kHz, then CH2 can be used up to 1 kHz.
* next page
Matsushita Electric Works (Europe) AG
A–7
Appendix A A.2 Specifications and Restricted Items
NAiS Control 1131
The maximum output frequency when using the pulse output function will differ de
pending on the output contact number as shown in the table: D When using either
only Y0 or only Y1, the maximum output frequency is 10 kHz. D When using the two
contacts Y0 and Y1, the maximum output frequency is 5 kHz. When using the high–
speed counter function and pulse output function, specifications will differ dep
ending on the conditions of use.
,
Example: When using one pulse output contact with a maximum output frequency of
5 kHz, the maximum counting speed of the high–speed counter being used simultane
ously is 5 kHz with the incremental mode and 1 kHz with the 2–phase mode.
A–8
Matsushita Electric Works (Europe) AG
NAiS Control 1131 A.3
Appendix A High–Speed Counter Function
A.3
High–Speed Counter Function
D The high–speed counter function counts the input signals, and when the count r
eaches the target value, turns ON and OFF the desired output. D The high–speed c
ounter function is able to count high–speed pulses of frequencies up to 10 kHz.
D To turn ON an output when the target value is matched, use the target value ma
tch ON instruction F166. To turn OFF an output, use the target value match OFF i
nstruction F167. D Preset the output to be turned ON and OFF with the SET/RET in
struction.
In order to use the high–speed counter function, it is necessary to set system r
egisters No. 400 and No. 401.
A.3.1
Types of Input Modes
Incremental input mode:
X0 Count 0 1 2 3 4 n–3 n–2 n–1 n ON OFF
Decremental input mode:
X0 Count n n–1 n–2 n–3 n–4 3 2 1 0 ON OFF
* next page
Matsushita Electric Works (Europe) AG
A–9
Appendix A A.3 High–Speed Counter Function
NAiS Control 1131
2–phase input mode:
(Incremental input: CW) X0 X1 0 1 2 n–1 n ON OFF ON OFF
Count
(Decremental input: CCW) X0 X1 n n–1 n–2 n–3 2 1 ON OFF ON OFF
Count
Incremental/decremental input mode (separate input mode):
X0 ON OFF ON OFF 1 2 3 4 3 2 1 2 3 Increasing 4 3 Decreasing
X1 Count 0
Increasing
Decreasing
Directional distinction mode:
X0 ON OFF ON OFF 1 2 3 4 3 2 1 0
X1 Count 0
Increasing
Decreasing
A – 10
Matsushita Electric Works (Europe) AG
NAiS Control 1131 A.3
Appendix A High–Speed Counter Function
A.3.2
I/O Allocation
The input allocation, as shown in the table in section A.2.1 , will differ depen
ding on the channel number being used. The output turned ON and OFF can be speci
fied from between Y0 to Y7 as desired with instructions F166 and F167.
,
Example 1: When using CH0 with incremental input and reset input
Count input X0
Reset input
X2 * ON and OFF output
Yn
* The output turned ON and OFF when values match can be selected from Y0 to Y7.
,
Example 2: When using CH0 with 2–phase input and reset input
A phase input B phase input Reset input X0 X1 X2 * ON and OFF output
Yn
* The output turned ON and OFF when values match can be selected from Y0 to Y7.
Matsushita Electric Works (Europe) AG
A – 11
Appendix A A.4 Pulse Output Function
NAiS Control 1131
A.4
Pulse Output Function
The pulse function enables positioning control by use in combination with a comm
ercially available pulse–string input type motor driver. It provides trapezoidal
control with the instruction F168 for automatically obtaining pulse outputs by
specifying the initial speed, maximum speed, acceleration/deceleration time, and
target value. The F168 instruction also enables automatic home return. A JOG op
eration using instruction F169 for pulse output while the predetermined trigger
is in the ON state is also possible. When using the pulse output function, set t
he channels corresponding to system registers No. 400 and No. 401 to “Do not use
high–speed counter.”
A.4.1
SDT Variables
SDT Variables are used in the following example programs. SDT means Structured D
ata Type. These variables can be comprised of several kinds of variables (e.g. W
ord and Double Word). SDT definitions or structures are administered globally an
d receive a structure name. For this structure, elements of various types are de
fined. If an SDT variable is to be used in a program, you need to assign an appr
opriate SDT variable in the global variable list. If one structure element of an
SDT variable is to be accessed, the structure element must be separated from th
e structure variable name by a period (e.g. Data_table1.Fmax).
DUT Pool Motor_Dat_1 Init WORD Fmin INT Fmax INT Tdelay INT TargetPuls DINT Term
ination INT Data_table2 Global Variables Data_table1 Type: Motor_Dat_1 Init WORD
Fmin INT Fmax INT Tdelay INT TargetPuls DINT Termination INT Type: Motor_Dat_1
Init WORD Fmin INT Fmax INT Tdelay INT TargetPuls DINT Termination INT POU POU H
eader (local variables) VAR_EXTERNAL Data_table1 VAR_EXTERNAL Data_table2 POU Bo
dy
LD 4000
ST Data_table1.Fmax
LD 4500
ST Data_table2.Fmax
A – 12
Matsushita Electric Works (Europe) AG
NAiS Control 1131 A.4
Appendix A Pulse Output Function
A.4.2
Positioning Function F168
This example illustrates normal positioning with an acceleration and a decelerat
ion ramp.
5000Hz
10000 pulses
500Hz 0Hz 200msec Start_X3 %MX0.903.10 no effect 200msec
The following program generates a pulse from output Y0. The initial speed is 500
Hz, and the normal processing speed is 5000Hz. The acceleration and deceleration
times are 200ms each. The movement amount is 10000 pulses.
+ Notes
Matsushita Electric Works (Europe) AG
ÏÏÏÏÏÏÏÏÏ ÏÏÏÏÏÏÏÏÏ
positioning active
(R903A)
D For trapezoidal control the initial and final speeds may not be greater than 5
000Hz. D The sum of maximum frequencies of all axes must not exceed 10000Hz.
A – 13
Appendix A A.4 Pulse Output Function
NAiS Control 1131
A.4.3
Pulse Output Function F169
The following example shows this process in a positive direction. The mode (of o
peration) 16#0112 sets the following conditions: D The duty ratio is 10% pulse a
nd 90% pause D Incremental counting D Directional output %QX0.2 (Y2) to ”0”. A f
requency of 300Hz is output via the input Start_X2. During frequency output, the
count of the elapsed value for the high–speed counter CH0 system registers (%MW
0.904.8 and %MW0.904.9 (DT9048 u. DT9049), or %MW0.9004.8 and %MW0.9004.9 with t
he FP0–T32CP) decreases.
The following example shows this process in a negative direction. The mode (of o
peration) 16#0113 sets the following conditions: D The duty ratio is 10% pulse a
nd 90% pause D Decremental counting D Directional output %QX0.2 (Y2) to ”1”. A f
requency of 700Hz is output via the input Start_X6. During frequency output, the
count of the elapsed value for the high–speed counter CH0 system registers (%MW
0.904.8 and %MW0.904.9 (DT9048 u. DT9049), or %MW0.9004.8 and %MW0.9004.9 with t
he FP0–T32CP) decreases.
A – 14
Matsushita Electric Works (Europe) AG
NAiS Control 1131 A.4
Appendix A Pulse Output Function
A.4.4
High–Speed Counter Control Instruction F0_MV
The function F0_MV is used for two different tasks. F0_MV is known as a MOVE fun
ction that copies values and memory contents. In addition, F0_MV is used to cont
rol the high–speed counter (e.g. for positioning a stepping motor). In this resp
ect, F0_MV offers the following functionality: D This instruction is used for re
setting the built–in high–speed counter, stopping the pulse outputs, and setting
and resetting the home proximity input. D Specify this instruction together wit
h special data register %MW0.905.2 (DT9052) or %MW0.9005.2 with the FP0–T32CP. D
Once this instruction is executed, the settings will be retained until this ins
truction is executed again.
,
Example 1: The home proximity speed is the starting speed of the ramp. The switc
hing is enabled by assigning the value 4 to the high–speed counter special regis
ter (%MW0.905.2 (DT9052) or %MW0.9005.2 with the FP0–T32CP). ”0” is entered just
after that to perform the preset operations.
* next page
Matsushita Electric Works (Europe) AG A – 15
Appendix A A.4 Pulse Output Function
NAiS Control 1131
,
Example 2:
A.4.5
Elapsed Value Change and Read Instruction F1_DMV
In these examples, HSCO_elapsedval is assigned to the address %MD0.904.4 (DDT904
4) or %MD0.9004.4 with the FP0–T32CP.
,
Example 1:
,
Example 2:
A – 16
Matsushita Electric Works (Europe) AG
NAiS Control 1131 A.5
Appendix A Sample Program for Positioning Control
A.5
Sample Program for Positioning Control
Wiring example
FP0 Input terminal Home sensor Positioning start Positioning start Home return s
tart Home proximity sensor Forward JOG start Reverse JOG start Overrun X0 X1 X2
X3 X4 X5 X6 X7 COM a contact b contact a contact Moving table (–) b contact (+)
Stepping motor driver Output terminal Pulse output Y0 COM Pulse input COM Direct
ional output Y2 Directional input
+ – 24V DC power supply
Matsushita Electric Works (Europe) AG
ÎÎÎÎÎÎÎÎÎÎÎ ÎÎÎÎÎÎÎÎÎÎÎ
A – 17
Stepping motor
Appendix A A.5 Sample Program for Positioning Control
NAiS Control 1131
A.5.1
Relative Value Positioning Operation (Plus Direction)
With Start_X1 positioning starts. Pos_runs_R10 indicates active positioning. Rea
ching the target position is indicated by Pos_done_R12 for 1s.
5000Hz Motor 10000 pulses 10000 pulses 500 Hz 0Hz 200msec 200msec
A – 18
ÎÎÎÎÎÎÎÎÎÎÎÎ ÎÎÎÎÎÎÎÎÎÎÎÎ
(– side) (+ side)
Matsushita Electric Works (Europe) AG
NAiS Control 1131 A.5
Appendix A Sample Program for Positioning Control
A.5.2
Relative Value Positioning Operation (Minus Direction)
With Start_X2 positioning starts. Pos_runs_R20 indicates active positioning. Rea
ching the target position is indicated by Pos_done_R22 for 1s.
6000Hz Motor 8000 pulses 8000 pulses 1000Hz 0Hz 300msec 300msec
Matsushita Electric Works (Europe) AG
ÎÎÎÎÎÎÎÎÎÎÎÎ
(– side) (+ side)
A – 19
Appendix A A.5 Sample Program for Positioning Control
NAiS Control 1131
A.5.3
Absolute Value Positioning Operation
With Start_X1 positioning starts. Pos_runs_R30 indicates active positioning. Rea
ching the target position is indicated by Pos_done_R32 for 1s. With absolute pos
itioning, the directional output is controlled. The mode of operation 16#112 set
s the directional output to ”1” when moving backward, and to ”0” when moving for
ward.
(– side) Motor
(+ side)
4000Hz
A – 20
ÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎ ÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎ
(10,000) 22,000 (30,000)
200Hz 0Hz 250msec 250msec
Matsushita Electric Works (Europe) AG
NAiS Control 1131 A.5
Appendix A Sample Program for Positioning Control
A.5.4
Home Return Operation (Minus Direction)
The return home direction causes the stepping motor to move in a reverse (minus)
direction. The ramps are maintained, just as they are with other positioning pr
ocesses. The braking ramp engages when the home proximity sensor turns on. Then
the stepping motor runs at starting speed until the home sensor is activated. Th
en the pulse output stops, and the elapsed value is set to 0. With Start_X3 posi
tioning starts. Pos_runs_R40 indicates active positioning. Pos_done_R42 turns on
for 1s after the return home is completed, and the elapsed value (Addr. %MW0.90
4.4 and %MW0.904.5 (DT9044 and DT9045) or %MW0.9004.4 and %MW0.9004.5 with the F
P0–T32CP) is set to 0.
(– side) Motor
(+ side)
Start_X3 2000Hz
Homeprox_X4
Home_X0
Matsushita Electric Works (Europe) AG
ÎÎÎÎÎÎÎÎÎÎÎÎ ÎÎÎÎÎÎÎÎÎÎÎÎ
Home_X0 Homeprox_X4
100Hz 0Hz 150msec 150msec
A – 21
Appendix A A.5 Sample Program for Positioning Control
NAiS Control 1131
A.5.5
Home Return Operation (Plus Direction)
The return home direction causes the stepping motor to move in a forward (positi
ve) direction. The ramps are maintained, just as they are with other positioning
processes. The braking ramp engages when the home proximity sensor turns on. Th
en the stepping motor runs at starting speed until the home sensor is activated.
Finally the pulse output stops, and the elapsed value is set to 0. With Start_X
3 positioning starts. Pos_runs_R50 indicates active positioning. Pos_done_R52 tu
rns on for 1s after the return home is completed, and the elapsed value (Addr. %
MW0.904.4 and %MW0.904.5 (DT9044 and DT9045) or %MW0.9004.4 and %MW0.9004.5 with
the FP0–T32CP) is set to 0.
(– side) Motor
Start_X3 (+ side) 2500Hz
Homeprox_X4
Home_X0
A – 22
ÎÎÎÎÎÎÎÎÎÎÎÎ ÎÎÎÎÎÎÎÎÎÎÎÎ
Homeprox_X4 Home_X0
120Hz 0Hz 100msec 100msec
Matsushita Electric Works (Europe) AG
NAiS Control 1131 A.5
Appendix A Sample Program for Positioning Control
A.5.6
JOG Operation (Plus Direction)
The input Start_X5 starts the pulse output. The directional output %QX0.2 (Y2) i
s not controlled using this mode of operation (16#112).
(– side) Motor
(+ side)
Start_X5
1 0
Matsushita Electric Works (Europe) AG
ÎÎÎÎÎÎÎÎÎÎÎÎ
%QX0.0(X0)
Pulses
A – 23
Appendix A A.5 Sample Program for Positioning Control
NAiS Control 1131
A.5.7
JOG Operation (Minus Direction)
The input Start_X6 starts the pulse output. The directional output %QX0.2 (Y2) i
s set using this mode of operation (16#122).
(– side) Motor
(+ side)
Start_X6
1 0
A.5.8
With a falling edge at the input, the pulse output is stopped. A break circuit h
as to be used as a protective circuit for this program. By using a break circuit
, the emergency stop function is made fail–safe.
A – 24
ÎÎÎÎÎÎÎÎÎÎÎÎ
Emergency Stop
%QX0.0(X0)
Pulses
Matsushita Electric Works (Europe) AG
Appendix B Glossary
Glossary
NAiS Control 1131
B–2
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Glossary
Action Assignment An action combines one sequence (created with the SFC–editor)
with parts of the logic which are executed when a specific step is active. An ac
tion contains parts of the over–all logic. An action can be assigned to multiple
steps and can be coded in FBD, LD or IL. Body A POU consists of a header and a
body. The body contains the PLC program. Data Type Each variable is assigned a d
ata type that determines its bit length. There are elementary (e.g. BOOL, WORD)
and user–defined (e.g. ARRAY) data types. Data Unit Type A Data Unit Type (DUT)
is a group of variables composed of several elementary data types. Such groups a
re used when data tables are edited. Declaration is the definition of * Variable
s for global or local use. EN (Enable) Input/ENO (Enable Out) Output Many functi
on blocks have an input and output variable of the data type BOOL in addition to
the other input and output variables. The status of the ENO output always refle
cts the current status of the EN input. F Instructions are common Matsushita ins
tructions. The P instructions function exactly the same way as the F instruction
s with the exception that they are only executed when a leading edge is detected
. Function Functions are used within the definition of the user logic whenever a
routine is needed, which, when executed, yields exactly one result. Since Funct
ions do not access any internal memory, every invocation of one Function with id
entical
input parameters always results in an identical value, the Function result. As s
oon as a Function has been declared it can be accessed from any other * Program
Organization Unit of the * User Logic. Function Block Function Blocks define bot
h the algorithm as well as the data declaration of a part of the * User Logic. D
ue to this definition the logic can be considered a class. Not the Function Bloc
k itself is invoked but several instances of this Function Block can be created,
which can then be used separately. Each instance possesses its own copy of the
data declaration memory, which provides the necessary data information for execu
ting the Function Block functionality. The private data declaration memory of a
Function Block Instance persists from one invocation of this instance to the nex
t one. This internal memory allows the implementation of incremental functionali
ty by using Function Blocks. As a consequence several invocations of one Functio
n Block Instance with the same input variables will not necessarily yield the sa
me results. In comparison with * Functions, Function Blocks allow you to define
not only one but a set of output variables representing the Function Block resul
ts. Substances of Function Blocks can be declared locally, for use within one PO
U. Declaring the instance of a Function Block within a POU defines the scope of
this instance at the same time.
Matsushita Electric Works (Europe) AG
B–3
Glossary
NAiS Control 1131
Function Block Diagram FBD is a graphical language for programming connective lo
gic. The individual * Program Organization Unit Variables are connected with the
inputs and outputs of function boxes. The connection represents a data flow bet
ween variables and inputs/outputs of function boxes. A Function Block Diagram pr
ogram is internally structured via * Networks. A Function Block Diagram network
is defined by a connected graph of function boxes. Function Block Instance An ob
ject of the * Function Block class possesses its own copy of the Function Block’
s data declaration memory. This private data area is linked to the Function Bloc
k algorithm for this particular instance. Global Variables Global variables have
physical addresses. They apply to the entire project and can be copied into the
POU headers as VAR_EXTERNAL. The Global Variable List is found in the Project N
avigator. Header A Program Organization Unit (POU) consists of a header and a bo
dy. In the header all variables used in the POU are listed and defined. Identifi
er is the symbolic name of a variable. Input Variable Input variables provide a
function block/function with values with which calculations are carried out. Ins
truction List IL is a low level textual language which provides the capabilities
for effective PLC programming. It is based on individual instructions which def
ine one operation per instruction. Besides the * Variables listed explicitly as
arguments for an operation the actual value of the
B–4
accumulator is used as an additional implicit argument. The result of an operati
on is also stored here after the execution of the appropriate instruction, thus
providing a link between a preceeding instruction and one afterwards. An Instruc
tion List program is internally structured as an assembly of * Networks. Ladder
Diagram LD is a graphical language for programming connective logic. Similar to
the * Function Block Diagram capabilities, the individual * Program Organization
Unit * Variables are connected with the inputs and outputs of function boxes. I
n addition, Boolean connections can be drawn by using coils and contacts. This c
onnection represents a Boolean signal flow. A Ladder Diagram program is internal
ly structued via * Networks. A Ladder Diagram network is defined by a connected
graph of functions boxes linked with the lefthand power rail. Local Variables Lo
cal variables only apply to the POU in whose header they have been declared. Log
ic The complete PLC program defined by the user for solving the automation probl
em. The user logic is structured via * Program Organization Units. Network A net
work belongs to a POU body and contains the logic (program). Output Variable Fun
ctions and function blocks write their results in output variables. P Instructio
ns * F instructions. POU Pool The POU Pool is located in the Project Navigator a
nd contains all POUs that are part of the project.
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Glossary
Program is similar to a Function Block with one implicit * Function Block Instan
ce. The differences between Programs and Function Blocks are: • Programs are onl
y allowed on top of a Program Organization Unit invocation hierarchy (i.e. a pro
gram may not be invoked from another Program Organization Unit) • Directly repre
sented * Variables can be used for defining a Program Program Organization Unit
(POU) Program Organization Units are used for structuring the complete user logi
c. Individual Units may invoke other ones, however a recursive POU structure is
not allowed. Program Organization Units are either defined as standard by defaul
t or user specific due to the specific automation problem to be solved by the *
User Logic. NAiSControl differentiates between the Program Organization Unit Hea
der (which contains the * Declaration part of the Program Organization Unit) and
the Program Organization Unit Body (which contains the Program Organization Uni
t’s algorithm). Due to different requirements for the solution of a sub–problem,
different typs of POUs are provided. The different Program Organization Unit ty
pes are * Functions, * Function Blocks and * Programs. Project The project repre
sents the top level of the hierarchy in NAiS Control. It contains the entire tas
k for the controller.
Sequential Function Chart SFC consists of the basic elements steps and transitio
ns. While steps represent a specific state during the execution of a POU, a tran
sition allows the definition of the conditions for changing from one state to th
e next state. Using either parallel or alternative branches you can complement s
everal types of SFC sequences. Specific connective logic program code can be ass
ociated to the steps via actions by using the appropriate languages * Function B
lock Diagram, Ladder Diagram and * Instruction List. Task defines the moment (an
d other execution parameters) of program execution. A POU of type program contai
ns the logic, i.e., it defines what has to be done. The association of a program
to a task defines the moment of the logic’s execution. Variable enables the ass
ociation of a specifier to a specific memory area. Due to different requirements
, data can be of different types. Variables can be either global, for use within
the entire user program, or local, being restricted to the POU in which it has
been defined.
Matsushita Electric Works (Europe) AG
B–5
Glossary
NAiS Control 1131
B–6
Matsushita Electric Works (Europe) AG
Alphabetical Index of All Instructions
A
ABS ADD ADD_TIME AND ASIN ATAN 3–2 4–4 5–2 7–2 4– 20 4– 32 DINT_TO_TIME DINT_TO_
WORD DIV DIV_TIME_DINT DIV_TIME_INT DIV_TIME_REAL DWORD_TO_BOOL DWORD_TO_DINT DW
ORD_TO_INT DWORD_TO_TIME 2– 79 2– 77 2–5 2–9 2–3 2–7 EQ EXP EXPT DWORD_TO_WORD 2
– 31 2– 29 4– 10 5– 14 5– 12 5– 16 2– 49 2– 53 2– 51 2– 57 2– 55
B
BCD_TO_DINT BCD_TO_INT BOOL_TO_DINT BOOL_TO_DWORD BOOL_TO_INT BOOL_TO_WORD
E
9–6 4– 41 4– 44
C
COS COS CT CT_FB CTD CTU CTUD 4– 23 4– 26 14 – 8 15 – 2 12 – 6 12 – 2 12– 11
F
F_TRIG F0 (MV) F1 (DMV) F2 (MVN) F3 (DMVN) F5 (BTM) F6 (DGT) F10 (BKMV) F11 (COP
Y) 14 – 9 14 – 10 2– 38 2– 25 2– 33 2– 27 2– 35 F12 (EPRD) F15 (XCH) F16 (DXCH)
F17 (SWAP) F20 (ADD) F21 (DADD) F22 (ADD2) 11 – 5 14 – 28 14 – 29 14 – 30 14 – 3
1 14 – 32 14 – 33 14 – 34 14 – 35 14 – 36 14 – 41 14 – 42 14 – 43 14 – 44 14 – 4
5 14 – 46
I–1
D
DF DFN DINT_TO_BCD DINT_TO_BOOL DINT_TO_DWORD DINT_TO_INT DINT_TO_REAL
Matsushita Electric Works (Europe) AG
Alphabetical Index of All Instructions
NAiS Control 1131
F23 (DADD2) F25 (SUB) F26 (DSUB) F27 (SUB2) F28 (DSUB2) F30 (MUL) F31 (DMUL) F32
(DIV) F33 (DDIV) F35 (INC) F36 (DINC) F37 (DEC) F38 (DDEC) F40 (BADD) F41 (DBAD
D) F42 (BADD2) F43 (DBADD2) F45 (BSUB) F46 (DBSUB) F47 (BSUB2) F48 (DBSUB2) F50
(BMUL) F51 (DBMUL) F52 (BDIV) F53 (DBIV) F55 (BINC) F56 (DBINC) F57 (BDEC) F58 (
DBDEC) F60 (CMP) F61 (DCMP) F62 (WIN) F63 (DWIN) F64 (BCMP) F66 (WOR) F67 (XOR)
F65 (WAN)
14 – 47 14 – 48 14 – 49 14 – 50 14 – 51 14 – 52 14 – 53 14 – 54 14 – 55 14 – 56
14 – 57 14 – 58 14 – 59 14 – 60 14 – 61 14 – 62 14 – 63 14 – 64 14 – 65 14 – 66
14 – 67 14 – 68 14 – 69 14 – 70 14 – 71 14 – 72 14 – 73 14 – 74 14 – 75 14 – 76
14 – 77 14 – 78 14 – 79 14 – 80 14 – 82 14 – 83 14 – 81
F68 (XNR) F70 (BCC) F71 (HEX2A) F72 (A2HEX) F73 (BCD2A) F74 (A2BCD) F75 (BIN2A)
F76 (A2BIN) F77 (DBIN2A) F78 (DA2BIN) F80 (BCD) F81 (BIN) F82 (BCD) F83 (DBIN) F
84 (INV) F85 (NEG) F86 (DNEG) F87 (ABS) F88 (DABS) F89 (EXT) F90 (DECO) F91 (SEG
T) F92 (ENCO) F93 (UNIT) F94 (DIST) F95 (ASC) F96 (SRC) F100 (SHR) F101 (SHL) F1
05 (BSR) F106 (BSL) F110 (WSHR) F111 (WSHL) F112 (WBSR) F113 (WBSL) F118 (UCD) F
119 (LRSR)
14 – 84 14 – 85 14 – 86 14 – 87 14 – 88 14 – 89 14 – 91 14 – 92 14 – 93 14 – 94
14 – 95 14 – 96 14 – 97 14 – 98 14 – 99 14 – 100 14 – 101 14 – 102 14 – 103 14 –
104 14 – 105 14 – 107 14 – 109 14 – 110 14 – 112 14 – 115 14 – 116 14 – 117 14
– 118 14 – 119 14 – 120 14 – 121 14 – 122 14 – 123 14 – 124 14 – 125 14 – 126
I–2
Matsushita Electric Works (Europe) AG
NAiS Control 1131
Alphabetical Index of All Instructions
F120 (ROR) F121 (ROL) F122 (RCR) F123 (RCL) F130 (BTS) F131 (BTR) F132 (BTI) F13
3 (BTT) F135 (BCU) F136 (DBCU) F137 (STMR) F138 (HMSS) F139 (SHMS) F140 (STC) F1
41 (CLC) F143 (IORF) F144 (TRNS) F147 (PR) F148 (ERR) F149 (MSG) F157 (CADD) F15
8 (CSUB) F162 (HC0S) F163 (HC0R) F164 (SPD0) F165 (CAM0) F166 (HC1S) F167 (HC1R)
F168 (SPD1) F169 (PLS) F170 (PWM) F183 (DSTM) F327 (INT) F328 (DINT) F333 (FINT
) F334 (FRINT) F335 (FSIGN)
14 – 128 14 – 129 14 – 130 14 – 131 14 – 132 14 – 133 14 – 134 14 – 135 14 – 136
14 – 137 14 – 138 14 – 139 14 – 140 14 – 141 14 – 142 14 – 143 14 – 144 14 – 14
6 14 – 147 14 – 148 14 – 149 14 – 150 14 – 152 14 – 153 14 – 154 14 – 155 14 – 1
56 14 – 158 14 – 160 14 – 165 14 – 168 14 – 171 14 – 173 14 – 175 14 – 177 14 –
179 14 –181
F337 (RAD) F338 (DEG) F355 (PID)
14 – 183 14 – 185 14 – 187
G
GE GT 9–4 9–2
I
ICTL INT_TO_BCD INT_TO_BOOL INT_TO_DINT INT_TO_DWORD INT_TO_REAL INT_TO_TIME INT
_TO_WORD 14 – 11 2– 23 2– 11 2– 13 2– 17 2– 19 2– 21 2– 15
J
JP 14 – 13
K
KEEP 14 – 14
L
LBL LE LIMIT LN LOG LOOP LSR LT 14 – 15 9–8 8–6 4– 35 4– 38 14 – 16 14 – 17 9 –
10
Matsushita Electric Works (Europe) AG
I–3
Alphabetical Index of All Instructions
NAiS Control 1131
M
MAX MC MCE MIN MOD MOVE MUL MUL_TIME_DINT MUL_TIME_INT MUL_TIME_REAL MUX 8–2 14
– 18 14 – 19 8–4 4– 12 4–2 4–8 5–8 5–6 5– 10 8–8
SQRT SR SUB SUB_TIME
4– 14 10 – 2 4–6 5–4
T
TAN TIME_TO_DINT TIME_TO_DWORD TIME_TO_INT TIME_TO_REAL TIME_TO_WORD TM_100ms TM
_100ms_FB 4– 29 2– 65 2– 69 2– 63 2– 83 2– 67 14 – 24 15 – 11 14 – 22 15 – 8 14
– 20 15 – 5 14 – 26 15 – 14 13 – 12 13 – 7 13 – 2 2– 74 2– 71
N
NE NOT 9 – 12 7–8
TM_10ms TM_10ms_FB TM_1ms TM_1ms_FB
O
OR 7–4
TM_1s TM_1s_FB TOF
P
P13 (EPWT) 14 – 38
TON TP TRUNC_TO_DINT
R
R_TRIG REAL_TO_DINT REAL_TO_INT REAL_TO_TIME ROL ROR RS 11 – 2 2– 62 2– 59 2– 81
6–8 6– 11 10 – 6
TRUNC_TO_INT
W
WORD_TO_BOOL WORD_TO_DINT WORD_TO_DWORD WORD_TO_INT WORD_TO_TIME 2– 39 2– 44 2–
43 2– 41 2– 47
S
SHL SHR SIN
I–4
6–2 6–5 4– 17
X
XOR 7– 8
Matsushita Electric Works (Europe) AG
Record of Changes
Manual No.
ACG–M0130END V1.0 ACG–M0130END V1.1
Date
June 1998 Oct. 1999 First edition
Description of Changes
Updated, appendix, glossary, new commands: IEC Functions: INT_TO_REAL, DINT_TO_T
IME, DINT_TO_REAL, DWORD_TO_TIME, REAL_TO_INT, REAL_TO_DINT, TIME_TO_DINT, TIME_
TO_DWORD, TRUNC_TO_INT, TRUNC_TO_DINT, SQRT, SIN, ASIN, COS, ACOS, TAN, ATAN, LN
, LOG, EXP, EXPT, MUL_TIME_DINT, MUL_TIME_REAL, DIV_TIME_DINT, DIV_TIME_REAL; Ma
tsushita Instructions: CT, DF, DFN, ICTL, JP, KEEP, LBL, LOOP, LSR, MC, MCE, TM_
1ms,TM_10ms, TM_100ms, TM_1s, F12 (EPRD), EEPROM read from memory P13 (EPWT), EE
PROM write to memory F327 (INT), Floating point data 16–bit integer data (the la
rgest integer not exceeding the floating point data) F328 (DINT), Floating point
data 32–bit integer data (the largest integer not exceeding the floating point
data) F333 (FINT), Rounding the first decimal point down F334 (FRINT), Rounding
the first decimal point off F335 (FSIGN), Floating point data sign changes (nega
tive/positive conversion) F337 (RAD), Conversion of angle units (Degrees Radians
) F338 (DEG), Conversion of angle units (Radians Degrees) F355 (PID), PID proces
sing instruction.
GLOBAL NETWORK
North America
Aromat Corporation
Europe
Matsushita Electric Works Group
Asia Pacific
Matsushita Electric Works (Asia Pacific)
China
Matsushita Electric Works
Japan
Matsushita Electric Works Ltd. Automation Controls Group
Europe
H Austria H Benelux H France H Germany H Ireland H Italy H Portugal H Scandinavi
a H Spain H Switzerland H United Kingdom Matsushita Electric Works Austria GmbH
Stojanstraße 12, 2344 Maria Enzersdorf, Austria, Tel. (02236) 2 68 46, Fax (0223
6) 46133, http://www.matsushita.at
Matsushita Electric Works Benelux B. V.
De Rijn 4, (Postbus 211), 5684 PJ Best, (5680 AE Best), Netherlands, Tel. (0499)
37 2727, Fax (0499) 372185, http://www.matsushita.nl
Matsushita Electric Works France S.A.R.L.
B.P. 44, 91371 Verrières le Buisson CEDEX, France, Tel. 01 60 13 57 57, Fax 01 6
0 13 57 58, http://www.matsushita–france.fr
Matsushita Electric Works Deutschland GmbH
Rudolf–Diesel–Ring 2, 83607 Holzkirchen, Germany, Tel. (08024) 648–0, Fax (08024
) 648–555, http://www.matsushita.de
Matsushita Electric Works Ltd., Irish Branch Office
Waverley, Old Naas Road, Bluebell, Dublin 12, Republic of Ireland, Tel. (01) 460
09 69, Fax (01) 460 11 31
Matsushita Electric Works Italia s.r.l.
Via del Commercio 3–5 (Z.I. Ferlina), 37012 Bussolengo (VR), Italy, Tel. (045) 6
75 27 11, Fax (045) 670 04 44, http://www.matsushita.it
Matsushita Electric Works Portugal, Portuguese Branch Office
Avda 25 de Abril, Edificio Alvorada 5  E, 2750 Cascais, Portugal, Tel. (351) 148
2 82 66, Fax (351) 1482 74 21
Matsushita Electric Works Scandinavia AB
Sjöängsvägen 10, 19272 Sollentuna, Sweden, Tel. +46 8 59 47 66 80, Fax (+46) 8 5
9 47 66 90, http://www.mac–europe.com
Matsushita Electric Works España S.A.
Parque Empresarial Barajas, San Severo, 20, 28042 Madrid, Spain, Tel. (91) 329 3
8 75, Fax (91) 329 29 76
Matsushita Electric Works Schweiz AG
Grundstrasse 8, 6343 Rotkreuz, Switzerland, Tel. (041) 799 70 50, Fax (041) 799
70 55, http://www.matsushita.ch
Matsushita Electric Works UK Ltd.
Sunrise Parkway, Linford Wood East, Milton Keynes, MK14 6LF, England, Tel. (0190
8) 231 555, Fax (01908) 231 599, http://www.matsushita.co.uk
North & South America
H USA Aromat Corporation Head Office USA
629 Central Avenue, New Providence, N.J. 07974, USA, Tel. 1–908–464–3550, Fax 1–
908–464–8513, http://www.aromat.com
Asia
H China H Hong Kong H Japan H Singapore Matsushita Electric Works, Ltd. China Of
fice
2013, Beijing Fortune, Building 5, Dong San Huan Bei Lu, Chaoyang District, Beij
ing, China, Tel. 86–10–6590–8646, Fax 86–10–6590–8647
Matsushita Electric Works Ltd. Hong Kong
Rm1601, 16/F, Tower 2, The Gateway, 25 Canton Road, Tsimshatsui, Kowloon, Hong K
ong, Tel. (852) 2956–3118, Fax (852) 2956–0398
Matsushita Electric Works Ltd. Automation Controls Group
1048 Kadoma, Kadoma–shi, Osaka 571–8686, Japan, Tel. 06–6908–1050, Fax 06–6908–5
781, http://www.mew.co.jp/e–acg/
Matsushita Electric Works Pte. Ltd. (Asia Pacific)
101 Thomson Road, #25–03/05, United Square, Singapore 307591,Tel. (65) 255–5473,
Fax (65) 253–5689
COPYRIGHT E
2000 All Rights Reserved
ARCT1F0000ABC V1.x 12/99 Printed in Europe
Specifications are subject to change without notice.

You might also like