Creating Procedures
As a control program becomes more complex, it is often desirable to break it down into
smaller more manageable tasks. This is where procedures are used. For example, in the
case of the airplane model, it may be beneficial to break the process down as follows:
• Start airplane motor.
• Throttle up to full power for takeoff.
• Lift landing gear.
• Lower landing gear.
Some of these functions could become procedures within a flowchart. In addition to
making the control program easier to create, it also makes it easier to read by avoiding
extremely long programs that seem to scroll down the page forever!
Procedures can also be used effectively for a repeating task. Creating a procedure for
the task and then calling the procedure for X number of repeats reduces programming
time and space.
For example:
To flash a light 20 times simply create a procedure that flashes the light
once and then repeat twenty times.
All procedures must end with the Stop command. To create a procedure:
1. Click on the Start symbol.
2. In the selection panel click on the Procedure button and enter a name
for the procedure.
An unlimited number of procedures can be used in a flowchart. However, procedures
can only be nested inside each other (Procedure B is “nested” or called for in Procedure A)
14 times.
K’NEX Robotics User’s Guide
Education
®
Building Programs
education.com
Education
®
Building Programs
49
SOFTWARE