Example: A Simple User Program

This topic shows a simple user program. For a detailed example on how to create a basic user program, see the Example: Creating a Basic User Program topic.

Assume the User Program below is from a system scaled to inches, so that 1 pu (position-unit) is 1 inch. This example User Program does the following:

Step 0:

Command:

Moves Axis 0 to 1 in. at 20 in/sec.

Link:

Waits for Axis 0 In Position status bit to turn on, which means the axis has reached the requested position. This link type is easily created using the Link Type Wizard.

Step 1:

Command:

Sets a Discrete Output.

Link:

Waits for 5 seconds, then it goes to the next step.

Step 2:

Command:

Moves Axis 0 to 20 in. at the speed specified by the FastSpeed variable. This variable must have previously been defined in the Variable Table.

Link:

Waits until the Axis 0 Actual Position is greater than 10, then it goes to the next step.

Step 3:

Command:

Moves Axis 0 to 20 inch at the speed specified by the SlowSpeed variable. This variable must have previously been defined in the Variable Table. Notice that this command is issued before the axis reaches the Command Position from step 2. This effectively slows down the speed of the move.

Link:

Ends the User Program immediately. Notice that the User Program stops running immediately, and the RMC will still finish making the move.



See Also

Programming Examples Overview


Send comments on this topic.

Copyright © 2024 Delta Computer Systems, Inc. dba Delta Motion