Yaskawa NS300 User Manual

Subject: Technical Note Product: NS300/NS500 Doc#: EM.MCD.05.106 Title: NS300/500 Master Ladder Example
Technical Note
NS300/500 Master Ladder Example
Doc#: Copyright Yaskawa Electric America ©2004 May 9, 2007 Page 1 of 16
Subject: Technical Note Product: NS300/NS500 Doc#: EM.MCD.05.106 Title: NS300/500 Master Ladder Example
Summary
This document describes the example ladder program for implementing control of the NS300 and NS500 application modules in a master PLC. This example code demonstrates how to control motion and how to use the set/read commands. Example ladder files are available in .pdf and .mal formats as a guide for implementing the code into any type of ladder language. Please see document eng.MCD.05.105 for the example ladder files.
Demonstrated Features
Motion commands: Feed Command, Step Command, Point Table Command, Station Command, Zero
Point Return, Simple Positioning, External Positioning, Notch Output Positioning, Multi-Speed Positioning
Set/Read commands: Read Parameter, Write Parameter, Set Current Position, Set Zero Point, Read Alarm,
Reset Module
Development Setup
The setup used to write and test the example ladder is shown below. An MP940D was used as the DeviceNet master, and NS300 demo was used as the test unit. Note that operation is identical on the NS500, except that the PROFIBUS protocol is used instead of DeviceNet. Ladder code was written in the MPE720 MotionWorks software environment, and local I/O of the MP940 was used to simulate PLC signals.
MP940D
Local I/O
NS300
Module
MP940D
Controller
Fig 1. Setup for Writing Example Master Ladder
Doc#: Copyright Yaskawa Electric America ©2004 May 9, 2007 Page 2 of 16
Subject: Technical Note Product: NS300/NS500 Doc#: EM.MCD.05.106 Title: NS300/500 Master Ladder Example
Before Programming
Before beginning programming for the NS300/500 master ladder, be sure to do the following:
Configure communications in the PLC. Follow the setup procedure provided with the PLC for adding a
device to the scan list of the selected network. The NS300/500 requires 8 bytes in/out. It is recommended to configure the second four bytes as data type long (or double-word) for convenience. If using a PLC that requires a setup file, the DeviceNet and PROFIBUS files can be found as shown below:
Table 1. Network Configuration Files
Category NS300 NS500
Setup File
NS300(rotary).eds NS300(linear).eds
NS500.gsd
Location www.yaskawa.com - search FAQ www.yaskawa.com - search FAQ
Configure communications in the NS300/500. This entails setting the DIP switches properly for
communications baud rate and network address. See the NS300/500 manual for proper settings.
Verify the functionality of E-stop, POT, and NOT on CN4 of the NS300/500. If using the hardware E-
stop, monitor the status of this bit using the NSxxx software to ensure that it is working as intended. Disable this input if not being used by setting Pn81B, bit 0 = 0. Verify POT and NOT are connected properly to the SGDH by monitoring these with the NSxxx software. If not using either of these signals, they can be masked off by setting Pn50A.3 = 8, and Pn50B.0 = 8.
Test communications between the PLC and NS300/500. Make sure the two devices are
communicating by opening a watch window in the PLC software. Test the E-stop bit from the PLC (be sure the E-stop bit at CN4 of the NS300/500 is set) and verify that a response is being received from the NS300/500 as the bit is toggled. Spin the motor by hand and monitor motor position by observing bytes 4 thru 7 of the response message.
Doc#: Copyright Yaskawa Electric America ©2004 May 9, 2007 Page 3 of 16
Subject: Technical Note Product: NS300/NS500 Doc#: EM.MCD.05.106 Title: NS300/500 Master Ladder Example
Register Summary
The chart below shows the assignment of the global and I/O registers used in the example program. Local registers are used throughout the program, but are not listed in this chart. This chart contains the registers accessed directly by the user.
Table 2. Example Master Ladder Register Addressing
MP940D Local I/O Inputs
User inputs to simulate PLC signals
Input Function Input Bit Bit Symbol Functionality
Input 0 IB00000 MB00000 PLC_ESTP N.C. E-stop Input 1 IB00001 MB00001 PLC_SVON Enables Servo Input 2 Alarm Reset IB00002 M B00002 PLC_ALARM_RESET Clears NSxxx Alarm Input 3 Start IB00003 MB00003 PLC_COMMAND_START Starts motion command Input 4 Direction IB00004 MB00004 PLC_DIR Selects forward/reverse Input 5 Inc/Abs IB00005 MB00005 PLC_ABS_INC Incremental or absolute Input 6 Hold IB00006 MB00006 PLC_HOLD Pauses motion command Input 7 Cancel IB00007 MB00007 PLC_CANCEL Cancels motion command
/E-Stop Servo On
PLC Co mm a n d B its
Bits to be controlled by PLC program
PLC Co mm a n d R e g is te r s
Command data loaded into these registers
Symbol
PLC_COMMAND_SELECT PLC_RESPONSE_CO DE PLC_FEED_SPEED PLC_STEP_NUMBER ML00006 3 PLC_STATION_NUMBER ML00008 4 PLC_POINT_TABLE_ROW ML00010 5 PLC_TARGET_POSITION ML00012 6 PLC_PARAMETER_N UM BER PLC_PARAMETER_D ATA PLC_CURRENT_POSITION_SET ML00018 9
Register
MW00002 0 MW00003 1 ML00004 2
MW00014 ML00016
PLC_C O M M AND_ S ELE CT Se ttin g s
Value to be loaded for type of motion command
PLC_RESPONSE_CODE Settings
Determines meaning of response message
Follow response code settings as listed in user's manual.
Setting
10 Read Parameter 11 Write Parameter 12 Set Current Position 13 Set Zero Point 14 Read Alarm 15 Reset Module
Description
No operation Feed Step Station Point Table Zero Point Return Positioning
7
External Positioning
8
Notch Output Positioning Multi-Speed Positioning
Doc#: Copyright Yaskawa Electric America ©2004 May 9, 2007 Page 4 of 16
Subject: Technical Note Product: NS300/NS500 Doc#: EM.MCD.05.106 Title: NS300/500 Master Ladder Example
Programming the NS300/500 Master Ladder
Properly programming the network master controller of the NS300/500 is essential for success when implementing one of these application modules. Most application issues identified in the field are the result of an application program that does not adhere to the NS300/500 timing diagrams. This technical note is intended to explain how the example master ladder program operates, and how it effectively eliminates common programming mistakes. Following the principles described in this tech note will greatly reduce troubleshooting by eliminating the majority of application issues. Three main issues are addressed; general program flow, best practices programming, and proper command bit sequencing and interlocking. After addressing these issues, specific highlights of the program are also discussed.
Doc#: Copyright Yaskawa Electric America ©2004 May 9, 2007 Page 5 of 16
Loading...
+ 11 hidden pages