You are on page 1of 5

Programming and Verification with Teach Pendant

ID : 5223

<< Prev        Next >>

Related Information

Basic Knowledge of Programming and Commands

Programming with Teach Pendant

This section shows how to create a program using the teach pendant, with a simple example.

When creating and editing a program, turn the operation mode to Manual.

Related Information

Overview of Sample Program

Entering a New Program Name

Entering Program Codes

PRE-CHECK of the Program

Starting a Program from Teach Pendant

Related Information

Simulating a Program Operation with Teach Pendant

Starting a Program in Teach Check Mode

Starting a Program in Auto Mode

Basic Knowledge of Programming and Commands

Related Information

Features of PAC Language

Maximum Number of Loadable Programs

Overview of Program Configuration

Descriptions of Main Commands

Movement to the Specified Coordinates (MOVE command)

Movement in the Z-Axis Direction (Approach and Depart commands)

Scope of Variables

Initiating from External Equipment


Descriptions of PacScript

What is PacScript

PacScript is a programming language to control DENSO Robotics.

"Pac" in "PacScript" refers to initial letters of the following words.


 P: Programable
 A: Automation
 C: Controller

Configuration of PacScript

PacScript generates execution programs based on the user created program file. This execution
program is called "task". Various actions and process are available by executing the tasks.

RC8 series manages files like general personal computers do. You can create multiple program files
and manage them in folders.

Files which can be Managed by RC8 Series

Name of file (file name) as follows managed by RC8 series must be based on naming convention.
 Program Files
A file for describing PacScript program. You can execute this file as a task. General program
files, supervisory task program files and panel program files are included.
 Header file
A file for describing Macro definition. File extension is ".h".
 Other files
BMP files used on the panel can be managed.

Statement and Line

A PAC language program is configured with multiple lines.


 One statement can be described on an arbitrary line.
 The length of a line may be up to 1024 bytes.
 A statement is the minimum unit to describe a process in the PAC language and it is
comprised of one command.
 A command is comprised of a command name and the information (parameter) given to the
command.
Name

The PAC language has regulations for identifying various elements in a program. This chapter
provides an explanation of these regulations. Names that express commands, variables, functions,
labels and programs follow the conventions described below.
 The first letter should be a character of alphabet [a to z].
 The second-to-last character should be alphabet [a to z], number or "_ (underscore)".
 These are case-insensitive."Test01", "test01" and "TEST01" are recognized as identical
characters.
 Only one-byte characters are available.
 The maximum number of characters that can be used for a name is 64.
 Reserved word cannot be used for a name.

Maximum Number of Loadable Programs


The maximum number of loadable programs in one controller is 256 at default setting as shown
below.
File type File format Maximum program number at default setting

PacScript
***.pcs
program

256 in total
Header file ***.h

TP panel file ***.pns

Changing the Maximum Number of Program


These values can be changed in the [Program Parameters] window.
To display the [Program parameters] window, press [F1:Program] [F6:Aux] [F5 Program parameters],
then change the value of [No2: Maximum number of program].

Overview of Program Configuration


A program consists of following compornents.
 Main procedure
A program which perform as a major role in the program. Each program file has only one
main program. A main procedure is a program that becomes a leading part of each program
file and exists only by one per one program file. A main procedure starts by "Sub Main", and
ends with "End Sub". This program becomes basic of the program operation. More than one
sub-procedure and function-procedure can be built in the main procedure to create a series of
program.
 Sub procedure
A sub procedure is a procedure which is frequently called from other program and written
exclusively. This procedure can be called by a main procedure or other sub procedures. Sub
procedures can include function procedure. More than one sub procedures can be written in
one program file. A sub procedure starts by "Sub Main", and ends with "End Sub".
 Function procedure
A procedure which is designated by user. More than one function procedures can be written in
one program file. A function procedure starts by "Function" and ends with"End Function".
 Entry point
A point where a main procedure starts.

A function described here is a calculation formula which meets following criteria.


1. Include "=".
2. Include variables and the form is "Variable = calculation formula"
3. When you enter parameter value, calculation result will be generated to variable.
Example: bbb = FuncA(aaa)
In this case, "bbb" is variable and the calculation result will be generated to it. "aaa" is
parameter.

A section of a program that repeats a specific motion can be put out of the program and called if
required.

The method of putting this section in the same program is called a subroutine. If this section is
independently put in a separate file as another program and that program is called, this is referred to as
calling a program.

A subroutine must be included in the same file as the calling program.

The program of an independent separate file can be called from various programs and commonly used.

If a series of work is organized as a unit of a subroutine or another program, the same contents do not
have to be described repeatedly. This is effective for correcting descriptions, reducing the creation
time and otherwise improving the ease of reading programs.

Procedure name
Each procedure name, whether Sub or Function, must be unique within a task. Even when a program
file is loaded by #Include, all procedure names must be unique. "#Include" is a command to read a
designated file from other program files.
For details, refer to "#Include"of PROGRAMMER'S MANUAL.

You might also like