K300 CMx Indexing AOI Example v1_1
K300 CMx Indexing AOI Example v1_1
1) Introduction
This example code shows one method to write Index configurations to the Kinetix 300 drive in
Indexing Mode via an AOI (Add On Instruction).
The Indexing AOI takes the values to configure a motion index profile and writes it to the Kinetix
300 Index Assembly object.
Establish an Ethernet connection from your PC to the Kinetix 300’s Ethernet port to configure the
drive. Once connected to the drive, navigate to the drives IP address from your web browser or
run the ‘MotionView OnBoard’ JAVA interface if already installed on your PC.
You will need to complete the following items at a minimum to use the program code in this
example:
Configure the motor. If using a motor with incremental feedback, select the motor you are
using from the listing. If the motor has an absolute programmed encoder it will be
automatically selected. (Note: if your motor has an intelligent encoder, -S,-M, it will be
recognized by the Kinetix 300 drive automatically.)
Set User Units scaling – in this example we use 1 rev/motor rev.
Auto Tune the motor (system).
Set the Drive Mode to Ethernet/IP External Reference under the General tab.
Unzip the file and run the install program (MPSetup.exe). Version 17 of RSLogix5000 needs to be
already installed on the PC for the AOP to install properly. Follow the onscreen instructions and
install the ‘Rockwell Automation 2097 Kinetix Module Profile’.
Here we see ‘K300_N1:I’ which contains status tags from the drive being read into Logix and
‘K300_N1:O’ which are parameter tags that can be written out of Logix to the drive.
The ‘R0_Power_Up’ routine initializes registers and command bits. The routine only runs once on
first program scan.
Important: There are four (4) message instructions that need to be modified to work with your
drive. You will need to modify the path to the drive for the message instruction to work.
Example:
Open the message dialog window, select the Communication tab and Browse to you drive to set
the Path.
Tags Explained:
• K300_IndexConfig (type K300_IndexConfig): This tag provides the status bits EN, DN, ER
and the ‘holding’ location for move parameters you can enter for the Index. When the
instruction enables, the EN bit is set. If the configuration is valid and completes successfully,
the DN bit is set. If the instruction errors because of an invalid parameter or something else,
the ER bit is set.
• OutputValues (type UDT_K300_Index): This tag provides a place for you to ‘auto load’ the
index parameters from an array or other mechanism to load multiple indexes with one
instruction. If you decide to use one AOI per index, as shown in this example, then your
Output values is no more than a Place Holder for your index information, hence the tag name
PlaceHolderIndex0.
• IndexMSG (type MESSAGE): This MSG will write the entire Index Assembly object (115)
which contains information for 1 full index.
• Set_IndexNumber: This is where you enter the index you would like to configure, valid
entries are 0-31
• IndexDistance: The distance of the index, in engineering units(ie: revs,mm, whatever the
drive is configured for), this value can be – or + sense to designate direction of the index
• IndexSpeed: The speed of the index also in engineering units, this value is + only, a zero or
negative value will result in an error
• Index Accel: The acceleration rate for the index in engineering units, this value is + only, a
zero or negative value will result in an error
• Index Decel: The deceleration rate for the index in engineering units, this value is + only, a
zero or negative value will result in an error
• Index Batch: The number of times to repeat the index, a zero or 1 indicates to execute the
index one time only
• Index Type: 0=Absolute, 1=Incremental, 2=RegistrationAbsolute,
3=RegistrationIncremental, 4=Stitched (any other value will result in an error)
• IndexMoveType: 0=Trapezoidal profile, 1=S-Curve profile
• IndexNextIndex: The next index to perform upon completion of this index, valid entries are
0-31
• IndexNextAction: The next Action to perform upon completion of this index. 0=Stop
motion and hold zero velocity, 1=Wait for Start Index Command over EtherNet, 2=Start
Next without Stopping (dwell time is used).
• IndexRegistrationDistance: If the Registration Input is configured, once asserted, the index
will perform either an additional Incremental motion of the Distance here, or if Absolute
Registration is selected, will move to an Absolute Position.
• IndexDwell: Time to dwell at completion of the index.
Important: The preferred method to add another Indexing AOI to code is to import the rung with
the AOI. Because the AOI includes a Message Instruction, importing it keeps the messaging
parameters intact, whereas they are lost with a copy and paste.
a. Open an RSLogix 5000 program that already has the Kinetix 300 drive
configured.
b. Right-click on a rung from within a program routine and select Import Rungs.
e. Next, select Data Types and one of the following options will be available under
the Operation column; Create – if this is your first time importing the AOI, or
Use Existing – if the AOI already exists in your code.
f. Next, click on Add-On Instruction, and again either Create or Use Existing will
be options under the Operation column for the AOI - K300_IndexConfig. You
do have the option to rename if you choose.
g. Now click on Tags. Here you may need to rename the Tags depending on your
application program. The default tag is set for Index0, but you may need to
rename it for Index1, Index2, etc.
h. Also, notice that you have a Flag next to the Input Tag referencing the AOP
Input Tag for the K300 drive. You need to select the tag for your drives’ Input
Tag Structure created by the AOP in your application under the Final Name
column.
Disclaimer
This sample code delivered by Rockwell Automation is just an example of how to control a K300 drive
via Ethernet.
Disclaimer Of Warranty
THE MATERIALS DELIVERED WITH THIS EXAMPLE ARE PROVIDED "AS IS" WITHOUT
WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ALL
IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
NONINFRINGEMENT OR OTHER VIOLATION OF RIGHTS. ROCKWELL AUTOMATION DOES NOT WARRANT
OR MAKE ANY REPRESENTATIONS REGARDING THE USE, VALIDITY, ACCURACY, OR RELIABILITY OF, OR
THE RESULTS OF THE USE OF, OR OTHERWISE, RESPECTING THE MATERIALS MAINTAINED ON OR
ACCESSED BY WAY OF THIS SITE OR ANY WEB SITES LINKED TO THIS SITE. FURTHERMORE, ALL
WARRANTIES, CONDITIONS, REPRESENTATIONS, INDEMNITIES AND GUARANTEES WITH RESPECT TO THE
ACCURACY, OPERATION, CAPACITY, SPEED, FUNCTIONALITY, QUALIFICATIONS, OR CAPABILITIES OF
THE SOFTWARE, SYSTEMS AND SERVICES COMPRISING OR UTILIZED IN THE OPERATION OF THIS CODE,
WHETHER EXPRESS OR IMPLIED, ARISING BY LAW, CUSTOM, PRIOR ORAL OR WRITTEN STATEMENTS BY
ROCKWELL AUTOMATION, OR OTHERWISE (INCLUDING, BUT NOT LIMITED TO ANY WARRANTY OF
SATISFACTORY QUALITY, MERCHANTABILITY, FITNESS FOR PARTICULAR PURPOSE, TITLE AND NON-
INFRINGEMENT) ARE HEREBY EXPRESSLY EXCLUDED AND DISCLAIMED.
Disclaimer Of Liability
UNDER NO CIRCUMSTANCES (INCLUDING NEGLIGENCE) WILL ROCKWELL AUTOMATION BE LIABLE FOR
ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES (INCLUDING
WITHOUT LIMITATION, BUSINESS INTERRUPTION, DELAYS, LOSS OF DATA OR PROFIT) ARISING OUT OF
THE POSTING (OR THE INABILITY TO POST) OR THE USE (OR THE INABILITY TO USE) THE DELIVERED
CODE EVEN IF ROCKWELL AUTOMATION HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.