background image

 

91 

 

4. 

Press the 

R

 Key to insert a rung below the first rung. 

Insert N.O. Input 

power1_done

 and then insert the MC_Home motion FB. 

Enter “Home1” as the instance name. 

 

 

 

 

 

 

 

 

5. 

Insert output 

home1_done

 (or any other name you prefer). 

 

 

 

 

 

6. 

Press the 

R

 Key to insert a rung below the second rung. 

Insert N.O. Input 

home1_done

 and then insert the MC_MoveRelative motion FB. 

Enter “Move1” as the instance name. 

 

 

 

 

 

 

 

 

 

 

 

7. 

Set the parameters as follows. (You do not need to set other parameters in this exercise.) 

 

Distance 

: 1000 (pulses) 

 

Velocity 

: 1000 (pulses/s) 

These settings move the ball screw the set distance in a second. 

 

 

 

 

 

 

Drag 

Drag 

Summary of Contents for NX1P

Page 1: ...Machine Automation Controller NX1P Practices Guide for NX1P Programming NX1P2 SYSMAC SE20 P122 E1 01...

Page 2: ...iability assumed for damages resulting from the use of the information contained in this publication OMRON 2017 Trademarks Sysmac and SYSMAC are trademarks or registered trademarks of OMRON Corporatio...

Page 3: ...ll safety precautions precautions for safe use and precautions for correct use For the startup and operating instructions for motion control refer to the NJ NX series Startup Guide for Motion Control...

Page 4: ...ase price of the non complying Product provided that in no event shall Omron be responsible for warranty repair indemnity or any other claims or expenses regarding the Products unless Omron s analysis...

Page 5: ...TED AND INSTALLED FOR THE INTENDED USE WITHIN THE OVERALL EQUIPMENT OR SYSTEM Programmable Products Omron Companies shall not be responsible for the user s programming of a programmable Product or any...

Page 6: ...for the Software LIMITATION OF LIABILITY THE ABOVE WARRANTY SHALL CONSTITUTE THE USER S SOLE AND EXCLUSIVE REMEDIES AGAINST OMRON AND THERE ARE NO OTHER WARRANTIES EXPRESSED OR IMPLIED INCLUDING BUT...

Page 7: ...read and understand the manuals for all devices and equipment that will make up the system to ensure that the system is used safely Review the entire contents of these materials including all safety p...

Page 8: ...mmunications functions EtherCAT communications functions NJ NX series CPU Unit Software User s Manual W501 NX701 NJ501 NJ301 NJ101 NX1P2 Learning how to program and set up an NJ NX series CPU Unit Mai...

Page 9: ...on the built in EtherNet IP port is provided Information on the basic setup tag data links and other features is provided Use this manual together with the NJ series CPU Unit Hardware User s Manual Ca...

Page 10: ...ory A manual revision code appears as a suffix to the catalog number on the front and back covers of the manual Revision code Date Revised content 01 September 2017 Original production Cat No P122 E1...

Page 11: ...Programming with Variables 20 1 3 1 Programming the NX1P 20 1 3 2 Data Types 23 1 3 3 Benefit of Using Data Types 24 1 3 4 International Standard IEC 61131 3 25 1 4 Programming Software 26 1 4 1 Progr...

Page 12: ...3 3 6 1 Self holding Rung 53 3 6 2 On Delay Timer TON Instruction 54 3 6 3 Exercise Energy Saving Escalator 58 3 6 4 Checking the Operation of the Program 59 3 6 5 Checking the Operation of the Progra...

Page 13: ...of the Ladder Program 89 5 3 2 Motion FBs to Use 89 5 3 3 Writing the Ladder Program 90 5 4 Data Tracing 93 5 4 1 Checking the Operation with Data Traces 93 5 5 3D Simulation 95 5 5 1 Starting 3D Sim...

Page 14: ...Using the NX1P 1 16 1 2 2 Easy to Add Programs 1 17 1 2 3 Easy Motion Programming 1 18 1 2 4 Structured Text Language for Easy Mathematical Processing 1 19 1 3 Programming with Variables 1 20 1 3 1 P...

Page 15: ...ed and precision EtherCAT simplifies the wiring to up to eight servo systems including for single axis position control 2 Networks for IoT EtherNet IP enables communications with a host PC and data li...

Page 16: ...productivity and quality machines are getting more advanced and more complex Engineers are facing challenges such as reducing engineering costs improving programming efficiency and minimizing training...

Page 17: ...am to add reused Programming the NX1P When a program is reused the NX1P automatically allocates memory addresses in the memory area for variables The user does not need to worry about addresses when a...

Page 18: ...te a program while monitoring and tuning the settings Programming the NX1P Operations such as turning ON the Servo homing and positioning can be described in one program by using motion FBs Processes...

Page 19: ...g languages ladder diagram language for sequence control and ST language for mathematical processing Example Calculating the area of a trapezoid Top length bottom length height 2 The ST language simpl...

Page 20: ...remember addresses and makes programming faster and easier Programming with variables means that you can create programs using the names on your control panel or touchscreen as shown below Programmin...

Page 21: ...n To program the NX1P each variable e g SW1 and L1 must be assigned in the I O Map to the corresponding input output terminal to which the physical device is connected Variables used in the program ar...

Page 22: ...O channels were changed Programming the NX1P Even when adding Units you just assign variables to new I O ports in the I O Map without changing the program Addresses are changed Adding a Unit Change al...

Page 23: ...represent decimal integers they have different ranges of values The WORD data type for bit strings the DATE_AND_TIME data type for date and time and other data types can also be used Classification Us...

Page 24: ...d from 16 bits to 32 bits all you have to do is change the data type You don t need to change the program or allocate memory The concepts of programming with variables and data types based on the inte...

Page 25: ...Diagram A graphical language written in a form similar to electrical circuits ST Structured Text A high level structured language similar to Pascal FBD Function Block Diagram A graphical language to d...

Page 26: ...Programming with variables Supports the ladder and ST languages and FBs 1 based on IEC 61131 3 3 PLCopen function blocks for easy programming of complex motion profiles and Cam Editor for quick implem...

Page 27: ...thout connecting physical devices 1 Check the operations of a program 2 Monitor variables in the Watch Tab Page without connecting devices 3 Check a motion program by viewing the changes of positions...

Page 28: ...ware mounting and wiring and the installation of the Sysmac Studio 2 1 System Configuration and Devices 2 29 2 1 1 Overview 2 29 2 1 2 Wiring 2 30 2 2 Installing the Sysmac Studio 2 32 2 2 1 Installin...

Page 29: ...Machine Automation Controller NX1P Ethernet cable 100Base TX 10Base T SYSMAC SE200D DVD only SYSMAC SE201L 1 license NX1P2 Pushbutton Switch Indicator Power Supply A22NL etc M22N etc S8VK S06024 etc T...

Page 30: ...30 2 1 2 Wiring Wiring Pushbutton Switches Wire Pushbutton Switches to the NX1P as shown below Wiring Indicators...

Page 31: ...d or ferrule to from a Push In Plus Terminal Block by following the procedure below Refer to the manual for connection and removal of a stranded wire Connecting a wire Just push the wire into the term...

Page 32: ...e Sysmac Studio 4 Restart your computer after the Sysmac Studio has been successfully installed 2 2 2 Requirements for Installation The system requirements for the Sysmac Studio are given in the follo...

Page 33: ...2 I O Map Setting 3 39 3 3 3 Checking Wiring 3 41 3 4 Ladder Programming 3 42 3 4 1 Inserting Circuit Parts 3 42 3 4 2 Keyboard Mapping 3 42 3 4 3 Rules 3 43 3 5 Example of a Basic Ladder Program 3 4...

Page 34: ...of a Ladder Program Using Date and Time 3 62 3 7 1 Programming the NX1P Using Date and Time 3 62 3 7 2 Exercise Continuous Operating Time of Escalator 3 62 3 8 Fundamentals of Programming to Reduce De...

Page 35: ...rocedure is given below 3 1 2 Creating a Project 1 Start the Sysmac Studio 2 Enter the project name Select NX1P2 9024DT 1140DT for the device parameter and 1 13 version indicated on the NX1P for the v...

Page 36: ...36 The following window is displayed Additional Information You can change the model version and other properties after creating a project file Right click...

Page 37: ...Screen for Configurations and Setup 3 2 2 Screen for Programming Configurations and Setup Multiview Explorer Toolbox Programming Edit Pane Simulation Pane 1 Select an item to set up 2 Make settings or...

Page 38: ...rder to create a program using the connected devices I O you need to assign variable names for the numbers of terminals to which devices are connected Any name can be assigned Names related to the dev...

Page 39: ...O ports Input Bit 00 etc of the NX1P are displayed in the I O Map 2 Double click an I O port to enter a variable name Set variable names for input output terminals as shown below Variable names for in...

Page 40: ...40 4 In the same way set SW2 and SW3 for Input Bit 01 and 02 and L1 to L3 for Output Bit 00 to 02 The variable names have been linked with the terminal numbers...

Page 41: ...sfer to Controller 3 Change the operating mode to PROGRAM mode to prevent the program from being executed while checking I O wiring 4 Press the Pushbutton Switches to check whether the values of the i...

Page 42: ...ey Right click Right click a rung and select Insert rung above or Insert rung below 3 4 2 Keyboard Mapping The following table lists the shortcut keys that you can use when creating ladder programs Op...

Page 43: ...thout inserting an input Always ON Flag is not required Functions and function blocks can also be inserted without inserting an input You can connect outputs functions and function blocks in series Yo...

Page 44: ...Space Three cars can be parked in the parking space Create a program to turn ON the FULL lamp L3 red lamp if the parking lots are full and turn ON the AVAILABLE lamp L1 green lamp if one or more park...

Page 45: ...nder POUs 2 Double click Section0 under Programs Program0 The Ladder Editor is displayed 3 Write a ladder program on the Ladder Editor Additional Information When a new ladder program is created Secti...

Page 46: ...ick a connecting line and select Insert Output from the Menu 2 Insert a rung below 1 Select the start of a rung and press the R Key or right click a rung and select Insert rung below 3 Insert a progra...

Page 47: ...m the start point to the end point and select N C Input from the menu Drag the connecting line from the start point to the end point 3 Insert another N C Input in the same way The program is completed...

Page 48: ...le Menu Enter a file name and export the file to the desktop Additional Information Difference between Save and Export Save Export The project is saved in the default folder The user does not need to...

Page 49: ...ll data including the program from the Sysmac Studio to the NX1P to check operation 1 Connect the NX1P to the computer Sysmac Studio via an Ethernet cable 2 Go online Start the Sysmac Studio and go on...

Page 50: ...2 and SW3 to check whether the AVAILABLE lamp L1 and FULL lamp L3 turn ON and OFF 3 5 6 Checking Operation on the Simulator You can check operation using the Simulator in the Sysmac Studio without con...

Page 51: ...3 Double click the input You can change the value between True ON and False OFF to debug the program instead of pressing the physical switch 4 Select Stop from the Simulation Menu to stop the Simulat...

Page 52: ...oolbar when an error occurs The example below shows a verification error that occurs when the NX1W CIF01 Serial Communications Option Board is not connected physically but is connected on the Sysmac S...

Page 53: ...he program created in 3 5 Example of a Basic Ladder Program Right click the rung numbers to delete while holding down the Ctrl Key Press the Delete Key Although the ladder program is deleted the I O M...

Page 54: ...d 3 6 2 On Delay Timer TON Instruction Create a rung to turn ON L2 in five seconds after SW1 is pressed Rung to add 1 Refer to the help for details of the TON instruction Select Instruction Reference...

Page 55: ...and Q changes to FALSE 2 Input the set time Specify a TIME data variable for the input parameter PT when inputting the set time For example input T 10 12s to set to 10 12 seconds Classification Data t...

Page 56: ...2 A rung is inserted below 3 Insert the N O input L1 as shown below 4 Search for the TON instruction in the Toolbox on the right of the window or select TON in the Timer in the Toolbox 5 Add the TON i...

Page 57: ...rted 7 Enter the instance name of the TON instruction Click Enter Function Block and enter Timer1 8 Set the parameters PT T 5s ET Timer1PV 9 Insert an output that changes to TRUE when Timer1 times out...

Page 58: ...ert an N C Input for timer output in the rung to stop the motor There are two N C input methods Specify timer output as a work bit e g Timer1UP Use Timer1 Q that represents the output status of the ti...

Page 59: ...hange input SW1 to FALSE and check that variable Timer1PV is reset 5 Change input SW2 stop button of the escalator to TRUE and check that output L1 changes to FALSE and variable Timer1PV is reset 6 Ch...

Page 60: ...grams instead of pressing the physical switch 3 6 5 Checking the Operation of the Program Watch Tab Page You can also check the operation of the program in the Watch Tab Page Monitoring can be perform...

Page 61: ...heck that data timer start flag In timer set value PT timer present value ET and timer completion flag Q contained in Timer1 can be monitored 4 Select the variable to monitor in the Ladder Editor and...

Page 62: ...hour minute and second TIME data and instructions to perform calculations easily 3 7 2 Exercise Continuous Operating Time of Escalator Create a program to measure time by using the program created in...

Page 63: ...Insert Input from the Menu to insert an input Press the Key or right click the input and select Diff Up from the menu 3 Insert the GetTime function to acquire date and time when L1 changes to TRUE Pre...

Page 64: ...to subtract StartTime from EndTime Enter LapTime as the output variable name 7 Click the Variables Bar at the top of the window to check the variable table StartTime and EndTime are registered as DAT...

Page 65: ...ect StartTime EndTime and LapTime in the variable table and drag them to the Watch Tab Page Change the value of input SW1 from False to True and check the value of variable LapTime The value of variab...

Page 66: ...make programs easy to read and reuse Two different programming languages ladder diagram and ST can be used You can choose the appropriate language for each process and also program in ST within a ladd...

Page 67: ...periodic task by default Create a program in Program0 because there is no need to worry about task setting 2 When adding a program right click Programs under Programming POUs and select Add Ladder or...

Page 68: ...blocks FBs are instructions used in programs In traditional PLCs like the CJ2 they are called special instructions e g MOV instruction FUN TIM instruction FB In addition to system defined FUN FBs the...

Page 69: ...block FB The values of internal variables are retained until the conditions are completed such as for timers The name instance name is required Set reset SR RS Trigger R_TRIG F_TRIG Counter CTU CTD CT...

Page 70: ...ables are variables registered in the I O Map and used for more than one program They can be accessed from any program External variables and internal variables External variables and internal variabl...

Page 71: ...that the variables such as SW1 and L1 registered in the I O Map are automatically registered as global variables Additional Information Global variables are displayed in purple Checking the variable t...

Page 72: ...72 are automatically registered as external variables Click the Internals Tab Variables registered in this program are automatically registered as internal variables...

Page 73: ...2 1 Application Example 4 75 4 2 2 Programming 4 75 4 2 3 Creating a Project 4 76 4 2 4 Configuring Analog Option Board Settings 4 77 4 2 5 Assigning Variables to the Option Board and Input Terminal...

Page 74: ...d for data processing Arrays All_Data n shown above is called an array The elements of an array are expressed by adding a subscript to the name of the variable that represents the entire array An elem...

Page 75: ...when the Photoelectric Sensor PH1 turns ON The value measured by the Displacement Sensor is stored in variable data1 as analog data and then stored as an element of array variable All_Data 4 2 2 Prog...

Page 76: ...ing a Project 1 Start the Sysmac Studio 2 Enter the project name Select NX1P2 9024DT 1140DT for the device parameter and 1 13 version indicated on the NX1P for the version parameter and then click the...

Page 77: ...rations and Setup Controller Setup in the Multiview Explorer 2 Select NX1W ADB21 Analog Input Option Board for the Option board 1 parameter 4 2 5 Assigning Variables to the Option Board and Input Term...

Page 78: ...PH1 is changed between True ON and False OFF by changing the ON OFF state of the Photoelectric Sensor The data type is Boolean 4 2 6 Program Example When PH1 changes to TRUE the MOVE data movement ins...

Page 79: ...and then enter Array into the Data type Column The data type name candidate ARRAY OF appears 3 Enter 0 for the left question mark and 9 for the right question mark in the section Next enter INT for t...

Page 80: ...variable table 4 2 8 Entering Programming Code 1 Insert input PH1 and set upward differentiation Select a connecting line and press the C Key Right click the input and select Diff Up from the menu or...

Page 81: ...nc instruction 4 2 9 Checking the Operation of the Program This section explains how to check the operation of the program on the Simulator 1 Select Run from the Simulation Menu to start the Simulator...

Page 82: ...PH1 to change the value between True ON and False OFF Change the value of PH1 to True ON 123 is stored in the value of All_Data 0 in the Watch Tab Page Check that n of the Inc instruction is increment...

Page 83: ...lowing procedure to refer values of the registered array variables The figure below shows an example of the program to assign the value of All_Data 3 the 4th value to INT variable temp1 2 Go offline b...

Page 84: ...ve and Setting the Parameters 5 86 5 2 1 Registering a Servo Drive 5 86 5 2 2 Registering the Axis 5 87 5 2 3 Setting the Axis Parameters 5 87 5 3 Creating a Program 5 89 5 3 1 Overview of the Ladder...

Page 85: ...ty MC_TorqueControl MC_SetPosition MC_SetOverride MC_CamIn MC_GearIn MC_GearInPos MC_GearOut MC_MoveLink MC_CombineAxes MC_Phasing MC_ZoneSwitch MC_TouchProbe MC_CamOut MC_Write 5 1 2 Programming Proc...

Page 86: ...EtherCAT under Configurations and Setup in the Multiview Explorer to display the EtherCAT Tab Page 2 Add a Servo Drive as the EtherCAT slave Click the Servo Drives in the Toolbox The list of Servo Dri...

Page 87: ...Add Single axis Position Control Axis from the menu 2 The axis MC_Axis000 0 is added as shown below 5 2 3 Setting the Axis Parameters Double click MC_Axis000 0 The Axis Parameter Settings Tab Page is...

Page 88: ...hose shown below default settings Additional Information Although the 1S series AC Servo System has a built in absolute encoder default incremental encoder settings are used in this exercise When usin...

Page 89: ...on FBs to Use Three motion FBs are used for this exercise Additional Information MC_Home is the Home instruction Set the homing operation in the Homing Settings Tab Page that is displayed by double cl...

Page 90: ...m0 in the Multiview Explorer to open the Ladder Editor 2 Insert N O Input start in the first rung Insert the MC_Power motion FB and enter Power1 as the instance name Search for MC_Power and drag the m...

Page 91: ...other name you prefer 6 Press the R Key to insert a rung below the second rung Insert N O Input home1_done and then insert the MC_MoveRelative motion FB Enter Move1 as the instance name 7 Set the para...

Page 92: ...MC_MoveRelative motion FB to move the ball screw backward at the same velocity Enter Move2 as the instance name Set the parameter for Distance to 1000 to move backward 9 Insert output move_done as sho...

Page 93: ...didates is displayed Select home1_done and TRUE rising to set the execution condition of the motion FB 3 Set the variable to trace Click the Add Target Button and specify MC_Axis000 Cmd Pos Enter MC_A...

Page 94: ...The progress of tracing is displayed in a light blue progress bar at the lower right of the window When the bar disappears the tracing is completed 8 Double click DataTrace0 under Configurations and...

Page 95: ...itor Button shown below Close unnecessary windows 2 Click the Settings Button shown below and select Add from the menu 3 Select Single axis position control for the Type parameter in the 3D Machine Mo...

Page 96: ...hown below to load the traced data 7 Check the 3D equipment motion by using the buttons shown below 8 Use the three viewpoint operation buttons shown below to change and rotate your viewpoint and zoom...

Page 97: ...ing Constructs 6 98 6 1 3 Structure of ST and Example 6 99 6 1 4 Operators 6 99 6 2 NX1P Programming in ST 6 100 6 2 1 Writing an ST Program for NX1P 6 100 6 3 ST Programming Exercise 6 101 6 3 1 Exer...

Page 98: ...hematical processing and data storage that are difficult to program in ladder diagrams account for about 70 of an entire program The use of ST for this part makes programming easier and reduces progra...

Page 99: ...Operator Operation Notation example Priority First priority Value 1 2 3 4 Value is 21 1 Sign 100 100 2 NOT Logical NOT Value NOT TRUE Value is FALSE Exponent Value 2 8 Value is 256 3 Multiplication V...

Page 100: ...be executed under a specified condition e g when an input changes to TRUE or can always be executed Additional Information Adding a program and assigning the program to a task 1 Right click Programs a...

Page 101: ...l Calculation Programming Create a ladder program including inline ST to calculate the distance between two points Exercise Create a program to execute the ST code to calculate the distance between tw...

Page 102: ...variable table 3 Register the variables used for inline ST as internal variables in the variable table Press the Insert Key to insert a row LREAL double precision floating point data enables precise d...

Page 103: ...ndidates is displayed Select Length and press the Enter Key 8 Enter a space and colon The assignment keyword is entered automatically 9 Enter SQRT Square Root and left parenthesis A description of the...

Page 104: ...amming is completed Select Check All Programs from the Project Menu to confirm that there is no error Ignore a warning 6 3 4 Checking the Operation of the ST Program 1 Start the Simulator to check the...

Page 105: ...Length 3 Go offline Save and export the project file Additional Information Write the code created in 4 Creating Programs to Handle Data in ST Instead of using the MOVE and Inc instructions you can us...

Page 106: ...2017 0917 0917 P122 E1 01...

Reviews: