Você está na página 1de 14

62)7:$5(0$18$/

/$''(5/$1*8$*(
5HIHUHQFH*XLGH
According to law, ORSI AUTOMAZIONE S.p.A. reserves the rights inherent to the property of this document, prohibiting its
reproduction (either in full or in part) and its disclosure in any form to third parties or competitors without written
authorisation.

Although great care has been taken in compiling this document to ensure that the information contained herein is correct, no
guarantee or warranty is given or implied.

The policy of ORSI AUTOMAZIONE S.p.A. is to constantly improve its products. Therefore, ORSI AUTOMAZIONE S.p.A.
reserves the right to make any changes to the product in question without prior notice.

This document is not an integral part of the contract offer, unless expressly mentioned.

INTEGRAL, ITER and P.M.C. PROGRAMMABLE MULTI-FUNCTION CONTROLLER are registered trademarks of ORSI
AUTOMAZIONE S.p.A.
CUBE, CUBE-FND, CUBE-GMS, CUBE-IMC, CUBE-ISM, CUBE-ODS, CUBE-PDE, CUBE-DEM, EXAD, INTEGRAL³, ITER
II, ITERNET, P.M.C. CP16, P.M.C. Series 5, P.M.C. Series 8, P.M.C. Series 10, P.M.C. Series 15, TLOOP, TurboARC are
trademarks of ORSI AUTOMAZIONE S.p.A.
CUBE-FND software, CUBE-GMS software, CUBE-IMC software, CUBE-ISM software, CUBE-ODS software and CUBE-
DEM software are copyrights of ORSI AUTOMAZIONE S.p.A. 1993-1998
DOMINO, PLC and PLC-5/xx are registered trademarks of Allen-Bradley
RediPANEL, Data Highway Plus and DH+ are trademarks of Allen-Bradley
ARCNET is a registered trademark of Datapoint Corp.
Microsoft is a registered trademark of Microsoft Corp.
Windows and Windows 95 are registered trademarks of Microsoft Corp.
Windows NT, Excel, Access, Word, Visual Basic and Visual C ++ are trademarks of Microsoft Corp.
Intel and iRMK386 are trademarks of Intel Corp.
IBM is a registered trademark of International Business Machines

In this document, mention may be made of trademarks belonging to third parties.

Manual code: MT134/03E


Edition: March 1998

ORSI AUTOMAZIONE certification number 9115.ORSI (June 26, 1996)


iii

Table of Contents

Information about CUBE ........................................................... ix


Customer-Support Services ....................................................... x
Hot-line Assistance and Online Services ................................................x
Technical WEB........................................................................................x
On-site assistance.................................................................................. xi
Educational Services.......................................................................... xi
Software Updates.................................................................................. xii
In this manual...........................................................................xiii
Purpose of this manual ........................................................................ xiii
Structure of this manual ....................................................................... xiii
How to use this manual........................................................................ xiv
Reader’s requirements......................................................................... xiv
1. Introduction ..........................................................................1.1
2. Ladder language...................................................................2.1
Elements of a Diagram............................................................2.2
Power-supply bar and termination line.................................................2.3
Branches and branch status ................................................................2.3
Contacts ...............................................................................................2.4
Diodes ..................................................................................................2.5
Coil .......................................................................................................2.6
Function blocks ....................................................................................2.7
User-module blocks .............................................................................2.8
Variable monitor ...................................................................................2.9
Comments............................................................................................2.9
Ladder Programming...............................................................2.9
Data classification ................................................................................2.9
Global variables .............................................................................2.10
Constants .......................................................................................2.12
Formal parameters and addressing mode .....................................2.13
Conversion operator "#" (Number sign) .........................................2.14
Choosing symbolic names for the variables ......................................2.15
Scheduling algorithm.............................................................2.17
Order of block activation ....................................................................2.17
iv

Optimising Boolean expressions........................................................2.18


Shared rungs......................................................................................2.20
A particular network configuration......................................................2.21
Scheduling non-terminal blocks .........................................................2.22
General programming rules...................................................2.26
Microsoft Languages .............................................................2.28
Using FORTRAN language with LADDER.........................................2.29
Calling up LADDER subroutines from FORTRAN .........................2.29
Calling up FORTRAN subroutines from LADDER .........................2.30
Using MACRO ASSEMBLER language with LADDER......................2.31
Calling up a LADDER subroutine from an ASSEMBLER module..2.34
Calling up an ASSEMBLER subroutine from LADDER .................2.37
Using C language with LADDER........................................................2.37
3. Function Blocks ...................................................................3.1
List of the Blocks by Category.................................................3.2
Arithmetic Instructions..........................................................................3.3
Base Instructions..............................................................................3.3
Advanced Instructions......................................................................3.3
Backup Instructions..............................................................................3.4
Base Instructions..............................................................................3.4
Bit String Instructions ...........................................................................3.4
Base Instructions..............................................................................3.4
Boolean Instructions.............................................................................3.4
Base Instructions..............................................................................3.4
Character String Instructions................................................................3.5
Advanced Instructions......................................................................3.5
Comparison Instructions ......................................................................3.6
Base Instructions..............................................................................3.6
Control Instructions ..............................................................................3.7
Base Instructions..............................................................................3.7
Advanced Instructions......................................................................3.8
Data File Instructions .........................................................................3.10
Advanced Instructions....................................................................3.10
I/O Instructions ...................................................................................3.11
I/O Interface (CP16 excluded)........................................................3.11
I/O Interface (CP16 only) ...............................................................3.12
Low-Level Instructions .......................................................................3.13
Base Instructions............................................................................3.13
v

Advanced Instructions....................................................................3.13
Network Instructions...........................................................................3.13
Advanced Instructions....................................................................3.13
Numerical Instructions........................................................................3.14
Base Instructions............................................................................3.14
Advanced Instructions....................................................................3.15
Program-Time Interface .....................................................................3.15
Advanced Instructions....................................................................3.15
Selection Instructions .........................................................................3.16
Base Instructions............................................................................3.16
Advanced Instructions....................................................................3.16
Sequence Control Instructions ...........................................................3.17
Base Instructions............................................................................3.17
Advanced Instructions....................................................................3.17
Timers and Counters..........................................................................3.18
Base Instructions............................................................................3.18
Type Conversion Instructions.............................................................3.18
Base Instructions............................................................................3.18
Advanced Instructions....................................................................3.19
Transfer Instructions ..........................................................................3.20
I/O Interface (CP16) .......................................................................3.20
User Interface Instructions .................................................................3.20
Advanced Instructions....................................................................3.20
Vectorial Instructions..........................................................................3.20
Base Instructions............................................................................3.20
Advanced Instructions....................................................................3.21
Alphabetical List of Blocks.....................................................3.22
ABS ....................................................................................................3.25
ADD....................................................................................................3.27
AND....................................................................................................3.30
BCD_TO_INT (BCDINT) ....................................................................3.33
BTR ....................................................................................................3.35
BTW ...................................................................................................3.41
CMPV .................................................................................................3.47
CTU (COUNTER-UP) ........................................................................3.50
DCOIL (TIME) ....................................................................................3.54
DIV .....................................................................................................3.57
EQ ......................................................................................................3.60
FILL ....................................................................................................3.62
FLOAT_TO_INT (FTOI) .....................................................................3.65
GE (GREATER-EQ.)..........................................................................3.67
vi

GT (GREATER) .................................................................................3.69
HCOIL (HOLD)...................................................................................3.71
INT_TO_BCD (INTBCD) ....................................................................3.74
INT_TO_FLOAT (ITOF) .....................................................................3.76
LE (LESS-EQUAL).............................................................................3.78
LODV .................................................................................................3.80
LT .......................................................................................................3.83
MAX ...................................................................................................3.85
MEAN .................................................................................................3.88
MIN.....................................................................................................3.91
+MOD.................................................................................................3.94
-MOD..................................................................................................3.97
MOVE (MOV) ...................................................................................3.100
MUL..................................................................................................3.102
NE ....................................................................................................3.105
NEG .................................................................................................3.107
NOT..................................................................................................3.109
OR ....................................................................................................3.112
RESUME..........................................................................................3.115
RS ....................................................................................................3.118
R_TRIG (ONE SHOT)......................................................................3.120
SHL (SHIFT-LEFT) ..........................................................................3.122
SHR (SHIFT-RIGHT) .......................................................................3.125
STOV ...............................................................................................3.128
SUB ..................................................................................................3.131
SUSPEND........................................................................................3.134
VMOVE (MOVV) ..............................................................................3.136
WAVE...............................................................................................3.139
vii

Typographic conventions

Throughout this Manual, specific typographic conventions have


been used, which are described below:

symbol/convention indicates

& A reference made to another


manual.

Points of particular importance


Important

Ex. Those points in which


examples are given.

Text in Boldtype The names of menus,


commands, dialog boxes and,
in general, all strings; for
example, File menu; Save
command.

Underlined characters Mnemonic-access characters,


which allow you to activate a
command from the keyboard;
for example: File: ALT+F.

KEY1+KEY2 Accelerator or shortcut keys,


which permit rapid access to
commands; for example:
CTRL+C.

UPPERCASE The names of keyboard keys


and toolbar buttons; for
example: RETURN key;
PLANT button.
viii

symbol/convention indicates

Italics The names of parameters that


must be replaced with a
specific name or value: for
example: filename indicates
that the name of the file must
be specified; input indicates
that the corresponding value
must be specified.

Ð A succession of commands in
which the command preceding
the symbol must be selected
before the command following
the symbol.

Important The graphic symbols found on the left side of certain


pages in this Manual have no relation whatsoever with those
graphic symbols defined by international and national technical
standards (IEC and UNI/CEI, respectively).
Any reference made to other standardisation organs is unintended;
therefore, we reserve the right to make any changes to the
symbols found herein.
ix

Information about CUBE


The product you have purchased also contains utilities that can
help you learn how to use the system correctly or exploit its
capabilities.

Readme.txt
CUBE installation includes a text file named “Readme.txt”, which
contains the upgrades and compatibilities as compared to previous
releases.

This file is allocated in the following directory (provided that default


settings are chosen during CUBE installation):
\ICUBESYS\DATA\README.TXT

Online Help
CUBE provides an online Help that permits immediate on-screen
consultation of all instructions necessary to use the program.

To display the online Help, select command Contents and index


from the Help menu; the program calls up the online Help window,
from which you can choose the topic of interest.

You can search for the desired information using the Table of
Contents or the Analytical Index.

Manuals
Each CUBE module has a dedicated user’s manual, which
provides information and detailed instructions as to how to use the
module.
x

Customer-Support Services
Hot-line Assistance and Online Services
To all those Customers requiring direct technical support, ORSI
offers over-the-phone (hot-line) assistance all work days from 9
A.M. to 1 P.M. and from 2 P.M. to 6 P.M. (Italian time). In order to
have access to this service, Customers must pay a Technical
Support Fee (TSF).

TSF subscribers are also entitled to:


• fax questions to our Technical Support Service at the following
number ++39 10 38.03.09;
• round-the-clock communication with ORSI via INTERNET.
Various utilities permit direct contact with our customer-support
services. In particular, there is a mailbox for contacting our
Technical Support Service. Please send queries to the following
e-mail address: TSS@ORSIWEB.COM

This mailbox allows you to inform us as to new functional


requirements that you would like to be included in future releases,
report malfunctions encountered while using ORSI products, as
well as request technical info regarding our products and their use.

Important TSF subscription has been simplified thanks to the


introduction of payment by credit card (CARTASI, VISA,
MASTERCARD) in addition to traditional forms of payment.

Technical WEB
ORSI also provides another service via its Technical WEB site.
Using a password, a Customer can gain access to technical
information of various nature, which includes:
• release notes;
• white papers and technical articles;
• software patches;
• slide presentations on different topics (tracking, batch
management, etc.);
• technical manuals (in those languages available);
xi

• technical/commercial documentation;
• application libraries;
• graphic libraries.

On-site assistance
A highly-experienced group of technicians and engineers is at
Customer disposal to provide assistance in setting up applications
correctly on premises, as well as for optimal system
commissioning on site.

Educational Services

ORSI training courses seek to teach the basics about our products
to Customers. In order to successfully achieve this goal, training
consists in lessons of both theory and practice.

Courses are held year-round according to a calendar that is


publicised in considerable advance with respect to the first session
scheduled.

The material on the basis of which our courses are conducted


reflects the result of years of experience in process control and
production management.

All courses are held by expert personnel that is constantly


informed as to the evolution of ORSI products.

Courses are conducted in Italian or English at the ORSI Training


Centre in Genoa or at ORSI locations in various parts of the world.
Upon request, training courses can also be organised on
Customer premises.

For more information, please contact our Training Centre at the


following phone number:
++39 10 3434.466.
xii

Software Updates
The CUBE software versions possessed by our Customers are
maintained in line with the latest product developments thanks to
our Software Update service, which allows entitled Customers to
automatically receive all new product versions.

The ASM (Annual Software Maintenance) Contract guarantees


software upgrades at each new release for all those CUBE
licenses associated to a single hardware key.
The SASM (Site Annual Software Maintenance) Contract
guarantees software upgrades at each new release for all those
CUBE licenses possessed by the end-user for a single site.

In addition to product upgrades, special software-maintenance


releases are issued by ORSI in order to correct product-related
problems reported by Customers. These releases, which undergo
testing and inspection by the ORSI Quality Assurance board, are
made available to Customers in the form of product-maintenance
versions called “Improware”. These patches are also made
available via the Technical WEB service, which can be accessed
against payment of a specific annual subscription fee. In addition,
a Customer is entitled to software maintenance services during the
product’s post-sales warranty period.
Upon expiration of the warranty, software maintenance services
are guaranteed to those Customers who possess an ASM or
SASM contract.
Both contracts have a one-year duration.
xiii

In this manual
For a better understanding of the contents of this manual, here are
some indications about the purpose of this manual, its internal
structure and its use.

Purpose of this manual


This manual was written to provide the reader with the following:

• an overview of the functions offered by the Ladder Language;


• a detailed guide to the execution of each native block of the
Ladder Language.

We will also provide suitable examples of configuration.

Structure of this manual


The structure of this manual is designed to meet the needs of all
readers.

This manual is an aid to the reader who is using the program for
the first time and needs a detailed and exhaustive guide, but it is
also useful for those who are already familiar with the application
and require more specific, in-depth information.
The descriptions are in chronological sequence, i.e. the
procedures that must be performed first for using the Ladder
Language are illustrated first.

Besides, you will also find a description of the commands, buttons


and dialog boxes. These are also listed in a Reference Guide,
where you will be referred to the relevant paragraphs.

The manual is then structured as follows:

• an introduction to the fundamentals;


• a guide to the Ladder Language procedures;
• a description of the native blocks of the Ladder Language.
xiv

How to use this manual


Each reader will establish how to use the various parts making up
this manual according to his/her learning method and knowledge
of the program. In any case, here are some suggestions.

We recommend that you first read the chapter “Ladder Language”


for better organising your work and avoiding the most frequent
mistakes.

If you want to use the native blocks and know more about their
properties, see the chapter “Function Blocks”.

Reader’s requirements

To fully understand the technical language and the contents of this


manual, the reader must have the following requirements:

• General knowledge of the Windows interface and


environment
The CUBE modules exploit the capabilities offered by the
Microsoft Windows NT operating system. We will assume a
basic knowledge of the Windows environment and its
commands and will then refer to them throughout this manual.

• Basic concepts underlying industrial automation. The


manual contains typical terms of this field.

• Basic programming knowledge. The manual also contains


specific concepts of the software developing environments.