<< Prev        Next >>

ID : 7521

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

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

Also, as the following figure shows, create a program so that the input variable "Execute" of "MC_Reset" is reset when "MC_Reset" has been completed. 
At the same time, create a program so that the input variable "Enable" of "MC_Power" reset when an error occurs.

5

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

6

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

7

Place "MC_WriteAxesGroup" in the end of the program.

 

This completes the programming.

ID : 7521

<< Prev        Next >>