<< Prev        Next >>

ID : 3308

Sample Program

This section shows a sample program for the robot control with Command-Slave function.

The following steps shows how to create a sample program that moves the 6-axis robot from the start position to the target position with PTP control, absolute position movement.

1

Place "MC_ReadAxesGroup" on the top of the program.

2

Place "MC_Initialize".
As the following figure shows, placing "normal open" after "MC_Initialize" will stop the following programs if the connection between robot controller and PLC is error.

3

Place "MC_DefineJointVar", and then specify the start position and target position.
If the start position and target position have been specified, go on to STEP4.

4

Place "MC_Power" to turn the robot motor on.
Assign any global variable in the input parameter "Enable".


5

Place "MC_Reset" just after "MC_Power" in case of error.
Assign any global variable in the input parameter "Execute".

6

Place "MC_MoveAxisAbsolute" to move the robot to the start position.
Assign any global variable in the input parameter "Execute".
Assign the start position, which has been specified just before, in the input parameter "AxisPosition".

7

Place "MC_MoveAxisAbsolute" to move the robot to the target position.
Assign any global variable in the input parameter "Execute".
Assign the target position, which has been specified just before, in the input parameter "AxisPosition".

8

Place "MC_WriteAxesGroup" in the end of the program.
Assign any global variable in the input parameter "Override".

This completes the programming.

ID : 3308

<< Prev        Next >>