Creating and running a program, Example 1 - a basic motion program, Creating and running a program -2 – Rockwell Automation 2098-IPD-xxx Ultra5000 C Programming using the Motion Library User Manual

Page 14: Example 1 - a basic motion program -2

Advertising
background image

Publication 2098-PM001E-EN-P — July 2002

1-2

Programming Motion Control in C

The first short program you will write:

• Moves the axis 1000 counts in the positive direction
• Delays program execution for 1 second
• Returns the axis 1000 counts in the negative direction

While the code is compact, what is important at this point is the
process. You must create the program text in a Project file, build it
successfully, load it, and run it.

Creating and Running a Program

The Ultraware User Manual (2098-UM001F-EN-P) instructs you about
how to create and run a program. The steps involved in creating and
running a program are:

1. Create a Project.

2. Create and edit a Source (.c) file.

3. Use the Program menu’s Build command to compile and create

the executable program (.exe) file.

4. Move the executable program file to the Program branch of an

On-Line drive.

5. Use the Program menu’s Run, Stop and Kill commands to control

the program’s execution.

You may remember an additional step, creating and editing a Header
file. For now that is an unnecessary step.

Example 1 - A Basic Motion Program

The first Ultraware program example starts you programming in C
using Ultraware Motion Library functions. To begin:

1. Insert a project into your program database.

2. Insert a source file into your newly created project.

Advertising