0% found this document useful (0 votes)
11 views

K300 CMx Indexing AOI Example v1_1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

K300 CMx Indexing AOI Example v1_1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Sample Code

Programming Example for a K300 using


Indexing Mode with Indexing Add-on-
Instruction (AOI) and RSLogix5000

K300 CLx Indexing AOI Example v1.1


07/21/2010
Sample Code

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.

This document will cover the following items:

Minimum requirements for basic drive setup.


Where to get the Kinetix 300 AOP and install files for RSLogix5000 v17.
RSLogix5000 tags created when a drive is configured.
Overview of the program sample code.
Explanation of the AOI parameters.
Import Indexing AOI rung into your code.

2) Basic Drive Setup


Once you have your Logix system (controller, drive, motor, etc.) connected and powered up per
the installation manual instructions (2097-UM001A-EN-P), you can begin configuring the Kinetix
300.

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.

See the user manual if you need additional information.

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.

K300 CLx Indexing AOI Example v1.1


07/21/2010 Page 2 of 10
Sample Code

3) Install the AOP


The AOP can be obtained by downloading it from:
http://support.rockwellautomation.com/MySupport.asp
Then navigate to Downloads and then RSLogix5000 I/O Modules Add-On Profiles.

It will be list under ‘2097 Kinetix Drives’ with a version number.

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’.

4) Tags Created in Logix


In this example you can see a 2097-V33PR1 drive was added to the I/O Configuration and named
‘K300_N1’. A set of Tags was also created when the drive was added.

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.

5) Logix Program Code


The example code is located in routine ‘R6_IndexMode’ under the Main Program Task.

K300 CLx Indexing AOI Example v1.1


07/21/2010 Page 3 of 10
Sample Code

The code within the routine shows an example of how to:

Enable the drive


Disable the drive
Do a fault reset – this is done via Explicit Message Instruction
Configure and run two different index moves. The indexes are built by writing to the K300
Index Assembly object via the AOI.
Stop motion

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.

They are on rungs 3, 7, 9 & 10 in routine ‘R6_IndexMode’.

Example:

Open the message dialog window, select the Communication tab and Browse to you drive to set
the Path.

K300 CLx Indexing AOI Example v1.1


07/21/2010 Page 4 of 10
Sample Code

6) Explanation of the AOI


Below is a brief explaination of the Indexing AOI.

Tags Explained:

The AOI has 3 tags that are accessed and used:

• 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.

K300 CLx Indexing AOI Example v1.1


07/21/2010 Page 5 of 10
Sample Code

AOI Parameters explained:

• 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.

7) Import Indexing AOI


Included with this example is a file K300_IndexAOIRung.L5X. This is a rung of code that
contains the AOI that is used in the program example. If you need to add additional indexes to the
code or would like to add the AOI to a different Logix file, below are steps to show you how.

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.

K300 CLx Indexing AOI Example v1.1


07/21/2010 Page 6 of 10
Sample Code

c. Navigate to the file Program K300_IndexAOIRung.L5X, and click Import.

The Import Configuration dialog with display.

d. Select your Kinetix 300 drive from Other Components as shown.

Note: DO NOT click OK yet.

K300 CLx Indexing AOI Example v1.1


07/21/2010 Page 7 of 10
Sample Code

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.

K300 CLx Indexing AOI Example v1.1


07/21/2010 Page 8 of 10
Sample Code

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.

i. Now, click OK to complete the rung and Indexing AOI import.

j. Make adjustments to the auxillary code as necessary.

K300 CLx Indexing AOI Example v1.1


07/21/2010 Page 9 of 10
Sample Code

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.

K300 CLx Indexing AOI Example v1.1


07/21/2010 Page 10 of 10

You might also like