Home

NJ-series CPU Unit Software User`s Manual

image

Contents

1. DeviceNet Unit 10 6 NJ series CPU Unit Software User s Manual W501 10 Communications Setup 10 3 Connection Configurations between Controllers and between Controllers and Slaves This section shows the connection configurations that are used between Controllers and between Con trollers and slaves 10 3 1 Connection Configurations between Controllers i EtherNet IP Refer to the NJU series CPU Unit Built in EtherNet IP Port User s Manual Cat No W506 for details Tag Data Links You can create tag data links between NJ series CPU Units on an EtherNet IP network EtherNet IP SOARS pue S19 01 U0D U3 M Q pue s19 01 U0D SJ9 O1 UOD UBOMIEQG SUOITeINBYUOD UONOBUUOD g 04 usemjeq SuoI eiNbiyUoD UONIBUUO4 04 Pa C Message communications You can send CIP messages from the user program AHE LE TLE aem ema Sending Mail You can send e mails to specified email addresses when the specified conditions are met TET NJ series CPU Unit Software User s Manual W501 10 7 10 Communications Setup Sending and Receiving Files You can send and receive files on the SD Memory Card that is inserted in the NJ series CPU Unit from an FTP client application Socket Services You can directly use TCP or UDP from the user program to send and receive any data with remote nodes between a host computer and the Controller or
2. A 43 A 73 restore dalene R ee catoeanocate 9 57 present values of battery backup memory 9 57 Retain Falten e A 29 A 52 Retention Failure Flag ccccseeceeeeeeeeeeeeeeeeees A 29 A 52 return values cc csccstscccosacacsactacederieannedessacaanecancenes 6 20 6 21 RUN MOJE oa e e ee 2 17 8 4 RUN ODU ne a tena eed a S 9 6 S Saving Packet Data File ccccesseeeeeeeeeeeees A 37 A 67 SD Memory Card exclusive Control Of ACCESS cseeeeeeeseeeeeeeeeeeeees 9 15 Seda gnos IS osa as 9 14 SD Memory Card Access Flag 06 9 13 A 28 A 51 SD Memory Card Error Flag s0seeeeeeseeees 9 13 A 50 SD Memory Card Life Warning Flag 9 13 A 28 A 51 SD Memory Card Power Interruption Flag 9 13 A 28 A 51 SD Memory Card Ready Flag 0 9 13 A 28 A 50 SD Memory Card Setting cccccssceeccsseseeeeesseeeeeeeees 4 4 SD Memory Card Write Protected Flag 9 13 A 28 A 50 SD Memory Cards file operations from the Sysmac Studio 9 13 life Expiration detection cccccccesseeeeeeeeeeeeeeeeeees 9 13 operation instructions ccceeeceseeeeeeeeeeeeeeeeeeeaeeees 9 12 ODCIAONS corpu srira aae 9 10 SpeciNcCatonS 22 ee ee 9 11 Security SONG sirp a R 4 5 semi user defined variables cccceseeceeeseeeeeeees 2 5 6 27 Index 6 sequence control and motion control c ceceeees 2 14 SEQUENCE control SYSTEM
3. cccceeeeeeseeeeeeeeeeeeneeeesaeees 2 14 Serial Communications Unit 0 Port 1 2 Settings Changing PC S sec neee aaa renee oe ater hae A 32 A 59 Serial Communications Units 1 to 15 Port 1 2 Settings Changing Flags ccccsseeeeeeceeeeeeeeeeeeeeesaeees A 32 A 59 senal DS cranar nana cs ees 9 19 9 20 Servo Drives Signal processing emulation cceeeeeseeeeeeeeeeeeeees 7 6 Settings for All Units sc scisinssconnccntisick naan dediunsieupdceataerundeeness 4 9 Settings for Exclusive Control of Variables in Tasks cccccceceesceseeceseeeeeeeeeeeeesaneass 4 7 5 15 simulation depugging sarsie ane nme ine eee ee ten mare eee eer 7 5 Partial SiIMUlatiOnm senna 7 4 SCC oenn a a a wists 7 4 starting and Stopping ss sssssssssssserrresrrresrrrerrrrerrrrsn 7 4 simulation programS ccccceecceceeceeceeeeeeeeeeesaeeeeeseeeeesaes 7 3 Simulator and physical CPU Unit ee ceeeeeees 7 3 Slave Application Error cccccccssseeeeeeseeeeeeens A 35 A 64 SWE ENO aeran a a a eaessessiacns A 34 A 62 Slave Error Table senere a aei andas A 34 A 62 Slave Initialization Error eccone A 35 A 64 Slave Node Address Duplicated Error A 35 A 64 Special I O Unit Initializing Flags 9 8 A 32 A 57 Special I O Unit Restart Bits 9 9 A 32 A 58 Special Units se rsccntee aae oe dae aeawh tured 4 9 9 8 IIIA SCUINGS ersi 4 11 SPOCINCAM ONS accdvravetares a 1 6 general e
4. An error was e The power supply to the Con detected in the memory check of the Setup Area for CPU Bus Units The IP address table settings are incorrect The send destina tion node is not known The FINS TCP con nection table is incorrect NJ series CPU Unit Software User s Manual W501 troller was interrupted or com munications with the Sysmac Studio were disconnected while downloading the CPU Bus Unit Settings The IP address conversion method is set to the combined method or the IP address table method but the IP address table settings are incorrect The send destination node was not found when a FINS mes sage was sent The power supply to the Con troller was interrupted or com munications with the Sysmac Studio were disconnected while downloading the FINS TCP connection table ELT E ATLL LP LL e TLD n 12 15 ol tn N Oo ea D o gt oO Oo 5 JqEL 10113 c g l 12 Troubleshooting p Level O 80100000 hex 80110000 hex 80120000 hex 12 16 Packet Dis carded Packet Dis carded Packet Dis carded One or more pack ets were discarded One or more pack ets were discarded One or more pack ets were discarded e A FINS response addressed to page 12 33 the CPU Unit was received The send designation Unit for the FINS response does not exist An attempt was made to senda y page 12 34 FINS response with ov
5. CPU Expansion Racks vy CPU v CJiW 0D232 Transistor Output Unit Rack 0 v Chi_Out Chi_Out00 Chi_Outi0 Chi_Out1i Chi_Outi2 Ch1_Out13 Chi_Outi4 Chi_Outi5 Description Output CH1 Output CH1 bit 00 Output CH1 bit 01 Output CH1 bit 02 Output CH1 bit 03 Output CH1 bit 04 Output CH1 bit 05 Output CH1 bit 06 Output CH1 bit 07 Output CH1 bit 08 Output CH1 bit 09 Output CH1 bit 10 Output CH1 bit 11 Output CH1 bit 12 Output CH1 bit 13 Output CH1 bit 14 Output CH1 bit 15 RW WORD RW BOOL RW BOOL RW BOOL RW BOOL RW BOOL RW BOOL RW BOOL RW BOOL RW BOOL RW BOOL RW BOOL RW BOOL RW BOOL RW BOOL RW BOOL RW BOOL R W Data Type Variable _ J01_Ch1_OuS i J01_Ch1_Out00 J01_Ch1_Out01 J01_Ch1_Out02 301_Chi_Out03 301_Chi_Out04 J01_Chi_Out05 J01_Chi_Out06 301_Chi_Out07 301_Chi_Out08 301_Chi_Out09 301_Chi_Out10 301_Chi_Outi1 J01_Chi_Outi2 301_Chi_Out13 4 301_Chi_Outi5 Automatically created Device Variables Device variables are automatically assigned to the I O ports for each slave or Unit These device variables are also automatically registered in the variable table specified in the Variable Type Column EN Additional Information We recommend that you set the device names i Selecting from the Registered Variables Select a registered variable in the I O Map You assign device variables using this method in the follow ing cases e To create slave configuration inform
6. assets and Protection for Protection of all project files The project file is coded by using Security preventing offline a password when the project is operating operations exported when an smc file is mistakes from the created Sysmac Studio Verification of operation Online operations are restricted by operation rights to prevent damage authority to equipment or injuries that may be caused by operating mistakes The user program cannot be executed without entering a user program e T e eat ID execution ID from the Sysmac Studio for the specific hardware CPU Prog Unit Storage type SD Memory Card 2 GB max SD Memory Card operation You can access SD Memory Cards from instructions in the user pro instructions gram SD Memory ETP server You can use FTP commands from an FTP client on an intranet to read Card ica and write large files in the SD Memory Card through EtherNet IP Applica g mencehons tion File operations from the Sysmac You can perform file operations for Controller files in the SD Memory Studio Card and read write general purpose document files on the computer SD Memory Card life expiration Notification of the expiration of the life of the SD Memory Card is pro detection vided in a system defined variable and event log When connected to an OMRON G5 series Servo Drive with built in EtherCAT communications Note You can use FINS message communications with NJ series Controllers However not all
7. NJ series CPU Unit Software User s Manual W501 Reference 3 2 Creating the EtherCAT Slave Configu ration 3 3 Creating the Unit Config uration Reference 2 2 1 Types of Variables 3 4 I O Ports and Device Variables 3 3 yun pue SARIS dU 10 S9ANPBIOIg JO M Q L E suoneinbijuoy 3 I O Ports Slave Configuration and Unit Configuration 3 4 Step 3 Create the axes and assigning them to the Servo Drives and encoder input slaves if motion control is used 1 Create the axes 2 Assign the axes to the Servo Drives and encoder input slaves in the EtherCAT configura tion Sysmac Studio Lz AS SFL LLP PI LES LLLP LLLP ltd SLOT SF LLG Axis Setup Servo Drives Axes Assigned a JA Axis variable a d Axis variable b gt a Axis variable c Encoder input slave Axis variable d gt o EtherCAT slave configuration Reference 3 5 Creating the Axes and Assigning Them to the Servo Drives Encoder Input Slaves NJ series CPU Unit Software User s Manual W501 3 I O Ports Slave Configuration and Unit Configuration 3 2 Creating the EtherCAT Slave Configuration This section describes how to create the EtherCAT Slave Configuration of an NJ series CPU Unit 3 2 1 Introduction Use the Sysmac Studio EtherCAT Editor to create the EtherCAT slave configuration that is detected as correct by the CPU Unit H N O fe gt te
8. Note You cannot use this system defined variable in the user program It is used only to access task status for data trac ing from the Sysmac Studio NJ series CPU Unit Software User s Manual W501 BOOL TIME TIME TIME UDINT BOOL UDINT TRUE or FALSE Depends on data type Depends on data type Depends on data type Depends on data type TRUE or FALSE Depends on data type Appendices page A 47 page A 48 page A 48 page A 48 page A 48 page A 49 page A 49 A 27 r oo lt m a D Q D y 5 D Q S oJ D o A106929 ON J9 04 U0D SOUOS PN EJBAC BU 104 SB QeUeA PeUulJep WaISAS g Y Appendices Functional Classification Errors _ErrSta Controller Error TRUE if there is a Controller error WORD 16 0000 to page A 49 16 COFO Status FALSE if there is no Controller error Note Do not use this variable in the user pro gram There may be a delay in updating it and concurrency problems in relation to the error status of the function mod ule Use this variable only to access status through communications from an external device Refer to information on the meanings of the error status bits at the end of this appendix for details _AlarmFlag User defined The bit corresponding to the event level is WORD 16 0000 to page A 50 Error Status TRUE while there is a user defined error Bits 16 00FF 00 to 07 correspond to user fault levels 1
9. Refer to 6 3 4 Attributes of Variables on setting variable attributes EN Additional Information If you define an external variable with the same name as a global variable in a function block it is defined automatically based on that global variable ENO e When ENO is FALSE the previous values of all other output variables are retained NJ series CPU Unit Software User s Manual W501 6 Programming Function Block Definitions and Instances A function block consists of a function block definition that is made in advance and instances that are then used in the actual programs All instances of a function block are based on the function block defi nition A function block definition consists of an algorithm and a local variable table Function Block Instance When you place an instance of a function block definition in a program or another function block the function block definition is treated as a part of that program or function block Function block definitions that are called from a program or another function block are called instances Every instance of a function block has an identifier known as an instance name associated with it and every instance uses memory You can create instances of a function block definition to process different I O data in the same way Program POU Instance name FB1_1 Function block definition name FB1 Variable Memory area i Memory area declarations reserved
10. Scope of Variables in Inline ST The scope of variables that you can access from inline ST is the same as the POU of the ladder dia gram that contains the inline ST Restrictions for Inline ST Item Description Number of inline ST boxes per rung 1 6 5 3 Structured Text Language p a u Oo D 3 3 5 re D c D Q D N The ST structured text language is a high level language code for industrial controls mainly PLCs defined by the IEC 61131 3 standard The standard control statements operators and functions make the ST language ideal for mathematical processing that is difficult to write in ladder diagrams The fea tures of ST are described below e Loop constructs and control constructs such as IF THEN ELSE are provided e You can write programs like high level languages such as C and you can include comments to make the program easy to read Determine TableNo FOR i 0 TO ItemNum DO IF MinNoli lt temBox i AND ltemBox i lt MaxNo i THEN Normal TableNoli ItemBox i e6benbue7 1x9 paunionus S 9 RangeDK i TRUE ELSIF ltemBox i gt MaxNo i THEN Upper TableNo i MaxNo i RangeOK i FALSE SE Lower TableNoli MinNo il RangeQK i FALSE END_ IF END_FOR NJ series CPU Unit Software User s Manual W501 6 71 6 Programming 6 72 Structure of ST ST code
11. j Variable Attributes According to Variable Type Attributes of Variables Attribute Specification Default Variable Name The variable name is used to identify the variable Data Tvpe The data type defines the format of the INT yP data that is stored in the variable If you want to handle a specific address e Not specified Not specified AT Specification for a CJ series Unit as a variable specify e Specify the address to assign to that variable Specify whether to retain the value of the Retain Value speci Non retain Reset variable in the following cases fied on the left is to initial value e When power is turned ON after a retained if there is a power interruption Battery Retain e N tain Ch e When the CPU Unit changes to RUN On Teta Ne naNge mode to initial value e When operation for a major fault level Controller error has occurred You can select to set or not set an initial Initial Value Depends on the value e Yas data type Refer to Initial value setting Specify the value of e None the section on initial the variable in the following cases and do values not specify the Retain attribute Initial Value e When power turned ON e When operating mode changes e When a major fault level Controller error occurs If the initial value is not set the value is not retained If you set the Constant attribute you can Specify making the set the initial value of the variable when it value a constant or not
12. CJ1W MD563 CJ1W B7A04 CJ1W B7A14 CJ1W B7A22 O oo I O refresh time per Unit us On CPU Rack On Expan sion Rack CJ1W AD041 V1 081 V1 24 36 CJ1W AD042 CJ1W DA021 041 08V 2400 060 36 CJ1W MAD42 2400 60 36 CJ1W CT021 54 0 81 CJ1W PH41U 80 When 120 When using expan using expan sion allocation sion allocation area 180 area 270 CJ1W V680C11 76 114 CJ1W V680C12 86 129 NJ series CPU Unit Software User s Manual W501 Appendices CPU Bus Units I O refresh time per Unit us Unit name On CPU Rack an EPEL sion Rack Serial Communications Units CJ1W SCU42 2 5 3 8 CJ1W SCU32 Add up to the Add up to the CJ1W SCU22 following maxi following maxi mum time mum time when a proto when a proto col macro is col macro is executed executed 0 1 x Number 0 15 x Num of refresh ber of refresh words words CJ1W DRM21 2 5 0 1 x 3 8 0 17 x Number of Number of allocated allocated words words The number of The number of allocated allocated words is the words is the total number of total number of words allo words allo cated to all the cated to all the slaves slaves DeviceNet Unit q User Program Execution Time The user program execution time depends on the specific instructions multiplied by the numbers of instructions used As a guideline instructions are divided into three groups and the number of instructions in each group is used for measurements
13. Description A function that automatically compares the information in the NJ series Controller with the information in the Sysmac Studio displays any differences and locations in a hierarchical form and can be used to synchronize the information A computer software application for setting programming debugging and trouble shooting NJ series Controllers It also provides operations for motion control and a Simulator System processing that is performed by the CPU Unit to perform I O refreshing and the user program execution within a task Exclusive control of variables between tasks data trace processing and other processing is performed Processing that is performed by the CPU Unit in unused time between task pro cessing The system service includes communications processing SD Memory Card access processing self diagnosis processing and other processing A variable for which all attributes are defined by the system and cannot be changed by the user An attribute that defines when a program is executed The interval at which the primary periodic task or a periodic task is executed One of the derivative data types It allows you to handle the same data as different data types The configuration information for the Units that are set on the Sysmac Studio This information tells what Unit models are connected to the CPU Unit and where they are connected To transfer data from the Controller to the Sysmac Studio with the synchro
14. Description This section provides an introduction to the NJ series Controllers and their features and gives the NJ series Controller specifications This section describes the variables and control systems of the CPU Unit and CPU Unit status This section describes how to use I O ports how to create the slave configuration and unit configuration and how to assign functions This section describes the initial settings of the function modules This section describes the task system and types of tasks This section describes programming including the programming languages and the variables and instructions that are used in programming This section describes simulation of Controller operation and how to use the results of simulation This section describes CPU Unit status This section describes the functionality provided by the CPU Unit This section describes how to go online with the CPU Unit and how to connect to other devices This section describes the procedures that are used to actually operate an NJ series Controller This section describes the event codes error confirmation methods and corrections for errors that can occur The appendices provide the CPU Unit specifications task execution times system defined variable lists data attribute lists CU series Unit memory information CJ series Unit memory allocation methods and data type conversion information Manual Configuration f NJ series CPU Unit M
15. NO lt O O m D 2 m x lt D O Cc O gt o ped p Cc 02 ped m oz D 2 m x lt D O a O m 3 D 02 A Precautions for Correct Use The above values when connected to the Simulator of the Sysmac Studio may contain more error in comparison to the times when connected to the physical Controller Use them as guide lines Always confirm operation while connected to the physical Controller to study the designs and before starting actual system operation NJ series CPU Unit Software User s Manual W501 5 25 5 Designing Tasks 5 3 Task Design Example and I O Response Times 5 3 5 26 1 This section provides information on estimating task execution times information on confirming system service monitoring settings an example of task designing and information on I O response times The primary periodic task and periodic tasks of an NJ series CPU Unit operate according to the speci fied task periods If the actual execution time exceeds the task period an error occurs This section uses an example that consists of one primary periodic task to describe estimation and appraisal methods Precautions for Safe Use The execution times in the physical Controller depends on the logic operations that are per formed in the user program the presence of communications commands and data links on whether data tracing is performed and on other factors Before st
16. O ma r D s m x O ad wn NJ series CPU Unit Software User s Manual W501 8 7 8 CPU Unit Status NJ series CPU Unit Software User s Manual W501 CPU Unit Functions EEE This section describes the functionality provided by the CPU Unit 9 1 Data Management Clock and Operating Functions 9 3 9 1 1 Clearing AllMEMON ici vee bo oe he Was Se A ow ee ed 9 3 Slee WlOCK Sg 2 3cisn mess eee Oe Ee eet bade eR ee oes haces MOS 9 3 T3 BUN OUPU 2 006 2246 e ee Geens Geta be ere Cee kere e Boeke bee eee 9 6 9 2 Management Functions for CJ series Units 000 cee ee eee 9 7 9 2 1 Based OWNS oeu hes a Oe eee on aee wae eae ete 9 7 92 2 SPeCCIaMWANS act 5 cee eee a eet he ee ee a eee ee Be ee 9 8 9 3 SD Memory Card Operations 2 00 es 9 10 9 3 1 SD Memory Card Operations 0 0 cee ee eee 9 10 9 3 2 Specifications of Supported SD Memory Cards Folders and Files 9 11 9 3 3 SD Memory Card Operation Instructions 0 0000 eee 9 12 O 3 4 FIP Semel ove oe oes boos Shed tok ese doss wi eee ese eee 9 12 9 3 5 File Operations from the Sysmac Studio 0 0c cence ees 9 13 9 3 6 SD Memory Card Life Expiration Detection 0000 eee 9 13 9 3 7 List of System defined Variables Related to SD Memory Cards 9 13 9 3 8 SD Memory Card Self diagnostic Functions 200005 9 14 9 3 9 Exclusive Control
17. Variables with Two Byte Alignments e g BOOL and WORD These variables are stored in memory with a two byte alignment Example Data type Memory Size is 1 bit Bytes Variable A First byte i First byte 1 Variable B First byte 2 Stored with a 2 byte alignment First byte 3 NJ series CPU Unit Software User s Manual W501 A 85 y N S Z D z D D 3 O lt gt O O D ot O 5 mp gt O Q o sainy uoleool y Aioweyy sjqeueA L Z Y Appendices Variables with Four Byte Alignments e g DWORD These variables are stored in memory with a four byte alignment The first byte is the first of four bytes in memory Therefore if a variable with a two byte alignment such as WORD data is inserted two bytes of unused memory will remain Example Memory Variable Table 1 Name Datatype Ni B word l Variable A Stored with a 4 byte alignment Variable B Stored with a 2 byte Firstbyte 5 i alignment First byte 6 a First byte 7 Eg eT Ze First byte 8 II yy Variable C Stored with a 4 byte alignment Variables with Eight Byte Alignments e g LWORD These variables are stored in memory with an eight byte alignment The first byte is the first of eight bytes in memory Therefore if a variable with a two byte alignment such as WORD data is inserted six bytes of unused memory will remain If a variabl
18. When a major fault level Controller error occurs the user program execution stops The NJ series Controllers can display user messages on an NJ series compatible NS series PT when a major fault level Controller error occurs You can set the display messages under the list of user defined events in the Event Setting Table on the Sysmac Studio NJ series CPU Unit Software User s Manual W501 9 53 uoewo u pue SIOZ pauy p sn sung POUIjep 19SF 7 9 6 P fo m lt 5 re O O 9 CPU Unit Functions Event Levels and Event Codes Range of corre sponding event Description code User defined Select from eight levels eros A Userfaut Levele 5001 t 10000 User aut Levers 10001 to 15000 user aut Levers 15001 1020000 User aut Levet5 20001 to 25000 User auttLevete 25001 to 20000 User aut Lever 80001 to 5000 User fault Level8 35001 to 40000 Low User defined Lowest User Information 40001 to 60000 The event type is user defined Information information User defined error levels are separate from Controller error levels Event classi Event level cate ae Level fication gory Precautions for Correct Use If you update the Event Setting Table and transfer it to the CPU Unit the event logs for user defined events still contain old information This can result in inconsistencies with the new Event Setting Table Program operations with caution i Related Instructions
19. You can specify a range for a data type in advance The data type can take only values that are in the specified range You can specify a range for any integer basic data type Programming is checked offline with the Sysmac Studio and when Program checks l instructions are executed Range specifications gt a I Se Tl Cc O T O N O O O zh O sed O gt NJ series CPU Unit Software User s Manual W501 A 9 Appendices Item NJ501 Absolute Positioning is performed for a target position that is specified with an positioning absolute value Sn see Relative Positioning is performed for a specified travel distance from the com p positioning mand current position control Interrupt Positioning is performed for a specified travel distance from the posi feeding tion where an interrupt input was received from an external input Velocity Velocity control is performed in Position Control Mode control Cyclic A velocity command is output each control period in Velocity Control synchronous Mode Single axis velocity control velocity control Single axis The torque of the motor is controlled Torque control torque control Starting cam A cam motion is performed using the specified cam table operation Motion control Single Ending cam The cam motion for the axis that is specified with the input parameter functions Axas operation is ended Starting gear A gear motion with t
20. ar month ME 2010 10 day houn min 10 23 59 59 123 utes seconds DT yearn month DT 2010 10 10 day houn min 23 59 59 123 utes seconds NJ series CPU Unit Software User s Manual W501 6 63 p A O e gt Q gt re m p D s Ue SUOD Jo SedAL Z y 9 6 Programming i Text Strings Text String Data Notation This is a string String Escape Character List Single byte dollar sign Single byte single quo tation mark R or r Carriage return Single byte double quo tation mark Direct character code specification two digit hexadeci mal number Remarks Enclose the string in single byte single quotation marks If you want to insert tabs line break codes or other special characters you can use a dollar sign as an escape character before them Refer to the following table You can also specify a string with O characters As in the following example a compiling error will occur if you specify any strings that span across multiple lines strVar ABC DEF Meaning Single byte dollar sign character code 0x24 Single byte single quotation mark character code 0x27 Moves the cursor to the next line LF control character line feed character code 0x0A Moves the cursor to the next line NL control character vertical tab character code 0x0B Moves the cursor to the next
21. gt g m gt V fes lt p O re eQ c fe O m EtherCAT master EtherCAT EtherCAT EtherCAT EtherCAT slave slave slave Conn Slave configuration E Create the configuration with the EtherCAT Editor of the Sysmac Studio The I O ports are automatically registered for the slaves in the configuration Assign device variables to the I O ports You can specify device variables in the programs to access the slaves uoHONpOU L Z 3 2 2 Creating the EtherCAT Slave Configuration You can use either of the following two methods to create the EtherCAT slave configuration fl Method 1 Creating the Slave Configuration Offline Procedure to Open the EtherCAT Editor Tab Page 1 Double click EtherCAT under Configurations and Setup in the Multiview Explorer Or right click EtherCAT under Configurations and Setup and select Edit from the menu The EtherCAT Editor Tab Page appears in the Configurations and Setup Layer Registering Slaves Procedure to Register Slaves in the Topology Display 1 Drag a slave from the Toolbox to the master in the Topology Display The slave is added under the master 2 In the same as in step 1 drag a slave from the Toolbox to the slave to connect it to in the Topol ogy Display The slave is added under the previous slave NJ series CPU Unit Software User s Manual W501 3 5 3 I O Ports Slave Configuration and Unit Conf
22. iodi er and prior in processing contents periodic periodic l task task ity 18 peri odic tasks Not per formed I O refresh processing I O is refreshed for CJ series Units Performed Performed Basic I O Units Special I O Units and CPU Bus Units and EtherCAT slaves User program execution e Programs assigned to tasks are exe Performed Performed Performed cuted in the order that they are assigned Motion control processing Motion control commands from the Performed Not per Not per user program are executed formed formed Motion control outputs are processed Common System com Variable refresh processing if there Performed Performed Performed processing mon pro are accessing tasks is performed time cessing 1 Motion input processing Data trace processing System com Variable refresh processing if there Performed Performed Performed mon pro are refreshing tasks is performed cessing 2 Variable access processing external to the Controller to ensure concurrency with task execution System over Other system common processing Performed Performed Performed head time Guidelines are provided below for calculating the various processing times A 16 NJ series CPU Unit Software User s Manual W501 Appendices i I O Refresh Processing Time The I O refresh processing time is the total of the following times I O refresh processing time A I O refresh over
23. 12 Troubleshooting Event name Meaning Source Error attributes Effects System defined variables Cause and correction Attached information Precautions Remarks Event name Meaning Source Error attributes Effects System defined variables Cause and correction Attached information Precautions Remarks 12 24 Illegal User Program Controller Configurations and Setup 10250000 hex The user program or Controller Configurations and Setup is corrupted PLC Function Module Source details None Level Major fault Recovery Cycle the power supply or reset the Controller Illegal data was transferred for the Download the user program or Con None troller Configurations and Setup again Or clear all of memory If this Detection timing At download power ON or Controller reset Log category System user program or Controller Configura tions and Setup None error persists replace the CPU Unit Non volatile memory is deteriorating or has failed None Safe Mode 40160000 hex Source details None Detection At power ON or timing Controller reset Cycle the power The Controller started in Safe Mode PLC Function Module Level Log category System supply or reset the Controller Major fault Recovery Variable Data type All outputs are stopped Name None re Assumed cause Correction Prevention The power supply was turned ON to the Controller w
24. Card is not cor 3 An error was Not lit Flashes Observa Use file operations If a cor detected during during tion in the Sysmac Stu rupted file the file system restore dio or insert the SD is detected check and the operation Memory Card into an attempt file system was Not lit after the computer to is made to automatically check whether any restore the by the restore operation 4 The SD Mem ory Card failed Not lit lit Observa Replace the SD haan Memory Card Precautions for Correct Use Never interrupt the power supply to the Controller during SD Memory Card access That includes when SD Memory Card self diagnosis at startup is enabled An attempt is made by the SD Mem ory Card restoration function to restore any corrupted files If the restore fails these files may be deleted automatically at startup Precautions for Safe Use If the recovery function is activated at startup time is required to enter RUN mode During that time outputs will be OFF and external communications are not performed Use the RUN output on the Power Supply Unit for example to implement fail safe circuits so that external devices do not operate incorrectly P rf wn UO D 3 O lt O D Q O D D D ma O D 9 3 9 Exclusive Control of Access to the SD Memory Card Access to files on the SD Memory Card is possible with the following methods e FTP server e SD Memory Card operation instru
25. Check the wiring by performing forced refreshing with user specified values from the I O Map or Ladder Editor ff MC Test Run Open the MC Test Run Dialog Box Change the CPU Unit to PROGRAM mode Monitor input signals on the display to check the wiring NON Jog the axis from the display New Project axis selection iC ASDUOTOK Nad lhg Axis ready to execute Axis disabled Standstill Discrete motion A E Stopping Error stopping V amp Axis Settings 37 MC_Axis000 0 Event LevellSourcel Message Namel Axes Group Settings amp Cam Data Settings gt Event Settings E Task Settings F7 Data Trace Settings gt Programming Motion error list Test Run Stopping Drive status Command current position pulse Positive limit input Actual current position pulse Negative limit input OFF Command current a o MOG Immediate stop input COFF current velocity EE pulse s Home proximity input OFF Absolute positioning Target velocity 1000000 IE pcceleraton TM 2 52 11 10 NJ series CPU Unit Software User s Manual W501 11 Example of Actual Application Procedures i Manual Operation Change the CPU Unit to RUN mode e Turning the Servo ON and OFF Execute the MC_Power motion control instruction e Jogging Execute the MC_MoveJog motion control instruction i Homing Homing Execute the MC_Home instruction i Actual Operation Select Operation Mode RUN Mode from the Controlle
26. Height of Box1 Height of Box2 Height of Box3 Structure Variable Box1 Structure Variable Box2 Structure Variable Box3 Member Member Member Height Width Depth When a structure is used for a variable in an instruction it is necessary to select a structure for the input parameter output parameter or in out parameter and register the variable Example Communications Instructions NJ series CPU Unit Software User s Manual W501 6 Programming Expressing Structure Variables and Structure Variable Members Specifying Members The individual pieces of data that make up a structure are called members You can express indi vidual members of a structure by putting a period after the variable name that represents the entire structure followed by the member name that you want to access You can even have a structure that is the member of another structure Example abc x Member x of structure variable abc abc Order z Member z of member structure variable Order of structure variable abc Specifying the Structure The structure represents all members that make up the structure A structure is expressed by the name of the structure variable In the example above you would write abc Creating a Structure 1 Create a structure data type in the Data Type Table Specify the data type name members and the data type p rf S Z D ea D N 2 Specify the member name and the structure data type from above as
27. Indicators System defined variables Cause and cor rection Attached information Precautions Remarks Gives the name of the error Gives the code of the error Gives a short description of the error Tells when the error is detected Detection timing Gives details on the source of the error Gives the source of the error Source details Tells the level of Gives the recov Tells which log influence on con ery method 2 the error is saved trol in 3 Recovery Log category Provides special information on the operation that results from the error Tells what will hap pen to execution of the user pro User program Operation gram 4 Gives the status of the built in EtherNet IP port and built in EtherCAT port indicators Indicator status is given only for errors in the EtherCAT Master Function Module and the EtherNet IP Function Module Data type Name Lists the variable names data types and meanings for system defined variables that provide direct error notification that are directly affected by the error or that contain settings that cause the error Correction Prevention Lists the possible causes corrections and preventive measures for the error Variable Assumed cause This is the attached information that is displayed by the Sysmac Studio or an NS series PT Provides precautions restrictions and supplemental information 1 One of the following Major fault M
28. Soll suods y 3ndino pue indu wa skS p E sS The Controller makes a response in the following I O response time Minimum I O response time Priority 16 periodic task period Example Controlling Unit A and Unit B with the Priority 16 Periodic Task Primary periodic task Priority 16 periodic task Note The above diagram shows only one input and one output NJ series CPU Unit Software User s Manual W501 5 29 5 Designing Tasks However the I O response time may be as follows depending on the timing of the input from the Unit i Sequence Control with EtherCAT Slaves For EtherCAT slaves EtherCAT communications with external devices is performed for I O refreshing in the primary periodic task The I O response times that include EtherCAT communications times are given below Performing Control with the Programs in the Primary Periodic Task The Controller makes a response in the following I O response time Minimum I O response time Primary period process data communications cycle Example Controlling EtherCAT Input Slave A and EtherCAT Output Slave B with the Primary Peri odic Task Process data communications period Primary periodic task Priority 16 periodic task Primary period t Note The above diagram shows only one input and one output However the I O response time may be as follows depending on the timing of the input from the slave Maximum I O response time Primary peri
29. USINT page A 53 BOOL FALSE or page A 53 TRUE Indicates whether there is an available inter nal logical port TRUE when an internal logical port is avail able Otherwise FALSE _FINSTCPConnSta FINS TCP Con Gives the FINS TCP connection status WORD 16 0000 to page A 53 nection Status 16 FFFF A 3 2 PLC Function Module Category Name _PLC Functional Classification Debugging Variable name Member ajaa STA IsStart lsComplete Is Trigger ParamErr Trace Busy Flag Trace Completed Flag Trace Trigger Monitor Flag Trace Parameter Error Flag BOOL TRUE or FALSE TRUE when a trace starts page A 54 Note You cannot use this system defined variable in the user program It is used only to monitor the status of data trac ing from the Sysmac Studio BOOL TRUE or FALSE TRUE when a trace is completed page A 54 Note You cannot use this system defined variable in the user program It is used only to monitor the status of data trac ing from the Sysmac Studio BOOL TRUE or FALSE TRUE when the trigger condition is met page A 54 FALSE when the next trace starts Note You cannot use this system defined variable in the user program It is used only to monitor the status of data trac ing from the Sysmac Studio BOOL TRUE or FALSE TRUE when a trace starts but there is an error in the trace settings page A 55 FALSE when the settings are normal Note You cannot use
30. Value of variable Global variable X is not read Accessing task Task B Accessing task Accessing task Task B Task B Task period of task B This will allow you to maintain the concurrency of the values of global variables within the tasks with out performing any special programming If an instruction that writes the value to a global variable is used in the accessing task an error will occur when you check the program on the Sysmac Studio Restrictions e Only one refreshing task can be set for each global variable If it is necessary to write a global variable from more than one task use the task exclusive control instructions described below to ensure concurrency e f you specify a refreshing task for a structure or union variable you must specify only one refresh ing task for the entire structure or union variable You cannot specify a different refreshing task for different structure or union members e If you specify a refreshing task for an array variable you must specify only one refreshing task for the entire array variable You cannot specify a different refreshing task for different array elements Sysmac Studio Setting Procedure Set the global variables for which to specify refreshing tasks and set the accessing tasks in the Set tings for Exclusive Control of Variables in Tasks on the Task Settings Tab Page on the Sysmac Stu dio For details refer to Settings for Exclusive Control
31. Variable name _EC_NetTopologyErr Meaning Network Configuration Error Global local Global Function TRUE if there is a network configuration error too many devices connected or ring connection Data type BOOL Range of values TRUE or FALSE R W access R Retained Not retained Network Publish Published Usage in user program Possible Related instruc Reset EtherCAT Controller Error tions e ResetECError Variable name _EC_PDCommErr Meaning Process Data Communications Error Global local Global Function TRUE if there is an unexpected slave disconnection or connection or if a slave WDT error is detected during pro cess data communications Data type BOOL Range of values TRUE or FALSE Usage in user program Possible Related instruc Reset EtherCAT Controller Error tions e ResetECError Variable name _EC_PDTimeoutErr Meaning Process Data Reception Timeout Error Global local Global Function TRUE if a timeout occurs while receiving process data Data type BOOL Range of values TRUE or FALSE Usage in user program Possible Related instruc Reset EtherCAT Controller Error tions e ResetECError Variable name _EC_PDSendErr Meaning Process Data Transmission Error Global local Global Function TRUE if there is a process data transmission error cannot send within the process data communications period or transmission jitter is over the limit Data type BOOL Range of values TRUE or FALSE Usage in user program P
32. You can display both the execu tion time and the actual process ing time Checking wiring Not supported e Forced refreshing e Changing the values of variables Verification of connections with Not supported e Data links other Controllers and host applica tions Sysmac Studio online operations The functions are the same e Monitoring present values of vari ables e Operating status displays e Data tracing 7 1 2 Simulation Programs uoHeINWIS L Z A simulation program is a program or a program section of a ladder diagram that you can execute only on the Simulator Simulation programs are treated as normal programs by the Simulator Assign them to a task to execute them 7 Program Sections Debug 9 Function Blocks v Data S Data Types bar Global Variables v Y Fa Tasks v gt Oe PrimaryTask bar Global Variables Y Fa Tasks gt Be PrimaryTask HUN NdO ledIskyg aU PUB JOYeINWIS 9y UBEMjeq SedUdJEIG L L Z NJ series CPU Unit Software User s Manual W501 7 3 7 Simulation Transferring Projects to the Physical CPU Unit and Operation 7 1 3 Executing a Simulation i Starting and Stopping Simulation Select Simulation Pane from the View Menu on the Sysmac Studio to open the Simulation Pane Click the RUN Button to transfer the program and execute the simulation When the simulation starts the Editor and other Sysmac Studio panes are the same as when connected to the physical CPU Uni
33. _EIP_MacAdrErr MAC Address Error Partial EtherNet IP tions Port EIP _LanHwErr Communications fault level Error Error Controller Error _EIP_EtnCfgErr Basic Ethernet Set ting Error _EIP_IPAdrCfgErr TCP IP Basic Set ting Error _EIP_IPAdrDupErr IP Address Duplica tion Error _EIP_BootpErr BOOTP Server Error _EIP_IPRTblIErr TCP IP Advanced Minor fault Setting Error level _EIP_CipErr CIP Commu _EIP_IdentityErr Identity Error Minor fault nications _EIP_TDLinkCfgErr Tag Data Link Set eve Error ting Error _EIP_TDLinkOpnErr Tag Data Link Con nection Failed _EIP_TDLinkErr Tag Data Link Com munications Error _EIP_TagAdrErr Tag Name Resolu tion Error _EIP_MultiSwONErr Multiple Switches Observa ON Error tion _EIP_TcpAp TCP Applica _EIP_TcpAppCfgErr TCP IP Setting Error Minor fault pErr tion Commu EIP_NTPSrvErr NTP Server Connec Vel nications tion Error Error _EIP_DNSSrvErr DNS Server Con nection Error T wo w lt m mp D 3 Q D h 5 D Q S D z D o MiobayeD ainpoy uooUN dIAON1943 9 V dlg swen NJ series CPU Unit Software User s Manual W501 A 41 Appendices EN Additional Information Relationships between the Target Node Information Tables Registered Target Node Information Valid only when _EIP_RegTargetSiais Normal Target Node Information Valid only when _EIP_EstbTargetSta Registered Target Node Information Valid only when _EIP_RegTa
34. ported ported ported ported ported ported ported ported Input vari Sup Sup Not sup Sup Sup Sup Not sup Sup able ported ported ported ported ported ported ported ported Function Output Sup Sup Not sup Sup Not sup Not sup Not sup Not sup blocks variables ported ported ported ported ported ported ported ported In out Sup Sup Not sup Not sup Not sup Sup Not sup Not sup variables ported ported ported ported ported ported ported ported External Not sup Not sup Not sup Not sup Not sup Sup Not sup Not sup variables ported ported ported ported ported ported ported ported Internal Sup Sup Not sup Not sup Sup Sup Not sup Not sup variables ported ported ported ported ported ported ported ported Input vari Sup Sup Not sup Not sup Sup Sup Not sup Not sup ables ported ported ported ported ported ported ported ported F nctions Output Sup Sup Not sup Not sup Not sup Not sup Not sup Not sup variable ported ported ported ported ported ported ported ported In out Sup Sup Not sup Not sup Not sup Sup Not sup Not sup variables ported ported ported ported ported ported ported ported External Not sup Not sup Not sup Not sup Not sup Sup Not sup Not sup variables ported ported ported ported ported ported ported ported 6 3 5 Data Types
35. special handling may apply See www dtsc ca gov hazardouswaste perchlorate e The CPU Unit contains a primary lithium battery with a perchlorate content of 6 ppb or higher Place the above information on the individual boxes and shipping boxes when shipping finished products that contain a CPU Unit to the State of California USA NJ series CPU Unit Software User s Manual W501 33 Precautions for Correct Use Precautions for Correct Use 34 i Storage Mounting and Wiring e Do not operate or store the Controller in the following locations Operation may stop or malfunctions may occur e Locations subject to direct sunlight e Locations subject to temperatures or humidity outside the range specified in the specifications e Locations subject to condensation as the result of severe changes in temperature e Locations subject to corrosive or flammable gases e Locations subject to dust especially iron dust or salts e Locations subject to exposure to water oil or chemicals e Locations subject to shock or vibration Take appropriate and sufficient countermeasures when installing the Controller in the following loca tions e Locations subject to strong high frequency noise e Locations subject to static electricity or other forms of noise e Locations subject to strong electromagnetic fields e Locations subject to possible exposure to radioactivity e Locations close to power lines Before touching a Unit be sure to first touc
36. tn N Oo ea D o gt oO Oo 5 correction A FINS response was received in Correct the IP address table settings Make sure that the IP address table which DNA was the local network settings are correct but DA1 was not the local node 2 AFINS command or response Correct the FINS message at the Check the FINS message at the was received in which the hub source so that the hub network source to be sure that the hub net network address specification address specification DNA is not work address specification DNA is not DNA was greater than or equal to greater than or equal to 80 hex greater than or equal to 80 hex 80 hex 3 There is insufficient space inthe Reduce the frequency of sending Keep the frequency of sending FINS internal buffer FINS messages at the source messages as low as possible ren 4 A FINS command that does not Correct the FINS command at the Set the FINS commands at the L have the minimum command source so that it has at least the mini sources so that they have at least the m length was received mum command length minimum command length a 5 A FINS command that exceeded Correct the FINS command at the Set the FINS commands at the J the maximum command length source so that it does not exceed the sources so that they do not exceed E was received maximum command length the maximum command length iel 6 Sending packets failed If the destination node is not in the Confirm that the d
37. 9 CPU Unit Functions 9 1 Data Management Clock and Operating Functions This section describes the data management clock and operating functions 9 1 1 Clearing All Memory You can initialize the user program Controller Configurations and Setup and variables in the CPU Unit to the defaults from the Sysmac Studio This is called the Clear All Memory operation H Precautions for Correct Use e The Clear All Memory operation can be performed only in PROGRAM mode e You cannot execute the Clear All Memory operation when write protection is set in the security functions e Do not turn OFF the power supply to the Controller during the Clear All Memory operation After you clear the memory the CPU Unit operates in the same way as immediately after you create the system configuration with the CPU Unit in the factory default condition The absolute encoder home offset is not cleared Operations from the Sysmac Studio Connect the Sysmac Studio to the CPU Unit online and select Clear All Memory from the Control ler Menu 9 1 2 Clock i Introduction A clock RTC is built into the CPU Unit The clock data from this clock is used for timestamps in the event logs and for the time and date of files that are created on the SD Memory Card O I ak g D D D 5 D Q D 3 D 5 gt O O r D 5 2 O 5 D D 5 ro Tl c 5 O 5 D The following functions are supported e Reading writi
38. A user with Administrator rights y page 12 27 Cleared cleared cleared all of the memory 900C0000 hex Event Log The event log was The event log was cleared by V page 12 27 Cleared cleared the user Power The power supply e The power supply was turned y page 12 28 Turned ON was turned ON ON Power Inter The power supply e The power supply was inter y page 12 28 rupted was interrupted rupted Operation Operation was e A command to start operation y page 12 28 Started started was received Operation Operation was e A command to stop operation y page 12 29 Stopped stopped was received Reset Exe A reset was exe e A reset command was y page 12 29 cuted cuted received User Pro gram Execu tion ID Write All Controller Errors Cleared Forced Refreshing Cleared The user program execution ID was set or changed in the CPU Unit All current errors were cleared e A user with Administrator rights changed the user program exe cution ID that is set in the CPU Unit e The user cleared all current errors BERRI o E e Clearing a forced e Clearing a forced refreshing y page 12 30 value was specified by the user refreshing value was specified weal Event code Assumed cause 14010000 hex 34100000 hex 34110000 hex 34130000 hex CPU Bus Unit Setup Area Error IP Address Table Setting Error Unknown Destination Node FINS TCP Connection Table Setting Error ae mae
39. CUB _INRESOTM cece cceeeeeeceeeeeseeeeeeeees 9 8 A 31 A 56 IB OUNI O eenn A A 32 A 57 CJB_MaxRackNo ou ccecceceecceeeeeeeeseeeeeseeees A 31 A 55 CJB IWaxSIOUN 6 ennei siainen eSa A 31 A 55 CJB MSMEM Se raea i A 31 A 56 _CJB_SCU00P1ChgSta to _CJB_SCUOOP2ChgSta enea A 32 _CJB_SCUO00P1ChgSta _CJB_SCUOOP2ChgSta to _CJB_SCU15P1ChgSta CJB SCUTSP2ChG Sia nnrir A 59 _CJB_SCU15P1ChgSta to CIB SCUTSP2CNG SI veni e a G A 32 _CJB_SIOOQ0O0lnitSta to CIB SIO95INtSta snc n 9 8 A 32 A 57 _CJB_SIO00Restart to _CJUB_SlOQ95Restart 0 9 9 A 32 A 58 GIB PIE STA 2a eae e A 31 A 56 CJ series Unit configuration ccceeeecseeeeeeeeeeeeeeeeeees 1 4 CJ series Units accessing Basic I O Units 0 0 0 eeeeeeeeeeeeeeees 2 10 accessing Special Units c cc eceeeeeeeeeeetneeeeeeeees 2 10 iInteMacinG on ithe heath os 2 10 Clearing All Memory 00 ccecceecceseseseeeeeeeeeasseeeeeeseaeaaes 9 3 CIOCK stricta neea eet et ea ieee sete cha 9 3 Clock dala Ao hart ctns tego tele acai ea ee net et 9 4 Common Error Status a an A 33 A 59 COMMON Variable ccecceceecceeseeeeeeeeeeeseeeeeenes A 33 A 60 COMMIMUNICAUN OMS e e e hee inland oc 10 3 Communications Controller Error A 34 A 39 A 62 A 69 Communications Error Slave Table A 35 A 65 Communications Port Error A 34 A 38 A 61 A 68 Condition Flags ericeri ae cease 6 104 connecting MIMGS seres 6 66 COMSTAINS einn a A 6 6
40. Color is defined as the data type of an enumeration For this example we will set three enumerators red yellow and green The numbers associated with these enumerators are as fol lows red 0 yellow 1 green 2 The variable DiscColor is registered with a data type of Color You can now select between three different enumerators for the variable DiscColor red yellow and green This will in turn write the appropriate value of O 1 or 2 to the variable DiscCo lor NJ series CPU Unit Software User s Manual W501 6 43 6 Programming Enumeration Table Data type Color ENUM Enumerator red green Variable Table Data type DiscColor Color Dew Enumeration Specifications Item Specification Enumerator names Enumerator names consist of single byte alphanumeric characters They are not case sensitive Prohibited characters are the same as for variable names A compiling error will occur if you specify the same enumerator more than once A compiling error will occur if you specify an enumerator with the same name as a variable in the user pro gram or if you specify an enumerator that already exists in another enumeration Values Valid range Integers between 2 147 483 648 and 2 147 483 647 Values do not have to be consecutive A compiling error will occur if you specify the same value more than once Note You cannot perform size comparisons with enumeration variables You can only test to see if the enumerat
41. DOJCI i ca eateltentiovors 7 7 troubleshooting ceecccseececeeeceeseeeeeseeseeseueeeseeeessens 12 11 U UNON S oera ets alee hte ea ae ai Shea a 6 41 UnitCOMM QUIATION 22cchsccceveszcts2vsesnttesaccseaunsnnseeetniecceenueen 3 7 Unit Configuration and Unit Setup 0 0 eeeeeeeeeeeees 4 9 TE TFMTONIMAUON sisec52s 25s cs shecetencecdcaacasesdscabanancacecsuseeaicad 4 9 Update Variable ssvcesstereiecsunhtushteatviven austen Gertreeeeds 4 7 user program execution IDS ccceeeceeseeeeeeeeeeeeeeeeees 9 25 User defined Error Status ccccceeseeeeeeeeeee ees A 28 A 50 user defined errors ccccseeececeeeeeeceseeeceeeeeeseeeesseeeeeees 9 50 user defined events cccceecccseeeeeceseeeceeeeeseeeeeseeeeees 9 44 user defined information cccecseeeeeeeeeeeeeeeeseeeeeeens 9 50 user defined variables ceeceeeseeseeeeeeeeeeeeeeeeeees 2 5 6 27 V Variable Access Time ccccccceececsececeseeceeseceeeeseeesaes 4 6 variable ACCESS time ratio sssnessneeneeeereeerreerrrerr rre 5 19 variable attributes PAV SS DSCIICATOM Secsees ct ects a ote Send aes 6 51 CONS AINE erreser ea SE 6 55 6 6 S E EEE E E E E A E 6 57 ital Vale sirsa a ks oie acesSdsan seule 6 53 Network PUbIISN cccccceeccceeeceeeeseseeeseeesseesses 6 56 BAE E ATP P TEAT EEA TEAT TE TTET 6 53 Variable NaMe ier teenie 6 50 VANIADIC NaMe S ersam a TEE 6 50 rESWICTIONS soraira rea A a aa ieee Cle 6 60 variable va
42. Event Settings WY Data Trace Settings gt Programming Setting Update Changes in Task Type Sets the task type Priority 4 pri Priority 4 pri When down Not allowed mary periodic mary periodic loaded to task task CPU Unit Priority 16 periodic task Priority 17 periodic task Priority 18 periodic task Execution Pri Sets the task execution Automatically Primary peri When down Not allowed ority priority set according odic task 4 loaded to to the task CPU Unit type Task Name Sets the task name Text string Primarylask When down Not allowed loaded to CPU Unit CS CJ NSJCJ2 Series Instructions Reference Manual W474 4 5 gt N 5 U D gt Q _ O mp gt D u rm O TI c gt oO O Q a D sBullles ySe Z y 4 Controller Setup Setting a Update Changes in Period Execu Sets the task period Primary peri Primary peri When down Not allowed tion Condi odic task odic task loaded to tions 500 us 1 ms 1 ms CPU Unit 2ms or4Ms Periodic Periodic tasks 10 ms tasks 1 ms 2ms 3 ms 4 ms 5 ms 8 ms 10 ms 15 ms 20 ms 25 ms 30 ms 40 ms 50 ms 60 ms 75 ms or 100 ms Task Period Sets whether to detect Detect When down Not allowed Exceeded an error when the task Minor fault loaded to Detection period is exceeded level Con CPU Unit troller error generated Do not de
43. First byte 2 2 2 Value of b gt Written to ID Tag ToAryByte Structure variable X a Transfer each member to the byte array _LOW_HIGH Order Array variable Z 0 AryOut ToAryByte Structure variable X b Out _LOW_HIGH Array variable 2 2 A 90 NJ series CPU Unit Software User s Manual W501 Index NJ series CPU Unit Software User s Manual W501 Index 1 Index Index A Accessing NASIK rslgctostenai eats cavecha lant a E 4 7 ACCESSING TASKS iere n i sian ieadtenntaeanees 5 15 TaskName _ACtive a nn 5 19 A 27 A 47 Ala IAG ayee A 28 A 50 UIGOMILAMINS shai cetsert evant y geueenuiy casas cpetounadeeeataceas 6 10 6 17 All Tag Data Link Communications Status A 43 A 73 Always FALSE Flag cccccsssseeeeesseeeeeeeeeeeeeens A 29 A 52 Always TRUE Flag seisc ccc cccuicccecsecssveseernsececseenies A 29 A 52 array SPECIFICATION seccececeeeeeeeceseeeeeeseaeeeeeeees 6 33 6 44 Pl SPCCIICAON sirsiran cede caencs 6 51 Axes Group Error Status cccccccceesseeeeeeenees A 33 A 60 Axes Group Variables ccc 2 7 3 18 A 33 A 60 AXIS Error Status sarai nr e A 33 A 60 Axis Variables cccccccecceseeseeeeeeeeeees 2 7 3 18 A 33 A 61 B backup dalasa e E ee ee RAC ee eRe 9 57 present values of battery backup memory 9 57 Dasic data TW DCS cees 6 31 Basic Ethernet Setting Error esesssssesssssreren
44. Ji NJ series CPU Unit Software User s Manual W501 10 9 10 Communications Setup 10 3 2 Connection Configuration between Controllers and Slaves i EtherCAT High speed high precision communications are possible with Servo Drives and general purpose slaves Refer to the NJ series CPU Unit Built in EtherCAT Port User s Manual Cat No W505 for details Servo Drives 10 10 NJ series CPU Unit Software User s Manual W501 10 Communications Setup 10 4 Connection Configurations with HMis and Devices with Serial Communications This section shows the connection configurations used to connect HMIs and devices with serial com munications to the NJ series Controller 10 4 1 Connections to HMIs EtherNet IP You can use the built in EtherNet IP port to connect to an HMI Refer to the NJU series CPU Unit Built in EtherNet IP Port User s Manual Cat No W506 for details HMI SUONBOIUNWWO4 Jes YJIM S NA SINH 0 suonoauuop P OL pue SINH yum suonen yuon uonsauuos p 0 EtherNet IP Serial Communications You can use a Serial Communications Unit to connect to an HMI Refer to the CJU series Serial Com munications Units Operation Manual for NJ series CPU Unit Cat No W494 for details High speed Serial Communications Unit RS 232C or RS 422A 485 10 4 2 Connections to Devices with Serial Communications You can use a Serial Communications Unit to
45. Not supported Members Rabo for integers and enu Members Rubons only Derivative data types Unions Not supported Members Rubo for integers and enu Members Rebone only Enumerations ss Enumerations Supported You must use the same data type for the lt FOR_variable gt lt end_value gt and lt increment decrement Otherwise an error occurs when the program is built on the Sysmac Studio Data type specifica tions WHILE Overview This construct repeatedly executes the specified statements as long as a condition expression is TRUE Reserved Words WHILE DO END_ WHILE Construct Structure WHILE lt condition_expression gt DO lt Sstatement END _WHILE 6 90 NJ series CPU Unit Software User s Manual W501 6 Programming Process Flow Diagram Condition FALSE expression TRUE Repeated Statement End Application Use this type of repeat construct when you do not know how many times to repeat a process i e when you do not know how many times based on the condition and you want to repeat a process for as long as a certain condition is met You can also use this type of repeat construct to execute a process only when a condition expression is TRUE pre evaluation repeat construct Description The lt condition_expression gt is evaluated before lt statement gt is executed If lt condition_expression gt is TRUE lt statement is executed Then the
46. Requires a total of 10 bytes 12 bytes Byte Byte First byte First byte First byte 1 DWORD data First byte 1 First byte 2 First byte 3 First byte 4 i j data type is a First byte 4 WORD data First byte 5 DWORD data multiple of four First byte 5 First byte 6 First byte 6 Not used First byte 7 l First byte 7 The beginning of the DWORD dat data type is a multiple of ata i First byte 10 four i e first byte 8 First byte 11 i The beginning of the First byte 8 data tvpeisa First byte 8 First byte 9 malple of two First byte 9 You must be aware of the alignment values for different data types when you exchange data such as structure variables between devices so that you can properly align the position of the data in memory Refer to A 7 Variable Memory Allocation Methods for details DWORD data The beginning of the Pitstnylors The beginning of the First byte 2 data type is a multiple of two amp S Z D ea D N Derivative Data Types A derivative data type is a data type with user defined specifications Derivative data types are reg istered in the Data Type View in the Sysmac Studio The following is a list of the derivative data types on Type Description 5 Structures This data type consists of multiple data types placed together into a single lay ered structure D Unions This data type allows you to handle the same data as different data types depending on the situation Enumerations Thi
47. Step 1 3 Designing Programs Step 2 Software Setups and Programming Step 3 Mounting and Setting Hardware Step 4 Wiring Step 5 Confirming Operation and Starting Actual System Operation Refer to 1 3 Overall Operating Procedure for the NJ series Controller for details NJ series CPU Unit Software User s Manual W501 6 3 o I O lt oO h u Oo Q teh 3 3 gt Q u Oo Q c 6 Programming POU Program Organization Unit Design Determine which processes to put into which POUs and design the POUs Note Functions cannot contain function block instructions or function blocks Determine which languages such as ladder diagrams inline ST and ST to use to create each process Note Inline ST is structured text that is written as an element of a ladder diagram Variable Design Design the user defined variables that you need to create Separate variables into those that you use in more than one POU global variables and variables that you use in only specific POUs local variables Determine if you need to automatically generate the variable names for the device variables that you use to access slaves and Units or if you need to define them yourself Design the attributes for the variables Variable Name Data Type AT Specification Initial Value Retain Constant and Network Publish Decide the data types of your variabl
48. The Data Type attribute defines the type of data and range of data that is expressed by a variable The amount of memory that is allocated when you declare a variable depends on the data type of that variable The more memory allocated the larger the range of values that the variable can express The data types for the input output and in out variables of instructions depend on the instruction Set the data types of input output and in out parameters for the instruction arguments according to the data types of the input output and in out variables for that instruction 6 30 NJ series CPU Unit Software User s Manual W501 6 Programming i Basic Data Types and Derivative Data Types There are two kinds of data types basic data types which have predefined specifications and deriva tive data types which are defined according to user specifications Basic Data Types The different kinds of basic data types are listed below Classification Definition Boolean A data type with a value of either TRUE or FALSE Bit string A data type that represents a value as a bit string Integer A data type that represents an integer value Real number A data type that represents a real number Duration A data type that represents a time duration days hours minutes seconds and milliseconds Time of day A data type that represents a specific time of day hour minutes and seconds Date A data type that represents a date year month and
49. Usage in user program Related instruc tions NJ series CPU Unit Software User s Manual W501 A 71 a w Oo D z O ot O 5 o O 5 a Q v w lt m mp D F Q h 5 D Q S o D o Asobeyeg ajnpoyy uopuny dlA2N1943 9 7 V dlg swen Appendices Variable name _EIP_MultiSwONErr Meaning Multiple Switches ON Error Global local Global Function TRUE More than one data link start stop switch changed to TRUE at the same time FALSE Other than the above Data type BOOL Range of values TRUE or FALSE Usage in user program Related instruc tions Variable name _EIP_TcpAppCfgErr Meaning TCP IP Setting Error Global local Global Function TRUE At least one of the set values for a TCP IP application FTP NTP SNMP is incorrect Or a read operation failed FALSE Normal Data type BOOL Range of values TRUE or FALSE Usage in user program Related instruc tions Variable name _EIP_NTPSrvErr Meaning NTP Server Connection Error Global local Global Function TRUE The NTP client failed to connect to the server timeout FALSE NTP is not set or the connection was successful Data type BOOL Range of values TRUE or FALSE Usage in user program Related instruc tions Variable name _EIP_DNSSrvErr Meaning DNS Server Connection Error Global local Global Function TRUE The DNS client failed to connect to the server timeout FALSE DNS is not enable
50. Use the following instructions to create and reset user defined errors and to create user defined infor mation Up to 32 events per level can occur simultaneously for a total of 256 possible simultaneous events Instruction name Instruction _ Description Create User defined SetAlarm The SetAlarm instruction creates a user defined error Error Reset User defined ResetAlarm The ResetAlarm instruction resets a user defined error Error Create User defined Setlnfo The Setlnfo instruction records the specified user defined informa Information tion in the event log 9 54 NJ series CPU Unit Software User s Manual W501 9 CPU Unit Functions Checking for User defined Errors You can use the Get User defined Error Status GetAlarm instruction to obtain the status of the cur rent user defined errors user defined error levels 1 to 8 and the highest priority event code Example Event Setting Table oo es ee ee ee 10001 User fault Level3 ControlA OOt ps o o i o E Description Failure X occurred E Correction Perform safety checks and handle the problem according to the cause code Actual Programming Detection condition GetAlarm EN EN Additional Information You can use user defined errors to add a message on possible corrections or other information when a Controller error occurs Use instructions such as the GetPLCError instruction to obtain information about the error status or event c
51. Variable name _EIP_TDLinkOpnErr Meaning Tag Data Link Connection Failed Global local Global Function TRUE The connection was not established because the remote node information in the tag data link parameters was different from the actual node information Note This variable does not change to TRUE if there is no remote node when the power is turned ON FALSE Other than the above Data type BOOL Range of values TRUE or FALSE R W access Rs Retained Not retained Network Publish Published Usage in user program Related instruc tions Variable name _EIP_TDLinkErr Meaning Tag Data Link Communications Error Global local Global Function TRUE A timeout occurred in a tag data link connection FALSE Other than the above Data type BOOL Range of values TRUE or FALSE Usage in user program Related instruc tions Variable name _EIP_TagAdrErr Meaning Tag Name Resolution Error Global local Global Function TRUE Tag resolution failed i e the address could not be identified from the tag name The following causes are possible e The size of the network published variable does not agree with the tag setting e The I O direction that is set in the tag data link settings does not agree with the I O direction of the vari able in the CPU Unit e There is no network published variable in the CPU Unit that corresponds to the tag setting FALSE Other than the above Data type BOOL Range of values TRUE or FALSE
52. W501 Index NTP Last Operation Time cccccsseeeeeeeeeees A 44 A 74 NTP Operation Information ccccsssseeeeeeseeeeeeeeeeees A 44 NTP Operation Result ccccssseeeeeeseeeeeeeeeees A 44 A 75 NTP Server Connection Error cccccceeeeeeeeees A 40 A 72 Number of Task Executions ccccceeeeeeceeeeeeeeeeeeeeees 5 20 Number of Used Ports c cccecceeceeseeeeeeeeeeeeenees A 30 A 53 O Sa S E AE EEE Reo ene E A E EAE EAE A 43 A 72 ONIMME COMING S E E E E 9 34 operating Mode sae eene aaa 2 17 CTC CIIING ioen ata 8 5 operation when changing operating mode 8 4 Operating Mode at Startup cccccccesseeeeeeeeeeeeeeeneees 8 4 operating modes ccccceseceeeseeeseeeeeesaeeeeneeeeeseeenaaeees 8 3 operation PAULIN OMY coena a p 9 17 Operation Settings cccccseseceeceeseeeeecesseeeeeeeeeeeeeeees 4 4 Operation Settings Tab Page cccccsesseceeseeeeeeeeneees 4 4 output variables oessesesnnesenesrnreerneeerresrrreeenee outputs program OUPUtTS aiora a n ute eos P Packet Monitoring Stopped pk E EEE A E AAE E EA E E EATE A Period Execution Condition ccccceeeeeeceseeeeeeeeeeeeeeens 4 6 penodi taSKS cai a E E e A a 5 10 parameters Sonsin ys 5 14 periodic tasks that control I O ccccseseeeesseeeeeeees 5 10 periodic tasks that do not control I O cee 5 10 P First FRUONMOGE x25 ecco ie cet oe e
53. When variable values are initial Initial value of variable set to Output is turned OFF ized or not initialized FALSE Variable for which no initial Output is turned OFF value is set Output Bit Status for CJ series Basic Output Units Status of outputs from CJ Settings at user program transfer Device variables in CPU Unit series Basic Output Units Initial value of variable set to Output is turned ON TRUE When variable values are initial Initial value of variable set to Output is turned OFF ized or not initialized FALSE Variable for which no initial value Output before the download is is set retained 8 2 4 Status for Controller Errors An error that is defined by the NU series system is called a Controller error The following tables give the operation of function modules and the CPU Unit itself when a Controller error occurs p N o n j Function Module Operation for Controller Errors in RUN Mode z gt The following table lists function module operations when a Controller error occurs in RUN mode 2 Error type Operation Minor fault level Controller The function module where the error occurred does not stop error Partial fault level Controller The function module where the error occurred stops error Major fault level Controller All function modules stop error Refer to 12 1 3 Non fatal error in CPU Unit for details on Controller errors UN Ny gt op pee pe mr cC n j O
54. before retained GRAM power inter mode ruption Same as Retained Retained Supported Retained RUN PRO Supported before GRAM power inter mode ruption Same as Retained Retained Not sup Retained PRO Not sup before ported GRAM ported power inter mode ruption Same as Retained Retained Not sup Retained PRO Not sup before ported GRAM ported power inter mode ruption Retained Retained Supported Retained RUN PRO Supported GRAM mode Same as Retained Retained Not sup Not PRO Not sup before ported retained GRAM ported power inter mode ruption Same as Retained Retained Not sup Not PRO Not sup before ported retained GRAM ported power inter mode ruption Initial val Initial val Initial val Supported Not RUN PRO Supported ues ues ues retained GRAM mode Initial val Retained Retained Supported Not RUN PRO Supported ues retained GRAM mode 16 0000 16 0000 16 0000 Supported Not RUN PRO Supported retained GRAM mode Supported Same as Retained Retained Supported Not RUN PRO before retained GRAM power inter mode ruption NJ series CPU Unit Software User s Manual W501 Appendices Retained Same as Retained Retained Supported Not Supported with Bat before retained tery power inter ruption Not Retained With Bat Retained Retained Supported RUN PRO Supported with Bat tery continued continued retained GRAM tery Ret
55. changes to TRUE and an error code that gives the cause of the error is output to ErrorID In both of these cases the P_PRGER Instruction Error Flag system defined variable changes to TRUE to indicate that an instruction error occurred in that program The following section describes the operations that are performed when an error occurs i Operation for Instruction Errors When the CPU Unit executes an instruction it checks the input parameter values and other information As a result of that check one of the following actions is taken P m c O y O 5 D Ladder Diagrams Type paaa variable Normal operation Error operation ENO Changes to TRUE Changes to FALSE P_PRGER Retained nothing is done Changes to TRUE Power flow output Value is Power flow output FALSE D updated according to the internal BOOL parameter outputs 2 eae algorithm Retained O nstruction pdaing output ee ai air eae z Non BOOL parameter out 2 parameters i puts Retained algorithm 5 Non BOOL parameter output S Value is updated according to the gt internal algorithm z standard instructions m Power flow output Value is Power flow output FALSE g updated according to the internal BOOL parameter outputs User created algorithm Retained functions and BOOL parameter output Value is Non BOOL parameter out function blocks updated according to the internal puts Retained algorithm Non BOOL parame
56. if the computer has an FG terminal make the connections so that the FG terminal has the same electrical potential as the FG GR terminal on the Power Supply Unit A differ ence in electric potential between the computer and Controller may cause failure or malfunction If the external power supply to an Output Unit or slave has polarity connect it with the correct polarity If the polarity is reversed current may flow in the reverse direction and damage the connected devices regardless of the operation of the Controller i Power Supply Design Do not exceed the rated supply capacity of the Power Supply Units in the NJ series Controller The rated supply capacities are given in the NJ series CPU Unit Hardware User s Manual Cat No W500 If the capacity is exceeded operation may stop malfunctions may occur or data may not be backed up normally for power interruptions Use NJ series Power Supply Units for both the NJ series CPU Rack and Expansion Racks Operation is not possible if a CJ series Power Supply Unit is used with an NJ series CPU Unit or an NJ series Power Supply Unit is used with a CJ series CPU Unit NJ series CPU Unit Software User s Manual W501 Precautions for Safe Use Do not apply voltages or connect loads to the Output Units or slaves in excess of the maximum rat ings e Surge current occurs when the power supply is turned ON When selecting fuses or breakers for external circuits consider the above precautio
57. logs i Reset User defined Errors User defined errors are cleared when the power supply to the NJ series Controller is turned ON You can also clear errors with the Sysmac Studio the Reset User defined Error instruction ResetAlarm and an HMI 9 56 NJ series CPU Unit Software User s Manual W501 9 CPU Unit Functions 9 7 Using the Sysmac Studio to Back Up and Restore Data This section describes how to use the Sysmac Studio to back up data You can back up the present val ues of the battery backup memory from the Sysmac Studio 9 7 1 Backing Up and Restoring the Present Values of Battery backup Memory i Introduction You can back up the present values of the battery backup memory in the CPU Unit to an XML file on your computer or restore the battery backup memory from a previously saved backup file This applies to the following data e Present values of variables with a Retain attribute e Present values in the DM EM and Holding Areas of memory used for CJ series Units e Absolute Encoder Home Offset Data Sysmac Studio Select Backup Variables and Memory from the Tools Menu CPU Unit Restoring Present values of battery backup memory Backup P N C 2 5 gt D w lt m 3 D O O c Q 3 u D O an Cc D 5 2 J D N O T J D D Backup and Restore Targets Present values of retained variables Present values in the DM EM and Holding
58. s Manual W501 6 Programming e Do not write code that directly modifies the FOR variable inside the FOR construct Unintended operation may result Example FOR i 0 TO 100 BY 1 DO X i 0 I I INT 5 END_FOR e You can write any of the statements on multiple lines Separate statements with a semicolon e You can omit BY lt increment decrement lf it is omitted the statement is executed with an incre ment value of 1 e You can specify any expression that returns an integer SINT INT DINT LINT USINT UINT UDINT or ULINT variable or integer value for the lt initial_value gt lt end_value gt and lt incre ment decrement gt You can also specify a function that returns an integer value Example 1 A value of 100 is assigned to array variable elements SP n The FOR variable is variable n the initial value is O the end value is 50 and the increment is 5 FOR n 0 TO 50 BY 5 DO SP n 100 END_FOR Example 2 The total of elements DATA 1 through DATA 50 of array variable elements DATA n is calculated and the result is assigned to the variable SUM gt a u Oo D 3 3 5 rr D c D Q D o IF a THEN FOR n 0 TO 50 BY 1 DO DATA n 1 END_FOR FOR n 0 TO 50 BY 1 DO SUM SUM DATA n END_FOR a FALSE END_IF Example 3 The maximum and minimum values of elements DATA 1 through DATA 50 of array variable elements DATA n are found The maxim
59. 1 X 1 A value of 1 is assigned to variable X when variable A is 1 2 5 X 2 A value of 2 is assigned to variable X when variable A is 2 or 5 6 10 X 3 A value of 3 is assigned to variable X when variable A is between 6 and 10 11 12 15 20 X 4 A value of 4 is assigned to variable X when variable A is 11 12 ELSE a or between 15 and 20 X 0 If none of the values is matched a value of 0 is assigned to the END_CASE variable X Example 2 You can give an integer variable integer expression integer function return value enumeration variable or enumeration function return value for the lt integer_expression gt An example is shown below e Example for an Integer Enumeration Variable CASE ColorVar OF RED X 0 BLUE X 1 ELSE X 2 END_CASE 6 86 NJ series CPU Unit Software User s Manual W501 6 Programming e Example for an Integer Expression CASE a1 a2 OF O X 0 X 1 ELSE X 2 END_CASE e Example of an Integer Enumeration Function Return Value oA E FUN OF Branches depending on the return value of FUN X 10 ae X 11 ELSE X 12 END_CASE Data Types That You Can Use in CASE Constructs Classification Data type lt integer_expression gt integers Supported Boolean bit string real duration date time Not supported of day date and time or text string data Not supported Array specifications Supported for integers and enu merati
60. 3 Attached information 4 Display Switch Update Print 65 events Last data logged at 6 23 2011 9 30 03 PM Event Log Details Display If you want to display detailed information about an event in the list select the desired event P o m lt gt mr r O es Time of occurrence Level 7 3 2 9 00 12 7 3 1 21 40 12 6 2 2 12 15 13 5 7 1 22 21 45 6 2 3 12 00 00 5 7 1 19 11 42 5 7 1 19 12 15 5 7 1 19 11 42 5 6 1 10 33 05 5 6 1 10 32 03 NJ series CPU Unit Software User s Manual W501 Information PLC Information PLC Operating Configuration changed a aa Event Power ON Power OFF Non fatal error axis stop error Fatal error program ere mode RU NS Program changed Operating mode PROGRAM Operating mode RUN Power ON Time of occurrence Level Event Sources Event Name Description Attached information 1 Attached information 2 2005 7 1 22 21 45 Fatal error PLC Function Module Program error 2062 A program error occurred An error occurred in the following location Refer to attached information 1 for the task number Refer to attached information 2 for the program line mw Cause could be the cause of this error E Correction Check the program and correct any errors 126 8032 9 47 s o u 4 UO uolewoyzu psjlejeq zZ 9 6 9 CPU Unit Functions i Clearing Event Logs Clearing Event Logs from the Sysmac Studio or
61. 3 7 List of System defined Variables Related to SD Memory Cards The following system defined variables show the status of the SD Memory Card _Card1Ready SD Memory TRUE when the SD Memory Card is recognized It is FALSE when BOOL Card Ready an SD Memory Card is not recognized Flag TRUE The Card can be used FALSE The Card cannot be used _Card1Protect SD Memory TRUE when the SD Memory Card is write protected BOOL Card Write TRUE Write protected ee FALSE Not write protected _Card1Err SD Memory TRUE when an unusable SD Memory Card is inserted or a format BOOL Card Error error occurs Flag TRUE There is an error FALSE There is no error _Card1Access SD Memory TRUE during SD Memory Card access BOOL Card Access TRUE Card is being accessed Flag FALSE Card is not being accessed _Card1Deterior SD Memory TRUE when the end of the life of the SD Memory Card is detected BOOL ated Card Life TRUE The end of the life of the Card is detected Weng RAY FALSE The end of the life of the Card was not detected _Card1PowerF SD Memory TRUE when the power supply to the Controller was interrupted dur BOOL ail Card Power ing access to the SD Memory Card Interruption Flag 2 TRUE Power was interrupted during SD Memory Card access FALSE Operation is normal 1 Precaution When Using SD Memory Card Access Flag _Card1Access The SD Memory Card Access Flag is intended for use in notifying external devices The status
62. A 37 A 66 JEG PDTIMeGOUtEM aaien aa A 34 A 63 AEC PKIMON SIO re a veh A 37 A 67 SEC PRIS AVING tenes eee e e e seats A 37 A 67 EC FONE d ee er eee Ree ner nny econ er mE A 34 A 61 JEG REG SAV TO iea A 37 A 65 SEG SlavAdrDUPEI derisi A 35 A 64 SBE SIaVADDE serenan thaedeee eens _EC_SlavEmergErr BB sl Oe 2h lj eee eee E AEG Ola VETOI oai BC SlavIOIE N e e coe wsemseeioncede LEIP BOOIDEN caneria a A EIR CIPE ieee nn eee eter a EIRP DNSSIVEN nahen ur ateded TBI EE NO a actos ch eanactetie _EIP_EstbTargetSta 255 ccceeeeeeseeeeeees A 43 A 73 RIP EIA GIG Ei eseun a deceit ate eatat A 39 A 70 EIP EtnOnlineSta saiid A 43 A 72 HES deny Em e uae as sieetennuntteasune A 40 A 71 LEIP IPAC CIOEIl Jeanine Naa Gia A 39 A 70 JETP IPAQIDUDE I nseni A 39 A 70 SEP IPA TDIE RE crsctectaat tiedccehcsecrataeeiee se scatsledect A 40 A 70 By ee es ane ee A 39 A 69 EIR MacAGrit erra A 39 A 69 _EIP_MultiSWONE rr ou ceeeeeeeeeeeeeeeeeees A 40 A 72 SBIP UNTPRESUIN sscecsssectiewsoisclerceh ictecnndete A 44 A 74 A 75 _EIP_NTPResult ExecNormal c ccccceeeeeeeeeeees A 44 _EIP_NTPResult ExecTime ccccccseeeceeeeeeeeeeees A 44 EIRP IN TP SIVEM oeoa A 40 A 72 SEIR PONEI oaa aa E A A 38 A 68 _EIP_RegTargetSta 255 ceeeeceesssseeeeeeees A 43 A 73 Ele FAQ ACE aa sacs A 40 A 71 _EIP_TargetNodeE ir cccccceeceesseesesseesesseeseeneeeens A 74 _EIP_TargetNodeE
63. A 4 6 EtherNet IP Function Module Category Name _EIP A 68 A 5 CPU Unit Data Retention and Other Attributes 005 A 76 A 6 Contents of Memory Used for CJ series Units 008 A 80 AGr YOlOMAlea ae aes teed eine ts Beh eS eeG Oy hs EO eh Ae A 80 AOZ Aay ANC lt great ese 568 ore oe ad sd RNa La ake dae eee a A 82 A 6 3 HOANG AICO ereere e eee ie ee a ek a ba Pee A 83 AGA DMMAKGa rae ts 43 Se anes ob obo tee ee ee ean ieee hates A 83 AD EMALT ett inset Wek soe oa ah he ee ae Re aed We oe Bead A A 84 NJ series CPU Unit Software User s Manual W501 A 1 Appendices A 2 A 7 Variable Memory Allocation Methods 0c e eee eee A 85 A 7 1 Variable Memory Allocation Rules 0 000 eee eee A 85 A 7 2 Important Case Examples 0 0 00 cee eee A 88 NJ series CPU Unit Software User s Manual W501 Appendices A 1 Specifications This section gives the specifications of the NJ series Controllers A 1 1 General Specifications Item NJ501 1300 NJ501 1400 NJ501 1500 Enclosure Mounted in a panel Grounding method Ground to less than 100 Q Dimensions 90 mm x 90 mm x 90 mm as Weight 550 g including the End Cover 8 Current consumption 5 VDC 1 90 A including SD Memory Card and End Cover 4 Operating Ambient operating tempera 0 to 55 C S environment ture Ambient operating humidity 10 to 90 with no condensation Atmosphere Must be free from corr
64. AT specifications There are variables with and without the retained ariable Pa a O u C Cc 5 0 D D D 5 2 UO D D J D D 5 O 5 Retain attribute memory Variables with a Retain Retained 4 a Battery is attribute connected This is the CIO and Work Areas for CJ series Units Not retained Memory Used for CJ series Units This is the Holding DM and EM Areas for CJ series Units Retained if a Battery is connected System Time This is the time information that is used inside the CPU Unit Retained if The event logs include the error log for the CPU Unit and Special a Battery is Event Log Data Units and logs of events other than errors such as when the power Connected supply was turned ON and OFF and when operation started This data is used to restore the actual position of a Servo Drive with Absolute Encoder Home Offset an absolute encoder in motion control The offset is the difference Data between the command position after homing and the absolute data that is read from the absolute encoder eyed HUN NdO L 9 g NJ series CPU Unit Software User s Manual W501 2 19 2 CPU Unit Operation 2 20 NJ series CPU Unit Software User s Manual W501 I O Ports Slave Configuration and Unit Configuration This section describes how to use I O ports how to create the slave configuration and unit configuration and how to assign functions 3 1 3 2 3 3 Overview of Pr
65. Algorithm Memory for instance FB1_1 p N u O C u e Co Q 3 O Q N te mg e gt C gt Memory for instance FB1_2 Instance name FB1 2 Function block definition name FB1 Variable declarations Memory area reserved syoo g uooUN uo sjed S Z 9 Algorithm Instances cannot be read from other programs or function blocks If an instance with the same name as another instance is placed in a different program or another function block that instance will oper ate as a completely separate instance NJ series CPU Unit Software User s Manual W501 6 13 6 Programming Array Specifications for Instances Array specifications can be made for instances You can indirectly specify an array element number with a variable to execute multiple instances with one instance name Furthermore you can switch input sources and output destinations and effectively execute multiple instances with a single instance name if you use an array specification for the input parameter and output parameter and specify the element numbers with the same variable Example Not Using an Array to Specify Instances timerO IN O OUT O PT O timer IN 1 OUT 1 PT 1 IN 2 OUT 2 PT 2 IN 3 OUT 3 PT 3 IN 4 OUT 4 PT 4 Using an Array to Specify Instances FOR EN ENO UINT 0 Initval Index i UINT 4 Endval UINT 1 Stepval timerfi
66. Area only when you specify addresses for some of the Special Units CPU Bus Unit Area Description The bits in this area are allocated to control and status information for CJ series CPU Bus Units Each Unit is allocated 25 words based on its unit number Data in this area is cleared when power is cycled or when the operating mode is changed between PROGRAM and RUN mode Addresses Addresses Word addresses Bit addresses Words per Unit Range CIO 1500 to ClO 1899 CIO 1500 00 to CIO 1899 15 25 words The words that are allocated are listed in the following table Word addresses Unit Number CIO 1500 to CIO 1524 O CIO 1525 to CIO 1549 1 to to CIO 1875 to CIO 1899 F A 80 NJ series CPU Unit Software User s Manual W501 Appendices For details on how to use the allocated words refer to the operation manual for the CJU series CPU Bus Unit Precautions for Correct Use You can access the CPU Bus Unit Area in NJ series CPU Units through the device variables that are allocated to I O ports We therefore recommend that you do not use AT specifications to access this area You should use AT specifications for the ClO Area only when you specify addresses for some of the Special Units i Special I O Unit Area Description The bits in this area are allocated to control and status information for CJ series Special I O Units Each Unit is allocated 10 words based on the unit number for up to a total of 96 Units unit nu
67. BOOL Size BOOL DscDut ci Done BOOL Busy BOOL Error BOOL ErrorlD BOOL ErrorlIDEx BOOL RecvSize Val Out You can branch the power flow output Example OK BOOL Execute BOOL Handle BOOL SrcDat BOOL Size BOOL DscDut CiPRead BOOL Done BOOL Busy BOOL Error BOOL ErrorlD BOOL ErrorlDEx BOOL RecvSize NJ series CPU Unit Software User s Manual W501 esl CliPRead Execute BOOL Handle BOOL SrcDat BOOL Size BOOL DscDut IN INT Val_In BOOL Execute BOOL Handle BOOL SrcDat BOOL Size BOOL DscDut BOOL Execute BOOL Handle BOOL SrcDat BOOL Size BOOL DscDut MyFB BOOL Done BOOL Busy BOOL Error BOOL ErrorlD BOOL ErrorlDEx BOOL RecvSize INT Val_Out BOOL CiPRead CiPRead Q BOOL Done BOOL Busy BOOL Error BOOL ErrorlD BOOL ErrorlIDEx BOOL RecvSize BOOL Done BOOL Busy BOOL Error BOOL ErrorlD BOOL ErrorlIDEx BOOL RecvSize 6 69 p a u Oo D 3 3 5 re D c D Q D N ebenbue7 wesbeig seppe Z S 9 6 Programming Restriction e You cannot create closed loops or intersect connecting lines Example No closed loops 4 NOT Inputs BOOL parameters can be inverted for inputs NOT input BOOL Q TRUE FALSE FALSE TRUE f Inline ST Introduc
68. Bit string processing instructions 13 0 Data movement instructions MOVE 23 5 Total 100 0 100 0 Structured Text Percent of exe Percent of cution time in instructions instruction group ST constructs IF ELSEIF END_IF 75 4 41 6 Comparison instructions EQ and LT 8 7 Types of instructions Timer and counter instructions Timer TON TOF and CTU CTD 18 8 Math instructions and 10 2 BCD conversion instructions and INT_TO_DINT and 1 6 data conversion instructions WORD_BCD_TO_UINT Bit string processing instructions AND and OR 11 7 Data movement instructions 7 3 Total 100 0 100 0 Configuration of Arithmetic Instructions for LREAL Data Instructions Percent of instructions Addition instructions for LREAL data 20 0 Subtraction instructions for LREAL data 20 0 Multiplication instructions for LREAL data 30 0 Division instructions for LREAL data 30 0 Total 100 0 Configuration of Trigonometric Instructions for LREAL Data Instructions Percent of instructions Sin of LREAL data 16 7 Cos of LREAL data 16 7 Tan of LREAL data 16 7 Sin of LREAL data 16 7 A 22 NJ series CPU Unit Software User s Manual W501 Appendices Instructions Percent of instructions Cos of LREAL data 16 7 Tan of LREAL data 16 7 Total 100 0 i Motion Control Processing The motion control processing time depends on the number of servo axes and virtual servo axes that are used For the number of servo an
69. Boolean bit string integer real duration date time of day date and time and text string data types Basic data type is used as opposed to derivative data types which are defined by the user A variable that represents the cam data as a structure array A cam data variable is an array structure that consists of phases and displace ments Any of the CJ series Units that can be used with an NJ series Controller One of the attributes of a variable If you specify the Constant attribute for a variable the value of the variable cannot be written by any instructions ST operators or CIP message communications The range of devices that are directly controlled by the CPU Unit In the NJ series System the Controller includes the CPU Rack Expansion Racks and EtherCAT slaves including general purpose slaves and Servo Drives Errors that are defined by the NJ series System Controller error is a collective term for major fault level partial fault level minor fault level and observation Controller events One of the events in the NJ series System Controller events are errors and infor mation that are defined by the system for user notification A Controller event occurs when the system detects a factor that is defined as a Controller event Information that is defined by the NJ series System that is not an error It repre sents an information Controller event A data type that is defined by the user Structures unions
70. CJ series Units A 32 A 57 CN OC sti snk eco a E E A 26 A 47 COMMUNICATIONS ccc ceceeseeceseeseeseeeeseeeeeeeees A 30 A 53 NJ series CPU Unit Software User s Manual W501 d epugging manner emr meer recente rte nternreres irertr re A 30 A 54 CLOG Or cavessaos ieee teense ae A 28 A 30 A 49 A 55 EtherCAT communications errors A 34 A 61 EtherCAT communications status A 37 A 65 EtherNet IP communications errors A 38 A 68 EtherNet IP communications status A 43 A 72 EtherNet IP communications switches A 45 A 75 VO DUS GMOS sarramen a A 31 A 56 VO DUS SAS ara cates ersee te A 31 A 55 meanings of error status bits cceeeeeessseeeeeees A 45 motion control FUNCTIONS cc eeeeeeeeeeeeeee ees A 33 A 59 power supply wiees Asanntacrecongetieaernnctceneetss A 29 A 51 programming sesasi nat teavetueaecatlns A 29 A 52 SD Memory Cards cccccseceeccesseeeeeeeeeeeees A 28 A 50 MASKS aena deasn Creams aaa eames A 27 A 47 system defined variables for motion control 2 7 T Tag Data Link Communications Error A 40 A 71 Tag Data Link Communications Start Switch A 45 A 75 Tag Data Link Communications Status A 43 A 73 Tag Data Link Communications Stop Switch A 75 Tag Data Link Connection Failed A 40 A 71 Tag Data Link Setting Error
71. CPU Unit is not possible for some operations e Names CPU Unit name Operation Commands Online editing Memory All Clear event log clearing and setting the user program execution ID in the CPU Unit Synchronizing and Downloading User program CPU Expansion Rack Configuration and Setup EtherCAT Settings Controller Setup Axis Settings Cam Table Settings Data Trace Settings User defined Event Setup restoring 12 36 Correction You cannot access the Administrators password Always record the Administrator password so that you do not for get it Log in with verification authority that is equal to or higher than the verification rights when you connected online lf the password for verification of operation authority is entered incorrectly five time in row operation is locked for 10 minutes Wait until the operation lock is released Verification of operation authority is required every time for the following functions to prevent hazards to equip ment and people e Operating mode change by a Maintainer e Online editing by a Maintainer You can release the operation lock with an operation authority that is equal to or higher than the operator The required operation authority will be that of an operator the operation authority that was verified when going online with the Sysmac Studio The source data was not downloaded along with the user program You will be able to read the data if you download the
72. Connections Me TU U Te Directly specify the IP address of the remote device or select the remote device from the node list Connecting to EtherNet IP through USB Sysmac Studio TH Vig MIH HE Directly specify the IP address of the remote device or select the remote device from the node list NJ series CPU Unit Software User s Manual W501 10 5 h 2 N O o gt gt D O o O o gt Ce o h o o lt n 3 o oO wm mp S S o SUOI O UUOD ulIljUO MO yL SUONeINBYUOD Z OL 10 Communications Setup 10 2 2 Configurations That Do Not Allow Online Connections Routing through CS CJ series EtherNet IP Units Ports You cannot connect to an NJ series Controller by routing through a CS Cu series Ethernet IP Unit or port CS1W EIP2 CJ1W EIP21 CJ2 CPU Unit built in EtherNet IP port or CU2M CPU Unit built in EtherNet IP port Sysmac Studio D O SoS SFB LESS ay a a cay A ee ay ay E EtherNet IP P P 7 CJ2 CPU Unit built in EtherNet IP port or EtherNet IP Units Routing through Networks Other Than EtherNet IP Such as DeviceNet You cannot route through any networks other than EtherNet IP networks For example routing is not possible for Controller Link networks and DeviceNet networks Sysmac Studio OS a CILLI IFIP O OSS o gt LCS C _ lt 7
73. Constant is downloaded but you cannot overwrite a constant the value afterwards This attribute allows you to use CIP com Do not publish Do not publish munications and data links to read write Publish Only Network Publish variables from outside of the Controller Input Output NJ series CPU Unit Software User s Manual W501 6 29 P amp S Z D ea D N S JqENHLA JO S MNAUUY p E 9 6 Programming Attribute Specification Default An Edge attribute allows you to detect e None None when the input parameter of a function e Change to TRUE Edge block changes to TRUE or changes to e Change to FALSE FALSE This can be used only on BOOL input variables EN Additional Information Exclusive Control between Tasks You can restrict writing to global variables to a single task to prevent changes to the values of global variables during processing Specify this as a task setting not as a variable attribute Attributes Supported by Each Type of Variable i Variable Data AT Spec Initial Network Sup Sup Sup Sup Sup Sup Sup Not sup Internal Sup Sup Sup Sup Sup Sup Not sup Not sup variables ported ported ported ported ported ported ported ported Programs External Not sup Not sup Not sup Not sup Not sup Sup Not sup Not sup variables ported ported ported ported ported ported ported ported Internal Sup Sup Sup Sup Sup Sup Not sup Not sup variables
74. Controller events Master Function Module EtherNet IP Function Module System defined variables Errors in Special Units Error status Detected Controller errors Errors in EtherCAT slaves NJ series CPU Unit Software User s Manual W501 9 49 P fo m lt 5 re O O UOIBWUOJU pue s10113 191 01 U00 SJUBAF JOI ONUOD 9 6 9 CPU Unit Functions 9 6 4 User defined Events User defined Errors and Information i Introduction These errors and information are defined by the user You can use instructions to create them User defined Errors These errors are defined by the user Use the Create User defined Error SetAlarm instruction to create user defined errors When this instruction is executed a user defined error is recorded in the event log The corresponding system defined variable changes to TRUE User defined errors are not reset when the operating mode changes User defined Information User defined information is user defined notification information This information does not indicate errors Use the Create User defined Information Setlnfo instruction to create user defined informa tion When this instruction is executed user defined information is recorded in the event log Event Setting Tables Detailed information User fault level Instruction Event logs Program An event occurs SetAlarm User defined events System defined Variables User defined error
75. DATIDEN cate maberel sontadentan Staines arcaaetaaes 6 30 6 3 6 POS RIVATING Data TYPES sito cates lather o a eeeeluiat savsadaet ner cae ce causendoavacbawaucetigiveessluacesds 6 38 6 3 7 Array Specifications and Range Specifications for Data Types cccccssseeeeeeeeeeeeeeeeeeeeeeeens 6 44 6 3 8 WaMIAOIS PALM IU C Sasser acted cust tie taices E E N seadeeunasced satcaadene staves enee 6 50 6 3 9 Changes to Variables for Status Changes cccceeceeeeee ee eeeeeeeeee eee eeeeeeeeeeeeaeaneeeeeeeeaaaneeeeeeeenas 6 57 G 3210 Function BIOCk Instances said tecl ah cst set Fae a te ca tamrtenaedaaa encsavaecuetedcaeaacueads 6 59 6 3 11 Monitoring Variable Values ccccccccsssccceeseeeceeseeceeseeeeeeeeeeeaeeeeeeaeeeeeaeeeeeaeeessaseeeeaseeensaesesseaess 6 59 6 3 12 Restrictions on Variable Names and Other Program related Names ccccccsseeeeeeeeeeeeeeeeees 6 60 Constants Literals iiien i aaa aia aa 6 61 6 4 1 CONSENS seian So saad a N wataaaaisdd 6 61 6 4 2 Iyp ES ORG ONStaANIS secr N inten neta Reuse 6 61 Programming Languages srini a a a ea ENS 6 65 6 5 1 Programming LangdageS essi ganr aA OO DEDA 6 65 6 5 2 Ladder Diagram Lang age snese eiae a a a e at TOA 6 65 6 5 3 SUPUCTUREO Text Language eci a cosa E a 6 71 MSFUCUONS a a a a a a A a EEAS 6 102 6 6 1 HIStHLICUIONS aeoea E a E ieecedsleentens 6 102 6 6 2 Basic Understanding of Instructions cccccsseeceeeceeeeeeeeseeeeeecseseeeeseeeeeeesaaseeeessua
76. Electronic gear ratio rotation Positions that can be managed Command positions and actual positions Negative positive or 0 long real data LREAL command units Position command values Positions can be set within a 40 bit signed integer range when con verted to pulses Velocity command values Negative positive or 0 long real data LREAL command units s NJ series CPU Unit Software User s Manual W501 Appendices Item NJ501 1300 NJ501 1400 NJ501 1500 Motion Acceleration command values and deceleration Positive or 0 long real data LREAL command units s2 control command values Jerk command values Positive or 0 long real data LREAL command units s Override factors 0 00 or 0 01 to 500 00 Axis types Servo axes virtual Servo axes encoder axes and virtual encoder axes Same as process data communications cycle of EtherCAT communica Motion control period tions i 65 535 points max per cam table Number of cam data points Cams 1 048 560 points max for all cam tables Number of cam tables 640 tables max Supported services Sysmac Studio connection Peripheral z r USB port Physical layer USB 2 0 compliant B type connector Communications protocol TCP IP UDP IP and BOOTP client Sysmac Studio connection tag data link CIP message communica Supported services tions socket service FTP server automatic clock adjustment NTP cli ent SNMP agent and DNS client Communi 10Base T or 100Base TX Net
77. For detailed specifications on outputs refer to the NU series Instructions Reference Manual Cat No W502 Functions and Function Blocks Functions and function blocks are placed along the connecting line to receive the power flow and operate accordingly For detailed instruction specifications refer to the NJU series Instructions Refer ence Manual Cat No W502 i Order of Execution for Ladder Diagrams Inputs outputs functions and function blocks are executed when they receive the power flow The order of execution for a ladder diagram is from top to bottom Elements at the same level are executed from left to right i Ladder Diagram Completion A ladder diagram is executed in order from top to bottom When the execution reaches the very bottom the process is completed However the process will also end if an END or RETURN instruction is encountered at any point during the process No processes after those instructions are executed i Controlling Execution of Ladder Diagrams Ladder diagrams are generally executed from top to bottom but you can use execution control instruc tions to change the execution order In the following example when the value of program input a changes to TRUE execution will move to the point labeled ExceptionProcessing Input a gt Label ExceptionProcessing Bi b Input c Label ExceptionProcessing Input d Input e NJ series CPU Unit Software User s Manual W501 6 Programmin
78. Func cations stop tions stop or continue tions continue tion Module depending on the fail soft operation settings EtherNet IP commu Part of the EtherNet IP EtherNet IP communica nications stop The communications stop It tions continue Sysmac Studio and is possible to connect EtherNet IP Function NS series PT cannot communications when Module connect communica the Sysmac Studio or tions NS series PT communi cations connection is not the cause of the error I O Operation for a Major Fault Level Controller Error e The following table gives the operation for the following errors N i or Z O gt h pe ee D x O O U C C 2 paea e Unsupported Unit Detected e I O Bus Check Error e End Cover Missing e Incorrect Unit Expansion Rack Connection e Duplicate Unit Number e Too Many I O Points e I O Setting Check Error Unit CPU Unit operation Unit or slave operation EtherCAT slave The slave is placed in the Safe Depends on the slave settings Operational state CJ series Basic I O Unit Refreshing is stopped e All outputs are turned OFF e All inputs are turned OFF CJ series Special Unit Refreshing is stopped Depends on the Unit operating specifications the ERH indicator lights Servo Drive Updating the command values is All axes stop immediately stopped Settings and setting methods depend on the slave Refer to the manual for the slave For a Servo Drive o
79. Going Online 1 Go online The Verification Dialog Box is displayed F3 Verification Operation authority Administrator i Password CEEA 2 Select the operation authority enter the password and click the OK Button The following warn ing is displayed if the password does not match Click the OK Button and then try to go online again 3 Sysmac Studio Password not matched i Specifications Types of Operation Authorities You can use the following two operation authorities on the Sysmac Studio English name Administrator Maintainer Examples of Online Operations for Operation Rights Examples of the online operations that are allowed for each operation authority are given below Refer to the Sysmac Studio Version 1 Operation Manual Cat No W504 for details OK Operation possible VR Verification required for each operation NP Operation not possible Status monitor example Administrator Maintainer Monitoring errors for troubleshooting OK I O monitor operations examples Administrator Maintainer I O monitor Reading K OK l 9 18 NJ series CPU Unit Software User s Manual W501 9 CPU Unit Functions Status monitor example Administrator Maintainer A O A I O monitor Writing Controlling BOOL variables SET RESET Forced refreshing AIA OIO A A Controller operations examples Administrator Maintainer RUN mode PROGRAM mode Online editing A lt J A Z T Resetting
80. Literals 0 00 es 6 61 6 4 1 CONSTANTS maset erent asin nc wee tated bo eer den eed hoe A 6 61 6 4 2 Types of Constants 0 0 ccc eee ees 6 61 Programming Languages 0 cece eee eee ees 6 65 6 5 1 Programming Languages cece eee ee ee eee 6 65 6 5 2 Ladder Diagram Language 0c cece eee e eee 6 65 6 5 3 Structured Text Language 0c ees 6 71 NJ series CPU Unit Software User s Manual W501 6 1 6 Programming 6 2 6 6 IISTFUCTIONS aaria eed Seis aie a E 6 ee ere ee es ee 6 102 6 6 1 WPS UICTIO IIS Shc or rt cee a rat ert a le ea eye eS a ees Bete Serene oes 6 102 6 6 2 Basic Understanding of Instructions 0 00 cee ees 6 102 6 6 3 Operation for Instruction Errors 0 0 00 ee es 6 105 Programming Precautions 000 c eee eee ees 6 108 6 7 1 Array Specifications for Input Variables Output Variables In Out Variables 6 108 6 7 2 Structure Variables for Input Variables Output Variables In Out Variables 6 108 6 7 3 Master C ONILOl 2 iu 2 nd Se BA BAS amp Rh 2 eed abe Sas eet ales 6 109 NJ series CPU Unit Software User s Manual W501 6 Programming 6 1 Overview of Programming Procedures This section provides an overview of programming procedures The shaded steps in the overall procedure that is shown below are related to programming Step 1 Software Design Step 1 1 Designing I O and Processing Step 1 2 Designing Tasks
81. Meaning Packet Monitoring Stopped Global local Global Function TRUE when packet monitoring is stopped Data type BOOL Range of values TRUE or FALSE R W access Rs Retained Not retained Network Publish Published Usage in user program Possible Related instruc Stop Packet Monitor tions e EC_StopMon Start Packet Monitor e EC_StartMon Variable name _EC_LinkStatus Meaning Link Status Global local Global Function TRUE if the communications controller link status is Link ON Data type BOOL Range of values TRUE or FALSE R W access R ss Retained Not retained Network Publish Published Usage in user program Related instruc tions a w Oo D z O ot O 5 o O 5 a Q v w lt m mp D F Q h 5 D Q S o D o Variable name _EC_PktSaving Meaning Saving Packet Data File Global local Global Function Shows whether a packet data file is being saved TRUE Packet data file being saved FALSE Packet data file not being saved Data type BOOL Range of values TRUE or FALSE R W access R ss Retained Not retained Network Publish Published Usage in user program Possible Related instruc Saving Packet Data File tions e EC_SaveMon Variable name _EC_InDatalnvalid Meaning Input Data Invalid Global local Global Function TRUE when process data communications are not normal and the input data is not valid Data type BOOL Range of values TRUE or FALSE
82. Not supported A A Bo Operation When the IDs Do Not Match When the IDs do not match an ID Verification Error major fault level Controller error occurs and the CPU Unit does not operate However to reset the error you must cycle the power supply to the Controller or reset the Controller from the Sysmac Studio User Program Execution ID Character Specifications P V D O c lt Maximum size without NULL O to 9 A to Z and a to z 8 to 32 characters Usable characters Case sensitivity di uonnoexy weiboId 12SN BY JO SUOIOLISEY uogeado HUN Ndo v v 6 NJ series CPU Unit Software User s Manual W501 9 27 9 CPU Unit Functions 9 5 Debugging 9 5 1 This section describes debugging The NJ series Controller provides the following debugging operations e Forced refreshing e Changing present values e Online editing e Data tracing Forced Refreshing f Description Forced refreshing allows the user to refresh external inputs and outputs with user specified values from the Sysmac Studio to debug the system Forced refreshing is executed not for the specified device vari ables but for the I O ports that are assigned to the device variables The state that is specified with forced refreshing is retained until forced refreshing is cleared from the Sysmac Studio Refer to Hold ing Clearing Forced Refreshing on page 9 31 for information how forced refreshing is retained or cleared accor
83. Nput Execution condition variable The hierarchical relationships between programs functions and function blocks are shown in the fol lowing figure Program 2 Functions Function blocks Functions Functions 6 2 4 Details on Programs i Program Structure Programs consist of a local variable table and an algorithm You can use any function or function block in the algorithm of a program Function blocks Program P Local variable table Assigned Algorithm E You cannot call programs from other POUS NJ series CPU Unit Software User s Manual W501 6 7 P N u O C O _ u Oo te D 3 O a D N D a e 5 Cc g Ssyoo g uonouny pue suonouny sweipoid UBEMI9G savuq E Z 9 6 Programming Program Execution Conditions Programs are executed when the task they are assigned to is executed Order of Execution You can set the order of execution of all programs in a task You specify this order under Task Setup Program Assignments in the Sysmac Studio Related System defined Variables Programs all have the following system defined variables in the local variables i e internal vari ables name type P_First_Run First RUN TRUE for one period when PROGRAM mode BOOL Read Mode Period Flag changes to RUN mode Use this flag to perform initial processing when the CPU Unit begins operation P_PRGER Instruction This flag changes
84. Packet was received with a Rout Check the FINS message at the ing Error routing error source and correct the unit number in the response frame or a command frame that does not require a response to a unit number that is in the routing table Packet was received with a No Check the FINS message at the Routing Table routing error source and correct the routing table to include the network address of the source network Packet was received with an Check the FINS message at the Event Area Size Over Limit rout source and correct the event area ing error size in the response frame or a com mand frame that does not require a response so that it does not exceed the limit 7 There is insufficient space inthe Reduce the frequency of sending Keep the frequency of sending FINS internal buffer FINS messages at the source messages as low as possible 8 FINS message routing failed because the communications load is too high Attached Attached information 1 Cause of discarding packets information 1 01 hex 2 02 hex 3 03 hex 4 04 hex 5 05 hex 6 06 hex 7 07 hex 8 08 hex The numbers refer to the numbers of the above causes Precautions None Remarks 12 34 NJ series CPU Unit Software User s Manual W501 12 Troubleshooting Event name Packet Discarded 80120000 hex Meaning One or more packets were discarded Source PLC Function Module Source details None Detection At FINS message timing reception ol
85. Precautions This section describes precautions for developing a user program 6 7 1 Array Specifications for Input Variables Output Variables In Out Variables Some instructions handle array variables Example DataTypeTable OOOO Data type 3 data 0 data 0 UINT 5 6 7 2 Structure Variables for Input Variables Output Variables In Out Variables Some instructions have structure variables for input output or in out variables Example SerialRcv_instance Operating SerialRcv Execute Done InPort Port Busy UINT 13 Size Error DstDat ErrorlD RecvDat 0 RecvDat 0 ErrorIDEx RevSize RecvSize 6 108 NJ series CPU Unit Software User s Manual W501 6 Programming In this case you must create a structure variable for the input output and in out parameters then use the MOVE instruction to set the values Example Variable Table Data type SPORT Execution Inline ST Sets values in the Inport structure variable condition 1 InPort UnitNo _CBU_No00 Serial Communications Unit with unit number 0 2 InPort PhysicPortNo USINT 2 Serial port 2 SerialRcv_instance SerialRcv Execute Done InPort Port Busy UINT 13 Size Error DstDat ErrorlD RecvDat 0 RecvDai 0 ErrorlDEx RevSize RecvSize 6 7 3 Master Control i Introduction Master control is used to make output FALSE for all processing between the MC Master Control Start instruction and the MCR Ma
86. Primary periodic task I O refreshing User program execution Motion control Priority 16 periodic task I O refreshing User program execution Priority 17 periodic task User program execution Examples of Task Separation For example if you separate the tasks by the I O response performance that is required by the con trolled devices you can achieve the control performance that is required for devices that need high speed response and execute programming that requires more processing time in separate tasks 5 2 2 Specifications Item Specification Type of task e Primary periodic task e Periodic task Numbers of tasks e Primary periodic task 1 e Periodic tasks 0 to 3 tasks Number of programs per 128 max task Task period of the primary 500 us 1 ms 2 ms or 4ms periodic task Task periods of periodic Set the task period of each periodic task to an integer multiple of the task period of tasks the primary periodic task Any of the following can be set Task period of the primary periodic Task periods that you can set for periodic tasks 1 ms 2 ms 3 ms 4 ms 5 ms 8 ms 10 ms 15 ms 20 ms 25 ms 30 ms 40 ms 50 ms 60 ms 75 ms or 100 ms 1 ms 2 ms 3 ms 4 ms 5 ms 8 ms 10 ms 15 ms 20 ms 25 ms 30 ms 40 ms 50 ms 60 ms 75 ms or 100 ms 2 ms 4 ms 8 ms 10 ms 20 ms 30 ms 40 ms 50 ms 60 ms or 100 ms 4 ms 8 ms 20 ms 40 ms 60 ms or 100 ms 5 2 3 Basic Operation of Tasks Task E
87. Project Button Sysmac Studio Version 1 2 Insert a Controller Insert Controller ea Manual Cat No NJ series CPU Unit Software User s Manual W501 1 9 1 Introduction The following Controller Configurations and Setup and the Programming and Task Settings can be performed in either order Step 2 1 Slave and Unit Configurations 1 Creating the Slave and Unit Configura tions 2 Assigning Device Variables to I O Ports Creating the slave configuration and Unit configuration either offline or online For online configuration make the online con nection that is described in step 5 EtherCAT Slave Setting 3 2 Creating the EtherCAT Editor Slave Configuration Unit Editor 3 3 Creating the Unit Con figuration The following step is for motion control 3 Creating the Axes and Assigning Them to the Servo Drive Encoder Input Slaves Step 2 2 Controller Setup Registering device variables in variable 3 4 I O Ports and Device tables Variable names are user defined or Variables automatically created Creating the axes and setting them as real Configurations and 3 5 Creating the Axes and axes or virtual axes Creating axes groups Setup Motion Con trol Setup Assigning Them to the Servo Drives Encoder Input Slaves ee Section 4 Controller Setup Configurations and 4 2 Initial Settings for the Setup Controller PLC Function Module Setup Operation Settings to perform inte
88. R W access R Retained Not retained Network Publish Published Usage in user program Related instruc tions Note All system defined variables that are related to the status of EtherCAT communications give the current status A069429 ainpoy uonoun4 194SeW LV0104 S v Y 9J WEN NJ series CPU Unit Software User s Manual W501 A 67 Appendices A 4 6 EtherNet IP Function Module Category Name _EIP Functional Classification EtherNet IP Communications Errors Variable name _EIP_ErrSta Meaning Built in EtherNet IP Error Global local Global Function This is the error status variable for the built in EtherNet IP port It represents the following error flags e _E P_PortErr Communications Port Error e _EIP_CipErr CIP Communications Error e EIP_TcpAppErr TCP Application Communications Error Note Refer to A 3 7 Meanings of Error Status Bits for the meanings of the error status bits Data type WORD Range of values 16 0000 to 16 00F0 Usage in user program Possible Related instruc You can access this variable from the user program with the following tions instruction e GetEIPError Variable name _EIP_PortErr Meaning Communications Port Error Global local Global Function This is the error status variable for the communications port It represents the following error flags e _EIP_MacAdrErr MAC Address Error e _ElP_LanHwErr Communications Controller Error e E IP_EtnCfgErr Basic Ethernet
89. Rack or there is an I O Control Unit on an Expansion Rack Incorrect Power Supply Unit Connected There is a CJ series Power Supply Unit connected to the CPU Rack The operation of the Controller is stopped HUN Ndd 94 Ul SIO 824 Z L Z4 CPU Unit Watchdog Timer Error This error occurs in the CPU Unit This error occurs when the watchdog timer times out because of a hardware failure or when temporary data corruption causes the CPU Unit to hang i Checking for Fatal Errors You can identify fatal errors based on the status of the PWR indicator on the Power Supply Unit and the RUN and ERROR indicators on the CPU Unit as well as by the ability to connect communications to the Sysmac Studio Indicator Communications CPU Unit operating PWR green RUN green ERROR red with Sysmac Studio status Not lit Not lit Not lit Not possible Power Supply Error Lit Not lit Not lit CPU Unit Reset Lit Flashing 3 s intervals Lit Incorrect Power Sup ply Unit Connected Lit Not lit Lit CPU Unit Watchdog Timer Error Power Supply Errors and Incorrect Power Supply Unit Connected errors can be differentiated with the indicators There is no need to check communications with the Sysmac Studio NJ series CPU Unit Software User s Manual W501 12 3 12 Troubleshooting 12 1 3 Non fatal error in CPU Unit f Event Levels Non fatal errors that occur are managed as Controller events in the NJ series Controller Controller events ar
90. Response Times Determine whether to use the primary periodic task or the 5 2 4 Assign priority 16 periodic task for the I O refreshing of each Unit and _ ing 1 0 Refresh slave ing to Tasks Devices slaves Units Primary periodic task H weeet p C h sie iea l _ Priority 16 Periodic Task Assign the slaves and Units to the task for I O refreshing Determine which programs to assign to the primary periodic 5 2 5 Assign task and to the priority 16 to priority 18 periodic tasks ing Tasks to Programs Design the exclusive control methods for variables between 5 2 7 Ensuring tasks Concurrency of Variable Values Design the exclusive control methods for variables between tasks when the between Tasks same global variables are used in different tasks Design the tasks to access variables from outside of the 5 2 8 Synchro Controller nizing Variable l l l Access from Design the tasks to enable synchronizing accessing variables in the CPU Outside the Unit from outside of the Controller including EtherNet IP tag data links Controller with with the execution of a program in a specific task Task Execution i Task Settings on the Sysmac Studio Setting the Tasks Reference Initial Settings for the PLC Function Module 4 2 Initial Set Task Settings Task Periods I O Settings Program Assignments Task we ee Interface Settings and other settings Module N
91. S V 9J WEN NJ series CPU Unit Software User s Manual W501 A 35 Appendices EN Additional Information Typical Relationships for the Built in EtherCAT Error Flags Variable varan E Variable Name Event level Name Name _EC_ErrSta Built in _EC_PortErr Communi _EC_MacAdrErr MacAdrErr MAC Address Error Address Error Partial fault EtherCAT cations Ce ae LanHwErr level Error Port Error Controller Error _EC_LinkOffErr LinkOffErr Link Link OFF Error Error Minor fault _EC_MstrErr Master a _NetCfgErr Network M me Error tion Information Error _EC_NetCfgCmpErr Network Configura tion Verification Error _EC_NetTopologyErr Network Configura tion Error _EC_PDCommeErr Process Data Com munications Error _EC_PDTimeoutErr Process Data Recep tion Timeout _EC_PDSendErr Process Data Trans mission Error _EC_SlavAdrDupErr Slave Node Address Duplicated Error _EC_ SlaviInitErr Slave Initialization Error _EC_SlavAppErr Slave Application Error _EC_CommeE rrTbl Communications Error Slave Table _EC_MsgErr EtherCAT Message Observation Error _EC_SlavEmergErr Emergency Message Detected _EC_SlaveErr Slave _EC_SlavErrTbl Slave Error Table Defined by Error the slave Note The values of all system defined variables that are related to errors in EtherCAT communications do not change until the cause of the error is removed and then the error in the Controller is reset with the trouble shooting functions o
92. S 9 Example BOOL variable BOOL variable NJ series CPU Unit Software User s Manual W501 6 67 6 Programming Connections Based on the BOOL Variable Positions The top BOOL variables are connected to the left and right bus bars In other words they become the power flow input and power flow output Top BOOL variable Top BOOL variable Power flow Power flow There is only one power flow input and one power flow output for each function or function block All other BOOL variables that are not at the top are for parameter inputs and parameter outputs MyFB BOOL INT IN1 Val_Out l l BOOL variable INT BOOL BOOL variable that is not that is not at the Val In at the top top 7 nn SIN2 2 Parameter input You cannot connect multiple BOOL variables to the left bus bar or the right bus bar as shown below BOOL NG KOK se Qt BOOL MyFB BOOL INT IN Val_Out INT BOOL Val_In NG You do not have to connect an OUT instruction to the right bus bar You can connect the function or function block directly 6 68 NJ series CPU Unit Software User s Manual W501 Cascade Connections 6 Programming Cascade connections in which the output of a function or function block is connected to the input of another function or function block are allowed only for power flow outputs and inputs Example CliPRead GO BOOL Execute BOOL Handle BOOL SrcDat
93. Setting Error _EIP_IPAdrDupErr IP Address Duplication Error _EIP_BootpErr BOOTP Server Error _EIP_IPRTblErr TCP IP Advanced Setting Error Note If a Link OFF or Built in EtherNet IP Processing Error occurs it is recorded in the event log and then the corre sponding bit turns ON Refer to infor mation on the meanings of the error status bits at the end of this appendix for details NJ series CPU Unit Software User s Manual W501 Appendices values _EIP_CipErr CIP Communica This is the error status variable for CIP com WORD 16 0000 to page A 69 16 00F0 tions Error munications It represents the following error flags e _E lP_IdentityErr Identity Error e E P_TDLinkCfgErr Tag Data Link Setting Error e _E P_TDLinkOpnErr Tag Data Link Con nection Failed e _EIP_TDLinkErr Tag Data Link Communi cations Error e _EIP_TagAdrErr Tag Name Resolution Error e ElP_MultiSwONErr Multiple Switches ON Error Note If a Tag Resolution Error occurs it is recorded in the event log and this vari able changes to TRUE Refer to infor mation on the meanings of the error status bits at the end of this appendix for details _EIP_TcpAppErr TCP This is the error status variable for TCP appli WORD 16 0000 to page A 69 Application Com cation communications 16 00F0 munications Error r oo lt m a D Q D y 5 D Q S oJ D o It represents the following error flag
94. Subnormal numbers have less effective digits than normal numbers Therefore if a calculation with normal numbers results in a subnormal number or if a subnormal number results in the middle of such a calculation the effective digits of the result may be less than the effective digits of a normal number Data Processing The floating point format expresses only an approximate value Therefore there may be a difference between the floating point number and its true value There is also a limited number of effective dig its for these values Therefore the following actions are taken when you perform calculations with the floating point format Rounding If the real value exceeds the effective digits of the mantissa the value is rounded off according to the following rules e The result of the calculation will be the closest value to the value that can be expressed as a float ing point number e f there are two values that are the closest to the real value e g if the real value is the median value of two approximate values the mantissa with a least significant bit value of O is selected as the result of the calculation NJ series CPU Unit Software User s Manual W501 6 Programming Overflows and Underflows An overflow occurs when the absolute value of the true value is larger than the maximum value that can be expressed in the floating point format An underflow occurs when the absolute value of the true value is smaller than t
95. TRUE or BOOL_variable BOOL 1 i Numbers Integers Notation Example Remarks data_type base numeric_value INT 10 1 e Data types SINT USINT INT UINT DINT UDINT LINT or ULINT e Base 2 8 10 or 16 data_type numeric_value This is interpreted as decimal data Note You cannot omit data_type and just enter base numeric_value Any variables that are entered in that form for instruction parameters result in errors Example You cannot enter only 16 1A You cannot enter just numeric_value Any variables that are entered in that form for instruction parameters result in errors Example You cannot enter only 7 NJ series CPU Unit Software User s Manual W501 6 61 T O e 5 m D D _ re D D D s Ue SUOD Y 9 6 Programming 6 62 Real Data data_type base numeric_value LREAL 10 3 14 Data types REAL or LREAL Base 10 data_type numeric_value LREAL 3 14 This is interpreted as decimal data numeric_value 3 14 If data_type is omitted the value is interpreted as LREAL decimal data Note Express real number variables as REALnumeric_value Example Correct REAL_variable REAL 3 14 Wrong REAL_variable 3 14 i Bit Strings Bit String Data Notation Remarks data_type base numeric_value WORD 16 0064 e Data types BYTE WORD DWORD or LWORD e Base 2 8 or 16 Note Express bit string data as bit_string_data_type ba
96. Timeout Error 60030000 hex Two consecutive I O refresh failures occurred during the primary periodic task or periodic task period PLC Function Module Source details None Detection Continuously timing Level Major fault Recovery Cycle the power Log category System supply or reset the Controller The task period setting is too short Check the task execution time and Design the tasks considering the cor change the task period to an appro rections that are given on the left priate value The priority of the periodic task is Increase the priority of the periodic incorrect task There are too many Units and slaves Move the I O refresh processes to that perform I O refresh in the task other tasks for example move I O refresh processes within the task to other tasks period Attached Information 1 Name of task where error occurred None The specified system service execution time could not be obtained PLC Function Module Source details None Detection Continuously timing Level Major fault Recovery Cycle the power Log category System supply or reset the Controller There is no unused time available for Check the time that is available for Set the system service time accord task execution task execution and increase the task ing to the corrections that are given period to ensure that there is suffi on the left cient task execution time Insufficient System Service Time Error The system servic
97. Unit from the Sysmac Studio Unit Configuration Sysmac Studio LL LIII L LLL IIZ LLL PLL PG LLP LL TPP LL LILA Comparison between the Unit Configuration on the Sysmac Studio Computer and the Unit Configuration in the Physical CPU Unit You can compare the Unit Configuration on the Sysmac Studio with the Unit Configuration Informa tion that is stored in the CPU Unit to see if they match before you download the Unit Configuration to the CPU Unit from the Sysmac Studio Sysmac Studio Unit Configuration ALD LIZZIE LIZ Z7 LF ZLLT LISS L RALLT Unit Configuration Information 3 10 NJ series CPU Unit Software User s Manual W501 3 I O Ports Slave Configuration and Unit Configuration 3 4 I O Ports and Device Variables This section describes the I O ports and device variables that you use to access the EtherCAT slaves and CJ series Units of an NJ series Controller 3 4 1 I O Ports and Device Variables i I O Ports An I O port is a logical interface that is used by the CPU Unit to exchange data with external devices slaves and Units I O ports are automatically created when you create the slave and Unit configura tions on the Sysmac Studio You assign device variables to I O ports to enable accessing the slaves and Units from the user program p A O u O a T D a g lt O D S D z o CPU Unit Variables Device variables I O ports are logical
98. Using Motion Control Instructions You use the Axis Variables in the system defined variables CPU Unit sjuewubissy O pUe SejqeueA Z Z Z EtherCAT slaves to which axes are not assigned System defined Variables Assigned axis Axis Variable 2n P EtherCAT Assigned axis Axis Variable EtherCAT Refer to 3 5 2 Axis Variables and Axes Group Variables for details NJ series CPU Unit Software User s Manual W501 2 9 2 CPU Unit Operation Interfacing CJ series Units Accessing Basic I O Units You use device variables for CJ series Units CPU Unit Basic I O Units Device Variables I O Ports Variable Ch1_in00 Variable Ch1_In15 Refer to3 4 7 I O Ports and Device Variables and 3 4 2 Registering Device Variables for details Accessing Special Units There are two ways to access Special Units Using Device Variables to Specify Operating Data and Setup Data You use device variables for CJ series Unit to specify operating data allocated ClO Area words and setup data allocated DM Area words for Special Units CPU Unit Example Analog Input Unit Device Variables I O Ports e Operating Data e Operating Data O Input 1 converted Ch1_RdAl value Variable C Input 1 disconnection Ch1_SensErr detection e Setup Data e Setup Data Variable Input 1 enable setting Chi_InChUseCfg Input 1 mean value rocessing settin Ch1_AveCfg P g g Refer to 3 4 1 I O Ports and Device Var
99. Variable Table Variable name Here array variables are used to specify instances of the function block definition TON and all input parameters and output parameters All of the element numbers are incremented to execute five instances in succession Data type ARRAY 0 4 OF BOOL ARRAY 0 4 OF BOOL ARRAY 0 4 OF TIME ARRAY 0 4 OF TON UINT NJ series CPU Unit Software User s Manual W501 6 Programming Execution Conditions for Function Blocks Function blocks do not have an EN input like functions They are executed each period Processes That Require Constant Data Monitoring Case Algorithm in FB ENO Operations other than ENO Normal opera Executed Normal end TRUE Output parameters Values are updated tion according to the internal algorithm In out parameters Values are updated according to the internal algorithm Error end FALSE Output parameters Retained In out parameters Values are updated according to the internal algorithm Inside a mas Executed when the state of User specified One of the above depending on the value ter control the power flow input is of ENO region FALSE Refer to 6 5 2 Ladder Diagram Language for details on power flow output and parameter output You can specify the edge for an input variable to make the variable TRUE only when the input parameter changes to TRUE fo Instance A Variable A Instance X Specifies detecting a change to TRUE You can
100. When the user program is downloaded e When the Clear All Memory operation is performed Note When the encoder home offset data is not retained the status is given in the error status of the axis variable and not in this flag Functional Classification Programming values P_On Always TRUE This flag is always TRUE BOOL TRUE page A 52 Flag P_Off Always FALSE This flag is always FALSE BOOL FALSE page A 52 Flag P_CY Carry Flag This flag is updated by some instructions BOOL TRUE or page A 52 FALSE P_First_RunMode First RUN Period TRUE for one task period when PROGRAM BOOL TRUE or page A 53 Flag mode changes to RUN mode FALSE Use this flag to perform initial processing when the CPU Unit begins operation P_PRGER Instruction Error This flag changes to and remains TRUE when BOOL TRUE or page A 53 Flag an instruction error occurs It remains TRUE FALSE until changed to FALSE from the user pro gram r wo w lt m a D 3 Q D h 5 D Q S z D z D o A106929 ON J9 04 U0D SOUAS PN EJBAC BU 104 SB QeUeA PeUulJep WaISAS g Y NJ series CPU Unit Software User s Manual W501 A 29 Appendices Functional Classification Communications values Gives the number of internal logical ports that are currently used You can use this variable when you debug the user program Number of Used Ports _Port_numUsingPort Network Commu nications Instruc tion Enabled Flag _Port_isAvailable
101. a new Battery within five minutes at 25 C of turning OFF the power supply If power is not supplied for at least 5 minutes the saved data may be lost NJ series CPU Unit Software User s Manual W501 Precautions for Safe Use i Unit Replacement e We recommend replacing the Battery with the power turned OFF to prevent the CPU Unit s sensitive internal components from being damaged by static electricity and to prevent malfunctions The Bat tery can be replaced without turning OFF the power supply To do so always touch a grounded piece of metal to discharge static electricity from your body before you start the procedure After you replace the Battery connect the Sysmac Studio and clear the Low Battery Voltage error e Make sure that the required data including the user program configurations settings variables and memory used for CJ series Units is transferred to a CPU Unit that was replaced and to externally connected devices before restarting operation Be sure to include the routing tables network parameters and other CPU Bus Unit data which are stored in the CPU Unit i Disposal e Dispose of the product and Batteries according to local ordinances as they apply 1 G9 PETE SA E e The following information must be displayed for all products that contain primary lithium batteries with a perchlorate content of 6 ppb or higher when shipped to or transported through the State of Califor nia USA Perchlorate Material
102. a variable with the same name as the function For example the return value of a function called MyFUN is MyFUN Definition of MyFUN IF IN gt 100 MyFUN 100 ELSE MyFUN IN END_IF Variable Execution Conditions for Functions A function is executed when EN is TRUE The function a processing when EN changes to FALSE Input variables Algorithmin FUN in Algorithmin FUN Operations other than ENO EN TRUE Executed Normal end Output parameters Values are updated according to the internal algorithm In out parameters Values are updated according to the internal algorithm Error end FALSE Output parameters Values are retained In out parameters Values are updated according to the internal algorithm EN FALSE Not executed n Output parameters and in out parameters Values a retained Inside a master Not executed FALSE Output parameters and in out parameters Values control region are retained NJ series CPU Unit Software User s Manual W501 6 21 P N u O C O _ u Oo D 3 O a D N D a e 5 Cc g SUOI OUNS uo s i q 9 7 9 6 Programming Example BOOL variable A Algorithm within function MyFUN I I I I I P On I BOOL variable B I in Function execution You can change ENO with the algorithm in the function BOOL variable A BOOL variable B ENO 6 2 7 Operation That Applies
103. allowed refresh the specified Units PeriodicTask loaded to CPU or slaves Unit Program Assignment Settings The Program Assignment Settings are used to assign the programs to tasks and set the program execution order Recess Configurations and Setup oma T f gt i EtherCAT gt Sb CPU Exqpansion Racks V B PrimaryTask amp I O Map ba m 3 Program0 gt 7 Controller Setup w gt i Motion Control Setup amp Cam Data Settings gt Event Settings a P Task Settings Gz Data Trace Settings D N 5 U D gt Q _ O mp gt D u rm O TI c gt oO O Q a D Changes in Parameter RUN mode Program Execu Assigns the programs to the Assign the pro Programo When down Not allowed tion Order specified tasks and sets the grams in the loaded to CPU order of program execution order to execute Unit within the tasks them from top to bottom sBullles YSeL Z y Settings for Exclusive Control of Variables in Tasks The Settings for Exclusive Control of Variables in Tasks are used to set the tasks that refresh speci fied global variables and the tasks that access specified global variables dainn Configurations and Setup s 1 Configurations and Setup V Be PrimaryTask Variable to be re Data Type Variable CommerPeriodicTaskO0 Accessing Task PeriodicTask1 Accessing Task Periodi sampieoo1 eoor f o z a v N a Y fa Periodi
104. an error if Detect tion the task execution time exceeds the specified task period e Detect a minor fault level Controller error is generated e Do not detect an observation is recorded in event log Refer to Task Period Exceeded Error on page 5 21 for details Task Timeout Detection Time Set the time to detect timeouts if task execution does not end e g if there is an infinite loop Set a multiple of the task period 1to5 Refer to Task Execution Timeout Error on page 5 22 for details Variable Access Time Set the percentage of the task period to assign to variable access 1 to 50 Refer to Variable Access Time Ratio on page 5 19 for details Parameters for Periodic Tasks Changes in RUN mode Task Type You can set any of the following When Not Priority 16 periodic task trans allowed Sion pariodeiask ferred to riority 17 periodic tas CPU Unit Priority 18 periodic task Parameter Setting range epeale Execution priority Automatically set to 16 17 or 18 Task Name Text string Period Task period Refer to 5 2 2 Specifications Execution Condi tions Task Period Exceeded Detec The same as for the primary periodic Thesame tion task as for the primary periodic task Task Timeout Detection Time Variable Access Time NJ series CPU Unit Software User s Manual W501 5 Designing Tasks Sysmac Studio Setting Procedure Add and set the tasks in the Task Settings under Configu
105. an output parameter all values after that parameter are not output but their values are retained Example Function EN ENO Example when variable is outside the range of the elements in array variable x OUT1 OUT2 i eee Errors in In Out Parameters If an error is detected in an in out parameter the function or function block is not executed and ENO is FALSE The power flow output is also FALSE but all other values are retained Function OFF EN ENO enn nm nmnmers Le INOUT INOUT Retained y 97 Retaine Example when variable is outside the range of the elements in array variable x f Recursive Calling The following recursive calls are not allowed for functions or function blocks They will result in an error when you compile the user program on the Sysmac Studio e A function or function block cannot call itself e A called function or function block cannot call the calling parent 6 2 8 POU Restrictions This section describes the restrictions in the creation of POUs i Names Refer to 6 3 12 Restrictions on Variable Names and Other Program related Names for restrictions on POU names and function block instance names i Passing Multiple Arguments If you need to pass multiple arguments to a function or function block use an array specification or structure to pass the required data This will make your program simpler However be aware that if you use an
106. and concurrency prob lems in relation to the error status of the function module It is used only to sample the task status for data tracing from the Sysmac Studio You can also use the GetMyTaskStatus and Task_IsActive instructions to read task status from the user program You cannot access the following variables directly through system defined variables Variable name Meaning Description paa R W type R YA i gt ep pen my Cc O O gt 02 J D ped prn D Q pe O D op 02 _TaskName_Active Task Active Flag TRUE during task execution BOOL FALSE when task execution is not in progress _TaskName_LastExecTime Last Task Execu Gives the last execution time of the task TIME R tion Time _TaskName_MaxExecTime Maximum Task Gives the maximum value of the task exe TIME R Execution Time cution time _TaskName _MinExecTime Minimum Task Gives the minimum value of the task exe TIME R Execution Time cution time NJ series CPU Unit Software User s Manual W501 5 19 5 Designing Tasks Variable name Number of Task Executions _TaskName_ExecCount Task Period Exceeded Flag _TaskName_Exceeded Task Period Exceeded Count _TaskName_ExceedCount Flag Operation type Contains the number of executions of the UDINT R task If the present value exceeds the maximum value of the data type the present value returns to O and the count is continued TRUE if the task period
107. and enumerations are derivative data types A variable that is used to access a specific device through an I O port To transfer data from the Sysmac Studio to the Controller with the synchronization operation of the Sysmac Studio One of the attributes of a variable This attribute makes a BOOL variable pass TRUE to a function block when the vari able changes from FALSE to TRUE or when it changes from TRUE to FALSE NJ series CPU Unit Software User s Manual W501 Term enumeration enumerator EtherCAT Master Function Module EtherNet IP Function Module event log Event Setup FB forced refreshing FUN function function block function module general purpose slave global variable I O map settings I O port I O refreshing information Initial Value inline ST instruction literal local variable main memory major fault level Controller error MC Test Run memory used for CJ series units Terminology Description One of the derivative data types This data type takes one item from a prepared name list of enumerators as its value One of the values that an enumeration can take expressed as a character string The value of an enumeration is one of the enumerators One of the function modules This function module controls the EtherCAT slaves as the EtherCAT master One of the function modules This function module controls the built in EtherNet IP port A function that recognizes and records err
108. and estimates e Standard instructions e Arithmetic instructions for LREAL data e Trigonometric instructions for LREAL data Simple Estimate For the number of instructions in each group read the execution time for each group from the follow ing graphs and calculate the total e Execution time for standard instructions e Execution time for arithmetic instructions for LREAL data e Execution time for trigonometric instructions for LREAL data This will allow you to estimate the execution time of the user program The instruction execution times are different for ladder diagrams and structured text NJ series CPU Unit Software User s Manual W501 A 19 p N O O fet gt Q Q Q LA 5 1 _ O D x m X O c y e gt 3 1 SOU uono xg yse eHesery y Buene L gz Y Appendices Ladder Diagrams Find the execution times from the following graphs and calculate the total e Execution Time for Standard Instructions 2000 1800 1600 1400 1200 1000 800 600 Execution time us 400 200 0 O 10000 20000 30000 40000 50000 60000 70000 80000 90000 100000 Total number of instructions e Execution Times for Arithmetic and Trigonometric Instructions for LREAL Data 2000 1800 1600 1400 1200 1000 800 Execution time us 600 400 200 0 100 200 300 400 500 600 700 800 900 1000 Total number of instructions Trigonometric instructions for LRE
109. and operation is performed according to the user program Clearing all forced refreshing values was specified by the user None None Memory All Cleared 900B0000 hex All of memory was cleared PLC Function Module Source details None Detection Commands from timing user User program Operation Operation returns to the factory state cleared all of the memory None None Event Log Cleared 900C0000 hex The event log was cleared PLC Function Module Source details None Detection Commands from timing user C E The event log was cleared by the user Attached information 1 Cleared events 0 All log categories were cleared 1 The system event log was cleared 2 The access event log was cleared 100 The user defined event log was cleared None NJ series CPU Unit Software User s Manual W501 12 27 b Y N fa o D o S O 5 eo SUOIIGI9S98Q 10113 p Z Z1 12 Troubleshooting Event name Power Turned ON 90110000 hex Meaning The power supply was turned ON Source PLC Function Module Source details At power ON timing Effects User program Operation Operation starts a doe e a Attached None information Precautions None Remarks Event name Power Interrupted 90120000 hex Meaning The power supply was interrupted Source PLC Function Module Source details None Detection At power inter timing ruption Effects All operations stops Attached None infor
110. between Controllers Communications en H Updating Clock Information You can obtain clock information from an NTP server to update the built in clock NTP server EtherNet IP NTP client NJ series CPU Unit Software User s Manual W501 10 Communications Setup Specifying Host Names You can use the DNS client or set up your Hosts so that you can specify the IP address of the NTP server or SNMP manager or the target destination of a socket instruction or CIP communications instruction with a host name instead of an IP address Example Setting Host Names on the DNS Server z DNS server O o gt m S Vn 9 gt fos o D p D D O o gt mp oO n tet gt a2 ey 9 lt D n ua m q suonen yuon uonsauuoy 0 EtherNet IP THS are Obtaining an IP Address When the Power is Turned ON You can obtain an IP address for the built in EtherNet IP port from the BOOTP server when the power supply is turned ON z BOOTP server HEL Specifying an SNMP Agent Built in EtherNet IP port internal status information is provided to network management software that uses an SNMP manager aaah SNMP manager DNS client EtherNet IP lt Ul UE BOOTP client S19 O1JUOD u m q SUOITEINBYUOD UOI O UUOD L E 0L EtherNet IP Ti ALE
111. cece A 40 A 71 Tag Name Resolution Error cccssseeeseeeeees A 40 A 71 Target Node Error Information 0000c008 A 44 A 74 Target PLC Error Information ccccsssseeeeee A 44 A 74 Target PLC Operating Mode eseeeeee A 43 A 73 Task Active Flag ccccsseecseeeeseeeeeeeeees 5 19 A 27 A 47 task design example agieanincate a ds 5 26 Task Exceeded Flag ccscssceessseeteseeeeteeeeess A 27 A 49 task exclusive Control instructions cccceeeeeeeeeeees 5 16 Task Execution Count cccccceseeceeseeeeeeeeeeeeenes A 27 A 48 task execution status gaelaliteldiale mene eeerencrerrerr ser a ners terre tres 5 23 Task Execution Status Monitor cccccccceeeeseeeeeeeeeeees 4 8 Task Execution Time Monitor a nns 4 8 5 24 Task Execution Timeout Error cccccseeeceeeeeeeeeeees 5 22 Task Execution Timeout Time ccccceeeeseeeeseeeeeees 4 6 task EXECUTION TIMES cccceeeceeeeceeeeceeeeseeeeeeseeeeeeeens 5 26 Task NAME rrini neseniai 4 5 4 7 Task Period Exceeded Count 08 5 20 A 27 A 49 Task Period Exceeded Error cccsseccseeeesseeeeeeeees 5 21 Task Period Exceeded Error Detection 000008 4 6 Task Period Exceeded Flag ccccsseccsseeeeeeeeeeeeeaees 5 20 WaSK SeUINOS Sai a eee 4 5 MASK UV IOC caria se ceuathebsasumncsiaia sexnensate 4 5 OSKE fet os ee cee eae tote tee eater
112. consists of one or more statements One statement is the equivalent of one process State ments are executed from top to bottom one line at a time until the process is completed Statements are made up of keywords and expressions A keyword is a symbol or string that expresses assignment or execution control An expression is a code that calculates a value from variables constants function return values and or a combination of those along with various operators A statement represents a process that completes by itself Expressions form a statement by using a combination of values and keywords Example of an Assignment Statement Assignment Variables Operators Constant Return value of function keyword Comment A B 100 ABC 10 20 Assign A to B 100 ABC 10 20 Expression Example of an IF Construct IF keyword IF keyword IF D E 100 DEF 10 20 THEN Expression G H TRUE if D and E 100 DEF 10 20 are equal otherwise FALSE Sauna Statement keyword END_IF ST Language Expressions Statement Separators e Statements must end with a single byte semicolon Statements are not considered complete with only a carriage return at the end This allows you to write long statements across multiple lines e One statement must end with one single byte semicolon In the following example the IF con struct contains a single assignment statement Each statement must be ended with a single byt
113. data types except for text strings Data types Arrays specify the element structures specify the member and unions specify the member Sampled data 10 000 samples per variable The trigger position is set in respect to the overall trace Setting trigger positions time or quantity Basic data types except for times durations dates and text strings Arrays specify the element structures specify the member and unions specify the member BOOL TRUE or FALSE Non BOOL Equals Greater than gt Greater than or equal Less Than lt Less than or equal lt Not equal Condition data types SUMING TNs 21 Re Condition expression Note Combinations of multiple condition expressions are not permitted Trace Trigger ON Sampling is performed when the TraceTrig instruction is instruction executed Evaluation timing When sampling is executed Starting tracing at start You can set tracing to start automatically when operation Starting a trace of operation is started Maximum data storage You can set the maximum amount of time to save contin period uous trace data Maximum data storage You can set the maximum total size of all files saved dur size ing continuous tracing You can set the number of data items to save in each file during a continuous trace Setting continuous i You can specify the location to create files to save data traci File save location i i racing during a continuous trac
114. ee ead 2 3 assigning tasks tO programs s ccceeeeeeeeeeeeeeeees 5 13 monitoring task execution status and task execution times eis cecodsesiceshex le eceleesteeceteeedecek 5 23 operating mode seine Steet eet iestecteiecse tied det 5 8 order Of program execution ccccseeeeeeeeeeeeeeeeeees 5 13 ro WL p E E A meg eam tre E ae ro nner na a cre ee 5 5 overall opera lOl sis ienn aai 5 7 POUs that you can assign to tasks ceeeee 5 13 processing of tasks and system services 5 8 NJ series CPU Unit Software User s Manual W501 Index SPECICATION sederni a wslaan cade 5 6 synchronizing variable access with task execution 5 18 task execution order cccccesecesesseeeseeseeteeeeenseeeenes 5 8 task execution priority cceecccseeeeeceeeeeeseeeeeneeeeenes 5 6 TCP Application Communications Error A 39 A 69 TCP IP Advanced Setting Error eee A 40 A 70 TCP IP Basic Setting Error cccccsssseeeeeees A 39 A 70 TCP IP Setting Error cntcxinatocthdnatecvovesiecancanestea A 40 A 72 TEXTS MINGS aein a e 6 32 UME ON OA roe EE 6 32 Total Power ON TIME anniren A 29 A 51 Trace Busy Flag ccccsssseecsssseeeeeseeeseees 9 40 A 30 A 54 Trace Completed Flag ccccsseeeeeeees 9 40 A 30 A 54 Trace Parameter Error Flag 000 9 40 A 30 A 55 Trace Trigger Monitor Flag cccseeee 9 40 A 30 A 54 transferring
115. eee ee eee 4 4 4 2 3 TASK SENNO S vce decact its resets apa sseticetoeis senceteasectaatebecs cosets seta ta tah atta Bees oaks aes a ema eae eas 4 5 4 2 4 Unit Contiguration and URItS Clu piisestancincciictsennecdiaatin dae a a 4 9 initial Settings for Special Units siscasececascen cazcecssccecsavecenssscdacsscesssanctesareesesceuscaveicessecsasatessoisect 4 11 Initial Settings for the Motion Control Function MOdulle cccccsssseesesseeeeseeseeeseeeenneees 4 13 4 4 1 MU OCUCHON ae aa tcsscrttecstantstaennd estat E 4 13 4 4 2 Seting Method Sse ced ned N and Ae sol te cee ba eh el ated a a 4 14 Initial Settings for the EtherCAT Master Function Module sccceceeeeseeeeeeeseeeeeeeneees 4 15 Initial Settings for the EtherNet IP Function MOdule ccccsssseesssseeeesseeeeeseeseeseeeeesneees 4 16 Designing Tasks Overview of Task Designing Procedure cccccessecceeseeseneeseeneeeenseeeeenseeeenseeeeaeeeoeasenoeeneesoas 5 2 TASIGSY STONY i iisicnisereicetie reads a a aa E A 5 5 5 2 1 NEROGUICTI A A EE E EE EE EAEL E E een aa nade a eee EE E eae Ocak icat 5 5 5 2 2 SPE CINC ON ce ene eee Dera eee fe cre eRe erin ent frcnhe ener sere tonne Preteen rene chk re tenr tanner or ee ee nee erry 5 6 5 2 3 Basic OperalloimOr Tasks 2224 2 es eet ce a De bee ete ole ee a te ad ee eens 5 6 5 2 4 Assigning I O Refreshing to Tasks ississcssicvcdceevei see boue cesses tact ce otdedinacl saselcusgeemielw aa cescdatesienciiuleiesind 5 1
116. file management Windows firewall settings for connections from computers and details on memory used for CJU series Units NJ series Motion Control Instructions Reference Manual Cat No W508 Section Section 1 Introduction to Motion Control Instructions Section 2 Variables and Instructions Section 3 Axis Command Instructions Section 4 Axes Group Instructions Section 5 Common Command Instructions Appendices Description This section gives an introduction to motion control instructions supported by NJ series CPU Units This section describes the variables and instructions for the Motion Control Function Module This section describes the instructions that are used to perform single axis control for the MC Function Module This section describes the instructions to perform multi axes coordinated control for the MC Function Module This section describes the instructions that are used for both axes and axes groups The appendices describe the error codes that are generated by the instructions NJ series CPU Unit Software User s Manual W501 Manual Configuration i NJ series Troubleshooting Manual Cat No W503 Section Section 1 Overview of Errors Section 2 Error Troubleshooting Methods Section 3 Error Tables Description This section describes the errors that can occur on an NJ series Controller the oper ation that occurs for errors and methods to confirm errors This section d
117. fine tune the setting from there NJ series CPU Unit Software User s Manual W501 5 Designing Tasks 5 3 4 System Input and Output Response Times The times that are required for the system to produce an output after it receives an input are described in this section The I O response times depend on various conditions The input response times and output response times between external devices and the slaves and Units must be added to the system I O response times i Sequence Control with Basic I O Units Refreshing between Basic I O Units and external devices is performed in the primary periodic task or the priority 16 periodic task The I O response times that include EtherCAT communications times are given below Performing Control with the Programs in the Primary Periodic Task The Controller makes a response in the following I O response time Minimum I O response time Primary period Example Controlling Unit A and Unit B with the Primary Periodic Task a 2 D o J D O Q gt m x lt Q 3 3 D Q gt Q Z O JJ D xe O gt D 5 D Priority 16 periodic task j oOo Note The above diagram shows only one input and one output However the I O response time may be as follows depending on the timing of the input from the Unit Maximum I O response time Primary task period x 2 Performing Control with the Programs in the Priority 16 Periodic Task
118. for a list of the reserved words Variable name including POU instance names POU definition names Data type Structure member names and union member names Characters that cannot be used together A text string that starts with a number 0 to 9 Strings that start with P_ A text string that starts in an underline _ character A text string that contains more than one underline _ character A text string that ends in an underline _ character Any text string that consists of an identifier and has a prefix or postfix which contains more than one extended empty space character i e multi byte spaces or any other empty Unicode space characters Enumerators Task names Full paths of vari able names Device names Section names Axis names Axes group names Cam table names Reserved Words Multibyte Maximum Case i Charac Reserved character ie size not oe sensitiv f ter words compatibil it including anecdin ity y NULL g Refer to Supported Not case 127 bytes UTF 8 Reserved sensitive Words below 63 bytes Network vari able 255 bytes Other 511 bytes 127 bytes Case sensitive Not case sensitive If any names are the same as a reserved word an error will occur when you check the program Names That Must Be Unique The following names must be unique An error is detected during the program check if they are not Global variable names
119. function the value of the in out parameter changes at that time e You cannot omit in out parameters e You cannot access the values of in out variables from outside of the function Internal vari No limit Internal variables are used for temporary storage within a function ables e The value is not retained after execution is completed e You cannot access the values of internal variables from outside of the function NJ series CPU Unit Software User s Manual W501 6 19 6 Programming 6 20 Variables External vari ables EN ENO Return value No limit Oor 1 Specification External variables access global variables This is a BOOL input variable used to execute the function e The function is executed when EN is TRUE e You must have one EN variable This applies to both user defined functions and FUN instructions Generally this is a BOOL output variable that is set to TRUE for a normal end and to FALSE for an error end e You can omit the ENO variable from user defined functions e Refer to ENO below for details The return value is the value that is returned from the function to the POU that called the function The return value is the value that is returned to the calling instruction It repre sents the results of the process after the algorithm in the function is executed e Each function must have one return value e You can specify enumerations of all basic data types You cannot specif
120. group on the Sys tem Studio a user defined axes group vari able with a different name is created Refer to the NJ series Motion Control Instruc tions Reference Manual Cat No W508 for details on structure members _MC_AX 64 Axis Variables Used to specify axes and shows single axis control status and single axis control settings for motion control instructions When you create an axis on the System Stu dio a user defined axis variable with a differ ent name is created Normally you use an Axis Variable with a dif ferent name Refer to the NJ series Motion Control Instruc tions Reference Manual Cat No W508 for details on structure members NJ series CPU Unit Software User s Manual W501 Used to specify axes groups and shows multi values 16 0000 to page A 59 16 40F0 16 0000 to page A 59 16 00F0 ARRAY 16 0000 to page A 60 0 63 16 00F0 OF WORD ARRAY 16 0000 to page A 60 0 31 16 00F0 OF WORD _SCOMMO page A 60 N_REF _SGROUP_ page A 60 REF _SAXIS_ page A 61 REF A 33 a wo U lt m a D 3 Q D h 5 D Q S z D z D o Miobayed ajnpoy uoouNJ jo4JUOD OHO 7 E V OW SWEN Appendices A 3 5 EtherCAT Master Function Module Category Name _EC Functional Classification EtherCAT Communications Errors values Built in EtherCAT Error _EC_ErrSta _EC_PortErr _EC_MstrErr _EC_SlavErr _EC_SlavErrTbl Communications Port Error Mast
121. gt D m gt D j teh D TI c gt O pn e O Q D Double click EtherCAT under Configurations and Setup and then select the master on the Sysmac Studio The Initial Setting Tab Page for the EtherCAT Master Function Module is displayed Sr P n F Node AddressiNetwork configuration aw uc gt 33 EtherCAT Master Item name gt CPU Expansion Racks 1 I O Map 2 gt amp Controller Setup V Motion Control Setup 3 PDO Communications Cycle Time V i Axis Settings Total Cable Length 3 MC_Axis000 0 4 RS8D KNOIL ECT Rev 2 1 Fail soft Operation Setting 5 Axes Group Settings Wait Time for Slave Startup amp Cam Data Settings PDO communications timeout detection count gt Event Settings Revision Check Method I Task Settings Serial Number Check Method F7 Data Trace Settings Refer to the NJ series CPU Unit Built in EtherCAT Port User s Manual Cat No W505 for details EO _ces Rev 2 1 Model Product name R88D KNO1L ECT Rev 2 1 E002 Number of Slaves R88D KNO1L ECT Rev 2 1 E004 CJ2 CPU Unit Hardware User s Manual 4 15 4 Controller Setup 4 6 Initial Settings for the EtherNet IP Function Module 4 16 This section describes the initial settings that are required for the EtherNet IP Function Module The initial settings for the EtherNet IP Function Module are listed below TCP IP Settings Link Settings FTP Settings NTP Settings SNMP Setti
122. h 5 D Q S 9 o D o A105929 ON 19 04 U0D SOUOS PN EJBAC BU 104 SB QeUeA PeUIJep WaISAS p V Appendices A 4 2 PLC Function Module Category Name PLC Functional Classification Debugging Variable name _PLC_TraceSta 0 3 IsStart Meaning Trace Busy Flag Global local Global Function TRUE when a trace starts Note You cannot use these system defined variables in the user program It is used only to monitor the status of data tracing from the Sysmac Studio Data type Structure sTRACE_STA Members BOOL Range of values TRUE or FALSE Usage in user program Not possible Related instruc TraceTrig tions e TraceSamp You can access this variable from the user program only with the following instruction e GetTraceStatus Variable name _PLC_TraceSta 0 3 lsComplete Meaning Trace Completed Flag Global local Global Function TRUE when a trace is completed Note You cannot use this system defined variable in the user program It is used only to monitor the status of data tracing from the Sysmac Studio Data type Structure _sTRACE_STA Members BOOL Range of values TRUE or FALSE Usage in user program Not possible Related instruc TraceTrig tions e TraceSamp You can access this variable from the user program only with the following instruction e GetTraceStatus Variable name _PLC_TraceSta 0 3 ls Trigger Meaning Trace Trigger Monitor Flag Global local Global Function TRUE when the tri
123. if the task period was exceeded FALSE if task execution was completed within the task period Note You cannot use this system defined variable in the user program It is used only to access task status for data tracing from the Sysmac Studio Data type BOOL Range of values TRUE or FALSE Usage in user program Not possible Related instruc You can access this variable from the user program only with the following tions instruction e GetMyTaskStatus Variable name _ TaskName_ExceedCount Meaning Task Period Exceeded Count Global local Global Function Contains the number of times that the period was exceeded If the present value exceeds the maximum value of the data type the present value returns to O and the count is continued If 4294967295 is exceeded the value returns to 0 and counting is continued Note You cannot use this system defined variable in the user program It is used only to access task status for data tracing from the Sysmac Studio Data type UDINT Range of values Depends on data type Usage in user program Not possible Related instruc You can access this variable from the user program only with the following tions instruction e GetMyTaskStatus Functional Classification Errors Variable name _ErrSta Meaning Controller Error Status Global local Global Function TRUE if there is a Controller error FALSE if there is no Controller error Note Do not use this variable in the user progr
124. in out variable the data passed to the function block or function as a parameter is written and the original data is not retained 6 24 NJ series CPU Unit Software User s Manual W501 6 Programming EN Additional Information Specifying an Array Variable or Structure Variable as a Parameter You can also specify an array variable or a structure variable as an input or output parameter However it will take longer to pass and receive data for these data types in comparison to a vari able with a basic data type depending on the size Therefore when handling array variables or structure variables in a function block we recommend that you design them in such a way that these variables are passed to and received from in out variables Example 1 Specifying an Array Program Variable Table 3 Data type ARRAY O 199 OF INT a Sh lt lt lt gt a Soi m mk a msm mi ea Do not assign INT variable x 0 199 to the function block input variable IN1 Data type of the N7 input variable in the function block ARRAY 0 199 OF INT v Instead assign INT variable x 0 199 to the INOUT in out variable of the function block Data type of INOUT in out variable in the function block ARRAY 0 199 OF INT XxX IN1 OUT 1 P N u O C O _ u Oo D 3 O a D N D a e 5 Cc g Program Variable Table Data type O N MyStructure oo i ng gS Sa a a a a a oa a
125. in the same CPU Unit Variable names in the same POU Section names in the same POU Member names in the same union or structure Enumerators in the same enumeration Local variable names and global variable names POU names and data type names Data type names and variable names Enumerators of an enumeration and enumerators of another enumeration Enumerators and variable names NJ series CPU Unit Software User s Manual W501 6 Programming 6 4 Constants Literals This section describes constants in detail 6 4 1 Constants The value of a variable changes depending on the data that is assigned to that variable The value of a constant never changes Unlike variables constants are not stored in memory You can use constants in the algorithm of a POU without the need to declare them In the NJ series Controllers constants have a data type in the same way as variables 6 4 2 Types of Constants The following types of constants can be used with NJ series Controllers e Bits e Numbers e Bit strings e Times e Text strings The following tables show how to express different variables in an NJ series Controller i Bits TRUE or FALSE TRUE or FALSE TRUE is equivalent to BOOL 1 data_type numeric_value BOOL 1 or BOOL 0 FALSE is equivalent to BOOL 0 A Precautions for Correct Use You cannot express a BOOL value as 0 or 1 A compiling error will occur Example Wrong BOOL_variable 1 Correct BOOL_variable
126. incorrectly Configure the external circuits so that the power supply to the control system turns ON only after the power supply to the Controller has turned ON If the power supply to the Controller is turned ON after the control power supply temporary errors may result in incorrect control system signals because the output terminals on Output Units may momentarily turn ON when power supply is turned ON to the Controller i Actual Operation e Check the user program data and parameter settings for proper execution before you use them for actual operation Turning OFF the Power Supply e Never turn OFF the power supply to the Controller when the BUSY indicator is flashing While the BUSY indicator is lit the user program and settings in the CPU Unit are being backed up in the built in non volatile memory This data will not be backed up correctly if the power supply is turned OFF Also a major fault level Controller error will occur the next time you start operation and operation will stop e Do not turn OFF the power supply or remove the SD Memory Card while SD Memory Card access is in progress i e while the SD BUSY indicator flashes Data may become corrupted and the Control ler will not operate correctly if it uses corrupted data To remove the SD Memory Card from the CPU Unit while the power supply is ON press the SD Memory Card power supply switch and wait for the SD BUSY indicator to turn OFF before you remove the SD Memory
127. information Precautions Remarks Event name Meaning Source Error attributes Effects System defined variables Cause and correction Attached information Precautions Remarks 12 32 Unknown Destination Node 34110000 hex The send destination node is not known PLC Function Module Source details None Detection At FINS message timing reception Not affected Packets are discarded The send destination node was not Correct the setting of the send desti Set the send destination node for nation node for FINS UDP communi FINS UDP communications correctly cations found when a FINS message was sent None None FINS TCP Connection Table Setting Error 34130000 hex The FINS TCP connection table is incorrect PLC Function Module Detection timing Source details None At power ON Controller reset or restart of built in Ethernet port FINS UDP communications will not operate The power supply to the Controller Download the FINS TCP connection Do not interrupt the power supply to was interrupted or communications table again the Controller or disconnect commu with the Sysmac Studio were discon nications with the Sysmac Studio while downloading the FINS TCP connection table nected while downloading the FINS TCP connection table None None NJ series CPU Unit Software User s Manual W501 Event name Meaning Source Error attributes Effects System defined variabl
128. is continuously performed Sample data is transferred to the Sysmac Stu dio as it is collected and saved to a file The Sysmac Studio also continues to read the trace data When the display buffer is full the data is automatically saved to a CSV file You can use this to store trace results data for a long tracing period in multiple CSV files Sysmac Studio NJ series CPU Unit Data to trace Sampling LLI C ILLI ZIZI EP F F ee sae LLULL PPL PIL eo ca or CT ST fas Sampled data Continues NJ series CPU Unit Software User s Manual W501 9 CPU Unit Functions Data Tracing Specifications Item Description Set a trigger condition to start sampling Data from before and after the condition is met is saved Trace Type settings Sample data is transferred to a computer as it is col Continuous tracing l lected and saved to a file Period of specified task Specify a task The period of that task is set as the sam pling period The time you enter is set as the sampling period How Setting of timing of Specified fixed interval ever the time you enter is rounded off to an integer multi Triggered tracing sampling ple of the primary periodic task When the trace sam With this method sampling is performed whenever the pling instruction is exe raceSamp instruction is executed in the user program cuted Maximum number of 192 variables max targets Setting sampled data Basic
129. is the time that was required for the task from when task execution is started until it is completed The time to execute other tasks that were executed from when task execution was started until it was completed is not included wh oo D O n g D n amp 5 m x 3 d D 2 _ O J D o O 5 D D 3 D o Calculating Times on the Physical Controller You can check the following values in the Task Execution Time Monitor when you are connected to the physical Controller Connected to the Controller e The minimum average and maximum values of the task execution time e The degree to which the period is exceeded and the task period exceeded count The maximum values that are displayed on the Sysmac Studio are the results of operation on the physical Controller As described previously the maximum value of the task execution time varies depending on the internal status of the physical Controller As a result the maximum values obtained here may be exceeded in actual operation Use the following maximum values as guide lines Estimated Maximum Values for Task Execution Times Based on Information from the Physical Controller e Task period of 500 us Average value of task execution time Average value of task execution time Mini mum value of task execution time 100 us e Task period of 1 2 or 4 ms Average value of task execution time Average value of task execution time Minimum value of ta
130. last time the task was executed unit 0 1 us Note You cannot use this system defined variable in the user program It is used only to access task status for data trac ing from the Sysmac Studio Contains the maximum value of the task exe cution time unit 0 1 us Note You cannot use this system defined variable in the user program It is used only to access task status for data trac ing from the Sysmac Studio Contains the minimum value of the task exe cution time unit 0 1 us Note You cannot use this system defined variable in the user program It is used only to access task status for data trac ing from the Sysmac Studio Contains the number of executions of the task If 4294967295 is exceeded the value returns to 0 and counting is continued Note You cannot use this system defined variable in the user program It is used only to access task status for data trac ing from the Sysmac Studio TRUE if the task period was exceeded FALSE if task execution was completed within the task period Note You cannot use this system defined variable in the user program It is used only to access task status for data trac ing from the Sysmac Studio Contains the number of times that the period was exceeded If the present value exceeds the maximum value of the data type the present value returns to 0 and the count is continued If 4294967295 is exceeded the value returns to 0 and counting is continued
131. layer 2 Right click the master in the EtherCAT Configurations Editing Pane and select Display Produc tion Information The Production Information Dialog Box is displayed l3 Production Information fx Type information Serial number Node9 RSSD KNO1L ECT Rev 2 1 OMRON Corporation Oxo0000000 The following items are displayed Node address Type information Serial number If the model number cannot be determined Such as when there is no ESI file the vendor ID product code and revision number are displayed 40 NJ series CPU Unit Software User s Manual W501 Unit Versions Unit Version Notation In this manual unit versions are specified as shown in the following table Product nameplate Notation in this manual Remarks Ver 1 0 or later to the right of Unit version 1 0 or later Unless unit versions are specified the information in this manual the lot number applies to all unit versions NJ series CPU Unit Software User s Manual W501 41 Related Manuals Related Manuals The following manuals are related to the NJ series Controllers Use these manuals for reference Manual name NJ series CPU Unit Hardware User s Manual W500 NJ501 OUUL I W501 NJ501 OUUL I W507 NJ501 OUUL I W502 NJ501 OUUL I W508 NJ501 UOLUUL I CJ1W OOLULI NJ series CPU Unit Soft ware Users Manual NJ series CPU Unit Motion Control Users Manual NJ series Instructions Reference Manual NJ
132. logs that are recorded in the CJ series Units and EtherCAT slaves Event Log List Display 5 Troubleshooting P nc T eg f Source Details Event Name Rack No 0 Slot No 1 CJIW V680C12 CPU Unit Error Rack No 0 Slot No 1 CJIW V680C12 CPU Unit Error Rack No 0 Slot No 1 CJ1W V680C12 CPU Unit Error Communications port Link OFF Detected Communications port Link OFF Detected EtherNet IP Communications port Link OFF Detected EtherNet IP Communications port Link OFF Detected EtherCAT Master Node No 1 Network Configuration Verification Error EtherNet IP Communications port IP Address Duplication Error EtherNet IP Communications port DNS Server Connection Error EtherNet IP Communications port IP Address Duplication Error I O bus Master End Cover Missing TIN haan Mate TIN Deen Chanel Crene Source I O bus I O bus I O bus EtherNet IP EtherNet IP Entry Time 6 21 2011 5 55 12 AM 6 20 2011 6 14 59 AM 6 20 2011 5 05 11 AM 1 1 1970 10 38 22 AM 1 1 1970 10 38 16 AM 1 1 1970 9 35 15 AM 1 1 1970 9 34 56 AM 1 1 1970 9 24 00 AM 1 1 1970 9 23 32 AM 1 1 1970 9 21 39 AM 1 1 1970 9 21 35 AM 1 1 1970 9 19 44 AM IHAHA O A1OAA AM CECECGagaaae Py Display Settings Displayed Information ba System Event Log bu Access Event Log Level E Major fault amp Partial fault E Minor fault amp Observation W Information Details Attached information 1 Attached information 2 Attached information
133. names of MC_Axis is incremented from 000 in the order that the axis variables are created 2 Assign the axes that you created to Servo Drives or encoder input slaves in the EtherCAT Slave Configuration of the Sysmac Studio NJ series CPU Unit Software User s Manual W501 3 19 OAJ9S dy 0 Way Hulubissy pue sexy oy Huneal s SOARIS INdU J9pPpOIUZ S9ALIG ri wih oO O D fa m ped Q Cc o m gt x D 02 ped Q gt z 02 S fad o D 02 3 I O Ports Slave Configuration and Unit Configuration Set the Axis Basic Settings from the Sysmac Studio Classification Setting Axis Basic Set Axis Number Axis numbers are automatically set in the order that the axes tings are created Select Used Axis Axis Type Select a servo axis or encoder axis Input Device Specify the node address of the EtherCAT slave that is Output Device assigned to the axis 3 Use the Sysmac Studio to specify the settings required for Test Mode operation Unit Conver sion Count Mode Limits etc and the settings required for actual system operation Then transfer the settings to the CPU Unit with the project New Project A Configurations and Setup new_NJ5010 v l i gt aj EtherCAT A alin far a Axis number rrrrrrrrr Hl I O Map muu Axis use Used axis G gt M ee H Axis type Virtual servo axis v vs AoE co p Feedback control v X Axis Settings Inp
134. nization units text The local variable table for each POU is also included The local variable tables include the initial values of the variables The global variable table lists attribute information for the variables Global Variable Table that are shared by all POUs The global variable table includes the ini tial values of the variables e The Unit Configuration and Unit Setup contain information on the Unit Configuration and Unit configuration that enables the CPU Unit to recognize the Units Unit Setup This information is used to automatically create I O ports e Initial settings for Special Units EtherCAT This is the EtherCAT slave configuration Network con Slave Con figuration Ether figuration information CAT Con EtherCAT The EtherCAT Master Settings contain parameter figuratio Master Set settings for the EtherCAT Master Function Module n tings such as the communications cycle Process The process data table contains the device variables Data Table axis variables and process data The I O Map contains assignment information between the variables I O Map and the I O ports that are automatically created based on the Unit Configuration c i Operation The Operation Settings contain information that is used to change the eal Settings software operation of the CPU Unit figuration Control Built in The Built in EtherNet IP Port Settings contain the following settings s and ler Setup Ether TCP IP sett
135. not be adversely affected before you perform an MC Test Run Always execute the Save Cam Table instruction if you change any of the cam data from the user pro gram in the CPU Unit or from the Sysmac Studio If the cam data is not saved the previous condition will be restored when the power is turned ON again possibly causing unexpected machine operation The positive drive prohibit input POT negative drive prohibit input NOT and home proximity input DEC of the Servo Drive are used by the MC Function Module as the positive limit input negative limit input and home proximity input Make sure that the signal widths for all of these input signals are longer than the control period of the MC Function Module If the input signal widths are shorter than the control period the MC Function Module may not be able to detect the input signals resulting in incorrect operation f Battery Replacement The Battery may leak rupture heat or ignite Never short circuit charge disassemble heat or incin erate the Battery or subject it to strong shock Dispose of any Battery that has been dropped on the floor or otherwise subjected to excessive shock Batteries that have been subjected to shock may leak if they are used UL standards require that only an experienced engineer replace the Battery Make sure that an expe rienced engineer is in charge of Battery replacement Apply power for at least five minutes before changing the Battery Install
136. observation level Controller error has occurred i Battery Backup e The user program and initial values for the variables are stored in non volatile memory in the CPU Unit The present values of variables with the Retain attribute and the values of the Holding DM and EM Areas in the memory used for CJ series Units are backed up by a Battery If the Battery is not connected or the Battery is exhausted the CPU Unit detects a Battery backup Memory Check Error lf that error is detected variables with a Retain attribute are set to their initial values and the Holding DM and EM Areas in memory used for CJ series Units are cleared to all zeros Perform thorough verifications and provide sufficient measures to ensure that the devices perform safe operation for the initial values of the variables with Retain attributes and the resulting operation i Debugging e Forced refreshing ignores the results of user program execution and refreshes I O with the specified values If forced refreshing is used for inputs for which I O refreshing is not supported the inputs will first take the specified values but they will then be overwritten by the user program This operation differs from the force set reset functionality of the CJ series PLCs NJ series CPU Unit Software User s Manual W501 Precautions for Safe Use e You cannot upload or download information for forced refreshing with the Sysmac Studio After downloading data that contains forced refres
137. of program 2 H Precautions for Correct Use e Do not make the locked regions any longer than necessary If the lock regions are too long the task execution period may be exceeded e Always use the Lock and Unlock instructions in a pair in the same section of the same POU syse UBEeMjeq senjeA aiqeueA jo Aou nouo Bulunsuy Z S NJ series CPU Unit Software User s Manual W501 5 17 5 Designing Tasks 5 2 8 Synchronizing Variable Access from Outside the Controller with 5 18 Task Execution i Introduction To synchronize variable access from outside the Controller with task execution make the settings for exclusive control in tasks in the Task Settings Also particularly when using tag data links set the Variable Access Time in the Task Settings of the Sysmac Studio You can use the following methods to access global variables from outside of the Controller e EtherNet IP tag data links e Accessing variables from an NS series PT e Accessing variables from the Sysmac Studio Synchronization with task execution is achieved only for writing e Accessing variables with CIP communications from a host computer External device Controller CPU Unit Execution of task a Refreshing task settings Set task aas the a refreshing task for global variable A To synchronize these Vv Global variable A Variable Access Time Ensure sufficient time to access global variable A Se
138. of Access to the SD Memory Card 9 15 9 4 SSO CUE ag aei lad see eens Boece al eae eee cee ees ee Ae ae ace ae 9 17 9 4 1 Verification of Operation Authority 0 00 ees 9 17 9 4 2 CPU Unit Names and Serial IDs 2 0 0c es 9 19 9 4 3 Protections niseni We ase eo oh ee eh eae eae A RE ah e on 9 21 9 4 4 CPU Unit Operation Restrictions for the User Program Execution ID 9 25 9 5 Debugging srie toca eta ane ic as ace Sears Sears Saree a Ea eae Soames 9 28 9 5 1 Forced Refreshing i186 ae ik PEE REL eRe eee eee aeS ed 9 28 9 5 2 Changing Present Values secr ese ccawae cor ae cee eeu ce eee Eee 9 32 et INI CEI tok i an Rte eer ee en E en SS en ts Be at ee ee 9 34 9 5 4 alas IACIAG he er eea ete te en as a BR eos wack et ee ee ee Sh ee 9 35 9 6 EVCNULOOS tiisa oso eee eet oe cee tect dueed ete 9 43 9 6 1 MEOdUCION asa e a a toasted 8 oe ante les dd ne aes aes 9 43 9 6 2 Detailed Information on Event Logs 000 ee eee eee eee 9 44 9 6 3 Controller Events Controller Errors and Information 9 49 9 6 4 User defined Events User defined Errors and Information 9 50 NJ series CPU Unit Software User s Manual W501 9 1 9 CPU Unit Functions 9 7 Using the Sysmac Studio to Back Up and Restore Data 9 7 1 Backing Up and Restoring the Present Values of Battery backup Memory 9 57 9 2 NJ series CPU Unit Software User s Manual W501
139. of Simulation Features The many simulation features include execution debugging and task execution time estimates on a virtual controller Introduction to the System Configurations The NJ Series supports the following system configurations Basic System Configurations The NJ series basic configurations include the EtherCAT network configuration CJ series Unit con figuration and the Support Software EtherCAT Network Configuration You can use the built in EtherCAT master port on the CPU Unit to connect to general purpose termi nals for analog and digital I O and to Servo Drives and encoder input slaves An EtherCAT network configuration enables precise sequence and motion control in a fixed cycle with very little deviation CJ series Unit Configuration In addition to the EtherCAT network you can mount CJ series Basic I O Units and Special Units CJ series Units can be mounted both to the CPU Rack where the CPU Unit is mounted and to Expan sion Racks Support Software The Support Software is connected to the peripheral USB port on the CPU Unit with a commercially available USB cable You can also connect it to the built in EtherNet IP port on the CPU Unit with Ethernet cable Support Software C CJ series Unit r Configuration Supply Ti CPU Unit NJ series Controller CJ series Units rs Ht CPU Rack EtherNet IP T A E n Ee e E ee EtherCAT Network Be es a a a L a Configuration Built in EtherNet IP
140. of Variables in Tasks on page 4 7 i Method 2 Task Exclusive Control Instructions Use the task exclusive control instructions Lock and Unlock instructions when it is necessary to write the value of a global variable from more than one task The Lock and Unlock instructions are used to prevent execution of program regions between Lock and Unlock between different tasks Refer to information on the Lock and Unlock instructions in the NJ series Instructions Reference Manual Cat No W502 for details Example If execution of region 1 in task B is attempted during execution of region 1 in task A region 1 in task B is not executed until execution of region 1 in task A is completed even if the execution priority of task B is higher Here execution of region 1 in task A is given priority NJ series CPU Unit Software User s Manual W501 5 Designing Tasks Program Lock instruction Global variable Refreshed Higher priority Region 1 PE EEA Rane va ar Execution is not started until region 1 in task A is completed megom1 When execution of region 1 in task A is completed region 1 in task B is executed as shown below Program 1 Refreshed Program 2 Global variable k N D N o lt Region 1 a 3 Se Region 2 Executed Global variable Exclusive control of execution Refreshed Unlock instructions in region 1 is achieved with the Lock and of program 1 and region 2
141. of the called function block and give the parameter names of the calling POU ABC x1 x2 y1 ABC Function block instance name A and B Omitted Input or in out variable of called function block X1 and x2 Input or in out parameter of calling POU can be a constant C Omitted Output variable of called function block or constant y1 Omitted Output parameter of calling POU e Ladder Diagram Expression ABC y1 x1 MyFB A gt x2 B e6benbue7 1x9 painionus S 9 e The order of parameters is based on the function block definition The order is the same as the local variable definition for the function block from top to bottom Application This statement calls a function block NJ series CPU Unit Software User s Manual W501 6 95 6 Programming Example e Programming Notation 1 ChangeFix ToFloat Execute Exe Data32_1 FixPointData1 Data32_2 FixPointData2 NoOfDigit_1 FixPointPos1 NoOfDigit_2 FixPointPos2 OK gt Done Double_1 gt RealData1 Double_2 gt RealData2 Notation 2 ChangeFixToFloat Exe FixPointData1 FixPointData2 FixPointPos1 FixPointPos2 Done RealDatai RealData2 e Ladder Diagram Expression Exe FixPointData1 FixPointData2 FixPointPos1 FixPointPos2 e Function Block Definition Function block name ConvData32ToDouble Function Block Variables 6 96 I O Input variables Output variables e Program Variables Variable name ChangeFixToFloat Ex
142. of values that the vari able can take is given R W access R Read only Retained The Retain Network Publish The Network Publish attribute of the RW Read write attribute of the variable is given variable is given Usage in user program Whether you Related instruc The instructions that are related to the variable are given can use the vari tions If you cannot use the variable directly in the user program the instructions able directly in that access the variable are given the user pro gram is speci fied A 4 1 System defined Variables for the Overall NJ series Controller No Category Functional Classification Clock Variable name _CurrentTime Function This variable contains the CPU Unit s internal clock data Data type DATE_AND_TIME Range of values DT 1970 01 01 00 00 00 to DT 2106 02 06 23 59 59 Usage in user program Related instruc Clock instructions tions Functional Classification Tasks Variable name _ TaskName_Active Meaning Task Active Flag Global local Global Function TRUE during task execution FALSE when task execution is not in progress Note You cannot use this system defined variable in the user program It is used only to access task status for data tracing from the Sysmac Studio Data type BOOL Range of values TRUE or FALSE Usage in user program Not possible Related instruc ActEventlask tions You can access this variable from the user program only with
143. program Refer to information on the meanings of the error Status bits at the end of this appendix for details _MC_ComeErrSta Shows the status of errors that are detected in common processing for motion control Common Error Status You can use this variable directly in the user program Refer to information on the meanings of the error Status bits at the end of this appendix for details _MC_AX_ErrSta Shows the error status for each axis The sta tus of up to 64 axes is shown You can use this variable directly in the user program Refer to information on the mean ings of the error status bits at the end of this appendix for details Axis Error Status _MC_GRP_ErrSta Axes Group Error Status Shows the error status for each axes group The error status for up to 32 axes groups is shown You can use this variable directly in the user program Refer to information on the mean ings of the error status bits at the end of this appendix for details Shows the status that is common to the Motion Control Function Module Common Variable _MC_COM Refer to the NJ series Motion Control Instruc tions Reference Manual Cat No W508 for details on structure members _MC_GRPJ 82 Axes Group Vari ables axes coordinated control status and multi axes coordinated control settings for motion control instructions Normally you use an Axes Group Variable with a different name When you create an axes
144. program Possible Related instruc You can access this variable from the user program with the following tions instruction e GetEIPError Variable name _EIP_TcpAppErr Meaning TCP Application Communications Error Global local Global Function This is the error status variable for TCP application communications It represents the following error flags e EIP_TcpAppCfgErr TCP IP Setting Error e EIP_NTPSrvErr NTP Server Connection Error e EIP_DNSSrvErr DNS Server Connection Error Note Refer to A 3 7 Meanings of Error Status Bits for the meanings of the error status bits Data type WORD Range of values 16 0000 to 16 00FO R W access R ss Retained Not retained Network Publish Published Usage in user program Possible Related instruc You can access this variable from the user program with the following tions instruction e GetEIPError Variable name _EIP_MacAdrErr Function Indicates that an error occurred when the MAC address was read at startup TRUE Error FALSE Normal Data type BOOL Range of values TRUE or FALSE R W access Rs Retained Not retained Network Publish Published Usage in user program Related instruc tions Variable name _EIP_LanHweErr Meaning Communications Controller Error Global local Global Function TRUE The communications controller failed FALSE Normal Data type BOOL Range of values TRUE or FALSE R W access Rs Retained Not retained Network Publish Publis
145. program that is edited online is initialized a g D o re Q 5 A Precautions for Correct Use When online editing changes are applied the execution times of the affected tasks are extended Set the task period appropriately so that you do not cause a Task Period Exceeded error due to online editing 9 5 4 Data Tracing You can use data tracing to sample variables without any additional programming You can read and check the data from the Sysmac Studio and save the data to a file This is used to start up operate and maintain devices Bupe eed vt S 6 The two tracing methods are described below Triggered Tracing Trigger conditions are set to record data before and after an event Sampling stops automatically when the maximum number of sampled variables is reached e You can check the flow of the program based on the status of changes in the present values of variables e You can use the data to investigate the cause of unexpected changes in the present values of variables NJ series CPU Unit Software User s Manual W501 9 35 9 CPU Unit Functions 9 36 Sysmac Studio NJ series CPU Unit Data to trace CTL LLL LAZZ LIF LLL LAP ILA FFF LE FLL PILI LIFT L777 Sampled data Uploaded once When the maximum number of sampled variables is reached the trace stops and the trace data is sent to the Sysmac Studio and displayed Continuous Tracing Sampling without a trigger
146. reS 1 0E 6 Bealnurbers 64 bits 8 bytes LREAL 1 79769313486231e 1 23404 308 to 2 22507385850720e 308 LREAL 0 2 22507385850720e 308 to 1 79769313486231e 308 20 co 64 bits 8 bytes T 9223372036854 775808ms T 12d3h3s T T 3s56ms 106751d_23h_47m_16s_ 854 77 TIME 6d 1 5808ms to nog 10m TER ye T 9223372036854 775807ms_ IME 16d_Sh_3m_4s T 106751d_23h_47m_16s_85 T 12d3 5h 4 775807ms T 10 12s T 61m5s Equivalent to T 1h1m5s TIME 25h_3m 64 bits 8 bytes D 1970 01 01 to D 2106 02 06 Add DATE date D or d to the January 1 1970 to February 6 beginning of the string and express the date Date DATE 2106 in the yyyy mm dd format Example d 1994 09 23 64 bits 8 bytes TOD 00 00 00 000000000 to Add TIME_OF_DAY time_of_day TOD 23 59 59 999999999 TOD or tod to the beginning of the l TIME_OF 00 00 0 000000000 to string and express the time of day in the hh yeeie T 23 59 59 999999999 mm ss format Example tod 12 16 28 12 64 bits 8 bytes DT 1970 01 01 Add DT or dt to the beginning of the 00 00 00 000000000 to string and express the date and time in the DATE_ DT 2106 02 06 yyyy mm dd hh mm ss format Date and time AND_ 23 59 59 999999999 January 1 Example 21 February 6 2106 23 59 999999999 seconds Text strings Number of single byte characters plus 1 x 8 bits STRING The character code is UTF 8 0 to 1 986 bytes 1 2 0 to
147. refresh times are for the default PDO mapping parameters SOU uono xg yse eHesery y Buenen L gz Y Slave name Moda I O refresh time per slave us Input slave 16 points 1 5 Output slave 32 points 1 5 Analog Input Slave 2 5 Analog Output Slave 2 Encoder Input Slave 5 Servomotor R88D LIL 6 Expansion Unit 1 5 NJ series CPU Unit Software User s Manual W501 A 17 Appendices CJ series Units Basic I O Units Unit name 8 16 point DC Input Units 32 point DC Input Units 64 point DC Input Units 8 16 point AC Input Units 16 point Quick response Input Unit 8 16 point Transistor Output Units 32 point Transistor Output Units 64 point Transistor Output Units Relay Contact Output Units Triac Output Unit 24 VDC Input Transistor Out put Units 16 inputs 16 out puts 24 VDC Input Transistor Out put Units 32 inputs 32 out puts TTL Input Output Units 16 inputs 16 outputs B7A Interface Unit Special I O Units Unit name Analog Input Units Analog Output Units Analog I O Unit High speed Counter Unit Temperature Control Units Analog Input Unit with Univer sal Inputs ID Sensor Units I O refresh time per Unit us On CPU Rack Sh ean sion Rack CJ1W ID201 211 212 1 5 CJ1W ID231 232 233 2 J8 CJ1W ID261 262 4 J6 CJ1W IA201 111 kiia A i omom Eo CJ1W 0C201 0C211 CJ1W OA201 CJ1W MD231 232 233 AINI 1 5 1 5 o_o 1 5 1 5 1 5 CJ1W MD261 263
148. s Manual W501 Appendices values _EC_PDSendErr Process Data TRUE if there is a process data transmission BOOL TRUE or page A 63 Transmission error cannot send within the process data FALSE Error communications cycle or transmission jitter is over the limit _EC_SlavAdrDupErr Slave Node TRUE if the same node address is set for BOOL TRUE or page A 64 Address more than one slave FALSE Duplicated Error _EC_SlavinitErr Slave TRUE if there is an error in an initialization BOOL TRUE or page A 64 Initialization Error command addressed to a slave FALSE _EC_SlavAppErr Slave TRUE if there is an error in the slave s appli BOOL TRUE or page A 64 Application Error cation status register FALSE _EC_MsgErr EtherCAT TRUE when a message is sent to a slave that BOOL TRUE or page A 64 Message Error does not support messages or when there is FALSE an error in the format of the response to a message that was sent to a slave _EC_SlavEmergErr Emergency Mes TRUE if the master detects an emergency BOOL TRUE or page A 64 sage Detected message that was sent by a slave FALSE _EC_CommeErrTbl Communications Slaves are given in the table in the order of ARRAY TRUE or page A 65 Error Slave Table slave node addresses The corresponding 1 192 FALSE r wo w lt m mp D 3 Q D h 5 D Q S z D z D o slave element is TRUE if the master detected OF BOOL an error for the slave Miobeyed ainpoy uojoun Je sey LV0104
149. series CPU Unit Software User s Manual W501 6 93 6 Programming Construct Structure e g in an IF Construct FOR WHILE REPEAT lt statement gt IF lt condition_expression gt THEN EXIT END_IF END_FOR WHILE REPEAT Application Use EXIT to end a repeating process before the end condition is met Description e g in an IF Construct If the lt condition_expression gt is TRUE the repeat construct FOR construct WHILE construct or REPEAT construct is ended and all code inside the repeat construct after the EXIT statement is ignored Note 1 You can also specify a BOOL variable instead of an expression for the condition expressions 2 Even if the lt condition_expression gt is TRUE before lt statement gt is executed lt statement gt is executed Example Variable n is repeatedly incremented by 1 from 1 to 50 while the value of n is added to array vari able elements DATA n However if DATA n exceeds 100 the repeat construct is exited IF A THEN DATA 3 98 FOR n 1 TO 50 BY 1 DO DATA n DATA n n IF DATA n gt 100 THEN EXIT END_IF END_FOR A FALSE END_IF Function Block Calls Overview This statement calls a function block Reserved Words None Statement Structure Give the argument specifications to pass the values of the specified variables to the input variables of the called function block and the return value specification to specify the variable
150. slots on each rack uoleinByuoyD pun y Buneealg Z E E Unit Numbers Set the unit numbers for the CPU Bus Units and Special I O Units that are mounted Ae ots A Configurations and Setup new N5010 v g Item name Value Configurations and Setup r i i CJIW V680C12 ID Sensor Unit V680 series 2 antenna ty 0 Assigned unit numbers Special Unit Settings Programming Ji Method 2 Reading the Unit Configuration Online from the Actual Mounted Units and Transferring It This method can be used to treat the current physical Unit configuration as the correct configuration The Sysmac Studio is connected online to the physical Units to read the Unit configuration The user program is then created accordingly Then you download the Unit Configuration and user program to the CPU Unit NJ series CPU Unit Software User s Manual W501 3 9 3 I O Ports Slave Configuration and Unit Configuration a nae LLLA LLLP LEP Fy Configuration of physical Units 2 Download 3 3 3 Verifying the Unit Configuration You can perform the following Unit configurations comparison with the Sysmac Studio Comparison between the Unit Configuration on the Sysmac Studio Computer and the Physical Unit Configuration You can compare the Unit Configuration on the Sysmac Studio with the physical Unit configuration to see if they match before the first time you download the Unit Configuration to the CPU
151. specific operation is shown in the triangle and explained in text This example indicates a precaution for electric shock The triangle symbol indicates precautions including warnings The specific operation is shown in the triangle and explained in text This example indicates a general precaution The filled circle symbol indicates operations that you must do The specific operation is shown in the circle and explained in text This example shows a general precaution for something that you must do NJ series CPU Unit Software User s Manual W501 Safety Precautions WARNING During Power Supply Do not touch any of the terminals or terminal blocks while the power is being supplied Doing so may result in electric shock Do not attempt to take any Unit apart In particular high voltage parts are present in the Power Supply Unit while power is supplied or immediately after power is turned OFF Touching any of these parts may result in electric shock There are sharp parts inside the Unit that may cause injury Ol gt Fail safe Measures Provide safety measures in external circuits to ensure safety in the system if an abnormality occurs due to malfunction of the CPU Unit other Units or slaves or due to other external factors affecting operation Not doing so may result in serious accidents due to incorrect operation Emergency stop circuits interlock circuits limit circuits and similar safety measures must be
152. specifies the xth element of the array variable Mem the variable x has a value of 10 so this would point to the 10th element Variable Table Variablename Datatype X 10 y 20 Data x y This expression specifies the x yth element of the array variable Data the variable x has a value of 10 and variable y has a value of 20 so this would point to the 30th element Specifying An Array i e the Entire Array The array represents all elements that make up the array Arrays are expressed by the name of the array variable In the above examples the arrays are written as Mem and Data Creating an Array amp S Z D ea D N 1 Enter A into the Data Type Column of the variable table and select ARRAY OF from the list of possible data type name candidates 2 Enter the number of the first element in the array for the left question mark and the last number for the right question mark in the section Next enter the data type for the question mark in the OF section and register the variable Variable Table Data type abc ARRAY 0 4 OF INT Represents the data type of the array variable Represents the last number of the elements of the array Represents the first number of the elements of the array Array sodA geq 104 suoneoiioeds eabuey pue suonesiyioeds Aey 7 8 9 NJ series CPU Unit Software User s Manual W501 6 45 6 Programming
153. specify falling edges too fo Instance A Variable A Instance X 7 l Specifies detecting a change to FALSE P N u O C O _ u Oo te D 3 O a D N D a e 5 Cc g syoo q uooUN uo sjed S Z 9 NJ series CPU Unit Software User s Manual W501 6 15 6 Programming Accessing Variables in a Function Block from Outside the Function Block You can access the input and output variables of a function block from outside the function block Vari ables are written as follows InstanceName VariableName Example To Access Output Variable B of Function Block Instance FB1_Instance FB1_Instance B You can access the input and output variables for a function block only within the program that contains the function block However you cannot access these variables from within other function block instances even if they are in the same program You cannot access them from other programs Program P1 FB1_ Instance Input and Output Variables for FB1 e Access is possible only from within program P1 e Access is not possible from program P2 e Access is not possible from within FB2 Cannot be accessed Cannot be accessed FB2_Instance B The in out variables and input variables for some instructions cannot be accessed from external devices Refer to the NJU series Instructions Reference Manual Cat No W502 for details NJ series CPU Unit Software User s Manua
154. states of an NJ series CPU Unit An NJ series CPU Unit can be in any of three states startup state ready state or error state The CPU Unit changes between these states for the following events e When power is turned ON e When operating mode changes e When downloading data from the Sysmac Studio to CPU Unit e When Controller error occurs Power turned ON When power is turned ON Ready state Operating mode When Controller error occurs When downloading data f PROGRAM from the Sysmac Studio mode to CPU Unit Controller error reset When operating mode changes RUN mode 8 2 NJ series CPU Unit Software User s Manual W501 8 CPU Unit Status 8 2 State Changes This section describes the changes in states that can occur for an NJ series CPU Unit 8 2 1 When Power Is Turned ON i Status until Ready State The CPU Unit is ready to operate 10 to 20 seconds after the power supply to the Controller is turned ON All outputs from Basic Output Units are OFF during this time External communications are not per formed and the RUN indicator flashes This is called the startup state i Status after Ready State Operating Modes When the CPU Unit enters the ready state it will change to the operating mode that you specify in the Controller Configurations and Setup Startup Mode setting in the Basic Settings in Configura tions and Setup Controller Setup Operation Settings You can se
155. status 9 50 NJ series CPU Unit Software User s Manual W501 9 CPU Unit Functions i Application Procedures Use the following procedures User defined Errors 1 Register a user defined error in the Event Setting Table 2 Execute the Create User defined Error SetAlarm instruction Specify an event code that is defined in the Event Setting Table 3 A user defined error occurs 4 The corresponding system defined variable _AlarmFlag User defined Error Status changes to TRUE Execute any process for that condition 5 Check the user defined error in the event log with the Sysmac Studio an instruction or an HMI User defined information 1 Register user defined information in the Event Setting Table P fo m lt 5 rr O O 2 Execute the Create User defined Information Setlnfo instruction 3 Check the record in the event log uoewo u pue SIOZ pauy p sn su ng POUIjep 19SF 7 9 6 NJ series CPU Unit Software User s Manual W501 9 51 9 52 9 CPU Unit Functions i Setting the Event Setting Table To create a user defined error or user defined information register the user defined error or user defined information in the Event Setting Table in the Sysmac Studio in advance The user events that you set here can be displayed on the Sysmac Studio or NJ series compatible NS series PT with the same information You can register up to 5 120 events in the Event Setting T
156. that is set in the CPU Unit Attached None information Precautions None Remarks NJ series CPU Unit Software User s Manual W501 12 29 12 Troubleshooting Event name All Controller Errors Cleared 90180000 hex Meaning All current errors were cleared Source PLC Function Module Source details None Detection Commands from timing user Effects Clearing all errors for which the causes have been removed Attached None information Precautions None Remarks Event name Forced Refreshing Cleared 90190000 hex Meaning Clearing a forced refreshing value was specified Source PLC Function Module Source details None Detection Commands from timing user Effects a program Continues Operation Forced refreshing values are cleared and operation is per formed according to the user program ene None eo o O Cause and Assumed cause Correction Prevention poe Clearing a forced refreshing value was specified by the user Attached None information Precautions None Remarks 12 30 NJ series CPU Unit Software User s Manual W501 12 Troubleshooting Errors Related to FINS Communications Event name CPU Bus Unit Setup Area Error 14010000 hex Meaning An error was detected in the memory check of the Setup Area for CPU Bus Units Source PLC Function Module Source details None Detection At power ON at timing Controller reset or when writing CPU Bus Unit Setup Area Error attributes Level Minor fault Recover
157. that will receive the value of the output variable of the called function block in parenthesis after the instance name of the function block There are two methods of writing this statement as shown in 1 and 2 below We recommend method 1 for program readability 6 94 NJ series CPU Unit Software User s Manual W501 6 Programming Notation Method 1 Give both the variable names of the called function block and the parameter names of the calling POU ABC A x1 B x2 C gt y1 ABC Function block instance name A and B Input or in out variable names of called function block x1 and x2 Input or in out parameter of calling POU can be a constant C Output variable of called function block yt Output parameter of calling POU e Ladder Diagram Expression ABC x1 MyFB A C x2 B Os e You can give the arguments and return values in any order e You can omit the input variable names and input parameter names If you omit these names the values assigned to the input variables for the previous call are assigned to the input variables again If this is the first time that the function block is called the input variables are set to their ini tial values e You can omit the output variables and output parameters If they are omitted the value of the out put variable is not assigned to anything gt a u Oo D 3 3 5 rr D c D Q D o Notation Method 2 Omit the variable names
158. the PLC Function Module to send commands to the Motion Con trol Function Module MC_Home Homing MC_Move Positioning MC_Camlin Start Cam Operation and instructions for other motion con trol operations For details on motion control instructions refer to the NJ series Motion Control Instructions Ref erence Manual Cat No W508 For details on other instructions refer to the NJU series Instruc tions Reference Manual Cat No W502 NJ series CPU Unit Software User s Manual W501 2 CPU Unit Operation 2 4 CPU Unit Status This section describes the status of an NJ series CPU Unit Power ON Ready state Mg O u C Cc 5 wo D r c O Operating modes Error occurs PROGRAM mode Error state lt lt Error reset An NJ series CPU Unit can be in any of three states startup state ready state or error state The CPU Unit is ready to operate 10 to 20 seconds after the power supply is turned ON All outputs from Basic Output Units are OFF during this time External communications are also not performed This period is called the startup state When the CPU Unit enters the ready state it will change to the operating mode that you specify in advance RUN mode or PROGRAM mode This is called the Startup Mode In RUN mode the user program is executed In PROGRAM mode the user program is not executed You use this mode to transfer the project including the user program and che
159. the Battery voltage is low the time zone setting is retained but the clock data is not retained and will not be correct i Setting the Clock Data Use one of the following methods Changing Clock Data from the Sysmac Studio You can use the Sysmac Studio to synchronize the clock data of the built in clock with the clock on the computer Changing Clock Data with Instructions You can use the SetTime instruction to set the clock data Changing the Clock Data from an NTP Server You can use an NTP server on EtherNet IP to set the clock data 9 4 NJ series CPU Unit Software User s Manual W501 9 CPU Unit Functions i Correcting the Clock from an NTP Server Application In a network system the clock data must be shared by the entire system NTP is supported to enable easy time synchronization Specifications An NTP client is provided Refer to the NU series Built in EtherNet IP User s Manual Cat No W506 for details i Reading the Clock Data lf the clock data is incorrect the incorrect value is read Reading the Clock Data from Instructions You can use the GetTime instruction to read the clock data from the user program Reading the Clock from System defined Variables Writing Is Not Possible You can use the following system defined variable to read the clock data _CurrentTime System Time Sysmac Studio Procedure You can select Controller Clock from the Controller Menu of the Sysmac S
160. the data type and register the variable in the variable table Variables Data type RGB sodA geq nyenu q 9 9 Chairsi0 ARRAY 0 1 OF ITEM blue Chairs 1 Color Fred Data type ITEM NJ series CPU Unit Software User s Manual W501 6 39 6 Programming 6 40 Structure Specifications Item Structure names Member data types Member attributes Number of mem bers Nesting depth of structures Maximum size of one structure vari able Specification Names are not case sensitive Prohibited characters and character length restrictions are the same as for variable names Classification Basic data types Derivative data types POU instances Member Name Comment 1 to 2 048 Boolean bit string integer real duration date Supported time of day date and time or text string data Array of Boolean bit string integer real dura Supported tion date time of day date and time or text string data Arrays see note unions and enumerations Supported Note Recursions and loops are not allowed An error will occur when the program is checked Array specifications for structures unions and Supported enumerations Not sup ported Maximum of 8 levels however a member name must be 511 bytes or less including the variable name No restrictions Arrays and Structures You can set an array in which the elements are structures You can also set a structure in
161. the error status bits Data type WORD Range of values 16 0000 to 16 00F0O Usage in user program Possible Related instruc Get EtherCAT Error Status tions e GetECError Reset EtherCAT Controller Error e ResetECError Variable name _EC_PortErr Meaning Communications Port Error Global local Global Function This system defined variable provides the collective status of errors in the communications ports for the EtherCAT master Refer to A 3 7 Meanings of Error Status Bits for the meanings of the error status bits Data type WORD Range of values 16 0000 to 16 00FO Usage in user program Possible Related instruc Get EtherCAT Error Status tions e GetECError Reset EtherCAT Controller Error e ResetECError Variable name _EC_MstrErr Function This system defined variable provides the collective status of EtherCAT master errors and slave errors detected by the EtherCAT master Refer to A 3 7 Meanings of Error Status Bits for the meanings of the error status bits Data type WORD Range of values 16 0000 to 16 00F0O Usage in user program Possible Related instruc Get EtherCAT Error Status tions e GetECError Reset EtherCAT Controller Error e ResetECError NJ series CPU Unit Software User s Manual W501 A 61 a w Oo D z O ot O 5 o O 5 a Q v w lt m mp D F Q h 5 D Q S o D o Miobeyed ainpoy uonoun4 194SEN LV0104 S p V 94 WEN App
162. the execution condition is met until execution is completed Processing Processing contents I O refresh Output data ing processing Output refresh data is created for Output Units that refresh O lf forced refreshing is set the forced refreshing values are reflected in the output refresh data Refreshing This process exchanges data with I O Input data e Input refresh data is loaded from Input Units that refresh I O processing e If forced refreshing is set the forced refreshing values are reflected in the input refresh data that was read System common process Processing for exclusive control of variables in tasks when accessing tasks are ing 1 set e Motion input processing is performed e Data trace processing sampling and trigger checking is performed User program execution e Programs assigned to tasks are executed in the order that they are assigned Motion control e The motion control commands from the motion control instructions in the user program execution are executed e Processing the motion outputs for I O refreshing in the next primary periodic task System common process Processing for exclusive control of variables in tasks when refreshing tasks are ing 2 set e Processing for variables accessed from outside of the Controller is performed to maintain concurrency with task execution executed for the variable access time that is set in the Task Settings Note If there is
163. the operations that are performed in the user program the presence of communications commands and data links on whether data tracing is per form and on other factors Use the physical Controller and verify performance with the Task Execution Time Monitor p N O O teh gt Q Q Q LA 5 1 _ fe D x m X O c y e gt 3 1 pol d ysel y BuINeS pue su UONNOexy yseL eHeseAy ay Huemes Jo jdwexg Z z y NJ series CPU Unit Software User s Manual W501 A 25 Appendices A 3 System defined Variables System defined variables are assigned specific functions by the system They are registered in the glo bal variable table or the local variable table for each POU in advance These variables cannot be changed Some of the variables start with an underbar and some start with eee Some of the system defined variables are read only and some are read write You read and write the variables with the user program with communications from external devices with the Sysmac Studio or with an NS series PT Basically system defined variables are classified according to the function modules The variables start with the following category names Function module Category name System defined variables for the overall None NJ series Controller PLC Function Module _PLC _CJB Motion Control Function Module _MC EtherCAT Master Function Module _EC EtherNet IP Function Module _E
164. the processes into different tasks for example move processes that need a short execution period to a periodic task with a lower priority The number of times that processing If there is a program with an is repeated is larger than expected extremely high number of repetitions correct the program to achieve the correct number of repetitions Set a trap in the user program that monitors the number of times a process is exe cuted to check the number of repeti tions The priority of the periodic task is Increase the priority of the periodic incorrect task Attached Attached Information 1 Name of task where error occurred information Precautions You can change the level of the error to an observation in the task settings Remarks 12 20 NJ series CPU Unit Software User s Manual W501 12 Troubleshooting Event name Task Period Exceeded 60050000 hex Meaning Task execution was not completed during the set task period for the primary periodic task or fixed periodic task Source PLC Function Module Source details Continuously timing Effects User program Continues Operation If the task execution does not finish within the set task period the I O refresh operation will be as follows e CJ series Units No I O refresh is executed When task execution is completed I O refreshing for the next period is executed e EtherCAT slaves The same values are output as for the previous output refresh If the task execution does n
165. they are different for the purpose of data processing This is discussed later in this section The values for the sign s exponent e and mantissa f of special numbers are given in the following table Data type name Special values Signs Exponente Mantissa f aa ic E CC NJ series CPU Unit Software User s Manual W501 6 35 6 Programming 6 36 Data type name Special values Signs Exponente Mantissa f wo p p E a Subnormal Numbers 0 er 0 0 You cannot use the floating point format to express values close to 0 i e values with an extremely small absolute value Therefore you can use subnormal numbers to expand the valid range of num bers near 0 You can use subnormal numbers to express values with a smaller absolute value than with the normal data format normal numbers Any number where the exponent e 0 and the man tissa f 0 is a subnormal number and its value is expressed as shown below e REAL Data Number 1 S2 126 f x 2 23 e LREAL Data Number 1 S2 1022 f x 2 52 Example Expressing 0 75 x 2 127 as REAL Data 1 This is a positive number so s 0 2 0 75 in binary is 0 11 3 From 0 11 x 2 127 2 126 f x 2 23 we can see that f 0 11 x 222 4 From the above expression f 01100000000000000000000 Therefore you can express 0 75 x 2 127 as shown in the following figure Sign Exponent Mantissa REAL data 82 bits o 00000000 01100000000000000000000 31 30 23 22 0
166. this system defined variable in the user program It is used only to monitor the status of data trac ing from the Sysmac Studio Functional Classification Errors Variable name PLC Function Module Error Sta tus _PLC_ErrSta A 30 Range of Reference 16 0000 to 16 00F0 TRUE when there is a Controller error that involves the PLC Function Module page A 55 FALSE when there is no Controller error that involves the PLC Function Module Refer to information on the meanings of the error Status bits at the end of this appendix for details WORD NJ series CPU Unit Software User s Manual W501 Appendices A 3 3 PLC Function Module Category Name CJB Functional Classification I O Bus Status values _CJB_MaxRackNo Largest Rack Contains the largest rack number of the Oto3 page A 55 Number Expansion Racks that are detected by the 0 Only CPU Controller Rack _CJB_MaxSlotNo Largest Slot Contains one higher than the largest slot ARRAY O to 10 page A 55 Number number with a CJ series Unit on each of the 0 3 0 No CJ Racks that are detected by the Controller OF UINT series Unit mounted Functional Classification I O Bus Errors values _CJB_ErrSta I O Bus Error Gives the I O bus error status 16 0000 to page A 56 Status l 16 COFO Note Do not use this variable in the user pro gram There may be a delay in updating it Use this variable only to access sta tus through communic
167. to 8 This variable contains 0000 hex when there is no user defined error Functional Classification SD Memory Card _Card1Ready SD Memory Card TRUE when the SD Memory Card is recog BOOL TRUE or page A 50 Ready Flag nized FALSE FALSE when the SD Memory Card is not rec ognized TRUE The Card can be used FALSE The Card cannot be used _Card1Protect SD Memory Card TRUE when the SD Memory Card is write BOOL TRUE or page A 50 Write protected with the LOCK switch FALSE Protected Flag TRUE Write protected FALSE Not write protected _CardiErr SD Memory Card TRUE when an unusable SD Memory Card is BOOL TRUE or page A 50 Error Flag inserted or a format error occurs FALSE TRUE There is an error FALSE There is no error _Card1Access SD Memory Card TRUE during SD Memory Card access BOOL TRUE or page A 51 Access Flag TRUE Card is being accessed FALSE FALSE Card is not being accessed The system updates the flag every 100 ms Because of this access to the SD Memory Card is shown by this flag with a delay of up to 100 ms We therefore do not recommend the use of this variable in the user program _Card1Deteriorated SD Memory Card TRUE when the life of the SD Memory Card is BOOL TRUE or page A 51 Life exceeded FALSE Warning Flag TRUE The life of the Card has been exceeded FALSE The Card can still be used _Card1PowerFail SD Memory Card TRUE when the power supply to the CPU Unit BOOL TRUE or page A 5
168. to and remains TRUE when an BOOL Read write Error Flag instruction error occurs After this flag changes to TRUE it stays TRUE until the program changes it back to FALSE P_CY Carry Flag This flag is updated by some instructions BOOL Read 6 2 5 Details on Function Blocks Procedure to Create Function Blocks A function block consists of a function block definition that is made in advance and instances that are used in the actual programs Create function blocks in the following order 1 Creating the Function Block Definition Create the algorithm 2 Placing an Instance of the Function Block Definition in a Program Call the function block definition from a program or another function block You can call the same function block definition from more than one program or function block After you place an instance of a function block definition in a program or in another function block you can manipulate and execute it as an independent entity 6 8 NJ series CPU Unit Software User s Manual W501 6 Programming i Structure of Function Blocks In a ladder diagram function blocks are represented as rectangular boxes as shown below Refer to the Expressing Functions in ST on page 6 18 for details about how to express function blocks in ST Function blocks consist of the following parts e Function Block in Ladder Diagram Instance name Function block name or instruction name In out variable MyFB_instance Outpu
169. to determine if a fatal or non fatal error has occurred Ifa communications connection from the Sysmac Studio is not possible perform the troubleshooting proce dure that is provided in the NJU series Troubleshooting Manual Cat No W503 before you assume that the error is a fatal error A fatal error occurred in the CPU Unit Refer to the NJU series Troubleshoot ing Manual Cat No W503 for the correction Not lit Power Supply Error PWR indicator green Lit Not possible Communications connection from Sysmac CPU Unit Reset Studio Not lit ERROR indicator red Possible Flashing i RUN indicator green Incorrect Power Supply Unit Connected Not lit Communications Not possible CPU Unit Watchdog Timer Error onnection from Sysmac Studio Possible A non fatal error occurred Refer to 12 2 2 Troubleshooting Flowchart for Non fatal Errors NJ series CPU Unit Software User s Manual W501 12 11 Y N Oo ea D o F e oO 5 eo Buieredo SI HUN Ndd 94 J BES 0 BuEjoeYyO L Z Z4 12 Troubleshooting 12 2 2 Troubleshooting Flowchart for Non fatal Errors For a non fatal error use the Sysmac Studio or an NS series PT to troubleshoot the error with the fol lowing flowchart You can use the indicators to check the following e Level e Whether the error is in the EtherNet IP Function Module or the EtherCAT Maste
170. to the net work as you need Network Publish Specifications There are three specifications for publishing variables to the network Publish Only Input and Out put The specifications are given in the following table Network Publish Specifications Do not publish You cannot access a variable with this attribute from external devices However Support Software can still access the variable regardless of this setting Publish Publish Only You can access a variable with this attribute from external devices through CIP communications Tag data links are not possible for vari ables with this attribute setting Input You can access a variable with this attribute from external devices through CIP communications or a tag data link For tag data links this will be a variable for data input from another CPU Unit to the local CPU Unit Output You can access a variable with this attribute from external devices through CIP communications or a tag data link For tag data links this will be a variable for data output from the local CPU Unit to another CPU Unit 6 56 NJ series CPU Unit Software User s Manual W501 6 Programming Ranges for Published to the Network The Network publish attribute is specified separately for each variable Set them for all elements and members of array structure and union variables Edge The Edge attribute makes the variable pass TRUE to a function block when a BOOL variable changes from FA
171. was exceeded BOOL R FALSE if task execution is completed within the task period Contains the number of times that the task UDINT R period was exceeded If the present value exceeds the maximum value of the data type the present value returns to O and the count is continued Task Active Flag _TaskName_Active Primary periodic task _TaskA_ Active Priority 16 periodic task TaskC _TaskC_Active ae ee ee Task period sl lt gt Task period ii o fire ovre Ye Wy Task Period Exceeded Flag _ TaskName_Exceeded Task period Primary periodic task TaskA Fee eS a T M o urs ff M 0 ure ff A Period exceeded TaskA Exceeded 5 2 11 Errors Related to Tasks This section describes the following errors e Task Period Exceeded Error e Motion Control Period Exceeded Error e Task Execution Timeout Error e I O Refreshing Timeout Error e Insufficient System Service Time Error 5 20 LED ELLE LEED NJ series CPU Unit Software User s Manual W501 5 Designing Tasks i Task Period Exceeded Error A Task Period Exceeded Error occurs if the task execution time exceeds the specified task period This is a minor fault level Controller error Operation continues even when this error occurs It can occur for the primary periodic task and periodic tasks Task Period Exceeded Errors can be disabled in the settings Use the Task Period
172. which the members are arrays Instructions That Take a Structure as a Parameter Some instructions pass structure variables as parameters To do so specify the structure variable as the input parameter Example Passing a Member of a Structure Variable to the MOVE Instruction and Passing a Struc ture Variable to the MOVE Instruction NJ series CPU Unit Software User s Manual W501 6 Programming When Not Using a Structure When Using a Structure Variable Table 3y a MK MK eM eM eM eM eM ee eK 9 Data Type Table r UINT Variable Table ed Color Color2 Color1_green 255 Color1 green 255 Color1_red 128 Color1 red 128 Color2_red UINT Color2_green UINT Color2_blue UINT Color1 blue UINT Colort_red UINT RGB red UINT Color1_green UINT UINT Color2_red Color1_red Color2 Color Color2_green Color1_green Color2_blue Color1_blue Passing Values to System defined Structure Input Variables for Certain Instructions Some instructions take a predefined structure variable as an input variable p amp S Z D ea D N Example The Port input variable for the Serial Communications Instructions which specifies the tar get port is a structure with a data type name of _sPORT When you use one of these instructions follow the procedure provided below to create a user defined structure vari able and specify that variable for the input p
173. you use to access an EtherCAT slave depends on the type of slave e Accessing Slaves through the Objects That Are Assigned for PDO Communications You can access slaves through the objects that are assigned for PDO communications for Servo Drives encoder input slaves and general purpose slaves All slaves other than Servo Drives and encoder input slaves are called general purpose slaves e Using Motion Control Instructions You can use motion control instructions to implement motion control for Servo Drives and encoder input slaves Motion control Instructions cannot be used for slaves from other manufacturers that are not supported Applicable slaves General purpose slaves all Servo Drive and encoder input slaves slaves except for Servo OMRON products or sup Drives and encoder input ported products from other Unsupported products from other manufacturers slaves manufacturers Access method Accessing slaves Supported through the objects that are assigned for PDO communications Using motion control Not supported Supported Not supported instructions 2 8 NJ series CPU Unit Software User s Manual W501 2 CPU Unit Operation Accessing Slaves through the Objects That Are Assigned for PDO Communications You use device variables for EtherCAT slaves CPU Unit EtherCAT slaves to which axes are not assigned Device Variables I O Ports ne N S a D ea D N D 2 O InBit15
174. 0 Function Block Instances Function block instances are added to and displayed in the local variable table as a data type EN Additional Information amp S Z D ea D N A function block instance is treated as a local variable i e internal variable of the program in which the instance is created As such the instance is added to and displayed in the local vari able table of the program You cannot treat these instances as global variables 6 3 11 Monitoring Variable Values You can monitor the value of variables from a Watch Tab Page on the Sysmac Studio S9OUe SU YOO G UONOUNS O0O L 8 9 1 Select Watch Tab Page from the View Menu The Watch Tab Page is displayed 2 Establish an online connection with the Controller and register the variables in one of the follow ing ways 1 Enter the variable in the name cell in the Watch Tab Page 2 Drag variables to the Watch Tab Page from an editor or variable table 3 The present values of the variables are displayed NJ series CPU Unit Software User s Manual W501 6 59 6 Programming 6 3 12 Restrictions on Variable Names and Other Program related 6 60 Names The following is a list of restrictions on program related names Character Restrictions Program related name Applicable characters Usable characters e 0to9 AtoZ andatoz e Single byte kana e _ underlines e Multibyte characters e g Japa nese Refer to Reserved Words below
175. 000 DO X X INT 10 2 DATA n X n n INT 1 END_WHILE e f you do not write correct condition expressions the program execution time increases and may cause a Task Period Exceeded Error Example boolVar TRUE WHILE boolVar DO intVar intVar INT 1 END_WHILE REPEAT The following expressions are used to specify whether the condition is met TRUE The condition is met FALSE The condition is not met Overview This construct repeatedly executes one or more statements until a condition expression is TRUE Reserved Words REPEAT UNTIL END _ REPEAT Construct Structure REPEAT lt statemenb UNTIL lt condition_expression gt END_REPEAT Process Flow Diagram Repeated Condition expression TRUE End Application Use this type of repeat construct when you do not know how many times to repeat a process i e when you do not know how many times based on the condition and you want to repeat a process for as long as a certain condition is met after processing Use this type of repeat construct to deter mine whether to repeat execution based on the result of the execution of a process post evaluation repeat construct NJ series CPU Unit Software User s Manual W501 6 Programming Description First lt statement gt is executed unconditionally Then the lt condition_expression gt is evaluated If lt condition_expression gt is FALSE lt statement gt is executed
176. 01 1500 Supported services Sysmac Studio connection Sel a Physical layer USB 2 0 compliant B type connector USB port y y l p yP Communications protocol TCP IP UDP IP and BOOTP client Sysmac Studio connection tag data link CIP message com Supported services munications socket service FTP server automatic clock adjustment NTP client SNMP agent and DNS client 10Base T or 100Base TX CSMA CD 100 Mbps 100Base TX S gt STP shielded twisted pair cable of Ethernet category 5 or ati Transmission media l Built in higher Ether 100 m max distance between hub and node Net IP port Number of cascade connec There are no restrictions if a switching hub is used tions ok I N 2 Oo D O h O D O T CIP service Tag data links cyclic communications Communi cations Number of con 32 nections Permissible 1 000 pps 2 including heartbeat communica tions band Number of tag 32 sets Communications protocol Special protocol for EtherCAT Supported services CoE PDO communications and SDO communications Synchronized communica DC distributed clock tions Physical layer 100Base TX Modulation Baseband EtherCAT p port Duplex mode Auto Topology Line daisy chain and branching Use a shielded twisted pair cable double shielding with alu Transmission media minum tape and braiding of Ethernet category 5 100Base TX or higher Transmission distance Distance between
177. 1 Controller Write Protection at Startup This setting automatically enables write protection when you turn ON the power supply to the Con troller Sysmac Studio i CPU Unit Writing is not Ae possible Al Set whether to automatically enable write protection when the power supply is turned ON in the Controller Setup under the Configurations and Setup of the Sysmac Studio Operation Settings Security Settings Write Protection at Sets whether to Do not use Operation Settings Startup enable write protec Use Tab Basic Settings tion FZ L IILL ZZZ LL LLLI IIL ZZ E LLL IILL LLL VIIL CPU Unit 9 22 NJ series CPU Unit Software User s Manual W501 9 CPU Unit Functions 2 Setting and Removing Write Protection from the Sysmac Studio In the Sysmac Studio go online and select Security Write Protect Setting Switch from the Con troller Menu to toggle write protection Sysmac Studio CPU Unit Saaz L ILLL SF LOL LIZ fF LLL FZ LLII LILL LZZ LL SPILL LLL AG You can turn write protection ON and OFF wer power is turned on Not Write protection enabled set Enabled Changed from the Writing disabled Sane Studio Writing enabled P U D O l lt UONO9 O1d 7 6 NJ series CPU Unit Software User s Manual W501 9 23 9 CPU Unit Functions Write protected Items The data and write operations i
178. 1 DIFSmng dala escape tiene 6 62 DiS A oe Se eee ee eee 6 61 WMC CIS casted weedeat earn seen ceee ed cenctecetes 6 61 PUTO CS ee cd os ack cA as Se nan 9 ad ln ee 6 61 ote 0 2 Ec pee Cena ae fen enc ee te mo nee 6 62 TOXE STINGS cniin S 6 64 time related data oo ccccccceceeeseseeeeeeeeeeeeeeeeaeenes 6 63 Control period and tasks ceeccsseseeeseseseseeeeeeneeeeenes 2 13 Controller Error Status ccccccceeseesseeeeseeeeeeeeees A 28 A 49 Controler errors sete teeta teehee Ace S soe hee 9 49 Controller events oo cece cece ccecceeseeeseeeseeseeeeaeeeaeeaeneas 9 44 Controller information senises en a T 9 49 CG ntroller SetUp restec a a 4 4 CPU Bus Unit Initializing Flags 9 8 A 32 A 57 CPU Bus Unit Restart Bits wo 9 9 A 32 A 58 CPU Unit dala ae eae ae Sete ee ene ee ae SOT Rm 2 18 internal software configuration cscceeesseeeeeees 2 2 NaMe ie ec ete ttn R 9 19 KOS CUING onar E ataieew see eaoes 12 3 SAUS aaaea A 2 17 NJ series CPU Unit Software User s Manual W501 watchdog timer error ccceeececseseeeeeeeeeeeeeeeenaeees 12 3 Be G10 6 21918 ime e a EEN A 26 A 47 D data formats DESUN e secure euiticutae sees aban neeeeeeeteaee ent 6 34 Fal MUMBDECIS srera E a 6 34 text SWINGS ae E 6 34 data retention misisko E tae 2 18 data tracho sacaang 9 35 COnNtiNnuouS tracing ssssssssessssersesrressrrrerrrrsrrrssrrreerree 9 36 ODCVAUIOMN micia a 9 38 SPECICAT
179. 1 Power Interrup was interrupted during access to the SD FALSE tion Flag Memory Card TRUE Power was interrupted during SD Memory Card access FALSE Normal A 28 NJ series CPU Unit Software User s Manual W501 Appendices Functional Classification Power Supply values _PowerOnHour Total Power ON Contains the total time that the power has UDINT 0 to page A 51 4294967295 Time been ON Contains the total time that the CPU Unit has been ON in 1 hour increments To reset this value overwrite the current value with O The value is not updated after it reaches 4294967295 This variable is not initialized at startup _PowerOnCount Power Contains the number of times that the power UDINT 0 to page A 52 Interruption supply has been interrupted The value is 4294967295 Count incremented by 1 each time the power supply is interrupted after the first time that the power was turned ON To reset this value overwrite the current value with O The value is not updated after it reaches 4294967295 This variable is not initialized at startup _RetainFail Retention TRUE at the following time failure of retention BOOL TRUE or page A 52 Failure Flag during power interruptions FALSE e When an error is detected in the battery backup memory check at startup FALSE at the following times no failure of retention during power interruptions e When no error is detected in the battery backup memory check at startup e
180. 1 985 single byte alphanumeric charac ters A NULL character is added to the end of text strings The number of bytes is therefore the number of single byte characters plus 1 Note You must set the number of bytes used by a STRING variable number of single byte alphanu meric characters plus 1 in the Sysmac Studio The default setting is 256 bytes Enclose the string in single byte single quo tation marks Example OMRON PLC 1 For single byte alphanumeric characters this is equal to O to 1 985 characters For Japanese this is approxi mately equal to O to 661 characters 2 If you want to insert tabs vertical tab codes or other special characters use a dollar sign as an escape character before them Refer to Escape Character List on page 6 64 6 32 NJ series CPU Unit Software User s Manual W501 6 Programming H Precautions for Correct Use The total amount of memory required by all variables is not equal to the total of the data sizes of each of those variables This is because the first position where data is stored in memory is auto matically set to a multiple of the alignment value for that data type This results in some empty space in memory between data types For example even if the data types are the same the overall memory space required depends on the order of data types as shown below Example DWORD gt DWORD gt WORD Requires a total of DWORD gt WORD gt DWORD
181. 1 min error per month Timers counters index registers data registers and Task Flags cannot be specified Means packets per second i e the number of communications packets that can be sent or received in one second However if port parameters are changed the relevant EtherNet IP port is restarted Communications for the nodes that were communicating with that port will time out and then they will be automatically restored An IGMP client is mounted for the EtherNet IP port If a switching hub that supports IGMP snooping is used filtering of unnecessary multicast packets is performed NJ series CPU Unit Software User s Manual W501 A 7 T h w D O O 9 i O 5 T suoneooadS SOURWIOLOd Z L Y Appendices A 1 3 Function Specifications Item NJ501 I O refresh and the user program are executed in units that are called tasks Tasks are used to specify execution conditions and execution priority Tasks are executed periodically as described below e Primary periodic task This task has the highest priority It is always executed in the specified period There is only one pri mary periodic task e Periodic tasks Periodic tasks are executed during the unused time between executions of the primary periodic task There can be three periodic tasks The execution interval and the percentage of the total user program System Service Monitoring Set Tasks inas execution time are monitored for the system s
182. 15 addresses NJ series CPU Unit Software User s Manual W501 A 57 Appendices Variable name _CJB_CBUOORestart to _CJB_CBU15Restart Meaning CPU Bus Unit Restart Bits Global local Global Function The CPU Bus Unit is restarted when the corresponding variable changes to TRUE It is changed to FALSE by the system after the CPU Bus Unit is restarted The numbers in the variables indicate the unit numbers of the applicable Units If you change the Restart Flag to TRUE with an instruction the restart process begins from refresh processing in the next task period Data type BOOL Range of values TRUE or FALSE R W access Not retained Network Publish Published Usage in user program Related instruc ResetUnit tions Auxiliary A501 Area A501 00 to A501 15 addresses Variable name _CJB_SlO0ORestart to _CJB_SlO95Restart Meaning Special I O Unit Restart Bits Global local Global Function The Special I O Unit is restarted when the corresponding variable changes to TRUE It is changed to FALSE by the system after the CPU Bus Unit is restarted The numbers in the variables indicate the unit numbers of the applicable Units If you change the Restart Flag to TRUE with an instruction the restart process begins from refresh processing in the next task period Data type BOOL Range of values TRUE or FALSE R W access Not retained Network Publish Published Usage in user program Related instruc ResetUnit tion
183. 15 entering manually c cc eeeccceeeeeceeeeeeseseeeseeeeeenees 3 15 d vice variables sitio cei ee e aoe 2 5 3 13 AUIDO S sai ee re arene ony E Ores eer eeae 3 14 RECISTONING sscuicete test iea aati eiter at ice eutee athe ele 3 15 Disabled Slave Table cccccccecceceesseeeeeeeeeeeeeees A 37 A 66 Disconnected Slave Table c cccceceeeseeseeeeees A 37 A 66 DNS Server Connection Error nasses A 40 A 72 GOW MOACING eresien ci econ icine en ete erated 8 6 GUNATIONS o c2c51824t cce cence cecencanats E 6 32 E EC lt COMMET ED ee ane ttsiatict escort ores A 35 A 65 _EC_DisableSlavTbl cccccsssseeeeeseeeeeeeees A 37 A 66 EC DISCONNSIaV Tiles a ae eed A 37 A 66 ECEN Slav estes octets ese ties Mercere cea A 37 A 65 EG Mola ea a cata N A 34 A 61 NJ series CPU Unit Software User s Manual W501 Index EC InDatalnvalid seir A 37 A 67 BEC Lan HWEM rr n a o a oa A 34 A 62 EC LCNKONEN cucerea n A 34 A 62 BEC INKS tat merenna a A 37 A 67 EO IWACAGI EN e a O A teem A 34 A 62 _EC_MBXSlavTbl 0 0 ccceccceeeeeeeeeeeeseeeeeens A 37 A 65 C MSE soraa N aanieeanet tees A 35 A 64 EC MSME orren a A 34 A 61 EC NetGIOCMPEM snd A 34 A 63 EC _NetCtg Err sie A 34 A 63 EC _NetTopologyE rr ccccssseeeeceeeeeeeeeeeees A 34 A 63 SEC PIDACUIV GS sreinge a A 37 A 66 AEG PDGOMIMER merrie na A 34 A 63 EC PDSendE e e a bee A 35 A 63 SEC PDSIAVVDI wicccetic attra eee
184. 1W IA111 We EE ow CJ1W AD041 V1 Analog Input Unit 4 points OMRON Corporation dnyes un pue uoleunByuoD PUN v zZ v Settings for All Units Set the device names Device names are automatically created when Units are added in the Unit Editor Default names J followed by serial numbers that start from 01 We recommend that you change the name to one that is suitable to the device EN Additional Information The device names that are set here are placed before the I O port name when device variables are automatically created Special Units Set the unit numbers of the Special Units Fi Precautions for Correct Use Make sure you set the same unit numbers as the unit numbers that are set on the rotary switches on the front of the Special Units If they are not the same operation will be according to the unit numbers that are set on the front panel rotary switches CS CJ NSJCJ2 Series Instructions Reference Manual W474 4 9 4 Controller Setup Basic I O Units The eee settings are made in the Unit Information of the Basic I O Units group rae Unit Informa Basic Input tion Unit Input Response Note Set the time informa tion for each slot 4 10 Sets the input response time ON response time OFF response time of the Basic Input Unit You can set this value in increments from O to 32 ms You can increase the value to reduce chattering and the effects of external noise If you
185. 2 5 2 5 ASSIGIING TASKS tOo Programs i siscest arin teeesne E E temey cose eee vest eeee eisietees 5 13 5 2 6 Parameters for Primary Periodic Task and Periodic TaSkS cccccccccseseeeeceneeeeeeaeeseeesaaeeess 5 13 5 2 7 Ensuring Concurrency of Variable Values between Tasks c scccccsseeeeeeceeeeeeeeaeeeeeeesaaeeees 5 15 5 2 8 Synchronizing Variable Access from Outside the Controller with Task Execution 0 0 5 18 5 2 9 Instructions Related to TASKS xiccs dics cescalacaniiescustaesivias toatuidsaneceinbnccn tudicysiate diate eeanduaeseeeeioaniins 5 19 5 2 10 System defined Variables Related to TaskS ccccssccccccsseeceeeeeeececaueeeeeeseeeeeeeseaeeeseesaneeeessaaes 5 19 Deeb Emors Relitedto TASKS 5 cert at tac a ee gaa A NC teh bon eau Sal 5 20 5 2 12 Monitoring Task Execution Status and Task Execution TIMES ccccccseeceeceeeeeeseeeesseeeeeees 5 23 Task Design Example and I O Response TiMes cccceeeeeeseeseeseeneeseeeseeeesseeeeeseeseeneeseeas 5 26 5 3 1 Checking the Task Execution Time cccccccsseeeeeceeeeeeeesaeseeecauecseeeceaaueeeeseuseeeesseseeesseaeeeeesanas 5 26 5 3 2 Checking the System Service Monitoring Settings cccccceeeeccsseeeeeeceeeeeeeseeeeeeeeaeeeeeeeseeeeeeens 5 27 5 3 3 Examples of Task Desig Nessie iiaia aa easan a aaie aianei 5 28 5 3 4 System Input and Output Response TIMES cccccceseeeecceesececeeeeeeeceeeeeeeeeueeeecsuaeeeessee
186. 536 words HO to H1535 be 32 768 words DO to D32767 specified T 32 768 words x 25 banks E0_00000 to E18_32767 specifica tions for vari ables s Maximum per CPU Rack or Expansion Rack 10 Units Maximum number of connectable Units Entire Controller 40 Units Unit con Number of Expansion Racks 3 max figuration 1 0 capacity 2 560 points max plus EtherCAT slave I O capacity Motion control A 4 Power Supply to CPU Rack and Expansion NJ PLJ38001 Power Supply Unit Racks OMRON G5 series Servo Drives with Built in EtherCAT Communica Recommended Servo Drives tions Recommended unit version Version 2 1 or later OMRON GxX series GX EC0211 EC0241 EtherCAT Remote I O Termi Recommended encoder input terminals nals Recommended unit version Version 1 1 or later Control method Control commands using EtherCAT communications Position control Cyclic Synchronous Position Control Mode Control modes Velocity control Cyclic Synchronous Velocity Control Mode Torque control Cyclic Synchronous Torque Control Mode axes Number of controlled Single axis control 16 axes max 32 axes max 64 axes max axes Linear interpolation control 4 axes max per axes group Circular interpolation control 2 axes per axes group Number of axes groups 32 axes groups max Unit of Display Pulses millimeters micrometers nanometers inches or degrees i Command pulses per motor rotation Work travel distance per motor
187. AL data Arithmetic instructions for LREAL data A 20 NJ series CPU Unit Software User s Manual W501 Appendices Structured Text Find the execution times from the following graphs and calculate the total gt N e Execution Time for Standard Instructions Q 2000 3 1800 3 Co 1600 Q E 2 1400 o 1200 z 5 S 1000 7 5 800 D x lt 600 al y 400 200 0 5000 15000 20000 25000 30000 35000 40000 3 Total number of instructions e Execution Times for Arithmetic and Trigonometric Instructions for LREAL Data 2000 1800 gt 1600 no 1400 D 1200 D 2 1000 E 5 800 a g S LL 600 a lt 400 2 amp 200 D 0 o 0 100 200 300 400 500 600 700 800 900 1000 A Total number of instructions e lt Trigonometric instructions for LREAL data Arithmetic instructions for LREAL data af D D NJ series CPU Unit Software User s Manual W501 A 21 Appendices Instruction Configuration for Each Group Instruction Configuration for Standard Instructions Ladder Diagrams Percent of exe i Percent of cution time in Types of instructions O mm instructions instruction group Ladder diagram instructions 40 2 Comparison instructions 8 3 Timer and counter instructions 7 3 Math instructions ADD SUB MUL and DIV 6 5 BCD conversion instructions and 1 2 data conversion instructions WORD_BCD_TO_UINT
188. Also the number of parameters must match the number of input variables and other variables in the function def inition Functions Expressed in ST Para_MAX Function name LO Para_MAX MAX In1 Para1 In2 Para2 Para_MAX MAX Para1 Para2 The input variables are omitted here Refer to Function Calls in ST Language Statements on page 6 97 for details NJ series CPU Unit Software User s Manual W501 6 Programming j Variable Designations for Functions Function name or instruction name Value is assigned Return value Return value parameter Value is assigned Value is assigned Input parameter Input Internal Output Output parameter n variables p Variable assignment variable variable Variable assignment itself is passed 77 _ itself is passed a 7 N A 7 In out parameter In out variable In out variable In out parameter The specifications for variables in functions are given below Variables Specification Input variables O to 64 Input variables are used as input arguments within the function They cannot be changed inside the function e When the function is executed the input variables are set to the values of the input parameters e You can specify either constants or variables for input parameters e Omitting Input Parameters Refer to information on operation when parameters are omitted in 6 2 7 Oper ation That Applies to Both Functions and Function Blocks e Unlike functio
189. Areas of memory used for CU series Units Absolute Encoder Home Offset Data i Sysmac Studio Procedure Place the Sysmac Studio online with the CPU Unit and select either Backup Variables and Memory Backup or Backup Variables and Memory Restore from the Tools Menu Refer to the Sysmac Stu dio Version 1 Operation Manual Cat No W504 for details sowan dnyoeg Aseieg JO SonjeA U S ld 94 Punozs y pue dA Buryoeg L 2 6 Backup Procedure 1 Select Backup Variables and Memory Backup from the Tools Menu of the Sysmac Studio NJ series CPU Unit Software User s Manual W501 9 57 9 CPU Unit Functions Esl sysmac Studio 5 fle Edit View Insert Project Controller_ Simulation Tools Help Troubleshooting Backup Variables and Memory gt Export Global Variables gt Configurations and Setup Event Settings x E DR ZConfiguations and Setup I Edit multiple tables Comment v op EtherCAT Event Code Event Name Event Level Group Details P Node10 R88D KNOLL ECT 1 1 1 user fault teve a OOOO OO gt Node9 R88D KNO1L ECT E 2 100 User fault Level 1 gt 5 CPU Expansion Racks 3 500 User fault Level 1 I O Map 4 5000 User fault Level 1 gt Controller Setup New Project gt 1 Motion Control Setup F Data Trace Settings Edit detailed event information shown on HMI if a major fault level Controller error occurs pj The Backup Dial
190. Array Variable Specifications Item Specification Maximum number 65535 of elements for an array variable Element numbers 0 to 65535 The number for the first element in an array does not have to be 0 Subscripts Constants Integer value between 0 and 65535 Variables Classification Data type Integer SINT INT DINT USINT UINT ee or UDINT Basic data type LINT or ULINT Not sup ported Boolean bit string real duration date time of day date and time or text string data Derivative data Structures unions and enumerations Not sup types ported POU instances NOT Su ported Arithmetic expressions Arithmetic expressions can be specified only in ST Example y x a b Dimensions of Array Variables You can regard the elements of a one dimensional array as one dimensional data lined up in a sin gle row You can set two dimensional and three dimensional arrays in the same way The array ele ments are expressed by adding the same number of subscripts to the array variable name as the number of dimensions Arrays can have a maximum of three dimensions Oo 1 2 3 sisca Three dimensional Array Specifications Variable Table Y 0 2 2 Data type i ITEM ARRAY 0 1 0 2 0 3 OF INT Z 0 3 0 2 3 A 1 X 0 1 O 1 Arrays and Structures Two dimensional Array Specifications Variable Table Variable name Data type abc ARRAY 0 5 0 3 OF INT 0O A OO N O You can set an ar
191. B_SlOg5InitSta _CJB_CBUOORestart to _CJB_CBU15Restart _CJB_SlO00Restart to _CJB_SIO95Restart _CJB_SCUOOP1ChgSta to _CJB_SCUO00P2ChgSta _CJB_SCU15P1ChgSta to _CJB_SCU15P2ChgSta A 32 Basic I O Unit Information CPU Bus Unit Ini tializing Flags Special I O Unit Initializing Flags CPU Bus Unit Restart Bits Special I O Unit Restart Bits Serial Communi cations Unit O Port 1 2 Settings Changing Flags Serial Communi cations Units 1 to 15 Port 1 2 Set tings Changing Flags Shows the status of the Basic I O Unit alarm TRUE or page A 57 output load short circuit protection FALSE TRUE Load short circuit FALSE No load short circuit The corresponding variable is TRUE during BOOL TRUE or page A 57 initialization of the CPU Bus Unit FALSE The corresponding variable changes to FALSE when the initialization is completed The numbers in the variables indicate the unit numbers of the applicable Units The corresponding variable is TRUE during BOOL TRUE or page A 57 initialization of the Special I O Unit FALSE The corresponding variable changes to FALSE when the initialization is completed The numbers in the variables indicate the unit numbers of the applicable Units The CPU Bus Unit is restarted when the cor BOOL TRUE or page A 58 responding variable changes to TRUE It is FALSE changed to FALSE by the system after the CPU Bus Unit is restarted The numbers in the var
192. C Notit SD BUSY indicator Not lit Flashing Not lit ae Not lit 9 3 8 SD Memory Card Self diagnostic Functions 9 14 You can perform self diagnosis on the inserted SD Memory Card when the power supply is turned ON You can select whether to perform self diagnosis when the power is turned ON in the Operation Set tings of the Controller Setup under the Configurations and Setup from the Sysmac Studio as shown below e File system check e Check equivalent to CHKDSK e Restoration attempt when check fails Access Setting ee Set val i Description point group ues Operation SD Mem Settings ory Card Operation Settings Settings Tab Basic Settings Memory Sets whether to execute self diagnosis file system check Do not Card and restoration on the inserted SD Memory Card when check Diagnosis the power is turned ON Check at Startup See note Note Self diagnosis is not executed if write protection is set on the SD Memory Card itself NJ series CPU Unit Software User s Manual W501 9 CPU Unit Functions Results of Self diagnosis restore operation is completed Case ae eee Error type Correction Remarks 2 The format of Not lit Not lit Observa Use the Sysmac tion Studio to format the SD Memory rect Card restored files were deleted file Self diagnosis in Flashing Not lit progress 1 When self diag Not lit Normal None nosis found no problems the SD Memory
193. CIO 3799 15 Words in this area are allocated to slaves for fixed allocations according to fixed allocation setting 1 2 or 3 in the software switches in the CIO Area Select one of these fixed areas Addresses me ste s avegui Slave to master input area put area Fixed allocation area 1 CIO 3200 to CIO 3263 CIO 3300 to CIO 3363 Fixed allocation area 2 CIO 3400 to CIO 3463 CIO 3500 to CIO 3563 Fixed allocation area 3 CIO 3600 to CIO 3663 CIO 3700 to CIO 3763 You can allocate memory in the DeviceNet Area even if you use fixed allocations to use the remote I O slave function of a DeviceNet Unit Addresses Was ier tele Ave oul Slave to master input area put area Fixed allocation area 1 CIO 3370 CIO 3270 Fixed allocation area 2 CIO 3570 CIO 3470 Fixed allocation area 3 CIO 3770 CIO 3670 Refer to the CS CJ series DeviceNet Unit Operation Manual Cat No W380 for details i CIO Area Work Areas Description You use the bits in these areas only in programming You cannot use them to input or output data through external I O terminals If you need work bits you should normally use bits in this area Data in this area is cleared when power is cycled or when the operating mode is changed between PRO GRAM and RUN mode Addresses Addresses Word addresses Bit addresses RANGE CIO 1300 to CIO 1499 and CIO 1300 00 to CIO 1499 15 and g CIO 3800 to CIO 6143 CIO 3800 00 to CIO 6143 15 A 6 2 Auxiliary Area Description Yo
194. Card e Do not disconnect the cable or turn OFF the power supply to the Controller when downloading data or the user program from Support Software e Always turn OFF the power supply to the Controller before you attempt any of the following e Mounting or removing I O Units or the CPU Unit e Assembling the Units e Setting DIP switches or rotary switches e Connecting cables or wiring the system e Connecting or disconnecting the connectors NJ series CPU Unit Software User s Manual W501 29 Precautions for Safe Use 30 The Power Supply Unit may continue to supply power to the rest of the Controller for a few seconds after the power supply turns OFF The PWR indicator is lit during this time Confirm that the PWR indicator is not lit before you perform any of the above Operation e Confirm that no adverse effect will occur in the system before you attempt any of the following e Changing the operating mode of the CPU Unit including changing the setting of the Operating Mode at Startup e Changing the user program or settings e Changing set values or present values e Forced refreshing e Always sufficiently check the safety at the connected devices before you change the settings of an EtherCAT slave or Special Unit e If two different function modules are used together such as when you use CJ series Basic Output Units and EtherCAT slave outputs take suitable measures in the user program and external controls to ensure that sa
195. Configurations and Setup in the Multiview Explorer and select Add Data Trace from the menu Data Trace is added to the Multiview Explorer Configurations and Setup gt 3 EtherCAT p gt CPU Expansion Racks I O Map gt 3 Controller Setup P gt Motion Control Setup Cam Data Settings gt Event Settings wm D i Data Trace 3 Double click Data Trace The Data Trace Tab Page is displayed in the Edit Pane Fa psmac Studio ile Edit Views Insert Project Controller Simulation Tools Help a l a a ve l A I l bauan Configurations and Setup new_NJ501_0 v g DataTraceO x c O be Bs i zs ial eal Sie 3 i Configurations and Setup Hv Se ae P S amp X Axis Time ms v gt oy EtherCAT gt CPU Eqansion Racks I O Map Trace type Single v Sampling interval Every period of task PrimaryTask Trace No 0 Controller Setu i j gt P Post triqger data ratio gt 43 Motion Control Setup 1003 0 10000 Cam Data Settings San E Enable trigger condition E Start tracing on RUN mode E Refresh charts during tracing Visible INamelX OffsetlY OffsetlY Axis Min lY Axis Max Minimum Maximum Average Cursor Commentl 0 4 045 0 5 0 55 Time ms P a g D o amp Q 5 0 45 0 5 0 55 Time ms RE a 3D equipment model No 3D equipment model is 7 Local World No 3D equipme
196. D_FOR Val i i Empty statement WHILE Var lt gt 0 DO Empty statement END_WHILE Commenting out multiple lines IF MyFun ErrorCode 3 THEN ReturnValue GetDetail END_IF down to here A SIN X 2 COS Y 42 10 1 A SIN X 42 4 COS Y 42 5 NJ series CPU Unit Software User s Manual W501 6 Programming Operators Priority Notation example and evaluated value 1 Highest 11 Lowest Operation Operator 1 2 3 4 1 Value 21 12 3 NOT TRUE 100 200 Value 20 000 100 200 10 MOD 7 Value 3 Parentheses Function function block call Exponent NOT Multiplication Division Remainder 17 MOD 6 Value 5 p a D Oo D 3 3 5 rr D c D Q D o 17 MOD 6 Value 5 17 MOD 6 Value 5 17 MOD 6 Value 5 100 200 6 100 200 Value 100 100 lt 200 If the comparison result is TRUE the value is set to TRUE Otherwise the value is set to FALSE In the above example 100 is less than 200 so the value is TRUE 100 200 If the two values match the value is set to TRUE Addition Subtraction ebenbue7 1x9 painionus S 9 Comparison Matches Otherwise the value is set to FALSE In the above example 100 does not equal 200 so the value is FALSE 100 lt gt 200 If the two values do not match the value is set to TRUE Otherwise the value is set to FALSE
197. Data2 Decimal point position specifi cation data 2 a FixPointPos2 INT Number of digits below deci O mal point 2 Done Normal end RealData Floating point data 1 RealData Floating point data 2 Application This statement calls a function Omitting Parameters When you call a function you can omit parameters that are not required The following table shows when you can omit parameters P A wo 0p as Cc O pas Cc x D Q D x me m ped m Q c fab Q D Variables for Notation pattern Omis POU type the called Parameters included sion POU FUN Given notation All parameters given method 1 More than one parameter given FUN x a y b One parameter given FUN y b No parameters given FUN x Given notation All parameters given FUN a b c OK MENOU PUNO FUN a 7 OK Possible initial used Compiling error NJ series CPU Unit Software User s Manual W501 6 99 6 Programming i Differences between ST and Ladder Diagrams The differences between ST and ladder diagrams are described below Item Ladder diagram ST including inline ST Input differ Change to TRUE Change to TRUE entiation e Method 1 e Method 1 start R_TRIG_instance Clk start Q gt do R_TRIG_instance is an instance of the R_TRIG instruction e Method 2 R_TRIG_instance R_TRIG start Clk Q j do e Method 3 Up start In do Change to TRUE Change to TRUE e Method 1 e Method 1 st
198. ECAT node node_number l O_ ECAT node 1 Input1 slaves _port_name Axis Variables MC _MC_AX MC _MC_AX 1 Axes Group Variables MC _MC_GRPI MC _MC_GR 1 A Precautions for Correct Use Device variables for CJ series Units You can assign the same address to more than one variable However this is not recommended as it reduces readability and makes the program more difficult to debug If you do this set an ini tial value for only one of the variables If you set a different initial value for each individual vari able the initial value is not stable EN Additional Information You cannot use an AT specification for an EtherCAT slave Always specify the device variables for EtherCAT slaves 6 52 NJ series CPU Unit Software User s Manual W501 6 Programming i Retain Use the Retain attribute to specify whether a variable should retain its value in the following cases e When power is turned ON after power interruption e When the operating mode is changed e When a major fault level Controller error occurs If the Retain attribute is not set the value of the variable is reset to its initial value in the above situa tions You can specify the Retain attribute when you need to retain the data that is stored in a variable Such as the manufacturing quantities even after the power to the Controller is turned OFF For a variable with an AT specification the setting of the Retain attribute must agree with addres
199. Err CIP Communications Error e _EIP_TcpAppErr TCP Application Communications Error T wo w lt m mp D 3 Q D h 5 D Q S D z D o J syg snye1s 10113 Jo shuluesy Z g y The meaning of the bits are shown in the following table However do not use the following variables in the user program _ErrSta Controller Error Status _CJB_ErrSta I O Bus Error Status _CJB_MstrErrSta I O Bus Master Error Status and _CJB_UnitErrSta O Bus Master Unit Status There may be a delay in updating them and concur rency problems in relation to the error status of the function module Use these variables only to access status through communications from an external device Bit Meaning 15 Master detected error This bit indicates whether the master detected a Controller error in the Unit slave for the error status of the Controller error TRUE The master detected a Controller error FALSE The master has not detected a Controller error Valid for _CJB_U_ErrSta and _EC_ShvErrTbl 14 Collective slave error status This bit indicates if a Controller error was detected for levels e g a Unit slave axis or axes group that are lower than the event source i e for a function module TRUE A Controller error has occurred at a lower level FALSE A Controller error has not occurred at a lower level Valid for _CJB_ErrSta MC_ErrSta and _EC_ErrSta 8 to 13 Not used NJ series CPU Unit Software User s Manu
200. EtherCAT Slave e EC _ConnectSlave Variable name _EC_DisconnSlavTbl Meaning Disconnected Slave Table Global local Global Function Slaves are given in the table in the order of slave node addresses The element for a slave is TRUE if the corresponding slave was disconnected Data type Array 1 192 OF BOOL Range of values TRUE or FALSE R W access R ss Retained Not retained Network Publish Published Usage in user program Possible Related instruc Disconnect EtherCAT Slave tions e EC_DisconnectSlave Connect EtherCAT Slave e EC_ConnectSlave Variable name _EC_DisableSlavTbl Meaning Disabled Slave Table Global local Global Function Slaves are given in the table in the order of slave node addresses The element for a slave is TRUE if the corresponding slave is disabled Data type Array 1 192 OF BOOL Range of values TRUE or FALSE Usage in user program Related instruc tions Variable name _EC_PDActive Meaning Process Data Communications Status Global local Global Function TRUE when process data communications are performed with all slaves Data type BOOL Range of values TRUE or FALSE R W access Rs Retained Not retained Network Publish Published Usage in user program Possible Related instruc Disconnect EtherCAT Slave tions e EC_DisconnectSlave Connect EtherCAT Slave e EC_ConnectSlave A 66 NJ series CPU Unit Software User s Manual W501 Appendices Variable name _EC_PktMonStop
201. Exceeded Detection setting in the Task Settings of the Sysmac Studio The default setting is to detect the error Primary period Primary period Primary period Primary period fF OH I ees he ae Primary periodic task UPG MC UPG MC Task Period Exceeded Error occurred Even if detection of Task Period Exceeded Errors is disabled information will be output to the following if task processing is not completed within the period Task Period Exceeded Flag _ lTaskName_Exceeded Task Period Exceeded Count _ JaskName_ExceedCount Controller Error Status _ErrSta and the event log p N D m 2 V lt m D 3 I O is refreshed as follows if task processing is not completed within the task period Outputs The values from the previous period are output Inputs Refresh values for inputs are not reflected in the user program Task Period Exceeded Error Error name Error level Correction Task Period Minor fault Review the task settings and programs and download the project Exceeded Error again Cycle the power supply or reset the CPU Unit to reset the error H Precautions for Correct Use SYSEL 0 POPe OY S10 L L g 9 If the Task Period Exceeded Error occurs shorten the programs to fit in the task period or increase the setting of the task period i Motion Control Period Exceeded Error A Motion Control Period Exceeded Error occurs if the motion control processing MC is not completed within the pri
202. FF and the time when operation is started e You can check these records based on the time You can therefore use them to isolate the causes of errors when problems occur g Types of Events Events are classified as shown below NJ series CPU Unit Software User s Manual W501 9 43 P fo m lt 5 re O O UONONPOIU L 9 6 9 CPU Unit Functions System defined Events Controller Events The Controller automatically detects these events Controller events include events for the function modules in the CPU Unit CJ series Units and EtherCAT slaves The different types of system defined events are as follows e Controller errors e Controller information User defined Events These are events that occur in applications that the user developed You can execute instructions to create the following types of events e User defined errors e User defined information You can read the event logs from the Sysmac Studio or from an NJU series compatible NS series PT 9 6 2 Detailed Information on Event Logs 9 44 i Event Sources This information identifies where an event occurred in the Controller The event sources are given below for Controller events and user defined events Sources of Controller Events Controller events occur in the function modules in the CPU Unit For some function modules there is more detailed information about the event source This informa tion is called the detailed eve
203. Files can be read from or written to the SD Memory Card in the CPU Net IP port cations service Unit from computers at other Ethernet nodes Clock information is read from the NTP server at the specified time or at a specified interval after the power supply to the CPU Unit is turned ON The internal clock time in the CPU Unit is updated with the read time Built in EtherNet IP port internal status information is provided to net r SNMP agent Communica work management software that uses an SNMP manager Hons ae Control information is exchanged in cyclic communications between Process data communications the EtherCAT master and slaves Control information is exchanged in noncyclic event communications between the EtherCAT master and slaves The following application protocol is supported EtherCAT CoE CANopen over EtherCAT port Information is read from connected slave devices and the slave config Network scanning mh fs uration is automatically generated Time is synchronized by sharing the EtherCAT system time among all EtherCAT devices including the master To implement the distributed clock propagation delay compensation drift compensation and offset compensation are performed Automatic clock adjustment SDO communications DC distributed clock The following instructions are supported CIP communications instructions SDO message instructions no protocol communications instructions and protoco
204. Global local Global Function Gives the I O bus error status Note Do not use this variable in the user program There may be a delay in updating it and concurrency prob lems may occur Use this variable only to access status through communications from an external device Refer to A 3 7 Meanings of Error Status Bits for the meanings of the error status bits Data type WORD Range of values 16 0000 to 16 00F0 Usage in user program Not possible Related instruc You can access this variable from the user program only with the following tions instruction e GetCJBError You can use the following instruction to clear this variable e ResetCJBError Variable name _CJB_MstrErrSta Meaning I O Bus Master Error Status Global local Global Function Gives the I O bus master error status Note Do not use this variable in the user program There may be a delay in updating it and concurrency prob lems may occur Use these variables only to access status through communications from an external device Refer to A 3 7 Meanings of Error Status Bits for the meanings of the error status bits Data type WORD Range of values 16 0000 to 16 00F0 Usage in user program Not possible Related instruc You can access this variable from the user program only with the following tions instruction e GetCJBError You can use the following instruction to clear this variable e ResetCJBError Variable name _CJB_UnitErrSta Meaning I O Bus Unit Error Stat
205. ION siriana araa 9 37 triggered tracing ssesssssssoesssssnrsrrreerrresrrrnrrrrerenree 9 35 data Types cre aa a uaneaaaemteetdienee ls 6 30 Unter ene erent create er tenet rte eer nrnt ce cneants ease tcet er 6 31 BY et tesa ca sare ee ena aa Se 6 31 CONVO esee auctaarencectaestts 6 37 DATE aa cree nee oP Or eet oe ere myers Ser 6 32 DINT esana canada anes tatgncaee fe asic atead oateere tones 6 31 PWOR D eta odes ht este ese ee oe 6 31 PINES aesteceesaccssate casero A 6 31 EIN oc Seat te act sae eas ena ee een a eaten ee gece 6 31 LRE Marre merit eee cere eae en Meee cece ere a 6 32 WOR D seattle cette eet tatee otal te ena oa ad aees 6 31 REAL scccatest oats con teccec te caresearecn shee camsepeeereaenceesaecec ates 6 32 SD ee se eae ne E aera goene cued e EENE E EE 6 31 SPOSCIICAN OMS icnctasatecteatsis E eeatesieenactas 6 33 STRING eeen teeth eed ral et ae 6 32 FAV coun pene ee epee heen Urnne senate rrr eet eee rence 6 32 PAME OF A 12 eer sree arses nen wr eee nee Ore 6 32 UDIN aan ese eres ee cere eee triste E 6 31 BEING eae cs te ee ie a ade eal 6 31 EIN a6 b08ceceses voccet sant a E tee 6 31 ROUND east ate ante accent aaausraayeenatauatt dana nacyceam eae 6 31 WORD pepe erie eee corer E 6 31 date And MMC eee esi Aes a oe att 6 32 CANS rea tecneec te A E 6 32 derivative data types ccccccscseccsssseeeesseeseeeeeseeseeeneaes 6 33 device variable name Creating automatically 00 ececeeeeeeeeeeeeeeeeeeeeeees 3
206. IP The variables are described in the tables of this appendix as shown below values This is the system This is the mean The function of the variable is described The data The range of The page of defined variable ing of the vari type of the values thatthe the individual name The prefix able variable is variable can system gives the category given take is given defined vari name able specifi cations table is given A 3 1 System defined Variables for the Overall NJ series Controller No Category Functional Classification Clock values _CurrentTime System Time Contains the CPU Unit s internal clock data DT 1970 01 page A 47 01 00 00 00 to DT 2106 02 06 23 59 59 A 26 NJ series CPU Unit Software User s Manual W501 Functional Classification Tasks _TaskName__ Active _TaskName __ LastExecTime _ TaskName __ MaxExecTime _TaskName __ MinExecTime _ TaskName__ ExecCount _ TaskName __ Exceeded _ TaskName__ ExceedCount Task Active Flag Last Task Execution Time Maximum Task Execution Time Minimum Task Execution Time Task Execution Count Task Exceeded Flag Task Period Exceeded Count TRUE during task execution FALSE when task execution is not in progress Note You cannot use this system defined variable in the user program It is used only to access task status for data trac ing from the Sysmac Studio Contains the task execution time the
207. IP port 100 Mbps 100Base TX Shielded twisted pair cable STP Category 5 5e or higher 100 m max distance between hub and node There are no restrictions if a switching hub is used T h 2 D O O D i O 5 T SUOIJEDIJIN9dS SOURWIOLOd Z L Y NJ series CPU Unit Software User s Manual W501 A 5 Appendices Item NJ501 1300 NJ501 1400 NJ501 1500 CIP service Tag data links cyclic communications Number of 32 connections 10 to 10 000 ms in 1 0 ms increments Packet interval Can be set for each connection Data will be refreshed at the set inter val regardless of the number of nodes Permissible 1 000 pps including heartbeat communications band Number of tag sets 32 Tag types Network variables CIO Work Holding DM and EM Areas Number of tags per 8 Seven tags if Controller status is included in the tag set connection i e per tag set Maximum link data 19 200 bytes size per node total size for all tags Maximum data size 600 bytes Note Data concurrency is maintained within each connec per connection tion Number of 32 1 connection 1 tag set registrable tag sets Maximum tag set 600 bytes Two bytes are used if Controller status is included in the tag size set Changing tag data Supported 2 link parameters when Controller is in RUN mode Multi cast packet Supported filter CIP message service Explicit messages Class 3 numb
208. If lt condition_expression gt is TRUE lt statement is not executed and the REPEAT construct is exited Precautions e REPEAT must always be used together with END_REPEAT e Even if the lt condition_expression gt is TRUE before lt statement is executed lt statement gt is exe cuted In other words lt statement gt is always executed at least one time e lt statement gt can contain multiple lines of code for the statement Separate statements with a semicolon e You can also specify a BOOL variable including functions that return a BOOL value for the condi tion expressions instead of an actual expression Example Example 1 Numbers from 1 to 10 are added and the values are assigned to the variable TOTAL A 1 TOTAL 0 REPEAT TOTAL TOTAL A gt a u Oo D 3 3 5 rr D c D Q D o A A INT 1 UNTIL A gt 10 END_REPEAT e f you do not write correct condition expressions the program execution time increases and may cause a Task Period Exceeded Error Example intVar INT 1 REPEAT intVar intVar INT 1 UNTIL intVar INT 0 END_REPEAT e6benbue7 1x9 painionus S 9 EXIT Overview Use this statement only inside a repeat construct FOR construct WHILE construct or REPEAT construct to exit the repeat construct Use this statement inside an IF construct to exit from the repeat construct when a condition is met Reserved Words EXIT NJ
209. In the above example 100 does not equal 200 so the value is TRUE Does not match A V NJ series CPU Unit Software User s Manual W501 6 75 6 Programming Priority Operation Operator Notation example and evaluated value 1 Highest 11 Lowest Logical AND AND amp Applies 1 bit AND logic to all bits 9 The results of 1 bit AND logic are as follows 0o AND O 0 O AND 1 0 1 AND O 0 1 AND 1 1 0101 AND 1100 Value 0100 Logical exclusive OR XOR Applies 1 bit exclusive OR logic to all bits The results of 1 bit exclusive OR logic are as fol lows O XOR 0 0 O XOR 1 1 1XORO 1 1XOR 1 0 0101 XOR 1100 Value 1001 Logical OR Applies 1 bit OR logic to all bits The results of 1 bit OR logic are as follows 0OORO 0 0OR 1 1 1ORO 1 1OR1 1 0101 OR 1100 Value 1101 If operators with different priorities are mixed the operators with the highest priorities are executed first Example X 1 2 3 4 In this case X is assigned a value of 9 Calculations are performed based on the data types For example the result of calculations with INT data will be INT data If the expression A B is calculated with INT variables A 3 and B 2 the result would not be 1 5 because all values after the decimal point are truncated Thus in this case the expression A B 2 would evaluate to 2 instead of 3 Use it with caution 6 76 NJ series CPU Unit Software User s Manual W501 6 Programming Data Types for Operator O
210. In Execution This function performs step execution into a function block Step out Execution This function performs step execution from a function block to the next instruction One period Execution This function executes the current task for one period Execution pauses at the beginning of the pro gram in the next period uoHeINWIS L Z 7 Breakpoints This function is used to specify a location in the program and pause the Simulator at that location during execution Pausing This function pauses operation of the Simulator Conditional Breaks This function stops the execution of the program at a breakpoint when the specified stopping condi tion is met You can combine multiple conditions with OR logic as the condition BulbBngeq uoneinWis S 4 Z Cycling Power This function simulates turning the power OFF and ON resetting NJ series CPU Unit Software User s Manual W501 7 5 7 Simulation Transferring Projects to the Physical CPU Unit and Operation This function adds the program execution time refreshing time and other required times to display esti mated processing time for each task based on the times computed during simulations i Task Execution Time Monitor Display The display is the same as when connected to a physical CPU Unit Only the task execution time is dis played when you are connected to a physical CPU Unit Configurations and Setup C rs P ee bA Pr
211. Introduction The initial settings for the PLC Function Module are listed below e Controller Setup e Task Settings Select Configurations and Setup Controller Setup and Configurations and Setup Task Set tings on the Sysmac Studio to make these settings 4 2 2 Controller Setup i Operation Settings Tab Page Basic Settings The Operation Settings are for functions supported by the CPU Unit such as the definitions of oper ations when the power is turned ON or when the operating mode changes New Project Configurations and Setup oma T Configurations and Setup Is Basic Settings gt on EtherCAT gt CPU Expansion Racks v Operation Settings 4 IO Map Startup mode RUN mode PROGRAM mode v Controller Setup v SD Memory Card Settings A Built in EtherNet Il Memory card diagnosis at startup Do not check Check gt t Motion Control Setup System Service Monitoring Settings System service execution interval ms System service execution time ratio w Security Settings Write protection at startup Do not use Use Setting Change during RUN Mode Parameter Setting Description Update tim Changes in group ing RUN mode Operation Settings SD Memory Card Setting Startup Mode Sets the CPU Unit s RUN or PRO RUN mode When down Not allowed operating mode at star GRAM mode loaded to tup CPU Unit Memory Card Sets whether to execute Do not check Do not check When d
212. J series CPU Unit Software User s Manual W501 5 3 Ol I O lt oO a D x gJ o Q gt u O O Q c g gt 5 Designing Tasks Offline Debugging with the Sysmac Studio Desktop Operation Check Perform desktop debugging of sequence control and motion control with the Simulator virtual controller Monitor the task execution times in the Task Execution Time Monitor Display Reference Section 7 Simu lation Transfer ring Projects to the Physical CPU Unit and Operation 5 2 12 Monitor ing lask Execu tion Status and Task Execution Times NJ series CPU Unit Software User s Manual W501 5 Designing Tasks 5 2 Task System This section describes the task system used by NJ series Controllers 5 2 1 Introduction Tasks Tasks are used to assign an execution condition and execution order to a series of processes such as I O refreshing and user program execution There are two kinds of tasks as shown in the following table They are defined by their execution condi tions and execution priorities Typeset pump task Hon Definition Main processing content task of tasks tion priority Primary 1 4 fixed The primary periodic task is executed I O refreshing user pro periodic once every task period It has higher pri gram execution and task ority than any other task Motion control motion control and EtherCAT communications are
213. L Range of values TRUE or FALSE Usage in user program Related instruc tions Auxiliary A50 to A69 Area A50 00 to A69 15 addresses Variable name _CJB_CBUO0O0lnitSta to _CJB_CBU15InitSta Meaning CPU Bus Unit Initializing Flags Global local Global Function The corresponding variable is TRUE during initialization of the CPU Bus Unit a w Oo D z O ot O 5 o O 5 a Q v w lt m mp D F Q D h 5 D Q S 9 o D o The corresponding variable changes to FALSE when the initialization is completed The numbers in the variables indicate the unit numbers of the applicable Units Data type BOOL Range of values TRUE or FALSE Usage in user program Related instruc ResetUnit tions Auxiliary A302 Area A302 00 to A302 15 addresses Variable name _CJB_SlOoOInitSta to _CJB_SlO95InitSta Meaning Special I O Unit Initializing Flags Global local Global Function The corresponding variable is TRUE during initialization of the Special I O Unit AioBbeyeg ejnpoyy uonouny Old V gro JWEN The corresponding variable changes to FALSE when the initialization is completed The numbers in the variables indicate the unit numbers of the applicable Units Data type BOOL Range of values TRUE or FALSE R W access R Retained Not retained Network Publish Published Usage in user program Related instruc ResetUnit tions Auxiliary A330 to A335 Area A330 00 to A335
214. LSE to TRUE or from TRUE to FALSE You can specify the Edge attribute only for BOOL input variables to function blocks Application Use the Edge attribute when you want the function block to accept the input only when the input parameter changes from FALSE to TRUE or from TRUE to FALSE For example you can use this attribute when you want to execute the function block any time there is a change detected in an input parameter Operation e If you specify a change to TRUE the input variable changes to TRUE only when the input param eter connected to that input variable changes from FALSE to TRUE e If you specify a change to FALSE the input variable changes to TRUE only when the input param eter changes from TRUE to FALSE Specification Value of input parameter Value of variable FALSE to TRUE TRUE Change to TRUE TRUE to FALSE TRUE Change to FALSE Changes according to the input None parameter value 6 3 9 Changes to Variables for Status Changes The values of variables in the CPU Unit will change as shown in the following table when the power is turned ON when the operating mode changes when the variable table is downloaded when a major fault level Controller error occurs or during online editing mcm opereung After downloading mode changes When the Clear the present values of Change from Retain attribute When power is ova iaD e Type of variable turned ON PROGRAM to PAPEETE When the check RUN mode or 5 bo
215. LSIF lt condition_expression_2 gt THEN lt statement_2 gt o on u O Q D 5 ELSIF lt condition_expression_3 gt THEN lt statement_3 gt 5 Q rr gt Q c Q ELSIF lt condition_expression_n gt THEN lt statement_n gt ELSE lt statement_m gt END_IF Process Flow Diagram Condition N FALSE expression 3 e6benbue7 1x9 painionuis S 9 Statement m NJ series CPU Unit Software User s Manual W501 6 83 6 Programming 6 84 Application Use this construct to perform a process depending on evaluation of multiple conditions condition expressions Description If lt condition_expression_1 gt is TRUE lt statement_1 gt is executed If lt condition_expression_1 gt is FALSE and lt condition_expression_2 gt is TRUE then lt statement_2 gt is executed If lt condition_expression_2 gt is FALSE and lt condition_expression_3 gt is TRUE then lt Statement_3 gt is executed If lt condition_expression_n gt is TRUE lt statement_n gt is executed If none of the conditions is TRUE lt statement_m gt is executed Precautions e IF must always be used together with END_IF e Write statements that can be TRUE or FALSE for the condition expressions Example IF A gt 10 You can also specify BOOL variables including functions that return a BOOL value for the condi tion expressions instead of an actual expression In that case when the variable is TRUE the evalu
216. Module Refer to A 3 7 Meanings of Error Status Bits for the meanings of the error status bits Data type WORD Range of values 16 0000 to 16 00F0O R W access R ss Retained Not retained Network Publish Published Usage in user program Possible Related instruc GetPLCError tions You can use the following instruction to clear this variable e ResetPLCError A 4 3 PLC Function Module Category Name CJB Functional Classification I O Bus Status Variable name _CJB_MaxRackNo Function Contains the largest rack number of the Expansion Racks that are detected by the Controller Data type UINT Range of values O to 3 0 Only CPU Rack Usage in user program Related instruc tions Variable name _CJB_MaxSlotNo Function Contains one higher than the largest slot number with a CJ series Unit on each of the Racks that are detected by the Controller Data type ARRAY 0 3 OF UINT Range of values 0 to 10 0 No CJ series Unit mounted R W access R ss Retained Not retained Network Publish Published Usage in user program Related instruc tions NJ series CPU Unit Software User s Manual W501 A 55 a w Oo D z O ot O 5 o O 5 a Q v w lt m mp D F Q h 5 D Q S o D o AioBeyeg ejnpoyy uonouny Old V gro swen Appendices Functional Classification I O Bus Errors Variable name _CJB_ErrSta Meaning I O Bus Error Status
217. Motion control instructions that are based on PLCopen standards and an instruction set POUs that follows IEC rules are provided Programming with Variables to Eliminate Worrying about the Memory Map You access all data through variables in the same way as for the advanced programming languages that are used on computers Memory in the CPU Unit is automatically assigned to the variables that you create so that you do not have to remember the physical addresses A Wealth of Security Features The many security features of the NJ series Controllers include operation authority settings and restriction of program execution with IDs Complete Controller Monitoring The CPU Unit monitors events in all parts of the Controller including mounted Units and EtherCAT slaves Troubleshooting information for errors is displayed on the Sysmac Studio or on an NS series PT Events are also recorded in logs NJ series CPU Unit Software User s Manual W501 1 3 J 1 1 2 Introduction Sysmac Studio Automation Software The Sysmac Studio provides an integrated development environment that covers not only the Con troller but also covers peripheral devices and devices on EtherCAT You can use consistent proce dures for all devices regardless of the differences in the devices The Sysmac Studio supports all phases of Controller application from designing through debugging simulations commissioning and changes during operation A Wealth
218. N te mg e gt C gt The POUs consists of a combination of these three types of POUs You can create many POUSs You assign the programs to tasks to execute them SNOd FV EUM 1 2 9 NJ series CPU Unit Software User s Manual W501 6 5 6 Programming 6 2 2 Overview of the Three Types of POUS f Programs Executing Programs and Execution Conditions e You execute a task to execute the programs that are assigned to that task e Programs are always executed Notation e The POUs must include at least one program You can assign up to 128 programs to a single task j Function Blocks FBs Executing Function Blocks and Execution Conditions e You can call function blocks from programs or other function blocks to execute them e Function blocks are always executed e f you want a function block to execute only when a condition is met you must define an input vari able that sets the execution condition Notation e You can use any instruction user defined function or user defined function block in the algorithm of a function block e You can retain the values of internal variables Therefore you can retain status such as for timers and counters e There are both user defined and system defined function blocks User defined function blocks are called user defined function blocks System defined function blocks are sometimes called FB instructions For details on function blocks refe
219. NJ series CPU Unit Built in EtherCAT Port User s Manual NJ501 OULL I NJ501 OULL I NJ501 OULL I SYSMAC SE2ULLI W505 NJ series CPU Unit Built in EtherNet IP Port User s Manual W506 NJ series Troubleshoot W503 ing Manual Sysmac Studio Version 1 W504 Operation Manual CX Integrator W464 CS CJ CP NSJ series Network Configuration Tool Operation Manual CX Designer User s Manual V099 CX Protocol Operation W344 Manual NJ series CPU Unit Software User s Manual W501 Model numbers Application Using the built in EtherCAT port on an NJ series CPU Unit Using the built in Ether Net IP port on an NJ series CPU Unit Learning about the errors that may be detected in an NJ series Controller Learning about the operat ing procedures and func tions of the Sysmac Studio Learning how to configure networks data links rout ing tables Communica tions Unit settings etc Learning to create screen data for NS series Pro grammable Terminals Creating data transfer pro tocols for general purpose devices connected to CJ series Serial Communica tions Units Related Manuals Description Information on the built in EtherCAT port is pro vided This manual provides an introduction and provides information on the configuration fea tures and setup Use this manual together with the NJU series CPU Unit Hardware User s Manual Cat No W500 and NJ series CPU Un
220. NJ series CPU Unit Software User s Manual W501 6 85 6 Programming Application Use this construct to perform different actions based on the value of an integer Description If lt integer_expression gt matches lt integer_expression_value_n gt lt statement_n gt is executed If lt integer_expression gt does not match any of the integer values lt statement_m gt is executed Precautions e CASE must always be used together with END_CASE e Use one of the following for the lt integer_expression gt e An integer or enumeration variable example abc e An integer expression example abc def e A function that returns an integer value example xyz e You can write any of the statements on multiple lines Separate statements with a semicolon e To specify OR logic of multiple integers for lt integer_expression_value_n gt separate the values with commas To specify a continuous range of integers separate the start integer and the end integer with two periods Example 1 You can specify a condition for a specific integer value or the same condition for multiple integer values CASE A OF TAHT A value of 1 is assigned to variable X when variable A is 1 2 X 2 A value of 2 is assigned to variable X when variable A is 2 SOK o A value of 3 is assigned to variable X when variable A is 3 ELSE X 0 If none of the values is matched a value of 0 is assigned to END_CASE the variable X CASE A OF
221. No W505 Section Description Section 1 This section provides an overview of EtherCAT communications describes the sys Introduction tem configuration and specifications and provides operating procedures Section 2 This section provides the part names and describes the slave settings and Sysmac Part Names and Slave Settings device functions Section 3 This section describes the different types of EtherCAT communications EtherCAT EtherCAT Communications settings and state transitions Section 4 This section describes how to connect and wire an EtherCAT network EtherCAT Network Wiring Section 5 This section describes how to set the network configuration information and how to Setting Up EtherCAT Communica check EtherCAT communications from the Sysmac Studio tions with the Sysmac Studio Section 6 This section describes the timing of communications response times and special Process Data Communications and instructions for process data communications and SDO communications It also pro SDO Communications vides sample programming Section 7 This section describes the system defined variables that are related to the built in System defined Variables That Are EtherCAT port Related to the Built in EtherCAT Port Section 8 This section provides a series of example operations for when an NJ series CPU Unit Example of Operations for EtherCAT is connected to slaves Communications This section describes the event codes error confirmati
222. O Map gt 4 Controller Setup wY 1 Motion Control Setup v Z MC_Axis000 0 5 Axes Group Settings amp Cam Data Settings gt Event Settings E Task Settings Parameters to show All v re A E s n i I P Configurations and Setup Axis Name 1 MC_Axis000 0 Y Axis Basic Settings Axis use Used axis Axis type Virtual servo axis Feedback control Input device Channel Output device Channel Unit Conversion Settings Unit of display D Command pulse count per motor rotation Work travel distance per motor rotation 10000 pulse rev Y Operation Settings W Data Trace Settings Maximum velocity 400000000 pulse s Velocity warning value Maximum jog velocity 1000000 pulse s Maximum acceleration 0 pulse s 2 Acceleration warning value Maximum deceleration 0 pulse s 2 Deceleration warning value Acceleration deceleration over se rapid acceleration deceleration Blending is changed to Buffered Operation selection at Reversing Deceleration stop Positive torque warning value Negative torque warning value In position range 10 pulse In position check time 0 msec Actual velocity filter time constant 0 msec Zero position range 10 pulse Y Other Operation Settings Immediate stop input stop method Immediate stop Limit input stop method Immediate stop Drive error reset monitoring time 200 msec Maximum positive torque limit 300 0 Maximum negative torque limit 300 0 Y Limit Settings Software limits Disabled Pos
223. OMRON Machine Automation Controller NJ series CPU Unit Software User s Manual NJ501 1300 NJ501 1400 NJ501 1500 CPU Unit SYS TTletl always in control OMRON 2011 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 constantly 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 Introduction Introduction Thank you for purchasing an NJ series CPU Unit This manual contains information that is necessary to use the NJ series CPU Unit Please read this manual and make sure you understand the functionality and performance of the NJ series CPU Unit before you attempt to use it in a control system Keep this manual in a safe place where it will be available for reference during operation Intended Audience This manual is intended for the following personnel who must
224. Overview of the Three Types of POUS 0 cee 6 6 6 2 3 Differences between Programs Functions and Function Blocks 6 7 6 2 4 Details On Programs 0 lt 2266 oa An wae eke ew we a ew al ee a e 6 7 6 2 5 Details On Function BIOGKS s seent 24 4 aetaed cea petiaeeicenotiaeeis 6 8 6 2 6 Details On RUNCHONS 22 30 Ais des ee weeks G4 be See ed ben te bowed ds 6 17 6 2 7 Operation That Applies to Both Functions and Function Blocks 6 22 6 2 8 POWHRESWICIONS 2 0 29335 25 p02 anaa e ties a a A a bane a ede 6 24 VaNlADICS s bette ace a he Ou cence eee ee ee Sens ee oie ee ee 6 27 6 3 1 VAADE E reS ae ean ee een eee En E Weta e ra owe een CREME emcee een ea 6 27 6 3 2 Types of Variables 0 0 cc ee eens 6 27 6 3 3 Types of User defined Variables in Respect to POUS 6 28 6 3 4 Attributes of Variables 0 0 0 eee 6 29 6 3 5 Data Type Seaia apaaken cage bask a Grated a e toate a canted oem dls 6 30 6 3 6 Derivative Data Types 0 cece eee ees 6 38 6 3 7 Array Specifications and Range Specifications for Data Types 6 44 6 3 8 Variable Attributes 0 0 eee 6 50 6 3 9 Changes to Variables for Status Changes 00000 ee eee 6 57 6 3 10 Function Block Instances 0 000 ccc eee 6 59 6 3 11 Monitoring Variable Values 0 0 ccc ee 6 59 6 3 12 Restrictions on Variable Names and Other Program related Names 6 60 Constants
225. PRGER Flag is a local variable i e internal variable for the program This flag changes to TRUE when an instruction error occurs in the program and remains TRUE during the next task period Variable Data ae need Range of values Initial value writ name type s P_PRGER Instruction Error Flag This flag changes to and BOOL TRUE or FALSE FALSE Read remains TRUE when an write instruction error occurs After this flag changes to TRUE it stays TRUE until the program changes it back to FALSE The user can write the P_PRGER Flag You can temporarily set the value of this flag to FALSE through a user operation to determine if the error occurs within a specific range for example After this flag changes to TRUE it remains TRUE until the operating mode is changed or the flag is overwritten by a program P m c 9 ma O 5 D Example Programs User created initial process Ifthe flag is ON you User created algorithm know that the User created normal l 4 instructions instruction error has process to be inside this range S101143 UONONIYSU JO uoeiado 6 9 9 P_PRGER Error processing for normal process 1 User created normal process 2 The P_PRGER Flag also changes to TRUE when an instruction error occurs inside a user created function block that is used by the program NJ series CPU Unit Software User s Manual W501 6 107 6 Programming 6 7 Programming
226. PU Unit Hardware User s Manual Cat No W500 The settings and operation of the CPU Unit and programming concepts for motion control are described Use this manual together with the NJ series CPU Unit Hardware User s Manual Cat No W500 and NJU series CPU Unit Soft ware User s Manual Cat No W501 The instructions in the instruction set IEC 61131 3 specifications are described When programming use this manual together with the NJ series CPU Unit Hardware User s Manual Cat No W500 and NU series CPU Unit Soft ware User s Manual Cat No W501 The motion control instructions are described When programming use this manual together with the NJ series CPU Unit Hardware User s Manual Cat No W500 NJ series CPU Unit Software User s Manual Cat No W501 and NJ series CPU Unit Motion Control User s Man ual Cat No W507 The methods and precautions for using CJ series Units with an NJ501 CPU Unit are described including access methods and pro gramming interfaces Manuals are available for the following Units Analog I O Units Insulated type Analog I O Units Temperature Control Units ID Sensor Units High speed Counter Units Serial Com munications Units and DeviceNet Units Use these manuals together with the NJU series CPU Unit Hardware User s Manual Cat No W500 and NJ series CPU Unit Software User s Manual Cat No W501 NJ series CPU Unit Software User s Manual W501 Manual name
227. Q 5 Procedure in the I O Map 1 Double click I O Map under Configurations and Setup on the Multiview Explorer The I O Map is displayed 2 Select the I O port to change the present value in the I O Map and do one of the following e Right click and select SET RESET SET or SET RESET RESET e Enter a value in the Value Column in the I O Map sane jueseidg Bulbueuy Z S 6 EN Additional Information If the value is entered in the wrong format an error occurs The illegal values are highlighted in red and an error icon is displayed Place the mouse over the error icon to view the error details Tre 7 I FALSE FALSE The entered value is invalid NJ series CPU Unit Software User s Manual W501 9 33 9 CPU Unit Functions Precautions on Changing the Status of Outputs Assigned to External Devices by Changing Present Values Observe the following precautions when you change the status of an output that is assigned to an I O port of a CJ series Basic Output Unit or EtherCAT output slave by changing a present value Changing Present Values in the I O Map in RUN Mode Any value of an I O port that is changed in the I O Map is then overwritten by the execution results of the user program The value that was specified by changing the present value is not output to the external device To change the value of an I O port and output that value to an external device use forced refreshing Changing Present Values i
228. RGER siden e a ict ees diets A 29 A 53 primary periodic task ccccceseeeceeeeeeeeeeeeeeeeeeeeseeeeeaaaees 5 8 parameta S e 5 13 Process Data Communicating Slave Table A 37 A 66 Process Data Communications Error A 34 A 63 Process Data Communications Status A 37 A 66 Process Data Reception Timeout ceceeeeeeeeees A 34 Process Data Reception Timeout Error 0000 A 63 Process Data Transmission Error asasen A 35 A 63 Program Assignment Settings cccccsseeeeeeeeseeeeeens 4 7 Program Execution Order ccceceeeeeeeeeeeeeeeeeeeeeeaeaeeees 4 7 PROGRAM Mode serrana 2 17 8 4 programming languages eceeeeeeeeeee eee eeeeeeeeeeeeeeeees 6 65 DOAS a scares epee E ea teen 6 7 execution conditions cccceeececeeeeeeeeeeeeneeeeenenerens 6 8 DOTS CUIOM arrena a 9 21 CPU Unit write protection cccccceeseeeeeeeeeeeeeees 9 22 user program transfers with no restoration information 9 22 R range specification cccceeeeeececesseeeceeeeeeeeeeneees 6 33 6 48 Ready Stale sori eee ee 8 3 real NUMDOIS tnvcsisesinsesnictaeseucsienaieouset Satmnoids toate diam 6 32 refreshing task settings cccssscecssseeeeceeeeeeeesaaeeees 5 18 refreshing tasks ccccccceeseeeeceeseeeeceeeeeeceeeeeeessaseees 5 15 Registered Slave Table cccsecceecesseeeeeeeeees A 37 A 65 Registered Target Node Information
229. RRAY TRUE or page A 73 Target Node built in EtherNet IP connections are regis 0 255 OF FALSE Information tered BOOL This variable is valid only when the built in EtherNet IP port is the originator Array x is TRUE The connection to the node with a target node ID of x is regis tered Array x is FALSE The connection to the node with a target node ID of x is not regis tered _EIP_EstbTargetSta 255 Normal Target This variable gives a list of nodes that have ARRAY TRUE or page A 73 Node normally established built in EtherNet IP 0 255 OF FALSE Information connections BOOL Array x is TRUE The connection to the node with a target node ID of x was estab lished normally Array x is FALSE The connection to the node with a target node ID of x was not _EIP_TDLinkAllRunSta All Tag Data Link TRUE Tag data links are communicating in BOOL TRUE or page A 73 Communications all connections as the originator FALSE P oo lt m mp D Q D y 5 D Q S oJ D o established or an error occurred Miobayed ainpoy uonoUN dIAON1943 9 V dlg swen of the target Controller with a node address of x _EIP_TargetPLCModeSta Target PLC Oper This variable shows the operating status of ARRAY TRUE or page A 73 255 ating Mode the target node Controllers that are con 0 255 OF FALSE nected with the built in EtherNet IP portas BOOL the originator The array elements are valid only
230. SD Memory Card is shown by this flag with a delay of up to 100 ms We therefore do not recommend the use of this variable in the user program Data type BOOL Range of values TRUE or FALSE Usage in user program Related instruc tions Variable name _Card1Deteriorated Meaning SD Memory Card Life Warning Flag Global local Global Function TRUE when the life of the SD Memory Card is exceeded If this variable changed to TRUE replace the SD Memory Card Read write operation may fail if the SD Memory Card is not replaced TRUE The life of the Card has been exceeded FALSE The Card can still be used Data type BOOL TRUE or FALSE Usage in user program Related instruc tions Variable name _Card1PowerFail Meaning SD Memory Card Power Interruption Flag Global local Global Function TRUE when the power supply to the CPU Unit was interrupted during access to the SD Memory Card TRUE Power was interrupted during SD Memory Card access FALSE Normal Data type BOOL Range of values TRUE or FALSE Usage in user program Related instruc tions Functional Classification Power Supply Variable name _PowerOnHour Meaning Total Power ON Time Global local Global Function Contains the total time that the power has been ON Contains the total time that the CPU Unit has been ON in 1 hour increments To reset this value overwrite the current value with 0 The value is not updated after it reaches 4294967295 This variable is no
231. SE The output power flow changes Output to FALSE in the next task period after it is TRUE for one task period 1 iaskpo Bened PETA od Time Chart i Function Block Instructions Execution Conditions The operation of the execution condition for an FB instruction depends on the instruction P 5 m c 9 ma O 5 D A specific input variable for the execution condition is defined for each instruction Examples Execute specifies a change to TRUE or a change to FALSE in the execution condition Enable causes the instruction to be executed each task period according to the current execution condition Function block instructions are unconditionally executed for as long as the POU that called them is executed Instruction Options Instruction options cannot be specified suononsjsu Jo Builpuejsuepun oiseg Z 9 9 NJ series CPU Unit Software User s Manual W501 6 103 6 Programming FUN Instructions Execution Conditions All FUN instructions have EN inputs as execution conditions The FUN instruction is executed each task period as long as EN is TRUE Instruction Options In a ladder diagram you can add the following instruction options to specify a change to TRUE ora change to FALSE as the execution condition for that instruction ST statements do not have options Instruction Options Symbol Differentiation Change to This option creates an upwardly differentiated instruc optio
232. Se one 2 18 NJ series CPU Unit Software User s Manual W501 2 1 2 CPU Unit Operation 2 1 Internal Operation of the CPU Unit This section describes the internal configuration of an NJ series CPU Unit 2 1 1 Internal Software Configuration of the CPU Unit i Software Configuration The CPU Unit has the following internal software configuration Motion Control EtherCAT Master EtherNet IP Function Module Function Module Function Module PLC Function Module The software in the NJ series CPU Units is divided into modules that are called function modules The basic function module which is the PLC Function Module runs on top of the OS The other modules run on top of the PLC Function Module A description of each function module is given in the following table Function module name Description PLC Function Module This function module controls overall scheduling executes the user program interfaces the CJ series Units sends commands to the other function mod ules and interfaces the USB connector and SD Memory Card Motion Control Function This function module executes motion processing based on target values Such Module as the position or velocity target value from the motion control instructions in the user program It outputs command values controls status and obtains information through the EtherCAT Master Function Module This function module functions as an open loop controller that outputs com mand values fo
233. Set tings Operation Set tings Error settings Protection Settings at Startup Security Settings TCP IP Set tings Built in EtherNet IP Port Link Set tings Service Settings SNMP Set tings SNMP Trap Settings NTP Settings FTP Settings and IP Router Tables Built in Ether Net IP Port Set tings Tag data link settings for built in Ether Net IP port Node Address Settings FINS UDP Set tings FINS TCP Set tings FINS Routing Tables Axis assignments axis parameter settings axes group parameter settings MC common parameter settings User defined error mes sages Event Setting Table CJ series bus con I O table figura tion Data reten tion at power interrup tions Retained with non volatile memory Retained with non volatile memory Retained with non volatile memory Retained with non volatile memory Retained with non volatile memory Retained with non volatile memory Retained with non volatile memory Retained with non volatile memory Retained with non volatile memory Appendices Transfer ring data Status changes with the a Sysmac l When Og Studio Operating Overwrit power is Chande When a woen MES mopoa ing in RUN tuned ON 5 g protection permitting EA etween MajorFault is enabled writing PRO Level Con Synchro GRAM troller nized data mode and Er
234. Setting Error e _EIP_IPAdrCfgErr TCP IP Basic Setting Error e _E P_lPAdrDupErr IP Address Duplication Error e _E IP_BootpErr BOOTP Server Error e E P_IPRTblErr TCP IP Advanced Setting Error Note lf a link OFF or Built in EtherNet IP Processing Error occurs it is recorded in the event log and then corre sponding bit turns ON Refer to A 3 7 Meanings of Error Status Bits for the meanings of the error status bits Data type WORD Range of values 16 0000 to 16 00F0O Usage in user program Possible Related instruc You can access this variable from the user program with the following tions instruction e GetEIPError A 68 NJ series CPU Unit Software User s Manual W501 Appendices Variable name _EIP_CipErr Meaning CIP Communications Error Global local Global Function This is the error status variable for CIP communications It represents the following error flags e _E lP_lIdentityErr dentity Error e E P_TDLinkCfgErr Tag Data Link Setting Error e _E P_TDLinkOpnErr Tag Data Link Connection Failed e _E P_TDLinkErr Tag Data Link Communications Error e _E P_TagAdrErr Tag Name Resolution Error e EIlP_MultiSwOnErr Multiple Switches ON Error Note Ifa Tag Resolution Error occurs it is recorded in the event log and this variable changes to TRUE Refer to A 3 7 Meanings of Error Status Bits for the meanings of the error status bits Data type WORD Range of values 16 0000 to 16 00F0O Usage in user
235. Shows whether a packet data file is being BOOL TRUE or page A 67 Data File saved FALSE TRUE Packet data file being saved FALSE Packet data file not being saved _EC_InDatalnvalid Input Data Invalid TRUE when process data communications BOOL TRUE or page A 67 are not normal and the input data is not valid FALSE Note All system defined variables that are related to the status of EtherCAT communications give the current status NJ series CPU Unit Software User s Manual W501 A 37 Appendices A 3 6 EtherNet IP Function Module Category Name _EIP Functional Classification EtherNet IP Communications Errors values This is the error status variable for the built in WORD 16 0000 to page A 68 16 00F0 _EIP_ErrSta _EIP_PortErr A 38 Built in EtherNet IP Error Communications Port Error EtherNet IP port It represents the following error flags e _E P_PortErr Communications Port Error e _E P_CipErr CIP Communications Error e EIP_TcpAppErr TCP Application Commu nications Error Note Refer to information on the meanings of the error status bits at the end of this appendix for details This is the error status variable for the com WORD 16 0000 to page A 68 munications port 16 00F0 It represents the following error flags e _EIP_MacAdrErr MAC Address Error _EIP_LanHweErr Communications Control ler Error _EIP_EtnCfgErr Basic Ethernet Setting Error _EIP_IPAdrCfgErr TCP IP Basic
236. This section describes the error messages that are displayed when you check a pro gram on the Sysmac Studio and how to correct those errors The appendices describe the following Driver Installation for Direct USB Cable Connection Specifying One of Multiple Ethernet Interface Cards Online Help Simulation Instructions Manual Structure Manual Structure Page Structure The following page structure is used in this manual 4 Installation and Wiring Level 1 heading Level 2 heading Level 2 heading 4 3 Mounting Units Level 3 heading Gives the current Level 3 heading 4 3 1 Connecting Controller Components headings The Units that make up an NJ series Controller can be connected simply by pressing the Units together and locking the sliders by moving them toward the back of the Units The End Cover is connected in the same way to the Unit on the far right side of the Controller A step In a proced u re 1 Join the Units so that the connectors fit exactly Indicates a procedure CA Ois Heeros Page tab Gives the number of the main section 2 The yellow sliders at the top and bottom of each Unit lock the Units together Move the sliders toward the back of the Units as shown below until they click into place Move the sliders toward the back O O OP until they lock into place J iat Yan Ev g ino jl Special info rmation i Precautions for Correct Use SEE _ ____________ _____se__ __ i_ e_ ___ e_ei_ _e i ___
237. UE and variable b therefore changes to TRUE Execute Done UnitNo Busy Error ErrorlD If Special Unit settings are changed in any of the following ways you must restart the Special Unit or cycle the power supply to the Controller e Editing from the Special Unit Setting Pane of the Sysmac Studio e Editing from the I O Map or Watch Tab Page e Setting the user program Related System defined Variables Variable ae _CJB_CBUOO CPU Bus Unit The corresponding variable is TRUE during initialization of the BOOL InitSta Initializing CPU Bus Unit The corresponding variable changes to FALSE to Flags when the initialization is completed The numbers in the vari _CJB_CBU15 ables indicate the unit numbers of the applicable Units InitSta _CJB_SIOOOI Special I O The corresponding variable is TRUE during initialization of the BOOL nitSta Unit Initializ Special I O Unit The corresponding variable changes to FALSE to ing Flags when the initialization is completed The numbers in the vari _CJB_SIO95I ables indicate the unit numbers of the applicable Units nitSta 9 8 NJ series CPU Unit Software User s Manual W501 9 CPU Unit Functions Variable an _CJB_CBUOO0O CPU Bus Unit The CPU Bus Unit is restarted when the corresponding variable BOOL Restart Restart Bits changes to TRUE It is changed to FALSE by the system after to the CPU Bus Unit is restarted The numbers in the variables _CJB_CBU15 indicate the u
238. Units Special Words allo Retained I O Unit cated to CPU with non Set CJ series Bus Units volatile tings CP Unit Set Example Con memory U Bus tings troller Link Unit Set Data Link tings Tables Words allo e cated in DM oa oy Area Ether Retained Ether i CAT Net Network con with non CAT Con i work figuration volatile figuratio x Configu information memory ration Retained with non Ether Ether volatile CAT Set CAT Set memory tings tings Retained Settings in Slaves by slaves Retained with non volatile memory Operation Authority Verification Retained with non User program execution ID in CPU Unit volatile memory Values of Not non User defined retained Present retained variables variables Values of i Retained 2 User defined retained with Bat i variables variables tery Not Contents CIO WR retained of mem ory used for CJ Retained series HR DM EM ARR Units tery A 78 Transfer ring data Status changes with the Wik Sysmac R l When ee Studio perating overwrit eae when write modes ind in RUN te a ON Change When 2 protection permitting g urne between MajorFault jg enabled writing mode PRO Level Con Synchro GRAM troller nized data mode and Error RUN mode occurs Retained Retained Supported Not Depends retained on the Unit Same as Retained Retained Supported Not RUN PRO Supported
239. User s Manual W501 A 39 Miobayed ainpoy uonoUN dIAON1943 9 V dlg swen Appendices values _EIP_IPRTbIErr TCP IP Advanced Setting Error _EIP_IdentityErr Identity Error _EIP_TDLinkCfgErr Tag Data Link Setting Error _EIP_TDLinkOpnErr Tag Data Link Connection Failed _EIP_TDLinkErr Tag Data Link Communications Error _EIP_TagAdrErr Tag Name Resolution Error _EIP_MultiSwONErr Multiple Switches ON Error _EIP_TcpAppCfgErr TCP IP Setting Error _EIP_NTPSrveErr NTP Server Con nection Error _EIP_DNSSrvErr DNS Server Con nection Error A 40 operation failed FALSE Normal FALSE Normal tag data link parameters was different from the actual node information Note This variable does not change to TRUE FALSE Other than the above TRUE A timeout occurred in a tag data link BOOL TRUE or page A 71 connection FALSE FALSE Other than the above The following causes are possible e The size of the network published variable TRUE Tag resolution failed i e the address BOOL TRUE or page A 71 could not be identified from the tag name FALSE does not agree with the tag setting e The I O direction that is set in the tag data link settings does not agree with the I O direction of the variable in the CPU Unit e There is no network published variable in the CPU Unit that corresponds to the tag setting FALSE Other than the above TRUE More than one data link sta
240. Values are not written to axis variables t when motion control instructions are amp 3 0 i f executed in the priority 16 periodic task ae MP eweaeeeeeee eo ooo o oo oo oo oo e The results of execution of motion control instruction in the previous priority 16 periodic task are read as the value of the axis variable in the next priority 16 periodic task CT Standb Axis 4u variables G read RML _ _ A Motion control instructions executed Primary period t Primary periodic task Priority 16 venctes a periodic task read E ia Motion control instructions executed The results of execution in the previous priority 16 periodic task are read as the values of the axis variables rh ra aN o lt 02 mp D 3 3 Ee a ped oz O a Ee a JJ D ip Ee O gt ep 3 D 02 NJ series CPU Unit Software User s Manual W501 5 33 5 Designing Tasks 5 34 NJ series CPU Unit Software User s Manual W501 Programming This section describes programming including the programming languages and the variables and instructions that are used in programming 6 1 6 2 6 3 6 5 Overview of Programming Procedures 000 0c eee eee eens 6 3 POUs Program Organization Units 000 0c eee eee 6 5 6 2 1 What Are FOUS cerere cist tem ales 2a bes Get caudally ok Shady areata dik Dinko ee ataewer 6 5 6 2 2
241. _ e oO T D D Cc gt Configurations and Setup Item name Value Device name JO1 Model name CJ1W 1D211 Product name DC Input Unit Specifications 24V DC 7mA 16 inp 0 sun O I DISeG 1 2 6 You must do either of the following to enable the settings e Cycle the power supply to the Controller e Reset the Controller the entire CPU Unit from the Sysmac Studio NJ series CPU Unit Software User s Manual W501 9 7 9 CPU Unit Functions i Related System defined Variables The set values for the input response times of the Basic Input Units are output to the following system defined variable _CJB_InRespTm_ Basic Input Unit Input Response Contains the response times of ARRAY 0 3 the Basic I O Units in 0 1 ms 0 9JOF UINT increments 9 2 2 Special Units i Restarting Special Units You can restart a Special Unit Special I O Unit or CPU Bus Unit to enable values that are set for it If you restart a Special Unit you do not have to cycle the power supply to the Controller Execute the fol lowing ResetUnit Restart Unit instruction to restart Special Units Instruction oe Description name Restart Unit Restarts the CPU Bus Unit or Special I O Unit ResetUnit The ResetUnit instruction restarts a Special Unit across multiple task periods when execution condition a changes to TRUE If the restart ends normally the output variable Done normal end changes to TR
242. a dummy member variable b2 that matches the CJ series CPU Unit to the NJ series CPU Unit as well unused memory location on the NJ series CPU Unit A 88 NJ series CPU Unit Software User s Manual W501 Appendices Exchanging Structure Variable Data with ID Tags or Any Other Device Outside of the CPU Unit When you create data to write to a device outside of the CPU Unit in an NJ series CPU Unit struc ture variable the data is arranged as shown below Therefore before you write the data to the ID Tag you must arrange the data as shown below Example Two byte four byte data Data to Write to the ID Tag Bytes First byte First byte 2 Wp tee a ee es oe ee a ge ye yy ye E E 1 Data Type Definitions y N S Z D z D D 3 O lt gt oy O D ot O 5 mp gt O Q o NJ series Structure Variable X Structure Y Bytes Fitbyte a 3 Fist byte 2 I Variable Table First byte 4 nae se ut lems S Series Sump lg es rfl i s jdwex4 esey yueyodwj Z Z Y NJ series CPU Unit Software User s Manual W501 A 89 Appendices In this case use one of the following solutions Solution 1 Change the data format of the ID tag Solution 2 Use instructions to convert the data on the NJ series CPU Unit before you write it to the ID Tag NJ series Structure Variable X BYTE Array Variable Z to Write to ID Tag Bytes Bytes Firstbyte a First byte ZO Value of a First byte 2
243. a program in the task that is set as the I O control task 5 2 5 Assigning Tasks to Programs p N D m 2 V lt m D 3 You assign the programs to execute to tasks You can assign up to 128 programs to one task i Order of Program Execution The order of execution of the programs in a task is set with the Sysmac Studio Sysmac Studio Setting Procedure Assign programs to tasks and set the order of program execution within the tasks in the Program Assignment Settings on the Task Settings Tab Page of the Sysmac Studio For details refer to 4 2 3 Task Settings fi POUs That You Can Assign to Tasks From 0 to 128 programs can be assigned to one task You cannot assign the same program to more than one task swelbold 01 syse Bulubissy S Z S 5 2 6 Parameters for Primary Periodic Task and Periodic Tasks The parameters for primary periodic task and periodic tasks are given below NJ series CPU Unit Software User s Manual W501 5 13 5 Designing Tasks 5 14 Parameters for Primary Periodic Task Changes Parameter Setting range in RUN mode Task Type Specify the primary periodic task pe When Not ae trans allowed y Ee cher Task Name Text string CPU Unit Period Task period 500 us 1 ms 2 ms or 4 ms Execu The process tion Con data communi ditions cations cycle in the EtherCAT settings will be the same as this period Task Period Exceeded Detec Specify whether to detect
244. able Event Setting Table Tab Page Event Setting Table Eventcode Title Levei Group Details Ooo a E a OOO ecere 10001 Failure X User fault Level3 Control A 001 ata E Description Failure X occurred E Correction Perform safety checks and handle the problem according to the cause code Programming Example Detection condition Failure SetAlarm The following items are set in the Event Setting Table New Project Configurations and Setup new_NJ501_0 v iit ores Configurations and Setup mea v 3 EtherCAT gt Node10 R88D KNO1L EC 1 gt Node9 R88D KNO1L ECT 2 gt CPU Expansion Racks I O Map Corrente Event Code Event Name Event Level Group Details if User fault Level 1 User fault Level ff l 5000 User fault Level eee gt Controller Setup gt i Motion Control Setup amp Cam Data Settings gt Event Settings NJ series CPU Unit Software User s Manual W501 Contents of the Event Setting Table Item Event Code Event Name Event Level Group Details Error details that are displayed on the HMI when a major fault level Controller error occurs You can specify a number to identify the event according to the event level You can specify the level of the event The level is indicated with a number The lower the number is the higher the level is You can specify a group name to repre sent the location or type
245. ag i a a a at a Satan aa eae a a a l U FB Do not assign MyStructure variable x to the N7 input D x IN1 OUT1 variable of the function block Data type of N7 input variable of the function block MyStructure S n v Instead assign MyStructure variable x to the NOUT in out xX INOUT INOUT variable of the function block Data type of INOUT in out variable of the function block MyStructure NJ series CPU Unit Software User s Manual W501 6 25 6 Programming Nesting Levels Calling another function block from a function block that was called from a program is called nesting You can nest function blocks up to eight levels deep You can nest user defined functions and user defined function blocks up to eight levels deep total Program Nesting level 1 Nesting level 2 6 26 NJ series CPU Unit Software User s Manual W501 6 Programming 6 3 Variables In the NJ series System variables are used to exchange O information with external devices to per form data calculations and to perform other processes This section describes variable designations in detail Refer to the Sysmac Studio Version 1 Operation Manual Cat No W504 for details on setting variables with the Sysmac Studio 6 3 1 Variables Variables store I O data for exchange with external devices or temporary data that is used for internal POU processing In other words a variable is a container for data with a name data typ
246. ained mode contin ued With out Battery Not predict able may stop Retained Same as Retained Retained Supported Not with Bat before continued continued retained tery power inter ruption i ol O u Cc Cc mp g D mp D J D mp D O 5 D S Q O mp D gt 2 o mp D o NJ series CPU Unit Software User s Manual W501 A 79 Appendices A 6 Contents of Memory Used for CJ series Units You can specify addresses in the memory used for CJ series Units for AT specifications for variables Details on each area are provided below A 6 1 CIO Area fl 0 Bits Description The bits in this area are allocated to input and output terminals on CJ series Basic I O Units The number of words 16 bits each that is required for each CJ series Basic I O Unit are allocated in order based on the position where the Units are connected from left to right starting from the Unit that is closest to the CPU Unit Data in this area is cleared when power is cycled or when the oper ating mode is changed between PROGRAM and RUN mode Addresses Addresses Word addresses Bit addresses Range ClO Oto CIO 159 0 00 to 159 15 EN Additional Information You can access this area on NJ series CPU Units through device variables allocated to I O ports We therefore recommend that you do not use AT specifications to access this area You should use AT specifications for the ClO
247. ajor fault level Partial fault Partial fault level Minor fault Minor fault level Observation Information 2 One of the following Automatic recovery Normal status is restored automatically when the cause of the error is removed Error reset Normal status is restored when the error is reset after the cause of the error is removed Cycle the power supply Normal status is restored when the power supply to the Controller is turned OFF and then back ON after the cause of the error is removed Controller reset Normal status is restored when the Controller is reset after the cause of the error is removed Depends on cause The recovery method depends on the cause of the error 3 One of the following System System event log Access Access event log 4 One of the following Continues Execution of the user program will continue Stops Execution of the user program stops Starts Execution of the user program starts NJ series CPU Unit Software User s Manual W501 12 17 ol tn N Oo ea D o gt oO Oo 5 eo suoduos q 10113 p Z Z 12 Troubleshooting i Errors Related to Tasks Task execution exceeded the timeout detection time Event name Meaning Source Error attributes Effects System defined variables Cause and correction Attached information Precautions Remarks 12 18 PLC Function Module Source details None Detection Continuously timing Level Major fault Recovery Cy
248. al W501 A 45 Appendices Bit Meaning 7 This bit indicates whether a major fault level Controller error has occurred TRUE A major fault level Controller error has occurred FALSE A major fault level Controller error has not occurred 6 This bit indicates whether a partial fault level Controller error has occurred TRUE A partial fault level Controller error has occurred FALSE A partial fault level Controller error has not occurred 5 This bit indicates whether a minor fault level Controller error has occurred TRUE A minor fault level Controller error has occurred FALSE A minor fault level Controller error has not occurred 4 This bit indicates whether an observation level Controller error has occurred TRUE An observation level Controller error has occurred FALSE An observation level Controller error has not occurred 0to3 Not used A 46 NJ series CPU Unit Software User s Manual W501 Appendices A 4 Specifications for Individual System defined Variables The specifications for each system defined variable are given as described below Variable name This is the system defined variable name The prefix Members The member names are given for gives the category name structure variables Meaning This is the meaning of the variable Global local Global Global variable Local Local variable Function The function of the variable is described Data type The data type of the variable is given Range of values The range
249. alid only when the Regis tered Target Node Information is TRUE page A 74 Array x is TRUE A connection was not nor mally established with the target node for a target node ID of x the Registered Target Node Information is TRUE and the Normal Target Node Information is FALSE ora connection was established with the target node but an error occurred in the target Controller Array x is FALSE The target node is not registered for a target node ID of x the Registered Target Node Information is FALSE or a connection was normally established with the target node the Regis tered Target Node Information is TRUE and the Normal Target Node Information is TRUE An error occurred in the target Controller the Target PLC Error Information is TRUE Use the GetNTPStatus instruction to read the NTP operation information from the user program Direct access is not possible _SNTP_ RESULT page A 74 DATE_ AND_ TIME Gives the last time that NTP processing ended normally The time that was obtained from the NTP server is stored when the time is obtained normally The time is not stored if it is not obtained from the NTP server normally Depends on data type page A 74 Note Do not use this variable in the user program There may be a delay in updating it Use this variable only to access status through communica tions from an external device TRUE Indicates an NTP normal end FALSE Indicates that NTP ope
250. also have knowledge of electrical sys tems an electrical engineer or the equivalent e Personnel in charge of introducing FA systems e Personnel in charge of designing FA systems e Personnel in charge of installing and maintaining FA systems e Personnel in charge of managing FA systems and facilities For programming this manual is intended for personnel who understand the programming language specifications in international standard IEC 61131 3 or Japanese standard JIS B3503 Applicable Products This manual covers the following products e NJ series CPU Units e NJ501 1300 e NJ501 1400 e NJ501 1500 NJ series CPU Unit Software User s Manual W501 1 Relevant Manuals Relevant Manuals There are three manuals that provide basic information on the NJ series CPU Units the NU series CPU Unit Hardware User s Manual the NJ series CPU Unit Software User s Manual this manual and the NJ series Instructions Reference Manual Most operations are performed from the Sysmac Studio Automation Software Refer to the Sysmac Stu dio Version 1 Operation Manual Cat No W504 for information on the Sysmac Studio Other manuals are necessary for specific system configurations and applications Read all of the manuals that are relevant to your system configuration and application to make the most of the NJ series CPU Unit NJ series CPU Unit Hardware User s Manual NJ series CPU Unit Software User s Manual rroan ono
251. alue Analog 1 0 Configurations and Setup Basic 1 0 z Model name ET General purpose device Product name Analog Input Unit 4 points Sensor Specifications E Temperature controller Rack No Slot No Unit No Assigned unit numbers ial Unit Setti setings input Keywo veel rth cil Fe Edit Special Unit Settings T l CJ1W AD042 gt Programming CJ1W AD04U E CJ1W AD081 V1 il CJ1W B7A04 E CJ1W B7A14 l CJ1W B7A22 Model information Displays the model number product name vendor name and specifications information for the selected Unit Unit information Displays device information for the selected Unit such as the rack number slot number unit number device name number of unit numbers assigned response time and error information Rack information Click the tab to the right of a rack to view its power consumption and size Registering Units Procedure to Change the Power Supply Unit Model 1 Right click the Power Supply Unit and select Change Model from the menu The Change Model Dialog Box is displayed 2 Select the Power Supply Unit and then click the OK Button Procedure to Insert Units 7 Drag the selected Unit from the Model Selection Pane to the Unit Editor The Unit is inserted Procedure to Change the Unit Model 1 Right click the Unit and select Change Model from the menu The Changing Unit Model Dialog Box is displayed 2 Select the Unit and then click the OK Button The Unit is changed
252. am Depending on the difference in the forced status the control system may operate unexpectedly 9 5 2 Changing Present Values i Description You can change the present values of variables that are used in the user program and settings and you can change program inputs and outputs to TRUE or FALSE This allows you to check the operation of the user program and settings Sysmac Studio CPU Unit n LLLI LLLP IIIT LZ LLL LIAI IZZI I TILIL IIZ EJ You can change the values of variables as required Precautions for Safe Use Always confirm the safety of the system before you change the present value of a variable i Application Changing Program Inputs and Outputs to TRUE or FALSE You can change the value of any BOOL variable to TRUE or FALSE The specified value is then overwritten by the execution results of the user program If the operating mode is changed or the power supply is cycled the initial value is restored You can control BOOL variables in the Ladder Editor Watch Tab Page or I O Map Changing the Values of Other Variables You can change the present values of user defined variables system defined variables and device variables as required You can do this on a Watch Tab Page Precautions for Safe Use Always confirm the safety of the system before you change the present value of a variable 9 32 NJ series CPU Unit Software User s Manual W501 9 CPU Unit Functions i Operating Pro
253. am There may be a delay in updating it and concurrency prob lems in relation to the status of the function module Use this variable only to access status through com munications from an external device Refer to A 3 7 Meanings of Error Status Bits for the meanings of the error status bits Data type WORD Range of values 16 0000 to 16 COFO R W access Rs Retained Not retained Network Publish Published Usage in user program Not possible Related instruc ResetPLCError tions e ResetCJBError e ResetECError e ResetMCError e MC_Reset e MC_GroupReset You can access this variable from the user program only with the following instructions e GetPLCError e GetCJBError e GetECError e GetMCError e GetEIPError NJ series CPU Unit Software User s Manual W501 A 49 a w Oo D z O ot O 5 o O 5 a Q v w lt m mp D F Q h 5 D Q S 9 o D o A105929 ON J9 04 UOD SOUOS PN EJBAC BU 104 SB QeUeA PeUIJep WaISAS Y Y Appendices Variable name _AlarmFlag Meaning User defined Error Status Global local Global Function The bit corresponding to the event level is TRUE while there is a user defined error Bits 00 to 07 correspond to user fault levels 1 to 8 This variable contains 0000 hex when there is no user defined error Data type WORD Range of values 16 0000 to 16 00FF R W access R ss Retained Not retained Network Publish Published Usage in user pr
254. an HMI You can clear the event logs from the Sysmac Studio or from an NJ series compatible NS series PT You can clear the Controller event log and user defined event log separately Precautions for Correct Use If you need to delete event log in the CPU Unit from the Sysmac Studio or HMI make sure you do not need any of the event information before you delete the event log You may have over looked some important information and observation level Controller events or user defined events Always check for these before you delete an event log Clearing Event Logs with the Clear All Memory Operation When you perform the Clear All Memory operation for an NJ series CPU Unit from the Sysmac Stu dio you can select whether to clear the event logs i Exporting Event Logs You can use the Sysmac Studio or an NJ series compatible NS series PT to export the displayed event log to a CSV file 090811 A8000001 090811 A8000002 090810 A80080F 1 090808 A8 XXX CSV Time of occurrence Error level Source Event Attached information Sysmac Studio Event Log Viewer Time of occurrence Level Source Event 09 08 11 Information PLC Power ON P Information se e e ale ke Exporting P iformaton OP P formation 09 08 10 Error PLC Memory error Checksum 09 08 08 Information PLC Program change Task 9 48 NJ series CPU Unit Software User s Manual W501 9 CPU Unit Functions 9 6 3 Co
255. an set the stop method to the immediate stop input signal or limit Stop method input signal You can change the input variables for a motion control instruction dur ing execution and execute the instruction again to change the target values during operation Re execution of motion control instructions You can specify when to start execution and how to connect the veloc ili Multi ex ion of motion control i l UR PEER aR SE ema TO one ities between operations when another motion control instruction is Motion eh tl executed during operation sit es Continuous axes group motions You can specify the Transition Mode for multi execution of instructions Transition Mode for axes group operation Software limits Software limits are set for each axis The error between the command current value and the actual current Following error value is monitored for each axis Velocity You can set warning values for each axis and each axes group acceleration rate deceleration rate torque interpolation velocity interpolation acceleration rate and interpolation deceleration rate Monitoring functions You can use an OMRON G5 series Servomotor with an Absolute Absolute encoder support Encoder to eliminate the need to perform homing at startup The following Servo Drive input signals are used External interface signals Home signal home proximity signal positive limit signal negative limit signal immed
256. ank for each element Unions e Initial values cannot be specified Always zero Enumerations e Initial values can be specified Variables That Do Not Apply Initial Values For the following variables initial values are not applied when the power is turned ON and the val ues before the power interruption are retained e Variables with Retain attribute e Variables with AT specifications retained areas or DM Holding or EM Area specifications only P 00 S ped SE D gt O Cc D 02 Precautions for Correct Use If the CPU Unit has no Battery the above variables are also initialized i Constant If you specify the Constant attribute the value of the variable cannot be written by any instructions ST operators or CIP message communications Setting the Constant attribute will prevent any program from overwriting the variable The values of variables with a Constant attribute cannot be written from instructions after the initial value is set If there is an instruction in a POU that attempts to write a value to a variable with the Constant attribute an error will occur when the user program is compiled NJ series CPU Unit Software User s Manual W501 6 55 6 Programming Operation lf there is an instruction or operator in a POU that attempts to write a value to a variable with the Constant attribute the following operations will occur Source Operation for attempts to write the value An er
257. arameter to the instruction 1 The system defined data type for the instruction is registered in the Sysmac Studio in advance Select that system defined data type in the Sysmac Studio and add a user defined structure variable to the variable table 2 Use the user program or initial values to set the member values of that structure Specify the structure variable for the input parameter to the instruction sodA geq nyenu q 9 9 i Unions A union is a derivative data type that enables access to the same data with different data types You can specify different data types to access the data such as a BOOL array with 16 elements 16 BOOL vari ables ora WORD variable Expressing Unions and Union Members Specifying Members When you define a union you must name each data type that can be accessed These names are called members You can express individual members of a union by putting a period after the vari able name that represents the entire union followed by the member name that you want to access Example Define the data type as a union as shown for My Union in the following example Data Type Definition NJ series CPU Unit Software User s Manual W501 6 41 6 Programming Name Data type My Union WORD ARRAY 0 15 OF BOOL Variable Table Variable name Data type Output My Union Output bit 0 This notation specifies the Oth element or value at bit 00 of union Output when it is treated as a 16 bi
258. are fo Setting devices and hardware Software settings Programming Testing operation and debugging Using motion control Using EtherCAT Using EtherNet IP Use the relevant manuals for references according to any error that Troubleshooting and managing errors in an NJ series Controller Maintenance Using EtherCAT Using EtherNet IP Using CJ series Units E i ATE L T ii Nri NJ series User s Manuals NJ series Instructions NJ series CPU Unit Motion Control User s Manual NJ series CPU Unit Built in EtherCAT Port User s Manual NJ series Motion Control Instructions Reference Manual NJ series CPU Unit Built in EtherNet IP Port User s Manual NJ series Troubleshooting Manual CJ series Special Unit Operation Manuals for NJ series CPU Unit Reference Manual v v oO l gt NJ series CPU Unit Software User s Manual W501 Manual Configuration Manual Configuration NJ series CPU Unit Hardware User s Manual Cat No W500 I Nu series CPU Unit Hardware User s Manual Cat No W500 Section Section 1 Introduction Section 2 System Configuration Section 3 Configuration Units Section 4 Installation and Wiring Section 5 Troubleshooting Section 6 Inspection and Maintenance Appendices Description This section provides an introduction to the NJ series Controllers and their features and gives the NJ series Controller specifications This section des
259. arget Node Information is TRUE If the corresponding Normal Target Node Information is FALSE the Target Node Controller Operating Information indicates the previous operating status Array x is TRUE This is the operating state of the target Controller with a node address of x Array x is FALSE Other than the above Data type ARRAY 0 255 OF BOOL Range of values TRUE or FALSE Usage in user program Related instruc tions NJ series CPU Unit Software User s Manual W501 A 73 ri gt 2 D h O 9 e 5 o O 5 Q Q D U lt P mp D F Q D 5 D a S D o D o Asobeyeg ajnpoyy uopuny dlA2N1943 9 7 V dlg swen Appendices Variable name _EIP_TargetPLCErr 255 Meaning Target PLC Error Information Global local Global Function This variable shows the error status logical OR of fatal and non fatal errors of the target node Controllers that are connected with the built in EtherNet IP ports as the originator The array elements are valid only when the corresponding Normal Target Node Information is TRUE The immediately preceding value is retained if this variable is FALSE Array x is TRUE A fatal or non fatal error occurred in the target Controller with a target node ID of x Array x is FALSE Other than the above R W access R ss Retained Not retained Network Publish Published Usage in user program Related instruc tions Variable name _ElP_Targ
260. ariables Major classification Middle classification Minor classification Application 1 User defined variables These variables are used internally in the Controller 2 Semi user defined vari Device variables Device variables for CJ CJ series Basic I O Units ables series Units CJ series Special Units Device variables for Ether EtherCAT slaves CAT slaves These variables are used for Servo Drives encoder input slaves and internally in the Controller Cam data variables 3 System defined vari System defined variables ables for PLC Function Module System defined variables for motion control System defined variable for EtherNet IP System defined variables for EtherCAT master These variables are used internally in the Controller MC Common Variable These variables are used for Servo Drives encoder input slaves and internally Axes Group Variables in the Controller Axis Variables Built in EtherNet IP port Built in EtherCAT master port User defined Variables The user defines all of the attributes of a user defined variable Refer to 6 3 Variables for details on user defined variables Semi user defined Variables You use these variables to access specific devices and data You can change some of the attributes of these variables The semi user defined variables include the following two types of variables for devices and data Device Variables Device variables are used t
261. ariables that are related to errors in EtherCAT communications do not change until the cause of the error is removed and then the error in the Controller is reset with the troubleshooting functions of the Sys mac Studio or the ResetECError instruction Functional Classification EtherCAT Communications Status Variable name _EC_RegSlavTbl Meaning Registered Slave Table Global local Global Function This table indicates the slaves that are registered in the network configuration information Slaves are given in the table in the order of slave node addresses The element for a slave is TRUE if the corresponding slave is registered Data type Array 1 192 OF BOOL Range of values TRUE or FALSE Usage in user program Related instruc tions Variable name _EC_EntrySlavTbl Meaning Network Connected Slave Table Global local Global Function This table indicates which slaves are connected to the network Slaves are given in the table in the order of slave node addresses The element for a slave is TRUE if the corresponding slave has entered the network Data type Array 1 192 OF BOOL Range of values TRUE or FALSE Usage in user program Related instruc tions Variable name _EC_MBXSlavTbl Meaning Message Communications Enabled Slave Table Global local Global Function This table indicates the slaves that can perform message communications Slaves are given in the table in the order of slave node addresses The element for a
262. arks Name Supported Data Type Supported Supported An error occurs if the setting of the Retain attribute does not Retain agree with the attribute of the CJ series Unit memory where the address is assigned Initial Value Supported Set the initial value setting to None if you want to use the memory value as it is Constant Supported You cannot write to a constant with an instruction Network Publish Supported Edae Not supported You can specify the Edge attribute only for function block input g variables Entering and Displaying AT Specifications When you specify the AT Specification attribute input the following in the Allocated Address Box of the variable table in the Sysmac Studio The following is displayed in the Allocated Address Box of the variable table or the I O Map Type of variable Entries and displays in the AT Example field User defined variables with AT word_address D100 specifications to word addresses User defined variables with AT word_address bit_position WO0 00 specifications to bit addresses The following variables are also allocated an address internally The following is displayed in the Allocated Address Box Type of variable Displays in the AT field Example lOBus rack rack_number slot Basic I O Units slot_number I O_port_number lOBus rack 0 slot 1 Ch1_In Ch1 _In00 Special Units lOBus rack 0 slot 1 PeakHold Cmd ch1_PeakHoldCmd Device variables for EtherCAT
263. art F_TRIG_instance Clk start Q gt do F_TRIG_instance is an instance of the F_TRIG instruction e Method 2 F_TRIG_instance F_TRIG start Clk Q do e Method 3 Down start4 In do Instruction Change to TRUE Change to TRUE differentia There is no equivalent in ST You must create it tion start Inst in logic Example e Method 1 R_TRIG_instance Clk start Q gt do IF do TRUE THEN Inst END_IF e Method 2 IF start TRUE THEN IF pre_start FALSE THEN Inst END_IF END_IF pre start start Update previous value 6 100 NJ series CPU Unit Software User s Manual W501 6 Programming Item Ladder diagram ST including inline ST Instructions With the TON instruction multiple cycles are You must declare two instances one for that last required from the start of instruction execution execution and one to reset as shown below multiple to the end and the instruction is reset when the IF start TRUE THEN task periods power flow is FALSE Therefore you need to TON_instance In TRUE omitted declare only one instance to both execute the JI Start timer instruction and reset it ELSE TON_instance TON_instance In FALSE omitted Reset timer In END_IF Func Add a circle to indicate NOT at the intersection Add a NOT operator to the argument tion func of the BOOL argument and the function function You can add NOT operators to any BOOL tion block block variable not just argumen
264. arting actual operation you must test performance under all foreseeable conditions on the actual system and make sure that the task periods are not exceeded and that suitable communications performance is achieved Checking the Task Execution Time Always design your system so that the average and maximum task execution times that are esti mated with the methods that are described in this section sufficiently fit within the specified task peri ods Desktop Calculations First refer to A 2 Calculating Guidelines for Task Execution Times to make a rough estimate of the average task execution time on paper You cannot estimate the maximum value on paper Estimating with the Simulator on the Sysmac Studio Use the Task Execution Time Monitor of the Simulator on the Sysmac Studio to estimate the aver age and maximum task execution times Use the following procedure to check operation on the Sim ulator Create the Unit and slave configurations create the global variables and device variables and create the axes to create the Axis Variables Create the programs to check Set up the tasks and build the project Start the Simulator in Execution Time Estimation Mode QAGQNH N Set the Expanded number of I O points for CJU series Unit parameter in the Task Execution Time Monitor to create user defined variables for specified CJ series Special Units and set the sizes of the expansion areas e g fixed I O allocation areas for the Devic
265. ary current be changed to any position Single functions for position ares CEE Enabling The position of an axis is recorded when a trigger occurs conic external latches Disabling The current latch is disabled external latches Zone You can monitor the command position or actual position of an axis to monitoring see when it is within a specified range zone Monitoring You can monitor whether the difference between the command posi Motion control axis following tions or actual positions of two specified axes exceeds a threshold error value Resetting the The error between the command current position and actual current following error position is set to O The torque control function of the Servo Drive can be enabled or dis limi iai Torgus abled and the torque limits can be set to control the output torque functions Absolute Linear interpolation is performed to a specified absolute position linear interpolation Multi axes coordinated control Relative linear Linear interpolation is performed to a specified relative position interpolation Circular 2D Circular interpolation is performed for two axes interpolation Resetting axes Axes group errors and axis errors are cleared group errors Enabling axes Motion of an axes group is enabled groups Axes groups Disabling axes Motion of an axes group is disabled groups Auxiliary functions for multi axes coordinated control Stopping ax
266. ated result is TRUE and when the variable is FALSE evaluated result is FALSE e You can write any of the statements on multiple lines Separate statements with a semicolon e You can omit the ELSE statement If it is omitted and none of the conditions produces a match nothing is done Example A value of 10 is assigned to variable X when the statement A gt 0 is TRUE A value of 1 is assigned to variable X when the statement A gt O is FALSE and statement B 1 is TRUE A value of 2 is assigned to variable X when the statement A gt 0 is FALSE and statement B 2 is TRUE If none of the conditions is TRUE a value of 0 is assigned to the variable X IF A gt O THEN X 10 ELSIF B 1 THEN X 1 ELSIF B 2 THEN X 2 ELSE X 0 END_IF NJ series CPU Unit Software User s Manual W501 6 Programming CASE Overview This construct executes a statement that corresponds to an integer set value that matches the value of an integer expression Reserved Words CASE Construct Structure CASE lt integer_expression gt OF lt integer_expression_value_1 gt lt statement_1 gt lt integer_expression_value_2 gt lt statement_2 gt lt integer_expression_value_n gt lt statement_n gt ELSE lt statement_m gt END_CASE Process Flow Diagram p a u Oo D 3 3 5 re D c D Q D N e6benbue7 1x9 painionuis S 9 Statement m Statement n Statement 2 Statement 1
267. ation You can start an NJ series Controller with mounted Units without creating or transferring a Unit Configuration to the Controller but I O ports and device variables are not created automatically so you will not be able to access the Units from the programs 3 3 2 Creating the Unit Configuration You can use either of the following two methods to create the Unit Configuration Method 1 Creating the Unit Configuration Offline and Transferring It Create the Unit Configuration that is to be considered as correct with the Unit Editor of the Sysmac Studio After you create Unit Configuration with the Unit Editor you download it along with the user pro gram to the CPU Unit Sysmac Studio 1 Created offline Saaz LL LIS ZZZ LLZ LL LZZ LZ LIIL L ZZZ L GLAZI 2 Download NJ series CPU Unit Software User s Manual W501 3 7 N do O D 5 S D C 5 O e D a e UONONPO U E amp 3 I O Ports Slave Configuration and Unit Configuration Create the Unit configuration with the Unit Editor Use one of the following procedures to display the Unit Editor e Double click CPU Expansion Racks under Configurations and Setup in the Multiview Explorer e Or right click CPU Expansion Racks under Configurations and Setup and select Edit from the menu Ree Cues A Configurations and Setup becca new_NJ501_0 v E Communications Item name V
268. ation or Unit configuration information after you start program ming e To reuse programs from another project 1 Enter the programs 2 Create the slave configuration information or Unit configuration information 3 Select a variable that was created in a program from the list in the I O Map to assign it to an I O Pot Description ___BcPU expansion Racks V CPU Rack 0 Y CILW OD232 Transistor Output Unit Chi_Out Chi_Outodo Chi_Out01 Chi Out Chi_Out03 Chi_Out04 Variable R WiData Type Pw WORD RW BOOL RW BOOL RW BOOL RW BOOL Output CH1 Vutput CH1 bit 00 Opu aep 7 Output 1 bit 02 Output H1 bit 03 Output CH1 bit 04 Select a user defined variable that has already been registered in the global variable table EN Additional Information To remove the variable assigned to an I O port clear the Variable Column or right click the vari able and select Reset Assignment from the menu The device variable assignment is removed However removing the assignment does not delete the variable from the variable table where it is registered 3 16 NJ series CPU Unit Software User s Manual W501 3 I O Ports Slave Configuration and Unit Configuration 3 5 Creating the Axes and Assigning Them to the Servo Drives Encoder Input Slaves This section describes how to create axes in the NJ series Controller and how to assign the axes to the Servo Drives and encoder input slaves 3 5 1 Intro
269. ations from an external device Refer to information on the meanings of the error status bits at the end of this appendix for details _CJB_MstrErrSta I O Bus Master Gives the I O bus master error status 16 0000 to page A 56 Error Status 16 00F0 Note Do not use this variable in the user pro gram There may be a delay in updating it Use this variable only to access sta tus through communications from an r wo w lt m mp D 3 Q D h 5 D Q S z D z D o external device Refer to information on the meanings of the error status bits at the end of this appendix for details AsoBeyeg ejnpoyy uonouny Old E V _CJB_UnitErrSta I O Bus Unit Error Gives the error status of the I O Bus Unit 16 0000 to page A 56 Status l l 16 80F0 Note Do not use this variable in the user pro gram There may be a delay in updating it Use this variable only to access sta tus through communications from an external device Refer to information on the meanings of the error status bits at the end of this appendix for details gr swen _CJB_InRespTm Basic Input Unit Contains the response times of the Basic 0 to 320 page A 56 Input Response Input Units Times NJ series CPU Unit Software User s Manual W501 A 31 Appendices Functional Classification Auxiliary Area Bits for CJ series Units values Variable name _CJB_lOUnitInfo _CJB_CBUoolnitSta to _CJB_CBU15InitSta _CJB_SlOooInitSta to _CJ
270. ave _EC_PDSlavTbl Process Data This table indicates the slaves that are per ARRAY TRUE or page A 66 Communicating forming process data communications Slaves 1 192 FALSE Slave Table are given in the table in the order of slave OF BOOL node addresses The element for a slave is TRUE if process data of the corresponding slave is enabled operational for both slave inputs and out puts Note Use this variable to confirm that the data for the relevant slave is valid before controlling an EtherCAT slave Kiobeyed ainpow uojoun Je sey LV0104 S E V _EC_DisconnSlavTbl Disconnected Slaves are given in the table in the order of ARRAY TRUE or page A 66 Slave Table slave node addresses 1 192 FALSE The element for a slave is TRUE if the corre OF BOOL sponding slave was disconnected _EC_DisableSlavTbl Disabled Slave Slaves are given in the table in the order of ARRAY TRUE or page A 66 S Table slave node addresses 1 192 FALSE D The element for a slave is TRUE if the corre OF BOOL m sponding slave is disabled _EC_PDActive Process Data TRUE when process data communications BOOL TRUE or page A 66 Communications are performed with all slaves FALSE Status _EC_PktMonStop Packet TRUE when packet monitoring is stopped BOOL TRUE or page A 67 Monitoring FALSE Stopped _EC_LinkStatus Link Status TRUE if the communications controller link BOOL TRUE or page A 67 status is Link ON FALSE _EC_PktSaving Saving Packet
271. banks EO_00000 to E18_ 32767 cations for vari ables 1 Maximum per CPU Rack or Expansion Rack 10 Units Maximum number of connectable Units Entire Controller 40 Units Number of Expansion Racks 3 max figuration o capacity 2 560 points max plus EtherCAT slave I O capacity Motion control 1 6 Power Supply Unit for CPU Rack and NJ PLJ3001 Expansion Racks OMRON G5 series Servo Drives with Built in EtherCAT Controllable Servo Drives Communications Recommended unit version Version 2 1 or later OMRON GxX series GX EC0211 EC0241 EtherCAT Remote Controllable encoder input terminals I O Terminals Recommended unit version Version 1 1 or later Control method Control commands using EtherCAT communications Position control Cyclic Synchronous Position Control Mode Control modes Velocity control Cyclic Synchronous Velocity Control Mode Torque control Cyclic Synchronous Torque Control Mode trolled axes Number of single axis control 16 axes max 32 axes max 64 axes max controlled 4 axes max per axes Linear interpolation control P axes group Circular interpolation control 2 axes per axes group Number of axes groups 32 axes groups max i 65 535 points max per cam table Number of cam data points Cams 1 048 560 points max for all cam tables Number of cam tables 640 tables max NJ series CPU Unit Software User s Manual W501 1 Introduction Item NJ501 1300 NJ501 1400 NJ5
272. below New Project o I Configurations and Setup gt op EtherCAT gt CPU Expansion Racks 1 0 Map To change the name right click the Controller icon and select Rename 2 When you first connect to the CPU Unit online the Sysmac Studio prompts you to store the CPU Unit name in the CPU Unit 3 After that when you connect to the CPU Unit online the Sysmac Studio refers to the CPU Unit name in the project and the CPU Unit name of the CPU Unit you connect to A warning dialog box is shown if they do not match and you are asked whether to continue to connect EN Additional Information You can name EtherNet IP ports in the Network Configurator i Serial IDs Optional Function When the Sysmac Studio first connects online you can obtain the serial ID from the CPU Units produc tion information and store it in the project After that when the Sysmac Studio connects online both the CPU Unit name and the serial ID are compared This enables stricter verification of the CPU Unit Sysmac Studio es e CPU Unit name A e Serial ID S A gl SZ ZI SSS LZ SL LLL ZW LITTLE LPP 1 When you connect online the serial ID is obtained from the CPU Unit CPU Unit 2 Acheck is performed to see if the CPU Unit name and serial ID match for online connections 9 20 NJ series CPU Unit Software User s Manual W501 9 CPU Unit Functions The following dialog box is displayed on the Sysmac Studio when
273. ber of banks is given in hexadecimal A 84 NJ series CPU Unit Software User s Manual W501 Appendices A 7 Variable Memory Allocation Methods You must be aware of variable memory allocation methods when you need to match the memory loca tions of structure variable members with the memory locations in other devices When you use struc ture variables to perform communications with other devices you must align the data allocations e When you access variables through CIP messages or EtherNet IP tag data links between an NJ series CPU Unit and another CPU Unit e When you need to exchange structure variable data with ID Tags or any device other than the CPU Unit A 7 1 Variable Memory Allocation Rules Variables are stored at locations in memory that are multiples of the alignment values shown in the fol lowing table Data type Size Alignment BOOL 2 bytes BYTE USINT or SINT 1 byte WORD UINT or INT 2 bytes DWORD UDINT or DINT 4 bytes LWORD ULINT or LINT 8 bytes REAL data 4 bytes LREAL data 8 bytes TIME DATE TIME_OF_DAY DATE_AND_ TIME 8 bytes STRINGIN N 1 x8 1 byte bits Enumeration 4 bytes Basic Data Types Variables with One Byte Alignments e g BYTE These variables are stored in memory with a one byte alignment Example Memory i Variable Tabe OO Bytes Name Datatype a eye o Be Jeye o Variable A bits 0 through 7 R T E Variable B bits 8 through 15 PS See RL alignment
274. ble third party certification documents identifying ratings and limitations of use that apply to the products This information by itself is not sufficient for a complete determination of the suitability of the products in combination with the end product machine system or other application or use The following are some examples of applications for which particular attention must be given This is not intended to be an exhaustive list of all possible uses of the products nor is it intended to imply that the uses listed may be suitable for the products e Outdoor use uses involving potential chemical contamination or electrical interference or conditions or uses not described in this manual e Nuclear energy control systems combustion systems railroad systems aviation systems medical equipment amusement machines vehicles safety equipment and installations subject to separate industry or government regulations e Systems machines and equipment that could present a risk to life or property Please know and observe all prohibitions of use applicable to the products NEVER USE THE PRODUCTS FOR AN APPLICATION INVOLVING SERIOUS RISK TO LIFE OR PROPERTY WITHOUT ENSURING THAT THE SYSTEM AS A WHOLE HAS BEEN DESIGNED TO ADDRESS THE RISKS AND THAT THE OMRON PRODUCTS ARE PROPERLY RATED AND INSTALLED FOR THE INTENDED USE WITHIN THE OVERALL EQUIPMENT OR SYSTEM PROGRAMMABLE PRODUCTS OMRON shall not be responsible for the user s progra
275. c 5 20 5 2 12 Monitoring Task Execution Status and Task Execution Times 5 23 5 3 Task Design Example and I O Response Times 5 26 5 3 1 Checking the Task Execution Time 0 000 cece eee 5 26 5 3 2 Checking the System Service Monitoring Settings 5 27 5 3 3 Examples of Task Design si s 444 ie eSwe esi Seee e ea Bede ei ss 5 28 5 3 4 System Input and Output Response Times 0 00000 c eee 5 29 NJ series CPU Unit Software User s Manual W501 5 1 5 Designing Tasks 5 1 Overview of Task Designing Procedure This section provides an overview of the task designing procedure The shaded steps in the overall procedure that is shown below are related to the task designing proce dure Step 1 Software Design Step 1 1 I O Processing Design Step 1 2 Designing Tasks Step 1 3 Designing Programs Step 2 Software Setups and Programming Step 3 Mounting and Setting Hardware Step 4 Wiring Step 5 Confirming Operation and Starting Actual System Operation Refer to 1 3 Overall Operating Procedure for the NJ series Controller for details 5 2 NJ series CPU Unit Software User s Manual W501 5 Designing Tasks Designing the Tasks Reference Design the task configuration 5 2 3 Basic l Operation of Design the task configuration based on the I O response performance that Pee is required by the controlled devices 5 3 Task Design Exam ple and I O
276. cTask0 Variable to be rei Data Type Variable CommerPrimaryTask Accessing Task PeriodicTask1 Accessing Task Periodic v fa PeriodicTask1 Variable to be rei Data Type Variable CommerPrimaryTask Accessing Task PeriodicTask0 Accessing Task Periodic Y ra PeriodicTask2 Variable to be rej Data Type Variable CommerPrimaryTask Accessing Task PeriodicTask0 Accessing Task Periodic Update tim Changes in Each Task Variables to Sets the variables to refresh in the When down Not allowed be refreshed primary periodic task or periodic loaded to task CPU Unit Data Type Sets the data type of variable Variable Com Sets a comment for the variable ment Accessing Sets the tasks that access the vari Task able CS CJ NSJCJ2 Series Instructions Reference Manual W474 4 7 4 Controller Setup 4 8 Task Execution Status Monitor The Task Execution Status Monitor displays the execution status of the programs lt i A Configurations and Setup new_NJ501_0 Vv gt 3 EtherCAT gt gt CPU Expansion Racks amp I O Map gt T3 Controller Setup gt 14 Motion Control Setup amp Cam Data Settings gt Event Settings E Task Settings Data Trace Settings Task Program Name Execution Status V fe PrimaryTask A ProgramO f PeriodicTaskO f PeriodicTask1 fa PeriodicTask2 Task Execution Time Monitor The Task Execution Time Monitor displays the execution times of the tasks ied A Configurati
277. cedure Operations can be performed from the following panes e Program panes ladder diagrams e I O Map e Watch Tab Page Procedure in the Ladder Diagram Editor 1 Select Monitor from the Controller Menu The monitor turns ON 2 Double click the ladder program ladder function or ladder function block under Programming in the Multiview Explorer The rungs are displayed on the Ladder Editor in monitor status 3 Select the variable input or output to change and do one of the following e Controlling BOOL Variables SET RESET Right click and select SET RESET SET or SET RESET RESET Procedure in the Watch Pane 1 Select Watch Tab Page from the View Menu to display a Watch Tab Page The rungs are dis played on the Ladder Editor in monitor status 2 Select the variable input or output in the Watch Tab Page and do one of the following e Controlling BOOL Variables SET RESET Select TRUE or FALSE in the Modify Column e Changing Other Variables Click the cell in the Modify Column on the Watch Tab Page enter a value that is compatible with the variable type given in the Data Format Column and then press Enter Key The format for entering a value in the Modify Column depends on the data type that is given in the Data Format Column EN Additional Information If the status of a BOOL variable that is used in a ladder diagram is changed the execution status in the Ladder Editor changes accordingly a g D o re
278. cessing 2 for the task that is set as the refreshing task and not as a system service Service for CJ series Special e Event servicing for CJ series Special Units Units e Execution of communications instructions CIP ik bd ie gJ Q o O O O sab O O gt D ep x lt i Note The CPU Unit exchanges data between CJ series Special Units and their allocated memory words during I O refreshing SD Memory Card service e Access from FTP client e SD Memory Card operations from the Sysmac Studio e Execution of SD Memory Card instructions Self diagnosis e Hardware error detection System services are executed during the unused time between executions of all of the tasks as shown below Primary period Execution priority a faa High Primary eoo eoc eoo eoo eoo periodic task Task a a Priority 16 Task period Priority 17 fo po Low periodic task System services NJ series CPU Unit Software User s Manual W501 5 11 System services are executed during the unused time between executions of the tasks 5 Designing Tasks System Service Monitoring Settings You can use the Basic Settings in the Operation Settings of the Sysmac Studio to set the execution time interval and execution time percentage of monitoring for system services Access Setting a Set Update cnanges point group Bescription values timing NRR mode Operation System Sys
279. ck I O wiring If an error occurs while the CPU Unit is in ready state the CPU Unit will change to error state Depend ing on the error that occurs all or part of CPU Unit operation will stop When the error is reset the CPU Unit returns to the ready state Controller error Item Major fault level Partial fault level Minor fault level Definition Serious errors that prevent Errors that prevent the Errors that prevent a por all system controls operation of a function tion of function module module other than the control PLC Function Module User program execution in Stopped Continued Continued CPU Unit Operation of the function module where the error occurred is stopped Motion Control Function Module EtherCAT Master Function Module or Eth erNet IP Function Mod ule Resetting error Not possible Possible Refer to Section 8 CPU Unit Status Section 12 Troubleshooting and the NJ series Troubleshooting Manual Cat No W503 for details on the CPU Unit states NJ series CPU Unit Software User s Manual W501 2 17 2 CPU Unit Operation 2 5 CPU Unit Data and Data Retention 2 5 1 CPU Unit Data The data in the CPU Unit are listed below The user program contains all of the programs that are assigned to Always User Program tasks retained These are the definitions of the programs functions and function POUs program orga blocks Each algorithm is written as a ladder diagram or in structured
280. cle the power supply or reset the Controller Log category System The timeout detection time setting is Increase the timeout detection time Design the tasks considering the cor too short rections that are given on the left The task period setting is too short Increase the task period A user program is too large The number of times that processing is repeated is larger than expected The priority of the periodic task is incorrect Separate the processes into different tasks for example move processes that need a short execution period to a periodic task with a lower priority If there is a program with an extremely high number of repetitions correct the program to achieve the correct number of repetitions Set a trap in the user program that monitors the number of times a process is exe cuted to check the number of repeti tions Increase the priority of the periodic task Attached Information 1 Name of task where error occurred None NJ series CPU Unit Software User s Manual W501 Event name Meaning Source Error attributes Effects System defined variables Cause and correction Attached information Precautions Remarks Event name Meaning Source Error attributes Effects System defined variables Cause and correction Attached information Precautions Remarks NJ series CPU Unit Software User s Manual W501 12 Troubleshooting I O Refreshing
281. code BYTE 16 00 i Converting Data Types When you use a variable of a different data type the data type is automatically converted in some cases You can also perform the conversion yourself with a data type conversion instruction sed eyeq S 9 Data Type Conversion All variables must have data types Programs must operate properly according to these data types For example the left and right sides of an assignment expression should normally use the same data type In some cases however it may be necessary to assign data of a different data type to a variable in order to program something successfully Example var3 vari ___ ____ _ __ Assigning a value to a variable of a different data type var is a variable of data type INT var3 is a variable of data type REAL In order to assign the data in var7 to the data type of var3 the data must first be converted This type of conversion is called data type conversion or just type conversion for short When Data Type Conversion Occurs Converting between data types occurs in the following two cases 1 Conversion by User Execution of Data Type Conversion Instructions 2 Automatic Conversion for Assignments and Instructions e ST assignments e Connecting lines in ladder diagrams NJ series CPU Unit Software User s Manual W501 6 37 6 Programming 6 3 6 Derivative Data Types 6 38 A derivative data type has a configuration that i
282. communications processing for EtherNet IP tag data links and refreshing tasks are set for the tags i e variables with a Network Publish attribute variable access processing is performed as part of system common processing 2 When there are motion control instructions in user program execution in the primary periodic task the CPU Unit executes the results from those instructions immediately afterward in motion control processing The CPU Unit outputs the results to the Servo Drives during I O refreshing in the next primary periodic task Task period Primary period fixed SC e a I O refreshing Control processing I O refreshing User a2 s P lese gt sf gp hoe gt o BPIDEG program E OG 5S WY YM S n no 0 n g Refreshing 5 8 BEB execution e3 ag Pisteenid D 59 2g ogs iS 59 a8 S i i S E When the CPU Unit executes a motion is control instruction it executes the result of During output data processing in the next primary that instruction in motion control processing period the CPU Unit sends the results of motion immediately afterward control processing to the Servo Drive via EtherCAT When there is a motion control instruction in user program execution in the periodic task the CPU Unit executes the result from that instruction in the motion control processing MC of the next pri mary periodic task For details refer to 5 3 4 System Input and Output Response Times NJ series CPU Unit S
283. connect to an HMI Refer to the CJU series Serial Commu nications Units Operation Manual for NJ series CPU Unit Cat No W494 for details High speed Serial Communications Unit Device with serial communications RS 232C or RS 422A 485 NJ series CPU Unit Software User s Manual W501 10 11 10 Communications Setup 10 12 NJ series CPU Unit Software User s Manual W501 17 Example of Actual Application Procedures Ea This section describes the procedures that are used to actually operate an NJ series Controller 11 1 Example Application 0 00 ccc ees 11 2 fikt System Configuration 000 12 2 css ee wee doe oe oe oes Os ee 11 2 lls ORGAO 2 s 2 c 0c e256 eee he Sa ee da oe eee s DE a eee aed sae Re 11 3 11 2 Overview of the Example Procedure 000 ce eee eens 11 4 Meet Veng and SeMS 22 wc ir oun eran Eee Coe eta he ead 11 4 11 2 2 Software Design ce ee ees 11 4 11 2 3 Software Settings from the Sysmac Studio 00000 c eee 11 5 11 2 4 Programming with the Sysmac Studio 0 00 00 cee ee 11 8 11 2 5 Simulation with the Sysmac Studio 0 00 ee 11 9 11 2 6 Checking Operation and Actual Operation 0 000 eee 11 10 NJ series CPU Unit Software User s Manual W501 11 1 11 Example of Actual Application Procedures 11 1 Example Application This section describes an example application for an NJ series Contr
284. cord of the user program execution IDs set in the user program and in the CPU Unit They are not dis played ol tn N Oo ea D o gt oO Oo 5 eo A user program execution ID is setin If user program execution ID is not set the CPU Unit but not in the user pro in the user program clear the user gram program execution ID set in the CPU x Unit by clearing all memory in the CPU Unit A Attached None u information 2 w Precautions None D Remarks S scl n Event name Illegal User Program 10240000 hex Meaning The user program is not correct Source PLC Function Module Source details None Detection At download timing power ON or Controller reset Error attributes Level Major fault Recovery Cycle the power Log category System supply or reset the Controller Effects All outputs are stopped oeaan There are more than 8 nesting levels Find the location in the user program Write the user program so that there for functions or function blocks with more than 8 nesting levels for is never more than 8 nesting levels for functions or function blocks and functions or function blocks Use the reduce the number of nesting levels to program check on the Sysmac Studio 8 or fewer Then download the user to confirm that there are not more program again than 8 nesting levels Attached None information Precautions None Remarks NJ series CPU Unit Software User s Manual W501 12 23
285. cradactt deects lasses bateridnetaluoteataetsccend 3 7 3 3 2 Creating the Unit Configuration sasscawes lt ceacenaciacdawnieeapuunetdcestadadiuteroten tessa bute te uaneieates Suances 3 7 3 3 3 Verifying the Unit CONfiQuration ccccccsscccccssseececeesececeeaseeesceeaeeeeseuaeeeeseauseeeessuseeesseaseeeseseas 3 10 VO Ports and Device Variables ssissisiisssiussn a a a aa aa 3 11 3 4 1 VO Ports and Device Variables cosine a ia E a aat e 3 11 3 4 2 Registering Device Variables 0000nnn000nnnnonneneeennneernetrernnnrernnnrernnnrernnnnernnn terran terne nerenn neern nenene 3 15 Creating the Axes and Assigning Them to the Servo Drives Encoder Input Slaves 3 17 3 5 1 HATFOCUICTI OM Sassi acter cee lnek eles EEO et 3 17 3 5 2 Axis Variables and Axes Group Variables cccccsseceeeceeeeeeeeceeeeeeesecseeeesaeaseeeesaueeeesseaaeeeeeeas 3 18 3 5 3 Creating and Using Axes and Axis Variables ccccccccsseeeeeeeeeeeeeeseeeeeeeeeeaeeeeeaaeeeeessaaeeeesens 3 19 Controller Setup Overview of the Controller Setup ssssccsssssseccssnseesssnssseeeeenseeecsoseeseoenssessoonssesesensseseneass 4 2 Initial Settings for the PLC Function Module cccssscessssseseseneeseeseeeeenseeeaseeseeneeseeeneeeees 4 4 4 2 1 NFO QUICTI OM 26aetectatae ascntednatasoateauecastedannincesat baeatecaicetesanmecceseancadeen cea acaneeesacaaeec anassetecsteecasegenaueced 4 4 4 2 2 70 gh 19 gives 0 o aea ee er oe ek
286. cribes the system configuration used for NJ series Controllers This section describes the parts and functions of the configuration devices in the NJ series Controller configuration including the CPU Unit and Configuration Units This section describes where and how to install the CPU Unit and Configuration Units and how to wire them This section describes the event codes error confirmation methods and corrections for errors that can occur This section describes the contents of periodic inspections the service life of the Bat tery and Power Supply Units and replacement methods for the Battery and Power Supply Units The appendices provide the specifications of the Basic I O Units Unit dimensions load short circuit protection detection line disconnection detection and measures for EMC Directives NJ series CPU Unit Software User s Manual Cat No W501 This Manual Section Section 1 Introduction Section 2 CPU Unit Operation Section 3 I O Ports Slave Configuration and Unit Configuration Section 4 Controller Setup Section 5 Designing Tasks Section 6 Programming Section 7 Simulation Transferring Projects to the Physical CPU Unit and Opera tion Section 8 CPU Unit Status Section 9 CPU Unit Functions Section 10 Communications Setup Section 11 Example of Actual Application Pro cedures Section 12 Troubleshooting Appendices NJ series CPU Unit Software User s Manual W501
287. ct control operations but appear in the event log to notify the user of specific information An error for which all of the control operations for one of the function modules in the NJ series Controller stop An NJ series CPU Unit continues operation even after a partial fault level Controller error An abbreviation for process data communications Data is exchanged between the master and slaves on a process data communications cycle The process data communications cycle is the same as the task period of the primary periodic task A tasks for which user program execution and I O refreshing are performed each period One of the function modules This function module executes the user program sends commands to the Motion Control Function Module and provides an interface to the USB and SD Memory Card An acronym for program organization unit A POU is a unit in a program execution model that is defined in IEC 61131 3 A POU contains an algorithm and a local variable table and forms the basic unit used to build a user program There are three types of POUs programs functions and function blocks The task with the highest priority One type of EtherCAT communications in which process data objects PDOs are used to exchange information cyclically and in realtime Process data communica tions are also called PDO communications Along with functions and function blocks one of the three types of POUs Programs are assigned to tasks to e
288. ctions e File operations from the Sysmac Studio However exclusive control is required when you access the same file on the SD Memory Card from dif ferent sources This is to prevent reading or writing a file while it is being written or writing a file while it is being read Exclusive Control of Access to a File on the SD Memory Card The CPU Unit automatically performs exclusive control only for the following combinations of instruc tions peg Aowa GS 2U 0 SSAD0VV JO 01 UOD OAISN IOXA 6 E 6 NJ series CPU Unit Software User s Manual W501 9 15 9 CPU Unit Functions 9 16 For the other combinations shown below perform exclusive control by using file operation instruc tions Change File Name Copy File etc or communications commands Access already FTP underway Exclusive control is performed auto matically and an error occurs for the instruction that is executed later Exclusive con Perform exclu trol is not sive control required Read Instructions Perform exclu sive control s Exclusive con Perform exclu Exclusive con Communica Read trol is not sive control trol is not tions com required required mands Perform exclusive control NJ series CPU Unit Software User s Manual W501 9 CPU Unit Functions 9 4 Security This section describes security functions The NJ series Controller provides the following security functions e Verification of operation au
289. cutions of all of the tasks p N D m 2 V lt m D 3 Primary Periodic Task Only syse JO uoneiado aISeg Z S Execution priority Primary period Primary period High Primary periodic task t l A double line means that all processing for i i that task has been System completed services ee _ m o o o i i X Low A dotted line represents a transition to another task IO Indicates I O refreshing data outputs and then data inputs UPG User program execution MC Indicates motion control SS Indicates system services NJ series CPU Unit Software User s Manual W501 5 7 5 Designing Tasks Primary Periodic Task Priority 16 Periodic Task and Priority 17 Periodic Task Execution priority Primary period High Primary periodic task Priority 16 periodic task Priority 17 periodic task System services Note The execution order of tasks does not depend on the above execution priority order alone For details refer to Task Execution Order below i Task Execution Order The execution order of tasks does not depend only on the execution priority order A task with a lower execution priority is sometimes executed even during execution of a task with a higher execution prior ity The execution order of tasks depends only on the following points e The primary periodic task is never interrupted to execute any other task e When the execution
290. cveshicoccecsonceetessacasetecancoasweeevesadestessccesasces 11 2 idat System Contgural n scree le ee ee ee 11 2 tede Operon eese a e a a a 11 3 11 2 Overview of the Example Procedure cccssecceseeceeeecenseceneesenseeenseecnseeseneeeensesenseneneeseas 11 4 11 2 1 Wiring and Settings cc eecccccseeececeeesseeeceueeceeceeaeeeeceuaseeeceeaeeeeseaaeeeeseeaseeesseegeeesseseeeesssnaeees 11 4 lie Sowas Desig oesie a basta ice tenelican tas Bac asa tena eaten uies Sat Gana laatauaalants 11 4 11 2 3 Software Settings from the Sysmac Studio cc cceceeceeeeeee eee e eee eeeeeeeeesaaeaeeeeeeeesaaaaneeeseeeaaaeees 11 5 11 2 4 Programming with the Sysmac StuCiO cccccccccsssseceeeeeeeeeeceeeeeeeeeeeeeeecsageeeessaneeeesseseeessaaaeees 11 8 11 2 5 Simulation with the SySMAC StuCiO cccccceeeececeeseeeeeeeeeeeeeeecseeeeeeeeeeeeseseeeeaseueeeessuseeeesaaeees 11 9 11 2 6 Checking Operation and Actual Operation cccccsseeeceecseeeeeeceneeeeeeceaeeeeeessaeeeessueeeeeesaaaees 11 10 Section 12 Troubleshooting 21 ODErallOni aner AM BRON sina E SEEE 12 2 12 1 1 Overview of NU SerieS Status cccccccccccccessseecceeseeeceeeeseececeaseeeceaeeeeeecsaeeessseeeeesseeeeesssseeees 12 2 tsis FAALEN S inthe GRU Uni xs sx cenk 5 ca states Soon cist E E 12 3 I2 i 3 JNon tatalberror In CPU UNIT eeina aaea voter sue aa eae SG isin LAL 12 4 12 2 STFOUDICSINOOUIAG ceisir aa a aik 12 11 12 2 1 C
291. d Or DNS is enabled and the connection was successful Data type BOOL Range of values TRUE or FALSE Usage in user program Related instruc tions Functional Classification EtherNet IP Communications Status Variable name _EIP_EtnOnlineSta Function TRUE The built in EtherNet IP port s communications can be used The link is ON and IP address is defined Also there are no errors FALSE The built in EtherNet IP port s communications is disabled due to an error in initial processing or restart processing Data type BOOL Range of values TRUE or FALSE Usage in user program Related instruc tions A 72 NJ series CPU Unit Software User s Manual W501 Appendices Variable name _EIP_TDLinkRunSta Meaning Tag Data Link Communications Status Global local Global Function TRUE At least one connection is in normal operation FALSE Other than the above Data type BOOL Range of values TRUE or FALSE Usage in user program Related instruc tions Variable name _EIP_TDLinkAllRunSta Meaning All Tag Data Link Communications Status Global local Global Function TRUE Tag data links are communicating in all connections as the originator FALSE An error occurred in at least one connection Data type BOOL Range of values TRUE or FALSE R W access R sd Retained Not retained Network Publish Published Usage in user program Related instruc tions Variable name _EIP_RegTargetSta 255 Meanin
292. d virtual servo axes read the motion control processing time from the following graph 600 500 400 T N O O gt Q Q Q o 5 _ e D x m Xx c oO 3 300 Execution time us 200 0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 Total number of instructions j Common Processing Time The total time for system overhead system common processing 1 and system common processing 2 is as follows The common processing time depends on the type of task Type of task Common processing time Primary periodic task Always 265 us Periodic task 10 us SOU uono xg yse eHesery y Buenen L gz Y NJ series CPU Unit Software User s Manual W501 A 23 Appendices A 2 2 Example of Calculating the Average Task Execution Time and Setting the Task Period i Calculating the Average Task Execution Time First we find the average task execution time for the following conditions The task is the primary peri odic task Item Conditions Slaves Units that are EtherCAT slaves e GX ID1611 Input Slave 1 used e GX OD1611 Output Slave 1 e R88D _IL Servomotors 4 CJ series Units on CPU e CJ1W ID211 DC Input Unit 1 Rack e CJ1W OD211 Transistor Output Unit 1 e CJ1W AD042 Analog Input Unit 1 e CJ1W DA021 Analog Output Unit 1 e CJ1W SCU42 Serial Communications Unit 1 Protocol macros are not used User program Ladder diagrams Standard instruct
293. day A data type that represents a date and time year month day hour minutes Date and time seconds and milliseconds Text string A data type that contains a value that represents a text string There are a total of twenty different basic data types The specifications are given in the following table The meanings of the data size and alignment columns in the following table are as follows e Data size The actual size of the value e Alignment The unit used to allocate memory Boolean BOOL 1 BOOL 0 TRUE or FALSE Bit strings EE sone bits 4 bytes DWORD 16 00000000 to BYTE 16 5A FFFFFFFF You can also use the _ character as a sepa tworp _ 4 bits 8 bytes LWORD 16 000000000000000_ rator 0 to FFFFFFFFFFFFFFFF SINT 128 to 127 100 INT 32768 to 32767 INT 2 00000000_01100100 DINT 1 bits 4 bytes neen 2147483648 to INT 8 144 2147483647 INT 10 100 ne 64 bits 8 bytes LINT 9223372036854775808 to INT 16 64 Integers 9223372036854775807 _100 USINT USINT O to 255 UINT UINT O to 65535 UDINT UDINT O to 4294967295 ULINT 64 bits 8 bytes ULINT O0 to 18446744073709551615 NJ series CPU Unit Software User s Manual W501 6 31 p amp S Z D ea D N sed eyeq sS S 9 6 Programming Classification Data type Data size Alignment Range of values Notation 32 bits 4 bytes REAL 3 402823e 38 to REAL 3 14 1 175494e 38 LREAL 3 14 REAL 0 3 14 1 175494e 38 to 3 402823e 38 344
294. decrease the value shorter input pulses are received but the pulses must be longer than the task period CS CJ NSJCJ2 Series Instructions Reference Manual W474 Changes in RUN mode No filter Not allowed 0 5 ms 1 ms 2 ms 4 ms 8 ms 16 ms or 32 ms When power is turned ON or the CPU Unit is reset 4 Controller Setup 4 3 Initial Settings for Special Units This section describes the initial settings that are required for the Special Units You can use any of the following methods to set the initial settings of the Special Units i Method 1 Setting from the Unit Setting Pane of the Sysmac Studio 1 Select the Unit in the Unit Configuration and Setup 2 Specify the settings in the Unit Settings Tab Page shown below z sysmac Studio EJ File Edit View Insert Project Controller Simulation Tools Help D OO 5 D w gt Q h e wn O A Cc gt p See eee hth and Setup new_NJ501_0 v Hi 1 Unit 1 CJ1W DRM21 x vw Configurations and Setup f Parameter group to show All parameters Parameter name Parameter value Scan List Enabled Switch Scan List Clear Switch Remote I O Communications Start Switch Remote I O Communications Stop Switch Master Enabled Switch gt t Motion Control Setup Master Disabled Switch amp Cam Data Settings Master Fixed Allocation Setting 1 Switch gt Event Settings Master Fixed Allocation Setting 2 Switch i Task S
295. defined variable as an interlock condition in the user program Refer to the NJ series CPU Unit Built in EtherCAT Port User s Manual Cat No W505 for details The slave outputs behave according to the slave settings Refer to the manuals for the slaves for details When an EtherCAT slave is disconnected communications will stop and control of the outputs will be lost not only for the disconnected slave but for all slaves connected after it Confirm that the system will not be adversely affected before you disconnect a slave lf you disconnect the cable from an EtherCAT slave to disconnect it from the network any current communications frames may be lost If frames are lost slave I O data is not communicated and the intended operation is sometimes not achieved Perform the following processing for a slave that needs to be replaced Program the _EC_I nDatalInvalid Input Data Disable system defined variable as an interlock con dition Set the Impermissible Number of Continuous Timeouts setting in the EtherCAT master to at least 2 Refer to the NJ series CPU Unit Built in EtherCAT Port User s Manual Cat No W505 for details f Motion Control Confirm the axis number carefully before you perform an MC Test Run The motor is stopped if communications are interrupted between the Sysmac Studio and the CPU Unit during an MC Test Run Connect the communications cable between the computer and CPU Unit securely and confirm that the system will
296. dically executed tasks i Period Period Periodic tasks Periodically Executed Tasks Periodically executed tasks are broadly classified into the following two types based on execution priority e Primary periodic task This task has the highest execution priority It is always executed in the specified period There can only be one primary periodic task The EtherCAT process data communications cycle and motion control period are also executed in the same period e Periodic tasks These tasks have a lower execution priority than the primary periodic task Peri odic tasks are executed during the unused time between executions of the primary periodic task Periodic tasks are executed on periods that are multiples of the primary periodic task period Refer to 5 2 3 Basic Operation of Tasks for details on tasks NJ series CPU Unit Software User s Manual W501 2 3 2 CPU Unit Operation i Overview of Task Processing The following processing is performed with tasks This example shows processing for the primary peri odic task Period Period e System common processing I O System refreshing Common processing 4 Requests for processing of motion control instructions N j Motion control F instructions 7 j 4 I O Refreshing Data I O is performed for CJ series Basic I O Units CJ series Special Units and EtherCAT slaves e You can refr
297. ding to changes in CPU Unit status All forced refreshing is cleared when a fatal error occurs when a Clear All Memory operation is performed when the operating mode is changed when power is interrupted or when the project is downloaded 9 28 Inputs The I O port and device variable change to the status that is specified with forced refreshing regard less of the status of the external input Sysmac Studio Sa SLIT L LLL ZII IIIZ PTT LLLP PL LLLP ALLA LZ TPL LEELA LT 1 I O port changed to TRUE with forced refreshing CPU Unit paar ik I O port FALSE 2 I O port and device variable change to TRUE NJ series CPU Unit Software User s Manual W501 9 CPU Unit Functions Outputs The I O port and the output to the external device change to the status that is specified with forced refreshing In the user program the status of the device variable that is assigned to the I O port will not necessarily be the status that was specified with forced refreshing It will change with the results of user program execution Sysmac Studio L SILLI LZ ZZ L IIIZ LL LLL IILI LZ FILLS CPU Unit SS See a ee es I O port 1 Output changed to TRUE with forced refreshing TRUE 2 The I O port and the output to the external device change to TRUE The device variable changes with the result of user program execution Applicable Areas You can execute forced refreshing f
298. duction OAJ9S dy 0 Way Hulubissy pue sexy oy Huljyeai9 s e SOARIS INdU JOpOIUZ S9ALIG When you use the Motion Control Function Module for operation with EtherCAT Servo Drive or encoder input slaves create axes in the Sysmac Studio and define them as EtherCAT servo axes or encoder axes At a result Axis Variables are automatically created as system defined variables Controlled by the Motion Control Function Module Axis B Functional units within the Motion Control Function Module Created Created y Axis variable B Assigned Assigned EtherCAT slave P ch l 3 O Q O O EtherCAT master EtherCAT Servo Drive encoder Servo Drive encoder input slave input slave You can specify an Axis Variable in a motion control instruction in the user program to easily access and perform operations with Servo Drives and encoder input slaves NJ series CPU Unit Software User s Manual W501 3 17 3 I O Ports Slave Configuration and Unit Configuration 3 5 2 Axis Variables and Axes Group Variables The following table lists the types of Axis Variables and Axes Group Variables Type of variable Application Creation method Axis Variables System defined axis An Axis Variable is The EtherCAT slave Provided by the sys variables used to control a sin Servo Drive or tem gle axis encoder input slave that is assigned to You must create a
299. e You can specify a prefix to automatically add to the File name prefix ee beginning of the file names You can specify the operation to perform when the stor Operation when limitis age time period or size limit is reached For example reached stopping tracing or deleting the oldest file and continu ing P a g D o re Q 5 Dupes eed S 6 Data items per file NJ series CPU Unit Software User s Manual W501 9 37 9 CPU Unit Functions Item Description You can display a graph where the X axis represents time and the Y axis represents the value of the variable You can display both BOOL variables and other variables on the same graph Graph display You can display the maximum value minimum value Table display average value and value at the specified time for each variable in a table Displaying trace results You can position a virtual composition model in 3D space and display the composition motion based on the com mand positions and actual positions of the motion axes 3D Motion Trace Dis play Mode You can save the trace results and all settings other than Exporting trace data Exporting to CSV files the trace number to a CSV file You can read the saved CSV format trace results and pordhe GIES cei display it on top of the current graph You can save the trace results in the project along with Saving the trace settings You can print graphs The Sysmac Studio
300. e FixPointData1 FixPointPos1 FixPointData2 FixPointPos2 Done RealData1 RealData2 ChangeFixToFloat ConvData32ToDouble Done Execute OK o Data32_1 Double_1 RealData1 Data32_2 Double_2 RealData2 NoOfDigit_1 NoOfDigit_2 Variable name Data type Execute BOOL Data32_1 DINT Data32_2 DINT NoOfDigit_1 INT NoOfDigit_2 INT BOOL Double_1 LREAL Double_2 O A J m gt Comments Convert from fixed point to floating point Execution trigger Decimal point position specifi cation data 1 INT Number of digits below deci mal point 1 Decimal point position specifi cation data 2 INT Number of digits below deci mal point 2 BOOL Normal end LREAL Floating point data 1 LREAL Floating point data 2 NJ series CPU Unit Software User s Manual W501 6 Programming Omitting Parameters When you call a function block you can omit parameters that are not required The following table shows when you can omit parameters Variables for Notation pattern POU type the called TEE Omission POU FB Given notation All parameters given sd All parameters given sd given instance x a y Z C method 1 Given notation rset T J OK method 2 OK Possible initial used Compiling error Function Calls Overview This statement calls a function gt a D Oo D 3 3 5 rr D c D Q D o Reserved Words None Statement Structure Give the output paramet
301. e and other attributes You do not need to assign a memory address to a variable However you can assign a specific memory address if necessary see note The NJ series CPU Unit automatically allocates memory addresses in the memory area for variables Note This is done to use specific functions for some CJ series Special Units You must specify the CJU series Unit memory address in the AT Specification attribute of the variable Refer to AT Specification on page 6 51 for details p amp S D ea D N 6 3 2 Types of Variables Variables are broadly classified into the following three types User defined Variables The user defines all of the attributes of a user defined variable The rest of this section describes user defined variables SOIQeHeA 9 Semi user defined Variables These variables are used to access specific devices and data There are two types of semi user defined variables device variables and cam data variables Refer to 2 2 1 Types of Variables and 3 4 1 I O Ports and Device Variables for details on device variables System defined Variables System defined variables are provided in advance in an NJ series CPU Unit The names and all attributes are defined by the system They have specific functions System defined variables are supplied for each function module Refer to A 3 System defined Variables for details Refer to 2 2 1 Types of Variables for details on the different types o
302. e semicolon IF A B THEN C D ee a IF construct statement END_IF Comment e You can write comments in your program to make the code easier to understand e Statements written as comments are not executed NJ series CPU Unit Software User s Manual W501 6 Programming e The two methods to insert comments are described below Enclose the comment in sin Commenting out multiple lines This type of comment can span over gle byte parenthesis and IF ErrCode 3 THEN multiple lines Comments cannot be asterisks for example _ nested This is a comment Value 1000 END_IF down to here Begin the comment with two Comment You can comment out only single forward slashes and end A SIN X 2 lines it with a carriage return Spaces Carriage Returns and Tabs e You can place any number of spaces carriage returns and tabs in your code at any location This allows you to add spaces or tabs before statements and carriage returns between operators key words and expressions in order to make your code easier to read e Always enter a token separator such as a space carriage return or tab between operators key words and variables Example The square boxes indicate where you must insert a token separator such as a space carriage return or tab IF E A gt O E THEN X 10 ELSE E X 0 END_IF P a u Oo D 3 3 5 rr D c D Q D o Lo
303. e I O tasks POUs and variables i I O Design e Design the relationship between the external I O and the unit configuration e Determine the intervals at which to refresh external I O Task and POU Design Consider the following e What task configuration is required e Which programs to assign to which tasks e Which Units to assign to which tasks e What processing to place in programs and what processing to place in function blocks and functions Variable Design Consider the following e The separation of variables into those that you use in more than one POU global variables and vari ables that you use in only specific POUs local variables e Defining the variable names for the device variables that you use to access slaves and Units e Defining the attributes of variables such as the Name and Retain attributes e Designing the data types of variables 11 4 NJ series CPU Unit Software User s Manual W501 11 Example of Actual Application Procedures 11 2 3 Software Settings from the Sysmac Studio On the Sysmac Studio you set the Unit and slave configurations register global variables and device variables create axes axis variables and set the Controller Setup and Special Unit Setup i Start the Sysmac Studio Create a project in Sysmac Studio ol ool I N O lt p lt p O h gt D m x lt Q 3 3 D u O O D Q c D amp Offline B Project Properties a N
304. e also specified in advance Accessing task Task B Read only Read write 4 Refreshing task is specified Refreshing task Task A Refreshing task Task A Global variable Accessing Read only task Task C Application Example The refreshing task specification is used to ensure the concurrency of the value of a global variable within a periodic task when the variable is written in the primary periodic task syse UBEeMmjeq senjeA aiqeueA jo AoualnoU0yD Bulunsuy Z s Refreshing task Accessing task Program Read only External variable GVar1 Program Read write External variable GVar1 gt Global variable GVar1 The most recent value of the variable at the end of refreshing task execution is read at the start of accessing task execution NJ series CPU Unit Software User s Manual W501 5 15 5 Designing Tasks System If a refreshing task is set for a global variable the accessing task at the start of accessing task exe cution always reads the most recent value of the variable that was written at the completion of refreshing task execution Task period of task A Task period of task A Task period of task A Refreshing Refreshing Refreshing task Task A task Task A task Task A Write Global variable L O of I I 1 i I variable is read I I 1 Value of variable X is not read Global variable
305. e classified into levels according to the degree of the effect that the events have on control When an event occurs the Sysmac Studio or PT will display the level Refer to the NJ series Trouble shooting Manual Cat No W503 for details on Controller events 12 4 Major Fault Level These errors prevent control operations for the entire Controller If a major fault level error is detected user program execution is stopped immediately and the loads for all slaves including remote I O are turned OFF With EtherCAT slaves and some CuU series Special Units you can set the slave settings or Unit settings to select whether outputs will go OFF or retain their previous status You cannot reset major fault level errors from the user program the Sysmac Studio or an NS series PT To recover from a major fault level error remove the cause of the error and either cycle the power supply to the Controller or reset the Controller from the Sysmac Studio Partial Fault Level These errors prevent control operations in a certain function module in the Controller The NJ series CPU Unit continues to execute the user program even after a partial fault level error occurs You can include error processing in the user program to safely stop any devices in operation After you remove the cause of the error execute one of the following to return to normal status e Reset the error from the user program the Sysmac Studio or an NS series PT e Cycle the power sup
306. e click CPU Expansion Racks under Configurations and Setup in the Multiview Explorer Or right click CPU Expansion Racks under Configurations and Setup and select Edit from the menu The Unit Editor is displayed for the Controller Configurations and Setup layer NJ series CPU Unit Software User s Manual W501 39 Unit Versions 2 Right click any open space in the Unit Editor and select Production Information The Production Information Dialog Box is displayed 3 Production information fx Model information Lot number 501 1500 af 31810 Hardware Production information SYSTEM 1 00 00 22519 Model information Lot number BOOT 20110627 TOPFE B 3 0 Rack 0 Slot 1 Unit 0 C 1W V680C12 Ver 1 2 16 10V TOPAW 0 73 Runtime 155 Rack 0 Slot 1 Unit 0 CIIW V680C12 Ver 1 2 167 10V Unit revision 1 PCE revision 100 Software revision 17 0 Output file Simple Display Detailed Display In this example Ver 1 0 is displayed next to the unit model The following items are displayed CPU Unit CJ series Units Unit model Unit model Unit version Unit version Lot number Lot number Rack number slot number and unit number EtherCAT Slaves 1 Double click EtherCAT under Configurations and Setup in the Multiview Explorer Or right click EtherCAT under Configurations and Setup and select Edit from the menu The EtherCAT Configuration Tab Page is displayed for the Controller Configurations and Setup
307. e ee A 29 A 53 PLC Function Module initial Settings nocka aet aeri 4 4 PLC Function Module Error Status A 30 A 55 PECES pees ne pr CO a A 30 A 55 _PLC_TraceStaf0 3 etna eerite atthe see getedcnebanerndid A 54 A 55 _PLC_TraceSta 0 3 IsComplete 06 9 40 A 30 _PLC_TraceSta 0 3 lsStart ceeeee sees 9 40 A 30 _PLC_TraceSta 0 3 lSTrigger ccccceeeseees 9 40 A 30 _PLC_TraceSta 0 3 ParamErr ccccceees 9 40 A 30 ple Renner emer tet ORs E E ney emer A 29 A 52 oe e ee ere reer cern eet okt er pnr eer kene sn eee een rome A 29 A 52 _Port_isAvailable lt cccecicvccceiccsiieeeece eicatensetncieeess A 30 A 53 POM NUMUSINGPOM eion inar Pevctusreenca ys A 30 A 53 POUs function DIOCK Sse ccceccivnte ec cecscseecasestcuseatsseecacsestanes 6 6 TING OTA Sees eae wea ag eae eee eens 6 6 Programs biiccezcssaeusiSrpteteninacehinase Gales aaeeuaidaasciane 6 6 FOS IWICTIONS Kerrien led eeu a railed eee Oe 6 24 POUs program organization units ccccecseeeeeeees 6 5 Power Interruption Count ccccceseeeeeeeeeeees A 29 A 52 power ON SlAISS eo a ee tal in eeins oath at a etetieed eens 8 3 Power Supply Unit incorrect model cccecccseccceeeeceeeeceeeceeseeseeeeseess 12 3 _PowerOnCount 0 0 cece ees eeceeeeeeeeeeeeeeeeeeeeeeneeeees A 29 A 52 HPOWCTORFOUN 4 2eiinctooabnnces eect ese eae A 29 A 51 Index 5 Index P P
308. e execution interval Check the effect on the processes is too short or the system service exe cution time ratio is too long in the sys tem service execution time settings executed by the system services with this operation and increase the sys tem service execution interval or reduce the system service execution time ratio None None 12 19 ol N Oo ea D o gt oO Oo 5 eo suoduos q 10113 p Z Z1 12 Troubleshooting Event name Task Period Exceeded 60010000 hex Meaning Task execution was not completed during the set task period for the primary periodic task or a periodic task Source PLC Function Module Source details Continuously timing Effects User program Continues Operation If the task execution does not finish within the set task period the I O refresh operation will be as follows e CJ series Units No I O refresh is executed When task execution is completed I O refreshing for the next period is executed e EtherCAT slaves The same values are output as for the previous output refresh If the task execution does not finish within the set task period overall control of the equipment may become impossible System defined Variable Name S The task period setting is too short Check the task execution time and Design the tasks considering the cor change the task period to an appro rections that are given on the left priate value A user program is too large Separate
309. e keke feet hance a aie hea als ae tee dhe 10 3 10 2 Connection Configuration for Sysmac Studio 0006 10 4 10 2 1 Configurations That Allow Online Connections 205 10 4 10 2 2 Configurations That Do Not Allow Online Connections 10 6 10 3 Connection Configurations between Controllers and between Controllers and Slaves siii ronie dite eda hinti wesw ne eee enue won s 10 7 10 3 1 Connection Configurations between Controllers 04 10 7 10 3 2 Connection Configuration between Controllers and Slaves 10 10 10 4 Connection Configurations with HMIs and Devices with Serial COMMUNICATIONS 1 52 05 ode bccn cee ee eae a hy eee 10 11 10 4 1 Connections to HMIS sc02225 6c e cerned eeaeds caves ears dca nt een 10 11 10 4 2 Connections to Devices with Serial Communications 10 11 NJ series CPU Unit Software User s Manual W501 10 1 10 Communications Setup 10 1 Communications System Overview 10 2 This section gives an overview of the communications systems that are supported by NJ series Con trollers The shaded steps in the overall procedure that is shown below are related to the communications sys tems Step 1 Software Design Step 1 1 Designing I O and Processing Step 1 2 Designing Tasks Step 1 3 Designing Programs Step 2 Software Setups and Programming Step 2 1 Slave and Unit Configurations Step 2 2 Controller Setup S
310. e monitoring setting 5 2 4 Assigning I O Refreshing to Tasks CJ series Units and EtherCAT slaves are assigned to the tasks You can assign them to the following tasks eaceiica I O refresh target Tasks to which assignment is possible tion unit CJ series By Unit Basic Basic VO Units Units Primary periodic task and priority 16 periodic task ou EtherCAT By slave Primary periodic task slaves Primary periodic task and priority 16 periodic task Sysmac Studio Setting Procedure Set the tasks in which to perform I O refreshing for the slaves and Units in the I O Control Task Set tings on the Task Settings Tab Page of the Sysmac Studio For details refer to V O Control Task Settings on page 4 6 5 12 NJ series CPU Unit Software User s Manual W501 5 Designing Tasks Precautions for Safe Use If two different function modules are used together such as when you use CJ series Basic Out put Units and EtherCAT slave outputs take suitable measures in the user program and external controls to ensure that safety is maintained in the controlled system if one of the function mod ules stops The relevant outputs will stop if a partial fault level Controller error occurs in one of the function modules Refer to 12 1 Operation after an Error for details on partial fault level Controller errors i Accessing I O from the User Program You use device variables to access I O ports from the user program Access the device variables from
311. e oa 9 7 9 2 2 Spocial UNS a2 8 5 pened Same cine tal a a arnt a haty pedn Rican been cca dee naire bea cence 9 8 9 3 SD Memory Card Operations iisicteciscctsccssdessasceiceceeidiaeeesahlcendecsand cade savdaasenacicbidedecsandsedieenaceent 9 10 9 3 1 SD Memory Card Operations ccscccccccsseeececeeseececeeecececeeeeeeeeeacseeeessaeeeesssaueeeesauseeesessaseeeees 9 10 9 3 2 Specifications of Supported SD Memory Cards Folders and Files ccccssseeeeeeeeeeeeeees 9 11 9 3 3 SD Memory Card Operation Instructions ccccccseeeceeceeeeeeceeeeeeeecaeceeeeseaeeeeeseeeeeessseeeeeseeeees 9 12 9 3 4 FNS VON sce aces a ais Sac a each aac ata E see ead E ean Gea eutacgondeacaeo aca ssecascoasueeadsemecese 9 12 9 3 5 File Operations from the SySMAC StuUCIO ccccceeccecceseeeececeeseeeeeeeeseeeeeaaeeeeeeseueeeeeeseeeeeesanseeees 9 13 9 3 6 SD Memory Card Life Expiration Detection ccccccsssseecceeeeeeeceseeecceueeeeessaeeeesceeeeeessaaeess 9 13 9 3 7 List of System defined Variables Related to SD Memory CardS ccccccsseeeeeeeeseeeeeeesseeees 9 13 9 3 8 SD Memory Card Self diagnostic FUNCTIONS ccccccssseeecceseeeecesseecceeseeeesnauseeeeseaeeeeessaasess 9 14 9 3 9 Exclusive Control of Access to the SD Memory Card cccccsecccccseseeeeceeeeeeeeseeeeeeeaeeeeeessaaeees 9 15 O28 SECUN waste Pried conse oeee a a aa a 9 17 9 4 1 Verification Of Operation AuUmnority ces2sccdncss Andee
312. e with a four byte alignment such as DWORD data is inserted four bytes of unused memory will remain Example Memory Variable Table Name Datatype a tword i JC Variable A WORD LWORD Stored with a SE da d e R a a a a a 8 byte alignment Variable B Stored with a 2 byte alignment First byte 12 aa ne First byte 13 ee ME Variable C Stored with a 8 byte alignment A 86 NJ series CPU Unit Software User s Manual W501 Appendices i Array Variables Array variables are stored in a continuous section of memory Example Variable Table Name Datatype a Boo B Boot S e ARRAY 1 5oFBooL Jo Variable A Variable B ARRAY 0 18 OF BOOL ARRAY 5 8 OF BOOL Variable C 1 5 Variable D 0 18 First byte 6 DA R udi P N S a D ea D D 3 oO lt gt O a O First byte 7 DRM alignment A gt oO Q o Variable E 5 8 Memory Variable Table Stored with a 2 byte alignment i Name Datatypes eee variable A NNN vere o Nun nnI EE O AEE y A variag az AAA A A varigas AA T AAE variable aj MA A i Structures A continuous section of memory is allocated based on the alignment value of the data type of the struc ture variable to store structure data sainy uolecoly Aioweyy sjqeueA L Z Y Example Memory Data Type Definitions Name Datatype a font j Fir
313. eCalitiOnS for Safe USC narun aana aa aaa aa ana da a a daana dadaa 28 PreGaulions f r C rrect US icra cacao ok a ede aa aaa entero 34 Reg lations and Standards vesecscecies secseccencwensetcecstvel ssewctsssdentsteedaedevsncseessseuetenceasens 37 Un SES IONS acana E ene a r eka enna a te deaddaenieeces 39 Related Ma nudlS aeterna a a a a a a a a a a 42 TORIMINOIOG Y vias a a aaea aa aaea aaa aaa 44 Revisi n HIStTOFY sses daai a a aa aaa aS 48 Section 1 Introduction FE The Nd SEries Controllers a a a Ea EEEE 1 2 1 1 1 POAUIOS ana a a ceacnaaencaacetGareceataleeercaessbeoner 1 2 1 1 2 Introduction to the System COnfiQurations ccccssececccceeeeeeceeeeeeeceeeeeeeeeeeaeeeeessueeeeesaeneeeeesaaees 1 4 T2 VSP SCI CAL OINS iene se sai ce sade a ence cede ie ciese auc salaee eet i encaues snecsel wen suadenvanecens 1 6 1 3 Overall Operating Procedure for the NJ series Controller cccccsssseseesseeeeseeeaseeseeneees 1 8 1 3 1 Overall PHOS CIF e isco os seek EEE crt es atin tee EEEN EEEE T EE EET EEIE 1 8 1 3 2 Procedure Details ccccccccccceccccccccecccccceccacececcuececeneacecenegeuueneauateneueeteneacacentauanentaeaueneneatsnenars 1 9 Section 2 CPU Unit Operation 2 1 Internal Operation of the CPU Unit cc teee cesses eeneeceeeecensecensseenseseesseeseeceseeseneesonessonseseas 2 2 2 1 1 Internal Software Configuration of the CPU Unit cccecccccccsseeeeeseeeeeeeseeeseeeseseeeeeaeeen
314. eNet Master Unit for AT specifications i e the number of output words and the number of input words These sizes are used to calculate the I O refresh time for the specific Special Units 6 Estimate the task execution times in the Task Execution Time Monitor You can check the following values in the Task Execution Time Monitor when you start the Simulator in Execution Time Estimation Mode NJ series CPU Unit Software User s Manual W501 5 Designing Tasks e Values That You Can Monitor with the Task Execution Time Monitor in the Simulator Connected to the Simulator e The average and maximum values of the task execution time e Real processing time of task estimated average values e System common processing time I O refreshing time user program execution time and motion control time Bar graphs show the amount by which the task period is exceeded e CPU usage EN Additional Information You can check the following values when connected to the Simulator of the Sysmac Studio You cannot check these values when connected to the physical Controller e CPU usage Displays how much of the task period is used by the total of the maximum esti mated task processing time and the system service processing time for the specified system service monitoring settings If CPU usage exceeds 100 it means that there is not sufficient time for task processing and the system service monitoring settings e Real processing time of tasks This
315. eceesecaeectaasct ES 5 19 Insufficient System Service Time Error cc0000 5 23 MEJE S r cree ere teen ereerren A rep nr tree terre 6 31 internal variables wrsccr eae le tele 6 12 6 19 IP Address Duplication Error essees A 39 A 70 NJ series CPU Unit Software User s Manual W501 L ladder diagram language cccecceeeeeseseeeeeeeeeeeeeeeens 6 65 ladder diagrams 20 1916 21 0 M use ete mete herr rere ennai ner ert oe rene 6 66 connecting functions and function blocks 6 67 controlling EXECUTION ccccseseeeceeeeeeseeseeseeeeeenees 6 66 OFUEMOMEXECUTION weet a 6 66 Largest Rack Number ccccsccsssseeeseeeeeseees A 31 A 55 Largest Slot Number cc cssseeeeeeeeeeeeeeeeees A 31 A 55 Last Task Execution Time sassen 5 19 A 27 A 48 _TaskName_LastExecTime ccc08 5 19 A 27 A 48 MINK ORE ENO esticcsccite a tenet tose area a aceeten eae A 34 A 62 LNK Stas 2 cartel aa scant dient a ance orelactad A 37 A 67 HRC FS ocra ae A a 6 61 local variable tables nneenenenenennnenenennnnnnnn 6 10 6 18 local Variables anini et aei da iai 6 28 M MAC Address Error aace A 34 A 39 A 62 A 69 master Control ses etek es ionini sr ieee 6 109 Mast r ENO orsina R A 34 A 61 _laskName_MaxExecTime oann 5 19 A 27 A 48 Maximum Task Execution Time 5 19 A 27 A 48 MC Common Variable a nn 2 7 WMG Test RUN axesteck ces csiaviee ss cnheies chca
316. ecified variable You can from File l specify array and structure variables The FileWriteVar instruction writes the value of a specified variable to Write Variable to A a binary file in the SD Memory Card You can specify array and struc FileWriteVar ae File ture variables If the directory specified for the file name does not exist it is created Open File FileOpen The FileOpen instruction opens the specified file Close File FileClose The FileClose instruction closes the specified file The FileSeek instruction sets a file position indicator in the specified Seek File file Read File FileRead The FileRead instruction reads the data from the specified file Write File The FileWrite instruction writes data to the specified file Get Text String The FileGets instruction reads a text string of one line from the speci fied file Put Text String ite FilePuts instruction writes a text string of one line to the specified The FileRemove instruction deletes the specified file from the SD Delete File FileRemove Memory Card Change File The FileRename instruction changes the name of the specified file or FileRename l Name directory Copy File FileCopy The FileCopy instruction copies the specified file to a different file Create Directory DirCreate The DirCreate instruction creates a directory in the SD Memory Card The DirRemove instruction deletes a directory from the SD Memory Delete Directory DirRemove Card 9 3 4 FTP Ser
317. ed in the next motion control processing MC section of the primary periodic task The results of processing are output via EtherCAT communications to the Servo Drive to which the axis is assigned during the I O refresh period in the next primary periodic task The Controller makes a response in the following I O response time I O response time Primary period process data communications cycle a 2 D o 0 D O Q gt m x lt Q 3 3 D Q gt Q _ O JJ D xe O gt D 5 D IN Execution command Process data communications cycle Primary period t Primary period t Primary periodic task Processing is performed in the motion control processing MC section in the next primary period Motion control instructions Commands to Servo A are sent via executed EtherCAT communications when I O is refreshed in the next primary period Task period 1 e g t x 3 Priority 16 UPG periodic task Note The above diagram shows only one input and one output However the I O response time may be as follows depending on the timing of the input from the slave Soll suods y nd no pue indu wajskS p E s Maximum I O response time Primary period process data communications cycle x 2 Programming Motion Control Instructions in the Priority 16 Periodic Task The motion control instructions are processed in the next motion contr
318. eee A 39 A 70 Basic I O Unit Information ce eeeeeeseeeeees A 32 A 57 Basic Ol rennan nana heeds 4 10 9 7 Basic Input Unit Input Response Times 9 8 A 31 A 56 DASIC SCTINGS draer a a a 4 4 basic system configurations sseesssseeeerreseeerrrrrrreeee nn 1 4 DIESUINGS arunan a 6 31 BOpleAN sisri A 6 31 BOOTP Server Error essssesessrsrssrerrrrrrnrerrenn A 39 A 70 Built in EtherCAT Error cccccccecceseesseeseeeeeeeeeee A 34 A 61 Built in EtherNet IP Error oo cccceceeseeeseeeeeeeeeee A 38 A 68 BUS Dals een enn Re ene ee ee oR eee Re eee 6 65 C cam data variables cccccseeceeceeeeeeceeeeeseeeeeeetseeneeeess 2 6 SG AIO TACCOSS aiiai a ta 9 13 A 28 A 51 _Card 1Deteriorated 0 00 eeceeeeeeeeeee ees 9 13 A 28 A 51 OOTTE Game eet Aner gn eo a eee 9 13 A 28 A 50 _Card1 PowerFall cccccceccessesseeseeeeeenees 9 13 A 28 A 51 GatGAPIOLCCE foci ion tress ect tects ata ee eae 9 13 A 28 A 50 Card 1 Ready ccccccccseccccssseeeeeeeeesaeaees 9 13 A 28 A 50 Cary FAO ieat i 6 8 A 29 A 52 changing present values ccceseeceeseeeeeeeeeeeeeeeeesaeees 9 32 checking I O wiring cccccceescecceeeseeeceeeeeeeeceneseeesseasees 7 7 CIP Communications Error c cccceeseeeeeeeeees A 39 A 69 _CJB_CBUOOInitSta to _CJB_CBU15InitSta oes 9 8 A 32 A 57 _CJB_CBUOORestart to _CJB_CBU15Restart oo 9 9 A 32 A 58 DG IIB SE lai eae a oa teeeh ee ee cee eas A 31 A 56 Index 2
319. eee eee 1 4 l 2 lt SPCCHICALIONS 2 629 eon hi oh eae eee oe sane eye een ees 1 6 1 3 Overall Operating Procedure for the NJ series Controller 1 8 1 3 1 Overall Procedure 2 20 5 esate eens ah da oie aed ghee eee oe eek 1 8 1 3 2 Proced re Details srities Ge Be ee et eee Gar Bae i ame a Soak ES 1 9 NJ series CPU Unit Software User s Manual W501 1 1 1 Introduction 1 1 The NJ series Controllers 1 1 1 The SYSMAC NuJ series Controllers are next generation machine automation controllers that provide the functionality and high speed performance that are required for machine control They provide the safety reliability and maintainability that are required of industrial controllers The NJ series Controllers provide the functionality of previous OMRON PLCs and they also provide the functionality that is required for motion control Synchronized control of I O devices on high speed EtherCAT can be applied to vision systems motion equipment discrete I O and more OMRON offers the new Sysmac Series of control devices designed with unified communications speci fications and user interface specifications The NJ series Machine Automation Controllers are part of the Sysmac Series You can use them together with EtherCAT slaves other Sysmac products and the Sysmac Studio Automation Software to achieve optimum functionality and ease of operation With a system that is created from Sysmac products you can connect componen
320. eeeeeeenseeeeeeeeenees A 76 A 6 Contents of Memory Used for CJ series Units ccctecceeeeseeeeeseeeeeseeeeenseeeenseeseeseeseeseeeoens A 80 NJ series CPU Unit Software User s Manual W501 17 CONTENTS Index 18 A 7 A 6 1 CNOA fats te Reales hil e sae edad eh alas ott acs dg deal gent cba vanes cad Get NA A 80 A 6 2 PUT iPM eae cc oa ie testa cette S A 82 A 6 3 FLO C Ale aenea sae ties sesaudcza rece aout cens seaaveecawsenanayenagiandunna a A A 83 A 6 4 DM FAV CA ae eedeareanacrcan R esas camorenea teaen lt eaanteaa seams qusaneeeasscmeaphieesass A 83 A 6 5 EM AlE auia a edn en ae noe seat aaa dace ce acne eagle A 84 Variable Memory Allocation Methods cseccccceeeeeeeeeeeeeeeseeeeeeeeeeeeeeeeeeeeenaneeeeeaeeseeseeseeas A 85 A 7 1 Variable Memory Allocation Rules reris a A E A 85 A 7 2 Important Case EX GIN DISS rccssccie wou cyiecatinnmatwncticknsate vaaneb cr autsiaiieeut wateat sav edencasianaa ottuns ea dduennsiercoeaeate cone A 88 NJ series CPU Unit Software User s Manual W501 Read and Understand this Manual Read and Understand this Manual Please read and understand this manual before using the product Please consult your OMRON representative if you have any questions or comments Warranty and Limitations of Liability WARRANTY OMRON s exclusive warranty is that the products are free from defects in materials and workmanship for a period of one year or other period if specified from date
321. eeeeesenseeeesas 6 102 6 6 3 Operation Tor TMSUUIC TON EMOS xara tetas cies steer aslo aces tee eee esa obs ce tesrioe hae Hinde he caendeck en causiots 6 105 Programming Precautions ssion tices dated ieele ceted nee chi aA a a aaa aaa eee 6 108 6 7 1 Array Specifications for Input Variables Output Variables In Out Variables 0008 6 108 6 7 2 Structure Variables for Input Variables Output Variables In Out Variables cc0 6 108 6 7 3 Master Contool yinie a aar neces hace Naa eile eee ts 6 109 Simulation Transferring Projects to the Physical CPU Unit and Operation SIMU ATION sissies setee tales code caus a aa a a a debian 7 2 7 1 1 Differences between the Simulator and the Physical CPU Uniit cccccesceeesseeeeeenseeeeeeeneees 7 3 7 1 2 simulatio PROGRAMS enaa sahara E aces aon ses ance EEE NEES 7 3 7 1 3 Executing a SIMU AUOM eaa Sori sawes sonia enue phe E NA 7 4 7 1 4 Sysmac Studio Online Operations cccccssscccccsesececceeeeccceeegeeeeceeeeeeeseuseeeeeeaueeeesseeeeeeessaeeeess 7 4 7 1 5 giman DEDUQGING enia SS tak Sis cents Sule ents taconite EN EAE 7 5 7 1 6 EStIMAION OL EXGCUUOM TINE Sesin E amatuer 7 6 7 1 7 servo Drive Signal Processing Emulation ccccececeeeceeeeseeeeeeeeeeaaeeeeeeeseeaaaaeeeeeeeeeaaaeseeeesenaas 7 6 Transferring the Project to the CPU Unit and Test Run c ccccsseseeeeeseeeeeseeseeeeeeeeeeeseenees 7 7 7 2 1 TManSierminG Ine Projeti sect vic
322. eeeess 5 29 NJ series CPU Unit Software User s Manual W501 Section 6 6 1 6 2 6 3 Section 7 7 1 7 2 7 3 CONTENTS Programming Overview of Programming Procedures sssssnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnm nnna 6 3 POUs Program Organization Units c ccsssecessessseeeceesseeseenseeeeceesseeeeoeeseesseoesseseoenseessoonsees 6 5 6 2 1 WNAE NG POUS iscia a aa a R 6 5 6 2 2 Overview of the Three Types of POUS ec cccccceecccccssseeeeceeeseeeeceeeeeeeceaeeeseseseeeessaeeeesssaseeesens 6 6 6 2 3 Differences between Programs Functions and Function BIOCKS c sccccseeeeeeeeeeeeeeeneees 6 7 6 2 4 Pelals om Programie sasie e a A E T 6 7 6 2 5 DetallS On Func HON BIOCKS risien A e a AREE donk 6 8 6 2 6 Beras OM IMG OMS sosea A EAN 6 17 6 2 7 Operation That Applies to Both Functions and Function BIOCKS c cccccssseeeeeeeseeeeeesaaeeees 6 22 6 2 8 OB ee 1oi dc 100 gic meme etme eemraaentee A ae Perr arene et E eran et eee eee 6 24 NM ANIADIOS wisest nce ethic Seal a aaae e a a e a aa ie EEE 6 27 6 3 1 VanaplE S Se can ties a E EE seus suaukaveusexodentechtyectin ts 6 27 6 3 2 Types Of VanlaDIeS 56 site rsce Slits a ewes See se eee 6 27 6 3 3 Types of User defined Variables in Respect to POUS ccccccccceseeeceeeeeeseeeeeeseeeeesaeeeeseaeees 6 28 6 3 4 Attributes of variable S xt tard 6 chiens Sen eats T a eked hcg eda keg Steeda 6 29 6 3 5
323. eeseeeeeeeees 1 4 EtherCAT slave configuration csseeeeeeeeeeeeeeeeeeeeees 3 5 EtherCAT Slaves menacing erae a saree terre emer ote 2 8 EtherNet IP Function Module initial settings scitnmhAtann eee 4 16 EVEN CODES erer ce cate Roum cect cette 9 45 event l vels tice coheed neon 9 45 12 4 event log categories cee eceeeseeeeeeeeeeteeeeneeeeeeneeeeeeees 9 45 event logs miniona sed eee 9 43 Event Setting Table ccccccssssececcessseeesessseeesseeseees 9 52 event SOUICOS sirais e Aa niai 9 44 _TaskName_ExceedCount a a 5 20 A 27 A 49 _TlaskName_Exceededqd aineen 5 20 A 27 A 49 _ TaskName_ExeCCount on 5 20 A 27 A 48 execution times SUI NING esenee en 7 6 external variables lt 2 a ccinn dain ee 6 12 6 20 F fata ENO S ena eaaa aara ana 12 3 FINS TCP Connection Status cccceeeeeeeeeeeeee A 30 A 53 _ FINSTCPConnSta cccecceccescececececececeseeees A 30 A 53 First RUN Period Flag ccccseeeeeeeeees 6 8 A 29 A 53 forced refreshing s2cssccesssasesnensseeosecccsezseessesesacgeactaanene es 9 28 FNP SCV ON Ghee E eect tat acces eden tea A E E E eters 9 12 PUINUMSW UCHONS scrissi aa a E 6 104 function block instructions sesesecserserreererrrereen 6 103 function blocks accessing variables from outside the function DIOCK uo ecc cece ecse cess eeeeeeeeeeeeeees 6 16 array specifications for instances cccceeeeees 6 14 calling OMES T srra e 6 10 Gre a
324. elements to the right are also changed to TRUE based on the operation of these con figuration elements This cascade of the TRUE state is called the power flow The left bus bar is the source of this power flow NJ series CPU Unit Software User s Manual W501 6 65 p a u Oo D 3 3 5 rr D c D Q D N sebenbue7 Burwweipold S 9 6 Programming 6 66 Connecting line The straight horizontal lines that connect the bus bar and the configuration elements are called con necting lines Connecting lines can be either TRUE or FALSE and can transfer the power flow from the left to the right Inputs Inputs are placed along the connecting line to receive the power flow and operate accordingly There are several different types of inputs and depending on their specifications they will either transfer the power flow from the left to the right or prevent the power flow from passing through When an input transfers the power flow to the right the connecting line to the right of the input will become TRUE If the power flow is inhibited the connecting line to the right of the input will remain FLASE For detailed specifications on inputs refer to the NU series Instructions Reference Manual Cat No W502 Output Outputs are placed along the connecting line to receive the power flow and operate accordingly An output writes the TRUE or FALSE value to a variable There are different types of outputs
325. endices Variable name _EC_SlavErr Function This system defined variable provides the collective status of all the error status for EtherCAT slaves Refer to A 3 7 Meanings of Error Status Bits for the meanings of the error status bits Data type WORD Range of values 16 0000 to 16 00F0O Usage in user program Possible Related instruc Get EtherCAT Error Status tions e GetECError Reset EtherCAT Controller Error e ResetECError Variable name _EC_SlavErrTbl Meaning Slave Error Table Global local Global Function This system defined variable gives the error status for each EtherCAT slave The error status is given for each slave in the actual system configuration This variable array indicates slaves in which there are errors Status is provided for each EtherCAT slave node address 1 to 192 Refer to A 3 7 Meanings of Error Status Bits for the meanings of the error status bits Data type Array 1 192 OF WORD Range of values 16 0000 to 16 00F0O Usage in user program Possible Related instruc Get EtherCAT Error Status tions e GetECError Reset EtherCAT Controller Error e ResetECError Variable name _EC_MacAdrErr Meaning MAC Address Error Global local Global Function TRUE if there is an illegal MAC address Data type BOOL Range of values TRUE or FALSE Usage in user program Possible Related instruc Reset EtherCAT Controller Error tions e ResetECError Variable name _EC_LanHweErr Meaning Communication
326. equired to monitor the actual position error information or other information on the Servo Drive or encoder input slave NJ series CPU Unit 2 An axis or axes group is specified for a Global Variable Table 1 The axis MC_Axis is created on the Sysmac Studio motion control instruction Sa Axis Variable An Axis Variable is made f System defined Variable Only the axis variable under a different name name is specified Axis variable name MC_Axis _MC_AX Axis basic settings and unit conversions Axis basic settings and unit conversions Motion I O The data types control Operating status and current values cannol ne Operating stat d t val instruction changed perating status and current values Axis variable name MC_Axis Error warning status Error warning status 3 You can monitor the members of the axis variable with instructions The values can be read and written with instructions Value of a member of the Axis Variable axis OMRON Servo Drives or encoder input slaves or supported Servo Drives or encoder input slaves from other companies Control operations EtherCAT 3 5 3 Creating and Using Axes and Axis Variables You can create and use axes and Axis Variables as described below 7 Right click Axis Settings under Configurations and Setup Motion Control Setup in the Multiview Explorer and select Add Axis Settings from the menu If necessary you can change the axis variable names from the default
327. er 2002 bytes An attempt was made to route a FINS response with over 2002 bytes Packet was received with a No Such Unit routing error Packet was received with a Routing Error routing error Packet was received with a No Routing Table routing error Packet was received with a No Routing Table routing error Packet was received with an Event Area Size Over Limit routing error There is insufficient space in the internal buffer FINS message routing failed because the communications load is too high A FINS response was received y page 12 35 in which DNA was the local net work but DA1 was not the local node A FINS command or response was received in which the hub network address specification DNA was greater than or equal to 80 hex There is insufficient space in the internal buffer A FINS command that does not have the minimum command length was received A FINS command that exceeded the maximum com mand length was received Sending packets failed FINS message routing failed because the communications load was too high NJ series CPU Unit Software User s Manual W501 12 Troubleshooting 12 2 4 Error Descriptions This section describes the information that is given for individual errors i Controller Error Descriptions The items that are used to describe individual errors events are described in the following copy of an error table Event name Meaning Source Error attributes Effects
328. er Error Slave Error Slave Error Table 16 0000 to 16 00F0 This system defined variable provides the col WORD lective status of errors in the EtherCAT Master Function Module page A 61 Refer to information on the meanings of the error Status bits at the end of this appendix for details WORD 16 0000 to 16 00F0 This system defined variable provides the col lective status of errors in the communications ports for the EtherCAT master page A 61 Refer to information on the meanings of the error Status bits at the end of this appendix for details WORD 16 0000 to 16 00F0 This system defined variable provides the col lective status of EtherCAT master errors and slave errors detected by the EtherCAT master page A 61 Refer to information on the meanings of the error Status bits at the end of this appendix for details WORD 16 0000 to 16 00F0 This system defined variable provides the col lective status of all the error status for Ether CAT slaves page A 62 Refer to information on the meanings of the error Status bits at the end of this appendix for details ARRAY 1 192 OF WORD 16 0000 to 16 00F0 This system defined variable gives the error status for each EtherCAT slave The error sta tus is given for each slave in the actual system configuration This variable array indicates page A 62 slaves in which there are errors Status is pro vided for each EtherCAT slave n
329. er Setup Enable Disable Settings Enabled wv gt i Motion Control Setup Serial Number 0x00000000 ef Cam Data Settings 0x6040 0 gt Event Settings 0x607A 0 me Task Ox60FF 00 FH Data Trace Settings sesame i RESD KNOIH ECT G5 Series ServoDrive Mot B8 0 R88D KNO1LL ECT Rev 2 1 0x60 AIRE R88D KNO1L ECT GS Series ServoDrive Mob gt Programming 0x607F 00 R88D KNO2H ECT Rev 2 1 Ox60E0 0 R88D KNO2ZH ECT G5 Series ServoDrive Mat 0x60E1 0 R88D KNO2L ECT Rev 2 1 0x603F 00 RB8D KNO2L ECT GS Series ServoDrive Mot PDO Map Settings 0x6041 0 R88D KNO4H ECT Rev 2 1 0x6064 0 RSSD KNO4H ECT GS Series ServoDrive Mot 0x6077 0 R88D KNO4L ECT Rev 2 1 0x6061 0 RSSD KNO4L ECT G5 Series ServoDrive Mob 3 Select the master and set the master parameters 4 Select each slave and set the slave parameters EN Additional Information At this point you can use forced resetting from the I O Map to check the wiring 11 6 NJ series CPU Unit Software User s Manual W501 11 Example of Actual Application Procedures i Register the Global Variables and Device Variables Registering Global Variables 1 Double click Global Variables under Programming Data 2 Register the global variables in the global variable table Registering Device Variables 1 Double click I O Map under Configurations and Setup 2 In the I O Map assign the variables to the I O ports The I O ports are created automatically from
330. er of 32 clients plus server connections UCMM Number of clients that can communicate at one time 32 max non connection type Supported CIP routing Units through which CIP routing is supported CS1W EIP21 CJ1W EIP21 CJ2H CPULIL EIP and CU2M CPU3L Class B Feature Pack Motion Control compliant Special protocol for EtherCAT CoE PDO communications and SDO communications DC distributed clock sere io0Base TX 100 Mbps 100Base TX Line daisy chain and branching E Twisted pair cable of category 5 or higher double shielded straight Transmission media i i og cable with aluminum tape and braiding Built in Ether Net IP port Communi cations Number of servers that can communicate at one time 32 max A 6 NJ series CPU Unit Software User s Manual W501 Appendices Item NJ501 1300 NJ501 1400 NJ501 1500 Transmission distance Distance between nodes 100 m max Maximum number of slaves 192 Inputs 5 736 bytes Maximum process data size Outputs 5 736 bytes However the maximum number of process data frames is 4 Built in Communi ee EtherCAT Maximum process data size per Inputs 1 434 bytes port slave Outputs 1 434 bytes 500 1 000 2 000 or 4 000 us At ambient temperature of 55 C 3 5 to 0 5 min error per month Internal clock At ambient temperature of 25 C 1 5 to 1 5 min error per month 1 2 3 4 At ambient temperature of 0 C 3 to
331. er program and check I O wiring i Operating Modes and Functions Function RUN mode PROGRAM mode I O refreshing of CJ series Units and EtherCAT Yes slaves Synchronizing from the Sysmac Studio Supported Online editing Supported Forced refreshing Supported Changing the values of variables and values in Supported memory used for CJ series Units from the Sys mac Studio Changing the values of variables and values in Supported memory used for CJ series Units from an HMI Communications Supported Operating Mode at Startup You can set the operating mode that is used at startup in the Controller Setup under the Configurations and Setup on the Sysmac Studio as shown below Settin ppandes Access point g Description Set values in RUN group mode Operation Set Operation Startup Sets the CPU RUN mode When Not tings Operation Settings Mode Unit s operat down allowed Settings Tab ing mode at loaded to Basic Settings startup CPU Unit Operation for Operating Mode Changes Changes in Values of Variables When the operating mode changes between RUN and PROGRAM mode the values of variables and the status of errors are affected as given in the following table Values of user defined variables Variables without Retain attribute Variables with Retain attribute RUN to PROGRAM e f initial values are set the variables No change PROGRAM to RUN change to the initial values The values befo
332. er to which the return value is assigned on the left side of the assignment keyword On the right side give the argument specifications to pass the values of the specified variables to the input variables of the called function inside the parenthesis after the function name There are two methods of writing this statement as shown in 1 and 2 below We recommend method 1 for program readability Notation Method 1 IF xO TRUE THEN y1 MyFUN A x1 B x2 C gt y2 END_IF e Ladder Diagram Expression e6benbue7 1x9 painionus S 9 MyFUN Function name x0 Specifies whether to call the function A and B Input variable names of the called function x1 and x2 Input parameters of the called function C Output variable name of the called function y1 Storage location for the return value from the called function y2 Output parameters of the called function e You can give the arguments in any order NJ series CPU Unit Software User s Manual W501 6 97 6 Programming 6 98 e You can omit the input variable names and input parameter names If they are omitted the input variables are assigned their initial values e You can omit EN as well If it is omitted EN is assigned a value of TRUE Notation Method 2 IF xO TRUE THEN y1 MyFUN x1 x2 y2 END_IF e Ladder Diagram Expression MyFUN Function name x0 Specifies whether to call the function A and B Input variable names of the called f
333. eration of the system Provide measures in the communications system and user program to ensure safety in the overall system even if errors or malfunctions occur in data link communications or remote I O communications If there is interference in remote I O communications or if a major fault level error occurs Output status will depend on the products that are used Confirm the operation that will occur when there is interference in communi cations or a major fault level error and implement safety measures Correctly set all of the EtherCAT slaves The NJ series Controller continues normal operation for a certain period of time when a momentary power interruption occurs This means that the NJ series Controller may receive incorrect signals from external devices that are also affected by the power interruption Accordingly take suitable actions such as external fail safe measures and interlock conditions to monitor the power supply voltage of the external device as required You must take fail safe measures to ensure safety in the event of incorrect missing or abnormal signals caused by broken signal lines momentary power interruptions or other causes Not doing so may result in serious acci dents due to incorrect operation eS Oooo Voltage and Current Inputs Make sure that the voltages and currents that are input to the Units and slaves are within the specified ranges Inputting voltages or currents that are outside of t
334. ervices processes that g are executed by the CPU Unit separate from task execution EtherCAT Slaves Axes assigned to Servo Drives and encoder input slaves Assigned to the primary periodic task I O refresh settings Other Slaves Assigned as required to the primary periodic task or a periodic task CJ series Units I O refreshing is set as required for each Unit in the primary peri odic task or a periodic task POUs that are assigned to tasks POUs Programs There are no restrictions to the number of definitions There are program capacity restrictions organiza Function blocks POUs that are used to create objects with specific conditions tion units POUs that are used to create an object that determine unique outputs for the inputs such as for data processing Program Ladder diagrams see note and structured text ST ming Types Note Inline ST is supported Inline ST is ST that is written as an ele languages ment in a ladder diagram External access of variables Network variables This is set as an attribute of the variable Program Variables Initial values are set when the user program is transferred ming without Retain Variables attribute Variables with Whether to set initial values can be selected when the user program is Retain attribute transferred An array groups data with the same attributes so that it can be handled as a single unit of data Number of dimensions 3 max Array Array variables Max
335. es Cause and correction Attached information Precautions Remarks 12 Troubleshooting Packet Discarded 80100000 hex One or more packets were discarded PLC Function Module Source details None Detection At FINS message timing reception Assumed cause Prevention A FINS response addressed to the Correct the contents of the FINS mes Set the FINS messages correctly CPU Unit was received sage at the source The send designation Unit for the FINS response does not exist Attached information 1 Cause of packet discard 01 hex FINS response addressed to CPU Unit received 02 hex Response send failed None NJ series CPU Unit Software User s Manual W501 12 33 ol tn N Oo ea D o gt oO Oo 5 suonduos q 10113 p Z Z1 12 Troubleshooting Event name Packet Discarded 80110000 hex Meaning One or more packets were discarded Source PLC Function Module Source details None Detection At FINS message timing reception Effects Not affected CONTENT 1 An attempt was made to senda Do not senda FINS response with Set the FINS message at the source FINS response with over 2002 over 2002 bytes correctly bytes An attempt was made to route a FINS response with over 2002 bytes 3 Packet was received with a No Check the FINS message at the Such Unit routing error source and correct the unit number in the response frame or a command frame that does not require a response 4
336. es All axes in interpolated motion are decelerated to a stop groups immediately All axes in interpolated motion are stopped immediately stopping axes groups Setting axes The blended target velocity is changed during interpolated motion group override factors Setting cam The end point index of the cam table that is specified in the input table parameter is changed Cams properties Common f l z l l l i Saving cam The cam table that is specified with the input parameter is saved in items i tables non volatile memory in the CPU Unit Writing MC Some of the axis parameters or axes group parameters are overwritten Parameters settings temporarily NJ series CPU Unit Software User s Manual W501 A 11 A h w x D O O D i O 5 T suoeooeds uoouny Yy Appendices Item NJ501 You can select either Linear Mode finite length or Rotary Mode infi Count modes nite length You can set the display unit for each axis according to the machine Automatic Jerk is set for the acceleration deceleration curve for an axis motion or acceleration axes group motion deceleration Acceleration control deceleration Changing the You can change the acceleration or deceleration rate even during control acceleration acceleration or deceleration and deceleration rates You can set an in position range and in position check time to confirm In position check when positioning is completed You c
337. es including array specifications range specifications structures and enumerations Keep the following precautions in mind when you design variables e Retention Set the Retain attributes to determine the values that are used for variables when the power supply is turned ON or when the operating mode changes Structures When a structure is used for a variable in an instruction design the program to use the same structure data type for the input parameter output parameter or in out parameter Example Communications Instructions e Array Specifications When an array variable is used for the variable for an instruction design the program to use an array variable for the input parameter output parameter or in out parameter Examples Shift Instructions Stack Instructions and Table Instructions e AT Specifications Use AT specifications for the variables used for input parameters to certain instructions Example Fixed or user I O allocations for DeviceNet Units Network Publishing Design the variables for EtherNet IP tag data links Reference 6 2 POUs Pro gram Organiza tion Units 6 5 Program ming Lan guages Reference 6 3 1 Variables 6 3 2 Types of Variables 6 3 3 Types of User defined Variables in Respect to POUs 2 2 2 Variables and I O Assign ments 6 3 4 Attributes of Variables 6 3 5 Data Types 6 3 6 Deriva tive Data Types 6 3 4 Attributes of Variables 6 3 5 Data Types 6 3 6 Der
338. es Are Set The initial value is assigned to the variable at the following times e When power is turned ON e When the operating mode changes from PROGRAM to RUN mode or from RUN to PROGRAM mode e When you select the Clear the present value of variables with Retain attribute Check Box and download the user program e When a major fault level Controller error occurs NJ series CPU Unit Software User s Manual W501 6 Programming When the Initial Value Specification Is Left Blank The following initial values are used for variables for which the initial value specification is left blank Data type Default initial value Boolean data and bit strings 0 UINT UDINT or ULINT Real numbers 0 0 Durations dates and times of D 1970 01 01 DATE_AND_TIME DT 1970 01 01 00 00 00 Text strings STRING blank character Initial Value of Array Variables Data type Initial value specifications e You can specify an initial value for each element Array specifications e To specify initial values you must specify a value or leave the specification blank for each element ni S Initial Values for Derivative Data Types 5 You do not specify an initial value for the data type itself You set an initial value for each individual variable Data type Initial value specifications e You can specify an initial value for each member Structures e To specify initial values you must specify a value or leave the specification bl
339. es Controller and the operation that occurs after an error is detected Refer to 12 2 Troubleshooting tor details on corrections for specific errors Refer to the NJ series Troubleshooting Manual Cat No W503 for all of the errors that may occur in an NJ series Controller 12 1 1 Overview of NJ series Status You can check the operating status of the CPU Unit with the PWR RUN and ERROR indicators on the front panels of the Power Supply Unit and CPU Unit Power Supply Unit CPU Unit RUN i indicator a RUN omron PA3001 wm PWR 7 Nys501 1500 indicator ERROR indicator a ne L1 oe AC100 240V INPUT L2 N The following table shows the status of front panel indicators the status of user program execution and the ability to connect communications to the Sysmac Studio or NS series PTs during startup during normal operation and when errors occur Communications with Sysmac Stu dio or NS series PT Flashing Not lit Stopped Not possible 1 s intervals Lit i o Normal opera Not lit Possible en Power Supply Not lit Not lit Not lit Stopped Not possible Error Fatal errorin incorrect Power Lit Flashing Lit Stopped CPU Unit Supply Unit Con B 3 s intervals po a nected dog Timer Error Lit Lit Lit Possible Commu Lit Lit Lit Front panel indicators User pro CPU Unit operating status ram execu Z 3 are RUN green ERROR red tion sta
340. es that are greater than the valid range of times For example T 61m5s expresses the same time as T 1him5s The numerical value is interpreted as a decimal number If any number that is not a decimal number is used a compiling error will occur You can specify the order of the time any way you want For example TIME 1h_2d is a valid expression As long as there is at least one of the following day houn minutes seconds milliseconds no compiling error will Occur Remarks You can add one or more zeroes to the beginning of the year month and day For example D 2010 1 10 expresses the same date as D 2010 01 10 A compiling error will occur if you specify any numerical value that overflows the valid dates For example D 2010 01 35 will Cause an error The numerical value is interpreted as a decimal number If any number that is not a decimal number is used a compiling error will occur Remarks You can add one or more zeroes to the beginning of the hour minute and second For example D 23 1 1 expresses the same date as D 23 01 01 A compiling error will occur if you specify any numerical value that overflows valid times For example D 24 00 00 will cause an error The numerical value is interpreted as a decimal number If any number that is not a decimal number is used a compiling error will occur Remarks DATE_AND_TIME ye DATE_AND_TI This is the same as the date data and time data types
341. es the system defined variables that are related to the built in EtherNet IP port This section describes how to set IP addresses for built in EtherNet IP ports This section describes the settings that are required for EtherNet IP communications This section describes how to perform communications test with EtherNet IP nodes to confirm that the built in EtherNet IP port is set correctly This section introduces tag data link communications and describes the settings that are required to use tag data links This section describes how to use CIP message communications for devices on the EtherNet IP network e g to read and write data This section describes how to use socket communications to send and receive data with TCP UDP This section describes how to use the FTP server to download and upload files in the SD Memory Card to and from FTP clients This section describes how to automatically get clock information from an NTP server to update the clock information in the CPU Unit This section describes how to use the SNMP to manage the built in EtherNet IP port as an SNMP agent This section describes tag data links communications adjustment of the communica tions load and communications time This section describes how to use event codes and network status to confirm errors and corrections for them The appendices provide a functional comparison of EtherNet IP between NJ series CPU Units and other series and describe EDS
342. esaaees 2 2 2 1 2 CVEIVICW Ol TASK Gress eared eee Peaks eens iat aden ctidin ade adi ach ona e a tana 2 3 2 2 VarlaDleS and VO ies v ecescescsvouruusenvoruad a aa aa aaa E aa 2 5 2 2 1 Types or Varnable Sienen E ey ne Pe er eer eee 2 5 2 2 2 Variables and I O ASSIQNMENNS ccccccccceeeceeceeececeseeesseeeeeseeeeeseaeeeseaeseesuaueeseeeesaeeessuseesaaaeees 2 8 2 3 COMUUOI SV SIONS aoaea E E RE E EEA 2 12 2 4 CPURU IE Stat iina e a a aa a a N a a E a a a aE S 2 17 2 5 CPU Unit Data and Data Retention ccccsecscsesseceecneesecneceseeeneeeecueenecuseuseueceseeenesaeenseesses 2 18 2 5 1 CPU OUNTO E E a a 2 18 NJ series CPU Unit Software User s Manual W501 13 CONTENTS Section 3 Section 4 3 1 3 2 3 5 Section 5 4 1 4 2 4 3 4 4 4 5 4 6 14 5 1 5 2 I O Ports Slave Configuration and Unit Configuration Overview of Procedures for the Slave and Unit Configurations ccscccseeseeeeeeeeeeeeeees 3 2 Creating the EtherCAT Slave Configuration cccccesssecseeseeeeeneeseenseeenseeeeaseesenseesenneessoas 3 5 3 2 1 MOGUC Ol eaceaencareeteatnencahia teccaskhaesieeeuneimacoratearaatecestetancemn ce see E 3 5 3 2 2 Creating the EtherCAT Slave Configuration ccccsssccececseeeeeeceeeeeeeeseeeeeeeeeuaeeeeeseaaeeeeeasaneeesenas 3 5 Creating the Unit Configuration sssini aa a a aa 3 7 3 3 1 NIL FOCUICH OM ienn a ised ct gaiecinen ch peo cacestanselieattwedeatsstDab
343. escribes how to handle errors This section lists all of the error events that can occur on NJ series Controllers fi Sysmac Studio Version 1 Operation Manual Cat No W504 Section Section 1 Introduction Section 2 Installation and Uninstallation Section 3 System Design Section 4 Programming Section 5 Online Connections to a Controller Section 6 Debugging Section 7 Other Functions Section 8 Reusing Programming Section 9 Support Software Provided with the Sysmac Studio Section 10 Troubleshooting Appendices NJ series CPU Unit Software User s Manual W501 Description This section provides an overview and lists the specifications of the Sysmac Studio and describes its features and components This section describes how to install and uninstall the Sysmac Studio This section describes the basic concepts for designing an NJ series System with the Sysmac Studio and the basic operating procedures This section describes how to create programs with the Sysmac Studio This section describes how to go online with a Controller This section describes how to debug the programs online on the Controller or debug it offline with the Simulator This section describes Sysmac Studio functions other than system design functions This section describes how to reuse the programs that you create with the Sysmac Studio This section describes the Support Software that is provided with the Sysmac Studio
344. esh I O in the primary periodic task or the priority 16 periodic task the periodic task with the highest execution priority e O refreshing is assigned by slave or by Unit e O refreshing is performed in all operating modes PROGRAM and RUN modes e The I O refresh processing time depends on the type and number of Configuration Units that are used in the Controller The processing time for each Unit is constant User Program Execution More than one program can be assigned to one task Programs are executed in the order that they are assigned Motion Control Motion control is executed based on commands from the user program Motion control instructions are executed only in the primary periodic task System Common Processing System common processing consists of condition evaluation for motion inputs processing for data tracing exclusive control of variables processing for tag data links and other processing Refer to 5 2 3 Basic Operation of Tasks for details 2 4 NJ series CPU Unit Software User s Manual W501 2 CPU Unit Operation 2 2 Variables and I O This section describes the types of variables that are used with an NJ series CPU Unit and the control systems that are used by an NJ series CPU Unit 2 2 1 Types of Variables An NJ series CPU Unit uses variables to access the memory space from instructions in the user pro gram A variable is a named data element in memory The following table lists the types of v
345. estination node is in S network add it to the network the network 7 FINS message routing failed Reduce the frequency of sending Keep the frequency of sending FINS because the communications FINS messages at the sources messages as low as possible load was too high Attached Attached information 1 Cause of discarding packets information 1 01 hex 2 02 hex 3 03 hex 4 04 hex 5 05 hex 6 06 hex 7 07 hex The numbers refer to the numbers of the above causes Precautions None Remarks NJ series CPU Unit Software User s Manual W501 12 35 12 Troubleshooting 12 2 5 Troubleshooting Errors That Are Not in the CPU Unit i Security Errors 1 Forgot the Administrator password Cannot release the operation lock with the Sysmac Studio Operation was locked when verifying operation authority on the Sysmac Studio An online connection was made with the operation authority that is required for operation but operation authority verification was requested for a spe cific operation Cannot release the operation lock with the Sysmac Studio after the operator left the Sysmac Studio unattended Some of the user program data cannot be read for certain operations e Monitoring Variables Operation Commands SET RESET forced refreshing online editing data tracing MC Trial Run and setting the user program execution ID in the CPU Unit Synchronizing Uploading Verifica tion and Backup POU algorithms Writing to the
346. etNodeErr Meaning Target Node Error Information Global local Global Function This variable indicates that the connection for the Registered Target Node Information was not established or that an error occurred in the target Controller The array elements are valid only when the Registered Target Node Information is TRUE Array x is TRUE A connection was not normally established with the target node for a target node ID of x the Registered Target Node Information is TRUE and the Normal Target Node Information is FALSE or a connection was established with the target node but an error occurred in the target Controller Array x is FALSE The target node is not registered for a target node ID of x the Registered Target Node Informa tion is FALSE or a connection was normally established with the target node the Registered Target Node Infor mation is TRUE and the Normal Target Node Information is TRUE An error occurred in the target Controller the Target PLC Error Information is TRUE Data type ARRAY 0 255 OF BOOL Range of values TRUE or FALSE Usage in user program Related instruc tions Variable name _EIP_NTPResult ExecTime Meaning NTP Last Operation Time Global local Global Function Gives the last time that NTP processing ended normally The time that was obtained from the NTP server is stored when the time is obtained normally The time is not stored if it is not obtained from the NTP server normally Note Do not use
347. eters Motion control parameters include the following parameters e Axis Parameters Settings for single axis control e Axes Group Parameters Settings for multi axes coordinated control Ly Selthe Studio Set the parameters in the Aa 5 y U i gt Q A O mp gt O oO O e gt mp o TI c gt O e m O Q a g Motion Control Setup NJ series CPU Unit i mn TT zA iili i p Motion control L parameters Built in non volatile memory When power is turned ON Main memory When downloaded Read and check Download Axis Parameter Settings data Axis Parameter Settings User program Upload i Axes group parameter settings UOHONpOU L p p Axes Group Parameter Settings C_Write instruction Temporarily changes some parameters CS CJ NSJCJ2 Series Instructions Reference Manual W474 4 13 4 Controller Setup 4 4 2 Setting Methods You can use either of the following methods to set motion control parameters fl Method 1 Setting the Motion Control Setup in the Sysmac Studio Right click Axis Settings from under Configurations and Setup Motion Control Setup in the Sys mac Studio and make the settings in the Axis Setting Table Eil Sysmac Studio File Edit View Insert Project Controller Simulation Tools Help New Project new_NIJ501_0 v gt oe EtherCAT gt CPU Expansion Racks amp I
348. ettings Master Fixed Allocation Setting 3 Switch FA Data Trace Settings Master User set Allocations Switch Temporary Setting Switch for Communications Cyde Time Communications Cyde Time Setting Switch Communications Cyde Time Reference Table Clear Switch Slave Enable Switch Slave Stop Switch Slave Fixed Allocation Setting 1 Switch Slave Fixed Allocation Setting 2 Switch Slave Fixed Allocation Setting 3 Switch Slave User Allocation Switch Slave COS Send Switch Unit Setup File Restore Switch Unit Setup File Backup Switch Node0 Master COS Send Switch Node1 Master COS Send Switch Node2 Master COS Send Switch Node3 Master COS Send Switch Node4 Master COS Send Switch Node5 Master COS Send Switch Node6 Master COS Send Switch Node7 Master COS Send Switch Nodes Master COS Send Switch Node9 Master COS Send Switch Node10 Master COS Send Switch Node11 Master COS Send Switch Node12 Master COS Send Switch Node13 Master COS Send Switch lt TIRE IE OE TUE TIOE TAE TEE IAE DOE TAE E TE aad aia 444i 4a aia 44 didi ad 4404040404 4 Return to default Help 3 Connect the CPU Unit online and transfer the settings to the CPU Unit Method 2 Using the Sysmac Studio to Specify Initial Settings for the I O Ports in the I O Map 1 Use the I O Map in the Sysmac Studio to set values for the I O ports 2 Restart the Unit reset the Controller or cycle the power supply to the Controller Method 3 Using the Sysmac Studio to Spec
349. ew Project gt M Open Project reed em Nev Project abor O lt lt re Create olpnis oewSAS y wo SHUII IES GIeMYOS E Z 1 i Create the Unit Configuration 1 Double click CPU Expansion Racks under Configurations and Setup 2 Create the Unit configuration by dragging Units New Project new_NJ501_0 v Configurations and Setup og EtherCAT z i i Model name CJ1W 0D231 Y CPU Expansion Racks j Product name Transistor Output gt m CPU Rack Specifications 12 to 24V DC 0 5A Rack No 0 o 7 7 eae H p Slot No 3 gt amp Controller Setup gt i Motion Control Setup amp Cam Data Settings Event Settings Br Task Settings v4 Data Trace Settings gt Programming Bf cow ov232 ii CJ1W 0D233 EG CJ1W 0D234 ii CJ1W 0D261 3 Select each Unit and make the required settings NJ series CPU Unit Software User s Manual W501 11 5 11 Example of Actual Application Procedures i Create the EtherCAT Slave Configuration 1 Double click EtherCAT under Configurations and Setup 2 Create the slave configuration by dragging slaves New Project Configurations and Setup new_NJ501_0 Node Address Network configuration Configurations and Setup Item name Value v 5p EtherCAT E002 Model Node1 R88D KNO1H ECT E gt 9 R88D KNO Da TOO R E p Product name R88D KNO gt CPU Expansion Racks N VeL Revision 725 I O Map Node Address gt Controll
350. exceeded Task execution count 1813998times Task period exceeded count Otimes Connected to the Simulator New Project gt oe EtherCAT gt CPU Expansion Racks I O Map gt amp Controller Setup gt i Motion Control Setup amp Cam Data Settings gt Event Settings E Task Settings hv Data Trace Settings Configurations and Setup oQQ A PrimaryTask Task Execution Time O Average Estimation 1252 0us Max Estimation 1252 0us Set period 4000us Period exceeded Task execution count 393times Task period exceeded count Otimes Real processing time of tasks INN Latest 1252 0us System common processing I O refreshi Execution of user programi Motion Control System service execution ratio 10 CPU usage rate 41 Reset CJ series Unit settings NJ series CPU Unit Software User s Manual W501 5 Designing Tasks You can monitor the following items Connected Connected Monitor item Description to the Con to the Sim troller ulator tion time played ina Max Set period The specified task period Period exceeded lf the task execution time exceeds the task period i e if the Task Period Exceeded Flag system defined variable is TRUE the amount by which the time was exceeded is displayed in the bar Task execution count Displays the number of executions of the task M The value of the Task Execution Count system D defined variable is displayed D Real processing time
351. exe cuted on the primary periodic task period Periodic 0to3 16 17 0or 18 The periodic tasks are executed once The processing that can tasks every task period be performed depends on the task execution priority e Execution priority 16 I O refreshing and user program execution Execution priority 17 or 18 User program exe cution The CPU Unit periodically executes both the primary periodic task and periodic tasks The interval in which the CPU Unit executes the primary periodic task or a periodic task is called the task period p N D m 2 V lt m D 3 uoponponu Z S Fixed period an integer multiple of the task period of the primary periodic task Periodic task task Primary periodic task periodic task Fixed Task period period Task period From 1 to 128 programs can be assigned to one gt one task The The programs that are assigned to a task are executed in the order that they are assigned Execution of the all of the programs assigned to each task is called user program execution Exchanging data with CJ series Units or EtherCAT slaves is called O refreshing You can assign I O refreshing for each slave and Unit to the primary periodic task or priority 16 periodic task By default refreshing for all slaves and Units is assigned to the primary periodic task NJ series CPU Unit Software User s Manual W501 5 5 5 Designing Tasks Task Configurations
352. f the Sysmac Studio or the ResetECError instruction A 36 NJ series CPU Unit Software User s Manual W501 Appendices Functional Classification EtherCAT Communications Status values _EC_RegSlavTbl Registered Slave This table indicates the slaves that are regis ARRAY TRUE or page A 65 Table tered in the network configuration information 1 192 FALSE Slaves are given in the table in the order of OF BOOL slave node addresses The element for a slave is TRUE if the corresponding slave is registered _EC_EntrySlavTbl Network This table indicates which slaves are con ARRAY TRUE or page A 65 Connected Slave nected to the network Slaves are given in the 1 192 FALSE Table table in the order of slave node addresses OF BOOL The element for a slave is TRUE if the corre sponding slave has entered the network r wo w lt m a D 3 Q D h 5 D Q S z D z D o _EC_MBXSlavTbl Message Com This table indicates the slaves that can per ARRAY TRUE or page A 65 munications form message communications Slaves are 1 192 FALSE Enabled Slave given in the table in the order of slave node OF BOOL Table addresses The element for a slave is TRUE if message communications are enabled for it pre opera tional safe operation or operational state Note Use this variable to confirm that mes sage communications are possible for the relevant slave before you execute message communications with an EtherCAT sl
353. f variables NJ series CPU Unit Software User s Manual W501 6 27 6 Programming 6 3 3 Types of User defined Variables in Respect to POUS 6 28 There are six types of user defined variables as defined according to their function in a POU POU type Internal variables Supported Supported Supported Input variables Not supported Supported Supported Local variables Output variables Not supported Supported Supported In out variables Not supported Supported Supported Global variables Supported see note Supported see note Supported see note External variables Supported Supported Supported Note You can define global variables as external variables to access the global variables through the external vari ables Type of user defined variable Bf Local Variables Local variables can be read and written only in the POU program function or function block in which it is defined Local variables are the same as internal variables if the POU is a program If the POU is a function block or a function local variable is a collective term for internal variables input variables output variables in out variables and external variables Internal Variables An internal variable can be used only within one POU An internal variable is declared in the local variable table for the POU You cannot access the values of internal variables from outside of the POU You can declare internal variables with the sa
354. fety is maintained in the controlled system if one of the function modules stops The relevant outputs will stop if a partial fault level error occurs in one of the function modules e Always confirm safety at the connected equipment before you reset Controller errors with an event level of partial fault or higher for the EtherCAT Master Function Module When the error is reset all slaves that were in any state other than Operational state due to a Con troller error with an event level of partial fault or higher in which outputs are disabled will go to Oper ational state and the outputs will be enabled Before you reset all errors confirm that no Controller errors with an event level of partial fault have occurred for the EtherCAT Master Function Module e Always confirm safety at the connected equipment before you reset Controller errors for a CJ series Special Unit When a Controller error is reset the Unit where the Controller error with an event level of observation or higher will be restarted Before you reset all errors confirm that no Controller errors with an event level of observation or higher have occurred for the CJU series Special Unit Observation level events do not appear on the Controller Error Tab Page so it is possible that you may restart the CJ series Special Unit without intending to do so You can check the status of the _CJUJB_UnitErrSta 0 0 to _CJB_UnitErrSta 3 9 error status variables on a Watch Tab Page to see if an
355. g Connecting Functions and Function Blocks in a Ladder Diagram Connection Configurations You use the following two types of connections for functions or function blocks 1 Power Flow Input and Output In a ladder diagram the line that connects an input variable of a function or function block and the left bus bar indicates a BOOL input and the line that connects an output variable to the right bus bar indicates a BOOL output Example Inputs are connected in the power flow that connects to the left bus bar Outputs are connected in the power flow that connects to the right bus bar gt a u Oo D 3 3 5 rr D c D Q D o 2 Parameter Inputs and Parameter Outputs In a ladder diagram parameter inputs and outputs are specified when the input and output variables of a function or function block are not connected to the left and right bus bars As shown below you can specify either variables or constants for input and output parameters Function function block variables Input parameters Output parameters Input variables You can specify variables or con stants Output variables Se You can specify only variables In out variables You can specify only variables You can specify only variables Number of BOOL Variables At least one BOOL variable each is required for the input and the output Such as EN and ENO of a function or function block ebenbue7 wesbeig seappe Z
356. g is performed User program execution e Programs assigned to tasks are executed in the order that they are assigned System common processing Processing for exclusive control of variables in tasks when refreshing 2 tasks are set e Processing for variables accessed from outside of the Controller is per formed to maintain concurrency with task execution executed for the vari able access time that is set in the Task Settings Note If there is communications processing for EtherNet IP tag data links and refreshing tasks are set for the tags i e variables with a Network Pub lish attribute variable access processing is performed as part of sys tem common processing 2 q System Services System services are the processes other than task processing that the CPU Unit executes System S services include the following processes lt 3 System service Description USB port service e Processing of service requests from the Sysmac Studio or an HMI such as CIP commands Built in EtherNet IP port ser e Processing of message service requests such as CIP commands from vice the Sysmac Studio an HMI host computers or other Controllers e EtherNet IP tag data link communications processing Note If there is communications processing for EtherNet IP tag data links and refreshing tasks are set for the tags i e variables with a Network Publish attribute variable access processing is performed as part of system common pro
357. g Registered Target Node Information Global local Global Function This variable gives a list of nodes for which built in EtherNet IP connections are registered This variable is valid only when the built in EtherNet IP port is the originator Array x is TRUE The connection to the node with a target node ID of x is registered Array x is FALSE The connection to the node with a target node ID of x is not registered R W access Rs Retained Not retained Network Publish Published Usage in user program Related instruc tions Variable name _EIP_EstbTargetSta 255 Meaning Normal Target Node Information Global local Global Function This variable gives a list of nodes that have normally established EtherNet IP connections Array x is TRUE The connection to the node with a target node ID of x was established normally Array x is FALSE The connection to the node with a target node ID of x was not established or an error occurred Data type ARRAY 0 255 OF BOOL Range of values TRUE or FALSE R W access Rs Retained Not retained Network Publish Published Usage in user program Related instruc tions Variable name _EIP_TargetPLCModeSta 255 Meaning Target PLC Operating Mode Global local Global Function This variable shows the operating status of the target node Controllers that are connected with the built in Ether Net IP port as the originator The array elements are valid only when the corresponding Normal T
358. g in slaves Function Module Process data communications cycle EtherCAT data transmission cycle Data refresh periods in slaves pee a eeroie akad This i same as the primary periodic task depends on the slave period periodic tasks 2 14 NJ series CPU Unit Software User s Manual W501 2 CPU Unit Operation Motion Control System The PLC Function Module sends motion control commands to the MC Function Module when motion control instructions are executed in the user program The MC Function Module then performs motion control processing based on those commands and sends the results of processing as commands to the EtherCAT Servo Drive that is assigned to the axis 1 The data is exchanged on the same period as shown below Task period of primary periodic task Motion control period Process data communications cycle iS do O e 5 o w lt Gi D 3 D CJ series Basic I O NJ series CPU Unit Units and Special Units PLC Function Module program execution Slaves EtherCAT Master Function Processing in slaves EtherCAT Motion control 4 control instructio processing by MC Function Module Motion control period primary periodic task Sequence control periods periods of primary periodic period Process data communications Data refresh periods in slaves task and periodic tasks cycle o data transmis depends on the slave s
359. g panes e Program Panes Ladder diagram language e I O Map e Watch Tab Page Procedure for Forced Refreshing from Ladder Editor 1 Select Monitor from the Controller Menu The monitor turns ON 2 Double click the ladder program ladder function or ladder function block under Programming in the Multiview Explorer The rungs are displayed on the Ladder Editor in monitor status 3 Right click the input or output and select Forced Refreshing TRUE The input or output is forced to TRUE Right click the input or output and select Forced Refreshing FALSE The input or output is forced to FALSE 4 The input or output in the Ladder Editor changes to TRUE or FALSE and the execution condition changes accordingly A mark that indicates that the input or output has forced status is displayed as shown below in i m Ladder diagram The TRUE or FALSE mark for forced status indicates the status that was specified for forced refreshing It does not indicate the current value of the input or output Forced status mark Operation TRUE specified with forced refreshing FALSE specified with forced refreshing EN Additional Information If there are other variables that are assigned the same memory address as one that is specified as the AT specification of a variable for which forced refreshing is specified the forced status mark is displayed for all of the variables with that AT specification i Affect of Operating Modes and P
360. g the built in EtherNet IP port 4 4 Wiring in NJ series CPU Unit Hardware User s Man ual Cat No W500 Operation manuals for the EtherCAT slaves and 4 4 Wiring in NJ series CPU Unit Hardware User s Man ual Cat No W500 6 4 2 Performing Online Debugging in Sysmac Stu dio Version 1 Operation Manual Cat No W504 Sysmac Studio Version 1 Operation Manual Cat No W504 Step 5 Confirming Operation and Starting Actual System Operation Step 1 Online Connec tion to Controller and Project Down load Description 1 Make the settings for communications with the Controller connect online and download the user program Controller Configurations and Controller Setup Perform this step before you create the slave configuration or Unit configu ration from the mounted Units in step 2 1 Note Use the Synchronize Menu of the Sysmac Studio to download the project 2 Cycle the power supply Sysmac Studio Reference Operations Controller Commu _ Section 7 Simulation Trans nications Setup ferring Projects to the Physi nization NJ series CPU Unit Software User s Manual W501 1 Introduction 2 Operation Check 1 Example Check the wiring by perform Section 7 Simulation Trans on Controller Ing forced refreshing with user speci ferring Projects to the Physi Ln values from the I O Map or Ladder cal CPU Unit and Operation itor Example for motion control Use the MC Test R
361. gger condition is met FALSE when the next trace starts Note You cannot use these system defined variables in the user program It is used only to monitor the status of data tracing from the Sysmac Studio Data type Structure sTRACE_STA Members BOOL Range of values TRUE or FALSE Usage in user program Not possible Related instruc TraceTrig tions e TraceSamp You can access this variable from the user program only with the following instruction e GetTraceStatus A 54 NJ series CPU Unit Software User s Manual W501 Appendices Variable name _PLC_TraceSta 0 3 ParamErr Meaning Trace Parameter Error Flag Global local Global Function TRUE when a trace starts but there is an error in the trace settings FALSE when the settings are normal Note You cannot use these system defined variables in the user program It is used only to monitor the status of data tracing from the Sysmac Studio Data type Structure sTRACE_STA Members BOOL Range of values TRUE or FALSE Usage in user program Not possible Related instruc You can access this variable from the user program only with the following tions instruction e GetTraceStatus Functional Classification Errors Variable name _PLC_ErrSta Meaning PLC Function Module Error Status Global local Global Function TRUE when there is a Controller error that involves the PLC Function Module FALSE when there is no Controller error that involves the PLC Function
362. gram select a section e Global variables i Application To change a user program without stopping the operation of the CPU Unit i Sysmac Studio Operations Performing Online Editing 1 Select the item to edit online 9 34 NJ series CPU Unit Software User s Manual W501 9 CPU Unit Functions Select Online Edit from the Project Menu Make the required changes Select Online Edit Transfer from the Project Menu Check the results QOOQAG N The user program will begin operation after online editing Execute online editing only after confirming that no adverse effects will occur if the I O timing is disrupted If you perform online editing the task execution time may exceed the task period I O may not be refreshed with external devices input signals may not be read and output timing may be changed H Precautions for Correct Use If the power supply to the Controller is interrupted when online edits are being saved a major fault level Controller error User Program Controller Configurations and Setup Transfer Error Non volatile Memory Restored or Formatted occurs If this error occurs download the user pro gram again Online edits are saved from when you click the Yes Button in the confirmation dialog box until you leave the Online Editing Pane Restrictions to Online Editing Internal Status of Differentiated Instructions The differentiation status of differentiated instructions in a
363. h a grounded metallic object in order to discharge any static build up Install the Controller away from sources of heat and ensure proper ventilation Not doing so may result in malfunction in operation stopping or in burning An I O bus check error will occur and the Controller will stop if an I O Connecting Cable s connector is disconnected from the Rack Be sure that the connectors are secure Do not allow foreign matter to enter the openings in the Unit Doing so may result in Unit burning electric shock or failure Do not allow wire clippings shavings or other foreign material to enter any Unit Otherwise Unit burning failure or malfunction may occur Cover the Units or take other suitable countermeasures especially during wiring work For EtherCAT and EtherNet IP use the connection methods and cables that are specified in the NJ series CPU Unit Built in EtherCAT Port User s Manual Cat No W505 and the NJ series CPU Unit Built in EtherNet IP Port User s Manual Cat No W506 Otherwise communications may be faulty Use the rated power supply voltage for the Power Supply Units Take appropriate measures to ensure that the specified power with the rated voltage and frequency is supplied in places where the power supply is unstable Make sure that the current capacity of the wire is sufficient Otherwise excessive heat may be gener ated When cross wiring terminals the total current for all the terminals will flow in t
364. he minimum value that can be expressed in the floating point format e f an overflow occurs and the true value is positive the result of the calculation is positive infinity If the true value is negative the result of the calculation is negative infinity e f an underflow occurs and the true value is positive the result of the calculation is positive zero If the true value is negative the result of the calculation is negative zero Special Value Calculations Calculations that involve special values i e positive infinity negative infinity 0 O and nonnu meric data are performed according to the following rules e Addition of positive and negative infinity results in nonnumeric data e Subtraction of two infinite values of the same sign results in nonnumeric data e Multiplication of 0 or 0 with infinity results in nonnumeric data e Division of 0 by itself O by itself or infinity by itself results in nonnumeric data e Addition of positive and negative zero results in positive zero e Subtracting 0 from itself or O from itself results in 0 e Any arithmetic that involves nonnumeric data results in nonnumeric data e Comparison instructions such as for the Cmp instruction treat O and 0 as equal e f you compare nonnumeric data with anything else the result is always not equal p rf S Z D ea D N Text String Data Format All STRING variables are terminated with a NULL character character
365. he specified gear ratio is performed between a operation master axis and slave axis Positioning A gear motion with the specified gear ratio and sync position is per Single axis gear operation formed between a master axis and slave axis synchronized 3 control Ending gear The specified gear motion or positioning gear motion is ended operation Synchronous Positioning is performed in sync with a specified master axis positioning Master axis The phase of a master axis in synchronized control is shifted phase shift Combining The command positions of two axes are added or subtracted and the axes result is output as the command position Single axis Powering the The Servo in the Servo Drive is turned ON to enable axis motion manual Servo operation Jogging An axis is jogged at a specified target velocity A 10 NJ series CPU Unit Software User s Manual W501 Appendices Item NJ501 Resetting axis Axes errors are cleared errors A motor is operated and the limit signals home proximity signal and home signal are used to define home High speed Positioning is performed for an absolute target position of 0 to return to homing home Stopping An axis is decelerated to a stop at the specified rate immediately An axis is stopped immediately stopping Setting The target velocity of an axis can be changed override factors Changing the The command current position or actual current position of an axis can Auxili
366. he specified ranges may cause accidents or fire Downloading Always confirm safety at the destination before you transfer a user program configuration data setup data device variables or values in memory used for CJ series Units from the Sysmac Studio The devices or machines may perform unexpected operation regardless of the operating mode of the CPU Unit NJ series CPU Unit Software User s Manual W501 Safety Precautions A Caution Application Do not touch any Unit when power is being supplied or immediately after the power supply is turned OFF Doing so may result in burn injury Wiring Be sure that all terminal screws and cable connector screws are tightened to the torque specified in the relevant manuals The loose screws may result in fire or malfunction Online Editing Execute online editing only after confirming that no adverse effects will be caused by deviations in the timing of I O If you perform online editing the task execution time may exceed the task period I O may not be refreshed with external devices input signals may not be read and output timing may change NJ series CPU Unit Software User s Manual W501 27 Precautions for Safe Use Precautions for Safe Use 28 i Disassembly and Dropping Do not attempt to disassemble repair or modify any Units Doing so may result in malfunction or fire Do not drop any Unit or subject it to abnormal vibratio
367. he variable table specified in the Variable Type Column under the following conditions Variable Name Automatically generated variables device_name Allowed O_port_name The default device names are as follows e For EtherCAT slaves an E followed by a sequential num ber starting from 001 e For CJ series Units the device names start with a J fol lowed by a sequential number starting from 01 Refer to 3 4 7 I O Ports and Device Variables for more information on I O Port Names lf entered manually the variable name is the string you enter Data Type According to the data type of the I O port Allowed AT Specification Device variables for EtherCAT slaves Not allowed ECAT node node_number I O_port_name Device variables for CJ series Units lOBus rack rack_number slot slot_number I O_por t_ name Retain Device variables for EtherCAT slaves Not retained Not allowed Device variables for CJ series Units assigned to the Operating Data CIO Area Not retained Device variables for CJ series Units assigned to the Setup Data DM Area Retained Initial Value None Allowed Constant None Allowed Network Publish Do not publish Allowed Edge None Not allowed Refer to 6 3 4 Attributes of Variables for the meanings of the attributes EN Additional Information e You can specify forced refreshing for I O ports in the I O Map You can force real I O to turn ON or OFF to check the wiring e Y
368. he wire When wiring cross overs make sure that the current capacity of each of the wires is not exceeded Do not touch the terminals on the Power Supply Unit immediately after turning OFF the power supply Residual voltage may cause electrical shock If you use reed switches for the input contacts for AC Input Units use switches with a current capacity of 1 A or greater If the capacity of the reed switches is too low surge current may fuse the contacts NJ series CPU Unit Software User s Manual W501 Precautions for Correct Use j Error Processing e In applications that use the results of instructions that read the error status consider the affect on the system when errors are detected and program error processing accordingly For example even the detection of a minor error such as Battery replacement during operation can affect the system depending on how the user program is written i Unit Replacement e If you replace a CPU Bus Unit or Special I O Unit refer to operation manual for the Unit for informa tion on the data required for individual Units and redo the necessary settings e The absolute encoder home offset is backed up with a Battery in the CPU Unit When you change the combination of the CPU Unit and Servomotor e g when you add or replace a Servomotor define home again To restore the information without changing the CPU Unit Servomotor combination remove the abso lute encoder home offset from the data to re
369. head time B Larger of the EtherCAT slave processing time and the CJ series Unit processing time A I O Refresh Overhead Time As shown by the following table if there are EtherCAT slaves the I O refresh overhead time is 60 us regardless of whether there are CJ series Units If there are only CJ series Units the I O refresh overhead time is 30 us EtherCAT slaves Cu series Units O refresh over head time Present None 60 us p N O e O fet gt Q Q Q LA 5 1 _ O D x m X O c y e gt 3 1 Present 60 us 30 us None B Larger of the EtherCAT Slave Processing Time and the CJ series Unit Processing Time EtherCAT Slave Processing Time I O refresh time for each EtherCAT slave x Number of slaves 70 us However if the above value is negative use 0 us CJ series Unit Processing Time I O refresh time for each CJ series Unit x Number of Units 230 us However if the above value is negative use O us lf more than one of the following CJ series Units is used add 230 us to the above value regardless of the number of Units e CJ1W PH41U Analog Input Unit with Universal Inputs e CJ1W ADO4U Analog Input Unit with Universal Inputs e CJ1W PDC15 Analog Input Unit with Universal Inputs e CJ1W V680C11 ID Sensor Unit e CJ1W V680C12 ID Sensor Unit i I O Refresh Times for Typical EtherCAT Slaves and Units EtherCAT slaves The following
370. hecking to See If the CPU Unit Is Operating cc cccccccccsseeeeeneeeeeeeeeeeeeeeesaaaeeeesseaeeeeseaaees 12 11 12 2 2 Troubleshooting Flowchart for Non fatal Errors ccccccccsseseeeceseneeeeceaeeeeeeeeaeeeeeeesaeeeseseaaees 12 12 1223 SIO TAD unore E E EE Aaa 12 12 12 2 4 Error DESCIDOMSixceseancecntsanncaatedeeandecasenecssorsacteasssteaanene Mamaansconcsmsenedanetaaedaatatsadiooanntesaateacnieeoaces 12 17 12 2 5 Troubleshooting Errors That Are Not in the CPU Unit 0 0 e ee eeeeeeeeeeeeeeeaeeeeeeeeeeaeeaaees 12 36 Appendices AT SPECINCAUOMNS siori a aeaa a a eaaa a a NAE A 3 A 1 1 General SPECICATION saersi isn n e E E A 3 A 1 2 Pertormance SpeciliCaliOns csse m teal numeri aaseo see en ese eee A 4 A 1 3 FUNCION SOCCINCALIOINS lt 5 3o 8 a as cee cael clue ce SAR Sasa a A 8 A 2 Calculating Guidelines for Task Execution Times cccsecceceeeeeeeeeeeeneeeeeeeneeeseeeneeeeeneneees A 16 A 2 1 Calculating the Average Task Execution TiIME S ccccccccseeeeeeeeeeeeeeeeeeeeeeesaaneeeeeeesaaaeeeeeeeaaas A 16 A 2 2 Example of Calculating the Average Task Execution Time and Setting the Task Period A 24 A 3 System denined Variables xsia a a aeaa a aaa deur aaa A 26 A 3 1 System defined Variables for the Overall NJ series Controller No Category ccccceeee A 26 A 3 2 PLC Function Module Category Name _PLC cccccceccecccssseeeeeeeeeeeeeceaeeeeeeseeeeeeeeaeeeeesenaaes A 30 A 3 3 PLC Fu
371. hed Usage in user program Related instruc tions NJ series CPU Unit Software User s Manual W501 A 69 a w Oo D z O ot O 5 o O 5 a Q v w lt m mp D F Q D h 5 D Q S 9 o D o Asobeyeg ajnpoyy uopuny dlA2N1943 9 7 V dlg swen Appendices Variable name _EIP_EtnCfgErr Meaning Basic Ethernet Setting Error Global local Global Function TRUE The Ethernet communications speed setting Speed Duplex is incorrect Or a read operation failed FALSE Normal Data type BOOL Range of values TRUE or FALSE Usage in user program Related instruc tions Variable name _EIP_IPAdrCfgErr Meaning TCP IP Basic Setting Error Global local Global Function TRUE e There is an illegal IP address setting e A read operation failed e The IP address obtained from the BOOTP server is inconsistent e The DNS settings are not correct FALSE Normal Data type BOOL Range of values TRUE or FALSE R W access R ss Retained Not retained Network Publish Published Usage in user program Related instruc tions Variable name _EIP_IPAdrDupErr Meaning IP Address Duplication Error Global local Global Function TRUE The same IP address is assigned to more than one node FALSE Other than the above Data type BOOL Range of values TRUE or FALSE Usage in user program Related instruc tions Variable name _EIP_BootpErr Meaning BOOTP Server Error Global local G
372. hen Safe Mode was set on the DIP switch on the CPU Unit If the Controller starts in Safe Mode the user program is not executed even if the startup mode is set to RUN mode None NJ series CPU Unit Software User s Manual W501 12 Troubleshooting Event name Event Log Restoration Error 10230000 hex Meaning Restoring the event log failed Source PLC Function Module Source details None Detection At power ON or timing Controller reset Not affected However the past event log cannot be checked Error attributes Effects eee es ee 3 c ereo A low battery voltage prevented reten Replace the Battery Replace the battery periodically S tion of memory during a power inter e ruption a Attached Attached information 1 Error Details 0 Failure to restore all categories of logs 1 Failure to restore system event log information 2 Failure to restore access event log 100 Failure to restore user defined event log Precautions None Remarks Event name Trace Setting Transfer Failure 10260000 hex Meaning The power supply was interrupted while transferring the trace settings Source PLC Function Module Source details None Detection At power ON or timing Controller reset Error attributes Log category System a i pa D m O UO 4D N O zZ O O 5 o Level Observation Recovery Cycle the power supply or reset the Controller G we o a e_O while transferring the trace settings while
373. hing change to RUN mode and then use the Sys mac Studio to perform the operation for forced refreshing Depending on the difference in the forced status the control system may operate unexpectedly e Do not specify the same address for the AT specification for more than one variable Doing so would allow the same entity to be accessed with different variable names which would make the user program more difficult to understand and possibly cause programming mistakes i General Communications e When you use data link communications check the error information given in the status flags to make sure that no error has occurred in the source device Write the user program to use the received data only if there is no error If there is an error in the source device the data for the data link may contain incorrect values e Unexpected operation may result if inappropriate data link tables are set Even if appropriate data link tables have been set confirm that the controlled system will not be adversely affected before you transfer the data link tables The data links start automatically after the data link tables are trans ferred e All CPU Bus Units are restarted when routing tables are transferred from Support Software to the CPU Unit Restarting these Units is required to read and enable the new routing tables Confirm that the system will not be adversely affected by restarting before you transfer the routing tables e Tag data links will st
374. hysical CPU Unit and Operation Es This section describes simulation of Controller operation and how to use the results of simulation T SIMUIAUON 23 eee tek oie neta sents tee oe eee we eae bee ee 7 2 7 1 1 Differences between the Simulator and the Physical CPU Unit 7 3 7 1 2 Simulation Programs 0 cc es 7 3 7 1 3 Executing a Simulation 2 0 ces 7 4 7 1 4 Sysmac Studio Online Operations 0 0 0 ee 7 4 7 1 5 Simulation Debugging 0 eee ees 7 5 7 1 6 Estimation of Execution Times 0 00 c cece eee 7 6 7 1 7 Servo Drive Signal Processing Emulation 0 00000 e eee 7 6 7 2 Transferring the Project to the CPU Unit and Test Run 7 7 7 2 1 Transferring the Project 0 0c ccc eee eens 7 7 f e 2 Checking I O Wining a ccn cater eanieea tweets ened ketene a cones 7 7 2 3 MO Test BUN caret oie ite 6 oie Soo he tee ice ote Sea etade eee etd 7 7 FS Starih OBCrallOn oj coca eae et bare eh ee ee ee Bea eee 7 8 NJ series CPU Unit Software User s Manual W501 7 1 7 Simulation Transferring Projects to the Physical CPU Unit and Operation 7 1 Simulation 7 2 This section describes simulation of the NJ series Controller in the Sysmac Studio Refer to the Sys mac Studio Version 1 Operation Manual Cat No W504 for details The shaded steps in the overall procedure that is shown below are related to the simulat
375. i The sliders on the tops and bottoms of the Power Supply Unit CPU Unit I O Units Special I O sjusuodwOd Ja O1JU0D Buyoeuu0g p Units and CPU Bus Units must be completely locked until they click into place after connecting Icons indicate the adjacent Unit connectors precautions additional information or reference information amp 05 M a n u al n am e NJ series CPU Unit Hardware User s Manual W500 This illustration is provided only as a sample It may not literally appear in this manual Special Information Special information in this manual is classified as follows Precautions for Safe Use ek Grae a Precautions on what to do and what not to do to ensure safe usage of the product A Precautions for Correct Use Precautions on what to do and what not to do to ensure proper operation and performance EN Additional Information Additional information to read as required This information is provided to increase understanding or make operation easier Note References are provided to more detailed or related information 8 NJ series CPU Unit Software User s Manual W501 Manual Structure Precaution on Terminology In this manual download refers to transferring data from the Sysmac Studio to the physical Controller and upload refers to transferring data from the physical Controller to the Sysmac Studio For the Sysmac Studio synchronization is used to both upl
376. iables and 3 4 2 Registering Device Variables for details Variable 2 10 NJ series CPU Unit Software User s Manual W501 2 CPU Unit Operation Using User defined Variables to Specify Memory Area Addresses You use user defined variables to specify memory area addresses that are assigned to Special Units The address to access is specified with an AT specification CPU Unit Example DeviceNet Unit User defined Variables Words and Bits in Memory Used for CJ series Units Addresses in memory for CJ series Units are Example Fixed allocations l l specified with AT for remote I O Fixed Allocations for ON N S p D ea D N D 5 Q specifications Remote I O 5 Variable 3200 00 Variable 3201 00 You use user defined variables to specify the memory area addresses for Special Units e Addresses in fixed allocations for DeviceNet Units e Addresses in user specified allocations for DeviceNet Units from the CX Integrator e Addresses in expansion memory for High speed Counter Units e Addresses in expansion memory for Analog I O Units Refer to 6 3 8 Variable Attributes for information on the AT Specification attribute sjuewuUbIssy O pUe SeiqeueA Z Z Z EN Additional Information The Network Publish attribute for user defined variables that are used for tag data links for Ether Net IP must be set to Input or Output Refer to 6 3 8 Variable Attributes for information on the Network Publish attribute NJ serie
377. iables indicate the unit numbers of the applicable Units If you change the Restart Flag to TRUE with an instruction the restart process begins from refresh processing in the next task period The Special I O Unit is restarted when the BOOL TRUE or page A 58 corresponding variable changes to TRUE It FALSE is changed to FALSE by the system after the Special I O Unit is restarted The numbers in the variables indicate the unit numbers of the applicable Units If you change the Restart Flag to TRUE with an instruction the restart process begins from refresh processing in the next task period TRUE when the parameters of the specified BOOL TRUE or page A 59 port are being changed TRUE when the FALSE Change Serial Communications Parameter SerialSetup instruction is being executed FALSE after the parameters are changed Baar BOOL TRUE or page A 59 It is also possible for the user to indicate a FALSE change in serial port settings by turning ON the corresponding flag through the execution of an instruction or a user operation NJ series CPU Unit Software User s Manual W501 A 3 4 Appendices Motion Control Function Module Category Name _MC Functional Classification Motion Control Functions Variable name Shows the status of errors that are detected in the Motion Control Function Module _MC_ErrSta Motion Control Function Module Error Status You can use this variable directly in the user
378. iate stop signal and interrupt input signal A 12 NJ series CPU Unit Software User s Manual W501 Appendices Item NJ501 Use one of the following procedures e Creating the Unit configuration offline with Sysmac Studio e Creating the Unit configuration online by reading the actual Unit con figuration with the Sysmac Studio Number of Units 40 Chattering and Input response times are set noise counter 1 0 allocations CJ series Units measures Unit I O Basic I O Units Load short cir Alarm information for Basic I O Units is read manage cuit protection ment and I O disconnection detection A Special Unit Special Units can be set up with Unit settings from the Sysmac Studio Special Units l l Setup or by setting device variables Number of slaves 192 EtherCAT Chattering and Input response times are set slaves Basic I O noise counter measures i A port for communications with vari kin f rt Software run Peripheral USB port port for communications arious kinds of Support Softwa ning on a personal computer Programless cyclic data exchange is performed with the devices on Tag cata inks the EtherNet IP network Message com CIP commands are sent to or received from the devices on the Ether munications Net IP network Socket Data is sent to and received from any node on Ethernet using the UDP services or TCP protocol Socket communications instructions are used Ether CIP communi ETP EENI
379. ibute Check Box and down load the user program e When a major fault level Controller error occurs NJ series CPU Unit Software User s Manual W501 6 53 6 Programming 6 54 You can set an initial value for a variable in advance so that you do not have to write a program to initial ize all of the variables For example you can preset data such as a recipe as initial values You do not have to set any initial values Types of Variables That Can Have Initial Values You can set initial values for only some types of variables A list is provided below Type of variable Initial Value Global variables Supported Internal variables Input variables Output variables Return values of functions Not supported In out variables External variables Enabling an Initial Value You can specify whether a variable has an initial value when you create the variable Initial Value Specified Initial value O Initial value Blank No Initial Value Specified Initial value None The following table shows the variables for which you can set an initial value Type Basic data type variables Enabling an Initial Value Supported l Arrays Supported Array variables Not supported l Supported Structure variables Not supported i Not supported initial values are always 0 Union variables eee word Initial values are always O Enumerated variables Supported POU instances Not supported When Initial Valu
380. ic task they can be started at the same time This is the same as controlling more than one axis in the primary periodic task Motion control instructions Start commands are output at the same time Motion control instructions Motion control instructions 5 32 NJ series CPU Unit Software User s Manual W501 5 Designing Tasks EN Additional Information Reference Reading the Values of Axis Variables in the Priority 16 Periodic Task e If an axis variable is read in the priority 16 periodic task the most recent values of the axis variable when the program execution for the priority 16 periodic task started are read These values show the results of motion control processing in the immediately proceeding primary periodic task e Values are not written to axis variables when motion control instructions are executed in the priority 16 periodic task They are written in the motion control processing MC section of the next primary periodic task Primary period t a Primary UPG Y c periodic task i Priority 16 bas ee periodic task ataeeues They are written in the motion control A Motion control instructions processing section in the next primary ts executed periodic task The most recent values of the axis variables are read at the start of execution of the programs in the priority 16 periodic task soul suods y C pue ajdwexy ubiseg yseL s e
381. ications Item Specification Data types that can be specified Classification Data type Usage for members Basic data Boolean and bit strings Supported types BOOL and bit string data array specifications Supported Derivative data Array specification for structures unions and Not sup types enumerations ported POU instances Sorp ported Number of mem 4 max bers Setting initial val Not supported Always zero ues Restrictions e The initial values for unions are always zero e You cannot move unions e You cannot specify unions for parameters to POUs i Enumerations ENUM An enumeration is a derivative data type that uses text strings called enumerators to express variable values To use an enumeration you must first set the values that can be obtained from that variable as enumerators text strings Use enumerations to make it easier for humans to understand the meaning behind the values of a variable p amp S Z D ea D N Expressing Enumerations When you define an enumeration you must define the possible values of the variable as enumera tors and give the enumeration a name sodA geq SANeAUEG 9 9 Creating Enumerations 1 Create an enumeration data type in the Enumeration Table Set the enumerators and their values for the enumeration 2 Specify the enumeration data type from above as the data type and register the variable in the variable table Example Here
382. ick Axis Settings under Configurations and Setups Motion Control Setup and select Add Axis Settings from the menu 2 Assign Servo Drives to the axes axis variables that you created in the EtherCAT configuration new_NJ501_0 v ilii i gt 32 EtherCAT es CPU Expansion Racks I O Map gt amp Controller Setup wv amp Motion Control Setup V amp Axis Settings MC_Axis000 0 ee OOOeeerrrrrrrr itisSCSCSCSCSCsSQS uuu Axis use Used axis v7 Axis type Virtual servo axis v Feedback control Input device Output device Detailed Settings F Data Trace Settings gt Programming ch e Set the Axis Use parameter to Used Axis e Set the Axis Type parameter to Servo Axis e Set the Input Device parameter to the Servo Driver that you registered in the slave configura tion Set the other parameters such as the Unit Conversion Settings and Operation Settings NJ series CPU Unit Software User s Manual W501 11 7 h ool I N O lt p lt p e gt D m x lt Q 3 3 D u O O D Q c D olpnis oewsAsS y wo SHUII ES GIeMYOS E Z L 11 Example of Actual Application Procedures i Set the Controller Setup and the Special Unit Setup Initial Settings for the PLC Function Module The Controller Setup includes the Startup Mode and other parameters Initial Settings for Special Units Unit Configuration and Setup Set the initial sett
383. ify Initial Settings for the Device Variables of the CJ series Units 1 Use the Sysmac Studio to specify the initial values for the device variables of the CJ series Units CJ2 CPU Unit Hardware User s Manual 4 11 4 Controller Setup 4 12 2 Download the variable table from the Sysmac Studio to the CPU Unit Select the Clear the present values of variables with Retain attribute Check Box 3 Restart the Unit reset the Controller or cycle the power supply to the Controller Method 4 Using Instructions to Set the Device Variables for the CJ series Units 1 Set the values for the device variables for the CJ series Unit at the start of operation from the user program e g use the MOVE instruction and then restart the Unit Example P_First_ RunMode First RUN Peroa pag UINT 16 0101 UnitO_RangeCfg Instance ResetUnit Execute Done UnitNo Busy Error ErrorlD Instance Done pT rr Precautions for Safe Use When you restart a Special Unit after you change the settings confirm the safety of the devices at the connection target before you restart the Unit CS CJ NSJCJ2 Series Instructions Reference Manual W474 4 Controller Setup 4 4 Initial Settings for the Motion Control Function Module This section describes the initial settings that are required for the MC Function Module 4 4 1 Introduction The initial settings for the Motion Control Function Module are called motion control param
384. iguration All vendors New Project A Configurations and Setup _ Groups Node Address Network configuration S Y 33 EtherCAT l gt Nodel RBBD KN gt Node2 R88D KN gt Node3 RB8D KN gt Node4 R88D KN Y CPU Expansion Racks gt m CPU Rack new_NJ501_0 v E003 R88D KNO1L ECT Rev 2 1 R88D KNO1L ECT Rev 2 1 R88D KNO1L ECT Rev 2 1 R88D KNO1L ECT Rev 2 1 amp I O Map gt T Controller Setup gt lt 2 Motion Control Setup amp Cam Data Settings gt Event Settings E Task Settings Data Trace Settings Servo Drives F Frequency Inverter Item name Model Product name Number of Slaves PDO Communications Cycle Time Total Cable Length Fail soft Operation Setting Wait Time for Slave Startup PDO communications timeout detection count Revision Check Method j Serial Number Check Method ee ere pean S i RESD KNOIL ECT GS Series Se R88D KNO2H ECT Rev 2 1 RSSD KNO2H ECT G5 Series Se R88D KNO2L ECT Rev 2 1 RSSD KNO2L ECT G5 Series Se R88D KNO4H ECT Rev 2 1 RS8D KNO4H ECT G5 Series Se Procedure to Delete Slaves in the Topology Display 1 Right click the slave to delete and select Delete from the menu The slave is deleted Procedure to Copy and Paste Slaves in the Topology Display 1 Right click the slave to copy and select Copy from the menu 2 Right click the slave to connect it to and select Paste from the menu The slave is
385. ilding standards Applicability to the ship building standards is based on certain usage conditions It may not be possible to use the product in some locations Contact your OMRON representative before attempting to use a Controller on a ship i Usage Conditions for NK and LR Shipbuilding Standards e The NJ series Controller must be installed within a control panel e Gaps in the door to the control panel must be completely filled or covered with gaskets or other material e The following noise filter must be connected to the power supply line Noise Filter Manufacturer Model Cosel Co Ltd TAH 06 683 Trademarks e Sysmac and SYSMAC are trademarks or registered trademarks of OMRON Corporation in Japan and other countries for OMRON factory automation products e Windows Windows 98 Windows XP Windows Vista and Windows 7 are registered trademarks of Microsoft Corporation in the USA and other countries e EtherCAT is a registered trademark of Beckhoff Automation GmbH for their patented technology e The SD logo is a trademark of SD 3C LLC SS P Other company names and product names in this document are the trademarks or registered trade marks of their respective companies Software Licenses and Copyrights This product incorporates certain third party software The license and copyright information associ ated with this software is available at http www fa omron co jp nj_info_e 38 NJ series CPU Unit Software User
386. imaryTask Task Execution Time pf gt amp Controller Setup gt i Motion Control ef Cam Data Settin Task execution count 2547 times Average Estimation 355us Max Estimation 484us Set periodi 1000us Period exceeded gt Event Settings ie Task Settings FA Data Trace Settir 484 us System common processing HO refresh Execution of user program Motion Control Real processing time of tasks YF Programming AR System service execution ratio 10 Estimated CPU usage rate 58 v amp POUs v ia Programs Reset Expanded number of I O points for CJ series Unit Y ProgramO Section Functions S Function Bloc gt Data gt Po Tasks You can emulate the signal processing of the Servo Drive and move the Servo axes in the Simulator with actual axis settings This provides virtual outputs of the Servo status and other signals e g wait ing for in position state signal and Servo ON signal to perform a simulation without changing the pro gram 7 6 NJ series CPU Unit Software User s Manual W501 7 Simulation Transferring Projects to the Physical CPU Unit and Operation 7 2 Transferring the Project to the CPU Unit and Test Run This section describes how to use the Sysmac Studio to transfer the user program to the physical CPU Unit and perform an MC Test Run 7 2 1 Transferring the Project Use the Sysmac Studio to transfer the project to the physical Controller 1 Go online with the Controller and then
387. imum number of elements 65 535 Array Supported Execution of multiple instances is possible with one specifications instance by using a variable to indirectly specify an array element num for FB ber instances Initial values attribute A 8 NJ series CPU Unit Software User s Manual W501 Appendices ltem NJ501 BOOL BYTE WORD DWORD LWORD INT SINT DINT LINT Basic data types UINT USINT UDINT ULINT REAL LREAL TIME durations DATE TIME_OF_DAY DATE_AND_TIME and STRING text strings Derivative data types data Derivative data types Structures unions and enumerations A derivative data type that groups together data with different data types Number of members 2 048 max Nesting levels 8 max Member data Basic data types structures enumerations unions or array variables Data types types gt os p Oo 2 Program 9 ming D A derivative data type that enables access to the same data with differ ent data types Number of members 4 max Member data BOOL BYTE WORD DWORD or LWORD types A derivative data type that uses text strings called enumerators to Enumerations express variable values An array is a group of elements with the same data type You specify Array the number subscript of the element from the first element to specify specifications the element You can specify arrays for both basic data types and Data type derivative data types attributes
388. in System Common Processing 1 TRUE is obtained for Sensor7 2 SysRun is changed to TRUE in the user program 3 In data trace processing in System Common Processing 1 in the next primary period TRUE is obtained for SysRun NJ series CPU Unit Software User s Manual W501 9 CPU Unit Functions Therefore in the data trace display SysRun is shown as TRUE one task period after Sensor7 Data Trace Display TRUE So 7 TRUE tt pe Sensor SysRun gt 1 task period EN Additional Information If the values of variables change during user program execution the changes in the values and changes for output processing for I O refreshing are changed in the same task period Example 2 When the Button2 variable assigned to an input signal from a pushbutton changes to TRUE during velocity control the user program in this example decelerates axis 0 WC_Axis000 to a stop IF Button2 is TRUE then perform deceleration processing Button2 MC_AxisO00 Axis Execute Done LREAL 100 0 Deceleration Busy STP_BSY LREAL 0 0 Jerk Active iter Vorigble BufferMode CommandAborted Axis AWiC_Axis000 CAS YoOriane The data trace operations and display of the execution results are given below 1 In data trace processing in System Common Processing 1 TRUE is obtained for Button2 2 STP_BSY is changed to TRUE in the user program and the Motion Control Function Module per forms deceleration
389. ing forced values in the user program Example When a Is Refreshed to TRUE with Forced Refreshing TRUE for forced refreshing but When FALSE FALSE in the user program X a ais FALSE in the program When the output is refreshed information from forced OFF refreshing is reflected and the external output of a is TRUE a g D o re Q 5 _ m Caa External output _ ofa TRUE _ ae a When FALSE TRUE for forced refreshing but FALSE in the user program n X FF a e ais FALSE in the program Because of this bis FALSE OFF e When the output is refreshed information from forced P refreshing is reflected and the external output of a is i a aa l O TRUE OFF a T lean an eae naa nO OFF External output lofa TRUE 7 ais FALSE in the program As a result bis FALSE 8 Guiys 1 H p 0104 9 6 _ _ cc za NJ series CPU Unit Software User s Manual W501 9 31 9 CPU Unit Functions Precautions for Safe Use e Confirm that no adverse effect will occur in the system before you use forced refreshing e Forced refreshing ignores the results of user program execution and refreshes I O with the specified values If forced refreshing is used for inputs for which I O refreshing is not sup ported the inputs will first take the specified values but they will then be overwritten by the user progr
390. ing procedures that are required up through actual program development This section describes manual operation when the MC Function Module is used together with an OMRON G5 series Servo Drive This section describes homing This section describes the motion control functions that are used when connected to OMRON G5 series Servo Drives with built in EtherCAT communications This section describes basic application methods for homing error monitoring and other functions and provides programming samples for absolute positioning cam operation and other axis operations This section describes the items to check when problems occur in the MC Function Module It includes error diagnosis and countermeasures for error indications and error diagnosis and countermeasures for operating conditions The appendices describe settings and connection methods for OMRON G5 series Servo Drive objects i NJ series Instructions Reference Manual Cat No W502 Section Section 1 Instruction Set Section 2 Instruction Descriptions Appendices Description This section provides a table of the instructions that are described in this manual This section describes instruction specifications in detail The appendices provide a table of error codes and other supplemental information to use instructions NJ series CPU Unit Software User s Manual W501 Manual Configuration NJ series CPU Unit Built in EtherCAT Port User s Manual Cat
391. ings Ethernet settings DHCP settings DNS settings Setup Net IP Port FTP settings NTP settings and SNMP settings Settings The Task Settings contain settings for the task types number of tasks Task Settings task execution conditions task names programs executed in the task and other task settings Axes The Motion Control Setup contains data for the axes and axes groups The axes are assigned to Servo Drive and encoder EtherCAT slaves Control Axes The settings consist of Axis Variables Axes Group Variables and Setup Groups motion control parameter settings The Axis Variables and Axes Group Variables are structure array variables Motion The cam data includes cam tables that consist of phase displacement data for use in cam operation for motion control instructions This data can be read and saved as cam data variables which are structure array variables Cam Data The Event Setting Tables are set to create user defined errors and user defined information Data Trace Settings The Data Trace Settings include settings for trigger conditions Tag Data Link Tables The Tag Data Link Tables contain the tag data link settings for Ether Net IP tags tag sets and connection information Event Setting Tables 2 18 NJ series CPU Unit Software User s Manual W501 2 CPU Unit Operation Variables without a The Variable Memory contains the present values of variables that do Not Pee Retain attribute not have
392. ings of the Analog Input Unit 11 2 4 Programming with the Sysmac Studio On the Sysmac Studio create the programs set the tasks and build the project i Write the Programs Right click Programs under Programming POU and select Add Ladder or Add ST from the menu Double click Section under the program that you registered Register the local variables for each program NON Enter the programs New Project uae _ o p Toolbox E Programming feoeo sear a Bg new_NJ501_0 v i z gt Configurations and Setup Data Type Initial Value AT Retain Constant BOOL va BOOL BOOL Data Type Canvasna gt FS v Ladder Tools Create a program with the following instructions e Homing MC_Home instruction e Velocity control MC_MoveVelocity instruction e Interrupt feeding MC_MoveFeed instruction e Positioning MC_Move instruction 5 As required right click Functions or Function Blocks under Programming POU and select Add Ladder or Add ST from the menu Double click the function or function block that you registered Register local variables for each function and function block Create the algorithms Note For a ladder diagram press the R Key and create the following rungs 11 8 NJ series CPU Unit Software User s Manual W501 11 Example of Actual Application Procedures i Set Up the Tasks Double click Task Setup under Configurations and Setu
393. interfaces used by the CPU Unit to exchange data with external devices I O ports C O ports SO QEWEA 3A PUB SHOd O I b v Outside of the CPU Unit EtherCAT CJ series slaves Units I O ports are automatically registered in the I O Map when you create the EtherCAT Slave Configuration or Unit Configuration in the Sysmac Studio or when you read either of these configurations from the physical Controller from the Sysmac Studio You can check the I O ports that were registered in the I O Map of the Sysmac Studio I O Map Beet Configurations and Setup new_NI501 0 v ETN Pos Port Description R W Data Tyf Variable Variable Comment Msa eane Racks gt 2 EtherCAT CF sw CPU Rack 0 gt CPU Eqpansion Racks 0 v CJiW 0D232 Transistor Outpt I O Map Cchi_Out Output CH1 gt FA Controller Setup Chi_Out00 Output CH1 bit 00 Pe gt 3 Motion Control Setup Chi_Out01 Output CH1 bit 01 poi_chi_Outoif ooo Cam Data Settings ae Chi_Out02 Output CH1 bit 02 PY gt Event Settings T Chi_outo3 Output CH1 bit 03 poi_chi_outa3 SCS I Task Settings Chi_Outo4 Output CH1 bit 04 a M7 Data Trace Settings Chi_Out05 Output CH1 bit 05 boi_chi_Out0ds a O Chi_Out0d6 Output CH1 bit 06 O1_chi_outo6f i ssid Chi_Out07 Output CH1 bit 07 po1_chi_outo7 ooo Er Chi_Outos Output CH1 bit 08 es Chi_outo9 Output CH1 bit 09 por_chi_outogp SS Chi_Out10 Output CH1 bit 10 po1_chi_
394. ion Step 1 Software Design Step 1 1 Designing I O and Processing Step 1 2 Designing Tasks Step 1 3 Designing Programs Step 2 Software Setups and Programming Step 2 1 Slave and Unit Configurations Step 2 2 Controller Setup Step 2 3 Programming Step 2 4 Offline Debugging Step 3 Mounting and Setting Hardware Step 4 Wiring Step 5 Confirming Operation and Starting Actual System Operation Refer to 1 3 Overall Operating Procedure for the NJ series Controller for details You can simulate the following operations of the NJ series Controller on the Sysmac Studio e Simulation Program e Executing simulations Simulations use a virtual controller that has the same functions as the physi cal CPU Unit e Debugging e Simulation Monitor e Estimation of Execution Times e Servo Drive Signal Processing Emulation NJ series CPU Unit Software User s Manual W501 7 Simulation Transferring Projects to the Physical CPU Unit and Operation 7 1 1 Differences between the Simulator and the Physical CPU Unit The differences between the functions of the Simulator and the physical CPU Unit are given below according to the divisions of test functions Algorithm verification e Data monitoring Simulation provides more functions Normal operation 3D motion monitoring such as step execution Operation for errors Debugging Checking task execution times Task execution time monitoring You can see only the execution time
395. ion Buffer Ether Memory All few examples are pro trol Function Module Net IP Func Clear vided here Module Analog Input tion Module Refer to the NJ series Communica Disconnection Troubleshooting Manual tions Control Detected CJ Cat No W503 for a ler Error series Unit complete list of errors EtherCAT Low Battery Master Func Voltage PLC tion Module Function Mod ule PWR Lit Lit Lit Lit Lit green beds ngi RUN Lit Lit Lit Lit cators green ERROR Lit red NJ series CPU Unit Software User s Manual W501 Flashes at 1 s Flashes at 1 s Not lit Not lit intervals intervals 12 5 ob N I oh O e m _ mp m oO YUN Md U 10149 e e UON 1 Zh 12 Troubleshooting Event level Item RUN out put on Power Supply Unit User pro gram exe cution status Operation of NJ series CPU Unit oe Event logs Outputs from EtherCAT slaves and Basic Out put Units Sysmac Studio display while online turned oe Not possible Recorded Some errors are not recorded Refer to the O Operation for a Major Fault Level Controller Error on page 12 7 Error messages are automatically displayed You can display detailed information in the Troubleshooting Dia log Box nature of the error Recorded e Errors in Controller infor mation Major fault level ates ue Minor fault level Informa
396. ion blocks and functions in NJ series Instructions Ref the required languages erence Manual Cat No W502 and NJ series Motion Control Instructions Reference Manual Cat No W508 3 Setting the Tasks Making task settings Configurations and 4 2 3 Task Settings Setup Task Settings Step 2 4 Checking the algorithms and task execu Section 7 Simulation Trans Offline Debugging tion times on the Simulator virtual control ferring Projects to the Physi ler cal CPU Unit and Operation Step 3 Mounting and Setting Hardware 1 Mounting Sonne ng adjacent niie 4 3 Mounting Units in NJ e Mounting to DIN Track series CPU Unit Hardware User s Manual Cat No W500 e Setting the node addresses of the EtherCAT slaves Operation manuals for the e Setting unit numbers on the rotary switches on the front of the Spe EtherCAT slaves and Spe cial Units cial Units 2 Setting Hardware NJ series CPU Unit Software User s Manual W501 1 11 19 01 U04 S H S fN U 10 INp JOld Huljes9do Ilea E L I N U x Q O D Q Cc O J O D o 1 Introduction Step 4 Wiring Step 1 Connecting Ethernet Cable 2 Wiring I O 3 Connecting the Computer That Runs the Sysmac Studio e Connecting the built in EtherCAT port Connecting the built in EtherNet IP port Wiring I O to EtherCAT slaves Wiring Basic I O Units and Special Units Checking wiring Connecting USB Cable Connectin
397. ion con Number of instructions 5 000 figuration Arithmetic instructions for Number of instructions 200 LREAL data Trigonometric instructions Number of instructions 100 for LREAL data Motion control pro Number of axes 4 cessing I O Refresh Time e I O Refresh Overhead Time 60 us e EtherCAT slave processing time 1 5 1 5 6 x 4 us 70 us 27 us 70 us 43 us Therefore O us is used e CJ series Unit processing time 1 1 24 24 2 5 230 us 52 5 230 us 177 5 us Therefore O us is used Therefore the I O refresh time is 60 us 0 us 60 us User Program Execution Time The graphs show the following values e Standard instruction configuration 5 000 instructions 100 us e Arithmetic instructions for LREAL data 200 instructions 175 us e Trigonometric instructions for LREAL data 100 instructions 220 us The total is 495 us Motion Control Processing The graphs show 25 us for four axes A 24 NJ series CPU Unit Software User s Manual W501 Appendices Common Processing Time This is the primary periodic task so the common processing time is 265 us Therefore i Setting the Task Period The task period is set based on the average value of the task execution time Average task execution time 845 us lt Task execution time x 0 9 A task period of 1 ms satisfies the above formula The execution times in the physical Controller depends on
398. ion control instructions the values of input parameters are passed to the input variables when execution of the function block starts and the values of the output variables are passed to the output parameters when execution of the function block ends Refer to Variable Designations for Function Blocks on page 6 11 On the data trace displays input parameters and input variable and output parameters and output variables change in the same task period g Related System defined Variables Variable name _ Member Description Data type _PLC_TraceSta 0 3 lsStart Trace Busy Flag TRUE when a trace starts BOOL isComplete Trace Completed TRUE when a trace is completed BOOL Flag Changes to FALSE when the next trace starts ls Trigger Trace Trigger Mon TRUE when the trigger condition is met BOOL itor Flag Changes to FALSE when the next trace starts ParamErr Trace Parameter Changes to TRUE when a trace starts if there BOOL Error Flag is an error in the trace settings FALSE when the settings are normal You cannot use these system defined variables in the user program Use the GetTraceSta instruction to read the status of data trace from the user program 9 40 NJ series CPU Unit Software User s Manual W501 9 CPU Unit Functions Overview of Data Trace Procedure Use the following procedure to execute a data trace 1 Start the Sysmac Studio and create a project 2 Right click Data Trace Settings under
399. ion cycle This is same as the primary periodic task period Sequence control periods periods of primary periodic task and priority 16 periodic task 1 You must use the Sysmac Studio to assign an axis to an EtherCAT slave to control it from the Motion Control Function Module This allows you to use motion control instructions in the user program to send commands to the Motion Control Function Module and to read information from the Motion Control Function Module You cannot use the Motion Control Function Module to control EtherCAT slaves to which axes are not assigned You must control these slaves directly from the user program 2 The timing of the execution of motion control instructions depends on the task to which the program that con tains the instructions is assigned For details refer to 5 3 4 System Input and Output Response Times NJ series CPU Unit Software User s Manual W501 2 15 2 CPU Unit Operation 2 16 EN Additional Information Instruction Types in Terms of Control Systems In terms of the control systems the instructions can be broadly separated into the following two types of instructions Type of instruction Definition All instructions other than motion These instructions are executed in the user program in the control instructions sequence con PLC Function Module and processing for them is completed trol there Motion control instructions These instructions are executed in the user program in
400. ion is made based on the evaluation of lt initial_value gt lt end_value gt and lt increment decre ment When lt FOR_variable gt is lt initial_value gt lt statement gt is executed After execution the value of lt increment decrement gt is added to lt FOR_variable gt and lt statement gt is executed again if lt FOR_variable gt is less than the value of the lt end_value gt After execution the value of lt increment decrement gt is added to lt FOR_variable gt and lt statement gt is executed again if lt FOR_variable gt is less than the value of the lt end_value gt This process is repeated The loop ends when lt FOR_variable gt gt lt end_value gt If lt increment decrement gt is negative the directions of the comparison symbols in the above state ments are reversed Precautions e If the FOR variable is signed lt increment decrement gt can be a negative number e FOR must always be used together with END_FOR e You cannot use addition or other arithmetic expressions in the lt end_value gt and lt increment dec rement gt e The FOR variable becomes the end value plus increment decrement after execution of the pro cess is completed for the end value This ends the FOR construct Example When the FOR construct is completed in the following ST statements the value of is 101 FOR i 0 TO 100 DO X i 0 END_FOR Here iis 101 a FALSE END_IF NJ series CPU Unit Software User
401. ions and then make sure that functionality is compatible in the slave manuals or other references You can check the actual slave revisions from the Sysmac Studio or on slave nameplates e After you transfer the user program the CPU Unit is restarted Communications with the EtherCAT slaves are cut off for up to 45 seconds During that period the slave outputs behave according to the slave settings Before you transfer the user program confirm that the system will not be adversely affected e If the Fail soft Operation parameter is set to stop operation process data communications will stop for all slaves when an EtherCAT communications error is detected in a slave For this reason if Servo Drives are connected the Servos for all axes will be turned OFF Make sure that the Fail soft Opera tion parameter setting results in safe operation when a device error occurs NJ series CPU Unit Software User s Manual W501 31 Precautions for Safe Use 32 EtherCAT communications are not always established immediately after the power supply is turned ON Use the system defined variables in the user program to confirm that communications are estab lished before attempting control operations lf frames sent to EtherCAT slaves are lost due to noise or other causes slave I O data is not commu nicated and the intended operation is sometimes not achieved If noise countermeasures are required use the _EC_I nDatalnvalid Input Data Disable system
402. ions and Setup are not correct because the power supply to the Controller was interrupted during online edit ing e The user program or Controller Configurations and Setup are not correct because the power supply to the Controller was interrupted during a Clear All Memory operation e Non volatile memory failed e The user program execution yyy page 12 23 IDs set in the user program and PEL EE m in the CPU Unit do not match N 7 e A user program execution ID is set in the CPU Unit but not in the user program aia o DERSE e y page 12 25 ure while transferring the trace settings Clock The clock time was The clock time was changed y page 12 25 Changed changed Time Zone The time zone was _ e The time zone was changed y page 12 26 Changed changed Variable Changing a variable e Changing a variable to TRUE BERRE page 12 26 Changed to to TRUE with forced with forced refreshing was NJ series CPU Unit Software User s Manual W501 10210000 hex Illegal User Program Execution ID The user program execution IDs set in the user program and in the CPU Unit do not match 10240000 hex Illegal User Program The user program is not correct e There are more than 8 nesting levels for functions or function blocks 10250000 hex Illegal User Pro gram Con troller Configura tions and Setup Safe Mode The user program or Controller Con figurations and Setup is corrupted e llegal da
403. it Software User s Manual Cat No W501 Information on the built in EtherNet IP port is provided Information is provided on the basic setup tag data links and other features Use this manual together with the NJ series CPU Unit Hardware User s Manual Cat No W500 and NJ series CPU Unit Software User s Manual Cat No W501 Concepts on managing errors that may be detected in an NJ series Controller and informa tion on individual errors are described Use this manual together with the NJ series CPU Unit Hardware User s Manual Cat No W500 and NJ series CPU Unit Software User s Manual Cat No W501 Describes the operating procedures of the Sys mac Studio Describes operating procedures for the CX Inte grator Describes operating procedures for the CX Designer Describes operating procedures for the CX Pro tocol 43 Terminology Terminology Term absolute encoder home offset array specification AT axes group Axes Group Variable axis Axis Variable basic data type cam data variable CJ series CPU Unit Constant Controller Controller error Controller event Controller information derivative data type device variable download edge 44 Description This data is used to restore in the CPU Unit the actual position of a Servo Drive with an absolute encoder The offset is the difference between the command position after homing and the absolute data that is read f
404. itive software limit Negative software limit Following error over value Following error warning value Y Homing Settings Homing method Zero position preset Home input signal Homing start direction Operation selection at positive limit input teen nee Home input detection direction Operation selection at negative limit input EE Homing velocity Fal Homing approach velocity E C A ed o fo ojo Oo Oo Oo ofo o o o SS S NS o Download the motion control parameters to the CPU Unit to save them in the non volatile memory in the CPU Unit The downloaded settings are enabled when the power is turned ON or a download is per formed g Method 2 Setting with the MC_Write Instruction You can temporarily overwrite some motion control parameters with the MC_Write instruction For details refer to the NJ series Instructions Reference Manual Cat No W502 4 14 CS CJ NSJCJ2 Series Instructions Reference Manual W474 4 Controller Setup 4 5 Initial Settings for the EtherCAT Master Function Module This section describes the initial settings that are required for the EtherCAT Master Function Module The initial settings for the EtherCAT Master Function Module are listed below e Device names e Total Cable Length e Fail soft Operation Settings e Wait Time for Slave Startup e PDO Communications Timeout Detection Count e Revision Check Method e Serial Number Check Method D Q1 5 a w D gt Q A e mp
405. itted the CPU Unit overwrites the oldest events Event type Maximum number of records Controller events 1 024 events User defined events 1 024 events i Retaining Events during Power Interruptions The NJ series CPU Unit uses a Battery to retain the event logs when the power is interrupted Precautions for Correct Use The event logs are retained by Battery They are not retained when there is no Battery Periodically export event logs as required i Event Codes Event codes are assigned to Controller events by the system in advance according to the type of event Event codes are assigned to user defined events by the user Controller event codes are 8 digit hexa decimal values You can use the Get Error Status instruction to read the error codes of current errors You can assign a decimal number from 1 to 60 000 as the event code for a user defined event i Event Levels Each event has an event level that indicates its level The event level depends on the type of event Lev els are defined separately for Controller events and user defined events NJ series CPU Unit Software User s Manual W501 9 45 P fo m lt 5 re O O s o u 4 UO Uuo0lewou psjleleaq z 9 6 9 CPU Unit Functions 9 46 Controller Events Controller events are classified into five levels according to the degree of the effect that the events have on control as shown in the following table Or BR WwW PM No Con
406. iva tive Data Types 6 4 NJ series CPU Unit Software User s Manual W501 6 Programming 6 2 POUs Program Organization Units The user program that runs on an NJ series CPU Unit is made from a combination of POUs program organization units This section describes the configuration and specifications of POUs Refer to the Sysmac Studio Version 1 Operation Manual Cat No W504 for details on creating POUs in the Sysmac Studio 6 2 1 What Are POUS A POU program organization unit is a unit that is defined in the IEC 61131 3 user program execution model A POU includes a local variable table and an algorithm i e a series of code or logic It is the basic unit used to build the user program You combine POUSs to build a complete user program There are three types of POUs as described below e Programs A program corresponds to a main routine It is the main type of POU that is used for algorithms You can place any instruction function or function block in the algorithm of a program Function Blocks FBs A function block can output different values even with the same inputs Function blocks are executed when they are called from a program or another function block Functions FUNs A function always outputs the same values for the same inputs Functions are executed when they are called from a program another function or a function block p N u O C u e Co Q 3 O Q
407. k teamed eee cede 4 5 4 2 4 Unit Configuration and Unit Setup 0 00 4 9 4 3 Initial Settings for Special Units 0 00 cc es 4 11 4 4 Initial Settings for the Motion Control Function Module 4 13 4 4 1 NAPFOGUICTION rete fo cos0 piace tee aol ae tat Stoke Oe etal aes att E ante Geet ete 4 13 4 4 2 Sewing MINGUS 0 dodo ce 2 dete eee ett eae eee eae eee ee aha 4 14 4 5 Initial Settings for the EtherCAT Master Function Module 4 15 4 6 Initial Settings for the EtherNet IP Function Module 4 16 CJ2 CPU Unit Hardware User s Manual 4 1 4 Controller Setup 4 1 Overview of the Controller Setup This section provides an overview of the Controller Setup The shaded steps in the overall procedure that is shown below are related to the Controller Setup Step 1 Software Design Step 1 1 Designing I O and Processing Step 1 2 Designing Tasks Step 1 3 Designing Programs Step 2 Software Setups and Programming Step 2 1 Slave and Unit Configurations Step 2 2 Controller Setup Step 2 3 Programming Step 2 4 Offline Debugging Step 3 Mounting and Setting Hardware Step 4 Wiring Step 5 Confirming Operation and Starting Actual System Operation Refer to 1 3 Overall Operating Procedure for the NJ series Controller for details 4 2 CS CJ NSJCJ2 Series Instructions Reference Manual W474 4 Controller Setup Controller Setup Reference Initial Settings Rela
408. l Target ka DM EM and HR Memory uesd for ha Absolute encoder home offset walu Execution Result Result Successful Failed Item List If the restore operation fails the number of items that were not restored is shown in the Failed Item List Text Box Click the Display Button The names of the data that were not restored are displayed in the Failed Item List 9 60 NJ series CPU Unit Software User s Manual W501 9 CPU Unit Functions EN Additional Information To restore the backup the contents of the NJ series Controller and the project must match If it does not match stop the restore process and synchronize the data to make it match If you replace the Controller you must restore the absolute encoder home offset as well When you replace a Servo Drive you must redefine home in the Controller P N c O gt ce gt g o lt 3 O a c a Oo Oo w fo O an c xe gt a J oO 9 g fe sowan dnyoeg Aseieg JO SonjeA U S ld 94 Punozs y pue dA Buryoeg L 2 6 NJ series CPU Unit Software User s Manual W501 9 61 9 CPU Unit Functions 9 62 NJ series CPU Unit Software User s Manual W501 Communications Setup Ss This section describes how to go online with the CPU Unit and how to connect to other devices 10 1 Communications System Overview 000 e eee ees 10 2 OiT INHOGUCHONE Giertsen a te neta y
409. l W501 6 Programming 6 2 6 Details on Functions g Structure of Functions In a ladder diagram functions are represented as rectangular boxes as shown below Refer to Expressing Functions in ST on page 6 18 for details about how to express functions in ST A function consists of the following parts Function in Ladder Diagram Function name or instruction name EN input ENO output Return value Para1 ret_val Para2 Output1 Input parameters Input variables Output variable Output parameter P N u O C O _ u Oo D 3 O a D N D a e 5 Cc g Function Name or Instruction Name This is the function name or instruction name assigned in the function definition when the function is defined Instance Name Functions do not have instance names Algorithm You can code the algorithm either as a ladder diagram or in ST You can use any instructions func tions or user defined functions in the algorithm of a function You cannot use any FB instructions or user defined function blocks You also cannot use a differentiated instruction e g R_TRIG or UP SUOI OUNS UO Sjlej8eq 9 7 9 Function Local variable table EN Input parameter Output parameter Output variable return value Input In out variable variable Internal variables Algorithm Instructions except for FB instructions FUN NJ series CPU Unit Softwa
410. l macro instruc tions Communications instructions Operation The output on the NJ PLJ3001 Power Supply Unit turns ON in RUN manage RUN output contacts mode ment The following events are recorded System e Events for the operation of the NJ series system itself eee Logman Event logs e Communications events ment agement g 7 e Events for the operation of user designed device applications NJ series CPU Unit Software User s Manual W501 A 13 T h w x D O O D i O 5 T suoeooeds uoouny Y Appendices Item NJ501 lt ne Programs function blocks functions and global variables can be Coline edung changed online The user can force specific variables to TRUE or FALSE Device variables for CJ series Units and variables with AT specifi cations 64 variables max Forced refreshing Device variables for EtherCAT slaves 64 variables max MC Test Run Motor operation and wiring can be checked from the Sysmac Studio eyachronlsin The project file in the Sysmac Studio and the data in the CPU Unit can y g be made the same when online The specified variables are sampled and stored in trace memory when the specified conditions are met No programming is required Data tracing Maximum number of records 10 000 records Maximum number of sampled variables 192 variables Sampling is performed for the specified task period at the specified Timing of sampling time or when a sampling i
411. lated instruc Reset EtherCAT Controller Error tions e ResetECError Variable name _EC_MsgErr Meaning EtherCAT Message Error Global local Global Function TRUE when a message is sent to a slave that does not support messages or when there is an error in the format of the response to a message that was sent to a slave Data type BOOL Range of values TRUE or FALSE Usage in user program Possible Related instruc CoE messages Read CoE SDO tions e EC_CoESDORead CoE messages Write CoE SDO e EC_CoESDOWrite Variable name _EC_SlavEmergErr Meaning Emergency Message Detected Global local Global Function TRUE if the master detects an emergency message that was sent by a slave Data type BOOL Range of values TRUE or FALSE Usage in user program Possible Related instruc Reset EtherCAT Controller Error tions e ResetECError A 64 NJ series CPU Unit Software User s Manual W501 Appendices Variable name _EC_CommeErrTbl Meaning Communications Error Slave Table Global local Global Function Slaves are given in the table in the order of slave node addresses The corresponding slave element is TRUE if the master detected an error for the slave Data type Array 1 192 OF BOOL Range of values TRUE or FALSE R W access Rs Retained Not retained Network Publish Published Usage in user program Possible Related instruc Reset EtherCAT Controller Error tions e ResetECError Note The values of all system defined v
412. les for a CJ1W AD041 V1 Analog Input Unit Chi_PkHdCmd Ch1_AveCfog etc 3 12 NJ series CPU Unit Software User s Manual W501 3 I O Ports Slave Configuration and Unit Configuration Device Variables In an NJ series Controller external devices slaves and Units are not assigned to specific memory addresses in the CPU Unit Rather variables are assigned to the I O ports These variables are called device variables Slave and Unit Configuration I O ports Variables assigned to I O ports Information created created Device variables p A O u O p T D a g lt O D S D 2 N Slave and Unit Configurations I O ports Device variables Assigned ch1_In00 QO lt J01_ch1_Inoo ch1_In01 QO lt Joi chino ch1_In02 C lt Joi ch_no2 i 1 SQA o You can specify device variables in the user program or in external communications to access the devices slaves or Units CPU Unit Variables are assigned to I O ports These variables are called device variables SO QEWEA 9DIABQ PUB SHOd O I b v I O ports I O ports Outside of the CPU Unit General purpose CJ series EtherCAT slaves Units Refer to 2 2 1 Types of Variables for the relationship of device variables to other variables NJ series CPU Unit Software User s Manual W501 3 13 3 I O Ports Slave Configuration and Unit Configuration Device Variable Attributes Device variables are registered in t
413. licable EMC Electromagnetic Compatibility standards are as follows EMS Electromagnetic Susceptibility EN 61131 2 and EN 61000 6 2 EMI Electromagnetic Interference EN 61131 2 and EN 61000 6 4 Radiated emission 10 m regulations Low Voltage Directive Always ensure that devices operating at voltages of 50 to 1 000 VAC and 75 to 1 500 VDC meet the required safety standards The applicable directive is EN 61131 2 Conformance to EC Directives The NJ series Controllers comply with EC Directives To ensure that the machine or device in which the NJ series Controller is used complies with EC Directives the Controller must be installed as fol lows e The NJ series Controller must be installed within a control panel e You must use reinforced insulation or double insulation for the DC power supplies connected to DC Power Supply Units and I O Units e NJ series Controllers that comply with EC Directives also conform to the Common Emission Stan dard EN 61000 6 4 Radiated emission characteristics 10 m regulations may vary depending on the configuration of the control panel used other devices connected to the control panel wir ing and other conditions You must therefore confirm that the overall machine or equipment complies with EC Directives NJ series CPU Unit Software User s Manual W501 37 Regulations and Standards Conformance to Shipbuilding Standards The NJ series Controllers comply with the following shipbu
414. ller 2 Select the Enable the verification of operation authority Check Box and double click Administra tor in the Operation authority Column gt New Password Setting Operation authority Administrator New password O Aouyny uogeiado JO UOedYUeA 1 7 6 New password confirmation a OK Cancel NJ series CPU Unit Software User s Manual W501 9 17 9 CPU Unit Functions 3 Enter the Administrators password in the New password Box Enter the same password in the confirmation box and click the OK Button 4 Set the Maintainer s password in the same way The user can perform operations only if the correct password is entered Setting Description Enable the verification of Select this check box to enable verification of operation authority Set a operation authority password for each operation authority level When the operation lock is enabled operation is locked if you do not per form any actions for the specified period of time when the Sysmac Studio is online To reset the lock enter the password in the Verification of Opera tion Authority Dialog Box that is displayed This prevents an operator with Operation Lock different authority from mistakenly performing operations The operation lock is intended to prevent misuse by operators of different operation authority levels Execution of internal Sysmac Studio operations such as monitoring and transfer processes is still possible even when operation is locked
415. lobal Function TRUE There was a failure to connect to the BOOTP server timeout FALSE The BOOTP is not enabled or BOOTP is enabled and an IP address was normally obtained from the BOOTP server Data type BOOL Range of values TRUE or FALSE Usage in user program Related instruc tions Variable name _EIP_IPRTbIErr Meaning TCP IP Advanced Setting Error Global local Global Function TRUE There is an error in one of the following settings Or a read operation failed e IP router table settings e Hosts settings FALSE Normal Data type BOOL Range of values TRUE or FALSE Usage in user program Related instruc tions A 70 NJ series CPU Unit Software User s Manual W501 Appendices Variable name _EIP_IdentityErr Meaning Identity Error Global local Global Function TRUE The identity information which you cannot overwrite is not correct Or a read operation failed FALSE Normal Data type BOOL Range of values TRUE or FALSE R W access R ss Retained Not retained Network Publish Published Usage in user program Related instruc tions Variable name _EIP_TDLinkCfgErr Meaning Tag Data Link Setting Error Global local Global Function TRUE The tag data link settings are incorrect Or a read operation failed FALSE Normal Data type BOOL Range of values TRUE or FALSE R W access R ss Retained Not retained Network Publish Published Usage in user program Related instruc tions
416. lt condition_expression gt is evaluated again This process is repeated lf the lt condition_expression gt is FALSE lt statement is not executed and the lt condition_expression gt is no longer evaluated p a u Oo D 3 3 5 re D c D Q D N Precautions e WHILE must always be used together with END_WHILE e If the lt condition_expression gt is FALSE before lt statement is executed the WHILE construct is exited and lt statement gt is not executed e You can write lt statement_1 gt and lt statement_2 gt on multiple lines Separate statements with a semicolon e You can execute more than one statement for lt statement gt Separate statements with a semico lon e You can also specify a BOOL variable including functions that return a BOOL value for the condi tion expressions instead of an actual expression ebenbue7 1x9 paunionuis S 9 Example Example 1 The first multiple of 7 that exceeds 1 000 is calculated and assigned to variable A A O WHILE A lt 1000 DO A A INT 7 END_WHILE Example 2 The value of variable X is doubled if X is less than 3 000 and the value is assigned to array variable element DATA 1 Next the value of X is doubled again and the value is assigned to the array variable element DATA 2 This process is repeated NJ series CPU Unit Software User s Manual W501 6 91 6 Programming 6 92 n 1 X 1 WHILE X lt 3
417. lues If no initial values are set the vari ables retain their value before the tion download Retains value Retains value before download before download regardless of retain regardless of retain condition condition Retain condition Indicates that the following conditions are met both before and after transfer e The variable name is the same e The data type name and data type size are the same e The Retain attribute is specified NJ series CPU Unit Software User s Manual W501 When a major fault level 6 Programming During online editing Retain attribute Type of variable e of variable Controller error occurs Variable in a POU for for online editing online editing e f initial values are set e f initial values are set No change the variables change to the variables change to User defined yar g the initial values the initial values ables and device vari o a ables e f initial values are not e f initial values are not Non retain set the variables set the variables change to 16 00 change to 16 00 CIO and Work mem No change ory areas for CJ series Units No change retains value e f initial values are set i before error the variables change to User defined vari the initial values ables and device vari o ables e f initial values are not Retain set the variables change to 16 00 Holding DM and EM No change memory areas for CJ series Units status 6 3 1
418. lues ensuring CONCUITENCY cccssecccesececeeseeenseeeeneaees 5 15 variables AMDE Soniai eee et mene aCe met ee cere a ene cm eres 6 29 OUND G atcecescamarteezcccacce a eaeeceseacaeeet ease 6 27 TV DGS aiae teoadedteceeetcuemeaaeenredcateens 6 27 variables and I O assignments 0eecceeeseeeeeeeeaeeeees 2 8 verification of Operation authority cceccseeeeeeeeeeees 9 17 Index 7 Index Index 8 NJ series CPU Unit Software User s Manual W501 Authorized Distributor
419. m only with the following tions instruction e GetMyTaskStatus Variable name _ TaskName_MinExecTime Meaning Minimum Task Execution Time Global local Global Function Contains the minimum value of the task execution time unit 0 1 us Note You cannot use this system defined variable in the user program It is used only to access task status for data tracing from the Sysmac Studio Data type TIME Range of values Depends on data type R W access Rs Retained Not retained Network Publish Not published Usage in user program Not possible Related instruc You can access this variable from the user program only with the following tions instruction e GetMyTaskStatus Variable name _ TaskName_ExecCount Meaning Task Execution Count Global local Global Function Contains the number of executions of the task If 4294967295 is exceeded the value returns to 0 and counting is continued Note You cannot use these system defined variables in the user program It is used only to access task status for data tracing from the Sysmac Studio Data type UDINT Range of values Depends on data type Usage in user program Not possible Related instruc You can access this variable from the user program only with the following tions instruction e GetMyTaskStatus A 48 NJ series CPU Unit Software User s Manual W501 Appendices Variable name _ TaskName_Exceeded Meaning Task Exceeded Flag Global local Global Function TRUE
420. mary period i e the motion control period twice in a row A partial fault level Controller error will occur in the Motion Control Function Module A Task Period Exceeded Error will occur at the same time Motion Control Period Exceeded Error Error name Errorlevel Correction Motion Control Minor fault Reduce the amount of processing in the programs or increase the Period Exceeded control period within the range that does not adversely affect opera Error tion NJ series CPU Unit Software User s Manual W501 5 21 5 Designing Tasks i Task Execution Timeout Error A Task Execution Timeout Error occurs if task processing is not completed within the specified Task Execution Timeout Time This is a major fault level Controller error Execution of the user program stops when the error occurs This error also occurs when normal task operation is not possible due to errors in program logic such as infinite loops Timeout Detection Time l Primary period Primary period gt gt Primary period Primary period 8 A O A l T Task Execution Timeout Error Error name Error level Correction Task Execution Major fault Review the task settings and download the user program again Timeout Error The power supply must be cycled or the CPU Unit reset i I O Refreshing Timeout Error An I O Refreshing Timeout Error occurs when I O refreshing is not completed within the period twice in a row Primary periodic
421. mation Precautions None Remarks Event name Operation Started 90130000 hex Meaning Operation was started timing to RUN mode Effects User program execution starts ea on r correction A command to start operation was T received Attached None information Precautions None Remarks 12 28 NJ series CPU Unit Software User s Manual W501 12 Troubleshooting Event name Operation Stopped 90140000 hex Meaning Operation was stopped Source details None Detection When changing timing to PROGRAM mode Source PLC Function Module apes None 3 c Seians A command to stop operation was S received Attached None information Precautions None Remarks Event name Reset Executed 90150000 hex Meaning A reset was executed Source PLC Function Module Source details None Detection Commands from timing user Effects User program Operation Operation is started after a reset is executed nm De gt m x x O J D dp O i O O do Attached None information Precautions None Remarks Event name User Program Execution ID Write 90160000 hex Meaning The user program execution ID was set or changed in the CPU Unit Source PLC Function Module Source details When download timing ing Effects Not affected System defined Data type Name ree Cause and Correction Prevention eotie chon A user with Administrator rights changed the user program execution ID
422. mbers O to 95 Data in this area is cleared when power is cycled or when the operating mode is changed between PROGRAM and RUN mode re O e gt gt oO i 3 oO lt C Q h e O c F Cc gt Addresses Addresses Word addresses Bit addresses Words per Unit CIO 2000 to CIO 2959 CIO 2000 00 to CIO 2959 15 10 words Range 10 words x 96 unit numbers ealV OIO 1 9 V The words that are allocated are listed in the following table Word addresses Unit Number CIO 2000 to CIO 2009 0 CIO 2010 to CIO 2019 1 to to CIO 2950 to CIO 2959 95 For details on how to use the allocated words refer to the operation manual for the CJU series Spe cial I O Unit EN Additional Information You can access the Special I O Unit Area in NJ series CPU Units through the device variables that are allocated to I O ports We therefore recommend that you do not use AT specifications to access this area p DeviceNet Area Description The bits in this area are allocated to the slaves when the remote I O master function of a DeviceNet Unit is used fixed allocations only Data in this area is cleared when power is cycled or when the operating mode is changed between PROGRAM and RUN mode NJ series CPU Unit Software User s Manual W501 A 81 Appendices Addresses Addresses Word addresses Bit addresses Range CIO 3200 to CIO 3799 CIO 3200 00 to
423. me names in different POUs Each of those vari ables is assigned to a different memory area Input Variables When a POU is called the input variables are assigned to the values of the input parameters from the calling POU An input variable is declared in the local variable table of the POU Output Variables Before processing a POU is completed the output parameters returned to the calling POU are assigned to the output variables An output variable is declared in the local variable table of the POU In Out Variables When a POU is called the in out variables are assigned to the in out parameters themselves vari able designations from the calling POU If you change the value of an in out variable within a POU the value of the in out parameter changes at that time An in out variable is declared in the local vari able table of the POU External Variables External variables are used to access data outside of a POU You can access global variables from POUs NJ series CPU Unit Software User s Manual W501 6 Programming i Global Variables A global variable is declared in the global variable table Device variables that are automatically generated from the Unit configuration and slave configuration and axis axes group variables that are generated from the Axis Setting Table are automatically regis tered as global variables 6 3 4 Attributes of Variables You can set the following attributes for variables
424. memory areas in the NJ series CPU Unit can be accessed If you require this functionality e g to connect to existing systems consult with your OMRON representative NJ series CPU Unit Software User s Manual W501 A 15 A h 2 x D O O 9 i O 5 T suoeooeds uoouny Y Appendices A 2 Calculating Guidelines for Task Execution Times This section describes how to calculate guidelines for average task execution times on paper You must use the physical Controller to check the maximum values of task execution times For details refer to 5 3 Task Design Example and I O Response Times Precautions for Safe Use The execution times in the physical Controller depends on the logic operations that are per formed in the user program the presence of communications commands and data links on whether data tracing is performed and on other factors Before starting actual operation you must test performance under all foreseeable conditions on the actual system and make sure that the task periods are not exceeded and that suitable com munications performance is achieved A 2 1 Calculating the Average Task Execution Times The task execution time is the total of the following processing times Task execution time I O refresh processing time User program execution time Motion control processing time Common processing time The following processing is performed Primary Priority 16 Priority 1 7
425. ment 2 Statement 1 p a u Oo D 3 3 5 re D c D Q D N Application Use this construct to perform one of two processes depending on evaluation of a condition condi tion expression Description If lt condition_expression gt is TRUE lt statement_1 gt is executed If lt condition_expression gt is FALSE lt statement_2 gt is executed Precautions e IF must always be used together with END_IF e Write a statement that evaluates to TRUE or FALSE for example IF A gt 10 or a BOOL variable for example F A for the condition expression e You can write lt statement_1 gt and lt statement_2 gt on multiple lines Separate statements with a semicolon e6benbue7 1x9 painionuis S 9 Example Another IF Statement before lt statement_1 gt IF lt condition_expression_1 gt THEN IF lt condition_expression_2 gt THEN lt statement_1 gt ELSE lt statement_2 gt END_IF END_IF NJ series CPU Unit Software User s Manual W501 6 81 6 Programming Process Flow Diagram Condition FALSE expression 1 Condition expression 2 Statement 1 Statement 2 ELSE corresponds to the previous THEN statement as shown above e You can execute more than one statement for both lt statement_1 gt and lt statement_2 gt Separate statements with a semicolon e You can omit the ELSE statement If it is omitted nothing is executed when lt condi
426. mmand Pulse Count Per Motor Rotation Work Travel Distance Per Motor Rotation Maximum Velocity Maximum Jog Velocity Maximum Acceleration Rate Maximum Deceleration Rate Software Limit Function Selection Software Limits and Count Mode 3 Open the MC Test Run Tab Page and perform the following Example e Monitor and check wiring e Jogging to check the direction of the motor e Check travel distances for relative positioning electronic gear settings e Confirming the homing operation NJ series CPU Unit Software User s Manual W501 7 7 7 Simulation Transferring Projects to the Physical CPU Unit and Operation 7 3 Starting Operation This section describes how to use the Sysmac Studio to operate the NJ series Controller Use the Sysmac Studio to start operation of the CPU Unit 7 8 NJ series CPU Unit Software User s Manual W501 CPU Unit Status This section describes CPU Unit status 8 1 Overview of CPU Unit Status 0c 8 2 8 2 Slate Changes sess s 0s secede este cariee dete se ee eae ee ee ees 8 3 8 2 1 When Power Is Turned ON 0 0 2c ee eee 8 3 8 2 2 Operating Mode Changes 0 0 c cee teens 8 3 8 2 3 When Downloading Data from the Sysmac Studio to CPU Unit 8 6 8 2 4 Status for Controller Errors 0 0 0 0 0 ce eee 8 7 NJ series CPU Unit Software User s Manual W501 8 1 8 CPU Unit Status 8 1 Overview of CPU Unit Status This section provides an overview of the
427. mming of a programmable product or any consequence thereof 20 NJ series CPU Unit Software User s Manual W501 Read and Understand this Manual Disclaimers CHANGE IN SPECIFICATIONS Product specifications and accessories may be changed at any time based on improvements and other reasons It is our practice to change model numbers when published ratings or features are changed or when significant construction changes are made However some specifications of the products may be changed without any notice When in doubt special model numbers may be assigned to fix or establish key specifications for your application on your request Please consult with your OMRON representative at any time to confirm actual specifications of purchased products DIMENSIONS AND WEIGHTS Dimensions and weights are nominal and are not to be used for manufacturing purposes even when tolerances are shown PERFORMANCE DATA Performance data given in this manual is provided as a guide for the user in determining suitability and does not constitute a warranty It may represent the result of OMRON s test conditions and the users must correlate it to actual application requirements Actual performance is subject to the OMRON Warranty and Limitations of Liability ERRORS AND OMISSIONS The information in this manual has been carefully checked and is believed to be accurate however no responsibility is assumed for clerical typographical or proofreading err
428. n axis with Sysmac Axis Variables auto matically created when axes are cre the axis Studio and assign ated with the Sys the device to the mac Studio axis Axes Group Vari System defined An Axes Group Vari The EtherCAT Provided by the sys ables axes group variables able is used for slaves Servo Drive tem multi axes coordi or encoder input You must create an nated control slaves that are axes group with the assigned to the axes Sysmac Studio Axes Group Vari ables automatically created when axes groups are created JrOUp with the Sysmac Studio Refer to the NJ series Motion Control Instructions Reference Manual Cat No W508 for details on Axis Variables and Axes Group Variables Specifying Axis and Axes Group Variables The variables can be specified with variable names that are created with the Sysmac Studio or with system defined variable names Names Type Axis Variables Axes Group Variables Variable names created with the MC_Axis MC_Group Sysmac Studio is assigned in ascending order is assigned in ascending order from 000 in the order the variables from 000 in the order the variables are created You can change the are created You can change the names as required names as required System defined variable names MC_AX 0 63 _MC_GRP 0 31 The array element numbers are The array element numbers are assigned in ascending order from O assigned in ascendi
429. n 1 and 2 above to which write protection applies are given below Protected Protected Protected Protected Protected Protected Protected Protected Protected Protected Protected Protected Protected Protected 9 24 NJ series CPU Unit Software User s Manual W501 9 CPU Unit Functions 9 4 4 CPU Unit Operation Restrictions for the User Program Execution ID Introduction You can set a specific ID called a user program execution ID in the CPU Unit in advance If you do you can execute only a user program with the same ID Sysmac Studio A user program execution ID is registered in the CPU Unit CLZ LZ ILLI So LLLI 2L ZZZ LEP TTF 9 LLLI CPU Unit User program execution ID Download The CPU Unit can User program User program execute the user program only when these two match User program execution ID assigned gt gt to user program 5 User program execution ID User program execution ID You can therefore prevent different CPU Units hardware from executing a user program In contrast to the protection function you can still display and edit the user program even if a user pro gram execution ID is set Operating Procedure 1 Always backup the project files before you assign a user program execution ID 2 Assign the user program execution ID to the user program offline from the Sysmac Studio gt User Program Execution ID Program E
430. n TRUE tion The instruction is executed only once when EN changes to TRUE To add an instruction option add one of the option symbols listed in the table above before the instruction Example Information That Applies to Both FB Instructions and FUN Instructions Condition Flags System defined variables that are assigned values that represent the result of instruction processing are called Condition Flags The only Condition Flag for an NJ series Controller is the Carry Flag P_CY The Carry Flag serves the following purposes e t shows whether the result of processing an instruction exceeds the range that can be expressed by the data type of the output variable e It shows whether an overflow occurred in a bit string data or bit shift instruction For details refer to the NJ series Instructions Reference Manual Cat No W502 6 104 NJ series CPU Unit Software User s Manual W501 6 Programming 6 6 3 Operation for Instruction Errors i Instruction Errors An instruction error indicates that instruction execution was not possible due to a problem that was found when input parameters and other values were checked by the CPU Unit before instruction execu tion Operation When an Instruction Error Occurs e For instructions with ENO ENO changes to FALSE however it is also FALSE when the instruction is not executed e For FB instructions that are processed across multiple task periods the Error output variable
431. n a Watch Tab Page in PROGRAM Mode The value that was specified in a Watch Tab Page by changing the present value of a device vari able that is defined as an external or local variable is not output to the external device To output a specified value to an external device do one of the following e Use forced refreshing e Change the present value in a Watch Tab Page of a device variable that is defined as a global variable The devices variables must be assigned to an I O port of a CJ series Basic Output Unit or EtherCAT output slave This also applies to a global variable with an AT specification to an output bit that is assigned to a CJ series Basic Output Unit Precaution When Directly Writing to I O Memory Addresses Assigned to Output Bits for CJ series Basic Output Units Any value that is written to an I O memory address that corresponds to an output bit that is assigned to a CJU series Basic Output Unit through a tag data link will be overwritten by the execution results of the user program The value that is written directly to the I O memory address from the tag data link will therefore not be output to the external device 9 5 3 Online Editing i Introduction The online editing function is used to add to or change part of a program in the CPU Unit directly from the Sysmac Studio You can select any of the following to perform online editing e POUs programs functions and function blocks For a ladder diagram pro
432. n a shorter Battery life e When you replace the Battery use the CJ1W BAT01 Battery Set NJ series CPU Unit Software User s Manual W501 35 Precautions for Correct Use i SD Memory Cards e Insert the SD Memory Card all the way e Do not turn OFF the power supply to the Controller during SD Memory Card access The files may be corrupted If there is a corrupted file in the SD Memory Card the file is automatically deleted by the restoration function when the power supply is turned ON 36 NJ series CPU Unit Software User s Manual W501 Regulations and Standards Regulations and Standards Conformance to EC Directives Applicable Directives e EMC Directives e Low Voltage Directive i Concepts EMC Directive OMRON devices that comply with EC Directives also conform to the related EMC standards so that they can be more easily built into other devices or the overall machine The actual products have been checked for conformity to EMC standards Whether the products conform to the standards in the system used by the customer however must be checked by the customer EMC related performance of the OMRON devices that comply with EC Directives will vary depending on the configuration wiring and other conditions of the equipment or control panel on which the OMRON devices are installed The customer must therefore perform the final check to confirm that devices and the overall machine conform to EMC standards App
433. n and allow sufficient margin in shut off performance Refer to the relevant manuals for surge current specifications Refer to the NJ series CPU Unit Hard ware User s Manual Cat No W500 for surge current specifications If the full dielectric strength voltage is applied or turned OFF using the switch on the tester the gener ated impulse voltage may damage the Power Supply Unit Use the adjustment on the tester to gradu ally increase and decrease the voltage e Apply the voltage between the Power Supply Unit s L1 or L2 terminal and the GR terminal when test ing insulation and dielectric strength You do not have to disconnect the LG and GR terminals to per form these tests e Do not supply AC power from an inverter or other device with a square wave output Internal temper ature rise may result in smoking or burning Always input a sinusoidal wave with the frequency that is given in the NU series CPU Unit Hardware User s Manual Cat No W500 Install external breakers and take other safety measures against short circuiting in external wiring i Turning ON the Power Supply e It takes up to approximately 10 to 20 s to enter RUN mode after the power is turned ON During that time outputs will be OFF or will be the values specified in the Unit or slave settings and external communications cannot be performed Use the RUN output on the Power Supply Unit for example to implement fail safe circuits so that external devices do not operate
434. n blocks you cannot specify to detect changes to TRUE or FALSE e You cannot access the values of input variables from outside of the function e Some of the instructions provided by OMRON can have varying numbers of input variables but you cannot make a user created function that has a vary ing number of input variables p N u O C u e Co Q 3 O Q N te mg e gt C gt Output variables O to 64 Output variables are used as output arguments from the function e The output parameters are set to the values of the output variables at the end of function execution e You cannot specify a constant for an output parameter You must specify a variable e At least one BOOL output variable including ENO and the return value is required e You can omit output parameter connections If you omit an output parameter the value of the output variable is not assigned to any parameter e You cannot access the values of output variables from outside of the function SUOI OUNS UO Sjlejeq 9 zg 9 In out variables O to 64 In out variables are used as inputs to and outputs from the function They can be changed inside the function e In out parameters variable designations are directly passed to or received from the in out variables You cannot specify a constant for an in out parameter You must specify a vari able If you change the value of an in out variable within a
435. n or shock Doing so may result in Unit malfunc tion or burning f Mounting The sliders on the tops and bottoms of the Power Supply Unit CPU Unit I O Units Special I O Unit and CPU Bus Units must be completely locked until they click into place after connecting the adja cent Unit connectors i Installation Always connect to a ground of 100 Q or less when installing the Units A ground of 100 Q or less must be installed when shorting the GR and LG terminals on the Power Supply Unit i Wiring Follow the instructions in this manual to correctly perform wiring Double check all wiring and switch settings before turning ON the power supply Use crimp terminals for wiring Do not connect bare stranded wires directly to terminals Do not pull on the cables or bend the cables beyond their natural limit Do not place heavy objects on top of the cables or other wiring lines Doing so may break the cables Mount terminal blocks and connectors only after checking the mounting location carefully Be sure that the terminal blocks expansion cables and other items with locking devices are properly locked into place Always remove any dustproof labels that are on the top of the Units when they are shipped before you turn ON the power supply If the labels are not removed heat will accumulate and malfunctions may occur Before you connect a computer to the CPU Unit disconnect the power supply plug of the computer from the AC outlet Also
436. n the following case e Variable Table Variable eat Data type Var Var2 STRING e User Program Var2 ABC Vari Var2 You cannot make assignments to union variables You must make the assignments to individual members of the unions RETURN Overview The following actions occur depending on where the ST statement is used ST The ST program is ended during operation and the next program is executed ST in a Function Inside a Function Block Instance The function or function block is ended during operation and the next instruction after the calling instruction is executed Inline ST The POU that contains inline ST with a RETURN statement is ended Reserved Words RETURN Statement Structure Application Use this statement to force the current program function or function block to end IF with One Condition Overview The construct executes the specified statement when a condition is met If the condition is not met another statement is executed The following expressions are used to specify whether the condition is met TRUE The condition is met FALSE The condition is not met NJ series CPU Unit Software User s Manual W501 6 Programming Reserved Words IF THEN ELSE END_IF Note You can omit ELSE Construct Structure IF lt condition_expression gt THEN lt statement_1 gt ELSE lt statement_2 gt END_IF Process Flow Diagram Condition expression State
437. nction Module Category Name _CUB ccccccceeeeeeeeeeeeeeeeeaeeeeeeeeeeesaaaaeeeeeeesaaaaeeeeeees A 31 A 3 4 Motion Control Function Module Category Name _MC c cccccssseeeeeceeseeeeceeeeeeeseneeesseaees A 33 A 3 5 EtherCAT Master Function Module Category Name _EC ccccssecceeceeeeeeeeeeeeeeeeeeeeeseeeaes A 34 A 3 6 EtherNet IP Function Module Category Name _EIP ccccccccsseeeeeeeeeseeeeecseseeeeeseaseeeseaeees A 38 A 3 7 Meanings of Error Status BIS irena eves eas ea ees ds ec espe eed het A 45 A 4 Specifications for Individual System defined Variables cccccceesseeeeeeeseeeeeeeneeeeeeeneees A 47 A 4 1 System defined Variables for the Overall NJ series Controller No Category ccccceeeee A 47 A 4 2 PLC Function Module Category Name _PLC ccccccccceccessseeeeeeeeeeeeeeeeeeeeeeseaeeeeeeaaneeesesaaes A 54 A 4 3 PLC Function Module Category Name _CJB cccccccsecceeceeeeeeeeseeeeeeeeeeeeeeseaaeeeeessaseeeeesaaees A 55 A 4 4 Motion Control Function Module Category Name _MC cccccssseeeeeceeseeeeseeeeeeeneneeeeesaaes A 59 A 4 5 EtherCAT Master Function Module Category Name _EC cceccccseeeeeeeeeeeeeeeeeeeeeeaeaeeeeees A 61 A 4 6 EtherNet IP Function Module Category Name _EIP cc cceeececeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeaaeeeeeees A 68 A 5 CPU Unit Data Retention and Other Attributes cccssccseeeeeeeesseeeeeeeenesee
438. nd use Controller Link Connections between Controllers Connections to Servo Drives and Use the built in EtherCAT port and slaves general purpose slaves I O controls Mount a DeviceNet Master Unit and use DeviceNet Connections to HMIs Use the built in EtherNet IP port Connections for serial communications Mount a Serial Communications Unit Connections to servers Connections to BOOTP servers Use the built in EtherNet IP port DNS servers or NTP servers NJ series CPU Unit Software User s Manual W501 10 3 10 Communications Setup 10 2 Connection Configuration for Sysmac Studio This section describes the configurations for connecting the Sysmac Studio to an NJ series Controller 10 2 1 Configurations That Allow Online Connections You can connect online from the Sysmac Studio to the peripheral USB port or built in EtherNet IP port of the NJ series CPU Unit Connecting with USB Sysmac Studio A direct connection is made from the computer that runs Sysmac Studio You do not need to specify the connection device 10 4 NJ series CPU Unit Software User s Manual W501 Connecting with EtherNet IP 1 1 Connection e A direct connection is made from the com puter that runs Sysmac Studio You do not need to specify the IP address or connec tion device You can make the connection either with or without a switching hub You can use either a cross cable ora straight cable 10 Communications Setup 1 N
439. nd other variable names and give only the parameters If you do the parameters must be given in the order that they are given in the function block definition Also the number of parameters must match the number of input variables and other variables in the function block definition TON_instance Function Blocks Expressed in ST Instance name TON_instance In a PT b Q gt c ET gt d TON_instance In a PT b Q gt c The ET output is omitted here TON_instance a b c d Input and output variables are omitted here NJ series CPU Unit Software User s Manual W501 6 Programming Refer to Function Block Calls in ST Language Statement on page 6 94 for details i Variable Designations for Function Blocks Instance Name Function block definition name Value is assigned Or instruction name Value is assigned Input parameter Input Internal Output Output parameter Variable assignment variable variables variable Variable assignment itself is passed itself is passed 7 s s a l In out parameter In out variable in out parameter The specifications for variables in function blocks are given below Variables Specification Input variables 1 to 64 Input variables are used as input arguments within the function block They can not be changed inside the function block e When the function block is executed the input variables are set to the values of the in
440. nds from timing user Operation is performed according to the forced refreshing values rome me E Changing a variable to TRUE with forced refreshing was specified by the user Name None None Variable Changed to FALSE with Forced Refreshing 90090000 hex Changing a variable to FALSE with forced refreshing was specified PLC Function Module Source details None Detection Commands from timing user Operation is performed according to the forced refreshing values Variable Data type Name Assumed cause Correction Prevention Changing a variable to FALSE with forced refreshing was specified by the user None None NJ series CPU Unit Software User s Manual W501 Event name Meaning Source Error attributes Effects System defined variables Cause and correction Attached information Precautions Remarks Event name Meaning Source Error attributes Effects System defined variables Cause and correction Attached information Precautions Remarks Event name Meaning Source Error attributes Effects System defined variables Cause and correction Attached information Precautions Remarks 12 Troubleshooting All Forced Refreshing Cleared 900A0000 hex Clearing all forced refreshing values was specified PLC Function Module Source details None Detection Commands from timing user User program Continues Operation Forced refreshing values are all cleared
441. nforma RNS h Individual identifiers lot numbers and other information is accessed 3 Production information tion from the Sysmac Studio e Major faults Internal bus check errors main memory check errors etc e Partial faults Motion control period exceeded slave initialization error etc e Minor faults Battery backed up memory check errors clock oscilla Controller errors Self diag tion stopped etc nosis DARS User defined errors are registered in advance and then generated by Reliability User defined errors executing an instruction functions Error registration error resetting error information registration User defined error messages can be specified in up to nine languages User defined error messages f including Japanese and English Power AC power supply 30 to 45 ms SUPPIY Power OFF detection time DC power supply 22 to 25 ms manage ment A 14 NJ series CPU Unit Software User s Manual W501 Appendices Item NJ501 When going online to a CPU Unit from the Sysmac Studio the CPU CPU Unit names and serial IDs Unit name in the project is compared to the name of the CPU Unit being connected to Protection for User program transfers with no Prevents reading data in the CPU online restoration information Unit from the Sysmac Studio a acl CPU Unit write protection Prevents writing data to the CPU Protecting alee rn Unit from the Sysmac Studio software Protection
442. ng order from 0 in the order the variables are cre in the order the variables are cre ated ated Application There are two ways to use Axis Variables and Axes Group Variables 1 Specifying Axes and Axes Groups in Motion Control Instructions If you specify an axis or axes group for an I O variable for a motion control instruction you can perform operations for the OMRON Servo Drive or encoder input slave 2 Monitoring Axis Variable Members You can use instructions to monitor the actual position error information or other information on the Servo Drives and encoder input slaves 3 18 NJ series CPU Unit Software User s Manual W501 3 I O Ports Slave Configuration and Unit Configuration EN Additional Information Details on Axis Variables 1 Assume that you create an axis with an axis name of A on the Sysmac Studio An Axis Vari able with a variable name of A is created automatically based on the system defined axis vari able The Axis Variable consists of Axis Basic Settings Unit Conversion Settings I O operating status current values error status and warning status 2 You specify the axis variable name A for the in out variable of a motion control instruction With the axis variable name you can access the OMRON Servo Drive or encoder input slave or sup ported Servo Drive or encoder input slave from another company and perform operations for it 3 You can specify the Axis Variable to use instructions as r
443. ng the clock from the Sysmac Studio e Reading writing the clock with instructions e Reading the clock from system defined variables Writing is not possible e Correcting the clock from an NTP Server Aowa Iy Bunea L L 6 NJ series CPU Unit Software User s Manual W501 9 3 9 CPU Unit Functions e Reading writing the clock from the Sysmac Studio e Reading writing the clock with instructions e Correcting the clock from an NTP server CPU Unit Clock data Event logs e Time and date of files that are created on SD Memory Card Battery backup Battery CJ1W BATO1 H Precautions for Correct Use The clock data is retained by the Battery when the power is turned OFF The clock data is not correct when the power is turned ON You can reset the clock data from an NTP server over an EtherNet IP network after the power is turned ON Clock Data Range The range of the clock is 1970 01 01 to 2106 02 06 January 1 1970 to February 6 2106 Setting the Time Zone and the Local Time You must set the time zone and local time for use outside of Japan You can set the time zone from the Sysmac Studio in the Controller Clock Dialog Box You can still use the CPU Unit s internal clock even if you do not set the time zone Clock data that is read by the CPU Unit from an external device and the clock data that is set are the local time based on the time zone EN Additional Information When a Battery is not mounted or when
444. nged inside the function block e The value of an in out parameter is passed to an in out variable and the value of the in out variable is then passed to the in out parameter e You cannot specify a constant for an in out parameter You must specify a vari able e f you change the value of an in out variable within a function block the value of the in out parameter changes at that time e You cannot omit in out parameters NJ series CPU Unit Software User s Manual W501 6 11 p N u O C u e Co Q 3 O Q N te mg e gt C gt syoo g uooUN uo sjed S Z 9 6 Programming 6 12 Variables Number Specification Internal vari No limit Internal variables are used for temporary storage within a function block ables e The values of internal variables are retained regardless of whether the function block is executed e Internal variables can have Retain attributes e You cannot access the values of internal variables from outside of the function block External vari No limit External variables are used to access global variables ables EN An EN variable cannot be used in a function block This applies to both user defined function blocks and FB instructions ENO Oor 1 Generally this is a BOOL output variable that is set to TRUE for a normal end and to FALSE for an error end e You can also omit it for some FB instructions e Refer to ENO below for details
445. ngs SNMP Trap Settings FINS Settings Select Configurations and Setup Controller Setup Built in EtherNet IP Port Settings on the Sysmac Studio to make these settings Refer to the NJ series CPU Unit Built in EtherNet IP User s Manual Cat No W506 for details CS CJ NSJCJ2 Series Instructions Reference Manual W474 Designing Tasks E This section describes the task system and types of tasks 5 1 Overview of Task Designing Procedure 000 0c eee e ees 5 2 5 2 TasSK System 655 ts ct oc a ete erie eo se teed ee ee ee es 5 5 5 2 1 IUFOGUCTION serived pae Pee b ea ne be ee ee ee wet es Be 5 5 B22 SPeCHICAUONS 5 2 45 65424 oe ote as ead Gh hae S eed oh tow he LURE ee 5 6 5 2 3 Basic Operation or Tasks 2 lt i20o22420eeniweedieiecduteghsdgadu cede 5 6 5 2 4 Assigning I O Refreshing to Tasks 0 000 cee eee eee eee 5 12 5 2 5 Assigning Tasks to ProgramS 0 0 ee eee 5 13 5 2 6 Parameters for Primary Periodic Task and Periodic Tasks 5 13 5 2 7 Ensuring Concurrency of Variable Values between Tasks 5 15 5 2 8 Synchronizing Variable Access from Outside the Controller With TASK EXECU itp caink oo tates ne is eae ie a ein oe eka Nels Berea Ca dors 5 18 5 2 9 Instructions Related to Tasks 0 0 eee 5 19 5 2 10 System defined Variables Related to Tasks 000000 aue 5 19 5 2 11 Errors Related to Tasks 4 00 to dawde tows hated ooo ba ee Ba bc
446. nit numbers of the applicable Units If you change Restart the Restart Bit to TRUE with an instruction the restart process begins from refresh processing in the next task period after the instruction is executed _CJB_SIOOO Special I O The Special I O Unit is restarted when the corresponding vari BOOL Restart Unit Restart able changes to TRUE It is changed to FALSE by the system to Bits after the Special I O Unit is restarted The numbers in the vari _CJB_SIO95 able names indicate the unit numbers of the applicable Units If Restart you change the Restart Bit to TRUE with an instruction the restart process begins from refresh processing in the next task period N gt te Q 3 gt mp TI c gt O m e gt _ oO oO 7 H 1 Cc gt sun eloedS 2 2 6 NJ series CPU Unit Software User s Manual W501 9 9 9 CPU Unit Functions 9 3 SD Memory Card Operations This section describes the functions that you can use for SD Memory Cards 9 3 1 SD Memory Card Operations The NJ series CPU Unit supports the following functions for SD Memory Cards Sysmac Studio Memory Card operation instructions LEZ LLLP LLLP TZ LELLI SF LILII LEP OTT FLL LLP ZL CPU Unit SD Memory Card Creating reading files from Sysmac Studio FTP server Function Introduction SD Memory Card operation You can access SD Memory Cards from instruc
447. nization operation of the Sysmac Studio All of the programs in one project One of the events in the NJ series System These events are defined by the user User defined events is a generic term for user defined errors and user defined information A variable for which all of the attributes are defined by the user and can be changed by the user A representation of data such as a numeric value or character string that is used in a user program You can change the value of a variable by assigned the required value Variable is used as opposed to constant for which the value does not change A memory area that contains the present values of variables that do not have AT specifications It can be accessed only with variables without an AT attribute 47 Revision History Revision History A manual revision code appears as a suffix to the catalog number on the front and back covers of the Cat No W501 E1 01 Revision code Revision code Dae Revised content 01 July 2011 Original production 48 NJ series CPU Unit Software User s Manual W501 Introduction Ee This section provides an introduction to the NJ series Controllers and their features and gives the NJ series Controller specifications 1 1 The NJ series Controllers 0 00 cece eee 1 2 1 1 1 PCAUUICS i cles G 5 saree reais waaay eine a A Pee e ke ae 1 2 1 1 2 Introduction to the System Configurations 000 00
448. nize the completion of startup of more than one CPU Unit e Release interlocks when the CPU Unit starts operation Precautions for Safe Use It takes up to approximately 10 to 20 s to enter RUN mode after the power is turned ON During that time outputs will be OFF and external communications are not performed Use the RUN output on the Power Supply Unit for example to implement fail safe circuits so that external devices do not operate incorrectly 9 6 NJ series CPU Unit Software User s Manual W501 9 CPU Unit Functions 9 2 Management Functions for CJ series Units This section describes the management functions used for Units in the Controller 9 2 1 Basic I O Units i Introduction You can increase the input response time to reduce chattering and the effects of external noise You can decrease the input response time to enable detection of shorter input pulses Do not set the ON response time or OFF response time to less than the refresh time Pulses shorter than the input response time are not detected Input from a proximity sensor or other device Input bit i Input response time Input response time i Setting Methods From the Multiview Explorer of the Sysmac Studio double click CPU Expansion Racks under Config urations and Setup Then select the input response times in the Unit information for the Basic I O Units T N gt te Q D 3 D gt mp TI c gt O oO gt
449. nks Data type BOOL Range of values TRUE or FALSE R W access Not retained Network Publish Published Usage in user program Related instruc tions Variable name _EIP_TDLinkStopCmd Meaning Tag Data Link Communications Stop Switch Global local Global Function This is the stop switch for data links Data type BOOL Range of values TRUE or FALSE Usage in user program Related instruc tions Aiobayeg ajnpoyy uonouny dIAO2N19443 9 v Y dlg swen NJ series CPU Unit Software User s Manual W501 A 75 Appendices A 5 CPU Unit Data Retention and Other Attributes The following table shows whether CPU Unit data is retained or cleared for the following Power inter ruptions startup operating mode changes major fault level Controller errors and clearing memory Transfer ring data Status changes with the pare tele Writing tlt Operating ale en when write Sue modes eee CPU Unit data power power is Change When a eean permitting ing in RUN interrup turned ON between Major Fault mode is enabled writing tions PRO Level Con Synchro GRAM troller nized data mode and Error RUN mode occurs Retained Same as Retained Retained Not sup Retained PRO Supported Uer pIo POUs and user program with non before ported GRAM Online edit execution ID in user pro volatile power inter RUN mode in gram h g gram memory ruption online edit ing Retained Same as Retained Retained N
450. nodes 100 m max Maximum number of slaves 192 1 Timers counters index registers data registers and Task Flags cannot be specified 2 Means packets per second i e the number of communications packets that can be sent or received in one second NJ series CPU Unit Software User s Manual W501 1 7 1 Introduction 1 3 Overall Operating Procedure for the NJ series Controller This section gives the overall operating procedure of the NJ series Controllers and then describes it in more detail 1 3 1 Overall Procedure The overall procedure to use an NJ series Controller is given below Step 1 Software Design Design the overall system configuration task configuration programs and vari ables Step 1 1 Designing I O and Processing Step 1 2 Designing Tasks Step 1 3 Designing Programs Step 2 Software Setups and Programming Create the system configurations that you designed in step 1 on the Support Soft ware and assign the variables Create the tasks and programs and debug them e g with simulations Step 2 1 Slave and Unit Configurations Step 2 2 Controller Setup Step 2 3 Programming Step 2 4 Offline Debugging Step 3 Mounting and Setting Hardware Mount the Units and make the required hardware settings Step 4 Wiring Connect the network cables and wire the I O Step 5 Confirming Operation and Starting Actual System Operation Connect the Support Software to the physical system and download the
451. nstruction is executed Starting tracing When specified from the Sysmac Studio or automatically at startup Triggered traces Trigger conditions are set to record data before and after an event When BOOL variable changes to TRUE or FALSE Comparison of non BOOL variable with a constant Debugging Trigger conditions Comparison Method Equals Greater than gt Greater than or equals Less Than lt Less than or equals lt Not equal Trigger position setting A slider is used to set the percentage of sam Delay pling before and after the trigger condition is met Example 20 80 Data tracing is executed continuously and the trace data is collected by Continuous tracing the Sysmac Studio The operation of the CPU Unit is emulated in the Sysmac Studio The following can be emulated user program execution including par tial emulation debugging including step execution and breakpoints monitoring tracing estimating execution times and Servo Drive sig nals Emulation is possible on the Simulator that is included with the Sys mac Studio integrated software package Connec Built in EtherNet IP port tions to Connected port HMIs Sysmac Connected port Peripheral USB port or built in EtherNet IP port Maintenance i F l Studio Remote programming and Connection is possible through the peripheral USB port to other nodes connection monitoring that are connected to the built in EtherNet IP port ID i
452. nt and end point after the data type name in the Data Type Column in the variable table Start point The minimum value that you can store in the variable End point The maximum value that you can store in the variable Example a uae N OE A ee ee Variable Table i abc INT 0 100 The end point of the range specification The start point of the range specification abc Range specification Minimum 0 to maximum 100 NJ series CPU Unit Software User s Manual W501 6 Programming Specifications of Range Specifications Item Specification Data types that Variables only you can specify An error does not occur and the value is written User program The CPU Unit does not perform a range check when the value of a variable changes due to the execution of an instruction When the value is A command error occurs an integer For an element of Write from the 2 Integer array Sysmac Studio Variable Operation for or a CIP mes For a member of an attempts to write _ sage integer structure out of range Communi value cations For an integer struc A command error does not ture occur and the value is writ For an integer array ren Tag data links An error occurs if you attempt to write to a single both via built member that specifies a range An error does not in EtherNet IP occur if you attempt to write to a structure that ports and Eth contains a member for which a range is specified e
453. nt model is registered CoordinateCommand valueActual vz x 0 0 0 0 Y 0 0 0 0 Axis value Axis Command valueActual valueunit Axis 0 0 mm Dupes eed t 9S 6 e Set the trace type sampling interval variables to sample trigger settings for trigger tracing and other data trace parameters 4 Go online and click the Execute Trace Button The graph is drawn as soon as sampling starts if displaying the graph while tracing is enabled NJ series CPU Unit Software User s Manual W501 9 41 9 CPU Unit Functions Display Examples Example 1 When Only the Leftmost Toggle Button Is ON The data trace graph is displayed The vertical axis represents the value of the variable The hori zontal axis represents time E Edit Vieri Insert Project Controller Simulation Tools Help sysmac Studio L x File New Project A Configurations and Setup w Configurations and Setup gt EP O X Axis Time ms v gt iy EtherCAT Visi Name X OffsetlY OffsetlY Axis Min lY Axis Max Minimum Maximum Average Cursor Comment gt t Motion Control Setup e Cam Data Settings 0 35 04 0 45 05 0 55 06 065 07 O75 08 0 85 0 9 0 95 Time ms 0 005 O1 O15 0 2 O25 0 3 0 35 0 4 0 45 0 5 0 55 06 0 65 0 7 0 75 08 O85 0 9 0 95 Time ms Example 2 When Only the Rightmost Toggle Button Is ON The 3D motion trace display appears C 3D equipment model Coordinate and axes Trajectory Loal World No 3D equi
454. nt source The following are Controller events Unit Slave Event source Source details CPU Unit PLC Function Module Bus master Motion Control Function Module Common axis or axes group EtherCAT Master Function Module Communications port or master EtherNet IP Function Module Communications port CIP FTP NTP or SNMP CJ series Units Errors in the memory words allo cated to a Special Unit EtherCAT slaves Individual EtherCAT slaves The source details information does not show information from the error histories from within CJ series CPU Special Units or EtherCAT slaves Read the error histories from the appropriate Support Software Sources of User defined Events User defined events occur in the PLC Function Module NJ series CPU Unit Software User s Manual W501 9 CPU Unit Functions i Category This information displays the category of event log It is used to access error logs from the Sysmac Stu dio or an HMI Event type Event log category Description Controller events System log The Controller automatically detects and records these events CJ series Unit errors are also included Access log This is a record of events that have affect Controller operation due to user actions User defined events User event log This is a log of events that are defined by the user i Number of Records Each event log can contain the following number of records If the number of events exceeds the num ber of records perm
455. nter a User Program Execution ID to set to a program User Program Execution ID E User Program Execution ID confirmation You can set the User Program Execution ID to the program only once Make a note of the ID for future reference Also back up the project file whose ID is unset Take the following procedures to make the ID effective 1 Set the same ID to the Controller 2 Transfer all programs that have the ID set from the computer to the Controller Precautions for Correct Use After you assign a user program execution ID to a user program you cannot change or delete the ID To use a different ID read the project file without an ID that was backed up in step 1 above and assign another user program execution ID To delete the ID use the project file with out an ID that was backed up in step 1 above NJ series CPU Unit Software User s Manual W501 9 25 di uonnoexyg weIboId 1SN SU 10 suoosay uogeiado HUN Ndo v v 6 P A V D O c lt 9 CPU Unit Functions 9 26 3 Connect the Sysmac Studio online and register the user program execution ID that was set in step 2 in the CPU Unit gt User Program Execution ID Controller Enter a User Program Execution ID to set to a connected Controller User Program Execution 1D Cancel The registration of the user program execution ID in the CPU Unit is recorded in the event log At this time the user program execution ID in the CPU Unit is
456. ntrol Programming System service execution ratio 10 Estimated CPU usage rate 58 v i POUs v a Programs Real processing time of tasks Reset Expanded number of I O points for CJ series Unit YV Program0 asa Functions 2 Function Bloc gt Data gt Pa Tasks If necessary review the task configuration program assignments and task periods i Saving the Project Select Save As from the File Menu NJ series CPU Unit Software User s Manual W501 11 9 h ool I N O lt p lt p e gt D m x lt Q 3 3 D u O O D Q c D OIpNig DeWSAS y YIM UOHEINWIS G Z L 4 11 Example of Actual Application Procedures 11 2 6 Checking Operation and Actual Operation Go online with the Controller download the project check the wiring and perform test operation before you start actual operation i Going Online Turn ON the power supply to NJ series Controller Connect the computer and the CPU Unit with a USB cable Select Communications Setup from the Controller Menu Select the connection method for the connection configuration in the Connection Type Field A QNS Select Online from the Controller Menu i Downloading the Project with the Synchronize Menu Select Synchronize from the Controller Menu and download the project to the Controller Note Use the Synchronize Menu of the Sysmac Studio to upload and download the project i Checking Wiring
457. ntroller Events Controller Errors and Information i Introduction Controller errors and information are defined by the NJ series System These events occur when the NJ series System detects an error or information factor Controller Errors These are system defined errors Controller error is a collective term for major fault level partial fault level minor fault level and observation level Controller events Errors in the function modules of the CPU Unit CJ series Units and EtherCAT slaves are detected When one of these events occurs a Controller error is recorded in the event log To check the status of a Controller error on the user program you execute the Get Error Status instruction to access the status of the Error Status variable which is a system defined variable Controller errors are not reset when the operating mode changes Refer to the NJ series Troubleshooting Manual Cat No W503 for details on Con troller Errors Controller Information Controller information is system defined notification information This information does not indicate errors It represents information level Controller events Examples include events other than errors such as turning the power ON and OFF starting and stopping operation connecting the Sysmac Studio online and downloading user programs Function Modules PLC Function Module Event logs Motion Control Function Module ee An error or information occurs EtherCAT
458. nttainc ies aN 7 7 MC AXIA ersin E A 33 A 61 EMC LAX EMSta aecenas A 33 A 60 WMC COM tact secures Sei a cease A 33 A 60 MC COMENSA scccisticcks avira nities A 33 A 59 PIG EMSA ee a a aerea ie reen texts A 33 A 59 IMIG GRP R2 ews ret ee ongeaha oka Seoeeh bce A 33 A 60 JMG GRP Emolar toctesnteitie ence A 33 A 60 Message Communications Enabled Slave Table A 65 _ TaskName_MinExecTime iann 5 19 A 27 A 48 Minimum Task Execution Time 5 19 A 27 A 48 Motion Control Function Module Nital setings sisina 4 13 Motion Control Function Module Error Status A 33 A 59 Motion Control Period Exceeded Error ossessi 5 21 Motion control SYSTEM rers nanen a iene 2 15 Multiple Switches ON Error cccccsseeeeeees A 40 A 72 N names FOSTICUONS saarn a T Peds ads Seton fs 6 60 nesting IOV ONS trike Rise aie ee Ate Ad a ete a ih ls tate 6 26 Network Communications Instruction Enabled FAG irean aa A 30 A 53 Network Configuration Error ccccsseeeeeeeeeees A 34 A 63 Network Configuration Information Error A 34 A 63 Network Configuration Verification Error A 34 A 63 network configurations c eeceeeeeeeeeeeeeeeeeeeeeeeeaaeeeeeeeees 1 5 Network Connected Slave Table e A 37 A 65 NOM Tatal CMOS cbse ce eases eked eerie enact veeee oes 12 4 Normal Target Node Information 0008 A 43 A 73 NJ series CPU Unit Software User s Manual
459. o access data in slaves and Units The data is accessed through logical interface ports that are called I O ports NJ series CPU Unit Software User s Manual W501 2 5 Y N S pH D ea D N D 2 O sejqeueA jo s d L Z Z 2 CPU Unit Operation NJ series CPU Unit Program Mounted Unit Instruction Device variable I O port EtherCAT CJ series Unit Basic I O Unit or Special Unit EtherCAT slave to which an axis is not assigned Device variables are assigned to the I O ports that are automatically created when you create the EtherCAT Slave Configuration or Unit Configuration in the I O Map of the Sysmac Studio You can access the following devices Type of variable Data to access Device variables for CJ series Units CJ series Basic I O Units Real I O data in Basic I O Units CJ series Special Units Operating data allocated CIO Area words and setup data allocated DM Area words for Special Units Device variables for EtherCAT EtherCAT slaves to which axes PDO mapping data for EtherCAT slaves are not assigned slaves specific objects allocated for PDO communications Refer to 3 4 1 I O Ports and Device Variables and 3 4 2 Registering Device Variables for details Cam Data Variables For information on cam data variables refer to the NJ series CPU Unit Motion Control User s Man ual Cat No W507 NJ series CPU Unit Software User s Manual W501 2 CPU Unit Ope
460. o the NJ Series Sysmac Studio Version 1 Operation Manual Cat No W504 for details on troubleshooting with the Sysmac Studio i Checking with the Troubleshooter of an NS series PT lf you can connect communications between an NS series PT and the Controller when an error occurs you can check for current Controller errors and the log of past Controller errors Current Errors Open the Controller Error Tab Page on the NS series PT s Troubleshooter to check the current errors event name event code level source source details details and attached information 1 to 4 Observations are not displayed as errors NJ series CPU Unit Software User s Manual W501 12 9 ob N I oh O e m _ mp m oO HUN Mdd U 10149 eye UON E L ZH 12 Troubleshooting Log of Past Errors Open the Controller Event Log Tab Page on the NS series PT s Troubleshooter to check the time of occurrence level source event name event code details and attached information 1 to 4 for past errors Refer to the NS series Programmable Terminals Programming Manual Cat No V073 for details on the NS series PT s Troubleshooter Checking with Instructions That Read Function Module Error Status Instructions are provided that allow you to read the error status of each function module from the user program These instructions get the status and the event code of the error with the highest le
461. oad and download data Here synchronize means to automatically compare the data for the Sysmac Studio on the computer with the data in the physical Controller and transfer the data in the direction that is specified by the user NJ series CPU Unit Software User s Manual W501 9 Manual Structure 10 NJ series CPU Unit Software User s Manual W501 Sections in this Manual Sections in this Manual Communications Setup 1 Introduction CPU Unit Operation I O Ports Slave Configuration and Unit Configuration 4 Controller Setup 5 Designing Tasks Programming Example of Actual Application Procedures Troubleshooting Appendices Simulation Transferring Projects to the Physical CPU Unit and Operation CPU Unit Status CPU Unit Functions NJ series CPU Unit Software User s Manual W501 11 Sections in this Manual 12 NJ series CPU Unit Software User s Manual W501 CONTENTS CONTENTS ee NEN OCU GC CIO Ic caeeie sce etc errs id wacea ee cera teal cant oe eae ie egies eet Ca UG 1 Relevan INU ANS oasis eaaa a aaa a aaa aa aai aaae 2 Mantial COnfiGuration sssissssa a a aa 3 Manual Structure a chicos diel a aa aA aa a 8 SECTIONS iN TINS tu AION araa a ents a a a a aaa a aaa danced 11 Read and Understand this Manual ccccccsceccnceccncececcscecencececencecsneesceneeaeneeess 19 Safety Precaut ons stieitececdese rose ia a a ai 23 Pr
462. ocedures for the Slave and Unit Configurations 3 2 Creating the EtherCAT Slave Configuration 00000 eens 3 5 3 2 1 MUOAUCION isin 2 tic eon paola ohare tien a ant a a a die atale ctieate ts dak a E E 3 5 3 2 2 Creating the EtherCAT Slave Configuration 0000 ee eee 3 5 Creating the Unit Configuration 0000 es 3 7 3 3 1 MUOCUCHONM sars erara de ae pdr se ae eet aaa A Cage beatae eae E 3 7 3 3 2 Creating the Unit Configuration 0 0 cc eee 3 7 3 3 3 Verifying the Unit Configuration 0 20 0 ce eee 3 10 I O Ports and Device Variables 0 0 c cece eee eee 3 11 3 4 1 I O Ports and Device Variables 0 00 3 11 3 4 2 Registering Device Variables 0 0 00 eee ees 3 15 Creating the Axes and Assigning Them to the Servo Drives Encoder Input SLAVES sare i tin se Shae peet ni uow ate mans a pon a alae at ae arene Sie eee eee 3 17 3 5 1 INGOGUCHON 2s 4chawad cowie than ate ed hed oot etn oul areeale wth ta acne 3 17 3 5 2 Axis Variables and Axes Group Variables 0000 cee eas 3 18 3 5 3 Creating and Using Axes and Axis Variables 0000000005 3 19 NJ series CPU Unit Software User s Manual W501 3 1 3 I O Ports Slave Configuration and Unit Configuration 3 1 Overview of Procedures for the Slave and Unit Configurations This section provides an overview of the procedures for the Slave and Unit Configurations The shaded s
463. od process data communications cycle x 2 Performing Control with the Programs in the Priority 16 Periodic Task The Controller makes a response in the following I O response time I O response time Priority 16 periodic task period Example Controlling EtherCAT Input Slave A and EtherCAT Output Slave B with the Priority 16 Peri odic Task IN OUT Process data ommunications cycle Primary period t gt cpr cpr Task period Primary periodic task Priority 16 periodic task Note The above diagram shows only one input and one output However the I O response time may be as follows depending on the timing of the input from the slave Maximum I O response time Priority 16 periodic task period x 2 5 30 NJ series CPU Unit Software User s Manual W501 5 Designing Tasks i Performing Motion Control with Motion Control Instructions Motion control instructions access the Servo Drives and encoder input slaves to which axes are assigned Motion control instructions can be used in the primary periodic task and in a priority 16 periodic task In either case the motion control instructions are processed in the motion control processing MC section of the primary periodic task The I O response times that include EtherCAT communications times are given below Programming Motion Control Instructions in the Primary Periodic Task The motion control instructions are process
464. ode address 1 to 192 Refer to information on the mean ings of the error status bits at the end of this appendix for details _EC_MacAdrErr MAC Address TRUE if there is an illegal MAC address BOOL TRUE or page A 62 Error FALSE _EC_LanHweErr _EC_LinkOffErr _EC_NetCfgErr _EC_NetCfgCmpErr _EC_NetTopologyErr EC_ PDCommeErr EC_PDTimeoutErr A 34 Communications Controller Error Network Configuration Information Error Network Configuration Verification Error Network Configuration Error Process Data Communications Error Process Data Reception Timeout TRUE if there is a communications controller BOOL TRUE or page A 62 hardware error FALSE Link OFF Error TRUE if the communications controller link is BOOL TRUE or page A 62 not established FALSE TRUE if there is illegal network configuration information BOOL TRUE or page A 63 FALSE TRUE if the network configuration information BOOL TRUE or page A 63 does not match the actual network configura FALSE tion TRUE if there is a network configuration error BOOL TRUE or page A 63 too many devices connected or ring connec FALSE tion TRUE if there is an unexpected slave discon BOOL TRUE or page A 63 nection or connection or if a slave WDT error FALSE is detected during process data communica tions TRUE if a timeout occurs while receiving pro BOOL TRUE or page A 63 cess data FALSE NJ series CPU Unit Software User
465. ode when a Controller error occurs You can then use the information to trigger a user defined error Example 1 When a Low Battery Voltage error occurs the event code 16 000B0000 is obtained and the fol lowing message is displayed Battery is dead P fo m lt 5 re O O Apply power for at least five minutes before changing the Battery Install a new Battery within five minutes of turning OFF the power supply Example 2 When a partial fault level Controller error occurs the event error level is obtained highest level status 2 and the following message is displayed uoewo u pue s1013 pauy p sn sung pau ep ISN 7 9 6 A device failed Call the following number for support Repair Contact Hours 8 00 AM to 9 00 PM TEL XXX XXXX XXXX NJ series CPU Unit Software User s Manual W501 9 55 9 CPU Unit Functions i as Variables Related to User defined Errors Description name type _AlarmFlag User ae The bit corresponding to the event level is TRUE while there WORD Error Status is a user defined error Bits 00 to 07 correspond to user fault levels 1 to 8 i Records in Event Log An event is recorded in the event log when you create user defined information or a user defined error or when you use the ResetAlarm instruction to reset an error When this happens the time event code event level and attached information 1 and 2 are recorded in the user defined event log in the event
466. of The time ratios are displayed with bars for the None Displayed A tasks 2 system common processing I O refreshing 3 9 3 user program execution and motion control pro cessing Specific time values are not dis played Average esti The estimated average value of the real pro mation cessing time of task is displayed Max estimation The estimated maximum value of the real pro cessing time of task is displayed 1 This is the actual time required from the point that task execution was started until it was completed This interval includes both the time to execute other tasks and the time for system services that were executed from when task execution was started until it was completed 2 This interval is the time required to execute only the task itself It is the same as the task execution time for the primary periodic task For periodic tasks this is the task execution time minus the time to execute other tasks and the time for system services that were executed between the point that the execution con dition is met until execution is completed Task period fixed Task execution time varies Real processing time of task varies Real processing time of task varies ee I O refreshing Control processing User program Refreshing execution z AN o D oS n we o o DS Pa es Na Output data processing Input data processing System common processing 1 A iy
467. of access to the SD Memory Card is not updated in realtime Because of this do not use the flag in the user program Because the status of access to the SD Memory Card is not shown in realtime it may cause unexpected Controller operation if you use it in the user program NJ series CPU Unit Software User s Manual W501 amp wn UO D 3 O lt O D Q O o D D ma O 5 D oipn s oewsAs y wo suoneiado ll4 S E 6 9 CPU Unit Functions 2 Precautions When Using the SD Memory Card Power Interruption Flag __Card1PowerFail If the SD Memory Card Power Interruption Flag is TRUE check to see if the correct file is in the SD Memory Card and to see if the SD Memory Card operates properly If the correct file is missing or the SD Memory Card does not operate properly download the correct file to the SD Memory Card again Cycle the power supply to the Controller or reset the Controller and then see if the SD Memory Card operates properly When you are finished change SD Memory Card Power Interruption Flag to FALSE _Card1PowerFail does not change to FALSE automatically EN Additional Information SD Memory Card Recognition and Unmounting Timing Chart SD Memory Card inserted Card recognized Power supply stopped with power switch System processing _Card1Err Recognition Recognition reset Sie lt gt _Card1Ready ee ny e _Card1Access i SD PWR indicator Not lit Lit o Lit
468. of sale by OMRON OMRON MAKES NO WARRANTY OR REPRESENTATION EXPRESS OR IMPLIED REGARDING NON INFRINGEMENT MERCHANTABILITY OR FITNESS FOR PARTICULAR PURPOSE OF THE PRODUCTS ANY BUYER OR USER ACKNOWLEDGES THAT THE BUYER OR USER ALONE HAS DETERMINED THAT THE PRODUCTS WILL SUITABLY MEET THE REQUIREMENTS OF THEIR INTENDED USE OMRON DISCLAIMS ALL OTHER WARRANTIES EXPRESS OR IMPLIED LIMITATIONS OF LIABILITY OMRON SHALL NOT BE RESPONSIBLE FOR SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES LOSS OF PROFITS OR COMMERCIAL LOSS IN ANY WAY CONNECTED WITH THE PRODUCTS WHETHER SUCH CLAIM IS BASED ON CONTRACT WARRANTY NEGLIGENCE OR STRICT LIABILITY In no event shall the responsibility of OMRON for any act exceed the individual price of the product on which liability is asserted INNO EVENT SHALL OMRON BE RESPONSIBLE FOR WARRANTY REPAIR OR OTHER CLAIMS REGARDING THE PRODUCTS UNLESS OMRON S ANALYSIS CONFIRMS THAT THE PRODUCTS WERE PROPERLY HANDLED STORED INSTALLED AND MAINTAINED AND NOT SUBJECT TO CONTAMINATION ABUSE MISUSE OR INAPPROPRIATE MODIFICATION OR REPAIR NJ series CPU Unit Software User s Manual W501 19 Read and Understand this Manual Application Considerations SUITABILITY FOR USE OMRON shall not be responsible for conformity with any standards codes or regulations that apply to the combination of products in the customer s application or use of the products At the customer s request OMRON will provide applica
469. of the event You can use user defined groupings for the events You can include a message that describes the event The user can enter any text string The message is used when the event is displayed on the Sys mac Studio or an HMI Refer to the additional information that is given below on displaying user mes sages on an NJ series compatible NS series PT when a major fault level Con troller error occurs for more details EN Additional Information 9 CPU Unit Functions Values User defined error 1 to 40 000 User defined information 40 001 to 60 000 You can include a title for the event 128 characters max User defined error User fault levels 1 to 8 User defined information User informa tion 32 characters max There are no restrictions on the charac ters that can be used Case sensitive Reserved words None 1 024 characters max There are no restrictions on the charac ters that can be used Case sensitive Reserved words None 128 characters max There are no restrictions on the charac ters that can be used Case sensitive Reserved words None You can set up to nine different languages for the same event code for different regions and users On the Sysmac Studio you can import an Event Setting Table from an Excel file via the clipboard EN Additional Information Displaying User Messages on an NJ series compatible NS series PT When a Major Fault Level Controller Error Occurs
470. of the primary periodic task is completed execution of the priority 16 periodic task is started Primary period Primary period Primary period Primary period Low A Precautions for Correct Use When you exchange data between tasks use exclusive control of variables between the tasks to ensure proper operation Refer to 5 2 7 Ensuring Concurrency of Variable Values between Tasks for details i Operating Mode Tasks are executed in both RUN mode and PROGRAM mode User program execution is not performed in PROGRAM mode i Processing of Tasks and System Services Primary Periodic Task The primary periodic task has the highest execution priority It executes processes with high speed and high precision In every period this task performs system common processing O refreshing user program execu tion and motion control Unlike periodic tasks the primary periodic task performs motion control processing MC 5 8 NJ series CPU Unit Software User s Manual W501 5 Designing Tasks Task period Primary period fixed Task execution time varies I O refreshing Control processing User program execution Input data processing System common processing 1 System common processing 2 Refreshing 1 Task period The CPU Unit executes tasks in this fixed period This is a preset fixed time Output data processing 2 Task execution time This is the actual time it takes from the point that
471. oftware User s Manual W501 5 9 p N D m 2 V lt m D 3 syse JO uoneiado oISeg Z S 5 Designing Tasks 5 10 Periodic Tasks A periodic task executes its programs every task period which is an integer multiple of the primary period You can use 0 to 3 periodic tasks The priority 16 periodic task can also refresh I O Processing for periodic tasks that do not control I O is different from processing for periodic tasks that do control I O Periodic Tasks That Do Not Control I O Task period fixed Task execution time varies I lt gt The Controller will temporarily interrupt the Pe gt ke ee gt execution of a periodic task in order to OP E eee a execute a task with a higher execution Control processing priority N Ege User Ege LEN DEG QED program QED O86 execution 288 oO oO Processing Processing contents Processing for exclusive control of variables in tasks when accessing tasks are set Data trace processing Sampling and trigger checking is performed System common processing 1 User program execution e Programs assigned to tasks are executed in the order that they are assigned Processing for exclusive control of variables in tasks when refreshing tasks are set Processing for variables accessed from outside of the Controller is per formed to maintain concurrency with task execution executed for the variable access time that is set in the Task Setting
472. og Box is displayed Input Parameters File Path Target amp Present value of Retain attribute vz E DM EM and HR Memory uesd for C Absolute encoder home offset valu Execution Result Result 2 Click the View File Selection Dialog Button The File Selection Dialog Box is displayed Spec ify the file path name and file name E save AS Look in E Desktop my Documents a q My Computer My Recent E My Network Places Documents at a test xml RE Desktop Mo Documents PE hy Computer TE My Network File name Places Files of type sml file ml Cancel Re 9 58 NJ series CPU Unit Software User s Manual W501 9 CPU Unit Functions 3 Select the check boxes for the memory to back up and then click the Execute Button The data is backed up Backup Input Parameters File Path C Documents and Settings PLC Desktop test ml Target iy Present value of Retain attribute ve ka DM EM and HR Memory vesd for E Absolute encoder home offset valu Execution Result Result When the backup is completed the results are displayed in the Execution Results Text Display Area EN Additional Information To back up the data the contents of the NJ series Controller and the project must match If it does not match stop the backup and synchronize the data to make it match Restoring Data Restore Procedure 1 Select Backup Variables and Mem
473. ogram Data type BOOL Range of values TRUE or FALSE R W access Not retained Network Publish Not published Usage in user program Related instruc tions Functional Classification Communications Variable name _Port_numUsingPort Meaning Number of Used Ports Global local Global Function Gives the number of internal logical ports that are currently used You can use this variable when you debug the user program Data type USINT Range of values 0 to 32 Usage in user program Possible Related instruc Communications instructions ExecPMCR SerialSend SerialRcv Send tions Rev and SendCma Variable name _Port_isAvailable Meaning Network Communications Instruction Enabled Flag Global local Global Function Indicates whether there is an available internal logical port TRUE when an internal logical port is available Otherwise FALSE Data type BOOL Range of values TRUE or FALSE Usage in user program Possible Related instruc Communications instructions ExecPMCR SerialSend SerialRcv Send tions Rev and SendCmd Variable name _FINSTCPConnSta Meaning FINS TCP Connection Status Global local Global Function Gives the FINS TCP connection status Data type WORD Range of values 16 0000 to 16 FFFF Usage in user program Related instruc tions NJ series CPU Unit Software User s Manual W501 A 53 a w Oo D z O ot O 5 o O 5 a Q v w lt m mp D F Q
474. ogram Possible Related instruc SetAlarm tions e ResetAlarm e GetAlarm Functional Classification SD Memory Card Variable name _Card1Ready Meaning SD Memory Card Ready Flag Global local Global Function TRUE when the SD Memory Card is recognized FALSE when an SD Memory Card is not recognized TRUE The Card can be used FALSE The Card cannot be used Data type BOOL Range of values TRUE or FALSE Usage in user program Related instruc tions Variable name _Card1Protect Meaning SD Memory Card Write Protected Flag Global local Global Function TRUE when the SD Memory Card is write protected with the LOCK switch TRUE Write protected FALSE Not write protected Data type BOOL Range of values TRUE or FALSE Usage in user program Related instruc tions Variable name _Card1Err Meaning SD Memory Card Error Flag Global local Global Function TRUE when an unusable SD Memory Card is inserted or a format error occurs TRUE There is an error FALSE There is no error Data type BOOL Range of values TRUE or FALSE Usage in user program Related instruc tions A 50 NJ series CPU Unit Software User s Manual W501 Appendices Variable name _Card1Access Meaning SD Memory Card Access Flag Global local Global Function TRUE during SD Memory Card access TRUE Card is being accessed FALSE Card is not being accessed The system updates the flag every 100 ms Because of this access to the
475. ogram Execution ID Assigned to the User Program Read the backed up project file in the Sysmac Studio To Delete the User Program Execution ID from the CPU Unit Connect the Sysmac Studio to the CPU Unit online and perform the Clear All Memory operation To Check the User Program Execution ID Assigned to the User Program For security the user program execution ID that is assigned to the user program cannot be checked from the Sysmac Studio Read the backed up project file in the Sysmac Studio and set the user pro gram execution ID again NJ series CPU Unit Software User s Manual W501 9 CPU Unit Functions To Check the User Program Execution ID in the CPU Unit For security the user program execution ID that is set in the CPU Unit cannot be checked from the Sysmac Studio Perform the Clear All Memory operation and register the correct user program exe cution ID i Specifications User Program Execution ID Verification Specifications Timing of Verification At startup the CPU Unit compares the user program execution ID that is registered in the CPU Unit with the user program execution ID that is assigned to the user program Verification Conditions The conditions for verifications are given in the following table A and B indicate the IDs User program execution User program execution ID that is registered in ID that is assigned to the Operation the CPU Unit user program None A ID Verification Error
476. ogram or Controller Con Do not interrupt the power supply to figurations and Setup are not correct the Controller during a Clear All Mem because the power supply to the Con ory operation troller was interrupted during a Clear All Memory operation Non volatile memory failed If the error persists even after you None make the above correction replace the CPU Unit Attached Information 1 Cause Details None Power was interrupted or communications were disconnected during a download or power was interrupted dur ing online editing Downloading Predownloading For other causes the timing of error occurrence during download or during download preparations is given None NJ series CPU Unit Software User s Manual W501 12 Troubleshooting Event name Illegal User Program Execution ID 10210000 hex Meaning The user program execution IDs set in the user program and in the CPU Unit do not match Source PLC Function Module Source details None Detection At user program timing download power ON or Controller reset Error attributes Level Major fault Recovery Cycle the power Log category System supply or reset the Controller Effects All outputs are stopped cornrecien The user program execution IDs setin Set the same user program execution Set the same user program execution the user program and in the CPU Unit ID in the user program and CPU Unit ID in the user program and CPU Unit do not match Keep a re
477. ol processing MC section of the primary periodic task after the priority 16 periodic task The results of processing are output via EtherCAT communications to the Servo Drive to which the axis is assigned during the I O refresh period in the next primary periodic task The Controller responds in the following I O response time regardless of the execution timing of the motion control instructions Minimum I O response time Priority 16 periodic task period Primary period process data communications cycle NJ series CPU Unit Software User s Manual W501 5 31 5 Designing Tasks Execution command Process data communications cycle Primary period t Primary periodic task Processing is performed in the motion control processing _ Commands to Servo A are sent via MC section of the next EtherCAT communications when I O primary periodic task is refreshed in the next primary period A Motion control instructions executed Task period e g t x 2 Task period e g t x 2 Priority 16 periodic task A Motion control instructions executed Note The above diagram shows only one input and one output However the response time may be as follows depending on the timing of the input from the slave Maximum I O response time Priority 16 periodic task period Primary period process data communications cycle x 2 If more than one axis is controlled by the programs in the priority 16 period
478. oller 11 1 1 System Configuration Unit name Pty Connected device CJ series Basic I O Units p CJ series Analog Input Displacement Sensor Unit EtherCAT slaves Servo Drives G5 Ether CAT Sysmac Studio NJ series Controller Analog Input Unit z I O Units Power Supply iim CPU i ij i B WoT CJ away Cy CJ qe LJ ews CJ wey CJ Displacement Sensor Built in EtherCAT port EtherCAT a a G5 EtherCAT Positive limit input i Gi Gi USB TA General purpose slaves Negative limit input Immediate stop input Home signal External latch signal etc 11 2 NJ series CPU Unit Software User s Manual W501 11 Example of Actual Application Procedures 11 1 2 Operation Interrupt feeding starts when the sensor signal changes to ON during velocity control Velocity Velocity control Interrupt feeding 1 elk m x te 3 3 p gt xo p 5 fet ie gt Time Sensor turns ON The vertical position changes based on the analog input from the Displacement Sensor uolesedO Z L NJ series CPU Unit Software User s Manual W501 11 3 11 Example of Actual Application Procedures 11 2 Overview of the Example Procedure This section describes examples of the actual operating procedures for an NJ series Controller 11 2 1 Wiring and Settings Wire the Controller and make the hardware settings 11 2 2 Software Design Design th
479. on methods and corrections for errors that can occur for EtherCAT communications It also describes how to replace slaves Section 9 Troubleshooting The appendices describe the relation of EtherCAT communications to overall CPU Appendices Unit status packet monitoring functions and multi vendor application NJ series CPU Unit Software User s Manual W501 5 Manual Configuration NJ series CPU Unit Built in EtherNet IP Port User s Manual Cat No W506 Section Section 1 Introduction Section 2 Installing Ethernet Networks Section 3 System defined Variables Related to the Built in EtherNet IP Port Section 4 Determining IP Addresses Section 5 Sysmac Studio Settings for the Built in EtherNet IP Port Section 6 Testing Communications Section 7 Tag Data Link Functions Section 8 Message Communications Section 9 Socket Service Section 10 FTP Server Section 11 Automatic Clock Adjustment Section 12 SNMP Agent Section 13 Communications Performance and Communications Load Section 14 Troubleshooting Appendices Description This section provides an overview and the specifications of the built in EtherNet IP port on an NU series Controller It introduces EtherNet IP communications and describes the system configuration and operating procedures This section describes the Ethernet network configuration devices network installa tion and cable connection methods This section describ
480. ons and Setup gt 73 EtherCAT gt Sh CPU Expansion Ra bA PrimaryTask 1 0 Map Task Execution Time C A gt 7 Controller Setup gt i Motion Control Sei amp Cam Data Settings E Siete a Real processing time of tasks P Task Settings Data Trace Settinc Average Estimation 1378 0us Max Estimation 1395 0us Set periodi 4000us Period exceeded Task execution count 795times Task period exceeded count Otimes Latest 1378 0us System common processing I O refresh Execution of user program Motion Control v gt PeriodicTaskO v Programming Vi Task Execution Time O v jf POUs Yv A Programs Y Program0 SectionO Functions Function Blocks Vv 7 Data v ra PeriodicTask1 Data Types tae cas Task Execution Time O Average Estimation 1778 0us Max Estimation 1778 0us Set period 20000us Period exceeded Task execution count 158times Task period exceeded count Otimes Real processing time of tasks Latest 400 0us System common processing I O refresh Execution of user programi Motion Control vV amp Tasks Average Estimation 1482 0us Max Estimation 1482 0us Set period 20000us Period exceeded Perey Task execution count 162times Task period exceeded count Otimes fa PeriodicTaskO f PeriodicTask1 Real processing time of tasks Meaca Latest 104 0us System common processing I O refresh Execution of user program Motion Control v ra PeriodicTask2 Task Execution Time _ ee Average Estima
481. ons only Structures Not supported Members ooon for integers and enu Members Rabo only Derivative data types Unions Not supported Members ioar for integers and enu Members Rubor only Enumerations ss Enumerations Supported p a u Oo D 3 3 5 re D c D Q D N Basic data types Data type specifica tions FOR e6benbue7 1x9 painionus S 9 Overview This construct repeatedly executes the same statements until a variable called the FOR variable changes from one value to another value The following expressions are used to specify whether the condition is met TRUE The condition is met FALSE The condition is not met Reserved Words FOR TO BY DO END_FOR Note You can omit BY Construct Structure FOR lt FOR_variable gt lt initial_ value gt TO lt end_value gt BY lt increment decrement gt DO lt Sstatement END_FOR NJ series CPU Unit Software User s Manual W501 6 87 6 Programming 6 88 Process Flow Diagram FOR variable Initial value FOR variable gt end value Repeated Statement FOR variable Increment decrement value End Application Use this construct when you know in advance how many times you want to repeat a process This type of repeat construct is particularly effective to specify each element of an array variable based on the value of a FOR variable Description A decis
482. op between related nodes while tag data link parameters are transferred during Controller operation Confirm that the system will not be adversely affected before you transfer the tag data link parameters i EtherNet IP Communications e All related EtherNet IP nodes are reset when you transfer settings for the built in EtherNet IP port including IP addresses and tag data links settings This is performed to read and enable the set tings Confirm that the system will not be adversely affected by resetting nodes before you transfer the settings e f EtherNet IP tag data links cyclic communications are used with a repeating hub the communica tions load on the network will increase This will increase collisions and may prevent stable communi cations Do not use repeating hubs on networks where tag data links are used Use an Ethernet switch instead EtherCAT Communications e Make sure that the communications distance number of nodes connected and method of connection for EtherCAT are within specifications Do not connect EtherCAT communications to EtherNet IP a standard in house LAN or other net works An overload may cause the network to fail or malfunction e Malfunctions or unexpected operation may occur for some combinations of EtherCAT revisions of the master and slaves If you disable the revision check in the network settings use the Sysmac Studio to check the slave revision settings in the master and the actual slave revis
483. or processing including functions and function blocks is represented as a diagram Those objects are connected together with lines to build the algorithm Algorithms that are written in the ladder diagram language are called ladder diagrams General Structure of the Ladder Diagram Language A ladder diagram consists of left and right bus bars connecting lines ladder diagram structure ele ments e g inputs and outputs functions and function blocks Only Jump instructions and Label instructions are expressed with symbols that indicate the jumps and labels Algorithms are made of multiple rungs connected together A rung is a connection of all configuration elements between the left bus bar and the right bus bar A program rung consists of logic blocks that begin with an LD LD NOT instruction that indicates a logical start Function or function block Input Connecting line Output Left bus bar gt 4 Bus Bars The vertical lines on the left and right sides of a ladder diagram are called the bus bars These bus bars always have a status of either TRUE or FALSE If you think of the ladder diagram as an electri cal circuit these states represent the flow of current through the circuit When a POU that is written as a ladder diagram is executed the value of the left bus bar changes to TRUE As a result all inputs and other configuration elements connected to the left bus bar also become TRUE Execution progresses as
484. or the following I O ports and memory used for CJ series Units e I O ports for EtherCAT slaves e I O ports for CJ series Basic I O Units e O ports for CJ series Special Units e O bits for DeviceNet slaves that is specified for an AT specification from a variable If you execute forced refreshing from the Ladder Editor or the Watch Tab Page the status of the I O port or memory element for a CJ series Unit will change via the variable ri a g D o re Q 5 Number of Simultaneous I O for Forced Refreshing The number of variables that you can refresh with forced refreshing is listed below e CJ series Units 64 points total e EtherCAT slaves 64 points total The number of external I O points are given for the above limits For example if more than one variable is assigned the same external I O point as the AT specifications it is counted as only one point Bulysesjey Peds04 S 6 i Application Inputs e To apply a simulated input signal to debug the user program e To create a status that would occur only when a failure occurs e g two exclusive bits turning ON or OFF at the same time Outputs e To turn outputs ON and OFF to check wiring NJ series CPU Unit Software User s Manual W501 9 29 9 CPU Unit Functions e To intentionally turn OFF an output you do not want to operate regardless of results of user program execution i Operating Procedure Operations can be performed from the followin
485. ors or omissions NJ series CPU Unit Software User s Manual W501 21 Read and Understand this Manual 22 NJ series CPU Unit Software User s Manual W501 Safety Precautions Safety Precautions Definition of Precautionary Information The following notation is used in this manual to provide precautions required to ensure safe usage of an NJ series Controller The safety precautions that are provided are extremely important to safety Always read and heed the information provided in all safety precautions The following notation is used Indicates a potentially hazardous situation which if not avoided could result in death or serious injury Additionally there may be severe property damage Indicates a potentially hazardous situation which if not avoided may result in minor or moderate injury or property damage CD precautions for Safe Use Indicates precautions on what to do and what not to do to ensure safe usage of the product la Precautions for Correct Use Indicates precautions on what to do and what not to do to ensure proper operation and performance NJ series CPU Unit Software User s Manual W501 23 Safety Precautions Symbols 24 The circle and slash symbol indicates operations that you must not do The specific operation is shown in the circle and explained in text This example indicates prohibiting disassembly The triangle symbol indicates precautions including warnings The
486. ors and other events Settings that define user defined errors and user defined information An acronym for function block Forcing the refreshing of an input from an external device or an output to an exter nal device e g when the user debugs a program Addresses that are subject to forced refreshing can still be overwritten from the user program An abbreviation for function A POU that is used to create an object that determines a unique output for the same input such as for data processing A POU that is used to create an object that can have a different output for the same input such as for a timer or counter One of the functional units of the software configuration of the CPU Unit Any of the EtherCAT slaves that cannot be assigned to an axis A variable that can be read or written from all POUs programs functions and func tion blocks Settings that assign variables to I O ports Assignment information between I O ports and variables A logical interface that is used by the CPU Unit to exchange data with an external device slave or Unit Cyclic data exchange with external devices that is performed with predetermined memory addresses One of the event levels for Controller events or user defined events These are not errors but appear in the event log to notify the user of specific information One of the attributes of a variable The variable is set to the initial value in the fol lowing situations e When po
487. ors are the same Number of enumera 1 to 2 048 tors Value Checks When a value is written to an enumerated variable through execution of an instruction an error will not occur even if that value is not defined as one of the enumerators of that variable 6 3 7 Array Specifications and Range Specifications for Data Types You can specify the following attributes for variables with each data types e Array specifications e Range specifications i Array Specifications ARRAY OF Use an array specification for a data type that handles a group of data with the same attributes as a sin gle entity You can use an array specification for the basic data types and derivative data types Arrays are useful when you want to handle multiple pieces of data together as you would for example coordi nate values for motion control Expressing Arrays and Array Elements Specifying Elements The individual pieces of data that make up an array are called elements The elements of an array are expressed by adding a subscript element number from the start of the array to the name of the variable that represents the entire array Enclose the subscript in single byte braces Subscripts can be either constants or variables In ST you can also use expressions to express subscripts Examples 6 44 NJ series CPU Unit Software User s Manual W501 6 Programming Variable Table 3 Mem x 10 Mem x This expression
488. ory Restore from the Tools Menu of the Sysmac Studio Troubleshooting Export Global Variables The Restore Dialog Box is displayed P N C o gt gt D w lt 3 O w c Q e e Ww te O P C gt 2 JJ p oO p g fe m Restore Input Parameters File Path Target Failed Item List sowan dnyoeq A yeg JO SenjeA jUaSelg ay Bunozs y pue dN Buiyoeg 2 6 NJ series CPU Unit Software User s Manual W501 9 59 9 CPU Unit Functions 2 Click the View File Selection Dialog Button The File Selection Dialog Box is displayed Spec ify the file path Open File Look irr E Desktop e a ey E my Documents 4 My Computer My Recent E My Network Places Documents Desktop My Documents hy Computer My Network File name Places Files of type xml file xml Cancel pi 3 Select the check boxes for the memory to restore and then click the Execute Button The data is restored Restore Input Parameters Ale Path C Documents and Settings PLC2 Desktop test aml Target Failed Item List When the restore operation is completed normally the results are displayed in the Execution Results Text Display Area A dialog box for restarting the NJ series Controller is displayed to reflect the results of the restored data Restore Input Parameters Ale Path C Documents and Settings PLC Desktopitest xm
489. osive gases Ambient storage temperature 20 to 75 C excluding battery Altitude 2 000 m max Pollution degree 2 or less Conforms to JIS B3502 and IEC 61131 2 Noise immunity 2 kV on power supply line Conforms to IEC 61000 4 4 Overvoltage category Category Il Conforms to JIS B3502 and IEC 61131 2 EMC immunity level Zone B Vibration resistance Conforms to JIS C60068 2 6 5 to 8 4 Hz with 3 5 mm amplitude 8 4 to 150 Hz Accelera tion of 9 8 m s2 100 min in X Y and Z directions 10 sweeps of 10 min each 100 min total T I G D D ep O D Q y QO pe mg O do Shock resistance Conforms to JIS C60068 2 27 147 m s 3 times in X Y and Z directions 100 m s for Relay Output Units Applicable standards Conforms to cULus EC Directives NK and LR NJ series CPU Unit Software User s Manual W501 A 3 Appendices A 1 2 Program ming Performance Specifications Item NJ501 1300 NJ501 1400 NJ501 1500 20 MB execution objects and variable tables including variable Program capacity names Variables with Retain attribute 2 MB Does not include Holding DM Memory and EM Area memory for capacity CJ series Units for variables Variables without Retain attribute 4 MB Does not include CIO and Work Area memory for CJ series Units Memory CIO Area 6 144 words CIO 0 to CIO 6143 ese 512 words WO to W511 CJ series Units Can Holding Area 1
490. ossible Related instruc Reset EtherCAT Controller Error tions e ResetECError NJ series CPU Unit Software User s Manual W501 A 63 a w Oo D z O ot O 5 o O 5 a Q v w lt m mp D F Q h 5 D Q S Z o D o Kiobeyed ainpoy uojoun Ja sey LV0104 S p V 9J swen Appendices Variable name _EC_SlavAdrDupErr Meaning Slave Node Address Duplicated Error Global local Global Function TRUE if the same node address is set for more than one slave Data type BOOL Range of values TRUE or FALSE R W access Rs Retained Not retained Network Publish Published Usage in user program Possible Related instruc Reset EtherCAT Controller Error tions e ResetECError Variable name _EC_ SlavInitErr Meaning Slave Initialization Error Global local Global Function TRUE if there is an error in an initialization command addressed to a slave Data type BOOL Range of values TRUE or FALSE R W access R ss Retained Not retained Network Publish Published Usage in user program Possible Related instruc Reset EtherCAT Controller Error tions e ResetECError Variable name _EC_SlavAppErr Meaning Slave Application Error Global local Global Function TRUE if there is an error in the slave s application status register Data type BOOL Range of values TRUE or FALSE R W access R ss Retained Not retained Network Publish Published Usage in user program Possible Re
491. ot finish within the set task period overall control of the equipment may become impossible System defined Variable Name Comecon The task period setting is too short Check the task execution time and Design the tasks considering the cor change the task period to an appro rections that are given on the left priate value ol tn N Oo ea D o gt oO Oo 5 eo A user program is too large Separate the processes into different tasks for example move processes that does not need a short execution period to a periodic task with a lower priority suoduos q 10113 p Z Z The number of times that processing If there is a program with an is repeated is larger than expected extremely high number of repetitions correct the program to achieve the correct number of repetitions Set a trap in the user program that monitors the number of times a process is exe cuted to check the number of repeti tions The priority of the periodic task is Increase the priority of the periodic incorrect task Attached Attached Information 1 Name of task where error occurred information Precautions This error can occur if you change the level of the error to an observation in the task settings Remarks NJ series CPU Unit Software User s Manual W501 12 21 12 Troubleshooting Errors Related to Controller Operation Event name Meaning Source Error attributes Effects System defined variables Cau
492. ot sup Retained PRO Not sup Task Task Settings with non before ported GRAM ported Setup volatile power inter mode memory ruption Retained Same as Retained Retained Not sup Retained PRO Not sup Device vari with non before ported GRAM ported Variable able volatile power inter mode tables memory ruption Variables but not Retained Same as Retained Retained Not sup Retained PRO Supported variable User defined with non before ported GRAM Onlineedit values i volatile power inter RUN mode variables ing memory ruption online edit ing Retained Same as Retained Retained Not sup Retained PRO Supported serdefined with non before ported GRAM Online edit Data type volatile power inter RUN mode data types i i ing memory ruption online edit ing Retained Same as Retained Retained Not sup Retained PRO Supported CPU Unit with non before ported GRAM name volatile power inter RUN mode memory ruption Controller name 5 Built in Ether Retained Same as Retained Retained Supported Not PRO upported Net IP port with non before retained GRAM p volatile power inter RUN mode name memory ruption A 76 NJ series CPU Unit Software User s Manual W501 Control ler Setup Motion Control Setup Cam Data Event Setting Table Bus con figura tion NJ series CPU Unit Software User s Manual W501 CPU Unit data Opera tion
493. ot synchronized Not executed No user defined error Controller IP address 192 168 250 10 Controller subnet mask 255 255 255 0 Operation authority A or some connections are stopped or no connection setting EtherCAT Process Data Communications A or some communications stop Serial ID L701 31810 9999 Variable in User Refreshing None EN Additional Information Use the RUN output on the Power Supply Unit to externally output a signal in RUN mode i Changing the Operating Mode Changing the Operating Mode You can change the operating mode from the Sysmac Studio sebueyyD pon BuneiedO Z Z 8 Changing the Operating Mode at Startup When the power supply to the Controller is turned ON the CPU Unit enters RUN mode by default Change the setting of the Startup mode in the Basic Settings to PROGRAM mode in Configura tions and Setup Controller Setup Operation Settings on the Sysmac Studio NJ series CPU Unit Software User s Manual W501 8 5 8 CPU Unit Status New Project Configurations and Setup new_NISO1_0 Configurations and Setup Startup mode RUN mode PROGRAM nic SD 2a Card Settings Memory card diagnosis at startup Do notcheck Check w System Service Monitoring Settings System service execution interval ms System service execution time ratio w Security Settings Write protection at startup Do not use Use gt Programming Setting Change during RUN Mode Changing
494. otion Control User s Manual Cat No W507 Section Section 1 Introduction to the Motion Control Function Module Section 2 Motion Control Configuration and Principles Section 3 Configuring Axes and Axes Groups Section 4 Checking Wiring from the Sysmac Studio Section 5 Motion Control Parameters Section 6 Motion Control Programming Section 7 Manual Operation Section 8 Homing Section 9 Motion Control Functions Section 10 Sample Programming Section 11 Troubleshooting Appendices Description This section describes the features system configuration and application flow for the Motion Control Function Module This section outlines the internal structure of the CPU Unit and describes the config uration and principles of the MC Function Module This section describes the concept of axes and axes groups the settings for axes that are required for the MC Test Run operations to function on the Sysmac Studio and the instructions for creating and configuring axes and axes groups using the Sys mac Studio This section describes the MC Test Run operations of the Sysmac Studio You can use the MC Test Run operations to monitor sensor signals check Servomotor wiring and more all without any programming This section provides information on the axis parameters and axes group parameters that are used for motion control This section provides the specifications of a motion control program and the operat
495. ou can choose the variable table global variable table or local variable table for one POU in which to register a device variable in the I O Map 3 14 NJ series CPU Unit Software User s Manual W501 3 I O Ports Slave Configuration and Unit Configuration 3 4 2 Registering Device Variables You assign device variables to I O ports in the I O Map of the Sysmac Studio As a result the device variables are registered in the variable table There are three ways to assign a device variable e Manually enter a new device variable name e Automatically create device variable names e Select variables from the variable table Ei Manually Entering Device Variable Names p A O u O a T D a g lt O D S D 2 o You can enter a device variable name manually You assign device variables using this method in the following case e To assign your own name for a slave I O terminal or a Basic I O Unit Use the following procedure 1 Create the slave configuration information or Unit configuration information 2 Select an I O port in the I O Map and enter a variable name in the Variable Column Pot R W Data Ty Variable Variable Commen ____ amp CPU Expansion Racks V CPU Rack 0 Y CJ1W 0D232 Transistor Output Unit Yh Out Output CH1 WORD s ae Ch1_Out00 Output CH1 bit 00 BOOL v Chi_Out01 Output CH1 bit 01 600 i Chi_Outo2 Output CH1 bit 02 600 i Device variables are automatically a
496. outiof o Ch1_Out11 Output CH1 bit 11 r SCS Chi_Outi2 Output CH1 bit 12 por_chi_outi2p o Chi_Out13 Output CH1 bit 13 p01 Chi _Outt3 f o Ch1_Out14 Output CH1 bit 14 po1_chi_Outi4f S Chi_Outi5 Output CH1 bit 15 O1_Chi_Outis Ch2_Out Output CH2 Ree Ch2_Out00 Output CH2 bit 00 a Ch2_Out01 Output CH2 bit 01 NJ series CPU Unit Software User s Manual W501 3 11 3 I O Ports Slave Configuration and Unit Configuration i I O Port Names EtherCAT Slaves The following I O port names are used for Remote I O Terminals Example for a 16 point Remote I O Terminal Bit0O to Bit15 For other slaves all or part of the object names that are defined in the EtherCAT object dictionary are used Example for Analog Input Unit CHO_input16 bit Examples for the R88D KN50H ECT Position actual value and Digital inputs CJ series Basic I O Units I O port names are created according to the following rules Rules for I O Port Names for Basic I O Units Inputs Outputs Ch In ChI Out Terminal number 00 to 15 Terminal number 00 to 15 16 bit words 1 to 4 16 bit words 1 to 4 I O Port Names for Specific Numbers of I O Points Number of I O port names input points put points WORD 64 points Ch1_In WORD Chi_Out WORD Chi_In0OO to Ch1_In15 BOOL Chi_Out00 to Chi_Out15 BOOL Ch2_In WORD Ch2_Out WORD WORD WORD CJ series Special Units I O port names are determined by the model number of the Unit and the functionality Examp
497. overwritten even if it is already regis tered 4 Transfer the user program with the same user program execution ID to the CPU Unit If the user program execution ID in the user program does not match the user program execu tion ID in the CPU Unit or if one of them does not have an ID an ID Verification Error major fault level Controller error occurs when you attempt to change to RUN mode and the CPU Unit will not operate A Precautions for Correct Use After you assign a user program execution ID to the CPU Unit you cannot read or delete the ID To delete the ID from the CPU Unit perform the Clear All Memory operation on the CPU Unit Operation When an ID Verification Error Occurs When the User Program Execution ID in the CPU Unit Is Incorrect or Not Registered Connect online to the CPU Unit from the Sysmac Studio and perform the following steps 1 Overwrite or register the correct user program execution ID in the CPU Unit 2 Cycle the power supply to the Controller or reset the CPU Unit from the Sysmac Studio When the User Program Execution ID Is Not Assigned to the User Program or Is Incorrect 1 Read the backed up project file from the Sysmac Studio and assign the correct user program execution ID 2 Connect the Sysmac Studio to the CPU Unit online and transfer the user program 3 Cycle the power supply to the Controller or reset the Controller from the Sysmac Studio Other Situations To Delete the User Pr
498. ower Interruptions Operating Modes for Forced Refreshing You can execute forced refreshing in either PROGRAM mode or RUN mode Forced refreshing is not possible while there is a major fault level Controller error 9 30 NJ series CPU Unit Software User s Manual W501 9 CPU Unit Functions Status of Forced Refreshing during Operating Mode Changes or Power Interruptions By default the forced refreshing is cleared when the operating mode changes between RUN mode and PROGRAM mode and when the power is interrupted i Holding Clearing Forced Refreshing Forced refreshing is retained and cleared according to changes in the status of the CPU Unit as shown below Change in status Forced refreshing status When power is turned ON Cleared When operating Cleared mode changes PROGRAM to RUN mode After downloading Cleared When a major fault level Controller error occurs Cleared During online editing Retained Programming Precautions for Forced Refreshing The status of variables for which forced refreshing is specified are overwritten by instruction in the user program Therefore the status that is specified for forced refreshing is not maintained in the user pro gram This point differs from forced setting resetting with CJ series PLCs However refreshing to external devices uses the values that were specified for forced refreshing and not the status of the variables in the user program Therefore care is required when us
499. own Not allowed Diagnosisat self diagnosis file sys Check loaded to Startup tem check and recovery CPU Unit on the inserted SD Mem ory Card when the power is turned ON CS CJ NSJCJ2 Series Instructions Reference Manual W474 4 Controller Setup Parameter Sening Description Update tim Changes in group ing RUN mode System Ser System Ser Sets the interval of sys 10msto1s 10ms When down Not allowed vice Monitor vice Execu tem service execution loaded to ing Settings tion Interval ms CPU Unit System Ser Sets the ratio of execu 5 to 50 10 When down Not allowed vice Execu tion for monitoring sys loaded to tion Time tem services in relation CPU Unit Ratio to overall processing of the CPU Unit Security Set Write Protec Automatically enables Do not use Do not use When power Supported ting tion at Startup write protection when Use is turned ON you turn ON the power supply to the Controller 4 2 3 Task Settings Task Settings The Task Settings are used to add and set up tasks men o Configurations and Setup eam 1 Configurations and Setup gt 33 EtherCAT gt S CPU Expansion Racks ype Task Name Period Execution ConditionsTask Period ExceTask Timeout DeEx I O Map Ba Priority 4 Primary Periodic Task PrimaryTask ims v Detect v 5ms Period v 04 gt 7 Controller Setup gt lt 4 Motion Control Setup amp Cam Data Settings gt
500. p e In the Task Setup set the task period and execution condition for the primary periodic task from the pulldown list e In the O Control Task Setting select the task name to which to assign each Unit and slave e Use the Program Assignments to assign the programs to the primary periodic task or the priority 16 periodic task i Build the Project Select Build from the Project Menu 11 2 5 Simulation with the Sysmac Studio Simulation is used to perform desktop debugging Check the task execution times and the real process ing times of tasks Review the task design as required i Starting the Simulator and Connecting to It Select Execute from the Simulation Menu The Simulator i e the virtual Controller starts An online connection is created automatically f Checking the Task Execution Time on the Simulator Double click Task Settings under Configurations and Setup Check to see if the task execution times in the Task Execution Time Monitor exceed the task periods A Configurations and Setup 1 Q an EtherCAT gt CPU Expansion V Be PrimaryTask YO Map Task Execution Time N gt 3 Controller Setup gt 2 Motion Control Average Estimation 355us Max Estimation 484us Setperiod 1000us Period exceeded Cam Data Settin Task execution count 2547 times gt Event Settings F Task Settings FA Data Trace Setti 484 us System common processing T O refreshi Execution of user program Motion Co
501. page FF control character form feed character code 0x0C Moves the cursor to the start of the line CR control character carriage return character code Ox0D Indicates a tab Tab character character code 0x09 Outputs a single byte double quotation mark character code 0x22 Specify the character code as two digit hexadecimal in parentheses Character codes are two digit hexadecimal numbers that range from 00 to FF For example L is the same as 0A UTF 8 character codes cannot be expressed in a single byte But for exam ple the character code for the Japanese character 4 is 0xE38182 which can be represented as E3 81 82 NJ series CPU Unit Software User s Manual W501 6 Programming 6 5 Programming Languages This section describes the programming languages in detail Refer to the Sysmac Studio Version 1 Operation Manual Cat No W504 for details on entering programs with the Sysmac Studio 6 5 1 Programming Languages The languages used to express the algorithms in a POU program function or function block are called the programming languages There are two different programming languages that you can use for an NJ series Controller ladder diagram language LD and ST structured text language 6 5 2 Ladder Diagram Language The ladder diagram language LD is a graphical programming language that is written in a form that appears similar to electrical circuits Each object f
502. pasted i Method 2 Reading the Actual Slave Configuration Online Connect the Sysmac Studio online to the actual network to read the slave configuration EN Additional Information After the EtherCAT Slave Configuration is registered for the Servo Drives and encoder input slaves Axis Variables are automatically created when you create the axes Refer to 3 5 Creating the Axes and Assigning Them to the Servo Drives Encoder Input Slaves NJ series CPU Unit Software User s Manual W501 3 I O Ports Slave Configuration and Unit Configuration 3 3 Creating the Unit Configuration This section describes how to create the Unit Configuration of an NJ series CPU Unit 3 3 1 Introduction Use the Unit Editor in the CPU Expansion Racks Tab Page of the Sysmac Studio to create the Unit Configuration that is recognized as correct by the CPU Unit Create the Unit configuration with the Unit Editor of the Sysmac Studio w Unit configuration CPU Unit gt D O O 2 o wn wn wo a m Special Unit Special Unit When the power is turned ON an automatic check is performed to determine whether the correct Unit Configuration matches the physical Unit configuration The I O ports are automatically registered for Units that are specified in the Unit Configuration Assign device variables to the I O ports The device variables are used in the programs to access the Units in the Unit configuration EN Additional Inform
503. pera tion depends on the setting of object 605E hex Fault Reaction Option Code e The following table gives the operation for all other errors NJ series CPU Unit Software User s Manual W501 12 7 12 Troubleshooting Unit CPU Unit operation Unit or slave operation EtherCAT slave The slave is placed in the Safe Depends on the slave settings Operational state CJ series Basic I O Unit e All outputs are turned OFF e All outputs are turned OFF e Input refreshing continues e External inputs are refreshed CJ series Special Unit Refreshing continues Depends on the Unit operating specifications Servo Drive Updating the command values is All axes stop immediately stopped Settings and setting methods depend on the slave Refer to the manual for the slave For a Servo Drive opera tion depends on the setting of object 605E hex Fault Reaction Option Code i Checking for Non fatal Errors Use the following methods to check for non fatal errors Checking method What you can check Checking the indicators You can use the indicators to confirm the Controller error level the error status of the EtherCAT Master Function Module and the error status of the Ether Net IP Function Module Checking with the trouble You can check for current Controller errors a log of past Controller errors error shooting function of Sysmac sources error causes and corrections Studio Checking with the Trouble You can check for cur
504. perands lf all the operands for an operator have the same data type any data type given as Supported in the following table can be set as operands However if an operand with a different data type is set for the operator an implicit cast is required Refer to mplicit Casts following the table for details on implicit casting Assign Argu Numeric Modulo compari Equality d Boe ment set sae Power son tive neg ment opera division opera ting operator opera ative operator tors operator tors i operator tors signs Data type Boolean OK Real num OK ber SS a a SS CC Baler OK OR tee ies ee ee Ti f OK OK eit ee a a a a a a a time Text string OK OK Enumera OK tion Structure OK an parent Array par OK OK ent OK Possible A compiling error will occur Do not use operators to compare text string variables Use instructions such as EQascii instead gt a u Oo D 3 3 5 rr D c D Q D N Implicit Casts If the data types of the operands do not match as shown below the data types are converted auto matically according to the implicit cast rules If the implicit cast rules are not satisfied a compiling error occurs 1 When the data types of the operands in the expression on the right side of the assignment statement are not the same 2 When the data types of the operands on the right and left sides of the assignment statemen
505. ple that consists of one primary peri odic task In any actual application or for specific conditions you may need to change the order of the design steps or consider different elements This example is therefore for reference only 1 Find the I O response times that are required for the system from the equipment specifications 2 From the system I O response times determine the task period for the primary periodic task 3 See if the task execution time fits into the task period that you found in step 2 above Then work on paper or use the Task Execution Time Monitor of the Sysmac Studio to estimate the average and maximum values of the task execution time 4 See if the system service times are within the monitor settings If you use the Sysmac Studio check the CPU usage 5 Use the physical Controller to see if the task execution time fits into the task period Place the Sysmac Studio online with the physical Controller and use Task Execution Time Mon itor to check the task execution times If it is necessary to alter the user program consider the following corrections for the task configuration e Separating a task e Changing program assignments e Changing the task period If a task is separated the periodic task will vary greatly with the unused time for primary periodic task execution For a periodic task use twice the average and maximum values calculated for the task execution time to set the task period and then
506. ply e Reset the Controller from the Sysmac Studio Minor Fault Level These errors prevent part of the control operations in a certain function module in the Controller The troubleshooting for minor fault level errors is the same as the processing for partial fault level errors Observations These errors do not affect the control operations of the Controller Observations serve as warnings to the user so that the error does not develop into an error at a higher level Information Events that are classified as information do not indicate errors NJ series CPU Unit Software User s Manual W501 12 Troubleshooting Operation for Each Level The operation that is performed when an error occurs depends on the error level of the Controller event mation Partial fault These errors are These errors Errors that pre Errors that do Information level serious errors prevent all of the vent a portion of not affect control events are not that prevent con control in a func control in one of errors but infor Definition trol operations tion module the function mation provided for the entire other than PLC modules to the user in the Controller Function Mod event log ule e I O Bus Check Motion Con e Positive Limit Packet Dis e Power ON Error PLC trol Period Input Detected carded Due to e Power Inter Function Mod Exceeded Motion Con Full Receive rupted Event examples Only a ule Motion Con trol Funct
507. pment model is registered CoordinateCommand valueActual value x 0 0 0 0 Z 0 0 Speed 0 0 Axis Command valueActual valueunit Axis 0 0 mm 9 42 NJ series CPU Unit Software User s Manual W501 9 CPU Unit Functions 9 6 Event Logs This section describes the event logs 9 6 1 Introduction The event logs contain records of events such as errors status changes and user defined events that occurred in the NJ series Controller You can check the current Controller events and the event log of past events NJ series CPU Unit CJ series Units LoL Errors in ao Special Units Create User defined Error SetAlarm instruction Create User defined Information Setlnfo instruction NS series PT You can check the current Controller events and the event log of past events Here events are unscheduled events that occur on the Controller such as errors Event refers to an error or non error information for which the user must be notified for the Controller or for a user definition There are two types and four classifications of events e Controller events Controller errors Controller information e User defined events User defined errors User defined Information Features Event logs have the following features e In addition to error records various records are recorded for events such as the time the power sup ply is turned ON or O
508. port EtherCAT 7 GR aA Jaa JEA ea Cb hs Power l Built in EtherCAT port NJ series CPU Unit Software User s Manual W501 1 Introduction Network Configurations e Host computers HMIs and other NJ series Controllers are connected to the built in EtherNet IP port on the CPU Unit e A DeviceNet network is connected to a DeviceNet Unit A serial communications network is con nected to a Serial Communications Unit Host computer NJ series Controller Lh LJ H ae l ALLL CN P SEST v SA B ol I oak _ D ma N D D N O te 5 r 2 T EtherNet IP EtherNet IP Built in EtherNet IP port NJ series Controller Example Serial Communications Unit Power Supply Unit CPU Unit General purpose device A with serial communications 4 Serial m suoneIn yuon WeISAS y 0 uononpoul Z L 4 Example DeviceNet Unit Support Software You can use the following Support Software to set up monitor and debug an NJ series Controller Sysmac Studio The Sysmac Studio is the main Support Software that you use for an NJ series Controller On it you can set up the Controller configurations parameters and programs and you can debug and simu late operation Other Support Softwa
509. processing 3 In data trace processing in System Common Processing 1 in the next primary period TRUE is obtained for STP_BSY and the status of the motion variable is obtained 4 STP_ACT is changed to TRUE in the user program 5 In data trace processing in System Common Processing 1 in the next primary period TRUE is obtained for STP_ACT The command value in the MC Function Module starts changing B in the following diagram when STP_BSY changes to TRUE in the user program and the Motion Control Function Module starts to per form deceleration processing The command value changes stepwise in synchronization with the pri mary periodic task The data trace however interpolates the values to connect the values for the previous and current periods Therefore the display shows that the command value for the Command Velocity motion control variable WC_Axis000 Cmd Vel changes one period early i e when Button2 changes to TRUE A in the following figure The display also shows that STP_BSY changes to TRUE one period after deceleration starts and then STP_ACT changes to TRUE after another period NJ series CPU Unit Software User s Manual W501 9 39 a g D o re Q 5 Bupe eed S 6 9 CPU Unit Functions Button2 Dotted lines Command value in MC Function Module STP_D STP_BSY STP_ACT MC_AxisO00 Cmd Vel Task period f f A B EN Additional Information For function blocks that contain mot
510. project Check operation on the physical system and then start actual system operation 1 8 NJ series CPU Unit Software User s Manual W501 1 Introduction 1 3 2 Procedure Details Step 1 Software Design 19 01 U04 SOLI8S FN 4 10 INp JOld Huljes9do Ilea E L Task periods Slave and Unit refresh times Exclusive control methods for variables between tasks Step 1 1 e External I O devices and unit configuration Section 3 Configuration Designing I O and Refresh periods for external devices Units in NJ series CPU Unit Processing e Program contents Hardware User s Manual Cat No W500 NO U S Step 1 2 Task configuration 4 2 3 Task Settings a Designing Tasks Relationship between tasks and programs T D Step 1 3 Designing Pro grams POU Program Programs Section 6 Programming Organization Unit Functions and function blocks Design Determining the algorithm languages Defining variables that you can use in more than one POU and 6 3 Variables Variable Design i S variables that you use in only specific POUs Defining the variables names for the device variables that you use to access slaves and Units Defining the attributes of variables such as the Name and Retain attributes Designing the data types of variables Step 2 Software Setups and Programming Step Description Sysmac Studio Oper Reference ations Project Creation 1 Create a project in the Sysmac Studio New
511. provided in external control circuits The Controller outputs may remain ON or OFF due to deposition or burning of the output relays or destruction of the output transistors As a countermea sure for such problems external safety measures must be provided to ensure safe operation of the system The CPU Unit will turn OFF all outputs from Basic Output Units in the follow ing cases e f an error occurs in the power supply e f the power supply connection becomes faulty e f a CPU watchdog timer error or CPU reset occurs e If a major fault level Controller error occurs e While the CPU Unit is on standby until RUN mode is entered after the power is turned ON External safety measures must be provided to ensure safe operation of the system even if the outputs turn OFF If external power supplies for slaves or other devices are overloaded or short circuited the voltage will drop outputs will turn OFF and the system may be unable to read inputs Provide external safety measures in controls with mon itoring of external power supply voltage as required so that the system oper ates safely in such a case NJ series CPU Unit Software User s Manual W501 25 Safety Precautions 26 WARNING Fail safe Measures Unintended outputs may occur when an error occurs in variable memory or in memory used for CJ series Units As a countermeasure for such prob lems external safety measures must be provided to ensure safe op
512. put parameters e You can specify either constants or variables for input parameters e Omitting Input Parameters Refer to information on operation when parameters are omitted in 6 2 7 Opera tion That Applies to Both Functions and Function Blocks e At least one BOOL input variable is required e You can specify to detect when the variable changes to TRUE or changes to FALSE e You can access the values of input variables from outside of the function block Access these values with the following format nstanceName nputVariable Name However you cannot write values directly to an input variable Output vari 1 to 64 Output variables are used as output arguments from the function block ables e The output parameters are set to the values of the output variables at the end of function block execution You cannot specify a constant for an output parameter You must specify a vari able At least one BOOL output variable including ENO is required You can omit output parameter connections If you omit an output parameter the value of the output variable is not assigned to any parameter You can access the values of output variables from outside of the function block Access these values with the following format InstanceName Output VariableName However you cannot write values directly to an output variable In out variables 0 to 64 In out variables are used as inputs to and outputs from the function block They can be cha
513. r Function Module e If the source of the error is the EtherNet IP Function Module or the EtherCAT Master Function Mod ule whether you can restore normal status yourself Non fatal error in CPU Unit To immediately check the specific error To check error status with the indicators Lit Flashing ERROR indicator red Not lit Partial fault level or minor fault level Check all of the following branches that correspond to the status of the EtherNet IP NET ERR and EtherCAT NET ERR indicators EtherNet IP NET ERR indicator is lit or flashing Both indicators are not lit EtherCAT NET ERR indicator is lit or flashing EtherCAT NET ERR Flashing indicator red EtherNet IP NET ERR indicator red Error in the Error in the Error in the Erorr PLe Major fault Observa Error in the EtherNet IP Function EtherCAT Master EtherCAT Master rror in Module for which you you can restore which you cannot for which you can MC Function cannot restore normal normal status by restore normal restore normal Module status by yourself yourself status by yourself status by yourself Refer to the NJU series Troubleshooting Manual Cat No W503 for the procedures to check for errors and corrections with the Sysmac Studio or an NS series PT 12 2 3 Error Table The errors i e events that can occur in the PLC Function Module are given on the following pages Event levels are given as following in
514. r Menu If an error occurs investigate the cause and edit the user program b 5 I N O lt oO _ mp gt g m X 3 2 u O O Q c g gt uonesadgo jenioy pue uoeiado Bulyoauy 9 Z L4 NJ series CPU Unit Software User s Manual W501 11 11 11 Example of Actual Application Procedures 11 12 NJ series CPU Unit Software User s Manual W501 Troubleshooting pO This section describes the event codes error confirmation methods and corrections for errors that can occur 12 1 Operation after an Error 0 00 cee es 12 2 12 1 1 Overview of NJ series Status 0 0 ee 12 2 12 1 2 Fatal Errors inthe CPU Unit 0 ce 12 3 12 1 3 Non fatal error in CPU Unit 0 0 0 cee 12 4 12 2 TFOUDIESNOOUNG aeaiee store en he ie Dose ae yteaanga te Rie eee eee Ser sa 1B 12 11 12 2 1 Checking to See If the CPU Unit Is Operating 12 11 12 2 2 Troubleshooting Flowchart for Non fatal Errors 00005 12 12 1223 TEVKOGTADIC rnan Ge eae eon wr ace acct ot ahd a ot Or Se ha oe ere Bard 12 12 12 2 4 Error Descriptions 0 6 0 3 gt availed a Bel Baa Oe Beh Ste wakes Seeds 12 17 12 2 5 Troubleshooting Errors That Are Not in the CPU Unit 12 36 NJ series CPU Unit Software User s Manual W501 12 1 12 Troubleshooting 12 1 Operation after an Error This section describes the error status of the NJ seri
515. r Servo Drives EtherCAT Master Function This function module communicates with the EtherCAT slaves as the EtherCAT Module master EtherNet IP Function Module This function module performs EtherNet IP communications Some CJ series Units can also be connected to an NJ series CPU Unit 2 2 NJ series CPU Unit Software User s Manual W501 2 CPU Unit Operation i Function Module Execution Relationship The execution relationship between the function modules is shown below NJ series CPU Unit Motion Control EtherCAT Master EtherNet IP PLC functionality PUNGHON MOQUE Function Module Function Module N I 5 mp g gt O D teh oO Oo _ mp gt O u C Cc gt Task Settings PLC Function Module Scheduler The Scheduler in the PLC Function Module schedules processing according to the task settings in the PLC Function Module The Scheduler controls the time that is allocated to execution of processing for the PLC functionality and by the other function modules SYSEL JO MOIAIOAC Z L Z 2 1 2 Overview of Tasks Tasks Tasks are used to specify user program execution and I O refreshing in the CPU Unit They are also used to specify execution conditions and execution priorities Here I O refreshing includes cyclic data exchange with EtherCAT slaves and CU series Units Some tasks are executed periodically Period Period Period Primary periodic task 1 Perio
516. r bit string data real number data and text string data Bit String Data Format Bit O is the least significant bit of a bit string variable Bit values are represented by values of either 1 or 0 However you can also represent the value of a single bit as a BOOL variable where 1 equals TRUE and 0 equals FALSE Bit 7 Bit O One bit extraction BYTE 16 3B 0 0 1 1 1 0 1 1 TRUE Real Numbers REAL and LREAL Data REAL and LREAL data have a real number data format This section describes how to express real numbers and how to perform data processing with real number data types Data Size REAL data is 32 bits while LREAL data Is 64 bits Data Formats The floating point format is a way to express a real number as a combination of a sign an exponent and a mantissa To express a real number as shown below the value of s is the sign the value of e is the exponent and the value of f is the mantissa e REAL Data Number 1 2 127 14 x 2 23 e LREAL Data Number 1 S2 1023 4 f x 2 52 This floating point format follows the IEEE 754 standard The formats are given below Sign Exponent Mantissa REAL data 32 bits s e f Z 31 30 23 22 O Sign Exponent Mantissa LREAL data 64bits s e S P 63 62 52 51 0 NJ series CPU Unit Software User s Manual W501 6 Programming Example Expressing 86 625 as REAL Data This is a negative number so s 1 86 625 in binary is 1010110 101 Normalizing thi
517. r defined axes group variable with a different name is created Normally you use an Axes Group Variable with a different name Refer to the NJU series Motion Control Instructions Reference Manual Cat No W508 for details on structure members Data type _SGROUP_REF Range of values Usage in user program Related instruc tions A 60 NJ series CPU Unit Software User s Manual W501 Appendices Variable name _MC_AX 64 Meaning Axis Variables Global local Global Function Used to specify axes and shows single axis control status and single axis control settings for motion control instructions When you create an axis on the System Studio a user defined axis variable with a different name is created Normally you use an Axis Variable with a different name Refer to the NJ series Motion Control Instructions Reference Manual Cat No W508 for details on structure members Data type _SAXIS_REF Range of values R W access R sd Retained Not retained Network Publish Published Usage in user program Related instruc tions A 4 5 EtherCAT Master Function Module Category Name EC Functional Classification EtherCAT Communications Errors Variable name _EC_ErrSta Meaning Built in EtherCAT Error Global local Global Function This system defined variable provides the collective status of errors in the EtherCAT Master Function Module Refer to A 3 7 Meanings of Error Status Bits for the meanings of
518. r to 6 2 5 Details on Function Blocks i Functions Executing Functions and Execution Conditions e You can call functions from programs other functions or function blocks to execute them e The EN input variable specifies the execution condition A function is executed only once each time EN changes to TRUE Notation e You cannot use FB instructions or user defined function blocks in algorithms e The values of internal variables are not retained Therefore the output value remains constant e There are both user defined and system defined function blocks User defined functions are called user defined functions System defined functions are some times called FUN instructions For details on functions refer to 6 2 6 Details on Functions 6 6 NJ series CPU Unit Software User s Manual W501 6 Programming 6 2 3 Differences between Programs Functions and Function Blocks Item POU type Function blocks Functions Executed upon execu Called from a pro Called from a pro Execution method tion of assigned task gram or another func gram function or tion block function block Any instructions Supported Supported Not supported Algorithm User defined functions Supported Supported Not supported User defined function Supported Supported Not supported blocks Executed each period Executed each period Specify the execution Specify the execution condition with the EN condition with an input
519. rNet IP Units Input refreshing from slaves An error does not occur and the value is written and Units Forced refreshing values An error does not occur and the value is written p rf S Z D ea D N sodA geq JO suoneoiioeds ebuey pue suogeaoads Aeuy Z 9 NJ series CPU Unit Software User s Manual W501 6 49 6 Programming H Precautions for Correct Use Variables with range specifications are not checked for changes in variable values that result from the execution of instructions in the user program To check the range of values for a variable that are set from execution of the user program use instructions that perform range checks Variable Table Data type INT 10 100 ChkRange Variable x Variable Variable x Variable You cannot perform any checks beforehand if you set data with arithmetic processing results this case check the range of values after arithmetic processing e g ADD n ii ae ae ae ee ae ae i i ee ee ee 1 Variable Table Variable mp Variable A INT 10 100 ChkRange Variable tmp Variable A Variable tmp Variable A If the results of the arithmetic processing are within the range set variable A to the value Make sure that the initial value is within the range specified for the Range Specification If the ini tial value field on the Sysmac Studio is left blank an initial value of O is used This applies even if a range that does no
520. rania E 6 29 I V O Bus Error Status a an A 31 A 56 I O Bus Master Error Status cece eee eeeee A 31 A 56 I O Bus Unit Error Status 2 0 cee eee eee eeeee A 31 A 56 YO Control Task Settings cccccccssseeeeeseseeeeeeeeseeeeeens 4 6 FAG IE S10 to deer nce tee pores eettonen mers ity nme nema een erent rm ee nice one 3 11 NANG S see cst teehee te stein aie cote aeh eaee 3 12 I O refresh operation ccccccsseseeeccesseeeceeeeeenssseseeess 5 12 I O Refreshing Timeout Error ccccccccsseeeeeeeeseeees 5 22 NGO MINDY EOT r tenrcouiea terse tu inacstateerenteauatani A 40 A 71 NMIPIGIWCASIS Niece Sete olen an tradlneatel RA 6 77 La Ua ic eee eee epee ek crete Morne cerannte fee ent herrea 6 70 in out variables j2icsceu cact be Eee 6 11 6 19 Input Data Invalid lt iciscsses corsersireeretnedee Peet A 37 A 67 DUE VATIADICS Asmera tiated 6 11 6 19 inputs DFOOFANMINOULS eg eecocdainban vaste a tnciw eeccreus nue 6 66 MSANE NAME earn ea tatc cet ete we toate tease ace 6 9 INSTANCE NAMES oititat halter sche eel Oe ae 6 17 Instruction Error Flag 0 c 0008 6 8 6 107 A 29 A 53 INSWFUCTION CITOIS sen iinne onenei taeae 6 105 6 107 IMSTUCION OPUONS Sosse 6 103 IISIPUCTIONS sanae e a roan ee 6 102 GetMyTaskStatus cccccccsseeeeesesseesesesseeeeseaaes 5 19 LOCK a a N ae Cr nr OTE 5 19 FRO GOWAN caaea a S 9 8 TASK ISACUVG 4223 ated aes a E 5 19 MIO Ke vistechstacestas tate cse
521. ration System defined Variables System defined variables are provided in advance in an NJ series CPU Unit The names and all attributes are defined by the system They have specific functions You cannot change the name or any N other attributes fe The system defined variables are specific to a function module There are system defined variables for D each function module o i The following table lists the types of system defined variables that are available a Function module Type of system defined variable o PLC Function Module System defined variables for PLC Function Module Motion Control Function Module System defined variables for motion control EtherNet IP Function Module System defined variables for EtherNet IP EtherCAT Master Function Module System defined variables for EtherCAT master no N Refer to A 3 System defined Variables for details on system defined variables a The following table lists the types of system defined variables that are provided for motion control F System defined variables for Description motion control J MC Common Variable This system defined variable is used to monitor the common status of the Motion Control Function S Module D Axis Variables Each of these system defined variables is a structure that provides information on an axis such as physical quantities status and error information They are used to access the EtherCAT slave that is assigned to the axis These EtherCAT sla
522. ration ended in an error or has not been executed even once TRUE or FALSE page A 75 Note Do not use this variable in the user program There may be a delay in updating it Use this variable only to access status through communica tions from an external device NJ series CPU Unit Software User s Manual W501 Appendices Functional Classification EtherNet IP Communications Switches values _EIP_TDLinkStartCmd Tag Data Link This is the start switch for data links BOOL TRUE or page A 75 Communications FALSE Start Switch _EIP_TDLinkStopCmd Tag Data Link This is the stop switch for data links BOOL TRUE or page A 75 Communications FALSE Stop Switch A 3 7 Meanings of Error Status Bits The meanings of the individual bits in the following error status are the same e _ErrSta Controller Error Status e _PLC_ErrSta PLC Function Module Error Status e _CJB_ErrSta O Bus Error Status e _CJB_MstrErrSta I O Bus Master Error Status _CJB_UnitErrSta l O Bus Unit Error Status _MC_ErrSta Motion Control Function Module Error Status e _MC_ComErrSta MC Common Error Status _MC_AX_ErrSta Axis Error Status e _MC_GRP_ErrSta Axes Group Error Status e EC_ErrSta Built in EtherCAT Error e _EC_PortErr Communications Port Error _EC_MstrErr Master Error _EC_SlavErr Slave Error _EC_SlavErrTbl Slave Error Table _EIP_ErrSta Built in EtherNet IP Error e _EIlP_PortErr Communications Port Error e _EIP_Cip
523. rations and Setup on the Sysmac Stu dio For details refer to Task Settings on page 4 5 5 2 7 Ensuring Concurrency of Variable Values between Tasks If more than one task reads or writes the same global variable you can use either of the following two methods to ensure the concurrency of the value of the global variable between the tasks Method 1 Write the global variable from only one task and read the variable from the other tasks Use the settings for exclusive control of variables in tasks Method 2 Lock other tasks so that they cannot write to the global variable Use the task exclusive control instructions i Method 1 Settings for Exclusive Control of Variables in Tasks Introduction You can specify the task that refreshes a global variable and the tasks that access the global vari able This ensures the concurrency of the value of the global variable from the point of view of the tasks that access the variable p N D m 2 V lt m D 3 A single task is set to write the value of a specified global variable That task is called the refreshing task If a refreshing task is specified other tasks cannot write the value of the global variable If a refreshing task is not specified for a global variable the value of the variable can be written at any time by any of the tasks so the value will change depending on when it is read The tasks that read the value of the global variable called accessing tasks ar
524. ray in which the elements are structures You can also set a structure in which the members are arrays 6 46 NJ series CPU Unit Software User s Manual W501 6 Programming Arrays with Structure Elements Date Type Table Data type Member Variables Variable Table abc 4 y Se x u y DINT abc 4 x ARRAY 1 4 OF Str Variables Data Type Table Data type Data type ee Str ARRAY 0 1 OF INT abeji x abc 1 y DINT Variable Table abc 4 x 0 abc 4 x 1 ARRAY 1 4 OF Str Instructions with an Array Parameter amp S Z D ea D N Some instructions pass array variables as parameters To do so specify only the name of the array variable as the input parameter Example Passing a Single Array Element to the MOVE Instruction and Passing an Array to the MOVE instruction Specifying One Element in the Array y 0 Moves INT variable x 0 to y 0 ARRAY 0 199 JOF INT ARRAY 0 199 JOF INT Moves INT variable x 0 199 to y 0 199 Restrictions When you move an array variable it must be moved to a variable of the same data type with the same range of element numbers EN Additional Information You cannot specify part of a multi dimensional array as a parameter Variable Table i ARRAY 0 9 0 9 0 9 JOF INT y 0 ARRAY 0 9 0 9 0 9 JOF INT sodA geq JO suoneoiioeds ebuey pue suonesiyjioeds Aey 9
525. re The following Support Software is also included in the Sysmac Studio Software Package Standard Edition Configuration software Application The Sysmac Studio is used for sequence control motion control and all other operations except those described below The Network Configurator is used for tag data links on the built in EtherNet IP port Sysmac Studio Network Configurator The CX Integrator is used for remote I O communications with a DeviceNet CX Integrator Unit The CX Protocol is used for protocol macros with Serial Communications CX Protocol Units CX Designer The CX Designer is used to create screens for NS series PTs NJ series CPU Unit Software User s Manual W501 1 5 1 Introduction 1 2 Specifications This section gives the main specifications of the NJ series Controllers Item NJ501 1300 NJ501 1400 NJ501 1500 20 MB execution objects and variable tables including vari Program capacity able names Variables with Retain 2 MB attribute Does not include Memory Holding DM and EM Area capacity memory for CJ series Units Program ming Unit con for vari Variables without Retain 4 MB ables attribute Does not include CIO and Work Area memory for CJ series Units Memory for CIO Area 6 144 words CIO 0 to CIO 6148 mace 512 words WO to W511 Units Can be speci Holding Area 1 536 words HO to H1535 fied with 32 768 words DO to D32767 aula lly 32 768 words x 25
526. re User s Manual W501 6 17 6 Programming Local Variable Table A local variable table defines the input variables output variables in out variables internal variables and external variables Refer to Variable Designations for Functions below for details Parameters Input Parameters to Input Variables An input parameter passes a value to an input variable in a function when function execution begins An input parameter can be either a variable or a constant Output Parameters from Output Variables An output parameter receives a value from an output variable in a function when function execution is completed A variable is given as the parameter In Out Parameters Shared between In Out Variables The value of the in out parameter changes within the function The same variable is used for both the input and output Expressing Functions in ST The following example shows how to call functions from ST return_value function_name input_variable_1 input_parameter_1 input_variable_N input_parameter_N in out_variable_1 in out_parameter_1 in out_variable_N in out_parameter_N output_variable_1 gt output_parameter_1 output_variable_N gt outout_parameter_N However you can also omit the return value You can also omit input variable names and other variable names and give only the parameters If you do the parameters must be given in the order that they are given in the function definition
527. re allocated to initial settings for Special Units Addresses Addresses Type or x Late es Word addresses Words per Unit Special Unit CJ series Special I O D20000 to D29599 100 words 100 words Units x 96 unit numbers Range CJ series CPU Bus D30000 to D31599 100 words 100 words Units x 16 unit numbers The words that are allocated are listed in the following table CJ series Special I O Units Word addresses Unit Number D20000 to D20099 0 D20100 to D20199 1 to to D29500 to D29599 95 NJ series CPU Unit Software User s Manual W501 A 83 Appendices CJ series CPU Bus Units Word addresses Unit Number D30000 to D30099 0 D30100 to D30199 1 to to D31500 to D31599 F For details on how to use the allocated words refer to the operation manual for the Special Unit EN Additional Information You can access the DM Area words that are allocated to Special Units in NJ series CPU Units through the device variables that are allocated to I O ports We therefore recommend that you do not use AT specifications to access this area A 6 5 EM Area Description This is a general purpose data area used to read and write 16 bit words You can also add a bit number to address specify bits Data in this area is retained during power interruption or when the operating mode is changed between PROGRAM and RUN mode Addresses Addresses Word addresses Bit addresses Range EO Oto E18 32767 EO 0 00 to E18 3276 15 Note The num
528. re the operating mode e If initial values are not set the vari changed are retained ables change to 0 Mode change 8 4 NJ series CPU Unit Software User s Manual W501 8 CPU Unit Status Precautions for Safe Use Always confirm the safety of the controlled system before you change the operating mode or the setting of the Startup Mode Status of Output Bits for EtherCAT Slaves The output data sent from the EtherCAT Master Function Module is used regardless of the operating mode of the CPU Unit Servo Drive Status If the operating mode changes from RUN to PROGRAM mode during a motion control operation the axes will decelerate to a stop at the maximum deceleration rate i Checking the Operating Mode You can check the operating mode on the front panel indicators from the Sysmac Studio or from sys tem defined variables Checking Operating Mode on Indicators on Front of CPU Unit The RUN indicator on the front of the CPU Unit indicates the operating mode as described below RUN indicator on CPU Unit Operating modes During startup In ready status PROGRAM mode Flashing Not lit RUN mode Lit green Checking the Operating Mode from the Sysmac Studio You can check the operating mode from the Controller Status Pane of the Sysmac Studio 2 N w D D O gt D D N Controller Status Pane sais Fionia __ Normal communications RUN mode fault level Controller error occurs N
529. reas You can specify addresses in the following areas Area Expression CIO CIO 0 to CIO 6143 I Work WO to W511 7 Holding HO to H1535 DM DO to D32767 EM E0_0 to E18_32767 The following table gives the data assignments by variable data type Variable data type Assignment position BOOL You can specify an assignment for each bit You can specify bit O or bit 8 of the specified CJ series address as the start position of the data assignment Example 1 AT Specification at Bit O of D100 D100 D100 16 12 One byte data 12 is stored from bit O Example 2 AT Specification at Bit 8 of D100 D100 8 D100 16 12 One byte data 12 is stored from bit 8 SOINQUHY SIQEHEA 8 9 BYTE SINT USINT WORD INT UINT Stored in increments of the data size from bit O of the specified CJ series DWORD DINT UDINT address REAL LWORD LINT ULINT LREAL You can specify bit O or bit 8 of the specified CJU series address as the start STRING sae position of the data assignment TIME Stored in increments of the data size from bit O of the specified CJ series DATE address TIME_OF_DAY DATER_AND_TIME Variables for Which You Can Set AT Specifications AT specifications are made separately for each variable Set them for all elements and members of array structure and union variables NJ series CPU Unit Software User s Manual W501 6 51 6 Programming Attributes of Variables with AT Specifications Specification Rem
530. reere ae Cane meee ae eee ere meme eee A 3 DEMMORMMANCE eases eeraeaodi kB coh N a A 4 ST lagade aeaa i 6 71 IS SIG IIMS INU sanee cates tasty ohdaduetenususabeetuantendceharuns 6 79 CAE eee ner enn Ny ne RU ROE Re a cree ee 6 85 EXIT aada el eee bees a Basha tt teil Me Sots a os 6 93 EXPOS SIONS crrr ran eter ectcieneccuten 6 72 FOR Fs ae ace hasan ee tee esc os 6 87 function block calls ccccecceccseeeeeeeeeeeeeeeesaeeeeeeees 6 94 function calls sorrera Ga tccenceaneesedieer ie 6 97 IF with multiple conditions seesseensnnenneeeneesnnneennne 6 83 IFW one CONGIUON sensere n A 6 80 ODO Ul S a a E S 6 75 REPEAL ornan lees sssestieee agar 6 92 RETURN dragmen a 6 80 Statement keywordS cccesecccseseeeseeeeeseeeeeeseeeeess 6 74 SUCO Seana cone ae eee ene ea anrtnee seers oer enna Rear eae 6 72 SV MAX onors enr n e a E R 6 106 MV Tell LS raiat a 6 90 SIRUCUUINGS bisio cana a seduces taenaeaadoieses 6 38 Support Software ccseeccecceeeeeecseseeeeesaaeeeeeesaeeeesssaeees 1 5 System Service Monitoring Settings 006 4 5 5 27 system Services es ccs cence Cebnccedenncctaiattetigecenaalmentarnetteweendoeass 5 11 MGNIFOFING SCUIN GS dere iceman sountcnuver 5 12 System Time eacece seat ocensecdenmrdl ianwedetdbeaivereldaemctes A 26 A 47 system defined events cccccsseeeececeseeeeeeseeeeeseeees 9 44 system defined variables ccccccccccssssseeeeeeeeees 2 7 6 27 Auxiliary Area bits for
531. rent types of general purpose Ethernet devices k I pees _ gt D ra h D D N O te 5 o T Standard feature USB Port You can connect the computer that runs the Support Software directly to the CPU Unit Standard feature SD Memory Card Slot You can access an SD Memory Card that is mounted in the CPU Unit from the user program Highly Reliable Hardware The NJ series Controllers provide the hardware reliability and RAS functions that you expect of a PLC i Software Features Integrated Sequence Control and Motion Control An NJ series CPU Unit can perform both sequence control and motion control You can simulta neously achieve both sequence control and multi axes synchronized control Sequence control motion control and I O refreshing are all executed in the same control period The same control period is also used for the process data communications cycle for EtherCAT This enables precise sequence and motion control in a fixed period with very little deviation soinjeo4 L 4 Multitasking You assign I O refreshing and programs to tasks and then specify execution conditions and execu tion order for them to flexibly combine controls that suit the application Programming Languages Based on the IEC 61131 3 International Standard The NJ series Controllers support language specifications that are based on IEC 61131 3 To these OMRON has added our own improvements
532. rent Controller errors a log of past Controller errors error shooter of an NS series PT sources error causes and corrections Checking with instructions that You can check the highest level status and highest level event code in the cur read function module error sta rent Controller errors tus Checking with system defined You can check the current Controller error status for each function module variables This section describes the above checking methods i Checking the Indicators Checking the Level of a Controller Error You can use the PWR indicator on the Power Supply Unit and the RUN and ERROR indicators on the CPU Unit to determine the event level for an error The following table shows the relationship between the Controller s indicators and the event level Indicator Event level PWR green RUN green ERROR red Lit Ty 1 s intervals Partial fault level Minor fault level it w non Observation 12 8 NJ series CPU Unit Software User s Manual W501 12 Troubleshooting Checking Errors in the EtherCAT Master Function Module and EtherNet IP Function Module For the EtherCAT Master Function Module and EtherNet IP Function Module use the EtherCAT and EtherNet IP NET ERR indicators to determine whether a minor fault level error or higher level error has occurred The indicator lets you check the status given in the following table Indicator Indicated status EtherCAT NET ERR EtherCAT Master Func
533. rgetStais Registered Tar get Node Infor mation TRUE is TRUE TRUE EIP_RegTarget C ree 2 Normal Target Node ah nore Target Node Error Information Information _EIP_EstbTargetSta ana Oi _EIP_TargetNodeErr TRUE TRUE FALSE FALSE TRUE TRUE FALSE Disabled TRUE FALSE Disabled Disabled Disabled A 42 Description A connection with the target node was established nor mally and there is no error in the tar get PLC A connection with the target node was established but there is an error in the target PLC A connection with the target node was not established nor mally The information is not valid because the target node is not registered NJ series CPU Unit Software User s Manual W501 Appendices Functional Classification EtherNet IP Communications Status values _EIP_EtnOnlineSta Online TRUE The built in EtherNet IP ports com BOOL TRUE or page A 72 munications can be used The link is ON FALSE and IP address is defined Also there are no errors FALSE The built in EtherNet IP ports com munications is disabled due to an error in initial processing or restart processing _EIP_TDLinkRunSta Tag Data Link TRUE At least one connection is in normal BOOL TRUE or page A 73 Communications operation FALSE Status FALSE Other than the above Status FALSE An error occurred in at least one connection _EIP_RegTargetSta 255 Registered This variable gives a list of nodes for which A
534. riable Table The local variable table is used to define input variables output variables in out variables internal variables and external variables Refer to Variable Designations for Function Blocks on page 6 11 for details Parameters Input Parameters to Input Variables An input parameter passes a value to an input variable in a function block when function block exe cution begins An input parameter can be either a variable or a constant Output Parameters from Output Variables An output parameter receives a value from an output variable in a function block when function block execution is completed A variable is given as the parameter In Out Parameters Shared between In Out Variables The value of the in out parameter changes within the function block The same variable is used for both the input and output EN Additional Information You can omit input and output parameters Refer to information on operation when parameters are omitted in 6 2 7 Operation That Applies to Both Functions and Function Blocks for details Calling Function Blocks from ST The following example shows how to call function blocks from ST instance_name input_variable_1 input_parameter_1 inout_variable_N input_parameter_N in out_variable_1 in out_parameter_1 in out_variable_N in out_parameter_N outout_variable_1 gt output_parameter_1 output_variable_N gt outout_parameter_N You can also omit input variable names a
535. riables from outside of the Controller to ensure concur rency between accessing variables from outside of the Controller and task execution Refer to the NJU series CPU Unit Built in EtherNet IP Port User s Manual Cat No W506 for the setting procedure for the Variable Access Time to use tag data links 5 2 9 Instructions Related to Tasks The following instructions are supported to read the status of the current task to determine if execution is in progress for other tasks and to perform exclusive control for regional concurrency between tasks Instruction Instruction name Introduction GetMyTaskStatus Read Current Task Reads the following status of the current task Status Last Task Execution Time Maximum Task Execution Time Minimum A Task Execution Time Task Execution Count Task Period Exceeded Flag and Task Period Exceeded Count o Task_lsActive Determine Task Determines if the specified task is currently in execution lt Status F Lock Lock Tasks Starts a lock between tasks Execution of any other task with a Unlock Unlock Tasks Stops a lock between tasks lock region with the same lock number is disabled 5 2 10 System defined Variables Related to Tasks The following system defined variables are provided for each task to show task status Example The Task Period Exceeded Flag for the task named MainTask is _MainTask_Exceeded Do not use this variable in the user program There may be a delay in updating it
536. rom the absolute encoder One of the variable specifications An array variable contains multiple elements of the same data type The elements in the array are specified by serial numbers called subscripts that start from the beginning of the array One of the attributes of a variable This attribute allows the user to specify what is assigned to a variable An I O port or an address in memory used for CJ series Units can be specified A functional unit that groups together axes within the Motion Control Function Mod ule A system defined variable that is defined as a structure and provides status infor mation and some of the axes parameters for an individual axes group An Axes Group Variable is used to specify an axes group for motion control instruc tions and to monitor the command interpolation velocity error information and other information for the axes group A functional unit within the Motion Control Function Module An axis is assigned to the drive mechanism in an external Servo Drive or the sensing mechanism in an external Encoder Input Slave Unit A system defined variable that is defined as a structure and provides status infor mation and some of the axis parameters for an individual axis An Axis Variable is used to specify an axis for motion control instructions and to monitor the command position error information and other information for the axis Any of the data types that are defined by IEC 61131 3 They include
537. ror RUN mode occurs Same as Retained Retained Not sup Retained CPU Unit Not sup before ported name ported power inter RUN PRO ruption GRAM mode Other set tings PRO GRAM mode Same as Retained Retained Not sup Retained Write Pro Supported before ported tection and power inter other set ruption tings PRO GRAM mode Same as Retained Retained Not sup Retained PRO Not sup before ported GRAM ported power inter mode ruption Same as Retained Retained Supported Not PRO Not sup before retained GRAM ported power inter RUN ruption Same as Retained Retained Not sup Retained PRO Not sup before ported GRAM ported power inter mode ruption Same as Retained Retained Not sup Retained PRO Not sup before ported GRAM ported power inter mode ruption Same as Retained Retained Not sup Retained PRO Not sup before ported GRAM ported power inter mode ruption Same as Retained Retained Not sup Retained RUN PRO Not sup before ported GRAM ported power inter mode ruption Same as Retained Retained Not sup Retained PRO Not sup before ported GRAM ported power inter mode ruption A 77 P oO O u Cc Cc 5 g D mp D J mp D 5 O 5 D Q O mp gt D gt oy c mp M O Appendices Data reten tion at power interrup tions CPU Unit data Data in CJ Retained series Units in CJ such as proto series col macros
538. ror is detected during the program check The Sysmac User program Studio checks the program when it is complied A compiling error occurs at that time Writing from Sys Not supported mac Studio ene CIP messages A command error occurs Communications An error occurs when a tag data link starts The tag data link will Tag data links continue to operate However the values of variables with the Constant attribute are not written Input refreshing from slaves and Units An error does not occur and the value is written Forced refreshing Range for Constant Attribute Specification The Constant attribute is specified separately for each variable Set them for all elements and mem bers of array structure and union variables EN Additional Information You cannot write to variables with the Constant attribute from the user program f Network Publish The Network Publish attribute allows a variable to be read written from external devices other Control lers host computers etc through CIP message communications or tag data links If this attribute is not set you can read write the variable only from the Controller that declared the variable and external devices other Controllers host computers etc cannot read write that variable Variables that have been published to the network are called network variables There are no restric tions on the number of network variables you can have You can publish as many variables
539. rpolated axes control Setting the following parameters from the Sysmac Studio Setting the initial values for the PLC Function Module Initial settings for Special Units Configurations and Setup CPU Expan sion Racks 4 3 Initial Settings for Spe cial Units To use motion control Setting the initial settings for the Motion Control Function Module Configurations and Setup Motion Con trol Setup 4 4 Initial Settings for the Motion Control Function Module Setting the initial values for the Ether CAT Function Module Configurations and Setup EtherCAT 4 5 Initial Settings for the EtherCAT Master Function Module Setting the initial values for the Ether Net IP Function Module Configurations and 4 6 Initial Settings for the Setup Controller EtherNet IP Function Mod Setup Built in Ether ule Net IP Port Settings NJ series CPU Unit Software User s Manual W501 1 Introduction Step 2 3 Programming 1 Registering Vari Registering the variables used by more Global Variable Table Sysmac Studio Version 1 ables et sees Hl ana variable Editor Operation Manual Cat No A E R Local Variable Table W504 Registering the local variable table for Editor 6 3 Variables each program Registering the local variable table for each function block and function 2 Writing Algorithms Writing the algorithms for the POUs pro Programming Editor Section 6 Programming for POUs grams funct
540. rr 255 ccccecccseeeceseeeeeeeeseeeeees A 44 _EIP_TargetPLCErr 255 oo ceeeeeeeeeeeeeeeeeees A 44 A 74 _EIP_TargetPLCModeSta 255 ccceceeeeees A 43 A 73 EIP TEPAPPCIGER ririo A 40 A 72 ABIP GDADDIEMM ntedecsta a A 39 A 69 _EIP_TDLinkAlIRunSta cccccceeeeeeeeeeeees A 43 A 73 JEIP FOLIMKGIGEI ear A 40 A 71 SEIP oT DWAR Bi oerset A 40 A 71 SEIP FDLIAKO PAE EF sxxasetieweecsetsinencccsseratesiasiees A 40 A 71 _ElIP_TDLinkRunSta ec eecceceeeeeeeeeeeeeees A 43 A 73 _EIP_TDLinkStartOmd cece ecceeeeeeeeeeeee ee A 45 A 75 Index 3 Index _EIP_TDLinkStopCmd nasrida A 45 A 75 Emergency Message Detected cccce A 35 A 64 EN aouen 6 12 6 20 ENO Sea N ieeam oma maieeeaaeeedees 6 12 6 20 SITUNMS LATIONS Asra 6 43 errors checking for non fatal errors cc ceeeeeeeeeeeeeeeeeeees 12 8 MACAO inserts cece eaten A 12 8 instructions that read error status ccee 12 10 system defined variables cccccssseecessseeeeeeeees 12 10 DEn a oe een OMe Te or OMe ee eee OrTe Ae 12 12 troubleshooting with NS series PT 0600 12 9 troubleshooting with Sysmac Studio 00 12 9 Ee oc E EE MAE eee E AI I AAEE me S A 28 A 49 EtherCAT Master Function Module mitia setings osere ae 4 15 EtherCAT Message Error ccccccseseeeeeeeeees A 35 A 64 EtherCAT network Configuration ccccccsseeee
541. rt stop BOOL TRUE or page A 72 switch changed to TRUE at the same time FALSE FALSE Other than the above TRUE At least one of the set values fora BOOL TRUE or page A 72 TCP IP application FTP NTP SNMP is FALSE TRUE The NTP client failed to connect to the BOOL TRUE or page A 72 server timeout FALSE TRUE The DNS client failed to connect to the BOOL TRUE or page A 72 server timeout FALSE incorrect Or a read operation failed FALSE Normal FALSE NTP is not set or the connection was successful FALSE DNS is not enabled Or DNS is enabled and the connection was successful TRUE There is an error in one of the follow BOOL TRUE or page A 70 ing settings Or a read operation failed FALSE e IP router table settings e Hosts settings FALSE Normal TRUE The identity information which you BOOL TRUE or page A 71 cannot overwrite is not correct Or a read FALSE TRUE The tag data link settings are incor BOOL TRUE or page A 71 rect Or a read operation failed FALSE TRUE The connection was not established BOOL TRUE or page A 71 because the remote node information in the FALSE if there is no remote node when the power is turned ON NJ series CPU Unit Software User s Manual W501 Appendices EN Additional Information Typical Relationships for the Built in EtherNet IP Error Flags Variable Variable Event Variable name name name level _ElP_ErrSta Built in _ElP_PortErr Communica
542. rted when an smc file is cre files ated NJ series CPU Unit Software User s Manual W501 9 21 P U D O lt UONOB O1d 7 6 9 CPU Unit Functions Protection for Online Operations from the Sysmac Studio User Program Transfers with No Restoration Information Normally when you transfer the user program from the Sysmac Studio to the CPU Unit information is transferred to restore it This function does not transfer information for restoration to prohibit read ing the user program Normal Transfer User Program Transfer with No Restoration Information Sysmac Studio Sysmac Studio LLLI ELIF TIE LLP LIL EPI LEP TPP 27 LZ a a fr a CL LLL LIII FFI a J IDA PIIL ILLL I LLL LPL PETIT SS CPU Unit CPU Unit User program for execution User program for execution T mme User program restoration information Normally both are transferred Readable restorar is not transferred Usemnrogram Restoration information infosiation Not readable This function is used to prevent theft of user program data when on site maintenance of the user program is not required In the Sysmac Studio select the Do not transfer program source Check Box and click the Transfer to Controller Button when you transfer the user program to the CPU Unit CPU Unit Write protection The following two types of protection are supported
543. s System common processing 2 Note If there is communications processing for EtherNet IP tag data links and refreshing tasks are set for the tags i e variables with a Net work Publish attribute variable access processing is performed as part of system common processing 2 Periodic Tasks That Control I O Task period fixed Task execution time varies The Controller will temporarily lt an gt interrupt the execution of a a periodic task in order to execute a Control processing task with a higher execution priority SOD oD ae ai 7 l ko 3 ese User ese 5 o Refreshing 39 3 D program 2 B 26 DS 8 execution HS 8 Oa a a a Processing Processing contents I O refreshing Output data e Output refresh data is created for Output Units that refresh I O processing e f forced refreshing is set the forced refreshing values are reflected in the output refresh data Refreshing This process exchanges data with I O Input data e Input refresh data is loaded from Input Units that refresh I O processing e f forced refreshing is set the forced refreshing values are reflected in the input refresh data that was read NJ series CPU Unit Software User s Manual W501 5 Designing Tasks Processing Processing contents System common processing Processing for exclusive control of variables in tasks when accessing 1 tasks are set e Data trace processing sampling and trigger checkin
544. s Auxiliary A502 to A507 Area A502 00 to A507 15 addresses A 58 NJ series CPU Unit Software User s Manual W501 Appendices Variable name _CJB_SCUO0OP1ChgSta _CJB_SCUO0OP2ChgSta to _CJB_SCU15P1ChgSta _CJB_SCU15P2ChgSta Meaning Serial Communications Unit 0 Port 1 2 Settings Global local Global Changing Flags Serial Communications Units 1 to 15 Port 1 2 Settings Changing Flags Function TRUE when the parameters of the specified port are being changed TRUE when the Change Serial Communica tions Parameter SerialSetup instruction is being executed FALSE after the parameters are changed It is also possible for the user to indicate a change in serial port settings by turning ON the corresponding flag through the execution of an instruction or a user operation Data type BOOL Range of values TRUE or FALSE R W access Not retained Network Publish Published Usage in user program Possible Related instruc SerialSetUp tions Auxiliary Words Port on Serial Communications Unit with unit number 0 A620 Area Ports on Serial Communications Unit with unit numbers 1 to 15 A621 to A635 addresses Port on Serial Communications Unit with unit number 0 A620 01 to A620 02 ian Ports on Serial Communications Unit with unit numbers 1 to 15 A621 01 to A635 02 A 4 4 Motion Control Function Module Category Name MC Functional Classification Motion Control Functions Variable name _MC_ErrSta Meaning Motion Control F
545. s e EIP_TopAppCfgErr TCP IP Setting Error e EIP_NTPSrvErr NTP Server Connection Error e ElIP_DNSSrvErr DNS Server Connection Error Note Refer to information on the meanings of the error status bits at the end of this appendix for details _EIP_MacAdrErr MAC Address Indicates that an error occurred when the BOOL TRUE or page A 69 Error MAC address was read at startup FALSE TRUE Error FALSE Normal _EIP_LanHweErr Communications TRUE The communications controller failed BOOL TRUE or page A 69 Controller Error FALSE Normal FALSE _EIP_EtnCfgErr Basic Ethernet TRUE The Ethernet communications speed BOOL TRUE or page A 70 Setting Error setting Speed Duplex is incorrect Or a read FALSE operation failed FALSE Normal _EIP_IPAdrCfgErr TCP IP Basic TRUE BOOL TRUE or page A 70 Setting Error e There is an illegal IP address setting FALSE e A read operation failed e The IP address obtained from the BOOTP server is inconsistent e The DNS settings are not correct FALSE Normal _EIP_IPAdrDupErr IP Address Dupli TRUE The same IP address is assigned to BOOL TRUE or page A 70 cation Error more than one node FALSE FALSE Other than the above _EIP_BootpErr BOOTP Server TRUE There was a failure to connect to the BOOL TRUE or page A 70 Error BOOTP server timeout FALSE FALSE The BOOTP is not enabled or BOOTP is enabled and an IP address was normally obtained from the BOOTP server NJ series CPU Unit Software
546. s CPU Unit Software User s Manual W501 2 11 2 CPU Unit Operation 2 3 Control Systems This section describes the control systems that are used by the NJ series CPU Units i Types of Control An NJ series CPU Unit can perform two types of control sequence control and motion control 1 You execute sequence control with instructions other than motion control instructions in the user program 2 You execute motion control with motion control instructions in the user program for EtherCAT Servo Drives and encoder input slaves that are assigned to axes NJ series CPU Unit User program in PLC Function Module CJ series Units 1 Sequence Control Basic I O Units Instructions dp other than 5 2 motion S S control Execution instructions Q S i i g Special Units D O EtherCAT EtherCAT slaves to which axes are not assigned 2 Motion Control EtherCAT EiherCAT Servo Drives Master control processing Function gt Le slaves instructions Module l and other slaves e Synchroni Data is refreshed ona assigned to axes zation fixed control period Etc Group Variables 2 12 NJ series CPU Unit Software User s Manual W501 2 CPU Unit Operation i Relationship between Control Period and Tasks You assign programs to the periodically executed tasks to execute the user program Motion control and EtherCAT communications are synchronized with the primary periodic task which has the highes
547. s Controller Error Global local Global Function TRUE if there is a communications controller hardware error Data type BOOL Range of values TRUE or FALSE Usage in user program Possible Related instruc Reset EtherCAT Controller Error tions e ResetECError Variable name _EC_LinkOffErr Meaning Link OFF Error Global local Global Function TRUE if the communications controller link is not established Data type BOOL Range of values TRUE or FALSE Usage in user program Possible Related instruc Reset EtherCAT Controller Error tions e ResetECError A 62 NJ series CPU Unit Software User s Manual W501 Appendices Variable name _EC_NetCfgErr Meaning Network Configuration Information Error Global local Global Function TRUE if there is illegal network configuration information Data type BOOL Range of values TRUE or FALSE R W access Rs Retained Not retained Network Publish Published Usage in user program Possible Related instruc Reset EtherCAT Controller Error tions e ResetECError Variable name _EC_NetCfgCmpErr Meaning Network Configuration Verification Error Global local Global Function TRUE if the network configuration information does not match the actual network configuration Data type BOOL Range of values TRUE or FALSE R W access R ss Retained Not retained Network Publish Published Usage in user program Possible Related instruc Reset EtherCAT Controller Error tions e ResetECError
548. s Manual W501 Unit Versions Unit Versions Unit Versions A unit version has been introduced to manage CPU Units in the NJ Series according to differences in functionality accompanying Unit upgrades i Notation of Unit Versions on Products The unit version is given on the ID information label of the products for which unit versions are man aged as shown below Example for NJ series NJ501 OUULI CPU Unit ID information label Unit model Unit version i NJ501 1500 1 Ver 1 00 PORT1 MAC ADDRESS sO00000000000 PORT2 oS ADDRESS Benes a Lot number and serial number MAC address The following information is provided on the ID information label Item Description Unit model Gives the model of the Unit Unit version Gives the unit version of the Unit Lot number and Gives the lot number and serial number of the Unit serial number DDMYY Lot number L For use by OMRON xxxx Serial number M gives the month 1 to 9 January to September X October Y November Z December MAC address Gives the MAC address of the built in port on the Unit i Confirming Unit Versions with Sysmac Studio You can use the Unit Production Information on the Sysmac Studio to check the unit version of the CPU Unit CJ series Special I O Units CJ series CPU Bus Units and EtherCAT slaves The unit versions of CJ series Basic I O Units cannot be checked from the Sysmac Studio CPU Unit and CJ series Units 1 Doubl
549. s Manual W501 45 Terminology Term minor fault level Controller error Motion Control Function Module motion control instruction Network Publish observation partial fault level Controller error PDO communications periodic task PLC Function Module POU primary periodic task process data communications program Range Specification Retain SDO communications Servo Drive encoder input slave slave and Unit configurations Special Unit Setup structure 46 Description An error for which part of the control operations for one of the function modules in the NJ series Controller stop An NJ series CPU Unit continues operation even after a minor fault level Controller error Occurs One of the function modules The MC Function Module performs motion control based on commands from the motion control instructions that are executed in the user program A function block instruction that executes motion control The Motion Control Function Module supports instructions that are based on func tion blocks for PLCopen motion control as well as instructions developed specifi cally for the Motion Control Function Module One of the attributes of a variable This attribute allows you to use CIP message communications or tag data links to read write variables from another Controller or from a host computer One of the event levels for Controller events or user defined events These are minor errors that do not affe
550. s based on one of the basic data types The following is a list of the derivative data types e Structures e Unions e Enumerations Refer to 6 3 12 Restrictions on Variable Names and Other Program related Names for restrictions on the number of characters in data type names and other restrictions when you create a derivative data type EN Additional Information NJ series Controllers come with three different types of system defined derivative data types e System defined variables that are structures e Structures used for input output and in out variables for instructions e Structures for Special Unit expansion memory You must register these in the Unit Editor to use them i Structures A structure is a derivative data type that groups together data with the same or different variable types You can easily change data and add new data if you place your data into a structure For example you can define a Box structure that has three members Width Height and Depth in order to organize and group your data You can then use this structure data type to add a variable called Box1 You can then use it to access the different levels of the data by placing a period after the variable name followed by the name of the data you want to access For example Box1 Width or Box1 Height If you need to create a new variable to store more box data you can perform the same steps to add a new variable called Box2 to the variable table
551. s data type uses one item from a prepared name list as its value Refer to 6 3 6 Derivative Data Types for details Specifications for Data Types The following array specifications and range specifications are possible for all data types Type Description Array specification An array is a group of elements with the same data type You specify the number subscript of the element from the first element to specify the element You can specify arrays for both basic data types and derivative data types Range specification You can specify a specific range for a data type in advance You can specify a range for any integer basic data type Refer to 6 3 7 Array Specifications and Range Specifications for Data Types for details NJ series CPU Unit Software User s Manual W501 6 33 6 Programming 6 34 i Restrictions on Using Data Types A list of the data types that you cannot use in different POUs is given below Unusable data types POU type Type of variable Basic data types Derivative data types Programs Local variables i e internal variables None Global variables None FUN Input variables output variables and in out None Unions variables Internal variables None Return values None A structure or union FB Input variables output variables and in out None Unions variables Internal variables None i Bit String Real Number and Text String Data Formats This section describes the data formats fo
552. s from the Sysmac Studio to monitor the task execution status and task execution times i Monitoring Task Execution Status You can monitor the execution status of the programs in all of the tasks started stopped from the Sysmac Studio a N D m an w lt G D 3 Sysmac Studio Operation Place the Sysmac Studio online with the CPU Unit and select Task Settings Task Execution Sta tus Monitor The following tab page is displayed SOW UOI NOexy yse pue snes uonnoaxg yse BuHopuoN ZL Z S NJ series CPU Unit Software User s Manual W501 5 23 5 Designing Tasks 5 24 i Task Execution Time Monitor You can monitor the execution time of each task from the Sysmac Studio Values You Can Monitor from the Sysmac Studio Connect online to the CPU Unit from the Sysmac Studio and click the Task Execution Time Monitor Button on the Task Settings Tap Page The following display appears The items that you can monitor depends on whether you connect to the physical Controller or to the Simulator Connected to the Controller He gt oe EtherCAT gt CPU Expansion Racks I O Map gt amp Controller Setup gt i Motion Control Setup amp Cam Data Settings gt Event Settings e Task Settings F7 Data Trace Settings A Configurations and Setup 1QQ5 Task Settings x ae SU bA PrimaryTask Task Execution Time i O Min 326 0us Average 414 0us Max 506 4us Set periodi 4000us Period
553. s in the memory area where the address is assigned Retained areas Holding DM and EM Areas Non retained areas ClO and Work Areas Conditions Required to Enable the Retain Attribute The CPU Unit must contain a Battery Using Initial Values for Retain Variables When you download the user program select the Clear the present values of variables with Retain attribute Check Box p rf S Z D ea D N Operation with and without the Retain Attribute The following table shows when variable values are retained or not Values of variables Case Retain attribute speci Retain attribute not fied specified When power is turned ON after power interruption Retained Not retained When the operating mode is changed When a major fault level Controller error occurs When the Clear the present values of vari ables with Retain SOINQUHY SIQEHEA 8 9 When you download the attribute Check Box is user program selected When the check box is Not retained not selected Variables for Which You Can Specify the Retain Attribute AT specifications are made separately for each variable Set them for all elements and members of array structure and union variables f Initial Value The variable is set to the initial value in the following situations e When power is turned ON e When changing between RUN mode and PROGRAM mode e When you select the Clear the present value of variables with Retain attr
554. s printing func Printing tionality is used Data Trace Operation Processing for data traces sampling and trigger detection are performed in System Common Process ing 1 between I O refreshing and user program execution Example If sampling is specified in the primary periodic task data tracing is executed in System Com mon Processing 1 as shown in the following diagram Primary period Primary period Primary periodic yo 2 task refreshing 9 38 Display examples for data trace operations and execution results is given below for sampling in a spec ified task period EN Additional Information I O refreshing user program execution and motion control processing are all executed in the same task period For data tracing user program execution and motion control processing for the current task period and I O refreshing for the next task period are displayed at the same time The timing charts in the NJ series Motion Control Instructions Reference Manual Cat No W508 are based on the task periods so the display are not the same as those for data tracing Example 1 In this example the SysRun variable is changed to TRUE in the user program when the Sensor vari able assigned to the sensor input signal changes to TRUE IF Sensorl is TRUE then set SysRun to TRUE Sensorl SysRun The data trace operations and display of the execution results are given below J 1 In data trace processing
555. s value gives us 1 010110101 x 28 From the above expression we can determine that e 127 6 so e 133 or 10000101 in binary Q ROH Next we take the value after the decimal part of 1 010110101 which is 010110101 This is not enough for the 23 bit mantissa so fis this number with the required amount of zeroes added to the end Therefore f 01011010100000000000000 Therefore you can express 86 625 as shown in the following figure Sign Exponent Mantissa REAL data 32 bits 10000101 01011010100000000000000 31 30 23 22 O Valid Ranges The valid ranges for REAL and LREAL data are shown in the following table There are a range of values that you cannot express as you approach 0 o OO REAL 3 402823e 38 to 1 175494e 38 1 175494e 38 to a 3 402823e 38 LREAL 1 79769313486231e 308 to 2 22507385850720e 308 to 2 22507385850720e 308 1 79769313486231e 308 REAL 3 402823e 38 REAL 3 402823e 38 LREAL 1 79769313486231e 308 LREAL 1 79769313486231e 308 5 d w oo 0 foo D 3 eae e ee REAL 1 175494e 38 REAL 1 175494e 38 LREAL 2 22507385850720e 308 LREAL 2 22507385850720e 308 Special Values Values such as positive infinity negative infinity 0 O and nonnumeric data are called special val ues Nonnumeric data refers to data that you cannot express as a floating point number and there fore cannot be treated as a numeric value Although 0 and 0 both mathematically mean 0
556. sd Seek aaa dd itched EE AE divert asasds 9 17 9 4 2 CPU Unit Names and Serial IDS 22e ccceea chee soe eee a 9 19 9 4 3 F ROTC CUOM naron Gee cena ia ed tin sea madame ih ca laeaa ecu ies a a apenas Sectaveckta acids 9 21 9 4 4 CPU Unit Operation Restrictions for the User Program Execution ID ccseeeeeeeeeeeeeeeeees 9 25 9 5 DEDUGG NAG iia aa a tats aE davies a a Ea e a 9 28 9 5 1 Forced ReresShiNg iinr E a EE 9 28 9 5 2 Changing Present Vales naera eaten tie Se aes Sede dS e eden Ss 9 32 9 5 3 ONING ete 0 resene a terete Peer aera Deri ene teen erst eet eee nr eres cere 9 34 9 5 4 Data Tra CWING eee tes stick dee sensed A hctana steed vadsadeten csicie maak EE 9 35 O26 EVEN OOS erone a a etvee eae tei a a 9 43 9 6 1 NVTEOCUICT ON cetestecnatecctcasatvescnasacaxdnea tte cm vecanceenteataenesseeeean tee veseatoneesae S 9 43 9 6 2 Detailed Information ON Event LOGS cccccssseeccceeeeeeeeceeeeeeeeceueeeecaaeeececsuaueeeessaeeeeeeaaneeessaaanees 9 44 9 6 3 Controller Events Controller Errors and Information cccccssseeececeeeeeeceseeeeecaeeeeeeeseeeeeeeeas 9 49 9 6 4 User defined Events User defined Errors and Information cccccseeeeeeceeeeeeeeaeeeeeesaeeeees 9 50 9 7 Using the Sysmac Studio to Back Up and Restore Data csssseseeeeeeeseseeseeeneseees 9 57 9 7 1 Backing Up and Restoring the Present Values of Battery backup Memory ccccsseeeeees 9 57 Section 10 Comm
557. se and correction Attached information Precautions Remarks 12 22 User Program Controller Configurations and Setup Trans 10200000 hex fer Error The user program or Controller Configurations and Setup were not transferred correctly PLC Function Module Source details None Detection At power ON or Motion Control Function Module timing Controller reset EtherCAT Master Function Module EtherNet IP Function Module Level Major fault Recovery Cycle the power Log category System supply or reset the Controller The user program or Controller Con Clear all of memory and then down Do not turn OFF the power supply to figurations and Setup are not correct load the project from the Sysmac Stu the Controller or disconnect commu because the power supply to the Con dio If attached information is nications with the Sysmac Studio dur troller was interrupted or communica registered cycle the power supply to ing a download of the user program or tions with the Sysmac Studio were the Controller and then implement the the Controller Configurations and disconnected during a download of above correction Setup the user program or the Controller Configurations and Setup The user program or Controller Con Do not interrupt the power supply to figurations and Setup are not correct the Controller during online editing because the power supply to the Con troller was interrupted during online editing The user pr
558. se numeric_value Example Correct bit_string_variable WORD 16 3 Wrong bit_string_variable 3 A Precautions for Correct Use e You cannot compare the sizes of bit string data types BYTE WORD DWORD and LWORD You must convert variables of these types to an integer data type with a data conversion instruction e g WORD_TO_UNIT before you can compare the values Example BCD_data WORD IF WORD_BCD_TO _UNIT BCD_data gt UINT 1234 THEN e You cannot perform logic processing on integer data types SINT INT DINT LINT USINT UINT UDINT and ULINT You must convert variables of these types to a bit string data type with a data conversion instruction e g INT_TO_WORD before you can perform logic opera tions Example a INT IF INT_TO_WORD a AND WORD 16 0001 THEN When a is odd NJ series CPU Unit Software User s Manual W501 6 Programming Time related Data Durations Notation TIME day d hounh mi TIME 61m5s nutes m seconds s mil liseconds ms T day d hounh min T 61m5s utes m seconds s milli seconds ms Dates DATE year month DATE 2010 1 day 10 D yearn month day D 2010 1 10 Times of Day TIME_OF_DAY houn TIME_OF_DAY minutes seconds 23 59 59 99999 9999 TOD houn min TOD 23 59 59 9 utes seconds 99999999 Dates and Times Remarks You can also include decimal points such as in T 12d3 5h You can also include numerical valu
559. select Synchronization from the Controller Menu The data on the computer and the data in the physical Controller are compared automatically 2 Click the Transfer to Controller Button Note Use the Synchronization Menu of the Sysmac Studio to upload and download data 7 2 2 Checking I O Wiring You can check the wiring by using forced refreshing of real I O from the I O Map or Watch Tab Page 7 2 3 MC Test Run uny S 1 pue HUF MdD 24 0 yalo1g OY Bulaysuedl Z Z MC Test Run is used mainly to perform the following operations from the Sysmac Studio without a user program e Checking wiring You can monitor Servo Drive connector I O signals and Servo Drive status e Checking the operation and direction of the motor You can turn ON the Servo and jog axes e Checking electronic gear settings You can perform relative positioning and check and change travel distances e Checking homing You can check the homing operation 7 Connect online to the CPU Unit from the Sysmac Studio and perform the MC Test Run on the MC Test Run Tab Page Refer to the NJ series CPU Unit Motion Control User s Manual Cat No W507 for details Use the following procedure yelo1g eu HUM JSULIL Z Z 1 After you complete the necessary wiring connect the Sysmac Studio online to the CPU Unit 2 Create axes assign the axes and set the following axis parameters Axis parameter settings required for MC Test Run operation Unit of Display Co
560. series Motion Control Instructions Reference Manual CJ series Special Unit Manuals for NJ series CPU Unit 42 Model numbers Application Learning the basic specifi cations of the NJ series CPU Units including intro ductory information designing installation and maintenance Mainly hard ware information is pro vided Learning how to program and set up an NJ series CPU Unit Mainly software information is provided Learning about motion control settings and pro gramming concepts Learning about the specifi cations of the instruction set that is provided by OMRON Learning about the specifi cations of the motion con trol instructions that are provided by OMRON Learning how to use CJ series Units with an NJ series CPU Unit Description An introduction to the entire NJ series system is provided along with the following information on a Controller built with an NJ501 CPU Unit e Features and system configuration e Introduction e Part names and functions e General specifications e Installation and wiring e Maintenance and inspection Use this manual together with the NJ series CPU Unit Software User s Manual Cat No W501 The following information is provided on a Con troller built with an NJ501 CPU Unit e CPU Unit operation e CPU Unit features e Initial settings e Programming based on IEC 61131 3 lan guage specifications Use this manual together with the NJU series C
561. served Words gt a D Oo D 3 3 5 rr D c D Q D o Combination of a colon and an equals sign Statement Structure lt variable gt lt expression gt lt variable gt lt variable gt lt variable gt lt constant Application Use this statement to assign a value to a variable For example use it to set initial values or to store the results of a calculation e6benbue7 1x9 painionus S 9 Description This statement assigns or stores the lt expression_value gt to the lt variable gt Example Example 1 The following statement assigns the result of the expression X 1 to variable A Example 2 The following statement assigns the value of variable B to variable A A B Example 3 The following statement assigns a value of 10 to variable A Precautions e Either the source data type must match the destination data type or the combination of data types must allow implicit casting Otherwise a compiling error will occur NJ series CPU Unit Software User s Manual W501 6 79 6 Programming 6 80 e If the value that is assigned is STRING data make the size of the destination STRING variable larger than that of the source string Otherwise an error will occur e For STRING variables assignment is allowed if the size of left hand variable is greater than the size of the text string stored in right hand variable Example Assignment is allowed i
562. sk is incorrect There are too many Units and slaves that perform I O refresh in the task period There is no unused time avail V page 12 19 able for task execution The system service execution interval is too short or the sys tem service execution time ratio is too long in the system ser vice execution time settings The task period setting is too y page 12 20 short A user program is too large The number of times that pro cessing is repeated is larger than expected The priority of the periodic task is incorrect The task period setting is too y page 12 21 short A user program is too large The number of times that pro cessing is repeated is larger than expected The priority of the periodic task is incorrect 12 13 ol A N Oo ea D o gt Oo oO 5 qEL 10113 c g l 12 Troubleshooting i Errors Related to Controller Operation Level The user program 10200000 hex User Pro gram Con troller Configura tions and Setup Trans or Controller Con figurations and Setup were not transferred cor rectly fer Error e The user program or Controller page 12 22 Configurations and Setup are not correct because the power supply to the Controller was interrupted or communications with the Sysmac Studio were disconnected during a down load of the user program or the Controller Configurations and Setup e The user program or Controller Configurat
563. sk execution time 120 us SsBull1eS BUUONUO 2313S WaISAS y BulyoeUD Z 8 S 5 3 2 Checking the System Service Monitoring Settings System services are executed during the unused time between executions of all of the tasks The CPU Unit monitors the percentage of the task period that is used for execution of system services based on the System Service Monitoring Settings in the Controller Setup The system service execu tion times must be greater than the values in the System Service Monitoring Settings If they are not an Insufficient System Service Time Error occurs and user program execution is stopped You must there fore ensure that there is sufficient time available In a configuration that consists of only a primary periodic task the system service execution time is the task period minus the task execution time By default system service execution time is monitored at 10 of the task period Therefore you would design the system so that the average task execution time was less than 90 of the task period NJ series CPU Unit Software User s Manual W501 5 27 5 Designing Tasks However some system servicing is executed in parallel with task execution Also the task execution time varies greatly with the external environment Therefore you cannot judge system performance based on this one condition Use it as a guideline 5 3 3 Examples of Task Design 5 28 This section describes the steps that are required for an exam
564. slave is TRUE if message communications are enabled for it pre operational safe operation or operational state Note Use this variable to confirm that message communications are possible for the relevant slave before you execute message communications with an EtherCAT slave Data type Array 1 192 OF BOOL Range of values TRUE or FALSE Usage in user program Possible Related instruc Disconnect EtherCAT Slave tions e EC_DisconnectSlave Connect EtherCAT Slave e EC_ConnectSlave NJ series CPU Unit Software User s Manual W501 A 65 a w Oo D z O ot O 5 o O 5 a Q v w lt m mp D F Q h 5 D Q S o D o Miobeyed ainpoy uojoun4 Je seyW LV0104 S p V 94 WEN Appendices Variable name _EC_PDSlavTbl Meaning Process Data Communicating Slave Table Global local Global Function This is a table that indicates the slaves that are performing process data communications Slaves are given in the table in the order of slave node addresses The element for a slave is TRUE if process data of the corresponding slave is enabled operational for both slave inputs and outputs Note Use this variable to confirm that the data for the relevant slave is valid before controlling an EtherCAT slave Data type Array 1 192 OF BOOL Range of values TRUE or FALSE Usage in user program Possible Related instruc Disconnect EtherCAT Slave tions e EC_DisconnectSlave Connect
565. ssigned to the I O ports for each slave or Unit These device variables are also automatically registered in the variable table specified in the Variable Type Column i Automatically Creating New Device Variable Names The device variables are named automatically from a combination of the device name and the I O port names You assign device variables using this method in the following cases e When you do not want to spend time manually entering device variable names e To automatically create device variable names to use to access operating data and setup data for Special Units sejqeue 2q Buuseisibey Z vy Use the following procedure 1 Create the slave configuration information or Unit configuration information 2 Set a device name in the EtherCAT Editor or the Unit Editor Item name Value Model name CJ1W OD232 Product name Transistor Output Unit Specifications 24V DC 0 5A 32 sourcing outputs loa Rack No 0 Slot No 0 The possible default device names are as follows e For slaves the device names start with an E followed by a sequential number starting from 001 e For Units the device names start with a J followed by a sequential number starting from 01 3 Right click a slave Unit or one or more I O ports in the I O Map and then select Create Device Variable from the menu NJ series CPU Unit Software User s Manual W501 3 15 3 I O Ports Slave Configuration and Unit Configuration Port
566. st byte 2 os O N j First byte 3 Variable A b First byte 4 J oem Variable Table CAE Variable A a Stored with a alignment 2 byte alignment Name Data type First byte 5 ne First byte 6 Nt uson 3 First byte 7 First byte 8 Variable A c First byte 9 S Stored with a Dem ie ial a 4 byte alignment First byte 10 First byte 11 DH NJ series CPU Unit Software User s Manual W501 A 87 Appendices A 7 2 Important Case Examples When you exchange structure variable data between an NJ series CPU Unit and another device you must align the memory locations of the structure variable members with those of the other device This is not necessary when you exchange data between NJU series CPU Units You need to be aware of the locations in memory of structure variable members in the following cases Data type Reading and Writing Variables through CIP Messages or EtherNet IP Tag Data Links between an NJ series CPU Unit and Another CPU Unit When the object for a tag data link includes a structure variable make sure that the locations in memory of the structure variable members matches between the NJ series CPU Unit and an other CPU Unit you need to exchange data with For example the differences in memory configuration for structure variables between an NJ series CPU Unit and a CJ series CPU are shown below NJ series S
567. ster Control End instruction Master control is useful to control the execu tion conditions of a relatively long series of instructions T N u a Yo D 3 3 5 u O D c O 5 D Refer to information on the MC and MCR instructions in the NJ series Instructions Reference Manual Cat No W502 for details i Master Control Programming Languages You can use master control in ladder diagrams JoUOD J SEN 2 9 You cannot use master control with ST You also cannot use master control for inline ST inside a ladder diagram Example Inside a Master Control Region Ladder diagram algorithm The ladder diagram is reset by the master Programs control For example the output variables from OUT instructions change to FALSE Inline ST aime is done Ladder diagram algorithm The ladder diagram is reset by the master control For example the output variables from OUT instructions change to FALSE i Operation of Instructions That Are Reset in a Master Control Region Refer to information on the MC and MCR instructions in the NJ series Instructions Reference Manual Cat No W502 for the operation of other instructions in the master control region when master control is reset User defined function block NJ series CPU Unit Software User s Manual W501 6 109 6 Programming 6 110 NJ series CPU Unit Software User s Manual W501 Simulation Transferring Projects to the P
568. stination Any combination that is not connected will cause a compil ing error USINT UINT UDINT _ _ULINT A A A A l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l SINT INT DINT _ LINT REAL gt LREAL When you assign the value the sign and absolute value of the number do not change sonne gt When you assign the value the sign and absolute value of the number may change Example intVar 1 intVar 16 FFFF uintVar 1 uintVar intVar uintVar 16 FFFF or 1 was assigned but the result is 65535 Even if the arrow does not connect directly to a data type you can still perform assignments for the data types For example SINT gt USINT gt UINT gt UDINT gt ULINT are all connected so you can write an assignment such as ULINT SINT 6 78 NJ series CPU Unit Software User s Manual W501 6 Programming Casting Rules in Expressions in Statements The implicit cast rules for right hand arithmetic expressions in assignment statements and for assigning the value of the right hand side to the left hand side also apply to expressions in state ments Example CASE A B C OF Result1 to ResultN to END_CASE i ST Language Statements Assignment Overview This statement assigns the right side i e the value of the expression to the left side i e the vari able Re
569. store i Task Settings e If a Task Period Exceeded error occurs shorten the programs to fit in the task period or increase the setting of the task period i Motion Control e Use the system defined variable in the user program to confirm that EtherCAT communications are established before you attempt to execute motion control instructions Motion control instructions are not executed normally if EtherCAT communications are not established e Use the system defined variables to monitor for errors in communications with the slaves that are controlled by the motion control function module Motion control instructions are not executed nor mally if an error occur in slave communications e Before you start an MC Test Run make sure that the operation parameters are set correctly e Do not download motion control settings during an MC Test Run i EtherCAT Communications e Do not disconnect the EtherCAT slave cables during operation The outputs will become unstable e Set the Servo Drives to stop operation if an error occurs in EtherCAT communications between the Controller and a Servo Drive i Battery Replacement e Be sure to install a replacement Battery within two years of the production date shown on the Battery label e Turn ON the power after replacing the Battery for a CPU Unit that has been unused for a long time Leaving the CPU Unit unused again without turning ON the power even once after the Battery is replaced may result i
570. t F Sysmac Studio w Progr ramming Executes a simulation a Eec x07 0 1 1 0 Speed Click the Stop Button in the Simulation Pane to stop the simulation i Executing a Partial Simulation You can select what to simulate in the Multiview Explorer to execute a specific task a specific section or a program D Setting the Simulation Speed Drag the Simulation Speed Slider in the Simulation Pane You can change the simulation speed from 0 1x to 1x You can change the speed during a simulation 7 1 4 Sysmac Studio Online Operations The Simulator provides the same online operations as those supported when the Sysmac Studio is connected to a physical NJ series Controller e Monitoring the present value of variables e Changing the present value of variables e Forced refreshing variables e Operating status displays e Data tracing 7 4 NJ series CPU Unit Software User s Manual W501 7 Simulation Transferring Projects to the Physical CPU Unit and Operation 7 1 5 Simulation Debugging You can use simulation debugging to stop the operation of the Simulator or to execute a program one step at a time to check the validity of the program logic Step Execution This function stops execution after only one step is executed You can use step execution for ladder diagrams ST and inline ST Continuous Step Execution This function continually performs step execution at a specified interval Step
571. t BOOL array variable Output data This notation specifies the value when union Output is treated as a single WORD variable Specifying the Union The union represents all members that make up the union Unions are expressed by the name of the union variable In the example above you would write Output Creating Unions 1 Create a union data type in the Union Table Specify the data type names and different data types of the members of the union 2 Specify the union data type from above as the data type and register the variable in the variable table Example Here OUT16_ACCESS is defined as the data type of a union The members of this union are a BOOL array with 16 elements and a WORD variable The variable Output is registered with a data type of OUT16_ACCESS You can now read write variable Output as a BOOL value for any of the 16 bits and as a WORD value Data Type Definitions OUT16ACCESS ARRAY 0 15 of BOOL BvteData Byala ARRAY O 1 of BYTE 7 1 0 3 WORD ee ar a 15 8 7 0 WordData OUTI6ACCESS 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 BoolDatar o 3005 ie Se oe a iia P02 aes a ae a 30 ByteData WordData 16 1234 Orch eee ane a re ee ee ere eee ee pee rege ee ey ee ee oa ae re ee on pe ee eee eae l l 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 BoolData ByteData WordData 6 42 NJ series CPU Unit Software User s Manual W501 6 Programming Union Specif
572. t are not the same Example Assignment Statement Where the Right Side is an Arithmetic Expression A B C D n F 1 2 3 When the data types of the operands in statement are not the same e6benbue7 1x9 painionus g 9 9 Example Integer Expression in a Statement CASE A B OF INT 1 S 3 def INT 10 NJ series CPU Unit Software User s Manual W501 6 77 6 Programming Casting Rules When the Right hand Side of an Assignment Statement Is an Arithmetic Expression e For the right hand operand you can use any combination of the data types that are supported for the operator operand e Of the operands on the right side the operand with the highest rank is considered the data type of the entire side Refer to the Data Type Ranking Table given below for the data type ranks e If both an unsigned integer and a signed integer with the same ranks exist on the right side the data type of the right side is considered to be unsigned Data Type Ranking Table The higher the rank the larger the range absolute values and precision of numerical values that the data type can express Rank Data type USINT SINT and BYTE UINT INT and WORD REAL DINT UDINT and DWORD LREAL LINT ULINT and LWORD Oo O1 B amp B W PM Casting Rules When You Assign the Right hand Value to the Left hand Side In the following chart a cast is performed if an arrow connects the data type of the source to the data type of the assignment de
573. t exe cution priority of all of the periodically executed tasks If you assign the programs to the primary periodic task user program execution motion control and refreshing for EtherCAT slaves are all executed in a constant period CPU Unit Y do O e 5 o V lt Gi D 3 D Control period Control period Control period User program control period Communications cycle Communications cycle Communications cycle EtherCAT y y y communications cycle I O refreshing emf refreshing I O refreshing Units slaves_ Units slaves Units slaves Processing is performed in a constant period The following periods all have the same length 1 user program control period 2 motion control period and 3 EtherCAT slave refresh period NJ series CPU Unit Software User s Manual W501 2 13 2 CPU Unit Operation The Difference between Sequence Control and Motion Control Sequence Control System The PLC Function Module executes the instructions in the user program to access the mounted Basic I O Units mounted Special Units and EtherCAT slaves without axis assignments through vari ables and I O ports The data is exchanged on the same period as shown below Task period of the primary periodic task Process data communications cycle CJ series Basic I O Units and Special Units NJ series CPU Unit PLC Function Module User program execution Slaves EtherCAT Master Processin
574. t include 0 is set for a Range Specification 6 3 8 Variable Attributes This section describes the variable attributes other than the Variable Name and Data Type Variable Name The variable name is used to identify the variable Each variable in a POU must have a unique name However you can declare local variables with the same variable name in different POUs These are treated as two separate variables You cannot declare a local variable with the same variable name as a global variable Refer to 6 3 12 Restrictions on Variable Names and Other Program related Names for restrictions on variable names 6 50 NJ series CPU Unit Software User s Manual W501 6 Programming i AT Specification Use the AT Specification attribute to specify the internal I O memory address of a variable in memory used for CJ series Units AT specifications are used mainly to specify specific memory addresses for the following Special Units e Addresses in fixed allocations for DeviceNet Units e Addresses in user specified allocations for DeviceNet Units from the CX Integrator e Addresses in expansion memory for High speed Counter Units e Addresses in expansion memory for Process I O Units If this attribute is not set the variable is automatically assigned to an address in variable memory EN Additional Information When you assign a device variable to an I O port they are automatically given an AT specifica tion internally Allocation A
575. t initialized at startup Data type UDINT 0 to 4294967295 Usage in user program Related instruc tions NJ series CPU Unit Software User s Manual W501 A 51 a w Oo D z O ot O 5 o O 5 a Q v w lt m mp D F Q D h 5 D Q S 9 o D o A105929 ON J9 01 U0D SOUAS PN EJBAC BU 104 SB QeUeA PeUIJep WaISAS Y Y Appendices Variable name _PowerOnCount Meaning Power Interruption Count Global local Global Function Contains the number of times that the power supply has been interrupted The value is incremented by 1 each time the power supply is interrupted after the first time that the power was turned ON To reset this value overwrite the current value with 0 The value is not updated after it reaches 4294967295 This variable is not initialized at startup Data type UDINT 0 to 4294967295 Usage in user program Related instruc tions Variable name _RetainFail Meaning Retention Failure Flag Global local Global Function TRUE at the following times failure of retention during power interruptions e When an error is detected in the battery backup memory check at startup FALSE at the following times no failure of retention during power interruptions e When no error is detected in the battery backup memory check at startup e When the user program is downloaded e When the Clear All Memory operation is performed Note When the encoder home offset data is not re
576. t the operating mode at startup to RUN mode or PROGRAM mode Refer to 8 2 2 Operating Mode Changes for information on the operating modes Power supply Yip Yj Yip ee e e l N A D O Ready state D Q Operating mode Startup state BC Coad made RUN indicator Flashing Mant ee ee A Outputs from Basic Refer to Output Bit Status Output Units OFF for CJ series Basic Output Units Status of Output Bits for EtherCAT Slaves The status of slave outputs before the start of EtherCAT communications depends on settings in the slaves After EtherCAT communications start the slaves output the values of the device variables The values of device variables in RUN mode depend on the results of user program execution These values then determine the output values of slaves j N ER D 5 O D ae nO 5 D ol O Z 8 2 2 Operating Mode Changes You can start and stop the execution of the user program when the CPU Unit is in Ready State You change the operating mode to start and stop user program execution i Operating Modes There are two operating modes RUN mode and PROGRAM mode NJ series CPU Unit Software User s Manual W501 8 3 8 CPU Unit Status RUN Mode The user program is executed in RUN mode The default setting of the operating mode at startup is RUN mode PROGRAM Mode The user program is not executed in PROGRAM mode Use this mode to transfer the project with the us
577. t variable TRIG QUT RESULT Input parameter Input variable Output variable Output parameter Algorithm e Function Block Settings When you create an instance of a function block definition make the following settings Settings of a function block instance in a program Instance name P N u O C O _ u Oo D 3 O a D N D a e 5 Cc g Function block name Local Variable Table Output parameters Input In out Output variables variables variables Input parameters Internal variables Algorithm e Written as a ladder diagram or in ST e You can use any instructions user defined functions and user defined function blocks syoo q uooUN uo sjed S Z 9 Created in the Function Definition Function Block Name or Instruction Name This is the function block name or instruction name assigned in the function block definition when the function block is created Instance Name You give an instance name to a function block instance in a program to enable managing it You specify an instance name when you call a function block definition from a program or another func tion block NJ series CPU Unit Software User s Manual W501 6 9 6 Programming Algorithm You can code the algorithm either as a ladder diagram or in ST You can use any instruction user defined function or user defined function block in the algorithm Local Va
578. ta was transferred for the user program or Controller Configurations and Setup e Non volatile memory is deterio rating or has failed The Controller started in Safe Mode 40160000 hex e The power supply was turned ON to the Controller when Safe Mode was set on the DIP switch on the CPU Unit e A low battery voltage prevented retention of memory during a power interruption 10230000 hex Event Log Restoration Error Restoring the event log failed 10260000 hex Trace Setting The power supply Transfer Fail was interrupted e The power supply was inter rupted while transferring the trace settings 90010000 hex 90020000 hex 90080000 hex TRUE with specified by the user Forced Refreshing refreshing was specified 12 14 12 Troubleshooting Level O 90090000 hex Variable Changing a variable e Changing a variable to FALSE page 12 26 to FALSE with with forced refreshing was forced refreshing specified by the user was specified Changed to Clearing all forced Clearing all forced refreshing Py ff page 12 27 Refreshing 900A0000 hex All Forced Refreshing Cleared FALSE with Forced refreshing values values was specified by the was specified user 900B0000 hex 90110000 hex 90120000 hex 90130000 hex 90140000 hex 90150000 hex 90160000 hex 90180000 hex 90190000 hex i Errors Related to FINS Communications Memory All All of memory was
579. tained the status is given in the error status of the axis vari able and not in this flag Data type BOOL Range of values TRUE or FALSE Usage in user program Related instruc tions Functional Classification Programming Variable name P_On Meaning Always TRUE Flag Global local Global Function This flag is always TRUE Data type BOOL Range of values TRUE Usage in user program Related instruc tions Variable name P_Off Meaning Always FALSE Flag Global local Global Function This flag is always FALSE Data type BOOL Range of values FALSE Usage in user program Related instruc tions Variable name P_CY Meaning Carry Flag Global local Local Function This flag is updated by some instructions Data type BOOL Range of values TRUE or FALSE Usage in user program Related instruc tions A 52 NJ series CPU Unit Software User s Manual W501 Appendices Variable name P_First_RunMode Meaning First RUN Period Flag Global local Local Function TRUE for one task period when PROGRAM mode changes to RUN mode Use this flag to perform initial processing when the CPU Unit begins operation Data type BOOL Range of values TRUE or FALSE Usage in user program Related instruc tions Variable name P_PRGER Meaning Instruction Error Flag Global local Local Function This flag changes to and remains TRUE when an instruction error occurs It remains TRUE until changed to FALSE from the user pr
580. task This is a major fault level Controller error Execution of the user program stops when the error occurs This error occurs only for the primary period task and if I O refreshing is set the priority 16 period task Primary periodic task I O Refreshing Timeout Error Error name Error level Correction I O Refreshing Major fault Review the task settings and download the project again Timeout Error The power supply must be cycled or the CPU Unit reset Primary period Primary period Primary period lt M _ ius Task Period Exceeded Error occurs Primary period Primary period E M ure 1 O Refreshing Timeout Error occurs 5 22 NJ series CPU Unit Software User s Manual W501 5 Designing Tasks i Insufficient System Service Time Error An Insufficient System Service Time Error occurs if the time that is specified in the time that is set for the system service monitoring setting cannot be obtained This is a major fault level Controller error Execution of the user program stops when the error occurs Insufficient System Service Time Error Error name Error level Correction Insufficient Sys Major fault Review the task settings and the system service monitoring set tem Service Time tings and download the project again Error The power supply must be cycled or the CPU Unit reset 5 2 12 Monitoring Task Execution Status and Task Execution Times You can use online operation
581. tect Store an observa tion level log record Task Timeout Sets the task execution Primary peri Primary peri When down Not allowed Detection timeout time A Task odic task and odic task and loaded to Time Execution Timeout Error periodic periodic CPU Unit occurs when the time tasks Task tasks out time is exceeded period x 1to 5 periods Task period x 5 Variable Sets the percentage of 1 to 50 3 When down Not allowed Access Time the task period to assign loaded to to variable access from CPU Unit outside the Controller O Control Task Settings The I O Control Task Settings are used to set the timing of refresh execution of inputs and outputs ae Configurations and Setup amon 1 4 I O Control Task Settings gt ig EtherCAT gt Sh CPU Expansion Racks Unit Position Unit Task Name I O Map v CPU Expansion Racks gt i Controller Setup CPU Rack 0 Y CPU Rack 0 gt t Motion Control Setup 00 CJ1W 0D232 Transi Primary Task e Cam Data Settings 01 CJ1W V680C12 ID PrimaryTask gt Event Settings Ie Task Settings Data Trace Settings v EtherCAT Network Configur EtherCAT Maste Master Node1 R88D KNO1L ECT Node2 R88D KNOIL ECT Node3 R88D KNO1L ECT gt Programming i Node4 R88D KNO1L ECT 4 6 CS CJ NSJCJ2 Series Instructions Reference Manual W474 4 Controller Setup Task Name Sets the task to use to PrimaryTask or PrimaryTask When down Not
582. ted to the PLC Function Module 4 2 Initial Set Controller Setup Startup Mode Write Protection System Service Moni aad aie toring Settings and other settings Module Initial Settings for Special Units 4 3 Initial Set Unit Configuration and Setup Initial settings for the Special Units Poa goia Initial Settings for the Motion Control Function Module 4 4 Initial Set tings for the e Axis Parameters Motion control parameters for single axis operation Motion Control e Axes Group Parameters Motion control parameters for multi axes coor Function Mod I ol Oo lt oO _ mp gt g O e gt mp 2 U mp O dinated operation ule e Cam data Phase and displacement setting tables for cam motions Initial Settings for the EtherCAT Master Function Module 4 5 Initial Set EtherCAT Master Parameters in the EtherCAT Configuration o TN Parameter settings for the EtherCAT master process data communications ler Funcion cycle and other settings Module Initial Settings for the EtherNet IP Function Module 4 6 Initial Set Ethernet Port Setup EtherNet IP Port TCP IP Settings Ethernet Settings py et and other settings Function Mod ule CS CJ NSJCJ2 Series Instructions Reference Manual W474 4 3 4 Controller Setup 4 2 Initial Settings for the PLC Function Module This section describes the initial settings that are required for the PLC Function Module 4 2 1
583. tee devine evicds a a a atest aheuteenanded Gack 7 7 7 2 2 CHECKING OO WINN sieisen ni aa O EO 7 7 7 2 3 MGE TESCH sen a a ee eee ere 7 7 Staring Opera UON oeei a aE a a E a eee eaten aE 7 8 NJ series CPU Unit Software User s Manual W501 15 CONTENTS Section 8 CPU Unit Status 8 1 Overview Of CPU Unit SlQtus isi icccccscsausses cepntecnd seceactasiecestesecdcorsacensecssntiestexectusneincettanerscessteesest 8 2 82 Slate Change Scoio ates hacia a ee Sesecnievieitie yecteieravueessanebiee 8 3 8 2 1 When Power lIs Turned OWN xc 2 c0c 2 ccsceneensacacadebnnshcceleseiate thas seadbeletedehsaethaasepinatade Uaesaorbsacaneadteiteseseds 8 3 8 2 2 Operating Mode Chang CS ixaccicsiwadicd nocd Atiansenieitiaiechaneclauen eicak cd N E patente R 8 3 8 2 3 When Downloading Data from the Sysmac Studio to CPU Unit eee eee eee eeeeeeeeeeeeees 8 6 8 2 4 Status for Controller Errors or x23 23cscceu r wecehcede ae ecietadec a a ace nee heeds 8 7 Section 9 CPU Unit Functions 9 1 Data Management Clock and Operating FUNCTIONS cccsssseeeesseeeeseeseeneeeeeseeeeeeneneeenees 9 3 9 1 1 Clearing All MGMONY merrer terest Core ei nirens Gane teen seats eee eee 9 3 9 1 2 COC E EE E ET E EE E Ave es E TAE ee ES E asda eae een dias E Bae Meee ES 9 3 9 1 3 RODEO sse a S 9 6 9 2 Management Functions for CJ series Units ccccceesseesesseeeeenseeeeseeseesseeeeneeseesseeeeeseesenees 9 7 9 2 1 Basie VO UMIS meae a a teeete ee ee e
584. tem Ser Sets the intervalof 10ms 10ms When Not Settings Service vice Execu system service to1s trans allowed Operation Monitor tion Interval execution ferred to Settings ing Set ms CPU Unit Tab Basic tings System Ser Sets the ratio for 5 to 10 When Not Settings vice Execu monitoring system 50 trans allowed tion Time service execution ferred to Ratio CPU Unit Precautions for Correct Use e The System Service Monitoring Settings are used to monitor whether the specified system service execution time can be obtained System services will not necessarily be executed for the specified time e To increase the system service processing time increase the task period or take other steps to increase the unused time between task execution e f the system service monitoring setting is too high for the unused time between task execu tion an Insufficient System Service Time Error occurs and user program execution stops Set system service monitoring setting to the minimum value that is required to meet the response performance for the required system services e Depending on the execution of system service processing a Task Period Exceeded Error may occur for the priority 17 or priority 18 periodic task Design the tasks so that the task process ing for the priority 17 and priority 18 periodic tasks is completed even if system service pro cessing is performed for the times that is specified in the system servic
585. tep 2 3 Programming Step 2 4 Offline Debugging Step 3 Mounting and Setting Hardware Step 4 Wiring Step 5 Confirming Operation and Starting Actual System Operation Refer to 1 3 Overall Operating Procedure for the NJ series Controller for details NJ series CPU Unit Software User s Manual W501 10 Communications Setup 10 1 1 Introduction You can use the NJ series System to build the communications system shown below HMI NJ series Controller NJ series Controller mi p BOOTP server a DNS server M in 1th Ti lin as C ie CHH Pe oO O o 3 3 S 5 O tet o gt n wm lt n r D 3 OQ lt D ge aer EtherNet IP EtherNet IP Sysmac Studio 2 Example Serial Communications Unit L NJ series Controller i General purpose 5 A Power Supply Unit CPU Unit device with serial ef communications USB ee al S E T Serial A L AA S Built in EtherNet IP port Ue i Example DeviceNet Unit Built in EtherCAT DeviceNet port EtherCAT J Hi ae Connection Connection method Sysmac Studio connection Use USB or the built in EtherNet IP port Connections between Controllers Connections with NJ series Control Use the built in EtherNet IP port ler or CJ2 CPU Unit Connections to CS CJ series PLCs Mount a Controller Link Unit a
586. teps in the overall procedure that is shown below are related to the Slave and Unit Config urations Step 1 Software Design Step 1 1 Designing I O and Processing Step 1 2 Designing Tasks Step 1 3 Designing Programs Step 2 Software Setups and Programming Step 3 Mounting and Setting Hardware Step 4 Wiring Step 5 Confirming Operation and Starting Actual System Operation Refer to 1 3 Overall Operating Procedure for the NJ series Controller for details 3 2 NJ series CPU Unit Software User s Manual W501 3 I O Ports Slave Configuration and Unit Configuration Step 1 Create the EtherCAT Slave Configuration if EtherCAT is used and the Unit Configuration if CU series Units are used e Create the EtherCAT Configuration EtherCAT slave configuration Fore CLL ZII LL LLL IIL FFE LZ TILLI ZZ AT LIDS SP LLLLPP IAS LLT Sysmac Studio lt 7 gem ji icon e Create the Unit Configuration Unit configuration Unit configuration information Sz OLLI Z IIT ERL LAARA ARA LZ LI ZT LAA ALLAL Step 2 Assign device variables to I O ports e Register the device variables Registering the device variables NN Slave Unit 1 O port Sysmac Studio D PE S eee a a ee Assign a new device a a _ ivariable or a variable rr re from a variable table for a ee See each I O port Sz LLLP FIL LL LLLI FLL FL LLL FLD LLL IPP PPL LILA A
587. ter output Value is updated according to the internal algorithm Updating output parameters ST Type Output variable Normal operation Error operation ST ENO Changes to TRUE Changes to FALSE P_PRGER Retained nothing is done TRUE NJ series CPU Unit Software User s Manual W501 6 105 6 Programming i Operation When a Syntax Error Occurs in a POU Written in ST Errors in Assignment Statements When an error occurs in an assignment statement written in ST that line is not executed 5 a b c d e f ABS Q 6 x 1 For example if a division by zero error occurs in b c d on line 5 execution of line 5 is cancelled the value of a is not changed and line 6 is executed This operation is the same as when the output ENO of a user created function is FALSE 5 a User created_function_block b C 6 x 1 When the ENO output from the user created function is FALSE execution of line 5 is cancelled the value of a is not changed and line 6 is executed Errors in IF Constructs lf a syntax error occurs in ST perform error processing for the syntax error When the value of c a below is zero the lines between the IF and END_IF are not executed POU AA IFa b c d THEN X ELSE X2 END_IF y 10 mh COOMNOW The user must include a safety IF P_PRGER TRUE THEN processing for possible errors x Initial_value Processing when an error occurs
588. the CPU Unit name and the serial ID are compared gt Sysmac Studio Name Serial ID is not matched Project Name new_NJ501_00 Serial ID L701 31810 9999 Controller Name new_NJ501_0 Serial ID L701 31810 9999 Do you want to change the Name Serial ID in the project to the controller s CPU Unit name Serial ID Y N It will be used for the CPU unit name ID check at the next online connection Press the Cancel button if you want to go offline 9 4 3 Protection i Introduction This function disables the ability to write data to CPU Units and SD Memory Cards to protect user pro gram assets and prevent misuse The NJ series Controller provides the following protection functions Protection for Online Operations from the Sysmac Studio Target data in the CPU Unit Protection Description User pro Cam Configu ram tables Paon g and Setup User program trans Prevents reading data in the CPU Unit Possible Possible fers with no restora from the Sysmac Studio This protects tion information the user program and other data AT Prevents writing data to the CPU Unit Possible Possible Possible CPU Unit write protec i tion from the Sysmac Studio Use this func tion to prevent incorrect operation Protection for Offline Operations from the Sysmac Studio Protection Description Protection Protection of all project Codes the project file by using a password when Project file the project is expo
589. the Controller A O A Resetting errors troubleshooting A lt J Starting or restarting an MC Test Run A Z T User program execution IDs for Controllers A O A lt J CPU Unit write protection Password Specifications Item Description Valid number of characters 8 to 32 Applicable characters Single byte alphanumeric characters case sensitive 9 4 2 CPU Unit Names and Serial IDs i Introduction Register a CPU Unit name in the CPU Unit When going online to a CPU Unit from the Sysmac Studio the CPU Unit name in the project is compared to the name of the CPU Unit being connected to This helps prevent incorrect connections to the CPU Unit from the Sysmac Studio It is particularly effective for operations performed over an EtherNet IP network Sysmac Studio Lz CPU Unit name A lt a LOL DSS LID L LLL FALL LLP FLL LTE PAL LP U D O l lt CPU Unit go CPU Unit T n i an E A check is performed to see if the CPU Unit name matches for online connections In addition to the CPU Unit name it is also possible to use serial ID identification based on the CPU Unit production information optional SQ JELeS pue SOWEN HUN Nd g t 6 NJ series CPU Unit Software User s Manual W501 9 19 9 CPU Unit Functions i Setting Methods 1 Set the CPU Unit name when you create a project on the Sysmac Studio The CPU Unit name is displayed as shown
590. the Operating Mode from the Sysmac Studio Use the following procedure e Select Mode Run from the Controller Menu 8 2 3 When Downloading Data from the Sysmac Studio to CPU Unit The operation that occurs when you download the project data from the Sysmac Studio to the CPU Unit is described below i Operation during Downloads Status of Output Bits for EtherCAT Slaves The output status is controlled by the settings in the EtherCAT slave Output Bit Status for CJ series Basic Output Units When you change from RUN mode to PROGRAM mode the memory used for CJ series Units is ini tialized to all zeros 16 0000 I O refreshing is performed with those values i Operation after Downloads Status of Output Bits for EtherCAT Slaves The EtherCAT slaves perform initial processing after the download is completed In the same way as for the download process the operation of the slaves during this time depends on the settings in the EtherCAT slaves Guidelines for the time required for initial processing after the download are given in the following table Number of slaves Time for initial processing after a download guideline 1 3 8 S 48 11s 192 45s 8 6 NJ series CPU Unit Software User s Manual W501 8 CPU Unit Status The status is as follows after initial processing Settings at user program transfer Device variables in CPU Unit EEN Mel TELEMANN CAT slaves Initial value of variable set to Output is turned ON TRUE
591. the Unit and slave configurations You can automatically create device variable names with the Sysmac Studio To do so right click an I O port and select Create Device Variables from the menu be ts Configurations and Setup TAQ new_NJ501_0 v sil Port Description R W Data Tyg Variable Ls v CPU Expansion Racks ag EtherCAT CF w CPU Rack O gt Node R88D KNOIH ECT E 0 Y CJIW SCU22 Serial Communic gt Node2 R88D KNO1H ECT E Com_UnitSta Serial Communication Ui R WORD gt CPU Expansion Racks Com_UnitLogMemErr Error Log EEPROM Error R BOOL I O Map Com_UnitPmrDatErr Protocol Data Error A O 00 gt amp Controller Setup Ht v P1_PortCfg Port1 Port Settings RW WORD gt t Motion Control Setup P1_SerSetCfg Porti User specified Sei RW BOOL amp Cam Data Settings fe P1_StartBitCfg Porti Start Bits RW BOOL gt Event Settings E is _DatBitCfg Porti Data Length BOOL i Task Settings 1_StopBitCfg Porti Stop Bits BOOL F7 Data Trace Settings E pi _ParityYNCfg Porti Parity BOOL fia P1_ParityBitCfg Porti Parity Even Odd BOOL P1_BaudrateCfg Porti Baud Rate USINT E v P1_SendDelayCfg Porti Send DelayOSetti RW P1_SendDelaySetCfg Porti Send Delay Time RW By default device variables are registered in the global variable table If necessary you can change the variable type from a global variable to a local variable internal variable for a POU i Create Axes Axis Variables 1 Right cl
592. the following instruction e Task_IsActive NJ series CPU Unit Software User s Manual W501 A 47 rf w Oo D 2 O fet ot O 5 D A O 5 a Q v U lt m mp D z Q h 5 D Q S 9 o D o A106929 ON J9 04 U0D SOUOS PN CEJBAC OU 104 SB QeUeA PeUIJep WaISAS Y Y Appendices Variable name _ TaskName_LastExecTime Meaning Last Task Execution Time Global local Global Function Contains the task execution time the last time the task was executed unit 0 1 us Note You cannot use this system defined variable in the user program It is used only to access task status for data tracing from the Sysmac Studio Data type TIME Range of values Depends on data type R W access Rs Retained Not retained Network Publish Not published Usage in user program Not possible Related instruc You can access this variable from the user program only with the following tions instruction e GetMyTaskStatus Variable name _ TaskName_MaxExecTime Meaning Maximum Task Execution Time Global local Global Function Contains the maximum value of the task execution time unit 0 1 us Note You cannot use this system defined variable in the user program It is used only to access task status for data tracing from the Sysmac Studio Data type TIME Range of values Depends on data type Usage in user program Not supported Related instruc You can access this variable from the user progra
593. the tables Maj Major fault level Par Partial fault level Min Minor fault level Obs Observation Info Information Refer to the NJU series Troubleshooting Manual Cat No W503 for all NJ series event codes 12 12 NJ series CPU Unit Software User s Manual W501 12 Troubleshooting j Errors Related to Tasks Level e The timeout detection time set vV page 12 18 ting is too short The task period setting is too short A user program is too large The number of times that pro cessing is repeated is larger than expected The priority of the periodic task is incorrect 60020000 hex 60030000 hex 60040000 hex 60010000 hex 60050000 hex NJ series CPU Unit Software User s Manual W501 Task Execu tion Timeout I O Refresh ing Timeout Error Insufficient System Ser vice Time Error Task Period Exceeded Task Period Exceeded Task execution exceeded the time out detection time Two consecutive I O refresh failures occurred during the primary periodic task or periodic task period The specified sys tem service execu tion time could not be obtained Task execution was not completed dur ing the set task period for the pri mary periodic task or a periodic task Task execution was not completed dur ing the set task period for the pri mary periodic task or fixed periodic task The task period setting is too vV page 12 19 short The priority of the periodic ta
594. this variable in the user program There may be a delay in updating it Use this variable only to access status through communications from an external device Data type Structure _sNTP_RESULT Range of values Depends on data type Members DATE_AND_TIME Usage in user program Not possible Related instruc You can read the contents of this variable with the GetNTPStatus instruc tions tion A 74 NJ series CPU Unit Software User s Manual W501 Appendices Variable name _EIP_NTPResult ExecNormal Meaning NTP Operation Result Global local Global Function This variable shows if the NTP operation ended normally TRUE Indicates an NTP normal end FALSE Indicates that NTP operation ended in an error or has not been executed even once Note Do not use this variable in the user program There may be a delay in updating it Use this variable only to access status through communications from an external device Data type BOOL Range of values TRUE or FALSE Usage in user program Not possible Related instruc You can read the contents of this variable with the GetNTPStatus instruc tions tion Functional Classification EtherNet IP Communications Switches a w Oo D z O ot O 5 o O 5 a Q v w lt m mp D F Q D h 5 D Q S 9 o D o Variable name _EIP_TDLinkStartCmd Meaning Tag Data Link Communications Start Switch Global local Global Function This is the start switch for data li
595. thority e CPU Unit names and serial IDs e Protection e Restriction of user program operation with user program execution IDs 9 4 1 Verification of Operation Authority i Introduction Online operations are restricted by operation rights to prevent damage to equipment or injuries that may be caused by operating mistakes Examples are shown below e I O Monitor Writing forced refreshing etc e Controller operations Changing the operating mode online editing MC Test Run etc You can register passwords for operation authority for each CPU Unit in the Sysmac Studio If a correct password is entered when an online connection is made to a Controller the online operations for the operation authority category for the password that was entered will be allowed The Administrator sets a password for each operation authority Users are notified of the operation authority name and password according to their skills i Operation Enabling Operation Authority Authentication Select Security Setting of Operation Authority from the Controller Menu on the Sysmac Studio Settings are made in the following dialog box P U D O lt 1 Select Security Setting of Operation Authority from the Controller Menu The Setting of Operation Authority Dialog Box is displayed 5 Setting of Operation Authority W Enable the verification of operation authority Operation Lock Disable Enable Transfer To Contro
596. tion Inline ST is a ladder diagram programming element in which you can write ST language code in a box called an inline ST box a blank text input area within a ladder diagram This allows you to eas ily code numeric data processing and text string processing within ladder diagrams The connecting line to an inline ST box becomes its execution condition The ST code inside of the box is executed based on that connecting line Refer to the following figure Inline ST box Execution Condition for Inline ST taiseki 4 0 3 14 round round round 3 0 Enter the ST language code here Inline ST is treated as a rung element in a ladder diagram Therefore unlike functions and function blocks they have no input output or in out variables Restrictions for Inline ST You can write ST language code in inline ST boxes 6 70 NJ series CPU Unit Software User s Manual W501 6 Programming Execution Conditions for Inline ST The execution conditions for inline ST are shown in the following table Status Operation TRUE execution condition Operation follows the execution condition You can use the execution condi tion at any point in the power flow e g you can connect the inline ST directly to the left bus bar To specify a change to TRUE or a change to FALSE specify it for an input in the execution condition FALSE execution condition Nothing is done Resetting in a master control Nothing is done region
597. tion 1482 0us Max Estimation 1482 0us Set period 20000us Period exceeded Task execution count 161times Task period exceeded count Otimes Real processing time of tasks Latest 104 0us System common processing I O refresh Execution of user programi Motion Control CS CJ NSJCJ2 Series Instructions Reference Manual W474 4 Controller Setup 4 2 4 Unit Configuration and Unit Setup Unit Information i Sysmac Studio File Edit Views Insert Project Controller Simulation Tools Help fl u ZA em eee Configurations and Setup jj category new_NJ501_0 p i l Communications Item name Value J Analog 1 0 vY Configurations and Setup Basic 1 0 gt 3G EtherCAT i Model name NJ501 E General purpose device Y 5 CPU Expansion Racks Product name CPU Unit Sensor gt am CPU Rack Specifications I O capacity 2560 Program capacit L Temperature controller 1 0 Map gt amp Controller Setup Ee E E amp Cam Data Settings gt Event Settings l BG Task Settings CJ1W AD042 F Data Trace Settings gt Programming g CJ1W AD04U I CJ1W AD081 V1 i CJ1W B7A04 i CJ1W B7A14 CJ1W B7A22 l CJ1W CT021 D N 5 U D gt Q _ e mp gt D u rm O TI c gt O oO O Q D l CJ1W CTL41 E l CJ1W DA021 l CJ1W DA041 l CJ1W DA042V m pos d l CJ1W DA08C CJLW DA08V l CJIW DRM21 E CJ
598. tion l n Depends on the Controller errors Depends on the nature of the error _ Depends on the Depends on the Depends on the user program user program user program EtherCAT Master Func tion Module Depends on settings in the slave Errors in other function mod ules Depends on user pro gram These items are not displayed on the error display 1 If multiple Controller errors have occurred the indicators show the error with the highest error level 2 Operation stops in the function module Motion Control Function Module EtherCAT Master Function Module or Ether Net IP Function Module in which the error occurred 12 6 NJ series CPU Unit Software User s Manual W501 12 Troubleshooting Operation in the Function Module Where an Error Event Occurred Event level J l i i Major fault level Partial fault level Minor fault level Observation Function module PLC Function Module Operation stops e Operation continues All axes stop The The affected axis axes Axis operation contin stop method group stops The stop ues Q depends on the method depends on e The motion control S Motion Control Func error the settings instructions that are j tion Module The motion control not related to axis x instructions that are operation are not exe 3 related to axis opera cuted o tion are not executed m EtherCAT communi EtherCAT communica EtherCAT communica S EtherCAT Master
599. tion Module Status e Lit An error for which normal status cannot be recovered through user actions i e errors for which you must replace the CPU Unit or contact your OMRON representative has occurred e Flashing An error for which normal status can be recovered through user actions has occurred e Not lit There is no minor fault level or higher level error EtherNet IP NET ERR EtherNet IP Function Module Status e Lit An error for which normal status cannot be recovered through user actions i e errors for which you must replace the CPU Unit or contact your OMRON representative has occurred e Flashing An error for which normal status can be recovered through user actions has occurred e Not lit There is no minor fault level or higher level error i Checking with the Troubleshooting Function of Sysmac Studio When an error occurs you can connect the Sysmac Studio online to the Controller to check current Controller errors and the log of past Controller errors Current Errors Open the Sysmac Studio s Controller Error Tab Page to check the current error s level source source details event name event code cause and correction Errors are not displayed for observa tions Log of Past Errors Open the Sysmac Studio s Controller Log Tab Page to check the time of occurrence level source source details event name event code details attached information 1 to 4 and corrections for past errors Refer t
600. tion_expression gt is FALSE Process Flow Diagram Statement Example Example 1 A value of 10 is assigned to variable X when the statement A gt 0 is TRUE A value of 0 is assigned to variable X when the statement A gt 0 is FALSE IF A gt O THEN X 10 ELSE X 0 END_IF Example 2 A value of 10 is assigned to variable X and a value of 20 is assigned to variable Y when the statements A gt 0 and B gt 1 are both TRUE A value of O is assigned to variable X and variable Y when the statements A gt 0 and B gt 1 are both FALSE IF A gt O AND B gt 1 THEN X 10 Y 20 ELSE X 0 Y 0 END_IF Example 3 A value of 10 is assigned to variable X when the BOOL variable A is TRUE A value of O is assigned to variable X when variable A is FALSE IF A THEN X 10 ELSE X 0 END_IF 6 82 NJ series CPU Unit Software User s Manual W501 6 Programming IF with Multiple Conditions Overview The construct executes the specified statement when a condition is met If a condition is not met but another condition is met another statement is executed If neither condition is met another state ment is executed The following expressions are used to specify whether the condition is met TRUE The condition is met FALSE The condition is not met Reserved Words IF THEN ELSIF ELSE END_IF Note You can omit ELSE Construct Structure IF lt condition_expression_1 gt THEN lt statement_1 gt E
601. tions 0 0 00 eee A 4 A 1 3 Function Specifications 0 0 teens A 8 A 2 Calculating Guidelines for Task Execution Times 20000 A 16 A 2 1 Calculating the Average Task Execution Times 00005 A 16 A 2 2 Example of Calculating the Average Task Execution Time and Setting the Task PONOG 064 cit aula et ale eine Dad ba gate cts pee dare ea A 24 A 3 System defined Variables 0000 c eee ees A 26 A 3 1 System defined Variables for the Overall NJ series Controller No Category A 26 A 3 2 PLC Function Module Category Name PLC 005 A 30 A 3 3 PLC Function Module Category Name _CJB 00005 A 31 A 3 4 Motion Control Function Module Category Name _MC A 33 A 3 5 EtherCAT Master Function Module Category Name _EC A 34 A 3 6 EtherNet IP Function Module Category Name _EIP A 38 A 3 7 Meanings of Error Status Bits naana aana A 45 A 4 Specifications for Individual System defined Variables A 47 A 4 1 System defined Variables for the Overall NJ series Controller No Category A 47 A 4 2 PLC Function Module Category Name PLC 0005 A 54 A 4 3 PLC Function Module Category Name _CJB 00005 A 55 A 4 4 Motion Control Function Module Category Name _MC A 59 A 4 5 EtherCAT Master Function Module Category Name EC A 61
602. tions in the user program instructions You can use FTP commands from an FTP client on the Intranet to read and FTP server write large files in the SD Memory Card through EtherNet IP You can perform file operations from the Sysmac Studio for the SD Mem File operations from the Sysmac Ory Card inserted in the CPU Unit Studio You can perform file operations for Controller files in the SD Memory Card and save standard document files on the computer SD Memory Card life expiration Notification of the expiration of the life of the SD Memory Card is provided detection in a system defined variable and event log 9 10 NJ series CPU Unit Software User s Manual W501 9 CPU Unit Functions 9 3 2 Specifications of Supported SD Memory Cards Folders and Files i SD Memory Card Specifications You can use any SD or SDHC Memory Card but operation has been verified only for the following OMRON SD Memory Card Normal operation may not be possible with any other SD Memory Cards Item Description Model number HMC SD291 Capacity 2 GB Number of overwrites 100 000 Formatting FAT16 Write protection You can write protect the SD Memory Card with a hardware switch on the Card The system defined variable _Card7Err SD Memory Card Error Flag changes to TRUE observation level in the following cases e When there is a format error lf an error occurs the SD PWR indicator on the front of the CPU Unit goes out and accessing the SD Memory Card
603. tng era e a E 6 8 definitions and instances eeececseeeserrererrenn 6 13 detalls raea a O a 6 8 execution Conditions esssesesssersersrsrererrnrererrrrnrene 6 15 IEEE IAL O OS E AE cae E AEDE E ies 6 13 instruction NAMES sseseseisessreresnsrnrrrrnrererinrnrnrrrrrrenns 6 9 FNS S eee a a te 6 9 DALAMELCIS sassncstoshssevencutsacursentcawemertadcumeretee tester 6 10 Index 4 STUC n cicekiistsuaseancsuerscaues ieee otiate tie alieeo sume encane 6 9 using or omitting EN and ENO cceeeeeeeeeeees 6 22 Variable designations cccccesseeeecseseeeeeeseneeeeens 6 11 TUNCTOMANOGUIES 235 out cuhececncne tee a 2 2 2 3 EtherCAT Master Function Module c00008 2 2 EtherNet IP Function Module ccccsseeeeeeeeees 2 2 Motion Control Function Module cc cseeeeee 2 2 PLC Function Module cccccccseeceeeeeeeeeeeeeeeeeees 2 2 functions detal ee ice eee ie ae stecteocedulesuucdieiddesecteeeaviore 6 17 OXDFESSING INST senses eacere o ies aavindees 6 18 instruction NAMES ccceeeeceeeecceeeceeeeceeeeeeeeesseeens 6 17 NaNe S sesuscesegersien ae seteueees r 6 17 operation for parameter errors ccceeeeeeeeeeeeees 6 23 operation when parameters are omitted 6 23 DAT AIMCO S marsen 6 18 SUG IUNC 8 och sate cece arate evst ETS 6 17 Variable designations ceceeeeeeeeeeeeeeeeeeeeeeeeeeees 6 19 G GIO Al VANIADICS m atirei eaaa lout
604. to Both Functions and Function Blocks i Using or Omitting EN and ENO The following table shows when you can use and when you can omit EN and ENO in functions and function blocks FB User defined Cannot be used Can be used or omitted functions A compiling error occurs if you try to define You define ENO as an output variable in EN in the variable table from the Sysmac the Sysmac Studio Studio Instruction All FB instructions do not use EN Some instructions use ENO and others do not FUN User defined Required Can be used or omitted functions When you create a function the Sysmac You define ENO as an output variable in Studio automatically adds EN to the vari the Sysmac Studio able table by default All FUN instructions use EN Some instructions use ENO and others do not 6 22 NJ series CPU Unit Software User s Manual W501 6 Programming j Operation When Parameters Are Omitted You can omit both input and output parameters Operation when omitted e When the first time the instance is executed the The initial value is used for initial value is used operation e Thereafter the function block is executed with the Input parameters to input variables previous value if the input variable is omitted the initial value is always used Can be omitted You can omit the output Output parameters from You can access the results of the operation outside Parameter If it is omitted output
605. to the selected model Procedure to Delete Units 1 Right click the Unit to delete and select Delete from the menu The Unit is deleted Procedure to Copy and Paste Units 1 Right click the Unit to copy and select Copy from the menu 2 Right click at the location where you want to insert the Unit and select Paste from the menu The Unit is pasted 3 8 NJ series CPU Unit Software User s Manual W501 3 I O Ports Slave Configuration and Unit Configuration Creating Expansion Racks Procedure to Add Expansion Racks 1 Right click at any location where there are no Units and select Add Rack from the menu The Rack is added Procedure to Delete Expansion Racks 1 Select a Unit of the Rack to delete 2 Right click at any location where there are no Units and select Delete Rack from the menu The Rack is deleted N do O D 5 F gt D C 5 O e 5 amp D ct oO Procedure to Delete All Racks and Units 1 Right click at any location where there are no Units and select Clear All from the menu All Racks and Units are deleted Configuration Unit Settings Make the following settings for the Configuration Units in the Unit Editor Device Names Enter names for the Configuration Units The device names that you set are used in the device vari ables that you use to access the Configuration Units Input Response Times Set the input response times of the Basic I O Units for the
606. transferring the trace settings Attached None information Precautions All trace settings are initialized when this error occurs Remarks Meaning The clock time was changed Source PLC Function Module Source details None Detection Commands from a user Error attributes Effects Not affected Attached Attached information 1 Time before change information Precautions Clock changes by the Set Time instruction SetTime are not recorded in the event log Remarks NJ series CPU Unit Software User s Manual W501 The time stamp for this event will be for the time after the change 12 25 12 Troubleshooting Event name Meaning Source Error attributes Effects System defined variables Cause and correction Attached information Precautions Remarks Event name Meaning Source Error attributes Effects System defined variables Cause and correction Attached information Precautions Remarks Event name Meaning Source Error attributes Effects System defined variables Cause and correction Attached information Precautions Remarks 12 26 Time Zone Changed 90020000 hex The time zone was changed PLC Function Module Source details None Detection When download timing ing None None Variable Changed to TRUE with Forced Refreshing 90080000 hex Changing a variable to TRUE with forced refreshing was specified PLC Function Module Source details None Detection Comma
607. troller errors Major fault level 2 ae Partial fault level Poe ld Observation level Controller information Information level Minor fault level Errors with a higher level have a greater affect on the functions that the NJ series System provides and it is more important to recover from them When an event in one of these levels occurs the Sys mac Studio or NJ series compatible NS series PT will display the error User defined Events User defined events are classified into the following levels These levels are defined by the NJ series System The event levels are defined for user defined events OO CO N oO AJ II NM No User fault Level 1 These event levels indicate a user defined error in an AO oO User fault Level 2 application The user executes the SetAlarm Create User defined Error instruction to create the event L i o User fault Level 3 Lk 4 User fault Level 4 Lt a User fault Level 5 User fault Level 6 User fault Level 7 User fault Level 8 Low User Information These event levels indicate user defined information in an application The user executes the Setlnfo Create User defined Information instruction to cre ate the event NJ series CPU Unit Software User s Manual W501 9 CPU Unit Functions i Displaying Event Logs The Sysmac Studio or an NJ series compatible NS series PT displays two event logs the Controller event log and the user defined event log You can also display the error
608. tructure Variable NJ_X CJ series Structure Variable CU_X Data type Bytes l Bytes First byte a a bnt YF First byte a 3 3 Booo fu i First byte 4 Oo bo First byte 4 b Variable Table First byte 6 Variable Table First byte 6 c a l 3 3 i i ee a Mi ii ee a Variable Table Data Type Definitions Data type Data type Variable NJ_X In this case align the CJ series and NJ series memory locations Solution Insert members to adjust memory locations You must match both the memory locations and the data types You need to create the alignment members for alignment in both the CJ series and NJ series CPU Units Data type NJ series Structure Variable NJ X CJ series Structure Variable CJ_X STRUCT Bytes Bytes DINT First byte gt First byte NT DINT i First byte 4 O bo o i First byte 4 O bo First byte 6 Variable Table gash VIE eG a Variable CJ_X Make the following changes to align the memory configurations in the NJ series and CJ series CPU Units NJ series Structure Variable NJ_X CJ series Structure Variable CU_X Data type STRUCT Bytes STRUCT Bytes ta omn First byte First byte a Tine J 3 DINT First byte 6 First byte 6 Variable Table eee First byte 8 Name Data type Name Data type i E Variable NJK l Variable Cu_ 2 Add the dummy variable b2 that you created in the 1 Add
609. ts argument NOT speci emergency i ficati IF NOT emergency THEN ications gency 2 Func O Q END_IF D 5 Multi stage IF start TRUE THEN 5 ce connections Func2 in Func1 T END_IF a c fat Q Post con You can connect only other Out instructions You cannot continue the ladder diagram after necting lad after an Out instruction inline ST der instructions Inline ST QO Q str ae Program You can create sections You cannot create sections divisions ri 7 wo O Cc O r Cc x D Q D x g ped Q Cc ped Q MO NJ series CPU Unit Software User s Manual W501 6 101 6 Programming 6 6 Instructions This section describes the instructions pre defined by the NJ series system For details on these instructions refer to the NJU series Instructions Reference Manual Cat No W502 and NJ series Motion Control Instructions Reference Manual Cat No W508 6 6 1 Instructions Instructions are the smallest unit of the processing elements that are provided by OMRON for use in POU algorithms Instructions are classified as shown below Ladder diagram structure elements inputs and outputs FB instructions FUN instructions ST language statements Programs user defined functions and user defined function blocks consist of these instructions Instructions 6 6 2 Basic Understanding of Instructions The fundamental specifications of the instr
610. ts and commission the sys tem through unified concepts and usability Sysmac Studio Automation Software Multitasking Synchronized Control Sequence control Motion control NJ series Controller ire HH IEC programming always in control I O controls Servo Drives and Inverters Machine vision Features i Hardware Features Standard feature EtherCAT Control Network Support All CPU Units provide an EtherCAT master port for EtherCAT communications EtherCAT is an advanced industrial network system that achieves faster more efficient communications It is based on Ethernet Each node achieves a short fixed communications cycle time by transmitting Ethernet frames at high speed The standard feature EtherCAT control network allows you to connect all of the devices required for machine control e g I O systems Servo Drives Inverters and machine vision to the same network CJ series Units In addition to EtherCAT network slaves you can also mount CJ series Basic I O Units and Special Units on the I O bus NJ series CPU Unit Software User s Manual W501 1 Introduction Standard feature EtherNet IP Communications Port All CPU Units provide an EtherNet IP port for EtherNet IP communications EtherNet IP is a multi vendor industrial network that uses Ethernet You can use it for networks between Controllers or as a field network The use of standard Ethernet technology allows you to connect to many diffe
611. ttings for Exclusive Control of Variables in Tasks Refreshing Task Settings When accessing global variables from outside of the Controller you can set a specific task as the refreshing task for those global variables to synchronize with the execution of programs in that task Particularly when using EtherNet IP tag data links always set the same task as the refreshing task for tags in the same tag set variables with a Network Publish attribute to ensure concurrency between the tags in the tag set You cannot set a refreshing task for the following assigned global variables The tasks that are given below are automatically set as the refreshing task e Device variables for EtherCAT slaves Task set as the I O control task e Device variables for CJ series I O Units Task set as the I O control task e Device variables for CJ series Special Units Primary periodic task e Variables with AT specifications in memory used for CJ series Units Primary periodic task Sysmac Studio Setting Procedure Set the global variables for which to specify refreshing tasks and set the accessing tasks in the Set tings for Exclusive Control of Variables in Tasks on the Task Settings Tab Page on the Sysmac Stu dio For details refer to Settings for Exclusive Control of Variables in Tasks on page 4 7 NJ series CPU Unit Software User s Manual W501 5 Designing Tasks i Variable Access Time Ratio Set the variable access time for accessing va
612. tudio to display the clock data i Logging When you change the clock data an event is recorded in the event log However nothing is recorded in the event log if the time is corrected for the NTP i Related System defined Variables _CurrentTime System Time This variable contains the CPU Unit s inter DATE_AND_TIME nal clock data O I ol g D D D 5 D Q D 3 D 5 gt O a D 5 2 O 5 D D 5 ro Tl c 5 O 5 D WOID c l 6 NJ series CPU Unit Software User s Manual W501 9 5 9 CPU Unit Functions 9 1 3 RUN Output i Introduction The RUN output on the NJ PL13001 Power Supply Unit is ON while the CPU Unit is operating Power Supply Unit NJ PL13001 CPU Unit RUN output The RUN output operates as shown in the following table Status Operation During RUN mode ON Startup state OFF until RUN mode is entered according to the Startup Mode setting During PROGRAM mode When a major fault level Controller error occurs The ratings of the RUN output on an NJ PL13001 Power Supply Unit are as follows Item Description Contact form SPST NO 2 A at 250 VAC for resistive load Switching capacity 0 5 A at 120 VAC for inductive load 2 Aat 24 VDC for resistive load i Application You can use the RUN output for the following purposes e Obtain a signal to notify the host that the CPU Unit is functioning normally and is currently operating e Synchro
613. tus Startup Lit 1 s intervals ing normally Observation tt Lit Nott Continues 1 Refer to 12 1 2 Fatal Errors in the CPU Unit for information on individual errors 2 Refer to 12 1 3 Non fatal error in CPU Unit for information on individual errors 3 The function module where the error occurred stops ne Flashin 3 nications can be Partial fault 2 g Continues connected from an Non fatal error 1 s intervals NS series PT if Eth 12 2 NJ series CPU Unit Software User s Manual W501 12 Troubleshooting 12 1 2 Fatal Errors in the CPU Unit i Types of Fatal Errors Some errors are fatal and prevent the CPU Unit from operating This section describes the errors that cause the operation of the CPU Unit to stop The Sysmac Studio and NS series PTs cannot connect communications if a fatal error occurs Power Supply Error Power is not supplied the voltage is outside of the allowed range or the Power Supply Unit is faulty ob N I oh O e m _ mp m oO CPU Unit Reset The CPU Unit stopped operation because of a hardware error Other than hardware failures this error also occurs at the following times e The power supply to an Expansion Rack is OFF e The I O Connecting Cable is incorrectly installed e The IN and OUT connectors are reversed e The connectors are not mated properly e There is more than one I O Control Unit on the CPU
614. u use the bits in these areas only in programming You cannot use them to input or output data through external I O terminals If you need work bits you should normally use bits in this area Data in this area is cleared when power is cycled or when the operating mode is changed between PRO GRAM and RUN mode A 82 NJ series CPU Unit Software User s Manual W501 Appendices Addresses Addresses Word addresses Bit addresses Range W000 to W511 W000 00 to W511 15 A 6 3 Holding Area Description You use the words and bits in this area only in programming The status of the words and bits in this area are retained during power interruptions or when the operating mode is changed between PRO GRAM and RUN mode Addresses Addresses Word addresses Bit addresses Range HO to H511 H0 00 to H511 15 ra O e gt oma gt oO amie 3 Oo lt C Q Aa e O c a Cc gt A 6 4 DM Area Description This is a general purpose data area used to read and write 16 bit words You can also add a bit number to address specify bits Data in this area is retained during power interruption or when the operating mode is changed between PROGRAM and RUN mode eoly BuIpjOH 9 V Addresses Addresses Word addresses Bit addresses Range DO to D32767 DO 00 to D32767 15 i DM Area Words for Special Units Description The following words in the DM Area a
615. uctions follow the specifications of functions and function blocks This section describes specifications that are unique to instructions Ladder Diagram Structure Elements Inputs and Outputs Locations Instructions for ladder diagram inputs and outputs have certain positions where they can be placed as shown below Classification Diagram Input Logical start Connected directly to the left bus bar instructions or is at the beginning of an instruction block Intermediate Between a logical start and the output instructions instruction Output instructions Connected directly to the right bus bar 6 102 NJ series CPU Unit Software User s Manual W501 6 Programming Instruction Options Some ladder diagram instructions for inputs also detect changes to TRUE or changes to FALSE if you add an upward arrow or downward arrow to them Change to Variable A The instruction reads input status makes TRUE 7 t comparisons tests bits or performs other types of processing every task period and outputs the power flow when result eae changes from FALSE to TRUE Output E The output power flow changes to FALSE in the next task period after it is TRUE 1 TOTTE penod Bens period for one task period Time Chart Change to Variable A The instruction reads input status or per FALSE J forms other types of processing every task period and outputs the power flow hh when result changes from TRUE to FAL
616. um value is assigned to the MAX variable and the minimum value is to the MIN variable The value of DATA n is from O to 1 000 e6benbue7 1x9 painionus S 9 MAX 0 MIN 1000 FOR n 1 TO 50 BY 1 DO IF DATA n gt MAX THEN MAX DATA n END_IF IF DATA n lt MAX THEN MIN DATA n END_IF END_FOR e f the total execution time of the statements in the FOR construct from when the FOR variable is incremented decremented from the initial value until it reaches the end value exceeds the task period a Task Period Exceeded Error occurs e When the FOR Variable Cannot Logically Reach the End Value Example NJ series CPU Unit Software User s Manual W501 6 89 6 Programming FOR i 0 TO 100 BY 1 DO intArray i i i INT 50 An infinite loop occurs and results in END_FOR a Task Period Exceeded Error Example FOR i 0 TO 100 BY 0 DO An infinite loop occurs and results in a Task Period Exceeded Error END_FOR e When an Overflow or Underflow Occurs Because the FOR Variable Exceeds the End Value Example FOR i 0 TO 254 BY 2 DO INTArray i i END_FOR Data Types That You Can Use in FOR Constructs and lt increment decrement gt Boolean bit string real duration date time Not supported Basic data types of day date and time or text string data integers Sma Not supported Array specifications Supported for integers and enu merations only Structures
617. un operations in PROGRAM mode to check wiring motor rotation 19 01 U04 SOLI8S fN 4 10 INp JOld Huljes9do je4BAO directions for jogging travel distances for relative positioning e g for elec tronic gear settings and homing oper ation Perform manual operation in RUN mode 7 Debug the actual control system X bi O O D Q Cc D 3 Actual Controller Perform automatic operation in RUN Section 7 Simulation Trans D Operation mode ferring Projects to the Physi cal CPU Unit and Operation NJ series CPU Unit Software User s Manual W501 1 13 1 Introduction NJ series CPU Unit Software User s Manual W501 CPU Unit Operation This section describes the variables and control systems of the CPU Unit and CPU Unit status 2 1 Internal Operation of the CPU Unit 20 00 02 c eee ees 2 2 2 1 1 Internal Software Configuration of the CPU Unit 2 2 2 1 2 Overview of TaSkS 0 0c eee tenes 2 3 2 2 Natiables and VO 20205 dh ceae ede eae es oe ee eee oes 2 5 2 2 1 Iypes Oh Vallavles 2 51 68 ote eat ee ree oe ee ee a ert cee Pt 2 5 2 2 2 Variables and I O Assignments 000 ccc eee eee eee eee 2 8 2 3 CONUOl SVSICMS 60 5 du ee es ee i ee eee ee eee ba ee 2 12 2 4 CPU Upit Status souti ated oon ware nA wi oe OO one bes 2 17 2 5 CPU Unit Data and Data Retention 200 e eee ee 2 18 2 5 1 PU a as eee aS a Ee oe Be oe
618. unction x1 and x2 Input parameters of the called function C Output variable name of the called function y1 Storage location for the return value from the called function y2 Output parameters of the called function e The order of parameters is based on the function definition The order is the same as the local variable definition for the function from top to bottom Example e Programming Notation 1 ConvData32 ToDouble Data32_1 FixPointData1 Data32_2 FixPointData2 NoOfDigit_1 FixPointPos1 NoOfDigit_2 FixPointPos2 Double_1 gt RealData1 Double_2 gt RealData2 Notation 2 ConvData32 ToDouble FixPointData1 FixPointData2 FixPointPos1 FixPointPos2 RealData1 RealData2 e Ladder Diagram Expression P_On ConvData32ToDouble EN FixPointData1 Data32_1 Double_1 RealData1 FixPointData2 Data32_2 Double_2 RealData2 FixPointPos1 NoOfDigit_1 FixPointPos2 NoOfDigit_2 NJ series CPU Unit Software User s Manual W501 6 Programming e Function Definition Function name ConvData32 ToDouble Function Variables v0 Data type Input variables Execute BOOL DINT DINT INT INT Output variables LREAL Double 2 Double 2 LREAL Return value i oo e Program Variables Variable name Comment ChangeFixToFloat Convert from fixed point to p floating point Exe Execution trigger 3 FixPointData1 Decimal point position specifi z cation data 1 5 FixPointPos1 INT Number of digits below deci 2 mal point 1 y FixPoint
619. unction Module Error Status Global local Global Function Shows the status of errors that are detected in the Motion Control Function Module You can use this variable directly in the user program Refer to A 3 7 Meanings of Error Status Bits for the meanings of the error status bits Data type WORD Range of values 16 0000 to 16 40F0 R W access Rs Retained Not retained Network Publish Published Usage in user program Possible Related instruc GetMCError tions e ResetMCError e MC_Reset e MC_GroupReset Variable name _MC_ComeErrSta Meaning Common Error Status Global local Global Function Shows the status of errors that are detected in common processing for motion control You can use this variable directly in the user program Refer to A 3 7 Meanings of Error Status Bits for the meanings of the error status bits Data type WORD Range of values 16 0000 to 16 00F0O R W access Rs Retained Not retained Network Publish Published Usage in user program Possible Related instruc GetMCError tions e ResetMCError NJ series CPU Unit Software User s Manual W501 A 59 a w Oo D z O fet ot O 5 D A O 5 a Q v U lt m mp D z Q h 5 D Q S Z o D o Miobeyed ainpoy uoounJ o4JUOD UONON 7 p V OW eweNn Appendices Variable name _MC_AX_ErrSta Meaning Axis Error Status Global local Global Function Shows the error status for each axis The status of
620. unications Setup 10 1 Communications System OVErvVieWw cccccccccssseesssseeseesseeeesseenenseeeenseeeenseseenseeeeensesoeneesoonees 10 2 HOSS ATOGUICUI ONT aretina a wanlentt wavatt anda sivealicd itedetatad ee ieacedeinen cocuweds 10 3 10 2 Connection Configuration for SySMac Studio ccecscceeeeeeeseeeeeeeeeeeeeenseeseeeeeeeeseeseeeseoeees 10 4 10 2 1 Configurations That Allow Online COnNeCtions cccccecccccseeeeeecenseeeeeceeeeecseeeeeeeeaeeeeeesaeeees 10 4 10 2 2 Configurations That Do Not Allow Online Connections ccccsseeeeceesseeeeeeeeeeeesaeeeeesaeeeess 10 6 10 3 Connection Configurations between Controllers and between Controllers and Slaves 10 7 10 3 1 Connection Configurations between Controllers cc cccccccssseeeeceeeeeeeecseeeeeeesaueeeeseeeenessaeees 10 7 10 3 2 Connection Configuration between Controllers and Slaves c cccccccsseeeeeeseeeeeeeaseeeeeseanees 10 10 16 NJ series CPU Unit Software User s Manual W501 CONTENTS 10 4 Connection Configurations with HMIs and Devices with Serial Communications 10 11 10 4 1 CONNECTIONS 1O FIM S EE E EAA E AAE lee eel asses Sate ester cial E da eileen alent em ina 10 11 10 4 2 Connections to Devices with Serial COMMUNICATIONS cccececececececcecececececcaeaeauceceranaees 10 11 Section 11 Example of Actual Application Procedures 1171 Example Application sccscicececiecctecsvecsazedsndeazecieniccscccaae
621. up to 64 axes is given You can use this variable directly in the user program Refer to A 3 7 Meanings of Error Status Bits for the meanings of the error status bits Usage in user program Possible Related instruc GetMCError tions e ResetMCError e MC_Reset Variable name _MC_GRP_ErrSta Function Shows the error status for each axes group The error status for up to 32 axes groups is shown You can use this variable directly in the user program Refer to A 3 7 Meanings of Error Status Bits for the meanings of the error status bits Data type ARRAY 0 31 OF WORD Range of values 16 0000 to 16 00F0 R W access R ss Retained Not retained Network Publish Published Usage in user program Possible Related instruc GetMCError tions e ResetMCError e MC_GroupReset Variable name _MC_COM Meaning Common Variable Global local Global Function Shows the status that is common to the Motion Control Function Module Refer to the NJ series Motion Control Instructions Reference Manual Cat No W508 for details on structure members Data type _SCOMMON_REF Range of values Usage in user program Related instruc tions Variable name _MC_GRP 32 Meaning Axes Group Variables Global local Global Function Used to specify axes groups and shows multi axes coordinated control status and multi axes coordinated control settings for motion control instructions When you create an axes group on the System Studio a use
622. us Global local Global Function Gives the error status of the I O Bus Unit Note Do not use this variable in the user program There may be a delay in updating it and concurrency prob lems may occur Use this variable only to access status through communications from an external device Refer to A 3 7 Meanings of Error Status Bits for the meanings of the error status bits Data type ARRAY 0 3 0 9 OF WORD Range of values 16 0000 to 16 80F0 R W access R ss Retained Not retained Network Publish Published Usage in user program Not possible Related instruc You can access this variable from the user program only with the following tions instruction e GetCJBError You can clear this variable with the following instruction e ResetCJBError Variable name _CJB_InRespTm Meaning Basic Input Unit Input Response Times Global local Global Function Contains the response times of the Basic I O Units Data type ARRAY 0 3 0 9 OF UINT Range of values O to 320 Usage in user program Related instruc tions A 56 NJ series CPU Unit Software User s Manual W501 Appendices Functional Classification Auxiliary Area Bits for CJ series Units Variable name _CJB_lOUnitInfo Meaning Basic I O Unit Information Global local Global Function Shows the status of the Basic I O Unit alarm output load short circuit protection TRUE Load short circuit FALSE No load short circuit Data type ARRAY 0 3 0 9 0 7 OF BOO
623. user program normally The CPU Unit is write protected Release the write pro tection NJ series CPU Unit Software User s Manual W501 12 Troubleshooting do not know how to change the user The user program execution ID cannot be changed or program execution ID deleted after it is set 00 9 forgot the user program execution ID There is no way to access the user program execution ID assigned to user program that is set Always record the user program execution ID so that you do not forget it 10 forgot the user program execution ID This is no way to access the user program execution ID that is registered in the CPU Unit that is set Set the user program execution ID again You can also clear the user program execution ID if you exe cute the Memory All Clear operation oh Y N O o D o S O 5 eo HUN NdO OU U JON ay yeyL s1013 BuNooYseiqnolL S Z Z4 NJ series CPU Unit Software User s Manual W501 12 37 12 Troubleshooting 12 38 NJ series CPU Unit Software User s Manual W501 PP Appendices The appendices provide the CPU Unit specifications task execution times system defined variable lists data attribute lists CJ series Unit memory information CJ series Unit memory allocation methods and data type conversion information A T SPECHICANONS 55 407 55 Ss eae Se ee ee ec A 3 A 1 1 General Specifications 0 0 cee eens A 3 A 1 2 Performance Specifica
624. ut E Output device Axes Group Setting f Detailed Settings Cam Data Settings gt Event Settings i Task Settings 1 Data Trace Settings gt Programming 4 In the user program an axis variable name is specified for the in out variable Axis in motion con trol instructions For the axis variable name specify the axis name axis variable name that was specified in the Motion Control Setup or the system defined variable _MC_AX 0 63 You can execute motion control for the assigned Servo Drive or encoder input slave An example that specifies the axis variable name MyAxis1 is shown below Example In out variable Axis Specify an axis MyAxis1On variable name MC_ Power MyAxis1 MyAxis1 MyAxis1OnStatus Enable Status ServoOn Busy MyAxis1 OnBusy Error MyAxis1OnError ErrorlD MyAxis1OnErrorlD Refer to 3 5 2 Axis Variables and Axes Group Variables for information on Axis Variables 3 20 NJ series CPU Unit Software User s Manual W501 Controller Setup aes This section describes the initial settings of the function modules 4 1 Overview of the Controller Setup 0 0000 cece ees 4 2 4 2 Initial Settings for the PLC Function Module 0000eaee 4 4 4 2 1 HIWOGUEGION 34 24a e Pave e e eer ee heh ee Oe ea 4 4 4 2 2 Controller SQup 2 03 2 ated ad ik ae hed Sie oh eee tek badekae Cae Se 4 4 4 239 TaSk SeuingS gi eanys Sou E E eee oud ee
625. variables of the instruction by using InstanceName OutputVari there is no way to retrieve ableName the result of the operation In out parameters to from Cannot be omitted Cannot be omitted in out variables You can access the input and output variables of a function block from outside of the function block but only within the same program with InstanceName VariableName However you cannot access the input and output variables of a function from outside the function FBinstance p N u O C u e Co Q 3 O Q N fe m ie gt C gt FBinstance Done Can be specified by using InstanceName Done Operation for Parameter Errors The following operation occurs when there is an error in an input parameter output parameter or in out parameter Errors in Input Parameters If an error is detected in an input parameter the function or function block is not executed and ENO is FALSE The power flow output is also FALSE but all other values are retained Example syoo g uoun pue suoouny yog 0 saijddy ey uonesedO 2 9 Function ENO FALSE Ppeeeeeeeeea abc Retained Variable Table l l Data type 1 10 l Example when variable i is outside the range of the elements in array variable x NJ series CPU Unit Software User s Manual W501 6 23 6 Programming Errors in Output Parameters If an error is detected in
626. vel Applicable function module Instruction PLC Function Module GetPLCError Motion Control Function Module GetMCError EtherCAT Function Module GetECError EtherNet IP Function Module GetEIPError For details on the instructions that get error status refer to the NU series Instructions Reference Manual Cat No W502 Checking with System defined Variables You can check the error status variables in the system defined variables to determine the status of errors in a Controller You can read the error status variables from an external device by using commu nications Refer to A 3 System defined Variables for the system defined variables 12 10 NJ series CPU Unit Software User s Manual W501 12 Troubleshooting 12 2 Troubleshooting This section provides basic error identification and troubleshooting flowcharts Use them when an error occurs in the NJ series Controller This section also describes the software errors that are related to the PLC Function Module and corrections for those errors 12 2 1 Checking to See If the CPU Unit Is Operating When an error occurs in the NJ series Controller use the following flowchart to determine whether the error is a fatal error or a non fatal error Whenever possible set the Sysmac Studio s communications connection in the flowchart to a direct USB connection If you use Ethernet there are many reasons that prevent a communications connec tion for the Sysmac Studio so time is required
627. ver You can read and write files on the SD Memory Card via EtherNet IP by sending FTP commands to the built in EtherNet IP port from an FTP client Refer to the NJ series CPU Unit Built in EtherNet IP User s Manual Cat No W506 for details CPU Unit FTP Client FTP commands Z y SoZ LIT KL ZL LLZ L Z a ae LIS FLL Z ZILI LZZ L7 LEP SPP LLL LLL Built in EtherNet IP port FTP server EtherNet IP SD Memory Card File transfers 9 12 NJ series CPU Unit Software User s Manual W501 9 CPU Unit Functions 9 3 5 File Operations from the Sysmac Studio You can perform file operations from the Sysmac Studio for the SD Memory Card inserted in the CPU Unit In addition to Controller files you can also store document files or other files on the SD Memory Card 9 3 6 SD Memory Card Life Expiration Detection You can determine the remaining life of the SD Memory Card before the Card becomes physically dete riorated You can determine the remaining life of the SD Memory Card with the following functions e System defined variable _Card1Deteriorated SD Memory Card Life Warning Flag e SD Memory Card Life Exceeded Observation record in the event log The life of the SD Memory Card is checked when the power is turned ON and periodically while the SD Memory Card is inserted When the end of the life of the SD Memory Card is detected save the data on the SD Memory Card and replace the SD Memory Card 9
628. ves are accessed without the use of I O ports Axes Group Variables Each of these system defined variables is a structure for an axes group An axes group contains mul tiple axes These variables are used for interpolated motions Refer to 3 5 2 Axis Variables and Axes Group Variables for details NJ series CPU Unit Software User s Manual W501 2 7 2 CPU Unit Operation 2 2 2 Variables and I O Assignments The NJ series CPU Unit assigns I O and variables as shown below User program Variables Axis variables I O ports I O ports Assigned axes Memory used for CJ series Units CJ series Units OMRON Servo Drive or encoder input Slaves or supported Servo Drive or Operating data Assigned memory encoder input slaves from other Setup data areas companies General purpose EtherCAT slaves Application Type of variable to use Interfacing You can access slaves through the objects that are Device variables for EtherCAT slaves EtherCAT assigned for PDO communications slaves Using motion control instructions Axis Variables Interfacing CJ Basic I O Units Device variables for CJ series Units series Units Special Units Operating data and setup data Device variables for CJ series Units Assigned memory area data User defined variables with AT specifica tions in memory used for CU series Units Refer to 3 4 I O Ports and Device Variables for details i Interfacing EtherCAT Slaves The interface method that
629. wer is turned ON When the CPU Unit changes to RUN mode When you specify to initialize the values when the user program is transferred e When a major fault level Controller error occurs ST programming that is included within a ladder diagram program The smallest unit of the processing elements that are provided by OMRON for use in POU algorithms There are ladder diagram instructions program inputs and out puts function instructions function block instructions and ST statements A constant expression that is used in a user program A variable that can be accessed only from inside the POU in which it is defined Local variable is used as opposed to global variable Local variables include internal variables input variables output variables in out variables and external variables The memory inside the CPU Unit that is used by the CPU Unit to execute the OS and user program An error for which all NJ series Controller control operations stop The CPU Unit immediately stops user program execution and turns OFF the loads for all slaves and Units including remote I O A function to check motor operation and wiring from the Sysmac Studio One type of I O memory in an NJ series CPU Unit It contains addresses that can be directly specified by the user It can be accessed only with variables with an AT attribute This memory is used to access CJ series Units and CJ series networks NJ series CPU Unit Software User
630. wercase Uppercase Single byte double byte Characters e Operators keywords and variable names are not case sensitive e Operators keywords and variable names must always be in single byte characters A syntax error will occur if you input double byte characters Variables and Prohibited Characters Refer to 6 3 12 Restrictions on Variable Names and Other Program related Names for restrictions on variable names e6benbue7 1x9 painionus S 9 Text Strings Refer to 6 3 12 Restrictions on Variable Names and Other Program related Names for restrictions on text strings NJ series CPU Unit Software User s Manual W501 6 73 6 Programming 6 74 ST Keywords and Operators Statement Keywords Keyword RETURN IF CASE FOR WHILE REPEAT EXIT Text Text Assignment Calling functions and function blocks Return Case For While Repeat Exit the loop Empty statement Comments Comment Example d 10 FBname para1 10 para2 20 Refer to Function Block Calls on page 6 94 IF d lt e THEN f 1 ELSIF d e THEN f 2 ELSE f 3 END_IF CASE f OF 1 g 11 2 9 12 ELSE g 0 END_CASE FOR i 100 TO 1 BY 1 DO Vall i i END_FOR WHILE Val lt MaxVal DO Val Val 1 END_WHILE REPEAT Val Val 1 UNTIL Val gt 4 END_REPEAT FOR i 1 TO 100 DO FOR j 1 TO 10 DO IF Vall i j gt 100 THEN EXIT END_IF END_FOR EN
631. when the corresponding Normal Target Node Infor mation is TRUE If the corresponding Nor mal Target Node Information is FALSE the Target Node Controller Operating Informa tion indicates the previous operating status Array x is TRUE This is the operating state Array x is FALSE Other than the above NJ series CPU Unit Software User s Manual W501 A 43 Appendices Variable name _EIP_TargetPLCErr 255 Target PLC Error Information _EIP_TargetNodeErr 255 Target Node Error Information _EIP_NTPResult NTP Operation Information ExecTime NTP Last Operation Time ExecNormal NTP Operation Result A 44 values ARRAY 0 255 OF BOOL TRUE or FALSE This variable shows the error status logical OR of fatal and non fatal errors of the tar get node Controllers that are connected with the built in EtherNet IP ports as the originator The array elements are valid only when the corresponding Normal Target Node Information is TRUE The immedi ately preceding value is retained if this vari able is FALSE Array x is TRUE A fatal or non fatal error occurred in the target Controller with a tar get node ID of x Array x is FALSE Other than the above page A 74 ARRAY 0 255 OF BOOL TRUE or FALSE This variable indicates that the connection for the Registered Target Node Information was not established or that an error occurred in the target Controller The array elements are v
632. will not be possible j Folder and File Specifications Character Restrictions o Object Reseed Multibyte Case eN Maximum 3 named by Usable characters a character sitivity size without O user compatibility NULL Volume label Oto 9 A to Z and a to z as CON PRN Case 11 bytes wellas _ amp AUX insensitive O AT andsingle byte CLOCKS E kaha l NUL COMO COM1 5 Directory O to 9 A to Z and a to z as COM 65 bytes o name wellas _ amp and single byte SONG File name Ai COM4 65 bytes kana COM5 COM6 COM 7 COM8 COM9 LPTO LPT1 LPT2 LPT3 LPT4 LPT5 LPT6 LPT7 LPT8 LPT9 Sojl4 pue SJapjO 4 spen Alowal GS pewoddns jo suoneoyioeds 2 6 1 You cannot begin volume label names with a space 2 Even if the computer supports multibyte characters e g for Japanese you cannot use them in the CPU Unit Subdirectory Levels You can create up to 5 levels example f1 f2 f3 f4 f5 abc txt Number of Files in the Root Directory 511 max NJ series CPU Unit Software User s Manual W501 9 11 9 CPU Unit Functions 9 3 3 SD Memory Card Operation Instructions You can perform various operations on the SD Memory Card by using the following instructions Instruction name Description The FileReadVar instruction reads the contents of a binary file on the nean yarian FileReadVar SD Memory Card and writes it to the sp
633. x is not Retain attribute RUN to PRO selected Check Box is GRAM mode selected User defined vari If initial values are set the variables change to the initial values ables and device jf initial values are not set the variables change to 16 00 variables Device variables 16 00 7 with AT specifica Non retain tions CIO Work and 16 00 Timer memory areas for CJ series Units NJ series CPU Unit Software User s Manual W501 6 57 p rf S Z D ea D N sebueuy sns 104 sejqeue 0 sebueyD 6 g 9 6 Programming 6 58 When retain condi tion is met When retain condi tion is met retains value before down load No change retains value before power interruption No change i e the values in RUN mode are e If initial values are retained set the variables change to the ini tial values If initial values are not set the vari ables change to 16 00 If initial values are When retain condi tion is not met set the variables ae change to the ini e f initial values are tial values set the variables change to the ini If initial values are tial values not set the vari ables change to 16 00 If initial values are not set the vari ables change to 16 00 If initial values are The value in mem ory at the specified set the variables address regardless change to the ini of the retain condi tial va
634. xecute them One of the variable specifications You can specify a range for a variable in advance The variable can take only values that are in the specified range One of the attributes of a variable The values of variables with a Retain attribute are held at the following times Variables without a Retain attribute are set to their initial values e When power is turned ON after a power interruption When the CPU Unit changes to RUN mode e When you specify to not initialize the values when the user program is trans ferred One type of EtherCAT communications in which service data objects SDOs are used to transmit information whenever required Any of the EtherCAT slaves that is assigned to an axis In the NJ series System it would be a Servo Drive or Encoder Input Slave Unit A generic term for the EtherCAT configuration and Unit configuration A generic term for the settings for a Special Unit including the settings in allocated DM Area words One of the derivative data types It consists of multiple data types placed together into a layered structure NJ series CPU Unit Software User s Manual W501 Term synchronization Sysmac Studio system common processing system service system defined variable task task period union Unit configuration upload user program user defined event user defined variable variable variable memory NJ series CPU Unit Software User s Manual W501 Terminology
635. xecution Priority The CPU Unit executes the task with the highest execution priority first If the execution conditions are met for another task with a higher execution priority while a task is under execution the task with the higher execution priority is given priority in execution 5 6 NJ series CPU Unit Software User s Manual W501 5 Designing Tasks e The primary periodic task has the highest execution priority The Controller executes it with a higher priority than any other task e There are three execution priority levels for periodic tasks High Numbers of tasks Primary Priority 16 priority ee 17 Priority 17 re periodic task Priority 18 Low i Overall Operation Tasks operate with the task period of the primary periodic task called the primary period as the stan dard period e The Controller executes a periodic task once during multiple primary periods For example if the task period of the primary periodic task is set to 1 ms and the task period of the priority 16 periodic task is set to 4 ms the priority 16 periodic task is executed once while the primary periodic task is executed four times e The primary periodic task and periodic tasks are processed during the task periods even in PRO GRAM mode The user program is executed in RUN mode e O refreshing is executed according to the task periods e The CPU Unit executes system services such as communications processing during the unused time between exe
636. y initial_value END_IF Syntax Errors in ST The following syntax errors can occur in ST e Exceeding the number of elements in an array e No parameter set for in out variable e STRING assignment When the text string size bytes of the left side is less than the text string length bytes of the right side e Division by zero excluding floating point number calculations When the value of a floating point number is nonnumeric the result of the calculation will also be nonnumeric This is not considered an error Operation for Structure Errors The P_PRGER Flag changes TRUE and the following occurs Syntax Operation Assignment The line is not executed statement 6 106 NJ series CPU Unit Software User s Manual W501 6 Programming Syntax Error location Operation IF condition No statements between IF and END_IF are executed expression CASE condition No statements between CASE and END_CASE are executed expression Control con FOR condition No statements between FOR and END_FOR are executed structs expression WHILE condition No statements between WHILE and END_WHILE are executed expression REPEAT condi No statements between REPEAT and END_REPEAT are executed tion expression Instruction Error Flag When an instruction error occurs in a ladder algorithm or when a syntax function error occurs in an ST algorithm the P_PRGER Instruction Error Flag system defined variable changes to TRUE The P_
637. y 0 1 Array Protection The following errors occur if you attempt to access an element that exceeds the number of elements in an array NJ series CPU Unit Software User s Manual W501 6 47 6 Programming 6 48 When the Subscript Is a Constant An error is displayed when you input the variable or when you check the program on the Sysmac Studio LR ie at te te eee deh nae ae wn eh aM Wie ae arp ee Lee ees ee fer Variable Table snes Varablename Datatype id 255 In Out 11 ARRAY 1 10 OF INT When the Subscript Is a Variable The CPU Unit checks for subscripts that are out of range when instructions are executed When a subscript variable exceeds the range of the elements of the array variable an instruction error occurs Variable Table i MOVE If the value of variable i exceeds 10 l Data type EN an instruction error occurs 255 In Out i ARRAY 1 10 OF INT CO ee ee ee a e f Range Specifications Use the range specification to restrict the values of the following integer variables to specific ranges of values Classification Data type Integers SINT INT DINT LINT USINT UINT UDINT and ULINT You can check to make sure that the entered value is within the allowed range in the following cases e When you specify an initial value for a variable e When you write a value to a variable with CIP message communications Making a Range Specification Input the start poi
638. y Error reset or Log category System cycling power supply Effects The CPU Bus Unit may stop correction The power supply to the Controller Clear all memory or download the Do not interrupt the power supply to was interrupted or communications CPU Bus Unit Settings If this error the Controller or disconnect commu with the Sysmac Studio were discon persists replace the CPU Unit nications with the Sysmac Studio nected while downloading the CPU while downloading the CPU Bus Unit Bus Unit Settings Settings Attached None information Precautions None Remarks Event name IP Address Table Setting Error 34100000 hex Meaning The IP address table settings are incorrect Source PLC Function Module Source details None Detection At power ON timing Controller reset or restart of built in Ethernet port Effects FINS UDP communications will not operate corrocuon The IP address conversion method is Correct the IP address table settings Set the IP address table correctly set to the combined method or the IP address table method but the IP address table settings are incorrect Attached None information Precautions None Remarks NJ series CPU Unit Software User s Manual W501 12 31 ol tn N Oo ea D o gt oO Oo 5 eo suoduos q 10113 p Z Z 12 Troubleshooting Event name Meaning Source Error attributes Effects System defined variables Cause and correction Attached
639. y an array structure or union e Refer to Return Values below for details Refer to 6 3 4 Attributes of Variables for details on setting variable attributes EN Additional Information You can register global variables as external variables in a function variable table to access glo bal variables We recommend that you create your functions so that they produce output values uniquely based on their input parameter values Algorithms that access global variables and use them to affect the output values are not recommended When you check the program on the Sysmac Studio a message will appear that says that it is not recommended to use global vari ables in functions Take appropriate measures if necessary ENO e When ENO is FALSE the previous values of all other output variables are retained NJ series CPU Unit Software User s Manual W501 6 Programming Return Values e Return values are blank in ladder diagrams Case Ladder diagram notation ST language notation Using return values variable_q MyFUN1 MyFUN1 variable_i Variable i Variable q i MyFUN2 In1 variable_i7 In2 v ariable_i2 OutEQ gt variable_q1 OutNE gt variable_q4 Not using a return value Variable 7 Variable i2 Variable q1 Variable q4 e The calling instruction is not required to use the return value in either a ladder diagram or ST e If you set the return value within a function algorithm set the value to

Download Pdf Manuals

image

Related Search

Related Contents

Manual - Optimus    BATCHFLUX® EGM5500C シリーズ  Bref`OPAL n°3    Manuale dell`utente  DDXI V1.00 DIGITAL DVI/VGA-KVM  Mitsubishi Electric BN 0032  Diskeeper User Manual  Documento PDF  

Copyright © All rights reserved.
Failed to retrieve file