ID : 5229
Descriptions of Main Commands
This section describes the minimum commands required in programming, using a simple motion program
Program Example
In the example shown below, the robot arm moves from the current position to P2 via P1 under PTP control.
Program file name: PRO1.pcs
'!TITLE "Denso Robot Program" 'Program title
Sub Main 'Declare main procedure
TakeArm Keep = 0 'Obtain arm semaphore
Speed 100 'Set the internal speed at 100%
Move P, P1 'Move to P1 position under PTP control
Move P, P2 'Move to P2 position under PTP control
GiveArm 'Release arm semaphoe
End Sub 'End of program
Form of Command
- Elements enclosed by [ ] (square brackets) are omittable.
- Alphabets are not case-sensitive.
Creating Program File Names
When creating a new program, a "file name" must be declared on the first line of [Edit] window. This will be a program file name and displayed on the top of the window along with ".pcs" extension. This program file name is used when the program is called from other programs.
Declaring Program Names (Sub Main command)
Description
This command declares items required for program execution such as program names and variables prior to execution. A program name must be declared on the first valid line of the program. Programs to initiate from external equipment should have a name of "Sub Main".
Syntax
Sub Main
Program Stop (End Sub command)
Description
To declare the end of procedure.
Syntax
End Sub
Obtaining an Arm Semaphore (Takearm command)
Description
Under multi-tasking control, it is necessary to transfer/receive the arm semaphore (robot control priority). When using a motion command that moves the robot arm, be sure to insert a TAKEARM command so that the program can obtain the control priority.
Syntax
Takearm[arm group number][ Keep = Keep option setting value]
Releasing an Arm Semaphore (Givearm command)
Description
To release control of the currently-acquired arm group expressly. Control of the arm group that each task acquired is automatically released after completion of the task, so this command is not required when "End sub" is entered.
Use the GiveArm statement only when you want to expressly release control in order to acquire control of a different arm group for the same task or to pass control to a different task.
Syntax
Givearm
Changing the Robot Speed (Speed command)
Description
The internal speed is specified in percentage (from 1 to 100).
Actual arm speed (%) = External speed (%) x Internal speed (%)
Change of internal speed is accompanied by change of internal acceleration and internal deceleration.
- The external speed is the speed specified from external equipment such as the teach pendant or PLC.
- A SPEED command is effective until the next SPEED command is executed.
Syntax
Speed speed
Comment (Rem command)
Description
Enter a comment string.
Strings entered between a single quotation or Rem and a line break are recognized as a comment. These texts are not compiled or executed.
Syntax
'[comment] (or Rem[comment])
ID : 5229