Home

OPERATION MANUAL

image

Contents

1. D Instance Area 5 Add Set the 4 areas Momm are Retain EO 20480 EO 32767 Timers 307 T409 Counters Setting Example StartAddress End Address Se Non Retain wano Waas EO 20480 EO 32767 12288 Times o T4095 1024 Counters Specifying Instance Area Addresses from the User Program If there are instructions in the user program that access addresses in the instance areas the CX Programmer IEC will display an error on the Output Windows Compile Program Check Tab Page in the following cases e When attempting to download the user program to the CPU Unit or attempting to write the program through online editing Neither download ing or editing will be possible e When a program check is performed by the user by selecting Program Compile Program Check or Compile All Programs Check from the PLC Menu 19 Converting Function Block Definitions to Library Files Note Section 1 4 For example if WOOO to W511 is specified as the non retained instance area and WOOO is used in the ladder program the following error will be displayed when compiling ERROR omitted Address WO 00 is reserved for Function Block use Program Instance area Start address Size Retanedaree ST Tmerarea CP Counterarea Compile error When a variable is added or deleted addresses are automatically re allocated to the instance areas Consecutive addresses are required for
2. C Control word NASL NSLL NSLL NSLL NASR NASR NASR NSRL NSRL NSRL 5 5 OD O T zZ ri JJ ER Increment Decrement Instructions INGREMENT BINARY DOUBLE INCREMENT BINARY DECREMENT BINARY 98 Operands Array required ma his Word o o u o Instruction Support and Operand Restrictions Appendix D Instruction Function Symbol Operands Array oo reduired DOUBLE DECREMENT Wd 1st word BINARY a INCREMENT BCD Wd Word zu DOUBLE INCREMENT 595 Wa ist d BCD _ DECREMENT BCD 596 Wd Word DOUBLE DECREMENT 597 Wd 1st word u im we Ki i Symbol Math Instructions Function Symbol Operands Array code required SIGNED BINARY ADD Au Augend word EN WITHOUT CARRY Ad Addend word R Result word Au 1st augend word Ad 1st addend word R 1st result word DOUBLE SIGNED BINARY ADD WITHOUT CARRY Ad Au Augend word Ad Addend word R Result word Au 1st augend word Ad 1st addend word R 1st result word DOUBLE SIGNED BINARY CL ADD WITH CARRY CL Q BCD ADD r WITHOUT CARRY Au Augend word Ad Addend word R Result word SIGNED BINARY ADD WITH CARRY 9 Instruction Support and Operand Restrictions Appendix D Instruction Function Symbol Operands Array code required Au 1st augend word BL P Ad 1st addend word u R 1st result word DOUBLE BCD ADD WITH OUT CARRY BL gt Q BCD ADD WITH CARRY BC A
3. e Retain Select if the value of the variable is to be maintained when the power is turned ON or when the operating mode is changed from PROGRAM or MONITOR mode to RUN mode The value will be cleared at these times if Retain is not selected Input the name of the function block variable The default data type is BOOL sl Change as required New Variable Name Type of variable to register Data Type eee i e the sheet oade Bet Advanced Initial value Initial Value FALSE z Retain Comment l Select to maintain value for xi power interruptions 2 For example input aaa as the variable name and click the OK Button As shown below a BOOL variable called aaa will be created on the Inputs Sheet of the Variable Table File Edit View Insert PLC Program Tools Window Help EERTE KAF SEHE Ber So Ze EO ERA R AAS 2E ds Name Type AT Initia Value A DO ra New Project Inputs Outputs Externals BOOL variable called aaa created on Inputs Sheet 30 Procedures Section 2 2 Creating the Algorithm Using a Ladder Program 1 2 3 1 Press the C Key and select aaa registered earlier from the pull down menu in the New Contact Dialog Box FB sample CX Pragrammer IEC NewPLCi pH File Ed View Insert PLG Program Tools Window Help osajsalseeleesia le e assa s h AR DREE a wia A y PN ppu IF r z He m KA ISEHEIRIHIEMI OLR EIE Ie ss 42
4. 1 2 3 The ladder program or structured text program can be input first and variable registered as they are required When using a ladder diagram a dialog box will be displayed to register the variable whenever a variable name that has not been registered is input The variable is registered at that time Use the following procedure 1 Press the C Key and input a variable name that has not been registered such as aaa in the New Contact Dialog Box Note A name must be input for variables even ones with AT settings specified address With CX Programmer IEC the following char acters can be input as the variable name to indicate VO memory addresses This is not possible with non IEC CX Programmer A W H HR D DM E EM T TM C or CNT followed by a number channel word address e A period to differentiate between channel word and bit addresses For example when Auxiliary Area addresses are specified as ATs the VO memory address e g A50200 can be specified as the variable name to make assignments easier to understand Even when this is done the actual address must be specified in the AT settings 2 Click the OK Button The New Variable Dialog Box will be displayed With special instructions aNew Variable Dialog Box will be display for each op erand in the instruction New Variable x Name pa Data Type BOOT x Usage Internal hd Initial Value FALSE 7 Retain Comment Set the data
5. 664 Yes MOV STRING S 1st source word Yes D 1st destination word CONCATENATE STRING _ 656 S1 Text string 1 S2 Text string 2 D First destination word Ma Yes Yes GET STRING LEFT LEFT 652 S1 Text string first word LEFT S2 Number of characters EN D First destination word Yes GET STRING RIGHT RGHT 653 S1 Text string first word Y RGHT S2 Number of characters EN D First destination word Me 120 Instruction Support and Operand Restrictions Appendix D Instruction Function Operands Array code required GET STRING MIDDLE MID 654 MID FIND IN STRING FIND FIND STRING LENGTH LENS 650 LENS REPLACE IN STRING RPLC 661 RPLC DELETE STRING DEL 658 DELS EXCHANGE STRING XCHG 665 XCHG CLEAR STRING INSERT INTO STRING S2 Number of characters S3 Beginning position D First destination word S1 Source text string first word S2 Found text string first Yes word D First destination word S Text string first word es D 1st destination word S1 Text string first word Yes 5 N Yes es string first word D First destination word 5 N es S2 Number of characters S3 Beginning position D First destination word S1 Text string first word 5 N Yes Yes Ex1 1st exchange word 1 Ex2 1st exchange word 2 lt CLR CLR S Text string first word S1 Base text string first
6. 1st augend word Ad 1st addend word R 1st result word DOUBLE FLOATING POINT SUBTRACT DOUBLE FLOATING POINT MULTIPLY Mi 1st minuend word Su 1st subtrahend word R 1st result word Qo J Md 1st multiplicand word Mr 1st multiplier word R 1st result word DOUBLE FLOATING POINT DIVIDE Dd 1st Dividend word Dr 1st divisor word R 1st result word DOUBLE DEGREES TO RADIANS RADD RADD S 1st source word R 1st result word DOUBLE RADIANS TO DEGD DEGD S Ist source word R 1st result word DEGREES DOUBLE SINE SIND SIND S 1st source word R 1st result word DOUBLE GOSINE COSD COSD S 1st source word R 1st result word 10 Instruction Support and Operand Restrictions Instruction DOUBLE TANGENT DOUBLE ARC SINE DOUBLE ARC COSINE DOUBLE ARC TANGENT DOUBLE SQUARE ROOT DOUBLE EXPONENT DOUBLE LOGARITHM DOUBLE EXPONENTIAL POWER 110 TAND TAND ASIND ASIND ACOSD ACOSD ATAND ATAND SQRTD SQRTD EXPD EXPD LOGD LOGD PWRD PWRD Function on Appendix D Operands S 1st source word R 1st result word S 1st source word R 1st result word S 1st source word R 1st result word S 1st source word R 1st result word S 1st source word R 1st result word S 1st source word R 1st result word S 1st source word R 1st result word B 1st base w
7. Look in E Le Programimer IEC Data de jt sample cxf Files of type CX P IEC Function Block Library Files cxf Cancel 3 A function block called FunctionBlock1 will be automatically inserted after the Function Blocks icon This icon contains the definition of the function block 4 Double click the FunctionBlock1 Icon The variable table and algorithm will be display E 2 2 11 Downloading Programs to a CPU Unit After a program containing function blocks has been created it can be down loaded from the CX Programmer IEC to a CPU Unit that is connected online It is also possible to check if the programs on the CX Programmer IEC and in the CPU Unit are the same Programs cannot be uploaded from the CPU Unit 43 Procedures Section 2 2 2 2 12 Monitoring and Debugging Function Blocks The following procedures can be used to monitor programs containing func tion blocks Monitoring Programs in Use the following procedure to check the program in the function block defini Function Block Definitions ton for an instance during monitoring 1 2 3 Right click the instance and select Go To Function Block Definition from the popup menu The function block definition will be displayed Monitoring Instance Use the following procedure to monitor instance variables Variables in the Watch Window 1 2 3 1 Select View Window Watch A Watch Window will be displayed 2 Double click the watch window The
8. Variable The ENO variable is created as the default output variable The ENO output variable will be turned ON when the instance is called The user can change this value The ENO output variable can be used as a flag to check whether or not instance execution has been completed normally 51 Function Block Specifications Section 3 1 52 B Internal Variables Internal variables are used within an instance These variables are internal to each instance They cannot be referenced from outside of the instance and are not displayed in the instance The values of internal variables are retained until the next time the instance is executed Consequently even if instances of the same function block defini tion are executed with the same I O parameters the result will not necessarily be the same Example The internal variable tim a in instance Pulse 2sON 1sOFF is different from internal variable tim_a in instance Pulse 4sON 1sOFF so the instances can not reference and will not affect each other s tim a value Variable table Usage Name Type CLOCK PULSE as Internal tim_a TIMER EN ENO Internal tim_b TIMER Input ON_TIME INT Input OFF_TIME INT a CLOCK PULSE EN ENO tmp Internals J Outputs J Externals 0 0 ADD_INT_DINT 10 0 i Algorithm Body EN ENO i EN Z id SIGN IN16 tmp i D100 D1000 SS D200 L IN32 tmp OUT32 Variable table is not displayed Internal
9. XV Installation Precaution XVI SECTION 1 Introduction This section introduces the CX Programmer IEC and explains the features that are not contained in the non IEC version of CX Programmer 1 1 Introducing the CX Programmer IEC 2 1 1 1 Functions and Features oee 2 1 1 2 SPECINCATONS een een 3 1 1 3 Files Created with CX Programmer IEC 5 afd EX Prosrammer TEC Menus aa zena oe ad 28 oR RE a N 6 l 2 Function BlOEKS ie EE ER IS EDE ler DE dd 7 LEZE OMME Sorts 50 6 eset TE OE OE ON Betere bras 7 1 2 2 Advantages of Function Blocks SE SS SE ee eae 7 12 3 Function Block Str el re aaa a ae ae 8 1 3 MAAIEN anne dr RE G EE Ze 13 ed ImtrodUehOAss snotter eha odette 13 1 3 2 Variable Usage and Properties 0 0 0 ss ss ss eee 14 123 3 MVariable Properties isi Ee aaah ER SEER DES ER Ee dalek Sees 15 1 3 4 Property Settings and Variable Usage n 0 17 1 3 5 Internal Allocation of Variable Addresses 18 1 4 Converting Function Block Definitions to Library Files 20 125 Operatines Procedures ics sie DEERE EED SAG un the Re EER Ee 21 1 5 1 Creating Function Blocks and Executing Instances 21 1 5 2 Reusing Function Blocks a ns sr 2 1 2 22 Introducing the CX Programmer IEC Section 1 1 1 1 Introducing the CX Programmer IEC 1 1 1 Functions and Features The CX Programmer IEC is a Programming Device that can use standar
10. Z x Decrement input Reset input 92 Instruction Support and Operand Restrictions Appendix D 1 CS1 H CJ1 H CJ1M or CS1D only Function Symbol Operands Array code required RESET TIMER CNR 545 Not supported N1 1st number in range COUNTER CNR N2 Last number in range BCD 547 Ee N1 1st number in range mn N2 Last number in range Comparison Instructions 1 CS1 H CJ1 H CJ1M or CS1D only 2 CJ1M only Function Symbol Operands Array a required Symbol Comparison S1 Comparisondata1 Unsigned S2 Comparison data 2 Using AND Symbol option Using OR Symbol option Symbol Comparison Dou S1 Comparisondata1 ble word unsigned S2 Comparison data 2 Symbol Comparison S1 Comparisondata1 Signed S2 Comparison data 2 Symbol Comparison Dou LD AND S1 Comparison data 1 EN ble word signed S2 Comparison data 2 93 Instruction Support and Operand Restrictions Appendix D 1 CS1 H CJ1 H CJ1M or CS1D only 2 CJ1M only Function Symbol Operands Array eo reduired UNSIGNED COMPARE S1 Comparisondatat yapi S2 Comparison data 2 DOUBLE UNSIGNED CMPL en S1 Comparisondatat COMPARE S2 Comparison data 2 SIGNED BINARY COM CPS 114 S1 Comparison data 1 PARE ICPS S2 Comparison data 2 DOUBLE SIGNED CPSL 115 S1 Comparison data 1 CPSL BINARY COMPARE S2 Comparison data 2 TABLE TCMP 085 S Source
11. and a Programming Console is not connected The user program and parameter area data e g PLC Setup are always backed up automatically in flash mem ory Section 3 5 Reference Cycle time 10 4 Computing the Cycle Time in Operation Manual Constant cycle time Program ming Manual W394 Cycle time 10 4 Computing the Cycle Time in Operation Manual Cycle time monitoring Program ming Manual W394 I O refreshing 10 4 Computing the Cycle Time in Operation Man ual VO refresh methods Program ming Manual W394 VO memory SECTION 9 Memory Areas in Operation Manual Holding memory areas when changing operating modes Pro gramming Manual W394 Holding VO memory 9 2 3 Data Area Properties in Operation Manual Load OFF Programming Manual W394 Timer counter PV Binary only Programming Manual W394 refresh method Note BCD is not supported Input response time 10 4 6 VO Response Time in Operation Manual Input response settings Pro gramming Manual W394 Startup mode Programming Manual W394 CPU Unit Specifications and Battery Replacement Section 3 5 Item Specification Reference Memory Card functions Automatically reading pro grams autoboot from the Memory Card when the power is turned ON Supported Memory Cards and file memory 3 2 File Memory in Operation Manual and Programming Man ual W394 Automatic file transfer at startup and file operations using CMND Progra
12. 013 IDIFU DIFFERENTIATE DOWN z 71 C B B B B B B RSET RSET RSET IRSET I RSET I RSET MULTIPLE BIT SET 530 ei m B B B B B B ii i N DIFD it it it it it it D Beginning word N1 Beginning bit N2 Number of bits MULTIPLE BIT RESET SETA C M bit 5 M Beginingon Na o _SETB OD ON N2 Number of bits SINGLE BIT SET 1 a Lite address N Bit number 90 Instruction Support and Operand Restrictions Appendix D 1 CS1 H CJ1 H CJ1M or CS1D only Function Symbol Operands Array code required INGEE BIT RESET 533 D Word address o N Bit number D BIT OUTPUT 534 D Word address Fa o N Bit number Sequence Control Instructions Function Symbol Operands Array code required ee He DT NO OPERATION Nop 000 JUMP JMP 004 Not supported in func N Jump number tion blocks JUMP END JME 005 Not supported in func N Jump number tion blocks CONDITIONAL JUMP CJP 510 Not supported in func N Jump number tion blocks CONDITIONAL JUMP CJPN 511 Not supported in func N Jump number tion blocks MULTIPLE JUMP JMPO 515 Not supported in func tion blocks MULTIPLE JUMP END JMEO Not supported in func tion blocks FOR NEXT LOOPS FOR 912 FOR N N Number of loops ee id N BREAK NEXT Timer and Counter Instructions 1 CS1 H CJ1 H CJ1M or CS1D only Instruction Function Symbol Operands Array code required S S
13. A and B are INT but C is a LINT e The following type of data type conversion functions can be used in structured text Syntax CurrentData Type TO NewDatalype VariableName Example REAL TO INT C The above example changes the data type of variable C from REAL to INT 83 Structured Text Keywords Appendix B The combinations of data types that can be converted are given in the following table YES Conversion possible No Conversion not possible FROM TO YES Ne YES LREAL YES Control Statements Control statement Function Example CS ProgrammerlEC Assignment Substitutes the results of the expres A B Supported sion variable or value on the right for the variable on the left Function block call Calls a function block FB_INST augument_list Not supported RETURN Returns to the point from which a RETURN Not supported function block was called IF THEN ELSIF Evaluates an expression when the IF condition_ 1 THEN Supported ELSE END_IF condition for it is true ela i ELSIF condition_2 THEN expression 2 ELSE expression 3 END_IF CASE ELSE Evaluates an express based on the B variable OF Supported END CASE value of a variable 1 expression 1 2 expression 2 3 ME 3 ELS ees 4 END CASE FOR TO BY DO Repeatedly evaluates an expression FOR identifier initial value Supported END FOR according to the initial value final TO final value BY increment value and increment DO
14. BCDL DOUBLE BCD BCDL 102 S 1st source word R 1st result word Instruction Support and Operand Restrictions Appendix D Symbol Operands Array required R Result word Function code Instruction 2 S COMPLEMENT mad oO Z al O dy dy U x Z DOUBLE 2 S COMPLE NEGL 161 MENT NEGL S 1st source word R 1st result word NEGL 16 BIT TO 32 BIT SIGNED BINARY SIGN R 1st result word SIGN C Control word S lt R 1st result word es DATA DECODER MLPX 076 MLPX DATA ENCODER DMPX 077 DMPX S 1st source word R Result word C Control word D G Z 2 di lt es ASCII CONVERT ASC 086 ASC ASC z Di Digit designator D 1st destination word ASCII TO HEX HEX 162 ER S 1st source word HEX 5 Di Digit designator D Destination word COLUMN TO LINE LINE 063 LINE LINE TO COLUMN COLM 064 COLM SIGNED BCD TO BINARY li di 5 N S 1st source word N Bit number 2 D Destination word mm Z Z mi di D 1st destination word es N Bit number C Control word D Destination word BINS 470 BINS 10 W Instruction Support and Operand Restrictions Appendix D Instruction Function Symbol Operands Array required DOUBLE SIGNED BCD BISL BST C Control word TO BINARY BISL D 1st destination word SIGNED BINARY TO BCD BCDS TT C Control word BCDS D D
15. Edit Dialog Box will be displayed as shown below PLC NewPLC Name or address Data Type Format Click the Browse Button 3 Click the Browse Button select the variable to be monitored and click the OK Button Find Symbol Read only Any d Pz Look in NewPLC1 v Symbols of type BooL v Name or address d Edit Sumba Symbol Informatio Fo 0 Name Address or value Data type 00 00 U U U U Comment 4 Click the OK Button Variable values will be display in the Watch Window as shown below Usage Value Comment DU U Address being used Variable name 44 Section 2 2 Procedures Monitoring Instance VO The present values of parameters for VO variables are displayed below the Variables parameters PV of parameter for I O variable Editing Function Block Programs using function blocks can be edited online Changes can also be ron Programs made around instances nline Instance parameters can be changed instances can be deleted and instructions other than those in instances can be changed Instances cannot be added instance names cannot be changed and algorithms and variable tables in function block definitions cannot be changed 45 Procedures Section 2 2 46 SECTION 3 Specifications This section provides specifications for reference when using function blocks including specifications on function blocks instances and compati
16. H rat aen DATA WORI us 4 Paste into function block 97 10 Table BUTS BOSE FALSE E Settings Internal Inputs Outputs Externals i men e i rograms of MOV O021 H Move A E 3 Program 00 777727 veered BOK Do Source word AF Function Bocks F FunctionBlock1 Destination 5 Symbols used in non IEC CX Programmer automatically registered as FB variables 5 When the rungs are pasted any symbols used in non IEC CX Program mer will automatically be registered in the variable table of the function block Any addresses that were specified directly in non lEC CX Program mer will be displayed in red and nothing will be registered for them Change all of these to variables When using structured text a dialog box will not be displayed to register the variable whenever a variable name that has not been registered is input Be sure to always register variables used in standard text programming in the variable table either as you need them or after completing the program Place the cursor in the tab page on which to register the variable right click and select Insert Variable from the popup menu 2 2 4 Creating Instances from Function Block Definitions 36 If a function block definition is registered in the global symbol table either of the following methods can be used to create instances Method 1 Select the function block definition insert it into the program and input a new instance n
17. N 100 s 3 The function block definition would then be placed in the program and words allocated to the CPU Bus Unit could be specified merely by passing the unit number using N in the above example to the instance For exam ple if a value of 5 was passed for N D30500 would be specified 35 Procedures Section 2 2 Reusing Non IEC CX Programmer Projects cxp 1 2 3 1 Read the non IEC CX Programmer project cxp and change the Device Using Structured Text Type to one that supports function blocks 2 Cutthe rungs to be used in the function block 3 Create a new function block definition 4 Paste the rungs into the function block 1 Open non IEC CX Programmer project and change iel x slelxd D Device Type to one that supports function blocks wi jd n WE se BE ME T ED ED ED hy 0 ss saals elk AEH Up ae 2 Cut for use in function block a Blea KEPER xl jo Projecti E En PLCOO1 CJ1G H FB Offline Symbols F7 10 Table Toooo 3 00 E3 Settings O 2 kid 1 Swot START Programs b MOW 021 Move g Programi 00 T ak ii 3 00 DO Source word Symbols Section se p END DATA Destination TE Function Blocks Si AUTO 5 00 3 Create fu nction block definition TN O Initial Value 1 Retained FALSE Comment Projecti START BOOL PLCOO1 CI1G HIFBY Offline DATA WORD 0
18. ON_TIME Internal tim_b TIMER NT y Input ON TIME Nm A Output variables ImpetvarsbleEs SRE et URE e eect ea SEED SEA DEEG I I tim b N io TIMX tim_a OFF TIME i tim a i i H TIMX tim_b OFF TIME 3 Internal variables Variable Type Usage Definition Operands to the Return values from the Variables used only Global symbols regis instance instance within instance tered as variables beforehand with the CX Programmer IEC Status of value at next The value is not The value is passed The value is passed The value is not passed on to the next on to the next execu on to the next execu passed on to the next execution tion tion execution execution Display Displayed on the left Displayed on the right Not displayed Not displayed side of the instance side of the instance Number allowed 64 max per function 64 max per function Unlimited Reserved variables block excluding EN block excluding ENO only 28 total Supported Supported Retain setting Supported Supported Variables created by EN Enable ENO Enable Output None Global symbols regis default Receives an input con Outputs the function tered in advance as dition block s execution sta variables in the CX tus Programmer IEC such as Condition Flags and some Auxiliary Area bits Note For details on Externals refer to Appendix C External Variables Oo l O B Input Variables Input var
19. Unit before replacing the battery Refer to the CS Series Operation Manual for the battery replacement procedure either with or with out power supplied The effective life of the battery is 5 years at 20 C regardless of how long power is supplied to the CPU Unit The battery life will be reduced at higher temperatures The battery life will also depend on the ratio of time that power is supplied Refer to the Operation Manual for the CPU Unit for details The CPU Unit models to refer to are listed in the following table CPU Unit Reference CPU Unit CS1G CPULILIH FB CS1G CPUL CS1H CPUOOH FB CS1H CPUDILIH CJ1G CPULILIH FB CJ1G CPULILIH CPU Unit Replacement Battery Set CS1G CPULILIH FB CS1W BATO1 CS1H CPULILIH FB CJ1G CPULILIH FB CPM2A BATO1 79 CPU Unit Specifications and Battery Replacement Section 3 5 80 Appendix A Data Types Basic Data Types Data type Content Size Range of values BOOL Bit data 32 768 to 32 767 DINT Double integer 2 147 483 648 to 2 147 483 647 LINT Long 8 byte integer 64 9 223 372 036 854 775 808 to 9 223 372 036 854 775 807 UINT Unsigned integer 0 to 65 535 UDINT Unsigned double integer 0 to 4 294 967 295 ULINT Unsigned long 8 byte 64 0 to 18 446 744 073 709 551 615 integer 32 REAL Real number 3 402823 x 1098 to 1 175494 x 10798 0 1 175494 x 10758 to 3 402823 x 10 8 LREAL Long real number 64 1 79769313486232 x 10
20. checkers email or other communications software and schedulers or other ap plications that start up periodically or automatically e Disable sharing hard disks printers or other devices with other com puters on any network e With some notebook computers the RS 232C port is allocated to a modem or an infrared line by default Following the instructions in doc umentation for your computer and enable using the RS 232C port as a normal serial port e With some notebook computers the default settings for saving energy do not supply the rated power to the RS 232C port There may be both Windows settings for saving energy as well as setting for specific com puter utilities and the BIOS Following the instructions in documenta tion for your computer disable all energy saving settings e Do not turn OFF the power supply to the PLC or disconnect the connect ing cable while the CX Programmer IEC is online with the PLC The com puter may malfunction e Confirm that no adverse effects will occur in the system before attempting any of the following Not doing so may result in an unexpected operation e Changing the operating mode of the PLC e Force setting force resetting any bit in memory e Changing the present value of any word or any set value in memory e Check the user program for proper execution before actually running it on the Unit Not checking the program may result in an unexpected opera tion e When online editing is
21. collection of data elements that are the same type of data Each array element is specified with the same variable name and a unique index The index indicates the location of the element in the array A one dimensional array is an array with just one index number Example When an internal variable named SCL is set as an array variable with 10 elements the following 10 variables can be used SCL 0 SCL 1 SCL 2 SCL 3 SCL 4 SCL 5 SCL 6 SCL 7 SCL 8 and SCL 9 SUL WORD variable WORD variable Specify SCLI3 to access this data element WORD variable WORD variable WORD variable WORD variable WORD variable WORD variable Edit Variable x Name Bal TTC Data Type E Cancel Usage Internal v EE hitial Value fo Retain Comment Advanced Settines x Array Settings v Array Variable Gancel Arkay Size Cfo gt AT Settings AT Specified Address m Settings for variable SCL as an array variable with element numbers 0 to 9 When specifying the first or last word of multiple words for an instruction oper and I O parameters cannot be used to pass data to or from I O variables Internal array variables must be used This applies for example to the first source word for SEND 090 or the starting word or end word for BSET 071 55 Function Block Specifications Section 3 1 For multiword operands an array variable must be prepared in advance with the required num
22. described on the next page The CX Programmer IEC can be used only for SYS MAC CS series and CJ series CPU Units that support function blocks These CPU Units are indicated as the CS1 H FB CJ1 H FB CPU Units This manual describes only CX Programmer IEC operations that are different from those of the non IEC CX Programmer For operations not related to function blocks refer to the CX Programmer Oper ation Manual enclosed Cat No W414 This manual also provides only specifications and informa tion on the battery replacement procedure for the CS1 H FB CJ1 H FB CPU Units For other information refer to the CS CJ series manuals Please read this manual and related manuals carefully and be sure you understand the information provided before attempting to install or operate the CX Programmer IEC or the CS1 H FB CJ1 H FB CPU Units Be sure to read the precautions provided in the following section Manuals Related to the CX Programmer IEC Mame fEENed onen SYSMAC WS02 CPIC1 E This manual CX Programmer IEC Operation Manual Describes the functionality unique to the CX Programmer IEC CS1G CPU42H 44H FB CS1H CPU65H based on function blocks Functionality that is the same as 67H FB CJ1G CPU42H 43H 44H FB CPU that of the CX Programmer is described in W414 enclosed Units SYSMAC WS02 CXPC1 E V3L W414 Provides information on how to use the CX Programmer for CX Programmer Operation Manual all functionality except for fun
23. max not including EN and ENO function block definitions Allocation of addresses Automatic allocation The allocation range can used by variables be set by the user Actual address specifica Supported tion Array specifications Supported one dimensional arrays only Language Function blocks can be created in ladder programming language or structured text ST see note 2 048 max per CPU Unit Number of instances Instance names Storing function blocks as Each function block definition can be stored as one file for reuse in other library files projects Note The ST language conforms to the IEC 61131 3 standard but CX Programmer IEC supports only assignment statements selection statements CASE and IF statements iteration statements FOR WHILE and REPEAT statements arithmetic operators logical operators comparison operators and comments Other statements and operators are not supported For details refer to Appen dix B Structured Text Keywords Creating instances 30 000 characters max Restrictions on Particular CPU Units e If a user program created with CX Programmer IEC contains function blocks it cannot be downloaded to a CPU Unit that does not support function blocks If the program is downloaded to a CPU Unit that does not support function blocks all function block instances will be treated as ille gal instructions and it will not be possible to edit or execute the user pro gram e
24. not be possible to edit or execute the user program The CX Programmer IEC cannot be connected online to any CS series or CJ series CPU Unit not supported by it CXP files from the non lEG version of CX Programmer for CPU Unit mod els not supported by the CX Programmer IEC cannot be read by the CX Programmer IEC When specifying the first or last word of multiple words for an instruction operand VO parameters cannot be used to pass data to or from I O vari ables Internal array variables must be used This applies for example to the first source word for SEND 090 or the starting word or end word for BSET 071 For multiword operands an array variable must be prepared in advance with the required number of elements and the data must be set for the ar ray in the function block definition The first or last element in the array vari able is then specified for the operand to set the first or last word Refer to 3 4 Function Block Applications Guidelines for details Input values are passed from parameters to input variables before the algorithm is processed Consequently values cannot be read from parameters to input variables within the algorithm If it is necessary to read a value within the execution cycle of the algorithm do not pass the value from a parameter Assign the value to an internal variable and use an AT setting specified addresses In a similar fashion output variables are passed to the corresponding pa rameters
25. performed the user program and parameter area data in CS1 H FB CJ1 H FB CPU Units is backed up in the built in flash memory The BKUP indicator will light on the front of the CPU Unit when the backup operation is in progress Do not turn OFF the power supply to the CPU Unit when the BKUP indicator is lit The data will not be backed up if power is turned OFF To display the status of writing to flash memory on the CX Programmer select Display dialog to show PLC Mem ory Backup Status in the PLC properties and then select Windows PLC Memory Backup Status from the View Menu xiii Application Precautions XIV 4 If a project file created with the non IEC CX Programmer is read and the Device Type is changed to one that supports function blocks the default function block memory allocations function block instance area refer to 2 2 6 Setting the FB Instance Areas will overlap with any of the following addresses used in the user program causing errors when compiling WOOO to W511 EM 20480 to EM 32767 in the last EM bank T1024 to T4095 and C1024 to C4095 If addresses are duplicated and an error occurs either change the func tion block memory allocations or the addresses used in the user program If a user program containing function blocks created on the CX Program mer IEC is downloaded to a CPU Unit that does not support function blocks e g the CS1 H or CJ1 H all instances will be treated as illegal commands and it will
26. program check is performed by the user by selecting Program Compile or Compile All Programs from the PC Menu e When attempting to download the user program to the PLC or attempting to write the program through online editing Neither downloading or edit ing will be possible Branches are not allowed on the left side of the instance Branches are allowed on the right side Correct FB C Incorrect i En Instruction A program rung cannot have more than one instance Incorrect Incorrect Ns A function block s input cannot be connected to another function block s out put In this case a variable must be registered to transfer the execution status from the first function block s output to the second function blocks input FB2 Temporary variables EN transfer the value from Programs cannot be uploaded from the CPU Unit to the CX Programmer IEC Function Block Applications Guidelines Section 3 4 PT Ladder Monitoring The Programmable Terminal ladder monitoring function cannot be used with Restriction the CS1 H FB CJ1 H FB 3 4 Function Block Applications Guidelines This section provides guidelines for using function blocks with the CX Pro grammer IEC 3 4 1 Deciding on Variable Data Types Integer Data Types Use the following data types when handling single numbers in 1 2 or 4 word 1 2 or 4 word Data Units e INT and UINT e DINT and DINT e LINT and ULINT Note Use signed integers if t
27. remain der from a division operation in ladder programming When ST language is used it isn t necessary to use an array to receive the result of a division operation Also the remainder can t be calculated directly in ST language The remainder must be calculated as follows Remainder Dividend Divisor x Quotient Use the AT setting in the following cases e When setting the first destination word at the remote node for SEND 090 and the first source word at the remote node for RECV 098 e When you want to read or write an Auxiliary Area bit within the execution cycle of an algorithm and the bit is not registered as an external variable If it isn t necessary to read or write the bit in the same cycle use an VO variable and VO parameter CPU Unit Specifications and Battery Replacement Section 3 5 3 5 CPU Unit Specifications and Battery Replacement The specifications of the CS1 H FB CJ1 H FB CPU Units and the battery replacement procedure are given in this section Refer to the CS Series PLC Operation Manual or the CS Series PLC Operation Manual for other items 3 5 1 Specifications CPU Unit Specifications CS1 H FB CPU Units CS1H CS1H CS1G CS1G CPU67H FB CPU65H FB CPU44H FB CPU42H MM mm VO bits 5120 20 User program s2 x memory steps See note Data memory 32K words Extended data 32K words x 32K words x 3 32K words x 1 bank memory 13 banks banks EO 00000 to E2 32767 EO OOOOO t
28. required R 1st receive word di 5 N PROTOCOL MACRO PMCR PMCR 260 36 35 37 S 1st source word C Control word N Number of bytes 0000 to 0100 hex 0 to 256 deci mal TRANSMIT TXD 2 TXD N RECEIVE RXD 2 m D 1st destination word RXD C Control word N Number of bytes to C store 0000 to 0100 hex 0 N to 256 decimal CHANGE SERIAL PORT STUP 2 C Control word port STUP SETUP STUP o S First source word Yes Network Instructions Function Symbol Operands Array code required NETWORK SEND SEND S 1st source word Yes SEND D 1st destination word Specify address at remote node with AT setting C 1st control word es di NETWORK RECEIVE RECV 098 S 1st source word Specify RECV address at remote node with AT setting D 1st destination word C 1st control word DELIVER COMMAND CMND 490 S 1st command word CMND D 1st response word C 1st control word 116 Instruction Support and Operand Restrictions Appendix D File Memory Instructions es dn Symbol Operand Array a required C Control word S1 a source word READ DATA FILE kammad FREAD D1 1st destination word D2 Filename S 1st source word WRITE DATA FILE u C Control word Display Instructions nn ir Symbol Array code ME DISPLAY MESSAGE werd Clock Instructions oe ee Operands Array ae required CALENDAR ADD Ind C 1st calendar word CADD T 1st time word R 1st resul
29. table right click and select Func tion Block Memory Address from the popup menu Alternately select Memory Function Block Memory Address from the PLC Menu Example Instance name displayed in global variable table automatically registered Address Value Rack Locati ET N Ed Usage Comment Edit 0 02 second clock pulse bit 0 1 second clock pulse bit 0 2 second clock pulse bit ta Insert Symbol 4A Validate Symbols Function Block Instance Addresses Right click on the instance name and select Function Block Instance Address 1 minute clock pulse bit 1 0 second clock pulse bit Access Error Flag The FB Interface Memory Dialog Box will be displayed Check the I O memory addresses internally allocated to variables here Example Addresses used internally for the input variables FB Instance Memory nstanceD1 Internals Inputs Outputs Procedures Section 2 2 Method Used for Checking Addresses Internally Allocated to Variables Program Instance of function block definition A instance name sample a b C Right click and select Function Instance registered in global Block Memory Address symbol table under instance name FM Instance Memory Dialog Box Name Type Ee Name pe Ades sample FB FunctionBlock1 N A Auto a BOOL W400 00 Outputs Name Type Address Instance name BOO want oo Addres
30. the CPU Unit and the instance will be called and executed if their input conditions are ON The instance is executed if the input f l o condition is established 3 Input instance name Function block definition A Program 1 Algorithm Input Instance of function block definition A condition 5 The system automatically allocates the addresses used by these variables Set the data area area in which these addresses are allocated Standard IN program section 7T with variable Insert in names a b c program etc 2 Variables ue 4 Specify the input source and output destination addresses Table defining usage land properties of _ variables a b c etc 21 Operating Procedures Section 1 5 1 5 2 Reusing Function Blocks 22 Use the following procedure to save a function block definition as a file and use it in a program for another PLCs 1 2 3 1 Select the function block that you want to save and save it as a function block definition file cxf 2 Open the other PLC s project and open read the function block definition file cxf that was saved 3 Insert the function block definition in the program when creating the new program Function block definition A 1 Algorithm Program mr Instance of function block definition A Standard condition program section with variable names a b C ae Input 1 00 a
31. the CS1 H CS1G H CJ1H H or CJ1G H 2 Select the PLC name in the project workspace right click and select Change from the popup menu 3 Inthe Change PLC Window select a Device Type with a name ending in FB These are listed in the following table 4 Press the Settings Button and select the CPU Type All other settings are the same as for non IEC CX Programmer CSIHH FB CS1G H FB OHH FB Note Observe the following precautions when changing the Device type of a project created with non IEC CX Programmer to one that supports function blocks 1 Internal Allocations for Variables If a project file created with the non IEC CX Programmer is read and the Device Type is changed to one that supports function blocks the default function block memory allocations instance area refer to 2 2 6 Setting 26 Procedures Section 2 2 the FB Instance Areas will overlap with any of the following addresses used in the user program and errors will occur when compiling WOOO to W511 EM 20480 to EM 32767 in the last EM bank T1024 to T4095 and C1024 to C4095 If addresses are duplicated and an error occurs either change the func tion block memory allocations or the addresses used in the user program 2 Specifying the Current EM Bank The CS1 H FB CJ1 H FB CPU Units cannot use the current EM bank function i e the EM bank must always be specified directly For CPU Units with model numbers of CPU42 CPU43 and CP
32. the function block uses variables and the addresses are like black boxes Example Function block definition A Standard program section with variable names a b c etc a b ED Lf mon MOV Table indicating usage and prpperties of variables a b c etc Usage Inputs Prpperties T O a Boo c Bono Usage Outputs Prpperties Namel Type AT b BOOL Initial Value Retained Program Instance of function block definition A Insert in program Mput 0 00 j a b Output 2 00 Input 3 00 Specify inputs and outputs at the same time Status of 0 00 1 or 0 is Status of b 1 or 0 is passed to a passed to 2 00 0 00 a b 2 00 Status of 3 00 1 or 0 is passed to c 3 00 c The system automatically allocates the addresses used by variables a b and c For example when W100 to W120 is set as the system s non retained memory area bit addresses such as a W10000 b W10001 and c W10002 will be allocated 13 Variables Section 1 3 1 3 2 Variable Usage and Properties Variable Usage 14 The following variable types usages are supported Internals Inputs Outputs Externals Internal variables are used only within an instance They cannot be used pass data directly to or from VO parameters Input variables can input data from input parameters outside of the instance
33. the variable table whenever required Create an Instance from Refer to 2 2 4 Creating Instances from Function Block Definitions for details the Function Block Definition m Inserting Instances in the Ladder Section Window and then Inputting the Instance Name 1 2 3 1 Place the cursor at the location at which to create an instance i e a copy of the function block and press the F Key 2 Input the name of the instance 3 Select the function block definition to be copied m Registering Instance Names in the Global Symbol Table and then Selecting the Instance Name when Inserting 1 2 3 1 Select Function Block as the data type for the variable in the global symbol table 2 Press the F Key in the Ladder Section Window 3 Select the name of the instance that was registered from the pull down menu on the Function Block Instance Field 24 Procedural Flow Section 2 1 Allocate External VO to Refer to 2 2 5 Setting Function Block Parameters for details the Function Block as ee 1 Place the cursor at the position of the input variable or output variable and press the P Key 2 Input the source address for the input variable or the destination address for the output variable Set the Function Block Refer to 2 2 6 Setting the FB Instance Areas for details Memory Allocations Instance Areas 1 2 3 1 Select the instance and select Memory Function Block Memory Allo cation from the PLC Menu 2 Set the function blo
34. to C4095 used for counters only 9 19 Counter Area in Operation Manual CPU Unit Specifications and Battery Replacement Section 3 5 Item Specification Reference DM Area 32K words DOOOOO to D32767 9 20 Data Memory Used as a general purpose data area for reading and writing DM Area in Operation data in word units 16 bits Words in the DM Area maintain Manual their status when the PLC is turned OFF or the operating mode is changed Internal Special VO Unit DM Area D20000 to D29599 100 words x 96 Units Used to set parameters for Special VO Units CPU Bus Unit DM Area D30000 to D31599 100 words x 16 Units Used to set parameters for CPU Bus Units Inner Board DM Area D32000 to D32099 Used to set parameters for Inner Boards 32K words per bank 13 banks max EO 00000 to EC 32767 9 21 Extended Data max Memory EM Area m Used as a general purpose data area for reading and writing Operation Manual data in word units 16 bits Words in the EM Area maintain their status when the PLC is turned OFF or the operating mode is changed The EM Area is divided into banks and the addresses can be set by either of the following methods Changing the current bank using the EMBC 281 instruction and setting addresses for the current bank Setting bank numbers and addresses directly EM data can be stored in files by specifying the number of the first bank Data Registers DRO to DR15 9 23 Data Registers in Store offse
35. type and other properties other than the name The properties for all input variables will initially be displayed as follows e Usage Internal e Data Type BOOL for contacts and WORD for channel word e Initial Value The default for the data type e Retain Not selected 3 Make any required changes and click the OK Button 4 As shown below the variable that was registered will be displayed in the variable table above the program am FB sample CX Proerammer IEC NewPLO1 FunctionBlock1 FB Ladder File Edit View Insert PLC Program Tools Window Help Inzalenalsaeleeslasslellasaal sn EBREBEE EWIG S Xa Siz Biel IK OEE EDE Ws ma E RAE os gt Instruction input Function block internal variable registered 5 Ifthe type or properties of a variable that was input are not correct double click the variable in the variable table and make the required corrections 33 Procedures Section 2 2 34 1 2 3 1 2 3 B Reference Information AT Settings Specified Address AT settings can be made to specify ClO or DM Area addresses allocated to a Special VO Unit or Auxiliary Area addresses not registered in the CX Pro grammer IEC A variable name is required to achieve this Use the following procedure to specify an address 1 After inputting the variable name in the New Variable Dialog Box click the Advanced Button The Advanced Settings Dialog Box will be displayed Select AT Specif
36. up to twice the given value When selecting fuses or breakers for external circuits allow sufficient margin in shut off perfor mance The inrush control circuit for an DC Power Supply uses a delay circuit with a capacitor If the PLC is hot started after a short power OFF time the ca pacitor will not be charged and the inrush current given in the table may be exceeded by up to twice the given value 77 CPU Unit Specifications and Battery Replacement Section 3 5 3 5 3 Operation of Timer Instructions selecting the Option Default Not Selecting the Option 78 There is an option called Apply the same spec as TO 2047 to T2048 4095 in the PLC properties of CPU Units This setting affects the operation of timers as described in this section If this option is selected all timers will operate the same regardless of timer number as shown in the following table Timer Operation for Timer Numbers T0000 to T4095 Refresh Description When instruction is The PV is refreshed each time the instruction is executed executed If the PV is 0 the Completion Flag is turned ON If it is not 0 the Completion Flag is turned OFF When execution of all All PV are refreshed once each cycle tasks is completed Every 80 ms If the cycle time exceeds 80 ms all PV are refreshed once every 80 ms If this option is not selected the refreshing of timer instructions with timer numbers TOOOO to T2047 will be different from thos
37. with Structured Text Select Function Blocks in the project workspace right click and select Insert Function Blocks Structured Text from the popup menu Or select Function Block Structured Text from the Insert Menu zit Jo Esie NewProject NewPLCI CILG HIFEY Offline QT 10 Table z Settings Ei Frograms lst NewProgrami 00 ge Symbols E Section 2 te iia END El E De EF Function locki FunctionBlock1 is displayed as the F Icon under the Function Blocks Icon F 3 By default a function block called FunctionBlock1 will be automatically in serted after the Function Blocks icon This icon contains the definitions for the function block 4 Whenever a function block definition is created the name FunctionBlockl will be assigned automatically where L is a serial number These names can be changed Allnames must contain no more than 64 characters 28 Procedures Section 2 2 Function Block Definitions Ladder Program Structured Text One of the following windows will be displayed when the function block icon is double clicked or if it is right clicked and Open is selected from the popup menu A variable table for the variables used in the function block is displayed on top and an input area for the ladder program or structured text is displayed on the bottom FB sample CX Programmer IEC NewPLC1 FunctionBlock1 FB Ladder File Edit View Insert PLC Program Tools W
38. word S2 Inserted text string first Yes word S3 Beginning position D First destination word Yes S1 Text string 1 S2 Text string 2 es INS 657 INS Yes String Comparison LD AND OR lt gt lt lt gt gt i di lt es 12 a Instruction Support and Operand Restrictions Appendix D Task Control Instructions Function Symbol Operands Array code reduired TASK ON TKON 820 N Task number mid N MT E Mi EN 21 TKOF 8 Kor N Task number N 122 A addresses allocation areas 57 checking internal allocations 40 setting allocation areas 39 algorithm creating 31 applications precautions X111 array settings 16 34 55 65 AT settings 16 34 54 66 restrictions 61 B battery replacement 79 C compiling 42 computer system requirements 3 5 control statements 84 CPU Unit specifications 67 D data types 15 54 81 84 determining 65 debugging function blocks 44 differentiation restrictions 61 downloading programs 43 E EM Area current bank restriction 63 errors function blocks 63 external variables 53 list 85 externals 14 Index F features 2 files 5 function block definitions 42 library 6 project files 5 project text files 6 function block definitions 8 checking for an instance 42 compiling 42 creating 28 description 29 saving to files 42 function block
39. x ox o UONT Unsigned double integer Babs OK lox x LNT Long 8 byte integer 64 bis OK x o Unsigned long 8 byte integer 64 bits OK JOK JOK o WORD iebtdaa Gis ox x x 32 bits x x ox OK OK OK OK ox TIMER Timer See note Flag 1 bit PV 16 bits COUNTER Counter See note Flag 1 bit PV 16 bits Note The TIMER and COUNTER data types cannot be used in ST language func tion blocks AT Settings Allocation to Actual Addresses With internal variables it is possible to set the variable to a particular VO memory address rather than having it allocated automatically by the system To specify a particular address the user can input the desired VO memory address in this property It is still necessary to use variable name in program ming even if a particular address is specified Note The AT property can be set for internal variables only Example If the READ DATA FILE instruction FREAD is being used in the function block definition and it is necessary to check the File Memory Operation Flag A34313 use an internal variable and specify the flag s address in the AT setting Register an internal variable select the AT setting option and specify A34313 as the address The status of the File Memory Operation Flag can be checked through this internal variable Edit Variable Advanced Settings Name NOW GARD_ Array Settines Data Type sa EI I Array Variable Cancel Usage intemal ti iti s sS l hitial Valu
40. 1 1st word in range es D Destination word FIND MINIMUM MIN MIN EN C 1st control word 5 R1 1st word in range D Destination word SUM R1 1st word in range D 1st destination word FRAME CHECK SUM FCS FCS R1 1st word in range D 1st destination word C 1st control word FCS C STACK SIZE READ 1 SNUM SNUM TB First stack address es D Destination word ep Z WC 5 2 2 gt Iz STACK DATA READ 1 SREAD SREAD es TB First stack address C Offset value D Destination word SUM SUM 184 C 1st control word SUM C 40 STACK DATA OVER WRITE 1 Yes TB First stack address C Offset value e2 di di SWRIT 6 SWRIT 112 Instruction Support and Operand Restrictions Appendix D 1 CS1 H CJ1 H CJ1M or CS1D only Function Symbol Operands Array code required STACK DATA INSERT TB First stack address 1 C Offset value S Source data STACK DATA DELETE TB First stack address 1 C Offset value D Destination word Data Control Instructions 1 CS1 H CJ1 H CJ1M or CS1D only Array required Function Symbol Operands code 190 PID CONTROL S Input word C 1st parameter word e D Output word C PID CONTROL WITH AUTO PIDAT 191 S Input word ne C 1st parameter word D Output word lt ep ep ep 2 es lt es 680 S Input word C 1st limit word D Output word 681 S Input word C 1s
41. 1 NewProeram1 Section1 Diagram FA File Edit View Insert PLC Program Tools Window Help joc om BB 22 LELLI 0 BARBERS N je XQ ISTE BIE Sees ELE BE IEEE A205 JE 26 Id 0 NewProject ED NewPLC1 CS1G HiF BIKOf Symbols G Memory vy sample Instance name Programs cen Function block definition Gel NewProeram1 00 o Symbols er Section aw An instance called sample END Bor is created from the function F Function Blocks u 8 FunctionBlock1 block definition called FunctionBlock1 The instance will be automatically registered in the global symbol table with an instance name of sample and a data type of Function block E Method 2 Registering the Instance Name in the Global Symbol Table in Advance and Then Selecting the Instance Name If the instance name is registered in the global symbol table in advance the instance name can be selected from the global symbol table to create other instances 1 2 3 1 Select a data type of Function block in the global symbol table input the instance name and registered the instance 2 Press the F Key in the Ladder Section Window The Function Block Invo cation Dialog Box will be displayed 3 Select the instance name that was previously registered from the pulldown menu on the FB Instance Field The instance will be created 37 Procedures Section 2 2 Restrictions Note Observe the following restrictions when cr
42. 1 to 7 steps per instruction Steps and number of steps per instruction 10 5 Instruction Execu tion Times and Num ber of Steps in Operation Manual Approx 400 different instructions 3 digit function codes The following instructions cannot be used in function block definitions e Block programming instructions BPRG and BEND e Subroutine instructions SBS GSBS RET MCRO and SBN e Jump instructions JMP CJP and CJPN e Step ladder instructions STEP and SNXT e Immediate refresh instructions e O REFRESH IORF e ONE MS TIMER TMHH and HIGH SPEED TIMER TIMH Basic instructions 0 02 us min Instruction execution Special instructions 0 06 us min times 10 5 Instruction Execution Times and Number of Steps in Operation Manual Normal mode 0 3 ms min Parallel processing 0 3 ms min CS1 H FB CPU Unit 7 Racks max C200H Expansion VO Expansion Racks Racks 3 max CJ1 H FB CPU Unit 3 Racks max 288 cyclic tasks 32 interrupt tasks 256 Tasks Programming Interrupt tasks can be executed every cycle the same as Manual W394 cycle cyclic tasks and are called extra cyclic tasks when they are used this way lf extra cyclic tasks are used up to 288 cyclic tasks can be executed Note Cyclic tasks are executed each cycle and are con trolled with TKON 820 and TKOF 821 instructions Note The following 4 types of interrupt tasks are supported Power OFF interrupt tasks 1 max Scheduled in
43. 17 11 at 0 3 A or greater 10 11 lot 0197 or later RUN output Not provided Contact configura Contact configura Not provided See note 2 tion SPST NO tion SPST NO Switch capacity Switch capacity 250 V AC 2A 240 V AC 2A resistive load resistive load 250 V AC 0 5 A 120 V AC 0 5 A induction load induction load 24 V DC 2A 24 V DC 2A resistive load 24 V DC 2A induction load Insulation resis 20 MQ min at 500 V DC between AC external and GR terminals See note 1 20 MQ min at tance 500 V DC between DC exter nal and GR termi nals See note 1 Total 30 W max 75 CPU Unit Specifications and Battery Replacement Section 3 5 Item Specifications Dielectric 2 300 V AC 50 60 Hz for 1 min between AC external and GR terminals See 1 000 V AC 50 strength note 1 60 Hz for 1 min Leakage current 10 mA max between DG exter nal and GR termi 1 000 V AC 50 60 Hz for 1 min between AC external and GR terminals See nals leakage note 1 current 10 mA Leakage current 10 mA max max 2 kV on power supply line conforming to IEC61000 4 4 Vibration resis 10 to 57 Hz 0 075 mm amplitude 57 to 150 Hz acceleration 9 8 m s in X Y and Z directions for 80 tance minutes Time coefficient 8 minutes xcoefficient factor 10 total time 80 min CPU Unit mounted to a DIN track 2 to 55 Hz 2 94 m s in X Y and Z directions for 20 minutes Shock resistanc
44. 239920 Tel 65 6835 3011 Fax 65 6835 2711 Authorized Distributor Cat No W427 E 1 01 Note Specifications subject to change without notice EE Cat No W427 E1 01 SYSMAC CX Programmer IEC Ver 1 0 WS02 CPIC1 E OPERATION MANUAL OMRON
45. 3 Not supported in func BRANCHING ELSE tion blocks CONDITIONAL BLOCK IEND 804 Not supported in func BRANCHING END tion blocks ONE CYCLE AND WAIT CONDI 805 Not supported in func TION WAIT tion blocks ONE CYCLE AND WAIT WAIT Bit 805 Not supported in func B Bit operand operand tion blocks TIMWX 816 Not supported in tuno N Timer number BIN tion blocks SV Set value 4 ONE CYCLE AND WAIT WAIT NOT 805 Not supported in func B Bit operand NOT Bit operand tion blocks TIMER WAIT TIMW 813 Not supported in func N Timer number BCD tion blocks SV Set value Fa 119 Instruction Support and Operand Restrictions Appendix D 1 CS1 H CJ1 H CJ1M or CS1D only Function Symbol Operands Array code reduired COUNTER WAIT CNTW 814 Not supported in func BCD oes SV Setva T Countinput je CNTWX 817 Not supported in func N Counter number J BIN en SV Sewe 4 HIGH SPEED TIMER WAIT TMHW 815 Not supported in func N Timer number BCD tion blocks SV Set value ca TMV Nor supported in funo N Timer number BIN tion blocks SV Set value 4 LOOP LOOP 809 Not supported in func tion blocks LEND LEND 810 Not supported in func tion blocks LEND LEND Bit 810 Not supported in func B Bit operand operand tion blocks LEND NOT END NOT 810 Not supported in func B Bit operand Bit operand tion blocks Text String Processing Instructions Function Symbol Operands Array code required
46. 4x a Sc HE BARA Ba MI EE AS xl Name Type AT initial Vake Comment NewProject EN BOOL FALSE Controls execut NewPLC1 CS1G H FB Qt aaa BOOL FALSE Symbols Ge Memory Programs Internals E Gel NewProgram1 400 Symbols Inputs Outputs Externals Section T i END 0 F l New Contact Fi 3 F Function Blocks If DES OK Ba a nn ox cacai EN aa Press the C Key and select aaa registered earlier from the pull down menu in the New Contact Dialog Box Note A name must be input for variables even ones with AT settings specified address With CX Programmer IEC the following char acters can be input as the variable name to indicate VO memory addresses This is not possible with non IEC CX Programmer A W H HR D DM E EM T TM C or CNT followed by a number channel word address e A period to differentiate between channel word and bit addresses For example when Auxiliary Area addresses are specified as ATs the VO memory address e g A50200 can be specified as the variable name to make assignments easier to understand Even when this is done the actual address must be specified in the AT settings 2 Click the OK Button A contact will be entered with the function block inter nal variable aaa as the operand variable type internal CP Elle Eat wiew Insert PLU Program lools Window Help o uenasaaleeslats e ask 1 BAR ERFE EKG S Kasteel uw oe amp amp S w
47. 67 CX Programmer IEC 3 function block operation 59 general 75 76 instances 57 structured text function block definition 29 keywords 83 restrictions 63 T timer instructions Operation 78 restrictions 62 U uploading restrictions 64 Index V variable names 15 variables address allocations 18 checking address allocations 40 creating as needed 33 definitions 48 introduction 13 properties 14 15 17 53 registering in advance 30 restrictions 61 setting allocation areas 18 usage 14 17 49 125 Index 126 Revision History A manual revision code appears as a suffix to the catalog number on the front cover of the manual Cat No W427 E1 01 Revision code The following table outlines the changes made to the manual during each revision Page numbers refer to the previous version Revisioncode Date Revised content September 2003 Original production 127 Revision History 128 OMRON CORPORATION FA Systems Division H O 66 Matsumoto Mishima city Shizuoka 411 8511 Japan Tel 81 55 977 9181 Fax 81 55 977 9045 Regional Headquarters OMRON EUROPE B V Wegalaan 67 69 NL 2132 JD Hoofddorp The Netherlands Tel 31 2356 81 300 Fax 31 2356 81 388 OMRON ELECTRONICS LLC 1 East Commerce Drive Schaumburg IL 60173 U S A Tel 1 847 843 7900 Fax 1 847 843 8568 OMRON ASIA PACIFIC PTE LTD 83 Clemenceau Avenue 11 01 UE Square Singapore
48. 7H e CJ1G CPU42H 43H 44H 45H e CJ1H CPU65H 66H CS CJ Series Function Restrictions Program Restrictions Subroutine numbers 128 to 1023 cannot be used in Subroutine Instructions SBS GSBS RET MCRO and SBN Only numbers 0 to 127 can be used e Instructions Not Supported in Function Block Definitions Block Program Instructions BPRG and BEND Subroutine Instructions SBS GSBS RET MCRO and SBN Jump Instructions JMP CUP and CJPN Step Ladder Instructions STEP and SNXT Immediate Refresh Instructions VO REFRESH IORF ONE MS TIMER TMHH and HIGH SPEED TIMER TIMH e Timer Counter PV refreshing method Binary only For details refer to 3 3 Restrictions on Function Blocks Compatible IBM PC AT or compatible ups Eed 133 MHz Pentium or faster with Windows 98 SE or NT 4 0 EEN o Windows 98 SE Me 2000 XP or NT 4 0 with service pack 6 or EEN Memory 64 Mbytes min with Windows ae SE or NT 4 0 orto cnt Sonia ecw ree Monitor SVGA 800 x 600 pixels min iN Note Use smal font 10h the font size Introducing the CX Programmer IEC Section 1 1 Item Specifications Functions not Defining Number of 896 max per CPU Unit function block definitions supported by and creat non IEC CX ing func Function 64 characters max block names Programmer tion blocks Variables 30 000 characters max Variable types Inputs Outputs Internals and Externals Number of VO variables in 64
49. 908 to 2 22507385850720 x 107308 0 2 22507385850720 x 107908 to 1 79769313486232 x 10908 WORD 16 bit data 0 to 65 535 DWORD 32 bit data 0 to 4 294 967 295 LWORD 64 bit data 0 to 18 446 744 073 709 551 615 TIMER Timer See note Flag 1 bit Timer number 0 to 4095 See note PV 16 bits Completion Flag 0 or 1 PV 0 to 65536 binary refreshing only COUNTER Counter See note Flag 1 bit Counter number 0 to 4095 See note PV 16 bits Completion Flag 0 or 1 PV 0 to 65536 binary refreshing only Note The TIMER and COUNTER data types cannot be used in ST language function blocks Derivative Data Types Array 1 dimensional array 32 000 elements max 81 Data Types Appendix A 82 Appendix B Structured Text Keywords Operators Operation Symbol Data types supported by operator CX Priority Programmer 1 Lowest IEC support 11 Highest Parentheses and expression Supported 1 brackets arraylindex Function evaluation identifier Not supported 2 operand list Semma None 8 complement Netsupporied ja Supported INT DINT LINT UNIT UDINT ULINT REAL Supported LREAL Remainder calcuaton mOoD Nort Addition INT DINT LINT UNIT UDINT ULINT REAL Supported LREAL INT DINT LINT UNIT UDINT ULINT REAL Supported LREAL Comparisons lt gt lt gt BOOL INT DINT LINT UINT UDINT ULINT Supported 7 WORD DWORD LWORD REAL LREAL Equality BOOL INT DINT LINT UINT U
50. Array code required 91 092 93 751 752 SET INTERRUPT MASK MSKS N Interrupt identifier 1 MSKS S Interrupt data u 114 Instruction Support and Operand Restrictions Appendix D 1 Not supported by CS1D Function Symbol Operands Array code ad aia INTERRUPT MASK MSKR N Interrupt identifier MSKR D Destination word CLEAR INTERRUPT N Interrupt identifier 1 a S Interrupt data DISABLE INTERRUPTS 1 vel 1 Step Instructions Instruction Function Symbol Operands Array code required STEP DEFINE STEP 008 Not supported in func B Bit tion blocks STEP START SNXT Not supported in func B Bit tion blocks Basic VO Unit Instructions 1 CS1 H CJ1 H GJ1M or ramen Jimeno Function Symbol Operands Array code required EE EE REFRESH IORF Not supported in func St Starting word EN IORF tion blocks E End word 7 SEGMENT DECODER _ SDEC See S Source word SDEC Di Digi designator EN D 1st destination word C Control data S Transfer source and number of words D Transfer destination and Yes number of words C Control data SE S Transfer source and number of words D Transfer destination and Yes number of words INTELLIGENT VO READ IORD IORD INTELLIGENT VO WRITE IOWR 223 IOWR CPU BUS UNIT VO DLNK a N Unit number REFRESH DLNK 4 115 Instruction Support and Operand Restrictions gt D 5 Q x w Serial Communications Instructions code
51. BY 1 DO 1 loop 10 times SP Memory b b 1 increment b H END_FOR end loop ER Programs IF c amp 0 THEN if Cis 0 ES NewProgrami 00 ds 81 substitute d for 1 Symbols ELSE p Section1 d amp 2 in other case substitute d for 2 END 1E Function Blocks AI F FunctionBlock1 END_IF end if ST program input directly or pasted from one created in a text editor Note 1 Tabs or spaces can be input to create indents They will not affect the al gorithm 2 The display size can be changed by holding down the Ctrl Key and turn ing the scrolling wheel on a wheel mouse 3 When an ST language program is input or pasted into the ST input area syntax keywords will be automatically displayed in blue errors in red comments in green and everything else in black 4 To change the font size or colors select Options from the Tools Menu and then click the ST Font Button on the Appearance Tab Page x Diagrams PLCs Symbols Appearance Ladder Information General v Reset All Ladder Font Mnemonic Font Item Sample Diagram Text HH A A d Foreground Colour p Backaround Colour Cell widik V Default IT Default a Custom Custori Aant Fr 1 Draw in 3D Click the ST Font Button to change the font Cancel Appl Help 32 Procedures Section 2 2 Registering Variables as Required Using a Ladder Program
52. C is turned ON again and when the PLC starts operating e Setting Procedure Select the Retain Option New Variable x Data Type 8001 x Cancel Advanced Usage hitial Value raus Retaini Comment Select the Retain option 1 3 4 Property Settings and Variable Usage The following table shows which properties must be set can be set and can not be set based on the variable usage Property Variable usage Must be set Must be set Must be set 17 Variables Section 1 3 1 3 5 Internal Allocation of Variable Addresses When an instance is created from a function block definition the CX Program mer IEC internally allocates addresses to the variables Addresses are allo cated to all of the variables registered in the function block definition except for variables that have been assigned actual addresses with the AT Settings property Program FB instance areas Non retained area Instance of function block definition A f Starting address 15 0 Ea GIO H W I a Input 0 00 a b Output 2 00 Pi D or E Area Size words t Output 5 00 Retained area Note Variable c is an internal Starting address 15 0 variable so it is not displayed ze Pr HDor d Pr A Orr I Size words Usage Inputs Pe rea
53. DINT ULINT Supported WORD DWORD LWORD REAL LREAL lt gt BOOL INT DINT LINT UINT UDINT ULINT Supported WORD DWORD LWORD REAL LREAL Subtraction Non equality Boolean AND a BOOLWORD DWORD LWORD Suppor Boolean AND AND 800L WORD DWORD LWORD suppored e Boolean oR OR BOOL WORD DWORD LWORD Supported Note Restrictions in Data Types for Structured Text Programming e Integers can be assigned only to the WORD DWORD INT DINT UINT UDINT and ULINT data types For example if A is an INT then A 1 is acceptable A syntax error will occur if anything other than an inte ger is assigned For example an error will occur for A 2 5 if A is an INT e Real numbers floating point decimal can be assigned only to the READ and LREAD data types For example if A is a REAL then A 1 5 is acceptable A syntax error will occur if anything other than a real number is assigned For example an error will occur for A 2 if A is an REAL e Contacts TRUE FALSE can be assigned only to the BOOL data type For example if A is a BOOL then A FALSE is acceptable A syntax error will occur if a contact is assigned to anything else For example an error will occur for A FALSE if A is an INT e The same data type must be used in a single ST statement For example if A B and C are INT then A B C is acceptable A syntax error will occur if different data types are mixed For example an error will occur for A B C if
54. EC or the CS1 H FB CJ1 H FB in function blocks but that can be used in the main program are given as Not supported in function blocks in the Sym bol column Restrictions on Operands e Operands that specify the first or last of multiple words and that require specification of array variables are indicated as follows in the Array required column Yes An array variable must be specified for the operand for the first or last oF multiple words Operands that do not require specification of array variables Note When specifying the first or last word of multiple words for an instruction operand I O parameters can not be used to pass data to or from I O variables Internal array variables must be used For multiword operands an array variable must be prepared in advance with the required number of elements and the data must be set for the array in the function block definition The first or last element in the array vari able is then specified for the operand to set the first or last word e Any operands for which an AT setting is required for an VO memory address on a remote node are indi cated as Specify address at remote node with AT setting in the Array required column 87 Instruction Support and Operand Restrictions Appendix D Instruction Functions Sequence Input Instructions 1 Not supported by CS1D 1 CS1 H CJ1 H CJ1M or CS1D only 1 CS1 H CJ1 H or CJ1M only Function Symbol Operands Array code required L
55. Insert in a b Program 2 Parameters er defining usage B _ land properties of ariables a b c etc NK Instance example of function block definition A l sample02 Parameters Each time an instance is created the actual VO memory addresses or con stants used to pass data to and from the I O variables are set These addresses or constants are called parameters Instance of Function Block Definition A Input 0 00 b Output 2 00 Input 3 00 Set the constant or Set the constants or output destination input source addresses address to which to pass from which to pass data data Here it is not the input source address itself but the contents at the input address in the form and size specified by the variable data type that is passed to the function block In a similar fashion it is not the output destination address itself but the contents for the output address in the form and size specified by the variable data type that is passed from the function block 10 Function Blocks Section 1 2 Even if an input source address i e an input parameter or an output desti nation address i e an output parameter is a word address the data that is passed will be the data in the form and size specified by the variable data type starting from the specified word address Program Instance of Function Block Definition A Input D100 Output D300 Input D200 Ex
56. J1 H FB CPU Units Battery Set CPM2A BATO1 period 12 2 1 Battery Replace ment in Operation Manual 74 CPU Unit Specifications and Battery Replacement Section 3 5 Item Specification Reference Self diagnostics CPU errors watchdog timer VO verification errors I O CPU VO bus memory and bat bus errors memory errors and battery errors tery errors 11 2 4 Error Process ing Flowchart in Operation Manual Other functions Storage of number of times power has been interrupted Number of power interruptions Stored in A514 10 3 Power OFF Operation in Operation Manual 3 5 2 General Specifications CS1 H FB CPU Units lem Specifications Power Supply C200HW PA204 C200HW PA204S C200HW PA204R C200HW PA209R C200HW PD024 Unit Supply voltage 100 to 120 V AC or 200 to 240 V AC 50 60 Hz 24 V DC Operating volt 85 to 132 V AC or 170 to 264 V AC 19 2 to 28 8 V DC age range tion 30 A max ha 100 to 30 A max 120 V AC 40 A max 200 to 240 V AC Output capacity 4 6 A 5 V DC including the CPU Unit power supply 9A 5V DC 4 6 A 5 VDC including the CPU including the CPU Unit power supply Unit power supply 0 625 A 26 VDC 0 625 A 26 VDC 0 625A 26V DC 1 3A 26 V DC 0 625 A 26 V DC 0 8 A 24 V DC Total 30 W max Total 30 W max Total 45 W max Total 30 W max Output terminal Not provided Provided Not provided service supply At consumption of less than 0 3 A 24 V DC supply will be
57. OAD LD Bus bar B Bit Starting point of block LD VW bar B Bit ILD 1 I LD 1 I LD 1 LOAD NOT LD NOT ILD NOT 1 LD NOT 2 LD NOT 2 LD NOT 3 I LD NOT 3 LD pn point of block AND AND AND SAND AND 1 I AND 1 I AND 1 AND NOT B Bit IAND NOT h 1 AND NOT 2 AND NOT 2 I AND NOT 3 I AND NOT AND NOT LL OR NOT OR NOT IOR NOT 1 OR NOT 2 OR NOT 2 I OR NOT 3 I OR NOT 3 t QO 8 Instruction Support and Operand Restrictions Appendix D 1 Not supported by CS1D 1 CS1 H CJ1 H CJ1M or CS1D only 1 CS1 H CJ1 H or CJ1M only Function Symbol Operands Array a P AND DZ _ LD ads LOAD ORLD TE GEN NE p Su eN EE T CONDITION OFF DOWN B Bit DOWN BIT TEST LD TST TE BIT TEST LD TSTN u BIT TEST AND TST AND TST S Source word N Bit number S Source word TSTN N Bit number S Source word N Bit number S Source word AND TSTN N Bit number BIT TEST AND TSTN BIT TEST OR TST BIT TEST OR TSTN S Source word TST N Bit number S Source word TSTN N Bit number N OO Instruction Support and Operand Restrictions Appendix D Sequence Output Instructions 1 CS1 H CJ1 H CJ1M or CS1D only Function Symbol Operands Array code required 47 OUTPUT OUT OUTPUT NOT DIFFERENTIATE UP OUT NOT IOUT NOT u u KEEP KEEP 011 IKEEP DIFU
58. Program ming Device displays to mean Programmable Controller Visual Aids The following headings appear in the left column of the manual to help you locate different types of information Note Indicates information of particular interest for efficient and convenient opera tion of the product 1 2 3 1 Indicates lists of one sort or another such as procedures checklists etc OMRON 2003 All rights reserved No part of this publication may be reproduced stored in a retrieval system or transmitted in any form or by any means mechanical electronic photocopying recording or otherwise without the prior written permission of OMRON No patent liability is assumed with respect to the use of the information contained herein Moreover because OMRON is con stantly striving to improve its high quality products the information contained in this manual is subject to change without notice Every precaution has been taken in the preparation of this manual Nevertheless OMRON assumes no responsibility for errors or omissions Neither is any liability assumed for damages resulting from the use of the information contained in this publication TABLE OF CONTENTS PRECAUTIONS is si ee Ee Ee er er Gr N 1 Intended Audience serune ideo ih DR RE Er te ta heette RE oe ne es xii 2 General Precautions sat bene DER ES pr ts ee dc en bc ae der xii 3 SAIELY PEECAU ONS k kes SE ee ie eo ee DE EE be er e aan ee xii 4 Application Precautons venten
59. SYSMAC CX En IEC Ver 1 0 WS02 CPIC1 E CS1 H FB CJ1 H FB CPU Units OPERATION MANUAL CX Programmer IEC Ver 1 0 WS02 CPIC1 E CS1 H FB CJ1 H FB CPU Units Operation Manual Produced September 2003 Notice OMRON products are manufactured for use according to proper procedures by a qualified operator and only for the purposes described in this manual The following conventions are used to indicate and classify precautions in this manual Always heed the information provided with them Failure to heed precautions can result in injury to people or dam age to property NDANGER Indicates an imminently hazardous situation which if not avoided will result in death or serious injury N WARNING Indicates a potentially hazardous situation which if not avoided could result in death or serious injury N Caution Indicates a potentially hazardous situation which if not avoided may result in minor or moderate injury or property damage OMRON Product References All OMRON products are capitalized in this manual The word Unit is also capitalized when it refers to an OMRON product regardless of whether or not it appears in the proper name of the product The abbreviation Ch which appears in some displays and on some OMRON products often means word and is abbreviated Wd in documentation in this sense The abbreviation PLC means Programmable Controller PC is used however in some
60. The CX Programmer IEC cannot be placed online with a CPU Unit that does not support function blocks e The CX Programmer IEC cannot read non lEC CX Programmer CXP files for CPU Units it does not support Introducing the CX Programmer IEC Section 1 1 Computer System Requirements Item OS Windows 95 See note 2 Windows 2000 or Me Windows XP 98 or NT 4 0 Service Pack 6 IBM PC AT or compatible IBM PC AT or compatible IBM PC AT or compatible CPU Pentium class 133 MHz or Pentium class 150 MHz or Pentium class 300 MHz or faster faster faster Memory Programs up to 64 Mbytes min 96 Mbytes min 128 Mbytes min 30 Ksteps 96 Mbytes min when also 128 Mbytes min when also 192 Mbytes min when also using CX Simulator using CX Simulator using CX Simulator For programs up 128 Mbytes min 192 Mbytes min 256 Mbytes min to 120 Ksteps 128 Mbytes min when also 192 Mbytes min when also 256 Mbytes min when also using CX Simulator using CX Simulator using CX Simulator For programs 192 Mbytes min 256 Mbytes min 384 Mbytes min over 120 Ksteps 192 Mbytes min when also 256 Mbytes min when also 384 Mbytes min when also using CX Simulator using CX Simulator using CX Simulator Note 1 The required memory RAM capacity is the capacity required to create programs If the computers memory is less than the required memory ca pacity the CX Programmer may operate slowly 2 Windows 95 cannot be used
61. The default input variable is an EN Enable vari able which passes input condition data Output variables can output data to output parameters outside of the instance The default output variable is an ENO Enable Out variable which passes the instance s execution status External variables are global symbols registered in advance as variables in the CX Programmer IEC such as Condition Flags and some Auxiliary Area bits The following table shows the number of variables that can be used and the kind of variable that is created by default for each of the variable usages Variable Allowed number Variable created by default usage Outputs Externals Up to 64 per function Enable Receives an input condition block not including EN ld instance is executed when the variable is ON The instance is not executed when the variable is OFF Up to 64 per function EN Enable Output Outputs the function block not including ENO block s execution status The variable is turned ON when the instance starts being executed It can be turned OFF by the algorithm The variable remains OFF when the instance is not exe cuted Iniernals United Reserved variables only Global symbols registered in advance as 28 variables in the CX Programmer IEC such as Conditions Flags or some Auxiliary Area bits For details refer to Appendix C External Variables Variables Section 1 3 1 3 3 Variable Properties Variables have
62. U44 there is only one EM bank bank 0 which must be specified as EO 1000 For other CPU Units which have more than one EM bank the EMBC 281 instruc tion must be used as follows to determine the EM bank being used Example EMBC amp 2 MOV 1111 E1000 Change to the following MOV 1111 E2 1000 3 Timer Counter PV Refresh Method The CS1 H FB CJ1 H FB CPU Units do not support the BCD refresh method for timer counter refresh values Only the binary refresh method can be used If any instructions for the BCD refresh method such as TIM are used in existing programs being reused on the CX Programmer IEC an error will occur and these instructions must be changed to the binary refresh form Refer to 6 4 Changing the Timer Counter PV Refresh Mode in the Programming Manual for details 4 Operation of Timer Instructions with Timer Numbers T2048 to T4095 If the option in the PLC properties to execute T2048 to T4095 timers the same as other timers is selected after reading the project timers with these timer numbers will operate differently in function blocks from the same timers on the CS1 H or GJ1 H CPU Unit at the following times e When the cycle time is over 80 ms e When one of these timers is in a task placed on standby with the TKON TKOFF instructions To achieve the same operation as on the CS1 H or CJ1 H CPU Unit clear the selection of the option in the PLC properties to execute 12048 to T4095 timers the same as other time
63. Units but not to Slave Racks connected to SYSMAC BUS Remote VO Master Units 1 word per Terminal 32 Terminals max Input and output bits 9 4 CIO Area in Operation Manual 9 5 C200H DeviceNet Area in Operation Manual 9 7 PLC Link Area in Opera tion Man ual 9 8 Data Link Area in Opera tion Man ual 9 9 CPU Bus Unit Area in Operation Manual 9 11 Spe cial VO Unit Area in Opera tion Man ual 9 10 Inner Board Area in Operation Manual 9 12 SYS MAC BUS Area in Operation Manual 9 13 VO Terminal Area in Operation Manual The CIO Area can be used as work bits if the bits are not used as shown here 69 CPU Unit Specifications and Battery Replacement Section 3 5 Item Specification Reference CS series DeviceNet 9 600 600 words CIO 320000 to CIO 379915 words 9 6 CS series Area CIO 3200 to CIO 3799 DeviceNet Area in CS series DeviceNet Area bits are allocated to Slaves Operation Manual according to C200HW CRW21 V1 DeviceNet Unit remote VO communications Fixed allocation 1 Outputs CIO 3200 to CIO 3263 Inputs CIO 3300 to CIO 3363 Fixed allocation 2 Outputs CIO 3400 to CIO 3463 Inputs CIO 3500 to CIO 3563 Fixed allocation 3 Outputs CIO 3600 to CIO 3663 Inputs CIO 3700 to CIO 3763 The following words are allocated to the CS Series DeviceNet Unit functioning as a master when fixed alloca tions are used for the CS1W DRM 21 DeviceNet Unit Setting Mast
64. a AS ERGER BOER GESE DERE GR A MS EE xiii 5 Installation Precaution sn a ED DE DE RE nn TAS XV SECTION 1 Introduction a je lel Intr dueinstheeX Pr stammer TEC si E l 2 Function Block S errire hr nee ee ee EMM es AA EE en OT EE ee ee 13 1 4 Converting Function Block Definitions to Library Files 20 15 Operitins Procedu S des EE senteerd wars Ee ee ee ee 21 SECTION 2 Creating Function Blocks eee eene 23 21 Prodedural BIOWL ss mad anrcsenhertbnstert eter toe behe ded ees 24 22 MOC enn te Aten Herle hard hete are 26 SECTION 3 Specifications ss ORE ewes SEE DE EED RR De sss dT 3 1 Function Block Specifications an cn se se Rg ie RR BG GE westie DER 48 3 2 Instance Speel AU ONS as sk DR AE n Ne ie ERA be braband a dsb oh won sh te ae eer dende eden 57 3 3 Restrictions on Function Blocks ee 60 3 4 Function Block Applications Guidelines aoe 65 3 5 CPU Unit Specifications and Battery Replacement oaeen 67 Appendices a DAE DES EES BEDE on ey n ID knee 81 B Structured Text Keywords ER be DR ESE eben RE De RO AE RRE doe nS de 83 C SEXtemial VADER berend Gee aoe Ee den 85 D Instruction Support and Operand Restrictions eee 87 IEN EE TO bene ten 125 Revision HIStory ig iss ctw SEDEER SS SES EE dese ee E27 Vil TABLE OF CONTENTS viii About this Manual This manual describes the function blocks and related functionality of the CX Programmer IEC and includes the sections
65. a CX Programmer IEC project file cxi Function Block Library A function block definition created in a project in CX Programmer IEC can be Files cxf saved as a file 1 definition 1 file so that definitions can be read into other programs and reused Project Text Files in CX The project files created in CX Programmer IEC cxi can be saved as CXT Programmer IEC cxt text files cxt just as in the non IEC CX Programmer 1 1 4 CX Programmer IEC Menus The following tables list CX Programmer IEC menus that are different from non IEC CX Programmer menus Menus that are the same are not listed ae D O anmenm ae Block Invocation Srono an instance of a function block in the program at the present cursor location Nn Block Parameter When the cursor is located to the left of an input variable or the right of an output variable sets the variable s input or output parameter eer Function Block Sets the range of addresses function block instance areas inter ory Memory Allocation nally allocated to the selected instance s variables Function Block Checks the status of the addresses internally allocated to the Memory Statistics selected instance s variables Function Block Checks the addresses internally allocated to each variable in the Memory Address selected instance Optimize Function Optimizes the allocation of addresses internally allocated to vari Memory ables Main Popup Menus Popup Menu for Function Bl
66. a variable is entered in the counter number 0 to 4095 operand of a counter instruction such as CNT or CNTR the data type will be COUNTER When this variable is used as an operand in another instruc tion it will be treated as a counter Completion Flag if the operand takes 1 bit data or as a counter PV if the operand takes 16 bit data The counter PVs are 16 bit binary data because the CX Programmer IEC can use only binary format for the PVs The COUNTER data type cannot be used in ST language function blocks 15 Variables Section 1 3 AT Settings Allocation to lt is possible to set a variable to a particular VO memory address rather than an Actual Addresses having it allocated automatically by the system To specify a particular address the user can input the desired VO memory address in this property This property can be set for internal variables only Even if a specific address is set the variable name must still be used in the algorithm e Setting Procedure Click the Advanced Button select the AT Specified Address option and input the desired address in the Address field New Variable Select the AT option Input the address Even though a specified address is being used for the variable specify the variable name in the algorithm in the function block definition Specify a variable name regardless of whether an address is being specified for the variable Note 1 Only addresses in the following areas ca
67. after the algorithm is processed Consequently values cannot be written from output variables to parameters within the algorithm If it is nec essary to write a value within the execution cycle of the algorithm do not write the value to a parameter Assign the value to an internal variable and use an AT setting specified addresses e Always use variables with AT settings in the following cases e The first destination word at the remote node for SEND 090 and the first source word at the remote node for RECV 098 e Auxiliary Area flags and bits that are not registered for external vari ables and that need to be read or written within the execution cycle of an algorithm Installation Precaution 5 Installation Precaution If the non IEC version of CX Programmer is already installed when installing the CX Programmer IEC the following overwrite confirmation dialog box will be displayed Confirm un installation E xi Q An older version of CX Server has been found To continue the installation the older version must be uninstalled TT Would vou like to uninstall Yes No Always click the Yes Button and install CX Server version 2 00 If the No Button is clicked it will not be possible to use the CX Programmer IEC i e it will not be possible to select a Device Type that supports function blocks FB Even if the Yes Button is clicked the non IEC version of CX Programmer will not be uninstalled and can be used as normal
68. ails on array settings refer to Variable Definitions in 3 1 2 Function Block Elements 16 Variables Section 1 3 B Reference Information When specifying the first or last word of multiple words for an instruction oper and I O parameters cannot be used to pass data to or from I O variables Internal array variables must be used For multiword operands an array vari able must be prepared in advance with the required number of elements and the data must be set for the array in the function block definition The first or last element in the array variable is then specified for the operand to set the first or last word Refer to 3 4 Function Block Applications Guidelines for details Refer to Appendix D Instruction Support and Operand Restrictions for the instructions and operands that require designation of a first or last word address for a multiword operand Initial Value This is the initial value set in a variable before the instance is executed for the first time Afterwards the value may be changed as the instance is executed For example set a boolean variable bit to either 1 TRUE or 0 FALSE Set a WORD variable to a value between 0 and 65 535 between 0000 and FFFF hex If an initial value is not set the variable will be set to 0 For example a bool ean variable would be 0 FALSE and a WORD variable would be 0000 hex Retain Select the Retain Option if you want an internal variable s data to be retained when the PL
69. ame The instance will automatically be registered in the global symbol table Method 2 Set the data type in the global symbol table to function block specify the function block definition to use and input the instance name to register it Procedures Section 2 2 B Method 1 Using the F Key in the Ladder Section Window and Inputtin the Instance Name 1 2 3 1 In the Ladder Section Window place the cursor in the program where the instance is to be inserted and press the F Key Alternately select Func tion Block Invocation from the Insert Menu The New Function Block In vocation Dialog Box will be displayed 2 Input the instance name select the function block from which to create an instance and click the OK Button niel bag en sae ea ASIA RJ 1 BAR ERFE SW N Ben Are ee 0988 jr eat ao BE Symbols At Memory nn Input the instance name Sot NewProg Ti re lowing ds END EF Function Blocks at FunctionBlock1 FB Instance aal FB Definition Functionigock1 Cancel Select the function block from which to create an 3 As an example set the instance name in the FB Instance Field to sample set the function block in the FB Definition Field to FunctionBlock1 and click the OK Button As shown below a copy of the function block definition called FunctionBlock1 will be created with an instance name of sample am FB sample CX Programmer IEC NewPLC
70. amples If m is type WORD one word of data from D100 will be passed to the variable If n is type DWORD two words of data from D200 and D201 will be passed to the variable If k is type LWORD four words of data from the variable will be passed to the D300 to D303 Note 1 Only addresses in the following areas can be used as parameters ClO Area Auxiliary Area DM Area EM Area banks 0 to C Holding Area and Work Area The following cannot be used Index and data registers both direct and indirect specifications and indirect addresses to the DM Area and EM Area both in binary and BCD mode 2 Local and global symbols in the user program can also be specified as parameters To do so however the data size of the local or global symbol must be the same as the data size of the function block variable 3 When an instance is executed input values are passed from parameters to input variables before the algorithm is processed Output values are passed from output variables to parameters just after processing the al gorithm If it is necessary to read or write a value within the execution cy cle of the algorithm do not pass the value to or from a parameter Assign the value to an internal variable and use an AT setting specified address es Caution When specifying the first or last word of multiple words for an instruction oper and I O parameters cannot be used to pass data to or from I O variables Internal array v
71. an one instance with the same name can also be inserted in the program If two or more instances have the same name they will use the same internal variables Instances with different names will have different internal variables For example consider three function blocks that use a timer as an internal variable In this case all instances will have to be given different names If more than one instance uses the same name the use of the timer would be duplicated which is not allowed If however internal variables are not used or they are used only temporarily and initialized the next time an instance is executed the same instance name can be used to save memory instance_A TIMER_FB Function Block Definition i TIMER_FB Variable Definitions Internal variable WORK_NUM instance A TIMER FB instance B TIMER FB Use same internal variables Use different internal variables Function Blocks Section 1 2 Number of Instances Multiple instances can be created from a single function block definition Up to 2 048 instances can be created for a single CPU Unit The allowed number of instances is not related to the number of function block definitions or the num ber of tasks in which the instances are inserted Function Block Definition A Program Instance example of function block definition A a es ci eet ee EE SET 1 Algorithm Standard program ___ unit with variable N _ names a b c etc
72. anged If a fatal error occurs in the CPU Unit while a function block definition is being executed ladder program execution will stop at the point where the error occurred Program FB definition Instance name Body LD P_On AAA 0 0 Fatal error occurs here MOV AAA BBB In this case the MOV AAA BBB instruction will not be executed and output variable D200 will retain the same value that it had before the function block was executed When a user program created in the CX Programmer IEC is downloaded to the CPU Unit and read by a Programming Console the instances will all be displayed as question marks The instance names will not be displayed 63 Restrictions on Function Blocks Prohibiting Access to FB Instance Areas Program Structure Precautions No Branches to the Left of the Instance Only One Instance per Rung No Function Block Connections Uploading Restriction 64 Section 3 3 To use a function block the system requires memory areas to store the instance s internal variables and VO variables FB instance Initial value of Start Initial value Allowed data areas area of Size Non retained 512 ClO WR HR DM EM ETE ENE in last EM bank 12 288 HR DM EM Timer 18072 1 024 Counter 3072 1 024 If there is an instruction in the user program that accesses an address in an FB instance area the CX Programmer IEC will output an error in the following cases e When a
73. ariable is not changed by the execution of the algo rithm the output parameter will retain its previous value 59 Restrictions on Function Blocks Section 3 3 Operation when the Instance Is Not Executed When the input to the function blocks EN input variable is OFF the function block is not called so the internal variables of the instance do not change FB definition Body P On Execution results Output variable 1 0 is turned OFF but ENO Internal variable a internal variable a retains its previous value Program If the programming were entered directly into the program instead of in a function block definition both bit 1 0 and variable a would be turned OFF Internal variable a N Caution An instance will not be executed while its EN input variable is OFF so Differ entiation and Timer instructions will not be initialized while EN is OFF If Differ entiation or Timer instructions are being used use the Always ON Flag P_On for the EN input condition and include the instruction s input condition within the function block definition Nesting A function block cannot be called from another function block i e nesting is not supported Program Instance A FB1 Instance X FB2 Instance A aH 3 3 Restrictions on Function Blocks Ladder Programming Restrictions Restrictions in Program Outside of Instances Instructions Prohibited in Function Block Definitions 60 The
74. ariables must be used This applies for example to the first source word for SEND 090 or the starting word and end word for BSET 071 For multiword operands an array variable must be prepared in advance with the required number of elements and the data must be set for the array in the function block definition The first or last element in the array variable is then specified for the operand to set the first or last word Refer to 3 4 Function Block Applications Guidelines for details 11 Function Blocks Section 1 2 N Caution Input values are passed from parameters to input variables before the algo rithm is processed Consequently values cannot be read from parameters to input variables within the algorithm If it is necessary to read a value within the execution cycle of the algorithm do not pass the value from a parameter Assign the value to an internal variable and use an AT setting specified addresses In a similar fashion output variables are passed to the corre sponding parameters after the algorithm is processed Consequently values cannot be written from output variables to parameters within the algorithm If it is necessary to write a value within the execution cycle of the algorithm do not write the value to a parameter Assign the value to an internal variable and use an AT setting specified addresses B Reference Information A variety of processes can be created easily from a single function block by using para
75. art at 30 A 2 ms max for cold room temperature room temperature start at room temperature At 200 to 240 V AC At 200 to 240 V AC 30 A 8 ms max for cold start at 40 A 8 ms max for cold start at room temperature room temperature Output capacity 5 0 A 5 V DC including supply to 2 8 A 5 V DC including supply to 5 0 A 5 V DC including CPU Unit CPU Unit supply to CPU Unit 0 8 A 24 V DC 0 4 A 24 V DC 0 8 A 24 V DC Total 25 W max Total 14 W max Total 25 W max 76 CPU Unit Specifications and Battery Replacement Section 3 5 Item Specifications Output terminal Not provided service supply RUN output See note 2 Contact configuration SPST NO Not provided Switch capacity 250 V AC 2 A resistive load 120 V AG 0 5 A inductive load 24 V DC 2A resistive load 24 V DC 2 A inductive load Insulation resis 20 MQ min at 500 V DC between AC external and GR terminals 20 MO min at 500 V DO tance See note 1 between DC external and GR terminals See note 1 Dielectric strength 2 300 V AC 50 60 Hz for 1 min between AC external and GR terminals See note 1 Leakage current 10 mA max 1 000 V AC 50 60 Hz for 1 min between AC external and GR terminals See note 1 Leakage current 10 mA max 2 kV on power supply line conforming to IEC61000 4 4 Vibration resistance 10 to 57 Hz 0 075 mm amplitude 57 to 150 Hz acceleration 9 8 m s in X Y and Z directions for 80 minutes Time
76. b Output 5 00 A _ 2 Variables Pad c Output 6 00 Table defining usage _ pad land properties of Read and variables a b c etc insert Pai N Save S ee De Sa Pd Function block definition A y Function block definition file cxf Note In the CX Programmer IEC each function block definition can be compiled and checked as a program We recommend compiling to perform a program check on each function block definition file before saving or reusing the file SECTION 2 Creating Function Blocks This section describes the procedures for creating function blocks on the CX Programmer IEC Zal Poced al Flow tsss oa ES det awe ES GERED OR GE ae De Re eas 24 2 7 ROCCO RENS GE ED DS SE EG SO Ee ge oe ae 26 Zadel Creannea Project sot sae Pd DE rieten 26 2 2 2 Creating a New Function Block Definition 28 2 2 3 Defining a Function Block 29 2 2 4 Creating Instances from Function Block Definitions 36 2 2 5 Setting Function Block Parameters a 38 2 2 6 Setting the FB Instance Areas sieri turii eee eee 39 2 2 7 Checking Internal Address Allocations for Variables 40 2 2 8 Checking the Function Block Definition for an Instance 42 2 2 9 Compiling Function Block Definitions 42 2 2 10 Saving Function Block Definitions to Files 42 2 2 11 Downloading Programs to a CPU Unit 43 2 2 12 Monitoring and Debugging Funct
77. be compared to the last condition when the EN input variable was ON so the Differentiation Instruction will not operate properly If the EN input variable remains ON the Differentiation Instruction will operate properly when the next rising edge or falling edge occurs 61 Restrictions on Function Blocks Section 3 3 Timer Instructions in Function Block Definitions 62 Example TIDEN T ORANI SET OUTI These Differentiation Instructions do not operate when input condition 0 00 goes from OFF to ON the first time The instructions do not operate while input condition 0 00 is OFF If Differentiation Instructions are being used always use the Always ON Flag P_On for the EN input condition and include the instruction s input condition within the function block definition EN EE Ee ees these Differentiation Instructions operate normally An instance will not be executed while its EN input variable is OFF so the fol lowing precautions are essential when using a Timer Instruction in a function block definition The Timer Instruction will not be initialized even though the instance s EN input variable goes OFF Consequently the timer s Completion Flag will not be turned OFF if the EN input variable goes OFF after the timer started oper ating EE N z ae Oe Flag UP will not be turned OFF even though input condition 0 00 goes OFF u If Timer Instructions are being used always use the Alwa
78. ber of elements and the data must be set for the array in the function block definition The first or last element in the array variable is then specified for the operand to set the first or last word Refer to 3 4 Function Block Applications Guidelines for details Example Function block definition Instance Variable SCL EN ENO SCL WORD 10 S D 100 Algorithm SCL BODY Specifying this array element in the SCL instruction is the same as specifying the first 0300 address amp 4000 LD POn MOV 0000 SCL Oj MOV amp 0SCL 1 MOV 0300 SCLI2 MOV amp 4000 SCL 3 SCL S SCL 0 D Write the operand data to the array variables Specify the beginning of the array in the SCL instruction Note For details refer to 3 4 Function Block Applications Guidelines Initial Values When an instance is executed the first time initial values can be set for input variables internal variables and output variables For details refer to nitial Value under the preceding descriptions of input variables internal variables and output variables Initial Value Retained Gor Edit Variable Name Data Type UINT Internals Inputs Usage Sommer LU Retaining Data through Power Interruptions and Start of Operation The values of internal variables can be retained through power interruptions and the start of operation When the Retain Option is selected the variable will be allocated to a region of me
79. ble PLCs as well as usage precautions and guidelines 3 1 Function Block Specifications ns van ss ESE eons Eren Eran 48 3 1 1 Function Block Specifications eee 48 3 1 2 Function Block Elements ee 48 3 2 Instance SpeciTeaORS arden nrd rn tE wa tes 57 3 2 1 Composition of an Instance ee 57 32 2 Operating Specifications sasir AE DE ER eae 59 3 3 Restrictions on Function BlockS SS cece 60 3 4 Function Block Applications Guidelines iss EE EES EE ES ES ee 65 3 4 1 Deciding on Variable Data Types 65 Sede Anay SENE Seepa anar 6 Ke Orme he ee eS 65 AS AF SCOSS iom iteiten 66 3 5 CPU Unit Specifications and Battery Replacement 67 oel SPECMCAUONS enaar eee ae 67 3 5 2 General Specifications ans ei a 4 75 3 5 3 Operation of Timer Instructions ee 78 3 5 4 Battery Replacement Procedure aaa 79 47 Function Block Specifications Section 3 1 3 1 Function Block Specifications 3 1 1 Function Block Specifications Description Number of function block definitions 896 max per CPU Unit Number of instances 2 048 max per CPU Unit Number of instance nesting levels Nesting is not supported Number of VO variables 64 variables max per function block definition 3 1 2 Function Block Elements The following table shows the items that must be entered by the user when defining function blocks Description Function block The name of the function block defin
80. cify the first addresses and sizes of these areas The first addresses and area sizes can be specified in 1 word units When the CX Programmer IEC compiles the function it will output an error if there are any instructions in the user program that access words in these areas nction Block Memory Allocation NewPLC1 x FB Instance Area Start Address End Address i Retain EG 20480 EC 32767 12288 once Timers T3072 T4095 1024 Edit Counters G3072 C4095 1024 Default Advanced The default values are as follows FB instance area Start address End Applicable memory address areas Non retained area CIO WR HR DM EM Retained area W 20480 in last 12 288 HR DM EM EM Area bank 57 Instance Specifications Section 3 2 FB instance area Start address End Applicable memory address areas Timawa rvs IE 03072 1 024 Comments A comment up to 30 000 characters long can be entered Creating Multiple Instances Calling the Same Instance A single instance can be called from multiple locations In this case the inter nal variables will be shared Making Multiple Instances Multiple instances can be created from a single function block definition In this case the values of internal variables will be different in each instance Example Counting Product A and Product B Prepare a function block definition called Down Counter CTD and set up counters for product A and product B There are two type
81. ck s VO The ability to reuse existing function blocks will save significant time when creating debugging programs reduce coding errors and make the program easier to understand Structured programs created with function blocks have better design quality and require less development time The VO operands are displayed as variable names in the program so the pro gram is like a black box when entering or reading the program and no extra time is wasted trying to understand the internal algorithm Many different processes can be created easily from a single function block by using the parameters in the standard process as input variables such as timer SVs control constants speed settings and travel distances Function Blocks Reduce Coding Errors Data Protection Improved Reusability with Variable Programming Creating Libraries Compatible with Multiple Languages Section 1 2 Coding mistakes can be reduced because blocks that have already been debugged can be reused The variables in the function block cannot be accessed directly from the out side so the data can be protected Data cannot be changed unintentionally The function block s VO is entered as variables so it isn t necessary to change data addresses in a block when reusing it Processes that are independent and reusable such as processes for individ ual steps machinery equipment or control systems can be saved as func tion block definitio
82. ck memory allocations Saving and Reusing Function Block Files Compile the Function Refer to 2 2 9 Compiling Function Block Definitions and 2 2 10 Saving Func Block Definition and Save tion Block Definitions to Files for details It as a Library File 1 2 3 1 Compile the function block that has been saved 2 Save the function block as a function block definition file cxf 3 Read the file into another PLC project Transferring the Program to the PLC Refer to 2 2 11 Downloading Programs to a CPU Unit Monitoring and Debugging the Function Block Refer to 2 2 12 Monitoring and Debugging Function Blocks 25 Procedures Section 2 2 2 2 Procedures 2 2 1 Creating a Project Either new projects can be created in CX Programmer IEC or programs previ ously requested on non lEC CX Programmer can be read to create projects Creating New Projects with CX Programmer IEC 128 1 Start the CX Programmer IEC and select New from the File Menu 2 In the Change PLC Window select a Device Type with a name ending in FB These are listed in the following table 3 Press the Settings Button and select the CPU Type All other settings are the same as for non IEC CX Programmer STH FB CS1G H FB Reusing Projects Created on Non lEC CX Programmer 1 2 3 5 1 Startthe CX Programmer IEC select Open from the File Menu and read the project file cxp created with non IEC CX Programmer see note Note The PLC must be
83. coefficient 8 minutes xcoefficient factor 10 total time 80 min according to JIS C0040 Shock resistance 147 m s 3 times each in X Y and Z directions Relay Output Unit 100 m s according to JIS C0041 Ambient operating 0 to 55 C temperature Ambient operating 10 to 90 with no condensation humidity Atmosphere Must be free from corrosive gases 20 to 70 C excluding battery temperature CPU Rack dimen 90 7 to 466 7 x 90 x 65 mm W x H x D not including cables SIONS Note W a b 20xn 31xm 14 7 a Power Supply Unit PA205R 80 PA202 45 PD025 60 b CPU Unit CJ1 H 62 n Number of 32 point I O Units or VO Control Units m Number of other Units Safety measures Conforms to cULus and EC Directives Note 1 Disconnect the Power Supply Units LG terminal from the GR terminal when testing insulation and dielectric strength Testing the insulation and dielectric strength with the LG terminal and the GR terminals connected will damage internal circuits in the CPU Unit 2 Supported only when mounted to CPU Rack 3 The inrush current is given for an AC Power Supply and cold start at room temperature The inrush control circuit for an AC Power Supply uses a thermistor element with a low temperature current control characteristic If the ambient temperature is high or the PLC is hot started the thermistor will not be sufficiently cool and the inrush current given in the table may be exceeded by
84. ction blocks Manuals Related to the CS1 H FB and CJ1 H FB CPU Units Name Contents SYSMAC CS Series W339 Provides an outline of and describes the design installation CS1G H CPULILI EV1 CS1G H CPULILIH maintenance and other basic operations for the CS series Programmable Controllers PLCs Operation Manual The following information is included An overview and features The system configuration Installation and wiring VO memory allocation Troubleshooting Use this manual together with the W394 SYSMAC CJ Series W393 Provides an outline of and describes the design installation CJ1G H CPULILIH GJ1M CPULIL CJ1G maintenance and other basic operations for the CJ series CPULIL PLCs Programmable Controllers The following information is included Operation Manual An overview and features The system configuration Installation and wiring VO memory allocation Troubleshooting Use this manual together with the W394 IX Name Contents SYSMAC CS CJ Series W394 Describes programming and other methods to use the func CS1G H CPULILI EV1 CS1G H CPULILIH tions of the CS CJ series PLCs CJ1G H GPULILIH GJ1M GPULIH CJ1G The following information is included CPU Programming Tasks File memory Other functions Use this manual together with the W339 or W393 SYSMAC CS CJ Series W340 Describes the ladder diagram programming instructions sup CS1G H CPULILI EV1 CS1G H CPULILIH ported by CS CJ series PLCs Progra
85. d T 2 es ASFT 017 ASFT lt WORD SHIFT WSFT 016 S Source word en WSFT St Starting word E End word Yes ARITHMETIC SHIFT LEFT ASL 025 Wd Word ii ASL DOUBLE SHIFT LEFT ASLL 570 Wd W ASLL ARITHMETIC SHIFT RIGHT ASR 026 Wd Word j ASR DOUBLE SHIFT RIGHT ASRL 571 Wd W ASRL ROTATE LEFT ROL 027 aL Wd Word ROL DOUBLE ROTATE LEFT ROLL 572 Wd Word a Bu d ROTATE LEFT WITHOUT RLNC 574 Wd Word nn RLNC in u wa DOUBLE ROTATE LEFT RLNL 576 Wd Word WITHOUT CARRY RLNL wu u wa ROTATE RIGHT ROR 028 ROR Wd Word ind DOUBLE ROTATE RIGHT RORL 573 Wd W ma d ROTATE RIGHT WITHOUT TRRNC 575 Wd Word CAREN RRNC ia u wa DOUBLE ROTATE RIGHT I RRNL 577 Wd Word WITHOUT CARRY RRNL ia u wa 9 N Instruction Support and Operand Restrictions Function ae Instruction ONE DIGIT SHIFT LEFT ONE DIGIT SHIFT RIGHT SHIFT N BIT DATA LEFT SHIFT N BIT DATA RIGHT SHIFT N BITS LEFT DOUBLE SHIFT N BITS LEFT SHIFT N BITS RIGHT DOUBLE SHIFT N BITS RIGHT Appendix D Operands Array required St Starting word E End word Symbol SRD zE St Starting word SRD E End word D Beginning word for shift C Beginning bit N Shift data length NSFR NSFR D Beginning word for shift C Beginning bit N Shift data length NASL NASL D Shift word C Control word D Shift word C Control word D Shift word C Control word D Shift word
86. d IEC 61131 3 function blocks The CX Programmer IEC is the same as non IEC CX Programmer version 3 0 except that function block functionality has been added The CX Programmer IEC is compatible with the CS CJ series PLCs and has the following features e Project files cxp created with non IEC CX Programmer can be imported and reused Function blocks can be created in ladder language by cutting and pasting program rungs e User defined processes can be converted to block format by using func tion blocks e Function block algorithms can be written in the ladder programming lan guage or in the structured text ST language See note e When ladder programming is used ladder programs created with non IEC CX Programmer can be reused by copying and pasting e When ST language is used it is easy to program mathematical pro cesses that would be difficult to enter with ladder programming Note The ST language is an advanced language for industrial control primarily PLCs that is described in IEC 61131 3 The ST lan guage supported by CX Programmer IEC conforms to the IEC 61131 3 standard e Function blocks can be created easily because variables do not have to be declared in text They are registered in variable tables A variable can be registered automatically when it is entered in a ladder or ST program Registered variables can also be entered in ladder programs after they have been registered in the variable table e A singl
87. data EN COMPARE TCMP T 1st word of table R Result word MULTIPLE MCMP Ka S1 1st word of set 1 MCMP S2 1st word of set 2 R Result word mm COMPARE BCMP S Source data Source data w BCMP T 1st S Soue data of table R Result word mi BCMP2 SCHED S Source data BCMP2 UNSIGNED BLOCK COMPARE EXPANDED BLOCK COM PARE 2 RR n u T 1st word of block R Result word AREA RANGE COMPARE ZCP i CD Compare data 1 word LL Lower limit of range UL Upper limit of range 94 Instruction Support and Operand Restrictions Appendix D 1 CS1 H CJ1 H CJ1M or CS1D only 2 CJ1M only Function Symbol Operands Array code required DOUBLE AREA RANGE ZCPL 116 CD Compare data COMPARE 2 words 1 LL Lower limit of range EN UL Upper limit of range Data Movement Instructions Function Symbol Operands Array code required MOV Ee MOVE 02 MOV EI u DOUBLE MOVE MOVL 498 Tr S 1st source word MOVL z D 1st destination word MOVE NOT MVN TT MVN DOUBLE MOVE NOT MVNL MVNL MOVE BIT MOVB 082 MOVB MOVE DIGIT MOVD 083 NED S Source word or data MOVD a C Control word D Destination word D Destination S 1st source word D 1st destination word MVNL S Source word or data MOVB C Control word gt D Destination word S 1st source word C ENT D 1st destination word Cp MULTIPLE BIT TRANS XFRB ons Control
88. ding to the performance specifica tions described in the operation manuals Before using the product under conditions which are not described in the manual or applying the product to nuclear control systems railroad systems aviation systems vehicles combustion systems medical equipment amuse ment machines safety equipment and other systems machines and equip ment that may have a serious influence on lives and property if used improperly consult your OMRON representative Make sure that the ratings and performance characteristics of the product are sufficient for the systems machines and equipment and be sure to provide the systems machines and equipment with double safety mechanisms This manual provides information for programming and operating the product Be sure to read this manual before attempting to use the product and keep this manual close at hand for reference during operation It is extremely important that a PLC and all PLC Units be used for the speci fied purpose and under the specified conditions especially in applications that can directly or indirectly affect human life You must consult with your OMRON representative before applying a PLC System to the above men tioned applications Safety Precautions N WARNING N Caution N Caution Confirm safety sufficiently before transferring VO memory area status from the CX Programmer IEC to the CPU Unit The devices connected to Output Units may malfunc
89. dl Properties Pi u Name Type AT Initial ValuelRetained wo mer area a BOOL 7 i a 7 tarting address ize Completion Usage Outputs 4 T Area Flags Properties er Mm ad Name Type AT Initial ValuelRetained BE ed we Counter area D BOOL ves d ee Per ww rt Starting Size Completion t TIMER i Automatic allocation of address C Area Flags addresses by system Usage Internals Er Earle Properties EE dn Name Type AT InitiaMaluelRetained c__ BOOL 2000 00 Manual allocation of address to variable in FB by AT Settings option Setting Internal Allocation The user sets the function block instance areas in which addresses are allo Areas for Variables cated internally by the CX Programmer IEC The variables are allocated auto matically by the system to the appropriate instance area set by the user The following data areas can be set for the instance areas Non retained Area e Applicable variables Internal variables that do not have the Retain Option selected to retain the variable s content when the power is turned ON or program execution starts Note TIMER and COUNTER data types are not allocated to the non re tained area e Allowed data areas VO CIO Area H Holding Area W Work Area D DM Area or E EM Area Note Bitdata can be accessed even if the DM or EM Area is specified e Units Set in word units e Default allocation W000 to W511 Retained A
90. e 147 m s 3 times each in X Y and Z directions according to JIS 0041 Ambient operat 0 to 55 C ing temperature Ambient operat 10 to 90 with no condensation ing humidity Atmosphere Must be free from corrosive gases Ambient storage 20 to 75 C excluding battery temperature Grounding Less than 1000 Enclosure Mounted in a panel Weight All models are each 6 kg max CPU Rack 2 slots 198 5 x 157 x 123 W x Hx D en 3 slots 260 x 130 x 123 W x H x D See note 3 5 slots 330 x 130 x 123 W x H x D 8 slots 435 x 130 x 123 W x H x D 10 slots 505 x 130 x 123 W x H x D Safety measures Conforms to cULus and EC directives Note 1 Disconnect the Power Supply Units LG terminal from the GR terminal when testing insulation and dielectric strength Testing the insulation and dielectric strength with the LG terminal and the GR terminals connected will damage internal circuits in the CPU Unit 2 Supported only when mounted to CPU Backplane 3 The depth is 153 mm for the C200HW PA209R Power Supply Unit CJ1 H FB CPU Units Specifications Power Supply Unit CU1W PA205R CJ1W PA202 CJ1W PD025 Supply voltage 100 to 240 V AC wide range 50 60 Hz 24V DC Operating voltage 85 to 264 V AC 47 to 63 Hz 19 2 to 28 8 V DC and frequency ranges tion Inrush current At 100 to 120 V AC At 100 to 120 V AC At 24 V DG See note 3 15 A 8 ms max for cold start at 20 A 8 ms max for cold st
91. e FALSE Retain AT Settings Comment V AT Specified Address Address A34313 is allocated to a boolean internal variable named NOW_CARD_ACCESS When the AT setting is used the function block loses its flexibility This func tion should thus be used only when necessary 54 Function Block Specifications Section 3 1 Note Note Array Setting With internal variables a variable can be defined as an array Only one dimensional arrays are supported by the CX Programmer IEC With the array setting a large number of variables with the same properties can be used by registering just one variable e An array can have from 1 to 32 000 array elements e The array setting can be set for internal variables only e Any data type can be specified for an array variable as long as it is an internal variable e When entering an array variable name in the algorithm of a function block definition enter the array index number in square brackets after the vari able name The following three methods can be used to specify the index In this case the array variable is al e Directly with numbers for ladder or ST language programming Example a 2 e With a variable for ladder or ST language programming Example a n where n is a variable e With an equation for ST language programming only Example alb c where b and c are variables Note Equations can contain only arithmetic operators and An array is a
92. e RR RR RE ey DS Eel feed est a PER xxi Get Memor 5 A Programs 3 NewProgram1 00 SY Symbols A Section MR m 8 END Contact entered with function block internal variable aaa as operand The rest of the ladder program is input the same as for normal programs with non IEC CX Programmer 31 Procedures Section 2 2 Using Structured Text An ST language program see note can either be input directly into the ST input area or a program input into a general purpose text editor can be copied and then pasted into the ST input area using the Paste Command on the Edit Menu Note The ST language conforms to IEC61131 3 but only assignment statements selection statements CASE and IF iteration statements FOR WHILE and REPEAT arithmetic operations logic operations comparison operations and comments All other elements are not supported Refer to Appendix B Structured Text Keywords for details sample_st2 CX Programmer IEC NewPLC1 FunctionBlock1 FB Structured Text laj x Fie Edit view Insert PLC Program Tools Window Help 18 x DEdleR saad d tia ABRAM ue A RIET ERAS e KQ ESE HE ar murw o BEE ES Ei 4a fa Sa E EES KEER AE Ad Name type at mitialv reta Comment Al NewProject a INT 0 B NewPLC1 C11G H FB Offline b INT 0 Symbol Internals Inputs Outputs Extemals gT 10 Tabl fal Setting FOR a 10 TOO
93. e function block can be converted to a library function as a single file making it easy to reuse function blocks for standard processing e A program check can be performed on a single function block to easily confirm the function block s reliability as a library function e One dimensional variable arrays are supported so data handling is eas ler for many applications Note The IEC 61131 standard was defined by the International Electrotechnical Commission IEC as an international programmable controller PLC stan dard The standard is divided into 7 parts Specifications related to PLC pro gramming are defined in Part 3 Textual Languages IEC 61131 3 Introducing the CX Programmer IEC Section 1 1 1 1 2 Specifications Specifications that are not listed in the following table are identical to the spec fications for CX Programmer Version 3 0 Item Specifications Model number WS02 CPIC1 E Setup disk CD ROM Compatible CPU Units Only the following CS1 H and CJ1 H CPU Units are compatible No other CPU Units can be used See note CS1G CPU42H 44H FB CS1H CPU65H 67H FB e CJ1G CPU42H 43H 44H FB Note Non IEC CX Programmer project files cxp created for the following models can be read and reused by changing the Device Type to one that supports function blocks Once the existing project file has been changed CX Programmer IEC function blocks can be used e CS1G CPU42H 43H 44H 45H e CS1H CPU63H 64H 65H 66H 6
94. e function block can con tain any of the instructions used in the normal program Refer to 3 3 Restrictions on Function Blocks for restrictions on the instructions that can be used e Structured text can be input according to the ST language defined in IEC61131 3 2 2 3 Defining a Function Block A function block is defined by registering variables and creating an algorithm There are two ways to do this e Register the variables first and then input the ladder program or structure text e Register variables as they are required while inputting input the ladder program or structure text Procedures Section 2 2 Registering Variables First Registering Variables in The variables are divided by type into four sheets in the variable table Inter the Variable Table nals Inputs Outputs and Externals These sheets must be switched while registering or displaying the variables 1 2 3 1 Make the sheet for the type of variable to be registered active in the vari able table See note Place the cursor in the sheet right click and select Insert Variable from the popup menu Note The sheet where a variable is registered can also be switched by setting the Usage The New Variable Dialog Box shown below will be displayed e Name Input the name of the variable e Data Type Select the data type e Usage Select the variable type e Initial Value Select the initial value of the variable at the start of oper ation
95. e with timer numbers T2048 to T4095 as given below This behavior is the same for CPU Units that do not support function blocks Refer to the descriptions of individual instruc tion in the CS CJ Series Instruction Reference for details Timer Operation for Timer Numbers T0000 to T2047 Refresh Description When instruction is The PV is refreshed each time the instruction is executed executed If the PV is 0 the Completion Flag is turned ON If it is not 0 the Completion Flag is turned OFF When execution of all All PV are refreshed once each cycle tasks is completed Every 80 ms If the cycle time exceeds 80 ms all PV are refreshed once every 80 ms Timer Operation for Timer Numbers T2048 to T4095 Refresh Description When instruction is The PV is refreshed each time the instruction is executed executed If the PV is 0 the Completion Flag is turned ON If it is not 0 the Completion Flag is turned OFF When execution of all PV are not updated tasks is completed Every 80 ms PV are not updated even if the cycle time exceeds 80 ms Select the Apply the same spec as 10 2047 to 12048 4095 Option to ensure consistent operation when using the timer numbers allocated by default to function block variables T3072 to T4095 CPU Unit Specifications and Battery Replacement Section 3 5 3 5 4 Battery Replacement Procedure CJ1 H FB CPU Units CS1 H FB CPU Units Note N Caution Battery Life and Replaceme
96. each instance so all of the variables will be allocated to a different block of addresses if the original block of addresses cannot accommodate the change in variables This will result in an unused block of addresses A memory optimization func tion can be executed to eliminate the unused area of memory so that the memory is used more efficiently 1 4 Converting Function Block Definitions to Library Files 20 A function block definition created in the CX Programmer IEC can be stored as a single file known as a function block definition file with filename exten sion cxf These files can be reused in other projects PLCs Project Project Function block definition Function block definition Example CLOCK_PULSE Example CLOCK_PULSE Ee RA 11 Algorithm 1 Algorithm N 7 im tim b i TIMX tim_a OFF_TIME TIMX tim_a OFF TIME tim_a tim_a TIMX tim_b ON TIME TIMX tim_b ON TIME L_ ENO eno MM Nj LDF WE NT CY EFA 2 Variable Definitions 2 Variable Definitions Usage Name Type Usage Name Type Internal tim a TIMER Internal tim_a TIMER Internal tim_b TIMER Internal tim_b TIMER Input ON TIME INT Input ON TIME INT Input OFF TIME INT Input OFF TIME INT y Function block definition file cxf Operating Procedures Section 1 5 1 5 Operating P
97. eating instances Refer to 3 3 Restrictions on Function Blocks for details e No more than one function block can be created in each program circuit e The rung cannot be branched to the left of an instance e Instances cannot be connected directly to the left bus bar i e an EN must always be inserted lf changes are made in the VO variables in a variable table for a function block definition the bus bar to the left of all instances that have been created from that function block definition will be displayed in red to indicate an error When this happens select each instance right click and select Update Invocation The instance will be updated for any changes that have been made in the function block definition and the red display will be cleared 2 2 5 Setting Function Block Parameters 38 After an instance of a function block has been created input parameters must be set for input variables and output parameters must be set for output vari ables to enable external VO 1 Inputs are located on the left of the instance and outputs on the right Place the cursor where the parameter is to be set and press the P Key Alter nately select Function Block Parameter from the Insert Menu The New Parameter es Box will be displayed as shown below EEF UAE IAS SS sn BAR ERFE Hal Seat ee BE ler TEFIE 2B Es x o NewProject NewPLC1 C51G H FB Offlin Symbols GT 10 Table 0 00 Settin
98. er to slave Slave to master Internal VO Area 4 800 300 words CIO 120000 to CIO 149915 words CIO 1200 to CIO 1499 37 504 2 344 words CIO 380000 to CIO 614315 words CIO 3800 to CIO 6143 These bits in the CIO Area are used as work bits in program ming to control program execution They cannot be used for external VO Work Area 8 192 bits 512 words WOOOOO to W51115 WOOO to W511 9 14 Work Area in Controls the programs only I O from external VO terminals is Operation Manual not possible Note When using work bits in programming use the bits in the Work Area first before using bits from other areas Holding Area 8 192 bits 512 words HOOOOO to H51115 HOOO to H511 9 15 Holding Area in Holding bits are used to control the execution of the program Operation Manual and maintain their ON OFF status when the PLC is turned OFF or the operating mode is changed Auxiliary Area Read only 7 168 bits 448 words A00000 to A44715 words 9 16 Auxiliary Area in A000 to A447 Operation Manual Read write 8 192 bits 512 words A44800 to A95915 words A448 to A959 Auxiliary bits are allocated specific functions Temporary Area 16 bits TRO to TR15 9 17 TR Temporary Temporary bits are used to temporarily store the ON OFF Relay Area in Opera execution conditions at program branches tion Manual Timer Area 4 096 T0000 to T4095 used for timers only 9 18 Timer Area in Operation Manual Counter Area 4 096 C0000
99. estination word DOUBLE SIGNED BDSL C Control word BINARY TO BCD BDSL Logic Instructions D 1st destination word Function Symbol Operand Array code required LOGICAL AND ANDW 1 Input 1 ANDW ANDW 12 Input 2 R Result word 1 Input 1 I2 Input 2 R Result word 1 Input 1 12 Input 2 R Result word DOUBLE LOGICAL OR 611 I1 Input 1 EE aa 12 Input 2 R Result word EXCLUSIVE OR XORW 036 E 1 Input 1 XORW I2 Input 2 R Result word BSL IS oe OP ecos IFS ME DOUBLE LOGICAL AND 610 LOGICAL OR ORW 035 Z U 104 Instruction Support and Operand Restrictions Appendix D Function Symbol Operand Array code required DOUBLE EXCLUSIVE OR XORL 612 En 1 Input 1 XORL I2 Input 2 R Result word EXCLUSIVE NOR XNRW 11 a 1 mi aa XNRW DOUBLE EXCLUSIVE NOR XNRL XNRL Instruction Z l R Result word R Result word COMPLEMENT COM 1 Word COM DOUBLE COMPLEMENT COML com Wd Word COML wa Special Math Instructions ad is Symbol Operands Array code required BINARY ROOT R Result word BCD SQUARE ROOT 072 R Result word ARITHMETIC PROCESS er Control word mn rn o FLOATING POINT DIVIDE Dd 1st dividend word Dr 1st divisor word R 1st result word 105 Instruction Support and Operand Restrictions Appendix D Instruction Function Operands Array code reduired BIT COUNTER 067 N Number of words Fa S 1st source w
100. et value N Timer number r N Timer number S Set value 91 Instruction Support and Operand Restrictions Appendix D 1 CS1 H CJ1 H CJ1M or CS1D only Function Symbol Operands Array code reduired HIGH SPEED TIMER TIMH 015 Not supported IN Timer number BCD S Set value ee 55 N Timer number S Set value Not supported N Timer number N Timer number Not supported N Timer number N Timer number TIMHX BIN if 2 IL IL el Z I T x ep ep ep ep ep ep ep ep ep ep de Op Op Cp ep ep U dB u u D D a a lt lt lt lt lt lt dp ON lt lt v lt lt O Oo c Q Q OO OO OO OO D OO Q O ONE MS TIMER N N lt lt D D BCD BIN N dy T lt D Cc D ACCUMULATIVE TIMER TTIM 540 552 087 BCD 55 5 Timer input BIN Reset input LONG TIMER 542 Not supported D1 Completion Flag BCD D2 PV word 553 D1 Completion Flags BIN D2 PV word MULTI OUTPUT TIMER MTIM 543 Not supported D1 Completion Flags BCD D2 PV word lt x di Gel a lt lt TT m x MTIMX 554 BIN D1 Completion Flags D2 PV word COUNTER CNT Not supported N Counter number BCD BIN Reset input REVERSIBLE COUNTER CNTR 012 Not supported N Counter number BCD CNTRX 548 Increment input N Counter number BIN 1 O
101. expression END FOR WHILE DO Repeatedly evaluates an expression WHILE condition D Supported END WHILE as long as a condition is true Me END WHILE REPEAT UNTIL Repeatedly evaluates an expression REPEAT Supported END REPEAT until a condition is true expression UNTIL condition END REPEAT EXIT Stops repeated processing EXIT Not supported End of statement Ends a statement Be Supported Comment All text between and is treated commenf Supported as acomment 84 Appendix C External Variables Classification External variable in Data type Address CX Programmer IEC Conditions Flags Greater Than or Equals GE Flag PE o BOOL CF00 Not Equals NE Flag Less Than or Equals LE Flag Greater Than GT Flag Less Than LT Flag Underflow UF Flag BOOL CF010 Access Error Flag CF011 Always OFF Flag Glock Pulses Auxiliary Area Flags Bis 85 External Variables Appendix C 86 Appendix D Instruction Support and Operand Restrictions The tables in this appendix tell which instructions can be used in function blocks and provide any restrictions that apply to operands including the use of array variables and AT settings Instruction Support e Instructions that are not supported by the CX Programmer IEC or the CS1 H FB CJ1 H FB either in function blocks or the main program are given as Not supported in the Symbol column Instructions that are not supported by the CX Programmer I
102. g box will be displayed zi Optimising Function Black memory will Force the memory to be re allocated and therefore the project will no longer match with the PLC Do vou wish to continue el 2 Click the OK Button Allocations to the function block instance areas will be optimized 41 Procedures Section 2 2 2 2 8 Checking the Function Block Definition for an Instance Use the following procedure to check the function block definition from which an instance was created 1 2 3 Right click the instance and select Go To Function Block Definition from the popup menu The function block definition will be displayed 2 2 9 Compiling Function Block Definitions A function block definition can be compiled to perform a program check on it Use the following procedure 1 2 3 Select the function block definition right click and select Compile from the popup menu Alternately press the Ctrl F7 Keys The function block will be compiled and the results of the program check will be automatically displayed on the Compile Table Page of the Output Window NewProject NewPLC1 CS1G H FB Of Symbols a Me mory 1 Programs oo vPro oeram1 00 200 00 mbols 200 00 300 00 2 F Function Blocks ia FunctionBlock1 sample FunctionBlock2 BLOU eb PLO New APLO M Lal D WARNING ala raal nction Block Instanc a can be removed PLG Pro nBlo k2 ERROR Inva
103. gister contain CV TOCV tion blocks ing CS Series memory 1 address D Destination word 118 1 Instruction Support and Operand Restrictions Appendix D 1 CS1 H CJ1 H CJ1M or CS1D only 2 CS1 H CJ1 H or CJ1M only Not supported by CS1D CS1 or CJ1 Function Symbol Operands Array code reduired DISABLE PERIPHERAL IOSP 287 jose 2 ENABLE PERIPHERAL IORS 288 iors 2 Block Programming Instructions 1 CS1 H CJ1 H CJ1M or CS1D only Function Symbol Operands Array code reduired BLOCK PROGRAM BEGIN BPRG Not supported in func N Block program number tion blocks BLOCK PROGRAM END BEND 801 Not supported in func tion blocks BLOCK PROGRAM PAUSE BPPS 811 Not supported in func N Block program number tion blocks BLOCK PROGRAM BPRS 812 Not supported in func N Block program number RESTART tion blocks CONDITIONAL BLOCK CONDI 806 Not supported in func EXIT TION EXIT tion blocks CONDITIONAL BLOCK EXIT Bit 806 Not supported in func B Bit operand EXIT operand tion blocks CONDITIONAL BLOCK EXIT NOT 806 Not supported in func B Bit operand EXIT NOT Bit operand tion blocks CONDITIONAL BLOCK CONDI 802 Not supported in func BRANCHING TION IF tion blocks CONDITIONAL BLOCK IF Bit oper 802 Not supported in func B Bit operand BRANCHING and tion blocks CONDITIONAL BLOCK IF NOT Bit 802 Not supported in func B Bit operand BRANCHING NOT operand tion blocks CONDITIONAL BLOCK ELSE 80
104. gs Instance_sampg _ Instance name FunctionBlock1 GR Memory Function block definition Y amp Programs EN Press the P Key with the cursor on the left Get NewPragramt 00 ven POOL of the instance The New Parameter Ta ode N Dialog Box will be displayed 5 Section eno x 1E Function Blocks vl Detal gt gt OK Cancel EF FunctionBlock1 um Dad Lance JEF FunctionBlock2 WORD BOOL 1 200 00 4 Input the address from which to pass data to the input variable Procedures Section 2 2 2 Input the address from which to pass status data to the input variable FB sample0612 CX Programmer IEC NewPLC1 NewProgram1 Section1 Diagram File Edit view Insert PLC Program Tools Window Help JOSE SAFE AAE Fr jassAlz RER ERBE la xa ESE BIER wl oge TR RR BE BEERS ED ES ixi fo NewProject ED NewPLC1 C51G H FB Offlin FA Symbols QT 10 Table Instance sample a Settings FunctionBlock1 Gt Memory TA Programs NewProgrami 00 Symbols p Section EP END H 1F Function Blocks EF FunctionBlock1 IF FunctionBlock2 BOOL vo BOOL The value of 001 is passed to input variable aaa 3 Input the addresses from to which to pass data for the other input and out put variables 2 2 6 Setting the FB Instance Areas The areas where addresses for variables used in function blocks are allocated can be set These areas are called the fu
105. hanging function block definitions variable tables or algorithms e Inserting or deleting instances Instance VO parameters and instructions not in instances can be changed Program protection Overwrite protection Set using DIP switch Program protection Program Copy protection Password set using Programming Device Ting Manual W394 User defined errors i e user can define fatal errors and Failure diagnosis Programming non fatal errors Manual W394 The FPD 269 instruction can be used to check the execu Fatal and nonfatal errors 11 2 4 tion time and logic of each programming block Error Processing Flowchart in FAL and FALS instructions can be used to simulate errors Operation Manual User defined errors Program ming Manual W394 Up to 20 errors are stored in the error log Information Error log Programming Manual includes the error code error details and the time the error W394 occurred The CPU Unit can be set so that user defined FAL errors are not stored in the error log 73 CPU Unit Specifications and Battery Replacement Section 3 5 Item Specification Reference Serial communications Built in peripheral port Programming Device including Serial communications systems Programming Console connections Host Links NT Links 2 5 1 Serial Communications Built in RS 232C port Programming Device excluding System in Operation Manual Programming Console connections Host Links no proto Ser
106. he execution cycle of the algorithm do not pass the value from a parameter Assign the value to an internal variable and use an AT setting specified addresses Initial Value When you set an initial value for an input variable that value will be written to the variable when the parameter for input variable EN goes ON and the instance is executed for the first time and that one time only If an initial value has not been set for an input variable the input variable will be set to 0 when the instance is first executed EN Enable Variable When an input variable is created the default input variable is the EN vari able The instance will be executed when the parameter for input variable EN is ON B Output Variables Output variables pass return values from the instance to external applications The output variables are displayed on the right side of the instance After the instance is executed the value of the output variable is passed to the specified parameter The value of the output variable CV is passed to the parameter specified as the output destination which is D100 in this case Function Block Specifications Section 3 1 Note Example ADD INT DINT pea Body we IN16 ie OUT32 is a DINT variable so the variable s value is passed to D1000 and D1001 i Comment END ma BOOL aa Tr Indicates successful EXEC O Like internal variables the va
107. he numbers being used will fit in the range Word Data Types Use the following data types when handling groups of data non numeric 1 2 or 4 word Data data in 1 2 or 4 word units e WORD e DWORD e LWORD 3 4 2 Array Settings Array Variables When specifying an instruction operand that is the first address or end address Use for First or End of a range of words see note the required values cannot be passed to vari A of Word ables through input parameters or output parameters anges Note Refer to Appendix D Instruction Support and Operand Restrictions to deter mine which instruction operands must have array variables because they specify the first end address of a range of words In this case prepare an array variable with the required number of array ele ments set the data in each array element in the function block and specify the beginning or end array variable in the operand Using an array variable allows you to specify the first address or end address of a range of words Handling a Single String of Data in Multiple Words In this example an array contains the directory and filename operand S2 for an FREAD instruction e Variable table Internal variable data type WORD array setting with 10 elements vari able names filename 0 to filenamel9 e Ladder programming MOV 5C31 file_name 0 MOV 8233 file_name 1 Set data in each array element MOV 0000 file_name 2 FREAD omitted omitted file namel0 omi
108. iables pass external operands to the instance The input variables are displayed on the left side of the instance The value of the input source data contained in the specified parameter just before the instance was called will be passed to the input variable P On DO D100 The value of the parameter specified as the input value of DO is passed to the instance s input variable PV 4 Function Block Specifications Section 3 1 50 Note Example Algorithm Body a _On SIGN IN16 tmp zz L IN tmp OUT32 ADD INT DINT EN ENO IN16 is an INT variable so the content of D100 is used IN32 is a DINT variable so the content of D200 and D201 is used Name Type AT T mitialw Retai Comment EN BOOL FALSE Controls execution of the IN16 INT IN32 DINT D Internals i Externals 1 The same name cannot be assigned to an input variable and output vari able If it is necessary to have the same variable as an input variable and output variable register the variables with different names and transfer the value of the input variable to the output variable in the function block with an instruction such as MOV 2 When the instance is executed input values are passed from parameters to input variables before the algorithm is processed Consequently values cannot be read from parameters to input variables within the algorithm If it is necessary to read a value within t
109. ial communications Program col communications NT Links ming Manual Wa94 Serial Communications Board sold separately Protocol macros Host Links NT Links Provided on all models Accuracy 1 min 30 s mo at Clock Programming Manual 25 C accuracy varies with the temperature W394 Note Used to store the time when power is turned ON and when errors occur Power OFF detection 10 to 25 ms not fixed Power OFF operation and power time OFF detection time 10 3 Power OFF Operation in Operation Man ual Power OFF detection O to 10 ms user defined default 0 ms Power OFF detection delay time delay time Programming Manual W394 Memory protection Held Areas Holding bits contents of Data Memory and Memory protection 9 2 3 Data Extended Data Memory and status of the counter Comple Area Properties in Operation tion Flags and present values Manual Note Ifthe IOM Hold Bit in the Auxiliary Area is turned ON and the PLC Setup is set to maintain the IOM Hold Bit status when power to the PLC is turned ON the contents of the CIO Area the Work Area part of the Auxiliary Area timer Completion Flag and PVs Index Registers and the Data Registers will be saved Sending commands to FINS commands can be sent to a computer connected via Host Links and non solicited a Host Link computer the Host Link System by executing Network Communica communications 2 5 2 Systems tions Instructions from the PLC in Operation Man
110. ied Address under AT Settings and input the desired ad dress New Variable Name Ee Data Type Boot x ance Usage Internal hd Initial Value i ALS 7 V Betan Comment Select AT Input address The variable name is used to enter variables into the algorithm in the func tion block definition even when they have an address specified for the AT settings the same as for variables without a specified address For example if a variable named Restart has an address of A50100 spec ified for the AT settings Restart is specified for the instruction operand Array Settings An array can be specified to use the same data properties for more than one variable and manage the variables as a group Use the following procedure to set an array 1 After inputting the variable name in the New Variable Dialog Box click the Advanced Button The Advanced Settings Dialog Box will be displayed Select Array Variable in the Array Settings and input the maximum number of elements in the array Edit Variable Hi tans foo TT um x Cancel Select Array Variable Input the number of elements When the name of a variable array is entered in the algorithm in the func tion block definition square brackets surrounding the index will appear af ter the array name For example if you create a variable named PV with a maximum of 3 ele ments PVIO PV 1 and PV 2 could be specified as instruction operands There are three ways
111. iede P Se CONTROL EN ENO amp 100 PARA 1 8200 PARA 2 Some precautions are required when using the same memory area For example if an instance containing a timer instruction is used in more than one program location the same timer number will be used causing coil duplica tion and the timer will not function properly if both instructions are executed Variables Registration of Instances 1 3 Variables 1 3 1 Introduction Section 1 3 Each instance name is registered in the global symbol table as a file name Program Instance sample of function block definition A The instance is registered in the global symbol table with the instance name as the variable name Name Type Address value sample FB FunctionBlock1 N A Auto The function block definition name is registered after FB in Instance name square parentheses In a function block the addresses are not entered as actual I O memory addresses they are all entered as variable names Each time an instance is created the actual addresses used by the variable are allocated automatically in the specified VO memory areas by the CX Programmer IEC Consequently it isn t necessary for the user to know the actual VO memory addresses used in the function block just as it isn t necessary to know the actual memory allo cations in a computer A function block differs from a subroutine in this respect i e
112. indow Help osulsa lsBel2 lt c jas Tr last sn RIET E ES 4 a geEBelR uuw Io REEDE RR RE EERBARE ld NewProject ED NEWPLCILCS1G HCFB OM mbols T 10 Table E Settings a Memor y Programs NewProgram1 00 s Variable table Internals J Ladder input area sample_st2 CX Programmer IEC NewPLC1 FunctionBlock1 FB Structured Text File Edit View Insert PLC Program Tools Window Help IDEB SR s B822 az TR ask IEBRETDOEB sy KOSTER HH oO SG Ss IE HA RR HE BECCARE NewProje n amp ePLci c31G H FB oe en Symbols Comment Variable table g 8 NewProgram1 00 Symbols _Internas Inputs Outputs Exterals Section FOR a 10 TO OBY 1 DO 1 loop 10 times Dj ST Input area b b 1 increment b Dj A meon END FOR end Ioop Dj uncti Zur c HEN if C is OO d amp 1 substitute d for 1 Dj ELSE case substitute d for 2 Dj d amp 2 in other END_IF end if Dj As shown a function block definition consists of a variable table that serves as an interface and a ladder program or structured text that serves as an algo rithm Variable Table as an Interface At this point the variable table is empty because there are no variables allo cated for VO memory addresses in the PLC Ladder Program or Structure Text as an Algorithm e With some exceptions the ladder program for th
113. ion Block Up to 896 function block definitions can be created for one CPU Unit Definitions Instances When a function block definition is inserted in a program the function block uses a particular memory area for its variables Each function block definition that is inserted in the program is called an instance or function block instance Each instance is assigned an identifier called an instance name By generating instances a single function block definition can be used to pro cess different VO data with the same function Not yet in program ie T notyet Block instance in program with memory allocate i allocated object abstract gt Shee Function Block Definition FB1 Program Instance 1 Algorithm _ Instance FB1_1 of function block definition FB1 neu Insert in Automatic Standard Program program unit kaan allocation Memory with variable Input a b _ _ for KEN names a b c data Output data etc Ed c 6 Ee 2 Automatic JL Memory _ _ 2 Parameters allocation w L_for FBT 37 Table defining usage Insert in _ and properties of _ program _ variables a b c etc Different VO data can be processed with the same function B1_2 of function block definition EB1 3 ke a o data 7 Output data O Output data Note Instances are managed by names More th
114. ion Blocks 44 23 Procedural Flow Section 2 1 2 1 Procedural Flow The following procedures are used to create function blocks save them in files transfer them to the PLG monitor them and debug them Creating Function Blocks Create a Project Refer to 2 2 1 Creating a Project for details m Creating a New Project 1 23 1 Start the CX Programmer IEC and select New from the File Menu 2 Select a Device type with a name ending in FB m Using a Non IEC CX Programmer Project 1 2 3 1 Start the CX Programmer IEC and read the project file cxp created with non IEC CX Programmer see note Note The PLC must be the CS1 H CS1G H CJ1H H or CJ1G H 2 Change the Device type to one with a name ending in FB Create a Function Block Refer to 2 2 2 Creating a New Function Block Definition for details Definition 1 2 3 1 Select Function Blocks in the project workspace and right click 2 Select Insert Function Blocks Ladder or Insert Function Blocks Structured Text from the popup menu Define the Function Block Refer to 2 2 3 Defining a Function Block for details m Registering Variables before Inputting the Ladder Program or ST Program 1 2 3 1 Register variables in the variable table 2 Create the ladder program or ST program m Registering Variables as Necessary while Inputting the Ladder Program or ST Program 1 2 3 1 Create the ladder program or ST program 2 Register a variable in
115. ition definition name Language The programming language used in the function block defini tion Select ladder programming or structured text Variable definitions Variable settings such as operands and return values required when the function block is executed e Type usage of the variable e Name of the variable e Data type of the variable e Initial value of the variable Algorithm Enter the programming logic in ladder or structured text Function blocks can have comments Function Block Each function block definition has a name The names can be up to 64 char Definition Name acters long and there are no prohibited characters The default function block name is FunctionBlockl where is a serial number Function block definition name CLOCK PULSE EN ENO BOOL BOOL ON_TIME INT OFF TIME INT Language Select either ladder or structured text Variable Definitions Define the operands and variables used in the function block definition Variable Names e Variable names can be up to 30 000 characters long e Variables name cannot contain spaces or any of the following characters 1 EER amp N lt gt e Variable names cannot start with a number 0 to 9 e Variable names cannot contain two underscore characters in a row There are no other restrictions 48 Function Block Specifications Section 3 1 Variable Notation nur Variable table ENO BOOL BOOL
116. lid Operand Plc net Results of program check displayed ERROR Invalid Chet era and Rune 0 0 0 FunctionBlock2 errors warnings NP Compile Find i a 2 2 10 Saving Function Block Definitions to Files A function block definition can be saved as a function block library file exten sion cxf to enable reusing it in other projects Saving a Function Block Use the following procedure to save a function block definition to a function Library File block library file 1 2 3 1 Select the function block definition right click and select Save Function Block File from the popup menu Alternately select Save Function Block File from the File Menu 42 Procedures Section 2 2 2 The following dialog box will be displayed Input the file name CX P IEC function block library files cxf should be selected as the file type File name Save as type EP IEC Function Block Library Files cxf Cancel As Reading Function Block Use the following procedure to read a function block library file cxf into a Library Files into Other project Projects 1 2 3 1 Select the function block definition item in the Project Workspace right click and select Insert Function Block From File from the popup menu 2 The following dialog box will be displayed Select a function block library file cxf and click the Open Button Select CX Programmer IEC Function Block Library File
117. lues of output variables are retained until the next time the instance is executed Example In the following example the value of output variable CV will be retained until the next time the instance is executed Product A counter PV cv 2150 1 The same name cannot be assigned to an input variable and output vari able If it is necessary to have the same variable as an input variable and output variable register the variables with different names and transfer the value of the input variable to the output variable in the function block with an instruction such as MOV 2 When the instance is executed output variables are passed to the corre sponding parameters after the algorithm is processed Conseguently val ues cannot be written from output variables to parameters within the algorithm If it is necessary to write a value within the execution cycle of the algorithm do not write the value to a parameter Assign the value to an in ternal variable and use an AT setting specified addresses Initial Value An initial value can be set for an output variable that is not being retained i e when the Retain Option is not selected An initial value cannot be set for an output variable if the Retain Option is selected The initial value will not be written to the output variable if the IOM Hold Bit A50012 is ON Auxiliary Area control bit Initial value IOM Hold Bit A50012 The initial value will not be set ENO Enable Output
118. meter like elements such as fixed values as input variables and changing the values passed to the input variables for each instance Example Creating 3 Instances from 1 Function Block Definition ee Instance CASCADE_01 CASCADE_01 CONTROL p Algorithm EN ENO FA Internal and VO le si variables OFF TIME Function Block Definition Example CONTROL Instance CASCADE 02 CASCADE 02 CONTROL Algorithm Algorithm EN ENO HHA Variables Internal and VO PAR TIME variables OFF TIME Example There are 3 FB instances and oach m has its own I O and Instance i er task SGADE os internal variables CASCADE 03 Pon ve Algorithm 8 Internal and VO variables amp 8 If internal variables are not used if processing will not be affected or if the internal variables are used in other locations the same instance name can be used at multiple locations in the program 12 Cyclic task Qocape P On CONTROL EN ENO m amp 100 The same instance can be PARA_1 used at multiple locations amp 130 PARA_2 Function block definition Example CONTROL Instance CASCADE gt CASCADE P_On CONTROL Algorithm Algorithm EN ENO amp 50 VEEN Internal and VO _ PARA 1 arian e gt variables amp 150 PARA 2 Gyclic task
119. mmable Controllers Programming Manual CJ1G H CPULILIH CJU1M CPULIL CJ1G CPULIL Programmable Controllers Instructions Reference Manual SYSMAC CS CJ Series W342 Describes the communications commands that can be CS1G H CPULILI EV1 CS1G H CPULJLJH addressed to CS CJ series CPU Units CS1W SCB21 V1 41 V1 CST W SCU21 41 The following information is included CJ1G H CPULILIH CJU1M CPULIL GJ1G C series Host Link commands When programming use this manual together with the Oper ation Manual CS1 W339 or CJ1 W393 and Programming Manual W394 Communications Commands Reference Manual Note This manual describes commands that can be sent to the CPU Unit without regard for the communications path which can be through a serial communications port on the CPU Unit a communications port on a Serial Communica tions Unit Board or a port on any other Communications Unit Overview of Contents Precautions provides general precautions for using the CX Programmer IEC Section 1 provides an overview of CX Programmer IEC functionality and general information on func tion blocks Section 2 provides information on and procedures for creating function blocks Section 3 provides technical specifications and restrictions for function blocks and information on the battery replacement procedure The Appendices provide additional information required for programming including data types ST language keywords a table of external
120. mming Manual W394 FT replacement during Supported Replacing the program with PLC Br CMND Programming Manual W394 Format in which data is User program Program file Data stored in the Memory Card stored in Memory Card format Programming Manual W394 PLC Setup and other parameters Data file format VO memory Data file format binary format text format or CSV format Functions for which Memory User program instructions Memory Card read write opera Card read write is supported Programming Devices tions Programming Manual including Programming W394 Consoles Host Link com puters AR Area control bits easy backup operation Memory Card data and the EM Extended Data Memory File memory Programming Man Area can be handled as files ual W394 Debugging Control set reset differential monitoring data tracing Debugging set reset differential scheduled each cycle or when instruction is executed monitoring data tracing Pro storing location generating error when a program error gramming Manual W394 occurs User programs can be overwritten in program block units Operating modes Programming when the CPU Unit is in MONITOR or PROGRAM mode Manual W394 This function is not available for block programming areas With the CX Programmer more than one program block can be edited at the same time Online editing Note The following operations cannot be performed using online editing e C
121. mory that is retained when the power is interrupted and PLC operation starts Algorithm Enter the logic programming using the registered variables Comment A comment up to 30 000 characters long can be entered 56 Instance Specifications Section 3 2 3 2 Instance Specifications 3 2 1 Composition of an Instance The following table lists the items that the user must set when registering an instance tem O Description Instance name Name of the instance Language The programming and variables are the same as in Variable definitions the function block definition Function block instance areas The ranges of addresses used by the variables A comment can be entered for each instance Instance Name This is the name of the instance e Instance names can be up to 30 000 characters long e Instance names cannot contain spaces or any of the following characters SHB amp NN lt gt e Instance names cannot start with a number 0 to 9 e Instance names cannot contain two underscore characters in a row There are no other restrictions The instance name is displayed above the instance in the diagram Instance name Pulse 2sON 2sOFF CLOCK PULSE amp 20 ON_TIME a OFF_TIME Function Block To use a function block the system requires memory to store the instance s Instance Areas internal variables and VO variables These areas are known as the function block instance areas and the user must spe
122. mote I O com munications 80 bits 5 words CIO 024700 to CIO 025015 words CIO 0247 to CIO 0250 and CIO A442 When a PLC Link Unit is used in a PLC Link use these bits to monitor PLC Link errors and the operating status of other CPU Units in the PLC Link 3 200 200 words CIO 10000 to CIO 119915 words CIO 1000 to CIO 1199 Link bits are used for data links and are allocated to Units in Controller Link Systems and PLC Link Systems CS1 H FB only 6 400 400 words CIO 150000 to CIO 189915 words ClO 1500 to CIO 1899 CS series CPU Bus Unit bits store the operating status of CS series CPU Bus Units 25 words per Unit 16 Units max 15 360 960 words CIO 200000 to CIO 295915 words CIO 2000 to CIO 2959 Special VO Unit bits are allocated to CS series Special VO Units and C200H Special VO Units See Note 10 words per Unit 96 Units max Note For the CS1 H FB there are I O Units that are treated as Special VO Units Examples C200H ID215 0D215 MD215 1 600 100 words CIO 190000 to CIO 199915 words CIO 1900 to CIO 1999 Inner Board bits are allocated to Inner Boards 100 VO words max 800 50 words CIO 300000 to CIO 304915 words CIO 3000 to CIO 3049 SYSMAC BUS bits are allocated to Slave Racks connected to SYSMAC BUS Remote I O Master Units 10 words per Rack 5 Racks max 512 32 words CIO 310000 to CIO 313115 words CIO 3100 to CIO 3131 VO Terminal bits are allocated to VO Terminal
123. n 1 to 32 000 ms Unit 1 ms When a parallel processing mode is used the cycle time for executing instructions is constant Possible Unit stops operating if the cycle is too long 1 to 40 000 ms Unit 10 ms When a parallel processing mode is used the instruction execution cycle is monitored CPU Unit operation will stop if the peripheral servicing cycle time exceeds 2 s fixed Cyclic refreshing immediate refreshing refreshing by IORF 097 IORF 097 refreshes I O bits allocated to Basic VO Units and Special VO Units The CPU BUS UNIT I O REFRESH DLNK 226 instruc tion can be used to refresh bits allocated to CPU Bus Units in the CIO and DM Areas Data links for Controller Link Units and SYSMAC LINK Units remote I O for DeviceNet Units and other special refreshing for CPU Bus Units is performed at the following times VO refresh period and when the CPU BUS UNIT VO REFRESH DLNK 226 instruction is executed Depends on the ON OFF status of the IOM Hold Bit in the Auxiliary Area All outputs on Output Units can be turned OFF when the CPU Unit is operating in RUN MONITOR or PROGRAM mode Time constants can be set for inputs from Basic I O Units The time constant can be increased to reduce the influence of noise and chattering or it can be decreased to detect shorter pulses on the inputs Supported The CPU Unit will start in RUN mode if the PLC Setup is set to use the Programming Console mode default
124. n be used for AT settings ClO Area Auxiliary Area DM Area EM Area banks 0 to C Holding Area and Work Area The following cannot be used Index and data registers both direct and indirect specifications and indirect addresses to the DM Area and EM Area both in binary and BCD mode 2 Always use variables with AT settings in the following cases e The first destination word at the remote node for SEND 090 and the first source word at the remote node for RECV 098 e Auxiliary Area flags and bits that are not registered for external vari ables and that need to be read or written within the execution cycle of an algorithm Auxiliary Area flags and bits can be used as parameters to pass data when these conditions do not apply Array Settings A variable can be treated as a single array of data with the same properties To convert a variable to an array specify that it is an array and specify the maximum number of elements This property can be set for internal variables only Only one dimensional arrays are supported by the CX Programmer IEC e Setting Procedure Click the Advanced Button select the Array Variable option and input the maximum number of elements in the Size field Select the Array Input the maximum Variable option number of elements e When entering an array variable name in the algorithm in a function block definition enter the array index number in square brackets after the vari able number For det
125. nction block instance areas 1 2 3 1 Select the instance in the Ladder Section Window or in the global symbol table and then select Memory Function Block Memory Allocation from the PLC Menu The Function Block Memory Allocation Dialog shown below will appear 2 Setthe FB instance areas Function Block Memory Allocation NewPLO1 Non retained area FB Instance Area Start Address Size Non Retain Wo Be Retained area Retain EO 20480 EO 32767 12288 Timers T3072 T4095 1024 Edit Counters C3072 C4095 1024 Default Advanced Timer area Counter area First Last Size address address The non retained and retained areas are set in words The timer and counter areas are set by time and counter numbers The default values are as follows FB instance area Start address End Applicable memory address areas Non retained area WO 512 CIO WR HR DM EM See note b Retained area EO 20480 12 288 HR DM EM See note a See note b Timer area T3072 1 024 Counter area C3072 1 024 Note a E20480 to E32767 in the last EM Area bank is the default setting The number of the last EM Area bank depends on the model of CPU Unit being used b Bit data can be accessed even if the DM or EM Area is specified 39 Procedures Note Section 2 2 Overlapping of Instance Area Addresses and Address Used in the Program If the addresses in the function block instance areas overlap with an
126. ns and converted to library functions The function blocks are created with variable names that are not tied to actual addresses so new programs can be developed easily just by reading the def initions from the file and placing them in a new program Mathematical expressions can be entered in structured text ST language st_sample FunctionBlock1 Internals Inputs Outputs Externals 1 2 3 Function Block Structure Function Block Definition A function block consists of the function block definition that is created in advance and the function block instances that are inserted in the program The function block definition is the basic element that makes the function block reusable Each function block definition contains the algorithm and vari able definitions as shown in the following diagram Function Block Definition EDE EE Example CLOCK PULSE 1 Algorithm tim_b TIMX tim_a OFF_TIME i 2 Variable Definitions Usage Name im Input ON TIME Input OFF TIME 1 Algorithm Standardized programming is written with variable names rather than actual I O memory addresses In the CX Programmer IEC algorithms can be written in either ladder programming or structured text 2 Variable Definitions The variable table lists each variable s usage input output or internal and properties data type etc For details refer to 1 3 Variables Function Blocks Section 1 2 Number of Funct
127. nt Period Replacement Batteries The battery replacement method is the same as for CJ1 H CPU Units The battery replacement method is the same as for CS1 CPU Units There are two battery connectors Connect a new battery to the open connector first and then remove the old battery from the other connector This enables peri odic replacement of the battery while the CPU Unit is turned ON without a bat tery error being detected 1 If the old battery is removed from the CS1 H FB CPU Unit first without power turned ON an internal capacitor will back up memory even though no battery is connected The capacitor however will back up memory for only 3 minutes after the power supply is turned OFF Connect the new battery within 3 minutes 2 If the old battery is removed from the CS1 H FB CPU Unit first while power is turned ON memory will be retained even though no battery is connected 3 Both the top and bottom battery connectors are equivalent It does not matter which is used Also no problems will occur if a battery is connect ed to both connectors e g the battery with the lower voltage will not re ceive a charge The battery can be replaced while the power is turned ON even if communica tions are being performed In this case always touch a grounded piece of metal to discharge any static electricity from your body before touching any part of the PLC Whenever possible we recommend turning OFF the power supply to the CPU
128. o E0_00000 to E6 32 67 E2 32 67 Current con 0 82 Aat5 VDC 0 78 Aat5 VDC sumption Note The number of steps in a program is not the same as the number of instruc tions Some instructions require only 1 step whereas others required 7 steps For example LD and OUT require 1 step each but MOV 021 requires 3 steps The program capacity indicates the total number of steps for all instructions in the program Refer to 10 5 Instruction Execution Times and Number of Steps in the Operation Manual for the number of steps required for each instruction CJ1 H FB CPU Units CJ1G CPU44H FB CJ1G CPU43H CJ1G CPU42H FB VO bits 1 1280 User program 30 go memory steps See note Data Memory 32 Kwords Extended Data 32Kwords x 1 bank Memory E0_00000 to E0_32767 Current con 0 91 Aat5 V DC sumption Common Specifications em Specification Control method Stored program EN VO control method Cyclic scan and immediate processing are both possible EN Programming adderdagar FAN CPU processing mode Normal Mode Parallel Processing Mode with Asynchronous Memory Access Parallel Processing Mode with Synchro nous Memory Access or Peripheral Servicing Priority Mode 67 CPU Unit Specifications and Battery Replacement Section 3 5 Item Instruction length Ladder instructions Execution time Overhead processing time Number of Expansion Racks Number of tasks Interrupt types Specification Reference
129. ock Definitions ____Popupmenu dan Insert Function Block Creates a function block definition with a ladder programming language algo rithm Structured Text Creates a function block definition with an ST language algorithm Reads a function block definition from a function block library file cxf Popup Menu for Inserted Function Blocks Popup menu Fatt Displays the contents of the selected function block definition on the right side of the window Save Function Block File Saves the selected function block definition in a file Compile Compiles the selected function block definition Popup Menu for Instances Popupmenu J Faneten O OS Changes the instance name Update Invocation When a function block definition s VO variables have been changed after the instance was created an error will be indicated by displaying the instance s left bus bar in red This command updates the instance with the new information and clears the error Go To Function Block Definition Displays the selected instance s function block definition on the right side of the window Function Blocks Section 1 2 1 2 Function Blocks 1 2 1 Outline A function block is a basic program element containing a standard processing function that has been defined in advance Once the function block has been defined the user just has to insert the function block in the program and set the I O in order to use the function As a standard proces
130. ord R Result word ae Floating point Math Instructions 1 CS1 H CJ1 H CJ1M or CS1D only Function Symbol Operands Array code required 450 FLOATING TO 16 BIT FIX u S 1st source word FIX R Result word OR FLOATING TO 32 BIT FIXL 451 id FML mn R Result word al x 16 BIT TO FLOATING FLT 452 FLT R 1st result word 32 BIT TO FLOATING FLTL 453 FLTL S 1st source word R Result word Au 1st augend word Ad 1st addend word R 1st result word TI FLOATING POINT ADD 454 F FLOATING POINT SUB F 455 Mi 1st Minuend word TRAGT F Su 1st Subtrahend word R 1st result word FLOATING POINT MULTI 456 Md 1st Multiplicand word PLY Mr 1st Multiplier word R 1st result word FLOATING POINT DIVIDE 457 Dd 1st Dividend word Dr 1st Divisor word R 1st result word 106 Instruction Support and Operand Restrictions Function Symbol Operands Array code required u S 1st source word R 1st result word 1 rce wor R 1st result word 1 CS1 H CJ1 H CJ1M or CS1D only gt D 5 2 i E O DEGREES TO RADIANS RAD RAD RADIANS TO DEGREES DEG DEG SINE SIN 460 SIN COSINE COS 461 COS TANGENT TAN 462 TAN ARC SINE ASIN 463 S 1st source word ASIN R 1st result word 68 S 1st source word R 1st result word S 1st source word R 1st result word S 1st source word R 1st result word S 1st source word R 1st
131. ord E 1st exponent word R 1st result word Array required Instruction Support and Operand Restrictions Appendix D Instruction Function Symbol Operands Array ni ane DOUBLE SYMBOL COM PARISON Using AND Symbol option Using OR Symbol option Table Data Processing Instructions 1 CS1 H CJ1 H CJ1M or CS1D only kaal ig Symbol Operands Array code required SET STACK SSET TB 1st stack address SSET N Number of words PUSH ONTO STACK PUSH Not supported in func iil DN EE FIRST IN FIRST OUT FIFO Not supported in func Toro EO nn LAST IN FIRST OUT LIFO Not supported in func leo EE mn sa N Table number LR Length of each record NR Number of records TB 1st table word DIMENSION RECORD TABLE 2 N SET RECORD LOCATION SETR SETR GET RECORD NUMBER GETR GETR Not supported in func N Table number EN tion blocks R Record number EN D Destination Index Reg ister Not supported in func N Table number ee tion blocks IR Index Register Fa D Destination word EN 111 Instruction Support and Operand Restrictions Appendix D Function Symbol Operands Array code required C 1st control word R1 1st word in range Cd Comparison data 1 CS1 H CJ1 H CJ1M or CS1D only DATA SEARCH SRCH SRCH O Q SWAP BYTES SWAP SWAP N Number of words R1 1st word in range Yes di SWAP FIND MAXIMUM MAX MAX C 1st control word MAX 5 R
132. re are some restrictions on instructions used in ladder programs Subroutine Instructions SBS GSBS RET MCRO and SBN Subroutine numbers 128 to 1 023 cannot be used Only 0 to 127 can be used The following instructions cannot be used in function block definitions A com pile error will occur if any of these instructions is used e Block Programming Instructions BPRG and BEND e Subroutine Instructions SBS GSBS RET MCRO and SBN e Jump Instructions JMP CUP CUPN JMPO and JMEO e Step Instructions STEP and SNXT e Immediate Refresh Instructions e VO REFRESH Instruction IORF TMHH and TIMH Instructions e CV Address Conversion Instructions FRMCV and TOCV Restrictions on Function Blocks Section 3 3 AT Setting Restrictions Unsupported Data Areas VO Variable Restrictions Unsupported Data Areas Refreshing Timer and Counter PVs Interlocks Differentiation Instructions in Function Block Definitions e Instructions manipulating record positions PUSH FIFO LIFO SETR and GETR e FAILURE POINT DETECTION Instruction FPD e Index Register Read Instructions MOVR and MOVRW Addresses in the following areas cannot be used for AT settings e Index Registers and Data Registers Neither indirect nor direct address ing is supported e Indirect addressing of DM or EM Area addresses Neither binary mode nor BCD mode indirect addressing is supported Addresses in the following data areas cannot be u
133. rea e Applicable variables Internal variables that have the Retain Option selected to retain the variable s content when the power is turned ON or program execution starts Note TIMER and COUNTER data types are not allocated to the retained area Allowed data areas H Holding Area D DM Area or E EM Area Note Bit data can be accessed even if the DM or EM Area is specified e Units Set in word units e Default allocation Words 20480 to 32767 of the last EM bank Note The default area is words 20480 to 32767 of the last EM bank The last EM bank number depends on the CPU Unit being used 18 Variables Section 1 3 Timer Area e Applicable variables Variables that have the data type property set to TIMER e Allowed data areas Timer Completion Flags 1 bit each or timer PVs 16 bits each e Default allocation T3072 to T4095 timer Completion Flags 1 bit each or timer PVs 16 bits each Counter Area e Applicable variables Variables that have the data type property set to COUNTER e Allowed data areas Counter completion flags 1 bit each or counter PVs 16 bits each e Default allocation C3072 to C4095 counter Completion Flags 1 bit each or counter PVs 16 bits each Setting Procedure Select Memory Function Block Memory Allocation from the PLC Menu Set the areas in the following dialog box Function Block Memory Allocation NewPLC1 X Cancel Edit Default Advanced
134. result word ARC COSINE ACOS ACOS ARC TANGENT ATAN ATAN SQUARE ROOT SQRT SQRT EXPONENT EXP EXP LOGARITHM 06 fa LOG R 1st result word S 1st source word R 1st result word S 1st source word R 1st result word S 1st source word R 1st result word 10 NJ Instruction Support and Operand Restrictions Appendix D 1 CS1 H CJ1 H CJ1M or CS1D only Function Symbol Operands Array code reduired EXPONENTIAL POWER B 1st base word E 1st exponent word R 1st result word S1 Comparoson data 1 EE a mad S2 Comparison data 2 lt F gt F gt F Using AND Using OR N FLOATING POINT TO FSTR 448 S 1st source word as FSTR C Control word D Destination word Yes es ASCII TO FLOATING POINT FVAL 449 i FVAL D 1st destination word u Double precision Floating point Instructions CS1 H CJ1 H CJ1M or CS1D Only Function Symbol Operands Array code required DOUBLE FLOATING TO 16 FIXD 841 S 1st source word ee BIT BINARY FIXD D Destination word DOUBLE FLOATING TO 32 FIXLD 842 S 1st source word FIXLD o u FE 108 Instruction Support and Operand Restrictions Appendix D 16 BIT BINARY TO DOUBLE DBL Instruction Operands Array required D 1st destination word Function oe FLOATING DBL 32 BIT BINARY TO DOUBLE FLOATING DBLL DBLL S 1st source word D 1st destination word DOUBLE FLOATING POINT D ADD D Au
135. rocedures 1 5 1 1 2 3 Once a function block definition has been created and an instance of the algo rithm has been created the instance is used by calling it when it is time to execute it Also the function block definition that was created can be saved in a file so that it can be reused in other projects PLCs Creating Function Blocks and Executing Instances The following procedure outlines the steps required to create and execute a function block 1 First create the function block definition including the algorithm and vari able definitions in ladder program or ST language Note a Create the algorithm entirely with variable names b When entering the algorithm in ladder programming language project files created with Non IEC CX Programmer can be reused by reading the project file into the CX Programmer IEC and copy ing and pasting useful parts 2 When creating the program insert copies of the completed function block definition This step creates instances of the function block 3 Enter an instance name for each instance 4 Set the variables input source addresses and or constants and output destination addresses and or constants as the parameters to pass data for each instance 5 select the created instance select Memory Function Block Memory Allocation from the PLC Menu and set the internal data area for each type of variable 6 Transfer the program to the CPU Unit 7 Start program execution in
136. rs Function blocks however use timer numbers T3072 to T4095 by default Timer instructions with timer numbers T0000 to T2047 will thus operate differently in the main pro grams from those in function blocks To solve this problem and achieve the same operation change the timer numbers used by function blocks to T0000 to 12047 Refer to 3 5 3 Operation of Timer Instructions for de tails 27 Procedures Section 2 2 2 2 2 Creating a New Function Block Definition Led 1 When a project is created a Function Blocks icon will appear in the project workspace as shown below Untitled CX Programmer IEC NewPLC1 NewProgram1 Section1 Diagram File Edit View Insert PLC Program Tools Window Help DEUR EB 22 mt TR 1a j XA ESTE JR IM OSE TARRAT apeu dad o NewProject ED NewPLC1 CJ1G H FB Offlin Symbols QT 10 Table 1 fa Settings Kt Memory A I Programs ZIZI E 3 NewProgrami 00 Symbols 5 Section Function Blocks will appear under the PLC 2 Function blocks are created by inserting function block definitions after the Function Blocks icon Function block can be defined using either ladder programming or structured text Defining Function Blocks with Ladders Select Function Blocks in the project workspace right click and select Insert Function Blocks Ladder from the popup menu Or select Func tion Block Ladder from the Insert Menu Defining Function Blocks
137. s advantages 7 application guidelines 65 creating 21 23 debugging 44 defining 29 elements 48 errors 63 instruction support 87 monitoring 44 operating specifications 59 outline 7 restrictions 60 reusing 22 setting parameters 38 specifications 4 48 structure 8 functions 2 function blocks 4 restrictions 3 G general specifications CJ1 H FB 76 CS1H FB 75 global symbol table 13 H hardware specifications CJ1 H FB 76 CS1 H FB 75 123 IEC 61131 3 2 4 input variables 49 inputs 14 instance areas 18 57 counter 19 non retained 18 retained 18 setting 19 39 timer 19 instances creating 21 36 multiple 58 number of 10 outline 9 registering in global symbol table 13 specifications 57 instructions support 87 internal variables 52 internals 14 L ladder programming function block definition 29 restrictions 64 restrictions in function blocks 60 menus 6 main 6 popup 6 monitoring function blocks 44 O online editing restrictions 63 operands restrictions 87 operators 83 output variables 50 outputs 14 124 Index P parameters outline 10 precautions x1 applications xiii general xii safety xii Programming Consoles 63 programs downloading 43 projects creating 26 reusing 26 36 PTs monitoring restriction 65 PV restrictions 61 S safety precautions xii specifications 47 CPU Unit
138. s of programs one for automatic operation and another for manual operation The user can switch to the appropriate mode of operation In this case multiple instances will be created from a single function block The same instance must be called from multiple locations Program 1 automatic operation Program 2 manual operation Product A counter Product B counter D100 Product B counter Reading the same product s counter value at different locations Reading different products counter values Algorithm calculating counter value is the same D200 Program 1 Instance A Instance A VO variables Internal variables 7 FB definition Instance B MNJ I N VO variables Internal variables VX EE EOE ERT EA I Use the same internal variables KA Use different internal variables 58 Instance Specifications Section 3 2 3 2 2 Operating Specifications Calling Instances Operation when the Instance Is Executed The user can call an instance from any location The instance will be executed when the input to EN is ON Instance In this case the input to EN is bit 0 0 at the left of the diagram e When the input to EN is ON the instance is executed and the execution results are reflected in bit 1 0 and word D10 e When the input to EN is OFF the instance is not executed bit 1 0 is turned OFF and the con
139. sed as parameters for input and output variables e Index Registers and Data Registers Neither indirect nor direct address ing is supported e Indirect addressing of DM or EM Area addresses Neither binary mode nor BCD mode indirect addressing is supported Timer and counter PVs are always stored in binary mode so PVs of all Timer and Counter Instructions must be treated as binary data whether or not the instructions are in function blocks When a function block is called from an interlocked program section the con tents of the function block definition will not be executed The interlocked function block will behave just like an interlocked subroutine P Of Ee FB BODY Interlocked Interlock will not affect instructions in the function block definition An instance will not be executed while its EN input variable is OFF so the fol lowing precautions are essential when using a Differentiation Instruction in a function block definition Differentiation Instructions include DIFU DIFD and any instruction with an or prefix e As long as the instance s EN input variable is OFF the execution condi tion will retain its previous status the last status when the EN input vari able was ON and the Differentiation Instruction will not operate e When the instance s EN input variable goes ON the present execution condition status will not be compared to the last cycles status The present execution condition will
140. ses used for function block internal variables Checking the Status of The following procedure can be used to check the number of addresses allo Addresses Internally cated to variables and the number still available for allocation in the function Allocated to Variables block instance areas 1 2 3 1 Select the instance in the Ladder Section Window right click and select Memory Function Block Memory Statistics from the PLC Menu 2 The Function Block Memory Statistics Dialog Box will be displayed as shown below Check address usage here Function Black Memory Statistics NewPLC1 ES FB Instance Area Non Retain Retain Timers Counters The total number The number of of words in each The number words still available interface area of words already used Optimizing Function When a variable is added or deleted addresses are automatically re allocated Memory in the variables instance area Consecutive addresses are required for each instance so all of the variables will be allocated to a different block of addresses if the original block of addresses cannot accommodate the change in variables This will result in an unused block of addresses The following procedure can be used to eliminate the unused areas in memory so that memory is used more efficiently 1 2 3 1 Select the instance in the Ladder Section Window right click and select Memory Optimize Function Memory from the PLC Menu The following dialo
141. sing function a function block does not contain actual addresses but variables The user sets addresses or constants in those vari ables These address or constants are called parameters The addresses used by the variables themselves are allocated automatically by the CX Pro grammer IEC for each program With the CX Programmer IEC a single function block can be saved as a sin gle file and reused in other PLC programs so standard processing functions can be made into libraries Program 2 Copy of function block A sa Function block A Program 1 EE Variable Output Copy of function block A Standard ai program section e N written with variables BN Define in advance Input Variable Variable Output I program N Set Set Copy of function block A N Save function block as a file Convert to library function Function block A gt To another PLC program y Reuse Input Variable Variable Output 1 2 2 Advantages of Function Blocks Structured Programming Easy to read Black Box Design Use One Function Block for Multiple Processes Function blocks allow complex programming units to be reused easily Once standard programming is created in a function block and saved in a file it can be reused just by placing the function block in a program and setting the parameters for the function blo
142. t limit word D Output word DEAD ZONE CONTROL 682 C 1st limit word D Output word SCALING SCL 194 P1 1st parameter word Y R Result word 3 O O an Cc O O Q en 11 Oe Instruction Support and Operand Restrictions Appendix D 1 CS1 H CJ1 H CJ1M or CS1D only Function Symbol Operands Array code required SCALING 2 SCL2 SCL2 TE S Soucewod P1 1st parameter word R Result word SCALING 3 SCL3 487 S Source word Source word SCL3 P1 1st parameter word 1st parameter word Yes R Result word AVERAGE WG 195 AVG N Number of cycles N R Result word Yes N Subroutine Instructions 1 CS1 H CJ1 H CJ1M or CS1D only Function Symbol Operands Array code required SUBROUTINE CALL SBS Not supported in func N Subroutine number SBS tion blocks SUBROUTINE ENTRY SBN Not supported in func N Subroutine number tion blocks SUBROUTINE RETURN RET Not supported in func tion blocks MACRO MCRO Not supported in func N Subroutine number MCRO tion blocks S 1st input parameter word 0 0 D 1st output parameter word GLOBAL SUBROUTINE GSBS 750 Not supported in func N Subroutine number tion blocks so GSBS GLOBAL SUBROUTINE GSBN Not supported in func N Subroutine number ENTRY tion blocks 1 GLOBAL SUBROUTINE GRET Not supported in func RETURN tion blocks 1 Interrupt Control Instructions 1 Not supported by CS1D Function Symbol Operands
143. t values for indirect addressing One register is 16 Operation Manual bits 1 word CS1 CPU Units Data registers used independently in each task CS1 H CPU Units Setting to use data registers either inde pendently in each task or to share them between tasks Index Registers IRO to IR15 9 22 Index Registers in Store PLC memory addresses for indirect addressing One Operation Manual register is 32 bits 2 words Setting to use index registers either independently in each task or to share them between tasks Task Flag Area 32 TKOOOO to TK0031 Task Flags are read only flags that are ON when the corre 9 24 Task Flags in Operation Manual sponding cyclic task is executable and OFF when the corre sponding task is not executable or in standby status 40 000 words trace data 31 bits 6 words Programming Manual W394 File Memory Memory Cards Use OMRON HMGC EFLI IT Memory Cards Programming Manual Commercially available compact flash memory cards can W394 not be used EM file memory Part ofthe EM Area can be converted to file memory MS DOS format 71 CPU Unit Specifications and Battery Replacement Function Specifications Item Constant cycle time Cycle time monitoring VO refreshing Timing of special refreshing for CPU Bus Units VO memory holding when changing operat ing modes Load OFF Input response time setting Startup mode setting Flash memory 72 Specificatio
144. t word CALENDAR SUBTRACT CSUB CSUB C 1st calendar word T 1st time word R 1st result word SECONDS TO HOURS rel CLOCK ADJUSTMENT DATE DATE HOURS TO SECONDS df 117 Instruction Support and Operand Restrictions Appendix D Debugging Instructions Function Symbol Operands Array code reduired TRAGE MEMORY SAM TRSM 045 Failure Diagnosis Instructions Function Symbol Operands Array code required FAILURE ALARM FAL N FAL number FAL M 1st message word or error code to gener ate 0000 to FFFF SEVERE FAILURE ALARM FALS 007 N FALS number EN M 1st message word or error code to gener ate 0000 to FFFF 9 FAILURE POINT DETEC FPD 26 Not supported in func C Control word EN TION tion blocks T Monitoring time En R 1st register word Other Instructions 1 CS1 H CJ1 H CJ1M or CS1D only 2 CS1 H CJ1 H or CJ1M only Not supported by CS1D CS1 or CJ1 Function Symbol Operands Array code required SET CARRY STC stc STC CLEAR CARRY CLC aie CLC DT 041 SELECT EM BANK EMBC 281 Not supported N EM bank number EMBC EXTEND MAXIMUM 094 T Timer setting CYCLE TIME 84 SAVE Condition FlagS CCS d CCS LOAD Condition FlagS CCL Y CCL CCL CONVERT ADDRESS FRMCV 2 Not supported in func S Word containing CV FROM CV FRMCV tion blocks series memory address D Destination Index Reg ister CONVERT ADDRESS TO TOCV 285 Not supported in func S Index Re
145. te Note The IOM Hold Bit A50012 is supported for compatibility with previous mod els To hold the values of variables in function blocks however use the Retain Option and not the IOM Hold Bit Initial Value An initial value can be set for an internal variable that is not being retained i e when the Retain Option not selected An initial value cannot be set for an internal variable if the Retain Option is selected Internal variables that are not being retained will be initialized to 0 The initial value will not be written to the internal variable if the IOM Hold Bit A50012 is ON Auxiliary Area control bit Initial value IOM Hold Bit A50012 The initial value will not be set The initial value will be set B External Variables External variables are global symbols registered as variables in advance with the CX Programmer IEC For details refer to Appendix C External Variables Variable Name The variable name is used to identify the variable in the function block The name can be up to 30 000 characters long The same name can be used in other function blocks A variable name must be input for variables even ones with AT settings specified address 53 Function Block Specifications Section 3 1 Data Type Any of the following types may be used Datatype Contem Sze inputs Outputs Internals Boor Bree a o o S INT integer teug o o JOK unr Unsignediteger Jews ox ox OK DINT JDodbeimeger Babs
146. tent of D10 is not changed The system calls a function block when the input to the function blocks EN input variable is ON When the function block is called the system generates the instance s variables and copies the algorithm registered in the function block The instance is then executed Algorithm Body tim b 1 The FB is called i i tim_a Eno 2 The system generates the instance i variables and copies the algorithm 9 2 2 WC NN NN FB instance Pulse_2sON_1SOFF Pulse 2sON_1sOFF a CLOCK PULSE EN ENO Usage Name Value Internal 200 100ms PULSE tim a Internal 200 100ms PULSE tim b u Input 200 100ms PULSE ON TIME amp 20 Input 200 100ms PULSE OFF TIME amp 10 3 The contents of the Algorithm Image instance are executed Pulse 2sON 1sOFF tim_b Pulse_2sON 1SOFF tim_a Pulse_2sON 1sOFF OFF TIME Pulse 2sON 1sOFF tim a Pulse_2sON_1sOFF tim_b Pulse_2sON_1sOFF ON TIME Pulse_2sON_1sOFF ENO The order of execution is as follows 1 Read data from parameters to input variables 2 Execute the algorithm 3 Write data from output variables to parameters Input to EN is ON Parameters 1 Read values from parameters to input variables 2 Execute the algorithm 3 Write values from output gt Parameters variables to parameters Data cannot be exchanged with parameters in the algorithm itself In addition if an output v
147. terrupt tasks 2 max I O interrupt tasks 32 max External interrupt tasks 256 max Scheduled Interrupts Interrupts generated at a time scheduled by the CPU Units built in timer I O Interrupts Interrupts from Interrupt Input Units Power OFF Interrupts Interrupts executed when the CPU Unit s power is turned OFF External VO Interrupts Interrupts from the Special VO Units CS series CPU Bus Units or the Inner Board CS1 H FB only Calling subroutines from more Supported using global subroutines than one task 68 CPU Unit Specifications and Battery Replacement Section 3 5 Item Specification Reference VO Area C200H DeviceNet Area PLC Link Area CS1 H FB only Link Area CPU Bus Unit Area Special VO Unit Area Inner Board Area CS1 H FB only SYSMAC BUS Area CS1 H FB only VO Terminal Area CS1 H FB only 5 120 ClO 000000 to CIO 031915 320 words from CIO 0000 to CIO 0319 The setting of the first word can be changed from the default CIO 0000 so that ClO 0000 to CIO 0999 can be used VO bits are allocated to Basic VO Units such as CS series Basic VO Units C200H Basic VO Units and C200H Group 2 High density VO Units 1 600 100 words Outputs CIO 005000 to CIO 009915 words CIO 0050 to CIO 0099 Inputs CIO 035000 to GIO 039915 words GIO 0350 to CIO 0399 C200H DeviceNet Area bits are allocated to Slaves accord ing to C200HW CRW21 V1 DeviceNet Unit re
148. the following properties Variable Name The variable name is used to identify the variable in the function block It doesn t matter if the same name is used in other function blocks Note The variable name can be up to 30 000 characters long but must not begin with a number Also the name cannot contain two underscore characters in a row There are no other restrictions Consequently it is acceptable to use addresses such as A20300 as variable names Data Type Select one of the following data types for the variable Any of the following types may be used Datatype Content Sue inputs Outputs Internals LINT Long amp byte integer 64 bis ok wx jo Unsigned long 8 byte integer 64 bits JOK JOK JOK o oO WORD t6btdaa ooit OK fx ox 32 bits ox x ox OK ox x OK ox x LREAL_ Longrealnumber ebs fox fx x TIMER Timer Seenote btortebs fok ox ox COUNTER Counter Seenote2 tbtortebis ok ox x Note 1 When a variable is entered in the timer number 0 to 4095 operand of a timer instruction such as TIM or TIMH the data type will be TIMER When this variable is used as an operand in another instruction it will be treated as the timer Completion Flag if the operand takes 1 bit data or as a timer PV if the operand takes 16 bit data The timer PVs are 16 bit bi nary data because the CX Programmer IEC can use only binary format for the PVs The TIMER data type cannot be used in ST language func tion blocks 2 When
149. tion regardless of the operating mode of the CPU Unit Caution is required in respect to the following functions e Transferring from the CX Programmer IEC to real VO CIO Area in the CPU Unit using the PLC Memory Window e Transferring from file memory to real I O CIO Area in the CPU Unit using the Memory Card Window Confirm safety at the destination node before transferring a program to another node or changing contents of the VO memory area Doing either of these without confirming safety may result in injury Execute online editing only after confirming that no adverse effects will be caused by extending the cycle time Otherwise the input signals may not be readable Application Precautions 4 N Caution Confirm safety sufficiently before monitoring power flow and present value status in the Ladder Section Window or when monitoring present values in the Watch Window If force set reset or set reset operations are inadvertently per formed by pressing short cut keys the devices connected to Output Units may malfunction regardless of the operating mode of the CPU Unit 4 Application Precautions Observe the following precautions when using the CX Programmer IEC e User programs cannot be uploaded to the CX Programmer IEC e Observe the following precautions before starting the CX Programmer IEC e Exit all applications not directly related to the CX Programmer IEC Particularly exit any software such as screen savers virus
150. tmp DINT BOOL Input IN16 INT Input IN32 DINT Output ENO BOOL O utput OUT32 DINT Retain Data through Power Interruptions and Start of Operation Internal variables retain the value from the last time that the instance was called In addition the Retain Option can be selected so that an internal vari able will also retains its value when the power is interrupted or operation starts the mode is switched from PROGRAM to RUN or MONITOR mode When the Retain Option is selected the value of the variable is retained when the power is interrupted or operation starts unless the CPU Unit does not have a backup battery If the CPU Unit does not have a good battery the value will be unstable Variables set to Retain Start of operation Function Block Specifications Section 3 1 When the Retain Option is not selected the value of the variable will not be held when the power is interrupted or operation starts Even variables not set to be retained however can be held at the start of operation by turning ON the IOM Hold Bit A50012 and can be held during power interruptions by set ting the PLC Setup as shown in the following table Variables Condition IOM Hold Bit A50012 setting IOM Hold Bit Status at Startup IOM Hold Bit Status at Startup PLC Setup selected PLC Setup not selected Variables not Start of operation Not retained setto Retain Not retained Not retained Variable Properties No
151. to specify indices e Directly with numbers e g PV 1 in the above example for ladder pro gramming or ST language programming Procedures 1 2 3 Section 2 2 e With a variable e g PV a in the above example where a is the name of a variable with a data type of INT for ladder programming or ST language programming e With an equation e g PV a b or PV a 1 in the above example where a and b are the names of variables with a data type of INT for ST language programming only Using an Array to Specify Words Allocated to CPU Bus Units The first DM Area word allocated to a CS series or CJ series CPU Bus Unit is expressed by the following formula D30000 unit number x 100 Thus an array variable can be used to indirectly address DM Area words allo cated to CPU Bus Units by using a formula containing the unit number as an index to the array For example the following could be done if the unit number is given by the variable named N and the variable named DataMemory is an array variable for the DM Area words allocated to the CPU Bus Unit 1 Register the variable DataMemory as an array variable with a maximum of 1 600 elements 2 To designate the DM Area word that is s words from the first allocated word where s is either a variable or a direct offset in number of words the fol lowing variable would be used and the AT setting for the Data Memory vari able would be set to D30000 DataMemory
152. tted lt Specify the first element of the array in the instruction operand Handling Control Data in Multiple Words In this example an array contains the number of words and first Source word operand S1 for an FREAD instruction 65 Function Block Applications Guidelines Section 3 4 Division Using Integer Array Variables Ladder Programming Only Note 3 4 3 AT Settings 66 e Variable table Internal variable data type DINT array setting with 3 elements variable names read_num 0 to read_num 9 e Ladder programming MOVL amp 100 read_num 0 No of words MOVL amp 0 read_num 1 1st source word FREAD omitted omitted file_name 0 omitted PPR the first element pf the array lam Set data in each array element Handling a Block of Read Data in Multiple Words The allowed amount of read data must be determined in advance and an array must be prepared that can handle the maximum amount of data In this example an array receives the FREAD instruction s read data operand D e Variable table Internal variable data tyoe WORD array setting with 100 elements variable names read datal0 to read_data 99 e Ladder programming FREAD omitted omitted omitted read_data 0 A two element array can be used to store the result from a ladder program s SIGNED BINARY DIVIDE instruction The result from the instruction is D quotient and D 1 remainder This method can be used to obtain the
153. u Augend word Ad Addend word R Result word DOUBLE BCD ADD WITH CARRY BCL BCL Au 1st augend word BCL Ad 1st addend word R 1st result word BC Au Ad Au SIGNED BINARY SUB TRACT WITHOUT CARRY Su Subtrahend word M um R Result word Su u 5 en DOUBLE SIGNED BINARY SUBTRACT WITHOUT CARRY Su Subtrahend word 2 z cC R Result word Mi Minuend word Su Subtrahend word SIGNED BINARY SUB TRACT WITH CARRY DOUBLE SIGNED BINARY WITH CARRY CL O Su Subtrahend word R Result word Mi Minuend word Su Subtrahend word Mi R Result word Su Mi 1st minuend word Su 1st subtrahend word R 1st result word R Result word i Mi Minuend word i i BCD SUBTRACT WITH OUT CARRY us 405 406 407 410 411 412 413 414 15 UJ C DOUBLE BCD SUB 4 TRACT WITHOUT CARRY 100 Instruction Support and Operand Restrictions Appendix D Operands Array required Mi Minuend word Su Subtrahend word Function code Instruction Og O ur Oo BCD SUBTRACT WITH CARRY BC i Mi R Result word I Mi 1st minuend word Su 1st subtrahend word R 1st result word DOUBLE BCD SUB TRACT WITH CARRY BCL 417 BCL SIGNED BINARY MULTI PLY 420 Md Multiplicand word Mr Multiplier word R Result word Md 1st multiplicand word Mr 1st m
154. ual Remote programming Host Link communications can be used for remote pro Remote programming and moni and monitoring gramming and remote monitoring through a Controller Link toring Programming Manual System or Ethernet network W394 Controller Link 2 5 3 Communi cations Network System in Oper ation Manual Three level communi Host Link communications can be used for remote pro Host Links and FINS message cations gramming and remote monitoring from devices on net service 2 5 2 Systems in Opera works up to two levels away Controller Link Network or tion Manual Ethernet Network Storing comments in I O comments can be stored in the CPU Unit in Memory VO comments CX Programmer CPU Unit Cards or EM file memory User Manual Program check Program checks are performed at the beginning of opera Program check Programming tion for items such as no END instruction and instruction Manual W394 errors CX Programmer can also be used to check programs Control output signals RUN output The internal contacts will turn ON close while the CPU Unit is operating For CS1 H HB CPU Units these terminals are provided only on the C200HW PA204R and C200HW PA209R RUN output Programming Man ual W394 Power Supply Units For CJ1 H HB CPU Units these terminals are provided only on the CJ1W PA205R Power Supply Units Battery life CS1 H FB CPU Units Battery Set CS1W BATO1 Battery life and replacement C
155. ultiplier word R 1st result word DOUBLE SIGNED BINARY 421 MULTIPLY UNSIGNED BINARY MUL TIPLY 422 Md Multiplicand word Mr Multiplier word Qe C R Result word Md 1st multiplicand word Mr 1st multiplier word R 1st result word DOUBLE UNSIGNED 423 BINARY UL MULTIPLY BCD MULTIPLY B 424 Md Multiplicand word Mr Multiplier word R Result word DOUBLE BCD MULTIPLY BL 425 BL Md 1st multiplicand word Mr 1st multiplier word R 1st result word SIGNED BINARY DIVIDE 430 R Result word Dd Dividend word Yes 10 a Instruction Support and Operand Restrictions Appendix D Instruction Function Symbol Operands Array required DOUBLE SIGNED BINARY Dd 1st dividend word DIVIDE Dr 1st divisor word R 1st result word Yes UNSIGNED BINARY 432 DIVIDE Dd Dividend word R Result word Dd 1st dividend word Dr 1st divisor word R 1st result word DOUBLE UNSIGNED 433 BINARY DIVIDE 5 N BCD DIVIDE B 434 Dd Dividend word or R Result word Dd 1st dividend word Dr 1st divisor word R 1st result word DOUBLE BCD DIVIDE 435 Ye D de Conversion Instructions ks Operands Array code reduired BOD TO BINARY TE R Result word se DOUBLE BCD TO DOU BINL S 1st source word EN BLE BINARY BINL R 1st result word Zu mid R Result word a BINARY TO BCD a DOUBLE BINARY TO
156. variables and tables of instructions support and operand restrictions N WARNING Failure to read and understand the information provided in this manual may result in per sonal injury or death damage to the product or product failure Please read each section in its entirety and be sure you understand the information provided in the section and related sections before attempting any of the procedures or operations given PRECAUTIONS This section provides general precautions for using the CX Programmer IEC The information contained in this section is important for the safe and reliable application of the CX Programmer IEC You must read this section and understand the information contained before attempting to set up or operate the CX Programmer IEC 1 intended Audience anr ren be ES GE Re Sa GE RE n AR EE xii 2 General PECON e rane RES DE DEE a A e xii 3 Salely Precaulions fa e RS bebe BED Bw ER E a ara xii 4 Application Precautionsz ersehen xiii 5 Installation Precaution eee XV X Intended Audience 1 2 3 xii Intended Audience This manual is intended for the following personnel who must also have knowledge of electrical systems an electrical engineer or the equivalent e Personnel in charge of installing FA systems e Personnel in charge of designing FA systems e Personnel in charge of managing FA systems and facilities General Precautions N WARNING The user must operate the product accor
157. when connecting through a Controller Link Support Board PCI Card or SYSMAC LINK Support Board PCI Card 1 1 3 Files Created with CX Programmer IEC Project Files cxi Projects created in CX Programmer IEC contain all of the program related data such as function block definitions and programs with instances The data is stored as a file with a cxi filename extension The following diagram shows the contents of a project The function block def initions are created at the same directory level as the program within the rele vant PLC directory Project file cxi PLC1 Global symbol table Otable PLC Setup PLC memory table Program withrung comments Localsymbol table Section 1 with instances As Section 2 with instances END section with instances lt 4 Function block definitions i FunctionBlock1 Each function block can be stored in a separate definition file cxf FunctionBlock2 Instances created in program Eur sections Introducing the CX Programmer IEC Section 1 1 Note Project files created with non lEG CX Programmer cxp can be read imported but cannot be saved After importing a file the CX Programmer IEC functions can be used if the Device Type is changed to one that supports function blocks Once the Device Type has been changed existing program rungs can be copied and pasted function blocks can be created in the ladder programming language and the data can be saved as
158. word FERA XFRB BLOCK XFER TRANSFER XFER N Number of words S 1st source word D 1st destination word ep OT 5 N 9 Un Instruction Support and Operand Restrictions Appendix D Function Symbol Operands Array code reduired BLOCK SET SET er BSET St Starting word E End word Yes DATA EXCHANGE XCHG 073 E1 1st exchange word XCHG E2 Second exchange word DOUBLE DATA EXCHANGE XCGL 562 E1 1st exchange word XCGL E2 Second exchange word E2 DIST Jos DIST Bs Destination base Yes address Of Offset DATA COLLECT COLL 081 COLL Bs Source base address Yes MOVE TO MOVR 560 Not supported in func S Source desired word D Destination word REGISTER MOVR tion blocks orbit D Destination Index Reg ister MOVE TIMER COUNTER MOVRW 561 Not supported in func S Source desired TC PV TO REGISTER MOVRW tion blocks number D Destination Index Reg ister Instruction SINGLE WORD DISTRIB UTE di Data Shift Instructions Array eu required SHIFT REGISTER SFT 010 St Starting word E End word Yes Operands IE ep T ep REVERSIBLE SHIFT REG SFTR 084 C Control word ISTER SFTR St Starting word E End word 96 gt D 5 2 x w Instruction Support and Operand Restrictions Instruction Function Symbol Operands Array code required ASYNCHRONOUS SHIFT REGISTER C Control word St Starting word E End wor
159. y of the addresses used in the user program an error will occur when compiling This error will also occur when a program is downloaded edited online or checked by the user a PLC Compiling PLC Program Name NewPLC1 NewProgram1 Section Name Section1 ERROR Step at rung 0 0 0 Address W0 00 is reserved for Function Block use ERROR Step at rung D 1 0 Address W001 is reserved for Function Block use ERROR Step at rung 0 2 0 Address W3 00 is reserved for Function Block use Work Area Addresses used in the user program overlap with the instance areas ERROR Step at rung 0 3 0 Address W5 00 is reserved for Function Block use ERROR Step at rung 0 4 0 Address W3 01 is reserved for Function Block use ERROR Step at rung 0 5 0 Address W2 0D is reserved for Function Block use ERROR Step at rung D 6 0 Address W100 01 is reserved for Function Block use Section Name END NewProgram1 7 errors 0 warnings 4 41 IP Compile A Find Report Transfer f gt If addresses are duplicated and an error occurs either change the function block instance areas or the addresses used in the user program 2 2 7 Checking Internal Address Allocations for Variables 1 2 3 40 The following procedure can be used to check the VO memory addresses internally allocated to variables Select View Symbols Global Select the instance in the global symbol
160. ys ON Flag P_On for the EN input condition and include the instructions input condition within the function block definition The timer s completion flag UP is turned OFF when input condition a 0 00 goes OFF e If the same instance containing a timer is used in multiple locations at the same time the timer will be duplicated Restrictions on Function Blocks Section 3 3 ST Programming Restrictions EM Current Bank Online Editing Restrictions Error related Restrictions Programming Console Displays e Only the following statements and operators are supported e Assignment statements e Selection statements CASE and IF statements e Iteration statements FOR WHILE and REPEAT statements e Arithmetic operators e Logical operators e Comparison operators e Comments e The TIMER and COUNTER data types cannot be used e Use parentheses to indicate the priority of arithmetic operations Example D A B C e Tabs and spaces can be used to indent text The EM current bank function cannot be used The EM bank number must be specified in all EM Area addresses The following online editing operations cannot be performed on the user pro gram in the CPU Unit e Changing or deleting function block definitions variable table or algo rithm e Inserting instances or changing instance names Note The instance s I O parameters can be changed instances can be deleted and instructions outside of an instance can be ch

Download Pdf Manuals

image

Related Search

Related Contents

BT-DRF-02  このリリースのPDFファイル  Samsung SL-C480W Manual de Usuario  Outdoor unit - Air to water split  C336ZC1 12x MPX PTZ Camera Instructional Manual  DU7544 DU7546 DU7549 Du7580 DU7582 DU7585  Atlantis Land A04-VGA-ET02  データポートF 取扱説明書(PDF)  

Copyright © All rights reserved.
Failed to retrieve file