logo资料库

QCPU(Q Mode)Programming Manual ( Structured Text).pdf

第1页 / 共286页
第2页 / 共286页
第3页 / 共286页
第4页 / 共286页
第5页 / 共286页
第6页 / 共286页
第7页 / 共286页
第8页 / 共286页
资料共286页,剩余部分请下载后查看
SAFETY PRECAUTIONS
REVISIONS
INTRODUCTION
CONTENTS
About Manuals
How to Use This Manual
About the Generic Terms and Abbreviations Used in This Manual
1 OVERVIEW
1.1 What Is the ST Language?
1.2 Features of ST Program in MELSEC-Q Series
1.3 ST Program Creating Procedure
2 SYSTEM CONFIGURATION
2.1 System Configuration
2.1.1 Applicable CPUs
2.1.2 Programming tool for ST program
2.1.3 ST program specifications
3 HANDLING OF CHARACTERS AND NUMERIC VALUES IN ST PROGRAMS
3.1 Usable Characters
3.2 Data Handling
3.2.1 Data types
3.2.2 About ANY type
3.2.3 Array and structure
3.3 Data Representation Methods
3.3.1 Constants
3.3.2 Labels
3.3.3 Devices
4 ST PROGRAM EXPRESSIONS
4.1 Assignment Statement
4.2 Operators
4.2.1 Operator list
4.2.2 Examples of using the operators
4.3 Control Syntaxes
4.3.1 Control syntax list
4.3.2 Conditional statements
4.3.3 Repeat statement
4.3.4 Other control syntaxes
4.3.5 Precautions for use of control syntaxes
4.4 Call of Function Block
4.5 Comment
5 MELSEC FUNCTIONS
How the functions are described
5.1 Output
5.1.1 Output to device OUT_M
5.1.2 Low-speed timer TIMER_M
5.1.3 High-speed timer TIMER_H_M
5.1.4 Counter COUNTER_M
5.1.5 Set of device SET_M
5.1.6 Reset of device RST_M
5.1.7 Conversion of direct output into pulse DELTA_M
5.2 1-Bit Shift
5.2.1 1-bit shift of device SFT_M
5.3 Termination
5.3.1 Stop STOP_M
5.4 Comparison Operation
5.4.1 Block data comparison (=) BKCMP_EQ_M
5.4.2 Block data comparison (<>) BKCMP_NE_M
5.4.3 Block data comparison (>) BKCMP_GT_M
5.4.4 Block data comparison (<=) BKCMP_LE_M
5.4.5 Block data comparison (<) BKCMP_LT_M
5.4.6 Block data comparison (>=) BKCMP_GE_M
5.5 Arithmetic Operation
5.5.1 Addition of BCD 4-digit data (2 devices) BPLUS_M
5.5.2 Addition of BCD 4-digit data (3 devices) BPLUS_3_M
5.5.3 Subtraction of BCD 4-digit data (2 devices) BMINUS_M
5.5.4 Subtraction of BCD 4-digit data (3 devices) BMINUS_3_M
5.5.5 Addition of BCD 8-digit data (2 devices) DBPLUS_M
5.5.6 Addition of BCD 8-digit data (3 devices) DBPLUS_3_M
5.5.7 Subtraction of BCD 8-digit data (2 devices) DBMINUS_M
5.5.8 Subtraction of BCD 8-digit data (3 devices) DBMINUS_3_M
5.5.9 Multiplication of BCD 4-digit data BMULTI_M
5.5.10 Division of BCD 4-digit data BDIVID_M
5.5.11 Multiplication of BCD 8-digit data DBMULTI_M
5.5.12 Division of BCD 8-digit data DBDIVID_M
5.5.13 Character string data connection (2 devices) STRING_PLUS_M
5.5.14 Character string data connection (3 devices) STRING_PLUS_3_M
5.5.15 BIN block addition BKPLUS_M
5.5.16 BIN block subtraction BKMINUS_M
5.5.17 Increment INC_M
5.5.18 Decrement DEC_M
5.5.19 32-bit BIN increment DINC_M
5.5.20 32-bit BIN decrement DDEC_M
5.6 Data Conversion
5.6.1 BIN --> BCD conversion BCD_M
5.6.2 32-bit BIN --> BCD conversion DBCD_M
5.6.3 BCD --> BIN conversion BIN_M
5.6.4 32-bit BCD --> BIN conversion DBIN_M
5.6.5 Floating-point --> BIN conversion INT_E_MD
5.6.6 32-bit floating-point --> BIN conversion DINT_E_MD
5.6.7 BIN --> floating-point conversion FLT_M
5.6.8 32-bit BIN --> floating-point conversion DFLT_M
5.6.9 16-bit BIN --> 32-bit BIN conversion DBL_M
5.6.10 32-bit BIN --> 16-bit BIN conversion WORD_M
5.6.11 BIN --> gray code conversion GRY_M
5.6.12 32-bit BIN --> gray code conversion DGRY_M
5.6.13 Gray code --> BIN conversion GBIN_M
5.6.14 32-bit gray code --> BIN conversion DGBIN_M
5.6.15 2' complement of 16-bit BIN NEG_M
5.6.16 2' complement of 32-bit BIN DNEG_M
5.6.17 2' complement of floating-point ENEG_M
5.6.18 Block BIN --> BCD conversion BKBCD_M
5.6.19 Block BCD --> BIN conversion BKBIN_M
5.7 Data Transfer
5.7.1 16-bit data NOT transfer CML_M
5.7.2 32-bit data NOT transfer DCML_M
5.7.3 Block transfer BMOV_M
5.7.4 Same data block transfer FMOV_M
5.7.5 16-bit data exchange XCH_M
5.7.6 32-bit data exchange DXCH_M
5.7.7 Block data exchange BXCH_M
5.7.8 First/last byte exchange SWAP_MD
5.8 Program Execution Control
5.8.1 Interrupt disable DI_M
5.8.2 Interrupt enable EI_M
5.9 I/O Refresh
5.9.1 I/O refresh RFS_M
5.10 Logical Operation Commands
5.10.1 Logical product (2 devices) WAND_M
5.10.2 Logical product (3 devices) WAND_3_M
5.10.3 32-bit data logical product (2 devices) DAND_M
5.10.4 32-bit data logical product (3 devices) DAND_3_M
5.10.5 Block data logical product BKAND_M
5.10.6 Logical sum (2 devices) WOR_M
5.10.7 Logical sum (3 devices) WOR_3_M
5.10.8 32-bit data logical sum (2 devices) DOR_M
5.10.9 32-bit data logical sum (3 devices) DOR_3_M
5.10.10 Block data logical sum BKOR_M
5.10.11 Exclusive OR (2 devices) WXOR_M
5.10.12 Exclusive OR (3 devices) WXOR_3_M
5.10.13 32-bit data exclusive OR (2 devices) DXOR_M
5.10.14 32-bit data exclusive OR (3 devices) DXOR_3_M
5.10.15 Block data exclusive OR BKXOR_M
5.10.16 NOT exclusive OR (2 devices) WXNR_M
5.10.17 NOT exclusive OR (3 devices) WXNR_3_M
5.10.18 32-bit data NOT exclusive OR (2 devices) DXNR_M
5.10.19 32-bit data NOT exclusive OR (3 devices) DXNR_3_M
5.10.20 Block data NOT exclusive OR BKXNR_M
5.11 Rotation
5.11.1 Right rotation (carry flag not included) ROR_M
5.11.2 Right rotation (carry flag included) RCR_M
5.11.3 Left rotation (carry flag not included) ROL_M
5.11.4 Left rotation (carry flag included) RCL_M
5.11.5 32-bit data right rotation (carry flag not included) DROR_M
5.11.6 32-bit data right rotation (carry flag included) DRCR_M
5.11.7 32-bit data left rotation (carry flag not included) DROL_M
5.11.8 32-bit data left rotation (carry flag included) DRCL_M
5.12 Shift
5.12.1 n-bit right shift SFR_M
5.12.2 n-bit left shift SFL_M
5.12.3 n-bit data 1-bit right shift BSFR_M
5.12.4 n-bit data 1-bit left shift BSFL_M
5.12.5 1-word right shift DSFR_M
5.12.6 1-word left shift DSFL_M
5.13 Bit Processing
5.13.1 Bit set of word device BSET_M
5.13.2 Bit reset of word device BRST_M
5.13.3 Bit test of word device TEST_MD
5.13.4 Bit test of 32-bit data DTEST_MD
5.13.5 Bit device batch reset BKRST_M
5.14 Data Processing
5.14.1 Data search SER_M
5.14.2 32-bit data search DSER_M
5.14.3 Bit check SUM_M
5.14.4 32-bit data bit check DSUM_M
5.14.5 Decode DECO_M
5.14.6 Encode ENCO_M
5.14.7 7-segment decode SEG_M
5.14.8 4-bit disconnection of 16-bit data DIS_M
5.14.9 4-bit connection of 16-bit data UNI_M
5.14.10 Bit disconnection of any data NDIS_M
5.14.11 Bit connection of any data NUNI_M
5.14.12 Byte unit data disconnection WTOB_MD
5.14.13 Byte unit data connection BTOW_MD
5.14.14 Data maximum value retrieval MAX_M
5.14.15 32-bit data maximum value retrieval DMAX_M
5.14.16 Data minimum value retrieval MIN_M
5.14.17 32-bit data minimum value retrieval DMIN_M
5.14.18 Data sort SORT_M
5.14.19 32-bit data sort DSORT_M
5.14.20 Total value calculation WSUM_M
5.14.21 32-bit total value calculation DWSUM_M
5.15 Structuring
5.15.1 Refresh COM_M
5.16 Buffer Memory Access
5.16.1 Special function module 1-word data read FROM_M
5.16.2 Special function module 2-word data read DFRO_M
5.16.3 Special function module 1-word data write TO_M
5.16.4 Special function module 2-word data write DTO_M
5.17 Character string processing
5.17.1 BIN --> decimal ASCII conversion BINDA_S_MD
5.17.2 32-bit BIN --> decimal ASCII conversion DBINDA_S_MD
5.17.3 BIN --> hexadecimal ASCII conversion BINHA_S_MD
5.17.4 32-bit BIN --> hexadecimal ASCII conversion DBINHA_S_MD
5.17.5 BCD --> 4-digit decimal ASCII conversion BCDDA_S_MD
5.17.6 BCD 8-digit --> decimal ASCII conversion DBCDDA_S_MD
5.17.7 Decimal ASCII --> BIN conversion DABIN_S_MD
5.17.8 Decimal ASCII --> 32-bit BIN conversion DDABIN_S_MD
5.17.9 Hexadecimal ASCII --> BIN conversion HABIN_S_MD
5.17.10 Hexadecimal ASCII --> 32-bit BIN conversion DHABIN_S_MD
5.17.11 Decimal ASCII --> BCD 4-digit conversion DABCD_S_MD
5.17.12 Decimal ASCII --> BCD 8-digit conversion DDABCD_S_MD
5.17.13 Device comment data read COMRD_S_MD
5.17.14 Character string length detection LEN_S_MD
5.17.15 BIN --> character string conversion STR_S_MD
5.17.16 32-bit BIN --> character string conversion DSTR_S_MD
5.17.17 Character string --> BIN conversion VAL_S_MD
5.17.18 Character string --> 32-bit BIN conversion DVAL_S_MD
5.17.19 Floating-point --> character string conversion ESTR_M
5.17.20 Character string --> floating-point conversion EVAL_M
5.17.21 BIN --> ASCII conversion ASC_S_MD
5.17.22 ASCII --> BIN conversion HEX_S_MD
5.17.23 Fetch from character string right side RIGHT_M
5.17.24 Fetch from character string left side LEFT_M
5.17.25 Any data fetch in character string MIDR_M
5.17.26 Any data replacement in character string MIDW_M
5.17.27 Character string search INSTR_M
5.17.28 Floating-point --> BCD decomposition EMOD_M
5.17.29 BCD format data --> floating-point EREXP_M
5.18 Special Functions
5.18.1 Floating-point SIN operation SIN_E_MD
5.18.2 Floating-point COS operation COS_E_MD
5.18.3 Floating-point TAN operation TAN_E_MD
5.18.4 Floating-point SIN-1 operation ASIN_E_MD
5.18.5 Floating-point COS-1 operation ACOS_E_MD
5.18.6 Floating-point TAN-1 operation ATAN_E_MD
5.18.7 Floating-point angle --> radian RAD_E_MD
5.18.8 Floating-point radian --> angle conversion DEG_E_MD
5.18.9 Floating-point square root SQR_E_MD
5.18.10 Floating-point natural exponential operation EXP_E_MD
5.18.11 Floating-point natural logarithm operation LOG_E_MD
5.18.12 Random number generation RND_M
5.18.13 Sequence change SRND_M
5.18.14 BCD 4-digit square root BSQR_MD
5.18.15 BCD 8-digit square root BDSQR_MD
5.18.16 BCD type SIN operation BSIN_MD
5.18.17 BCD type COS operation BCOS_MD
5.18.18 BCD type TAN operation BTAN_MD
5.18.19 BCD type SIN-1 operation BASIN_MD
5.18.20 BCD type COS-1 operation BACOS_MD
5.18.21 BCD type TAN-1 operation BATAN_MD
5.19 Data Control
5.19.1 Upper/lower limit control LIMIT_MD
5.19.2 32-bit data upper/lower limit control DLIMIT_MD
5.19.3 Dead band control BAND_MD
5.19.4 32-bit data dead band control DBAND_MD
5.19.5 Bit zone control ZONE_MD
5.19.6 32-bit data bit zone control DZONE_MD
5.19.7 File register block No. switching RSET_MD
5.19.8 Set of file register file QDRSET_M
5.19.9 Set of comment file QCDSET_M
5.20 Clock
5.20.1 Read of clock data DATERD_MD
5.20.2 Write of clock data DATEWR_MD
5.20.3 Addition of clock data DATEPLUS_M
5.20.4 Subtraction of clock data DATEMINUS_M
5.20.5 Clock data format conversion (hour, minute, second --> second) SECOND_M
5.20.6 Clock data format conversion (second --> hour, minute, second) HOUR_M
5.21 Program Control
5.21.1 Program standby PSTOP_M
5.21.2 Program output OFF standby POFF_M
5.21.3 Program scan execution registration PSCAN_M
5.21.4 Program low-speed execution registration PLOW_M
5.22 Others
5.22.1 WDT reset WDT_M
6 IEC FUNCTIONS
How the functions are described
6.1 Type Conversion Functions
6.1.1 Boolean type (BOOL) --> double precision integer type (DINT) conversion BOOL_TO_DINT BOOL_TO_DINT_E
6.1.2 Boolean type (BOOL) --> integer type (INT) conversion BOOL_TO_INT BOOL_TO_INT_E
6.1.3 Boolean type (BOOL) --> character string type (STRING) conversion BOOL_TO_STR BOOL_TO_STR_E
6.1.4 Double precision integer type (DINT) --> Boolean type (BOOL) conversion DINT_TO_BOOL DINT_TO_BOOL_E
6.1.5 Double precision integer type (DINT) --> integer type (INT) conversion DINT_TO_INT DINT_TO_INT_E
6.1.6 Double precision integer type (DINT) --> real number type (REAL) conversion DINT_TO_REAL DINT_TO_REAL_E
6.1.7 Double precision integer type (DINT) --> character string type (STRING) conversion DINT_TO_STR DINT_TO_STR_E
6.1.8 Integer type (INT) --> Boolean type (BOOL) conversion INT_TO_BOOL INT_TO_BOOL_E
6.1.9 Integer type (INT) --> double precision integer type (DINT) conversion INT_TO_DINT INT_TO_DINT_E
6.1.10 Integer type (INT) --> real number type (REAL) conversion INT_TO_REAL INT_TO_REAL_E
6.1.11 Integer type (INT) --> character string type (STRING) conversion INT_TO_STR INT_TO_STR_E
6.1.12 Real number type (REAL) --> double precision integer type (DINT) conversion REAL_TO_DINT REAL_TO_DINT_E
6.1.13 Real number type (REAL) --> integer type (INT) conversion REAL_TO_INT REAL_TO_INT_E
6.1.14 Real number type (REAL) --> character string type (STRING) conversion REAL_TO_STR REAL_TO_STR_E
6.1.15 Character string type (STRING) --> Boolean type (BOOL) conversion STR_TO_BOOL STR_TO_BOOL_E
6.1.16 Character string type (STRING) --> double precision integer type (DINT) conversion STR_TO_DINT STR_TO_DINT_E
6.1.17 Character string type (STRING) --> integer type (INT) conversion STR_TO_INT STR_TO_INT_E
6.1.18 Character string type (STRING) --> real number type (REAL) conversion STR_TO_REAL STR_TO_REAL_E
6.2 Numerical Functions (General Functions)
6.2.1 Absolute value ABS ABS_E
6.2.2 Square root SQRT SQRT_E
6.3 Numeric Functions (Logarithm Functions)
6.3.1 Natural logarithm LN LN_E
6.3.2 Natural exponent EXP EXP_E
6.4 Numerical Functions (Trigonometric Functions)
6.4.1 Floating-point SIN operation SIN SIN_E
6.4.2 Floating-point COS operation COS COS_E
6.4.3 Floating-point TAN operation TAN TAN_E
6.4.4 Floating-point SIN-1 operation ASIN ASIN_E
6.4.5 Floating-point COS-1 operation ACOS ACOS_E
6.4.6 Floating-point TAN-1 operation ATAN ATAN_E
6.5 Arithmetic Operation Functions
6.5.1 Addition ADD_E
6.5.2 Multiplication MUL_E
6.5.3 Subtraction SUB_E
6.5.4 Division DIV_E
6.5.5 Modulus operation MOD MOD_E
6.5.6 Natural exponential EXPT EXPT_E
6.5.7 Assignment MOVE MOVE_E
6.6 Bit Shift Functions
6.6.1 Bit left shift SHL SHL_E
6.6.2 Bit right shift SHR SHR_E
6.6.3 Right rotation ROR ROR_E
6.6.4 Left rotation ROL ROL_E
6.7 Bit Type Boolean Functions
6.7.1 Logical product AND_E
6.7.2 Logical sum OR_E
6.7.3 Exclusive logical sum XOR_E
6.7.4 Logical NOT NOT NOT_E
6.8 Selection Functions
6.8.1 Binary selection SEL SEL_E
6.8.2 Maximum value MAX MAX_E
6.8.3 Minimum value MIN MIN_E
6.8.4 Limiter LIMIT LIMIT_E
6.8.5 Multiplexer MUX MUX_E
6.9 Comparison Functions
6.9.1 Greater than right member ( > ) GT_E
6.9.2 Greater than or equal to right member ( >= ) GE_E
6.9.3 Equal ( = ) EQ_E
6.9.4 Less than or equal to right member ( <= ) LE_E
6.9.5 Less than right member ( < ) LT_E
6.9.6 Unequal ( <> ) NE_E
6.10 Character String Functions
6.10.1 Character string length acquisition LEN LEN_E
6.10.2 Acquisition from start position of character string LEFT LEFT_E
6.10.3 Acquisition from end of character string RIGHT RIGHT_E
6.10.4 Acquisition from specified position of character string MID MID_E
6.10.5 Concatenation of character strings CONCAT CONCAT_E
6.10.6 Insertion of character string into specified position INSERT INSERT_E
6.10.7 Deletion of character string from specified position DELETE DELETE_E
6.10.8 Replacement of character string from specified position REPLACE REPLACE_E
6.10.9 Search for character string from specified position FIND FIND_E
7 ERROR LIST
APPENDICES
Appendix 1 Character Strings That Cannot Be Used as Labels and FB Names
INDEX
WARRANTY
INDEX MENU
QCPU(Q Mode) Programming Manual(Structured Text) P QCPU(Q Mode) Programming Manual (Structured Text) ( Q C P U Q M o d e ) i P r o g r a m m n g M a n u a l ( S t r u c t u r e d T e x t ) MODEL MODEL CODE QCPU-P-ST-E 13JF68 SH(NA)-080366E-A(0302)MEE HEAD OFFICE : 1-8-12, OFFICE TOWER Z 14F HARUMI CHUO-KU 104-6212,JAPAN NAGOYA WORKS : 1-14 , YADA-MINAMI 5 , HIGASHI-KU, NAGOYA , JAPAN When exported from Japan, this manual does not require application to the Ministry of Economy, Trade and Industry for service transaction permission. Specifications subject to change without notice. Printed in Japan on recycled paper. Mitsubishi Programmable Logic Controller R
• SAFETY PRECAUTIONS • (Always read these precautions before use) Before using the MELSEC-Q series or MELSEC-QnA series PLC, thoroughly read the manuals attached to the products and the relevant manuals introduced in the attached manuals. Also pay careful attention to safety and handle the products properly. Please save the manuals attached to the products carefully to make them accessible when required, and always forward them to the end user. A - 1 A - 1
REVISIONS * The manual number is given on the bottom left of the back cover. Revision Print Date Feb., 2003 SH (NA) 080366E-A First printing * Manual Number Japanese Manual Version SH-080363-A This manual confers no industrial property rights or any rights of any other kind, nor does it confer any patent licenses. Mitsubishi Electric Corporation cannot be held responsible for any problems involving industrial property rights which may occur as a result of using the contents noted in this manual.  2003 MITSUBISHI ELECTRIC CORPORATION A - 2 A - 2
INTRODUCTION Thank you for choosing the Mitsubishi MELSOFT series Integrated FA software. Read this manual and make sure you understand the functions and performance of MELSEC series sequencer thoroughly in advance to ensure correct use. Please make this manual available to the end user. CONTENTS SAFETY PRECAUTIONS..............................................................................................................................A- 1 REVISIONS....................................................................................................................................................A- 2 INTRODUCTION............................................................................................................................................A- 3 CONTENTS....................................................................................................................................................A- 3 About Manuals ...............................................................................................................................................A-11 How to Use This Manual................................................................................................................................A-12 About the Generic Terms and Abbreviations Used in This Manual .............................................................A-13 1. OVERVIEW 1- 1 to 1- 4 1.1 What Is the ST Language?...................................................................................................................... 1- 1 1.2 Features of ST Program in MELSEC-Q Series ...................................................................................... 1- 3 1.3 ST Program Creating Procedure............................................................................................................. 1- 4 2. SYSTEM CONFIGURATION 2- 1 to 2- 3 2.1 System Configuration............................................................................................................................... 2- 1 2.1.1 Applicable CPUs ............................................................................................................................... 2- 1 2.1.2 Programming tool for ST program.................................................................................................... 2- 1 2.1.3 ST program specifications ................................................................................................................ 2- 1 3. HANDLING OF CHARACTERS AND NUMERIC VALUES IN ST PROGRAMS 3- 1 to 3-16 3.1 Usable Characters ................................................................................................................................... 3- 1 3.2 Data Handling........................................................................................................................................... 3- 3 3.2.1 Data types ......................................................................................................................................... 3- 3 3.2.2 About ANY type................................................................................................................................. 3- 4 3.2.3 Array and structure............................................................................................................................ 3- 5 3.3 Data Representation Methods................................................................................................................. 3- 8 3.3.1 Constants........................................................................................................................................... 3- 8 3.3.2 Labels ................................................................................................................................................ 3-11 3.3.3 Devices .............................................................................................................................................. 3-14 4. ST PROGRAM EXPRESSIONS 4- 1 to 4-31 4.1 Assignment Statement............................................................................................................................. 4- 1 4.2 Operators.................................................................................................................................................. 4- 2 4.2.1 Operator list ....................................................................................................................................... 4- 2 4.2.2 Examples of using the operators ...................................................................................................... 4- 4 A - 3 A - 3
4.3 Control Syntaxes...................................................................................................................................... 4- 5 4.3.1 Control syntax list .............................................................................................................................. 4- 5 4.3.2 Conditional statements...................................................................................................................... 4- 6 4.3.3 Repeat statement.............................................................................................................................. 4-14 4.3.4 Other control syntaxes ...................................................................................................................... 4-19 4.3.5 Precautions for use of control syntaxes ........................................................................................... 4-21 4.4 Call of Function Block .............................................................................................................................. 4-28 4.5 Comment.................................................................................................................................................. 4-31 5. MELSEC FUNCTIONS 5- 1 to 5- 114 How the functions are described ................................................................................................................... 5- 1 5.1 Output....................................................................................................................................................... 5- 4 5.1.1 Output to device ......................................................................................... OUT_M......................... 5- 4 5.1.2 Low-speed timer ........................................................................................ TIMER_M ..................... 5- 4 5.1.3 High-speed timer ....................................................................................... TIMER_H_M ................ 5- 5 5.1.4 Counter ...................................................................................................... COUNTER_M .............. 5- 5 5.1.5 Set of device .............................................................................................. SET_M ......................... 5- 6 5.1.6 Reset of device .......................................................................................... RST_M ......................... 5- 6 5.1.7 Conversion of direct output into pulse ....................................................... DELTA_M..................... 5- 7 5.2 1-Bit Shift .................................................................................................................................................. 5- 8 5.2.1 1-bit shift of device ..................................................................................... SFT_M.......................... 5- 8 5.3 Termination............................................................................................................................................... 5- 9 5.3.1 Stop ............................................................................................................ STOP_M ...................... 5- 9 5.4 Comparison Operation............................................................................................................................. 5-10 5.4.1 Block data comparison (=) ........................................................................ BKCMP_EQ_M............ 5-10 5.4.2 Block data comparison (<>) ...................................................................... BKCMP_NE_M ............ 5-10 5.4.3 Block data comparison (>) ........................................................................ BKCMP_GT_M ............ 5-11 5.4.4 Block data comparison (<=) ...................................................................... BKCMP_LE_M............. 5-11 5.4.5 Block data comparison (<) ........................................................................ BKCMP_LT_M............. 5-12 5.4.6 Block data comparison (>=) ...................................................................... BKCMP_GE_M............ 5-12 5.5 Arithmetic Operation ................................................................................................................................ 5-13 5.5.1 Addition of BCD 4-digit data (2 devices) ................................................... BPLUS_M .................... 5-13 5.5.2 Addition of BCD 4-digit data (3 devices) ................................................... BPLUS_3_M ................ 5-13 5.5.3 Subtraction of BCD 4-digit data (2 devices) .............................................. BMINUS_M .................. 5-14 5.5.4 Subtraction of BCD 4-digit data (3 devices) .............................................. BMINUS_3_M.............. 5-14 5.5.5 Addition of BCD 8-digit data (2 devices) ................................................... DBPLUS_M.................. 5-15 5.5.6 Addition of BCD 8-digit data (3 devices) ................................................... DBPLUS_3_M.............. 5-15 5.5.7 Subtraction of BCD 8-digit data (2 devices) .............................................. DBMINUS_M ............... 5-16 5.5.8 Subtraction of BCD 8-digit data (3 devices) .............................................. DBMINUS_3_M ........... 5-16 5.5.9 Multiplication of BCD 4-digit data .............................................................. BMULTI_M................... 5-17 5.5.10 Division of BCD 4-digit data ..................................................................... BDIVID_M .................... 5-17 5.5.11 Multiplication of BCD 8-digit data ............................................................ DBMULTI_M ................ 5-18 5.5.12 Division of BCD 8-digit data ..................................................................... DBDIVID_M.................. 5-18 5.5.13 Character string data connection (2 devices) ......................................... STRING_PLUS_M....... 5-19 5.5.14 Character string data connection (3 devices) ......................................... STRING_PLUS_3_M... 5-19 5.5.15 BIN block addition .................................................................................... BKPLUS_M.................. 5-20 5.5.16 BIN block subtraction ............................................................................... BKMINUS_M................ 5-20 A - 4 A - 4
5.5.17 Increment ................................................................................................. INC_M .......................... 5-21 5.5.18 Decrement ............................................................................................... DEC_M......................... 5-21 5.5.19 32-bit BIN increment ................................................................................ DINC_M........................ 5-22 5.5.20 32-bit BIN decrement ............................................................................... DDEC_M ...................... 5-22 5.6 Data Conversion ...................................................................................................................................... 5-23 5.6.1 BIN BCD conversion ............................................................................. BCD_M......................... 5-23 5.6.2 32-bit BIN BCD conversion ................................................................... DBCD_M ...................... 5-23 5.6.3 BCD BIN conversion ............................................................................. BIN_M .......................... 5-24 BIN conversion ................................................................... DBIN_M........................ 5-24 5.6.4 32-bit BCD 5.6.5 Floating-point BIN conversion ............................................................... INT_E_MD ................... 5-25 5.6.6 32-bit floating-point BIN conversion ...................................................... DINT_E_MD................. 5-25 floating-point conversion ................................................................ FLT_M.......................... 5-26 5.6.7 BIN 5.6.8 32-bit BIN floating-point conversion ...................................................... DFLT_M ....................... 5-26 5.6.9 16-bit BIN 32-bit BIN conversion ........................................................... DBL_M ......................... 5-27 16-bit BIN conversion ......................................................... WORD_M..................... 5-27 5.6.10 32-bit BIN 5.6.11 BIN gray code conversion ................................................................... GRY_M......................... 5-28 5.6.12 32-bit BIN gray code conversion ......................................................... DGRY_M...................... 5-28 BIN conversion .................................................................. GBIN_M........................ 5-29 5.6.13 Gray code 5.6.14 32-bit gray code BIN conversion ......................................................... DGBIN_M..................... 5-29 5.6.15 Complement of 2 of 16-bit BIN ................................................................ NEG_M......................... 5-30 5.6.16 Complement of 2 of 32-bit BIN ................................................................ DNEG_M...................... 5-30 5.6.17 Complement of 2 of floating-point ........................................................... ENEG_M ...................... 5-31 5.6.18 Block BIN BCD conversion ................................................................. BKBCD_M.................... 5-31 BIN conversion ................................................................. BKBIN_M ..................... 5-32 5.6.19 Block BCD 5.7 Data Transfer ........................................................................................................................................... 5-33 5.7.1 16-bit data NOT transfer ............................................................................ CML_M......................... 5-33 5.7.2 32-bit data NOT transfer ............................................................................ DCML_M ...................... 5-33 5.7.3 Block transfer ............................................................................................. BMOV_M...................... 5-34 5.7.4 Same data block transfer .......................................................................... FMOV_M...................... 5-34 5.7.5 16-bit data exchange ................................................................................. XCH_M......................... 5-35 5.7.6 32-bit data exchange ................................................................................. DXCH_M ...................... 5-35 5.7.7 Block data exchange ................................................................................. BXCH_M ...................... 5-36 5.7.8 First/last byte exchange ............................................................................. SWAP_MD................... 5-36 5.8 Program Execution Control...................................................................................................................... 5-37 5.8.1 Interrupt disable ......................................................................................... DI_M............................. 5-37 5.8.2 Interrupt enable .......................................................................................... EI_M ............................. 5-37 5.9 I/O Refresh ............................................................................................................................................... 5-38 5.9.1 I/O refresh .................................................................................................. RFS_M ......................... 5-38 5.10 Logical Operation Commands............................................................................................................... 5-39 5.10.1 Logical product (2 devices) ..................................................................... WAND_M ..................... 5-39 5.10.2 Logical product (3 devices) ..................................................................... WAND_3_M ................. 5-39 5.10.3 32-bit data logical product (2 devices) .................................................... DAND_M ...................... 5-40 5.10.4 32-bit data logical product (3 devices) .................................................... DAND_3_M.................. 5-40 5.10.5 Block data logical product ........................................................................ BKAND_M.................... 5-41 5.10.6 Logical sum (2 devices) ........................................................................... WOR_M........................ 5-41 5.10.7 Logical sum (3 devices) ........................................................................... WOR_3_M ................... 5-42 5.10.8 32-bit data logical sum (2 devices) .......................................................... DOR_M ........................ 5-42 5.10.9 32-bit data logical sum (3 devices) .......................................................... DOR_3_M .................... 5-43 5.10.10 Block data logical sum ........................................................................... BKOR_M ...................... 5-43 A - 5 A - 5
5.10.11 Exclusive OR (2 devices) ...................................................................... WXOR_M..................... 5-44 5.10.12 Exclusive OR (3 devices) ...................................................................... WXOR_3_M................. 5-44 5.10.13 32-bit data exclusive OR (2 devices) .................................................... DXOR_M...................... 5-45 5.10.14 32-bit data exclusive OR (3 devices) .................................................... DXOR_3_M.................. 5-45 5.10.15 Block data exclusive OR ....................................................................... BKXOR_M.................... 5-46 5.10.16 NOT exclusive OR (2 devices) .............................................................. WXNR_M ..................... 5-46 5.10.17 NOT exclusive OR (3 devices) .............................................................. WXNR_3_M ................. 5-47 5.10.18 32-bit data NOT exclusive OR (2 devices) ........................................... DXNR_M ...................... 5-47 5.10.19 32-bit data NOT exclusive OR (3 devices) ........................................... DXNR_3_M.................. 5-48 5.10.20 Block data NOT exclusive OR .............................................................. BKXNR_M.................... 5-48 5.11 Rotation .................................................................................................................................................. 5-49 5.11.1 Right rotation (carry flag not included) .................................................... ROR_M ........................ 5-49 5.11.2 Right rotation (carry flag included) .......................................................... RCR_M......................... 5-49 5.11.3 Left rotation (carry flag not included) ....................................................... ROL_M......................... 5-50 5.11.4 Left rotation (carry flag included) ............................................................. RCL_M ......................... 5-50 5.11.5 32-bit data right rotation (carry flag not included) .................................... DROR_M...................... 5-51 5.11.6 32-bit data right rotation (carry flag included) .......................................... DRCR_M...................... 5-51 5.11.7 32-bit data left rotation (carry flag not included) ...................................... DROL_M ...................... 5-52 5.11.8 32-bit data left rotation (carry flag included) ............................................ DRCL_M ......................5-52 5.12 Shift......................................................................................................................................................... 5-53 5.12.1 n-bit right shift .......................................................................................... SFR_M ......................... 5-53 5.12.2 n-bit left shift ............................................................................................. SFL_M.......................... 5-53 5.12.3 n-bit data 1-bit right shift .......................................................................... BSFR_M....................... 5-54 5.12.4 n-bit data 1-bit left shift ............................................................................ BSFL_M ....................... 5-54 5.12.5 1-word right shift ...................................................................................... DSFR_M ...................... 5-55 5.12.6 1-word left shift ........................................................................................ DSFL_M ....................... 5-55 5.13 Bit Processing ........................................................................................................................................ 5-56 5.13.1 Bit set of word device ............................................................................... BSET_M....................... 5-56 5.13.2 Bit reset of word device ........................................................................... BRST_M....................... 5-56 5.13.3 Bit test of word device .............................................................................. TEST_MD .................... 5-57 5.13.4 Bit test of 32-bit data ................................................................................ DTEST_MD.................. 5-57 5.13.5 Bit device batch reset .............................................................................. BKRST_M .................... 5-58 5.14 Data Processing..................................................................................................................................... 5-59 5.14.1 Data search ............................................................................................. SER_M......................... 5-59 5.14.2 32-bit data search .................................................................................... DSER_M ...................... 5-59 5.14.3 Bit check .................................................................................................. SUM_M ........................ 5-60 5.14.4 32-bit data bit check ................................................................................ DSUM_M...................... 5-60 5.14.5 Decode ..................................................................................................... DECO_M...................... 5-61 5.14.6 Encode ..................................................................................................... ENCO_M...................... 5-61 5.14.7 7-segment decode ................................................................................... SEG_M......................... 5-62 5.14.8 4-bit disconnection of 16-bit data ............................................................ DIS_M .......................... 5-62 5.14.9 4-bit connection of 16-bit data ................................................................. UNI_M .......................... 5-63 5.14.10 Bit disconnection of any data ................................................................. NDIS_M........................ 5-63 5.14.11 Bit connection of any data ..................................................................... NUNI_M........................ 5-64 5.14.12 Byte unit data disconnection .................................................................. WTOB_MD................... 5-64 5.14.13 Byte unit data connection ...................................................................... BTOW_MD................... 5-65 5.14.14 Data maximum value retrieval ............................................................... MAX_M......................... 5-65 5.14.15 32-bit data maximum value retrieval ..................................................... DMAX_M...................... 5-66 5.14.16 Data minimum value retrieval ................................................................ MIN_M.......................... 5-66 A - 6 A - 6
5.14.17 32-bit data minimum value retrieval ...................................................... DMIN_M ....................... 5-67 5.14.18 Data sort ................................................................................................. SORT_M ...................... 5-67 5.14.19 32-bit data sort ....................................................................................... DSORT_M.................... 5-68 5.14.20 Total value calculation ........................................................................... WSUM_M..................... 5-68 5.14.21 32-bit total value calculation .................................................................. DWSUM_M .................. 5-69 5.15 Structuring .............................................................................................................................................. 5-70 5.15.1 Refresh .................................................................................................... COM_M........................ 5-70 5.16 Buffer Memory Access........................................................................................................................... 5-71 5.16.1 Special function module 1-word data read .............................................. FROM_M...................... 5-71 5.16.2 Special function module 2-word data read .............................................. DFRO_M ...................... 5-71 5.16.3 Special function module 1-word data write ............................................. TO_M ........................... 5-72 5.16.4 Special function module 2-word data write ............................................. DTO_M......................... 5-72 5.17 Character string processing................................................................................................................... 5-73 5.17.1 BIN decimal ASCII conversion ............................................................ BINDA_S_MD.............. 5-73 decimal ASCII conversion ................................................. DBINDA_S_MD ........... 5-73 5.17.2 32-bit BIN 5.17.3 BIN hexadecimal ASCII conversion .................................................... BINHA_S_MD.............. 5-74 5.17.4 32-bit BIN hexadecimal ASCII conversion ......................................... DBINHA_S_MD ........... 5-74 decimal ASCII conversion ............................................... BCDDA_S_MD ............ 5-75 5.17.5 BCD 4-digit 5.17.6 BCD 8-digit decimal ASCII conversion ............................................... DBCDDA_S_MD.......... 5-75 5.17.7 Decimal ASCII BIN conversion ........................................................... DABIN_S_MD.............. 5-76 32-bit BIN conversion ................................................. DDABIN_S_MD ........... 5-76 5.17.8 Decimal ASCII 5.17.9 Hexadecimal ASCII BIN conversion ................................................... HABIN_S_MD.............. 5-77 5.17.10 Hexadecimal ASCII 32-bit BIN conversion ....................................... DHABIN_S_MD ........... 5-77 BCD 4-digit conversion ............................................ DABCD_S_MD ............ 5-78 5.17.11 Decimal ASCII 5.17.12 Decimal ASCII BCD 8-digit conversion ............................................ DDABCD_S_MD.......... 5-78 5.17.13 Device comment data read ................................................................... COMRD_S_MD ........... 5-79 5.17.14 Character string length detection .......................................................... LEN_S_MD .................. 5-79 5.17.15 BIN character string conversion ........................................................ STR_S_MD.................. 5-80 5.17.16 32-bit BIN character string conversion ............................................. DSTR_S_MD ............... 5-80 BIN conversion ....................................................... VAL_S_MD .................. 5-81 5.17.17 Character string 5.17.18 Character string 32-bit BIN conversion ............................................. DVAL_S_MD................ 5-81 5.17.19 Floating-point character string conversion ........................................ ESTR_M....................... 5-82 floating-point conversion ........................................ EVAL_M ....................... 5-82 5.17.20 Character string 5.17.21 BIN ASCII conversion ....................................................................... ASC_S_MD.................. 5-83 5.17.22 ASCII BIN conversion ....................................................................... HEX_S_MD.................. 5-83 5.17.23 Fetch from character string right side ................................................... RIGHT_M ..................... 5-84 5.17.24 Fetch from character string left side ...................................................... LEFT_M........................ 5-84 5.17.25 Any data fetch in character string .......................................................... MIDR_M ....................... 5-85 5.17.26 Any data replacement in character string ............................................. MIDW_M ...................... 5-85 5.17.27 Character string search ......................................................................... INSTR_M ..................... 5-86 5.17.28 Floating-point BCD decomposition ................................................... EMOD_M ..................... 5-86 floating-point ......................................................... EREXP_M.................... 5-87 5.17.29 BCD format data 5.18 Special Functions................................................................................................................................... 5-88 5.18.1 Floating-point SIN operation .................................................................... SIN_E_MD ................... 5-88 5.18.2 Floating-point COS operation .................................................................. COS_E_MD .................5-88 5.18.3 Floating-point TAN operation .................................................................. TAN_E_MD.................. 5-89 5.18.4 Floating-point SIN-1 operation .................................................................. ASIN_E_MD................. 5-89 5.18.5 Floating-point COS-1 operation ................................................................ ACOS_E_MD............... 5-90 5.18.6 Floating-point TAN-1 operation ................................................................ ATAN_E_MD ............... 5-90 A - 7 A - 7
分享到:
收藏