You are on page 1of 352

Manual for program development

with
ecolog AS-i system
(asisys)
version 1.5

Copyright ifm electronic gmbh

January 11, 1999

manual ecolog asi system page 1


page 2 manual ecolog asi system
Important note!
When this manual was printed, it considered
the current state of technolgy. Technically
trained persons are addressed. It was prepared
with the utmost care.

The information, data and notes provided in the


manual represent no warranted characteristics.
No guarantee is assumed for the absence of
mistakes, errors or the general suitability of the
indicated application examples.

manual ecolog asi system page 3


Preface _______________________________________________________________ 9

1. AS-i basics (master, slaves, host ... do I have to know all this?) ____________ 1-1

2. AS-i-Controller-Family (OK, you haven’t much time, but...) _________________ 2-1


2.1. Technical Data 2-1
2.2 Configuration 2-3
2.2.1 Basic modules 2-3
2.2.2 Optional components 2-4
2.3 Correlations 2-4
2.4 Memory allocation 2-6
2.5 Powerfail monitoring 2-7
2.6 Watchdog monitoring 2-7
2.7 Wiring diagram and power supplies 2-7

3. Brief insight into asisys ______________________________________________ 3-1


3.1 Basic terms and concepts 3-1
3.2 Installation 3-3
3.3 Sneak preview : a short asisys project 3-4

4. What is what in asisys? ______________________________________________ 4-1


4.1. Control of a traffic light 4-1
4.2 The visualisation of a traffic light 4-10

5. This time with an AS-i controller ______________________________________ 5-1


5.1 Project description : an alarm system 5-1
5.2 Connecting the system (...slowly, don't connect everything all at once) 5-3
5.3 Realizing the alarm system using asisys 5-5
5.4 Start-Up 5-21

6. COMPONENTS OF ASISYS IN DETAIL __________________________________ 6-1


6.1 Handling projects 6-1
6.2 Handling objects 6-12
6.3 Common edit commands 6-15
6.4 Common Online commands 6-18
6.5 A matter of View 6-24
6.6 Arranging windows 6-25
6.7 Help! 6-27

page 4 manual ecolog asi system


7. THE EDITORS OF ASISYS_____________________________________________7-1
7.1. The declaration editor 7-1
7.2 The text editors 7-5
7.2.1 The Instruction List editor 7-8
7.2.2 The Structured Text editor 7-10
7.2.3 The S5-IL editor 7-19
7.3 The graphical editors 7-24
7.3.1 The Function Block Diagram editor 7-26
7.3.2 The Ladder Diagram editor 7-31
7.3.3 The Sequential Function Chart editor 7-36
7.4 PLC configuration 7-42
7.5 Global variables 7-42
7.6 Library manager 7-43
7.7 Watch window 7-44
7.8 Sampling Trace 7-46

8. VISUALISATION AND DDE ____________________________________________8-1


8.1 Visualisation 8-1
8.1.1 Setup a visualisation 8-1
8.1.2 Inserting visualisation elements 8-2
8.1.3 Editing of visualisation elements 8-2
8.1.4 Configuration of visualisation elements 8-3
8.1.5 Configuration of polygons 8-4
8.1.6 Additional functions for visualisation elements 8-5
8.2 DDE interface 8-7

Appendix

A. THE IEC OPERATORS _______________________________________ Appendix-1


A.1 Arithmetic operators Appendix-1
A.2 Bit string operators Appendix-3
A.3 Selection operators Appendix-5
A.4 Comparison operators Appendix-8
A.5 Address operator Appendix-11
A.6 Call operator CAL Appendix-11
A.7 Copy operator MOVE Appendix-11
A.8 Comparison of programming in STEP5 and IEC 1131-3 Appendix-12
A.9 The language S5-IL in asisys Appendix-19

manual ecolog asi system page 5


B. THE ELEMENTS OF THE STANDARD LIBRARY __________________ Appendix-26
B.1 Type conversion functions Appendix-26
B.2 Numerical functions Appendix-28
B.3 Bit shift functions Appendix-28
B.4. Bistable function blocks Appendix-30
B.5 Edge detection Appendix-31
B.6 Counter Appendix-31
B.7 Timer Appendix-32

C. THE ELEMENTS OF THE AS-I LIBRARY ________________________ Appendix-35


C.1 The lists (LDS, LAS, LPS) Appendix-35
C.2 Slave information Appendix-36

D. THE ASISYS OPERANDS_____________________________________ Appendix-40


D.1 BOOL constants Appendix-40
D.2 TIME constants Appendix-40
D.3 Numbers Appendix-40
D.4 Strings Appendix-41
D.5 Variables Appendix-41
D.6 Addresses Appendix-41
D.6 Flags Appendix-43
D.7 Arrays Appendix-44

E. ERROR MESSAGE REFERENCE_______________________________ Appendix-46

F. AS-i-TECHNICAL DATA ______________________________________ Appendix-56

G. CONTROLLER INSTALLATION AND USER INSTRUCTIONS ________ Appendix-59

H. DESCRIPTION OF AS-i ↔ PROFIBUS DP INTERFACE____________ Appendix-67

page 6 manual ecolog asi system


I. DESCRIPTION OF AS-i ↔ DEVICENET INTERFACE_______________ Appendix-95
I.1.1 General overview Appendix-95
I.1.2 Modes of Operation Appendix-96
I.1.2.1 Gateway or Stop mode Appendix-97
I.1.2.1 Pre-processing or RUN mode Appendix-98
I.2. Connection of the system Appendix-99
I. 2.1 Connection using a conventional power supply Appendix-99
I. 2.1 Connection using a Power Decoupler (AC1211) Appendix-100
I.3. Data Mapping Appendix-101
I.3.1 Mode of Operation and Transferred Bytes Appendix-101
I.3.2 Basic Concept of Mapping Appendix-102
I.3.3 Map structure: an overview Appendix-102
I.4. Configuration Appendix-108
I.4.1 Configuration using the DeviceNet Manager Appendix-108
I.4.2 AS-i DeviceNet Controller Parameters Appendix-109
I.5. Set-Up Guide: Two Step-by-Step Examples Appendix-111
I.5.1 GATEWAY APPLICATION Appendix-111
I.5.2 PRE-PROCESSING APPLICATION Appendix-127

K. DESCRIPTION OF AS-i ↔ INTERBUS INTERFACE _____________ Appendix-133

Index ___________________________________________________________ Index-1

manual ecolog asi system page 7


page 8 manual ecolog asi system
Preface

This manual contains a description of version 1.5 of the programming


software

ecolog asi system (short asisys).

AS-interface functions
asisys is the system software for the AS-i controller family produced
by ifm electronic. Every AS-i controller is an AS-i master and
therefore finely tuned to accomplish the functions on an AS-interface.
Naturally the system software offers optimum access to these functions.

Gateway
The AS-i controller is also a gateway to field bus systems (Profibus,
Interbus, DeviceNet, ...) or serial interfaces (RS232C, RS485).

Increased data
The development of automation solutions which extend to the field bus
systems level is increasing the amount of data being processed by plc
systems. Additional information such as parameters or error signals can
also be transferred via these systems. This information is also to be
processed!

Decentralization
Parameters can be decentrally managed and error signals are often
transferred as combined message for further processing. This brings the
need for decentral (intelligent) stations where preprocessing of such
information can take place.

Solution: signal preprocessing


Therefore every AS-i controller has a very powerful signal
preprocessing system. This system is programmed in the same manner
as a modern plc and supports all the AS-i functions.

Reaction time
When AS-i and a field bus system are combined the signal transfer times
of the two systems are added. This in conjunction with the cycle time of
a large central plc system leads to rather long reaction times for such
automation systems.

Again the answer: signal


preprocessing
That is right, signals are processed locally using the AS-i controller and
only results are transferred to the central system. This elegant method
allows the immediate reaction to urgent local conditions. This not only
decreases reaction time but also relieves the burden of the central plc
system.

Programming this signal preprocessing is carried out using a PC in


conjunction with the system software asisys.

manual ecolog asi system page 9


Programming
In reading (and working thru) this manual you will become familiar with
the programming languages under the aspects of
• type
• syntax and
• extent.
Operation
By means of simple examples you will gain expertise in the operation
(handling) of the software with reference to the following:

• function keys
• menu structure
• project structure
• project test, etc.
Naturally the basics of the AS-i system as well as the structure of the
AS-i controller shall be discussed.

For your orientation the contents of the manual are briefly discussed
(chapter for chapter) below.

AS-i basics
A summary of AS-i basics is to be found in chapter 1. If you are familiar
with concepts such as
? AS-i master,
? slave-configuration,
? LAS, LDS, LPS,
? projection mode ...
then you can "skim thru" this chapter. If AS-i is something new for you
then we recommend your reading this chapter rather carefully.
AS-i controller family
Everything that the user needs to know about the AS-i controller family is
contained in chapter 2. Please read this chapter thru so that the
controller is not just an "orange box" for you. The wiring diagram and the
instructions for system build-up are especially helpful for the practical
application.

Getting started
If you have never used asisys then working thru chapter 3 is a must.
Most users need about an hour to complete this chapter. Since the
basics of working with asisys (installation, program writing, visualisation,
etc. ) are discussed here it is an hour well spent. Please don't miss it!

Concepts and background


In chapter 4 we start by presenting the "big picture of asisys". Then
we give a rather detailed description of the various components of this
big picture.

A discussion of the visualisation system completes our introduction to


asisys.

These points are presented by means of an example project. The reader


can (and should) work thru this example in conjunction with this manual
and a computer. Just as with chapter 3 we recommend that you take the
time to work thru this chapter since the concepts and methods discussed
are applicable in many of the projects with which you will be involved.

page 10 manual ecolog asi system


Creating an alarm system using
the AS-i Profi Kit
After you have finished chapters 2, 3 and 4 you should be on a "first
name basis" with the AS-i controller and asisys. You should be ready to
tackle your first application together with your newly found friends. The
procedures to be followed are discussed in chapter 5.

The hardware connections as well as the software association between


the AS-i controller / AS-i system form a very good basis for further
work. Go thru this example "step by step" using the components of your
Profi Kit. This simple example allows you to use your newly gained
knowledge and serves as a foundation for other applications.

Details
The information in chapters 6, 7 and 8 is presented in "reference book
form" . Chapter 6 contains a description of the various pull-down menus
and associated screens. The language editors are described in
chapter 7. The visualisation system is discussed in chapter 8. Since
these chapters have been written for your reference a "work thru" as for
the chapters above is not necessary. Just "leaf thru" them at first to
become familiar with their contents. In this way you will know where to
look when you have a specific question.

The appendix: this one is useful!


As you may imagine, the appendix is somewhat boring (until you need
something which is contained there). We have extended a great effort to
make this part of the manual as informative and helpful as the other
parts. Just look at what we have to offer.

A: All asisys-operators with examples.

B: All elements of the standard-library st8051.lib, also with examples.

C: All elements of the AS-i library ecoasi.lib, again with examples.

D: All asisys operands, naturally with examples.

E: All complication error messages with the corresponding corrective


actions.

F: AS-i data and function calls of the programming interface listed in


table form.

G: Brief summary of the AS-i controller hardware, installation and


operating instructions of the controller operating and display
elements.

H: Description of AS-i ↔ Profibus DP interface.

I: Description of AS-i ↔ DeviceNet interface

K: Description of AS-i ↔ InterbusS interface

And last but not least an index containing hopefully all important key
words to help you find information in the manual concerning a particular
subject.

manual ecolog asi system page 11


We are certain that if you work thru this manual in the manner which we
have indicated above you will reach your goal very quickly. This goal
being the effective application of the AS-i controller and the
programming software asisys.

Now you can help us


As indicated by our description this manual is not short. It is obvious that
errors can be missed during the proofreading of a book having this size.
For this reason we ask you for your help. Please indicate to us if you
find any errors or have a suggestion for improvement. We would be very
greatful for your help in this matter. You can contact us through the ifm
electronic representative in your area.

Version 1.5
Compared to the preceding version some modifications have been made
to the asisys programming software version 1.5 which will be listed
below. In this manual you will find a detailed description of these
modifications in the corresponding chapters.

ØWin95 Design: The design of the shell corresponds to a 32-


bit application. The symbols of the symbol bar are three-
dimensional and coloured. Of course, asisys still runs under
Windows 3.1x.

ØNew language 'Structured Text' (ST): With the


language Structured Text (ST) asisys supports all IEC1131-3
languages. ST is similar to the programming language Pascal.
Using this language makes sense for programming formula,
driver protocols and processing structured data.

ØNew language 'S5 - IL' (S5): The language S5-IL (S5) in


asisys mainly corresponds to the instruction list in the
programming language STEP5 from Siemens AG. It makes
program design for the ifm controller family easier for the
experienced Siemens programmer.

ØAutomatic declaration of variables: If this option is


active, asisys automatically finds a non defined variable used
for designing a program. A declaration window opens where the
type, address and other details of the variable can be entered.
The defined variable is then automatically inserted in the
corresponding declaration part.

ØAutoformat: In IL and S5-IL the option autoformat can be


activated. The program line can then be entered in small letters
and without tabulators. After pressing the Enter key the line is
automatically formatted correctly and clearly.

ØImport STEP5 programs: plc programs in the original


Siemens STEP5 format with the file extension .S5D can be
imported to asisys. These programs need only be slightly
modified and can then be used as a S5-IL or converted IEC
program in an AS-i controller project.

page 12 manual ecolog asi system


ØSearch the project for unused variables: During the
program design variables are often declared as intermediate
flags for test purposes. The program assignment is then
removed but the declaration is still there. asisys can now locate
such forgotten declarations and indicate them in a list.

ØOpen FB instances: The online error search in the program


code can now also be performed in instances of function blocks.

ØFaster communication: The baud rate for the


communication interface can now be set between 4800 and
57600 bauds. Note that baud rates greater than 19200 bauds
require a suitable powerful PC hardware.

ØWatch window modified: asisys can now store and


manage several watch windows. This way a simple management
of recipes is also possible.

ØDocumentation form can be edited: The layout for the


project documentation can now be freely designed. This includes
bitmaps as logo, header and footer lines and areas not to be
printed.

ØNew variable types DWORD, DINT and STRING:


asisys now has the 32-bit data types DWORD and DINT as well
as character chains type STRING for text management.

ØBinary or hexadecimal monitoring: In online mode


values can now also be represented binarily or as a hexadecimal
number.

ØVisualisation: The integrated visualisation now also provides


polygons, bitmaps and other visualisation windows as creation
elements. Polygons can be rotated around a pivot point which
can be freely defined.

Along with the above-mentioned additions we have made improvements


to the appearance of several pull-down menus and screens. We have
corrected all errors which we have found or which were reported to us
since the first release of asisys. We have also considered all
suggestions for improvements and implemented them where possible
(nonetheless "you can't please all of the people all of the time").

We wish you all the best with your new system. And do have fun.

manual ecolog asi system page 13


1. AS-i basics (master, slaves, host ... do I have to know all this?)

It may be that upon reading this manual you have been using AS-i for
some time already and are familiar with the properties of the system. It
may be, however, that you are still in the process of optimizing your
specific automation system.

At whatever stage you may be the contents of chapter 1 will be of


interest. Here we shall discuss the structure and properties of the AS-i
system. In addition to this we convey advice and show you "tricks" which
shall help you with your specific application.

Why AS-i anyway?


The first goal of the AS-interface is to replace the parallel wiring between
plc I/O modules and field devices (sensors/actuators) with a two-wire
cable.

In order to replace parallel wiring systems it is necessary that the


use of the AS-interface requires the same amount of technical
knowledge as with parallel wiring!

For this reason the interchange of digital information between a plc


system and sensors/actuators does not require any deep system
knowledge.

AS-i is not only to replace the parallel wiring system but also offer the
user supplementary features for diagnosis and signal processing.

For this reason AS-i has additional functions which makes its use very
economical.

We want to present an overview of AS-i functions and explain how they


can be applied effectively.

Generally speaking the application of functions such as parameter


/diagnosis processing is simpler as with field bus systems.

manual ecolog asi system page 1-1


AS-i features
Naturally AS-i offers :

4Reading of input data


4Writing of output data
but also :

4 Sensing range parameter adjustment

4 Material dependent coefficient adjustment via


software

4 Prefailure monitoring of sensors (dirtying,


maladjustment of mounting,...)

4 Short circuit monitoring of actuators (valve coils...)

4 Signal cable monitoring up to sensor/actuators

4 Voltage supply monitoring of field devices

4 Plant structure changes (missing sensors) detection


and diagnosis

4 Digitalized analog value transfer

4 Simple solutions even with slip rings and dragged


cables

Basic equipment
What are the essential components of an AS-i system?

Ø AS-i master: Sub-system which is built into or connected to a


plc or PC. This is the central component of the system. There is
one and only one in an AS-i system. It manages the data
exchange between the actuators/sensors and the PLC/PC
system.

Ø AS-i power supply: A special power supply which covers


the needs of the AS-i master and AS-i slaves as well as most
sensors and some actuator types. When repeaters are not used
(explanation follows) only one such power supply is used in an
AS-i system.

Ø AS-i slaves: Field modules in an AS-i system. In general


these are I/O modules or special AS-i sensors. A maximum of 31
such slaves can be connected in an AS-i system. Each slave

page1-2 manual ecolog asi system


contains an address (1..31) which is remenantly stored (remains
even when supply voltage is removed).

Ø Cable: The connection of the AS-i components can be via any


two-wire cable provided the cross sectional area is adequate
for the power being transferred (as with parallel wiring). A special
AS-i flat cable ("the yellow cable“) can provide advantages for
the user as it is polarized to prevent improper connection of +/ -.
In addition the method of connection called "isolation
displacement" eliminates the need for wire stripping, cable shoes
etc.

And what about the connection?


The connection is very easy: master, power supply and slaves are simply
connected in parallel to the AS-i cable (brown ⇔ + ; blue ⇔ -).
The AS-i cable (unshielded is allowed) can be branched as required. The
cable length per AS-i power supply may be up to 100 meters.

AS-i tip: Wiring of AS-i can be done in many ways (star, tree, ring).
But to determine the cable length the whole laid AS-i
4 cable must be considered, incl. all branches. As a rule the
cable length is not equal to the distance between the
master and the last slave!

To allow the master to distinguish between the various slaves each is


given a slave address. This address is stored in the slave. It remains
there even when the voltage is removed (slave is disconnected).

Addressing
There are several methods of addressing AS-i slaves. The manufacturer
enters the address 0 (zero) before it leaves the factory. The AS-i master
system can not accept the address 0 as an operating address. An
address between 1 and 31 is required.

Hand-held addressing unit


If you work very often with the AS-i system we recommend that you use
a hand-held addressing unit. This is a compact, battery (accumulator)
operated unit to which AS-i slaves can be connected. At the press of a
button it reads and displays the address of the connected slave. It is then
a very simple matter to change the address as well as to enter and store
it in the slave.

AS-i tip: New AS-i slaves have the address zero. If you remove a
unit in order to use it somewhere else it is a good practice to
4 set the address to zero!

Error due to double addressing


Thru the use of a hand-held addressing unit or due to preaddressed
slaves it can occur that two slaves with the same address are connected
to a given AS-i system. This is a system error called double
addressing. The AS-i master does not detect one or both of these
slaves.

AS-i tip: If the AS-i master does not detect two connected slaves it
may be that double addressing has occured! Remove one
4

manual ecolog asi system page 1-3


of the undetected slaves. Now the other slave should be
detected.

Addressing via the AS-i master


The addressing of slaves is also supported by the AS-i master. This
feature is realized to different degrees of comfort. The AS-i controller
supports several methods of addressing AS-i slaves.

The addressing option via the controller operating and control


elements is always at the user's disposal. A discription is to be found in
the appendix.

AS-i tip: Several functions of the controller are inactive when it is


turned on. This deactivation can be removed by pressing
4 both operating buttons for approx. 5 sec.

asisys allows for the addressing of a connected slave (online) by means


of the mouse. It could not be any easier!

Choosing the proper slave


The great variety of slaves which exist makes it very difficult to keep the
market in full view. For this reason we shall give only a short list of some
known slave types making no claim of completeness.

AS-i in the control cabinet


AS-i modules (most often 4I/4O) used in in control cabinets are usually
found where a large number of I/O's are located. They have a protection
rate of IP20. They are built with screw terminal connections or combi-
con connectors and are generally a direct replacement for terminal
blocks.

AS-i tip: AS-i modules with screw terminals usually have an


addressing plug. Several of these modules can be
4 connected in a system after which they can be addressed
one after the other by manipulating this addressing plug.
Details are in the AS-i catalogue.

The outputs of AS-i modules can switch 24V DC (transistor) or 230V


AC (relay). They are often short-circuit protected and are made in a
variety of switching powers.

In the area of operating panels AS-i connections are found as


button/illuminator combinations. These are as blocks (matrix) or
combinations of two or four.

AS-i is also found in the area of motor control. Solutions for connecting
power switches and contactors exist. These are starters for direct or
reversable operation.

AS-i directly in the plant (field)


The advantages of AS-i show up even more when the connection is
made directly in the plant. I/O-modules with protection rates of IP67
can be mounted directly in the field without any extra housing. This takes
place using the "yellow cable" without the need for terminal blocks by
connection to the respective lower parts.

page1-4 manual ecolog asi system


AS-i I/O-modules exist having various housings and up to 4 inputs and
outputs per module. Sensors with two switching signals (for example the
IND form) may also be connected.

Special AS-i save-systems equipped with AS-i interfaces integrated


directly in the sensor or actuator are very common. Examples of sensors
are inductive, capacitive or photo-electric proximity switches as well
as flow monitors having integrated adjustment and safety functions.

An example of an actuator having an integrated AS-i slave is the motor


starter for reversable operation with the respective status signals.
Another is the motor drive with variable direction and speed. A third
example is the encapsulated button/signal station equipped with up to
4 illuminated buttons. Further examples are signal columns (acoustical
or optical). Yet another is the valve control unit with integrated input (for
example IND) and short-circuit protected outputs.

Diagnosis
The integration of AS-i slaves in sensors/actuators extends your ability
for plant diagnosis. The options and/or advantages are:

• simple preventive warnings


• detection of dirt collection near sensors/wire and coil breaks /
overheating or critical conditions
• prefailure information shortens downtime
• quick detection of trouble spots
• function tests of sensors/actuators

AS-i can also handle analog


signals
AS-i slaves having analog inputs, 4 PT100 inputs or analog outputs
allow the connection of the entire actuator/sensor system of your plant
to AS-i! The method of signal transfer of up to 16 bits is determined by
the AS-i organisation in the value protocol and is not manufacturer
specific. Naturally the AS-i controller supports this protocol in a very
simple and easy to use manner.

AS-i parameters
Some AS-i slaves use another feature of the AS-i system: the
parameters (up to 4 bits). They are transferred acyclically and are used
to adjust properties of slaves. They can be used to adjust switching
distance of a sensor, switching threshold of a measurement system.
Another example for the use of parameters is choosing the character of
an analog input/output (0..10V, 0/4..20mA).

AS-i tip: The parameters of only one slave can be changed per AS-i
cycle. For this reason the various parameters in an AS-i
4 system should not be changed too often and certainly not
cyclically!

Lists and flags


Every AS-i master provides information which reflects the state of the
AS-i system. The most important topics are as follows:

Ø LDS: List of detected Slaves; i.e. 32 bits used to indicate which


AS-i slaves are connected.

manual ecolog asi system page 1-5


Ø LPS: List of projected Slaves; i.e. 31 bits used to indicate
which AS-i slaves should be connected (projected).
Slave 0 can not be projected!

Ø LAS: List of activated Slaves; i.e. 31 bits used to indicate which


AS-i slaves should be connected (have been projected) and in
fact are connected. Slave 0 can not be activated!

Ø AS-i voltage: indicates whether or not the AS-i system is


being supplied with voltage.

Ø Slave 0 detected: indicates whether or not a new slave (with


address 0) is connected.

Ø Configuration OK: indicates whether or not all projected


slaves are correctly connected to the system.

Ø Normal operation: indicates whether or not the AS-i master


is cyclically exchanging data with the slaves in the system.

Ø Projection mode: indicates whether or not the projected


system (slaves which should be connected to the AS-i system)
can be momentarily changed. If this mode is not activated then
the AS-i master is in the protected mode, i.e. data is only
exchanged with correctly projected slaves.

Ø Automatic addressing: indicates whether or not a newly


connected slave is automatically assigned the address of a
defective slave (this is only valid in the protected mode).

The AS-i controller can of course carry out operations with this
information in conjunction with the signal preprocessing. The AS-i
controller can preprocess this information and transfer the results
(also collected messages). It can also operate directly on this
information and react at once, which may be necessary in critical
situations.

By means of special functions in the AS-i controller in conjunction with


the signal preprocessing the configuration can be automatically
adapted to the plant. This is of special interest for example in
applications involving changeable tooling fixtures.

Short glossary of technical


terms
We now provide you with a short glossary of technical terms from the
"AS-i world".

Acyclic data transfer


Parameters are transferred to one slave at a time once per cycle when
the system is switched on or when values are changed. This is called
acyclic data transfer.

page1-6 manual ecolog asi system


Addressing
Each slave is allocated an individual address for identification by the
master. This address lies in the range of 1-31. Address 0 has a special
function.

AS-i
Actuator Sensor Interface, bus system for the first binary level.

AS-iC
Application specific integrated circuit, application specific integrated
circuit (IC), here containing a complete AS-i slave function.

Automatic Addressing
A slave can be replaced with the system in operation. The missing slave
is detected by the master and is automatically allocated the address of
its "predecessor".

Binary
Two possible switching states ON/OFF (1/0).

Bit
Digital information carrier, state 1/0 corresponds to signal ON/OFF.

Bus
Serial transfer of data of several participants on the same line. In the
case of AS-i a two-wire cable for serial data transfer of several
participants.

Conventional binary sensor


Sensors with outputs for connection to standard I/O modules or AS-i user
modules.

Cyclical data transfer


Data of all slaves are transferred cyclically, i.e. they are updated in the
master after max. 5 ms.

Data (port)
4 bit information which is cyclically updated.

Gateway (coupler)
Connection between AS-i and a field bus system.

Host
PLC or PC system; receives the input data from the slaves, operates on
this data and returns the output data to the master. The master then
transfers this data to the slaves.

Intelligent sensor
Sensor having an integrated AS-i Chip and additional functions (see
With a built-in interface).

Isolation displacement connector


(IDC)
Patented technology to electrically connect AS-i flat cable with the slaves
without cutting or stripping insulation.

manual ecolog asi system page 1-7


Master
Controls the complete organization in the bus. The master decides the
bus access time and polls the slaves.

Master call
Is carried out in form of a prompting message to the slave. The slave
replies with the requested information.

Module
A distinction is made between module upper parts (user parts) and
module lower parts (coupling parts). The upper parts can be active or
passive. They are the connection between sensor/actuator and coupling
part. The coupling parts are available for flat cable or round cable. They
are the electromechanical connection between the bus cable and user
cable.

Parameter (port)
4 bit parameter which are acyclically transferred by the master as set
value.

Parameter setting
(tele adjustment)
Intelligent sensors can adjusted via the the parameter ports by means of
a POU (for example a function block).

Participant
Common denotation for slave; here: a maximum of 31 slaves per AS-i
line possible (e.g. intell.sensors).

PELV
Protective Extra Low Voltage. One of the protective measures against
direct contact in accordance with DIN VDE0100 T410.

Repeater
Component which can be inserted in any bus branch to amplify the
signals. From the repeater the size of AS-i is extended by further 100 m.

Slave
Passive participant answers only when scanned by the master.

Slave reply
Reply of the slave to the master call, contains 4 bits of user data.

Single master system


Only one master, therefore defined scanning times, especially suited for
field level of automation.

Telegram
A standard message structure is used for the different services of the
master.

Topology
Principle structure of the network. The tree structure is the most flexible
one.

page1-8 manual ecolog asi system


Tree structure
Laying of the bus cable similar to a tree with the trunk, branches and
twigs. This is more flexible than a ring or line structure. The tree structure
provides flexible adaption to the plant.

User data
Part of the message consisting of the information to be transferred, 4 bits
for AS-i.

With a built-in interface


Units, sensors which can be directically connected to a bus. The bus
connection (AS-i slave) must be integrated in the sensor.

Without a built-in interface


Normally used in conjunction with sensors which can be connected to a
bus via input/output modules.

manual ecolog asi system page 1-9


page1-10 manual ecolog asi system
2. AS-i controller family (OK, you haven’t much
time, but...)

If you are often confronted with new devices or software you may have
adopted the method „ first test, then read the manual“. This policy will
lead to success in this case as well. However, it would be better to read
this chapter before connecting your controller and thereby avoid
unnecessary setbacks. Please do this even if you are familiar with the
starter-kit.

The basics of the AS-i controller are described in this chapter. After you
have completed this chapter you will understand the fundemental
relationships between the various subsystems of an AS-i controller. You
will be able to install an AS-i controller in a system.

In the previous chapter the fundamentals of AS-i systems were


discussed. More detailed information is to be found for example in the
AS-i system manual. A basic knowledge of AS-i is assumed for the
readers of this and following chapters.

2.1. Technical data

The AS-i controller family has several members and is still growing. Four
members of the family are showen in fig. 2.1.1. These units either exist
or will soon exist.

Here we see controllers with RS 232 interfaces having 1 and 2 AS-i-


masters (AC1003 / AC1004). One also finds controllers with Profibus-
interfaces also having 1 and 2 AS-i-masters.

Fig. 2.1.1 AS-i controller family

manual ecolog asi system page 2-1


As an example the AC1003 data sheet is shown in figure 2.1.2
below.

order no. AC 1003

operating voltage [V] 10 - 30 V, typ. 24 V DC

power consumption [W] ≤ 10

serial interface RS 232 C;

transfer rate 4800 .. 57600 Baud

AS-i interface according to the specification

number of screw terminals 5

function display LED 2 x red, 2 x green, 1 x yellow

operating buttons / LEDdisplay 1 x MODE, 1 x SET / 4 digits

operating temperature [°C] 0 ... + 60

housing DIN rail mounting

Schutzart housing IP 20, terminals IP 20

block circuit diagram 9-pin Sub D

RS 232
AS-i CPU .
master .
1 .

1 2 3 4 5 .
PE AS-i 1 INT PWR .
⊥ - + 0V 24V .

wiring diagram 5 + 24 V
operating voltage
4 0V

3 AS-i +
AS-i cable
2 AS-i -

1 PE ground

Fig. 2.1.2 Data sheet AS-i controller with 1 master

To find the corresponding data for your controller version please see ifm
electronic's catalogue.

page 2-2 manual ecolog asi system


2.2 Configuration

2.2.1 Basic modules

As already mentioned, the controller family is big. All members have


fundamental features in common.

The block diagram of figure 2.2.1.1 shows the four basic modules of all
AS-i controllers. They are the AS-i master, communications interface,
controller processor and display/operating panel. The optional
components are not available in any conceivable combination. Examples
of optional components will be given in chapter 2.2.2.

display / AS-i master


operating panel

controller
processor

communications optional
interface components

Fig. 2.2.1.1 Block diagram of the AS-i controller with basic components

AS-i master
The AS-i master is a master with full functions according to the AS-i
specifications. It consists of a digital and an analog part. The digital part
contains a microprocessor and processes the AS-i protocol. In addition, it
manages the configuration data and ensures the exchange of data to the
controller processor. The analog part of the hardware converts the digital
signals into the physical signals of the AS-i cable.

Communications interface
This interface has two functions:

• during commissioning of the plant mainly program transfer (PC →


controller)

• during the normal operation of the plant mainly transfer of process


data (PC ↔ controller)

This interface is either type RS-232 or RS-485.

Important remark!
The protocol of the communications interface has not been
designed for the cyclical exchange of the time-critical control data.

To do this, the AS-i controller family provides versions with an additional


data interface (Profibus DP, DeviceNet, InterbusS, ...).

manual ecolog asi system page 2-3


Controller processor
A quickly cycled 8-bit processor from the 8051 family.

Display / operating panel


Figure 2.2.1.2 shows the display and operating panel of the AS-i
controller.

Fig. 2.2.1.2 Display and operating panel

2.2.2 Optional components

AS-i controllers can contain further optional components. They are


integrated in the housing, and so cannot be arbitrarly combined. A list of
currently available or planned components is given below:

• second AS-i master


• data interface as Profibus DP - slave
• communications interface in the RS 485 - version
• data interface as DeviceNet slave

2.3 Correlations

We will discuss the correlations common to all AS-i controllers as well as


the Profibus DP interface connection, the latter being an example of one
of the options.

A block diagram of such a controller is shown in figure 2.3.1 The


following components such as EPROM, RAM1, etc. are illustrated in
figure 2.3.1

page 2-4 manual ecolog asi system


Fig. 2.3.1 Block diagram AS-i controller with Profibus DP interface

For the block diagram of your controller version please see ifm
electronic's catalogue.

Software systems
A distinction is made between two software systems:

• sequence control program


• user program
Sequence control program
The sequence control program has the following tasks:

• control of the operating and display panel


• handling of the communications interface
• handling of optional interfaces, if any
• processing of the user program

Its code is stored in the EPROM and has RAM1 as the main memory.

User program
The user program is developed by means of the programming system
asisys and then loaded into the controller via the communications
interface.

This code is stored in the EEPROM and has RAM2 as its main memory
(e.g. for variables).

Processor chip
A fast 8051 command compatible 8-bit processor, type 80C320 is used.

Chip select logic


GAL has been used for the whole chip select control.

AS-i master communications


The communications with the AS-i master (AS-i masters if there are two)
is handled via a 1 KB DPRAM.

manual ecolog asi system page 2-5


Communications interface
The communications interface operates in conjunction with a UART chip
which has a 16-byte FIFO. This method is used to prevent any loss of
characters while the system is processing a higher-level interrupt.

Profibus DP interface
The Profibus DP slave interface connection has, for the most part, been
implemented by the SPC3 chip. SPC3 supports transfer rates up to 12
MBaud.

Operating and display panel


The operating buttons are read directly via the ports of the 80C320
processor.

The display panel is triggered via a 7-segment driver.

2.4 Memory allocation

Figure 2.4.1 shows a table of a typical storage allocation of the AS-i


controller.

code ( EPROM
or EEPROM ) XDATA

user program RAM for


user program

RAM for
sequence control
program
reserve
sequence control display
program UART
DPRAM AS-i 2*
DPRAM AS-i 1
Profibus SPC3*

* = if available

Fig. 2.4.1 Typical memory allocation of the AS-i controller

page 2-6 manual ecolog asi system


For the user the 32 KB area for the user program is
most interesting. The other areas have also been shown for the sake of
completeness.

2.5 Powerfail monitoring

The operating voltage of the AS-i controller is monitored.

If the supply voltage falls below 10 V, an interrupt is triggered. The


retentive flags (%MB0 to %MB63) and various system flags are then
saved in the EEPROM.

2.6 Watchdog monitoring

The processor is monitored by the watchdog integrated in 80C320.

After its release the watchdog must be triggered in cycles. If the software
is faulty (e.g. closed loop in the user program), the watchdog would no
longer be triggered. This would lead to a reset being triggered after 512
processor cycles.

2.7 Wiring diagram and power supplies

Wiring diagram
The wiring diagram m shown in figure 2.7.1 can be used for your work
with this manual and as a model for implementing other projects.

manual ecolog asi system page 2-7


AS-i
power supply power supply AS-i controller
AC 1206 DN 2001 AC 1003

Plant earthing
system

AS-i cable

Fig. 2.7.1 Wiring diagram AS-i controller with power supplies

Power supplies
In addition to the AS-i controller two power supplies can be seen in figure
2.7.1.

• AC1206 (AS-i power supply with integrated data decoupling)

• DN2001 (standard power supply 24 V DC / 2.5 A)

AS-i power supply


The power supply with integrated data decoupling is absolutely
necessary for the functioning of the AS-i system! It supplies the analog
part of the AS-i master and most of the connected AS-i slave units.

As an alternative to AC1206 other AS-i power supplies can, of course,


also be used, e.g. power supplies with 24 V DC primary supply or such
with increased power (see ifm electronic's catalogue).

Standard power supply


The standard power supply is used as an energy supply for the AS-i
controller. Also, it is used to supply outputs which may be present in the
AS-i system via the additional black flat cable.

You need not necessarily use a power supply type DN 2001. One with a
higher nominal current may be required. Other power supplies are part of
ifm electronic's product range.

page 2-8 manual ecolog asi system


manual ecolog asi system page 2-9
3. Brief insight into asisys

The name "getting your feet wet" would perhaps be a better title for this
chapter.

We shall discuss a few basic concepts of asisys here thus giving the
reader the necessary background for the chapters that follow. For the
most part we only touch on the points leaving a detailed discussion for
later.

The reader is then shown how to install asisys and guided through a
very short asisys project.

3.1 Basic terms and concepts

What is asisys?
asisys is a complete development system for your asi controller. (asisys
stands for ecolog asi system.)

asisys is a tool, which makes it easy to learn how to write programs with
the powerful language constructs of the IEC-1131-3 standard.

What is IEC1131-3?
IEC1131-3 is an international standard for PLC programming
languages. It is important to note that the programming language is
standardized and not the programming environment. When referring to
IEC1131-3 the short form IEC will be used below.

The languages used in asisys comply with those of the IEC standard.

What is a project?
A project in this context is a composition of components. This
composition, as a whole, accomplishes a given task (e.g. sequence
control of a plant unit, pre-processing of data).

What are the primary components


of an asisys project?
The primary components of an asisys project are as follows:

• POUs (program organisation units, executable code)

• structures (data organization)

• visualisations

What programming languages are


available?
asisys supports the following pogramming languages:

• LD (ladder diagram)

• IL (instruction list)

• FBD (function block diagram)

manual ecolog asi system page 3- 1


• SFC (sequential function chart)

• ST (structured text)

• S5 (instruction list similar to step 5 from Siemens)

How is a project created?


A project is created using the following procedures:

• AS-i-system configuration
- I/O definition
• Component creation
- POUs
- structures
- visualisations

How can I test my project?


Clearly the only true test of a project is to run it in the plant. However, a
good pretest can be accomplished using the simulation option.

What is the simulation option?


The term simulation (simulation mode) refers to imitating the controller
and plant reaction on a PC. With such a system it is possible to pretest
the project without actually going on site, thus "ironing out" errors in the
office, saving time, nerves and face. The simulation mode used in
conjunction with a visualisation of the plant is the next best thing to being
there.

Using the simulation mode along with the many debugging features
available in asisys allows you to complete your precommissioning test
easily and efficiently.

What debugging features does


asisys have?
The following debugging features are standard with asisys:

• graphical hardware configuration

• forcing of I/O’s and variables

• creation of watch windows for current project data

• setting of breakpoints in simulation mode

• stepping
- from cycle to cycle
- breakpoint to breakpoint in simulation mode

• sampling tracing (graph of variable values as a function of time)

What about documentation?


The whole project can be documented or exported to a text file at any
time.

page 3-2 manual ecolog asi system


Conclusion
From the above one can conclude that asisys is a complete
development system for your asi-controller, leading to significant time
reduction in the development of your applications.

3.2 Installation

System requirements
asisys requires MS-Windows 3.1 or higher, MS Windows 95 or MS-
Windows NT. So an AT PC with a 386 processor must be used but we
recommend a 486 or pentium processor.
Installation
A "set up" program installs asisys on your PC. It is found on the diskette
supplied with this manual. Please procede as follows:

Windows 3.1 or higher


1. If MS-Windows has not yet started, type WIN and press the Enter
key.
2. Insert the ecolog asi system diskette into your diskette drive (here it
is assumed to be drive a).
3. In the program manager click on the menu point
File\RUN...
Type
a:\setup.exe
and click on
OK
4. Follow the instructions which appear on your monitor.
Windows 95 or NT
1. Insert the ecolog asi system diskette into your diskette drive (here it
is assumed to be drive a).
2. In the task bar click on the start button and the menu point
RUN...
3. Type
a:\setup.exe
and click on
OK
4. Follow the instructions which appear on your monitor.
What else is on the diskette?
In addition to the those just used the system diskette contains several
files which we shall refer to throughout this manual. We list these below
along with a short description.

• Examarry.pro : Examples concerning arrays and structures.

• Animate.pro : Example concerning anination in conjunction with the


visualisation option.
• Alarm1E5.pro : Example used in chapter 5.
• Examples.pro : Contains many examples illustrating the use of
asisys. It is not specifically refered to and can
be used for reference.

manual ecolog asi system page 3- 3


• Demo_lib.pro : Example dealing with user defined libraries (used in
conjunction with Demo_lib.lib)

• *.200 and *.gsd: Profibus configuration files

3.3 Sneak preview : a short asisys project

In this section we shall write a short project which will serve to illustrate
the basic steps required in using asisys. The options and procedures
shall be listed more or less "cook book style", leaving a detailed
explanation for later.

Task to be performed
A lamp C is to be on only when two switches A and B are closed. This
very simple system can be represented as in fig. 3.3.1 below.

A B
AND
A
çè C
C B

Fig. 3.3.1

asisys shall be used to


• realise and
• visualise
this system.

Getting started
These steps are usually the same.

1. Start MS-Windows

2. Start asisys

3. Open an existing or start a new project

Start a new project


To start a new project click on the option ’File/New’ as shown in fig.
3.3.2 below:

page 3-4 manual ecolog asi system


Fig. 3.3.2

Add an object
Next click on ‘Project\Add Object’ (fig. 3.3.3) to add the PLC_PRG
(main program part) to the project.

Fig. 3.3.3

As indicated in fig. 3.3.4 the object’s

• name is PLC_PRG, its

• type is Program and the

• language is FBD

Make sure your screen


corresponds in all points:

• Name: PLC_PRG

• Type: Program

• Language: FBD

Fig. 3.3 4

manual ecolog asi system page 3- 5


After clicking on ‘OK’ your monitor screen should be similar to fig.3.3.5.

Fig. 3.3.5

We have now added the PLC_PRG to our project. The PLC_PRG


operates cyclically and activates those POUs (programs, functions or
function blocks; see chapter 4 for more about POUs) which are
contained within it.

Please note these very important facts:

1. All projects must have one and only one PLC_PRG .

2. All POUs which are to be directly activated by the PLC_PRG must be


entered there, otherwise they will not be activated at all.

Point 1 has already been accomplished. To illustrate point 2 we will add


a second program to the project and enter it in the PLC_PRG, thereby
insuring that it is activated from there.

Add ‘AndGate’ to project


Click on the option ‘Project/Add Object’ again and add a program
named ‘AndGate’ to the project (see fig. 3.3.6).

Make sure your screen


corresponds in all points:

• Name: AndGate

• Type: Program

• Language: FBD

Fig. .3.3.6

After making the entries as shown in fig. 3.3.6 above your monitor should
appear similar to that shown in fig. 3.3.7 below.

page 3-6 manual ecolog asi system


Fig. 3.3.7

Define variables
Variables can be represented as tables (see fig. 3.3.7) or as text. Below
the representation as text is described but the type of variable
representation can be changed any time.

First click on the menu point 'Options\Declarations as Tables' (fig.


3.3.8) to select representation as text. This is shown in fig. 3.3.9. By
selecting the above option again, it is possible to return to the
representation of variables as tables.

Fig. 3.3.8

Move cursor to the end line If necessary click and pull to


2 and press 'ENTER' enlarge the screen
An empty space appears at
line 3

Fig. 3.3.9

manual ecolog asi system page 3- 7


Define variables (short form)
Define variables A and B to be Boolean (BOOL). To do so, proceed as
follows:

• move cursor to the end of line 2 and press the 'Enter' key

è line 3 is now empty (fig. 3.3.9 on the right)

• enter the definition in line 3 as shown in fig. 3.3.10.

Define variables A and B as


BOOL at the new line 3.

Fig. 3.3.10

This is the short form representation of variable definition (declaration).

We will go into further detail concerning variable definition (both forms)


later in this manual.

You may use either form for variable definition. We have often used the
short form in this manual due to space considerations.

Add ‘AND’ operator


Click on network 0001 so that the cursor (dotted rectangle) appears as
in fig.3.3.11.

Network 0001 with dotted rectangle

Fig. 3.3.11

Enter an ‘AND’ operator by


• clicking on the &-icon (see fig. 3.3.12) or by
• using the option ‘Insert\Operator’ (see fig. 3.3.13)

&- icon for AND operator IN-R icon for result (we
refer to this later)
Fig. 3.3.12

page 3-8 manual ecolog asi system


Fig. 3.3.13

Which ever method you use your monitor screen should appear similar
to fig. 3.3.14.

Blue background
indicates a choice of
alternatives.
In this case alternative
operators may be
chosen.

Fig. 3.3.14

F2: The magic key


At the risk of breaking your train of thought we would like to point out the
meaning and use of the F2 key. Often you will arrive at a point in using
asisys where a choice between several options is to be made. An
example is seen in fig. 3.3.14. Here an AND operator has been added
as a suggestion from asisys.The blue field upon which AND is written
indicates that there are alternatives. Pressing the F2 key here causes a
list of these alternatives to appear. Try it here and and a list of other
operators is given on the screen. In this case a new choice is not
necessary, so close with ‘Cancel’ (fig. 3.3.15).

Be aware that it works in most cases where alternatives exist (variables


etc.).

manual ecolog asi system page 3- 9


Move the bar to
your choice and
confirm with
double click or by
clicking on ‘OK’

Fig. 3.3.15

Operands
Add the operands A and B to the input of the ‘AND’ operator by
replacing ??? at each input with A and B respectively (see fig. 3.3.16
and fig.3.3.17).
Replace ??? inputs
with A and B
respectively.

Fig. 3.3.16 Fig. 3.3.17

Result
Click to the right and outside of the AND operator symbol causing the
cursor (dotted rectangle) to appear.

Before you procede make sure that the option Autodeclare is activated
(ü ). It is found in the menu point Project/Options (fig. 3.3.18).

Fig. 3.3.18

page 3-10 manual ecolog asi system


Then click on the ‘IN--R’ icon (fig. 3.3.19) and enter C as the result of the
‘AND’ operation.
Click on the IN--R
icon Replace ???
with C

Fig. 3.3.19

If you now leave the input field, the system finds out that the variable C
has so far not been defined and automatically opens a window for the
declaration of variables (fig. 3.3.20). The entries in this window can be
changed invididually but in this case they are correct and should be
confirmed by pressing OK. The variable declaration is now entered in the
upper part of our window.

Fig. 3.3.20

Activate AndGate from PLC_PRG


The program AndGate is to be activated from the PLC_PRG. To do this
display the screen containing the PLC_PRG (fig.3.3.21) and click on the
option ‘Insert/Function Block’ (fig.3.3.22).

manual ecolog asi system page 3- 11


1. Open 2. Insert
PLC_PRG program call
with double here
click

Fig. 3.3.21 Fig. 3.3.22

The Help Manager then appears from which the option User defined
Programs is chosen (fig. 3.3.23). Click on ‘AndGate’ and then ‘OK’.
The symbol for the user defined program ‘AndGate’ is now entered in
network 0001 of the PLC_PRG (fig. 3.3.24).

Fig. 3.3.23

Fig. 3.3.24

Why the bother for just an AND


operation ?
Certainly, the AND operation could have been entered directly in the
PLC_PRG. We used this complication of entering the operation in a
program and activating this program from the PLC_PRG for a good
reason. We wanted to illustrate that all POUs (in this case the POU
AndGate ) which are to be activated directly from the PLC_PRG must
be entered there. It is not enough to just write the POU. We go to such
bother here to ensure that this point is clear, since it has often happened
that POUs have been written and not entered anywhere. This results in
their not being called (activated) at all. We don’t want this to happen
to you!

What about the other languages ?


We do not want to start a discussion of the other asisys languages at
this point. To satisfy your curiosity we shall however show how the

page 3-12 manual ecolog asi system


program AndGate is written in the other languages (IL = instruction list,
LD= ladder diagram, ST= structured text, S5= Step5). SFC = sequential
function chart does not apply here. We will discuss each language in
greater detail later.

Fig. 3.3.27

How far are we now?


We have written two programs (PLC_PRG and AndGate). We have
entered the program AndGate in the PLC_PRG, which causes AndGate
to be activated from PLC_PRG.

Where do we go from here?


We have realized our project to the point that we can test to determine if
it accomplishes what it is supposed to accomplish. To do this let us
follow the procedure outlined below.

Online/ Simulation
Click on the option ‘Online’ and make sure that the simulation mode is
active. This is indicated by a check (ü ) next to simulation. If necessary,
click on simulation to activate it (fig. 3.3.28).

Online/Login
Click on the option ‘Online/Login’( see fig. 3.3.28). If there are any
syntax errors asisys will inform you of this and the login will be
prevented. All possible syntax errors cannot be considered here. If there
is an error in the message window a double click on this message line
opens the window of the program part where the error has been
detected.

Let us assume that either there were no errors or that you have corrected
those that may have occured. In any case we assume that the system
has been successfully logged in.

Online/Run
Next click on the ‘Online/Run’ mode (see fig. 3.3.28). Please make sure
that asisys is in this mode before proceeding.

manual ecolog asi system page 3- 13


Display the program ‘AndGate’ (double click on the left of the screen
under POUs).Your monitor should appear as in fig. 3.3.29.The message
at the bottom of the screen indicates that the Run mode is active .

Fig. 3.3.28

If the message is not present at all make sure that the status bar is
active. Do this by using the option ‘Options\Status’ ensuring that a (ü)
is present next to the status option.

Online
Simulation
and Run
modes
active

Fig. 3.3.29

Changing variable values


As indicated in fig. 3.3.29 the value of all three variables A, B, C is
FALSE. We can use the option ‘Online\Write Values to PLC’ to change
the value of these variables. To do this use the following procedure.

page 3-14 manual ecolog asi system


Fig. 3.3.30 Fig. 3.3.31

Double click on the value FALSE next to A and B, which changes each
to TRUE in red as in fig. 3.3.31 below. This change is not yet in effect.
To do this the values must be sent to the (simulated) plc.

Fig. 3.3.32

This is done by clicking on the option ‘Online/Write Values to PLC’ as


shown in fig. 3.3.32. The value change of variables A and B from
FALSE to TRUE is now in effect, which is reflected by the change of the
value of variable C from FALSE to TRUE (also colour change to blue) as
we expect as a result of the AND operation (see fig. 3.3.33).

You can use this method to make other changes to the variable values
and observe the result as for example in fig. 3.3.34.

Fig. 3.3.33 Fig. 3.3.34

manual ecolog asi system page 3- 15


Visualisation
Now that the system operation has been accomplished let us turn to the
visualisation. We shall guide you through a simple visualisation session
just as above.

A new visualisation has to be created with asisys offline. Use the option
‘Online/Logout’ to bring asisys offline.

Activating visualisation option


Activate the visualisation option by choosing ‘Visualisations’ on the left
of your monitor screen.To do this

• click on the scroll bar of the field on the left containing ‘POUs’ (see
fig. 3.3.35).

• then click on ‘Visualisations’.

Choose ‘Visualisations’ and


‘Add Object’

Fig. 3.3.35

Adding an object
Next click on the option ‘Project/Add Object’ as in fig. 3.3.35 . A screen
as in fig. 3.3.36 then appears which requests you to enter the name to
the new object. We have used the name ‘AndGateVis’. Please enter this
and click on ‘OK’. An empty screen then appears in which the new
visualisation "picture" can be "drawn" (see fig. 3.3.36).

Fig. 3.3.36

page 3-16 manual ecolog asi system


Fig. 3.3.37

"Drawing a picture"
There are three elements which can be drawn and animated using the
visualisation option. We shall use the rectangle as an example. The
procedures used to draw and animate this element can be used for the
other elements as well.

Click on the ‘Insert/Rectangle’ option (fig. 3.3.38) to bring a rectangle


on the empty screen. To do this

• place the cursor on the empty screen

• press the left mouse button

• drag the mouse until the rectangle has the desired size

• release the mouse button.

The result is as shown in fig.3.3.39.

Fig. 3.3.38 Fig. 3.3.39

Correspondence:
figures ó variables
To enable an interaction between picture elements and POU variables it
is necessary to establish a correspondence between them. This is done
by assigning each element one or more corresponding variables.

manual ecolog asi system page 3- 17


To facilitate this correspondence (among other things) a configuration
screen has been created. Entering the variables into this screen is aided
by using the F2 key. The exact use of this key will be explained below.

In order to use the F2 key in this sense we must introduce the variables
to the visualisation system. To do this click on the ‘Project/Rebuild all’
option.

If any errors are reported please correct them and close the message
window.

Element configuration
Double click on the rectangle in the screen as indicated in fig. 3.3.39.
Click on the category Variables and a screen as in fig. 3.3.40 then
appears. It is not necessary to make entries in all fields of this screen.
We shall discuss and make entries only to fields which pertain to our
present needs.

Fig. 3.3.40

To assign a variable to a picture element (in this case the rectangle),


click on the ‘Color:’ field and then press F2 (fig. 3.3.40), which causes a
screen as in fig. 3.3.41 to appear. Double clicking on the POU ‘AndGate’
results in a listing of the variables from that POU, which may be
assigned to the rectangle (fig. 3.3.42). Double clicking on the variable A
causes it to be entered in the ‘Color:’ field. The assignment is now
complete.

Click on 'AndGate' Note that clicking '.' calls a list of global


to display variables. variables. These variables will be discussed
later in this manual.

Fig. 3.3.41

page 3-18 manual ecolog asi system


Double click on 'A' or select 'A'
and confirm with 'OK' to enter
the variable

Fig. 3.3.42

Interaction
Interaction between the operator and the POU variables via the picture
element can be accomplished via a mouse click. The state
(TRUE/FALSE) of the corresponding (assigned) variable can be
changed (toggled between TRUE/FALSE) and displayed.

Colour changes
The state of the variable is displayed through the colour of the respective
element. The following correspondence exists between the variable state
and the picture element colour:

Color è variable FALSE

Alarm Color è variable TRUE

Choose option
To choose this option click in category Input on ‘Toggle Variable ‘Color
Change’ on mouse click’ .

Colour
Click in category Colors on the option ‘Color/Inside’ and a screen as in
fig. 3.3.43 appears. Choose an appropriate colour for the inside of the
rectangle by clicking on your choice and confirming this by clicking on
‘OK’. Since this is the colour that the rectangle has when the
corresponding variable is FALSE, grey is a good choice.

Fig. 3.3 43

manual ecolog asi system page 3- 19


Repeat this procedure using the ‘Color/Frame’ option.

Alarm Color
Repeat this procedure using the ‘Alarm Color/Inside’ and the ‘Alarm
Color/Frame’ options to choose alarm colours of the rectangle element.
Since the TRUE state is represented here we suggest green, but that is
your decision.

Text format
To give a name or label to the rectangle click in category Variables on
the field ‘Text Format’ and enter ‘A’. This name will appear on the
rectangle.

The screen ‘Regular Element Configuration’ should be as that shown


in fig.3.3.44. When you have insured that this is the case close the
screen by clicking on ‘OK’.

Fig. 3.3.44

Variable B
(with copy it is really easy)
We want to add another visualisation element for variable B similar to
that associated with variable A. The very useful copy/paste option is of
great help here. To use this feature proceed as follows:

• click on the element A

• click on the copy- icon


è a copy of this element (with configuration ) has now been made

• click on the paste -icon


è the element copy is now pasted over the original

• place the cursor on element A , press the left mouse button, drag the
element to the desired position and release the mouse button (see fig.
3.3.45 and fig. 3.3.46)

page 3-20 manual ecolog asi system


Click on the copy icon
and then on the paste-
icon.
Next click and drag copy
to desired position.

Double click to display


the configuration.

Fig. 3.3.45 Fig. 3.3.46

Continue the procedure as follows:

• double click on the copy to display the element configuration (fig.


3.3.46)
è the configuration as in fig. 3.3.47appears

• modify the configuration replacing A with B indicating that the


element corresponds to variable B (note that the definitions referring
to colour have already been copied via the copy option as used
above)

• confirm your choice with ‘OK’

The addition of the new element assigned to variable B is now


complete.

Change A to B thus assigning


the variable B to the new
element.

Fig. 3.3.47

manual ecolog asi system page 3- 21


Variables C
Use the copy/paste option discussed above or the same procedures
used for variable A above to assign an element to the C variable. Modify
the configuration as follows:

shape : Ellipse (transformed to a circle )

Input : No Input

Colors/Alarm Color/Inside : red

Which ever method you use to add the element for variable C the
configuration should appear as in fig. 3.3.48.

Fig. 3.3.48

Your visualisation screen should be similar to that in fig. 3.3.49.

Fig. 3.3.49

Using the visualisation


We are now ready to use (test) the visualisation screen which we have
created. To do this asisys needs to be online and running. Please use
the procedures outlined above to accomplish this. To refresh your
memory, briefly stated these procedures are :

• ‘Online\Simulation’ ( ‘ü ’ indicates it is active)

• ‘Online\Login’

• ‘Online\Run’

To use the visualisation screen refer to fig. 3.3.49 thru fig. 3.3.51.

page 3-22 manual ecolog asi system


First click on rectangle A followed by rectangle B. Their colour should
change from grey to green (assuming you entered these colours in the
element configuration screen; in any case the colour change should be in
accordance with the element configuration). The green colour of the
rectangles indicates that both of the corresponding variables have the
TRUE state.

Next observe that the colour of circle C changes from grey to red (again
in accordance with the element configuration). The red colour of the
circle indicates that the C variable has a value of TRUE, which is a result
of the AND operation (C = A AND B).

You can make further tests, for example click on rectangle B to grey
again (state = FALSE) and observe the resulting effect on circle C.

Fig. 3.3.50 Fig. 3.3.51

Storing your project

To save your project click on the option ‘File/Save as...’ (see fig. 3.3.52).

Fig. 3.3.52

This causes a file save dialogue to appear. Click on the field under ‘file
name’ and replace the (‘- - ‘) with for example AndGate. Confirm this
entry by clicking on ‘OK’. Your project is now stored in a file with the
name ‘AndGate.PRO’. Note that the visualisation screen (with
associated element configuration) has also been stored.

After all this work you probably want to have a break and you may want
to turn your system off.

To do this click on the ‘Online’ option and click on ‘Stop’ followed by


‘Logout’. Asisys is now stopped (simulation Option) and off line.

manual ecolog asi system page 3- 23


Then click on option ‘File/Exit’ (see fig. 3.3.53) after which asisys is no
longer active.

Fig. 3.3.53

With this sneak preview we hope to have given you the required help to
get you started using asisys. In the rest of this manual we shall add to
and expound upon the basic principles presented here.

page 3-24 manual ecolog asi system


manual ecolog asi system page 3- 25
4. What is what in asisys?

4.1. Control of a traffic light

We are now going to write a small example program. It is supposed to


control two traffic lights at a crossing. Both traffic lights will alternate their
red and green phases. To avoid accidents, we will insert yellow and
yellow/red switching phases. The phases red and green will last longer
than the switching phases.

This example will show you how time sensitive programs can be written
with IEC1131-3 languages and how the different languages are edited
with asisys. Last but not least you will learn to appreciate the simulation
of asisys.

At first, start asisys and select 'File''New'.

Creating POUs
Create a POU by performing 'Project' 'Add Object'. asisys calls this
POU automatically PLC_PRG. Do not change this name and do not
change the type of the POU (PRG) since every project needs a program
with this name.

The language choosen for this POU is Sequential Function Chart (SFC).

Now we create two more objects. A function block in the language


Function Block Diagram (FBD) named PHASES, and a POU WAIT
which is also a function block written in Instruction List (IL) .

What does PHASES do?


In the POU PHASES, each traffic light phase will be assigned to the right
colour, i.e. we will make sure that the red light is on in the phase red and
in the phase yellow/red, the green light in the phase green, etc.

What does WAIT do?


The POU WAIT will be a simple Timer. It will have one input which will
be the duration of the phase in milliseconds, and it will output TRUE
when the time is elapsed.

What does PLC_PRG do?


PLC_PRG will call the upper two POUs with the appropriate parameters
so that the correct light is on at the correct time and for the requested
duration.

"PHASES" declaration
Let us now write the POU PHASES. In the declaration part, you have to
declare an input variable STATE (between the keywords VAR_INPUT
and END_VAR) of type INT. STATE will have five possible states, one
for each phase (green, yellow, yellow/red, red and off).

So our traffic light will have the four output variables RED, YELLOW,
GREEN and off. Please declare these four variables as can be seen in
fig. 4.1.

The declaration part of PHASES should now look like this:


Fig. 4.1: Function block PHASES, declaration part

"PHASES" body
Now we will determine the output variables according to the input
variable status. To do so, click with your mouse on the network number
of the first network (the grey field on the left with the number 0001). Now
you have selected the first network.

Select the command 'Insert''Operator'. In the network a box with the


operator AND and two inputs will be inserted.

Select the AND with your mouse and change the text to EQ. Now change
the upper TRUE to STATE, and the lower to 1. Now you have built the
following network:

Click on any space on the right of the box. The output of the operation is
now selected. Select 'Insert' 'Assign'. Change the word "result" to
GREEN. Now you have programmed the following network:

STATE is compared with 1, and the result is assigned to GREEN: The


network will switch to GREEN, if the value of STATE is 1.

We need three more networks for the other traffic light colours and for
the off state. Create these networks with the command 'Insert''Network
(after)'. You should configure these networks as shown in fig. 4.2. The
complete POU now looks like this:
Fig. 4.2: Function block PHASES, body

For inserting an operator to the left of another operator (this is necessary


in the networks 2 and 3), you have to click on the spot where the output
of the new operator shall meet the box. Now you can perform 'Insert'
'Operator'. The rest is edited like the first network.

The first POU is finished. According to the input value STATE, PHASES
controls the wanted colour of our traffic light.

"WAIT" declaration
Let us now start coding the POU WAIT. This POU is to become a timer
for controlling the duration of a traffic light phase. Our POU has the input
variable TIME1 of type TIME and outputs a Boolean variable named OK.
This Boolean variable will output TRUE, if the desired time is elapsed.

This variable should have the initial value FALSE. This is done by
inserting ":= FALSE" after the declaration (but before the semicolon).

Linking the ST8051.lib


For programming the timer, you have to use a POU from the standard
library. Open the library manager by performing 'Window' 'Library
Manager'. You will see all libraries linked to our project. The standard
library is implicitly linked.
For our purposes, we need the POU TP, a Timer Pulse. This POU has
two inputs (IN, PT) and two outputs (Q, ET). TP has the following
function:

As long as IN is TRUE, ET is 0 and Q is FALSE. ET contains the elapsed


time in milliseconds since it went from TRUE to FALSE. When ET
achieves the value of PT, ET keeps its value. Q contains the value
TRUE as long as ET is less than PT. After ET achieved the value PT, Q
turns to FALSE again.

Remark: You find a brief description of all elements of the standard


library in the appendix, chapter B.

For using the TP in the POU WAIT, we have to declare a local instance
of TP. Therefore, we declare a local variable TEL (for time-elapsed) of
type TP (between the keywords VAR and END_VAR).

The declaration part of WAIT now looks like this:

Fig. 4.3: Function block WAIT, declaration part

To design the desired timer, the body of the POU has to be programmed
as follows:

"WAIT" body

Fig. 4.4: Function block WAIT, body

First Q is loaded. If Q is TRUE (the timer is running) we jump to the label


and Cal TEL to check whether the time is elapsed or not.
Otherwise, we reset the timer and start it with the desired duration
(time1).

The negated value of Q is then stored in OK. Therefore OK is TRUE for


one cycle after time1 is elapsed.

Now the timer is complete. The main program PLC_PRG will


concatenate our two previous function blocks WAIT and PHASES.

"PLC_PRG", first level of


development
First we declare the variable list needed. These are two instances of the
function blocks PHASES (LIGHT1, LIGHT2) and one of the type WAIT
(DELAY). We obtain the following declaration part:

Fig. 4.5: Program PLC_PRG, first level of development, declaration part

How to build a diagram in SFC


The initial diagram of a POU written in SFC consists of a step "Init", a
following transition "Trans0" and a jump back to Init (fig. 4.5). We are
going to slightly extend this structure.

First we fix the structure of our diagram, then we can code the different
actions and transitions.

First of all, we need a step for each phase of the traffic light. You can
insert a step by selecting Trans0 and performing 'Insert' 'Step-
Transition (after)'. Repeat this procedure three times.

By clicking directly on the name of a transition or a step, this name is


selected and can now be changed. Replace Trans0 by "TRUE", the other
transitions by "DELAY.OK".

That means: control always passes the first transition and the other
transitions if the value of DELAY.OK (output variable of the function
block instance DELAY) is TRUE, i.e. when time1 is elapsed.

The steps are named (from top to bottom) Switch1, Green2, Switch2,
Green1. Init keeps its name. "Switch" always means a yellow phase.
While the step Green1 is active, LIGHT1 will be green, while the step
Green2 is active, LIGHT2 will be green.

Finally, change the jump target from Init to Switch1. The resulting
diagram should be as follows:

Fig. 4.6: Body of the program PLC_PRG, first level of development

Now we have to fill the action bodies of the steps. If you double click on
a step, a dialogue is displayed to open a new action. In our example we
will always choose the language IL (Instruction List).

Actions and Transition conditions


The action which is associated with the Init step initializes the variables.
The variable STATE of LIGHT1 is assigned 1 (green). The variable
STATE of LIGHT2 is assigned 3 (red).
Fig. 4.7: Action Init

At the step Switch1 the STATE of LIGHT1 switches to 2 (yellow), the


STATE of LIGHT2 switches to 4 (yellow and red). The delay time is fixed
to 2 s.

Fig. 4.8: Action Switch1

At Green2, LIGHT1 is red (STATUS:=3), LIGHT2 is green (STATUS:=1),


and the delay is 5000 ms.

Fig. 4.9: Action Green2

At the step Switch2 the STATE of LIGHT1 switches to 4 (yellow and red),
the STATE of LIGHT2 switches to 2 (yellow) and the delay is 2000 ms.

Fig. 4.10: Action Switch2

At Green1, LIGHT1 is green (STATUS:=1), LIGHT2 is red (STATUS:=3),


and the delay is 5000 ms.

Fig. 4.11: Action Green1

Now the first level of development of our program is finished. You can
compile the resulting program and test it in the simulation.

PLC_PRG second level of


development
You now want to switch off your traffic light system after a certain
number of cycles, e.g. in the night. Therefore we insert a counter in our
program which counts up the number of cycles of our traffic light system.
The system is switched off when this counter reaches a certain number.
First of all, we need a new variable COUNTER of type INT. Declare this
variable in the declaration part of PLC_PRG, and initialize it in the action
Init with 0.

LD 0

ST COUNTER

Now select the transition after Switch1 and insert a step/transition after
this transition.

Select the new transition, press the <SHIFT> key and select the last
transition before the jump. Insert an alternative branch (command:
'Insert''Alternative Branch (left)')

Insert after the left transition a step and a transition.

Insert after the new transition a jump to Switch1.

Name the new parts as follows.

The upper one of the two new steps is named "Counting".

The other step is named "Off".

The transitions are called (from top to bottom and from left to right)
FINISH, "TRUE" and "DELAY.OK".

Our changed structure now looks as follows:


Fig. 4.12: Traffic light system

As can be seen, there are two more actions and one transition condition
to be programmed.

In the step Counting, the counter is increased by one.

Fig. 4.13: Action Counting


In the transition FINISH it is checked whether the counter exceeds a
certain number, e.g. 7:

Fig. 4.14: Transition FINISH

In OFF, the state of both lights is set to 5 (OFF), the COUNTER is reset
to 0, and the delay is set to 10 s (10,000 ms):

Fig. 4.15: Action Off

The Result
In our traffic light city, it is getting dark after seven traffic light cycles, this
lasts 10 s, then the traffic lights are switched on again, etc.

Traffic light simulation


Now test the resulting program in simulation mode. The simulation mode
is selected when the menu item ‘Online’ ‘Simulation mode’ is checked.
If not, select this menu item. Now perform 'Online' 'Login' and
simulation is active.

With 'Online' 'Start', the execution of the user program is started. Open
PLC_PRG and watch the change of active (blue) steps. Open actions
and transitions to monitor variables.

4.2 The visualisation of a traffic light

With the visualisation tool of asisys, it is very easy to design a


visualisation of the PLC program. In chapter 8 the visualisation tool is
described in detail.

In the following sections we will draw a traffic light building with two
traffic lights to visualise the program course.

Set up a new visualisation


To set up a new visualisation, you have to select ‘Visualisation’ in the
object list. Therefore click on the field ‘POUs’ in the left column of the
asisys workbench. A list with the entries ‘POUs’, ’Structures’ and
‘Visualisations’ appears. Now select visualisation to set up a new
visualisation with the command ‘Project’’Add Object’. Enter the name
of the visualisation and press OK. A window for the new visualisation
opens.

Insert an element
For the traffic light visualisation, carry out the following steps:

• Activate the command ‘Insert’’Circle’ and draw a medium circle


(∅2cm) by moving the mouse (hold the left mouse button pressed).

• Double click on the circle. A dialogue box to edit the circle will open.
Select the category ‘Variables’ and enter the variable:
PLC_PRG.LIGHT1.RED in the colour field

• With this entry the variable RED of the instance LIGHT1 of the
function block PLC_PRG will be addressed.

• Now click on the category 'Colors' and press the button ‘Inside’ of
the section ‘Color’. Select a neutral colour such as black.

• Then click on the button ‘Inside’ of the section ‘Alarm Color’ and
select the colour red.

The generated circle will be displayed in black in the normal state, and if
the variable RED of LIGHT1 is TRUE, the colour of the circle will change
to red. The first light of our traffic light is finished!

The other lights


Copy this light with the command ‘Edit’’Copy’ (Ctrl+C) and then the
command ‘Edit’’Paste’ (Ctrl+V) twice. Now you got two additional circles
which are placed upon the first circle. Move the two circles under the first
one with the mouse (click on one circle and tear it to the new position by
pressing the left mouse button). They should be in one column under the
first circle (like a real traffic light).

Double click on the two new circles. Select the category ‘Variables’ in
the configuration dialogue and enter the following variables in the colour
field oft the corresponding circles:

for the middle circle: PLC_PRG.LIGHT1.YELLOW

for the bottom circle: PLC_PRG.LIGHT1.GREEN

Select the corresponding colours (yellow and green) in the category


‘Colors’ and in the section ‘Alarm Colors’.

The traffic light case


Let us now draw the case of the traffic light. Select drawing a rectangle
with the command ‘Insert’’Rectangle’. Draw a rectangle outside the
three circles by selecting the left upper edge and the right bottom edge
with a mouse click. For the colour of the rectangle choose a neutral
colour (e.g. grey) and put it to the background with the command
‘Extras’’Put to Behind’ (the circles become visible).

If the simulation mode is not active, this can be done with the command
’Online’’Simulation Mode’.

You can start the simulation with the commands ‘Online’’Login’ and
‘Online’’Start’. Now the colour changing of the traffic light can be
watched.
The second traffic light
The easiest way to design the second traffic light is to copy the first one
and to modifiy the configuration entries. First mark all parts of the first
traffic light by tearing up a window over all parts and then select the
command ‘Edit’’Copy’ and ‘Edit’’Paste’. Change the element
configurations from LIGHT1 to LIGHT2. That is all. The visualisation is
finished.

Text in the visualisation


To complete the visualisation, insert two rectangles below the traffic
lights. In the visualisation dialogue adjust the colour frame to white.
Write in the field ‘Text Format’ of the category ‘Variables’: "Traffic Light
1“ for the first traffic light and "Traffic Light 2“ in the field of the second
traffic light.
Now, your visualisation is finished and looks like this:

Fig. 4.16: Visualisation example


5. This time with an AS-i controller

As far as the AS-i controller and the AS-i system are concerned the
examples in chapters 3 and 4 were "dry-runs". We wanted to get
aquainted with asisys. And that we did.

Let us not forget that creating a project and testing it in the simulation
mode is only the beginning. It must operate in the plant. That is the point
where the AS-i controller and the AS-i system enter the picture.

In this chapter you will learn how to


• connect the AS-i controller to the AS-i system
• configure and commission the AS-i system for your application
We shall do this, as always, by means of an illustrative example project.
This project, ‘alarm1e5.pro’, is included on the diskette containing your
asisys-software. We shall discuss this project below.

The hardware contained in the AS-i Profi Kit is used in this example,
which is convenient for those who have a Profi Kit. But please do not
misunderstand, you will be able to understand everything in this chapter
even without this convenience.

5.1 Project description : an alarm system

A door-monitoring alarm system is to be built (see fig. 5.1.1). The system


shall have the following features:

• The condition of the door (open / closed) is to be determined (sensed)


and displayed
• The condition sensor is to be relatively manipulation-safe
• A control panel shall contain the following sensors and actuators:

actuator:
− H1: signal lamp; ON when alarm system is
active, realized by the LED in the green button
− H2: signal lamp; ON when alarm system is
active and the door was or is open, realized by the
LED in the red button
− horn: signals when alarm system is active and door was
or is open
sensors
− T1 alarm system ON / OFF-button (green)
− T2 horn-acknowledge-button (red)

In addition to the above a visualisation screen for monitoring the alarm


system is to be created.

manual ecolog asi system page 5-1


AC2000 (module upper part) slave AC2018 (module upper part)
+ AC5000 (module lower part) + AC5000 (module lower part)

AS-i flat cable AC4000

slave IG5886
control panel

door to be
monitored

plug-in power supply AC1201

AS-i
controller
AC1003

red

brow connecting cable AC4010


n

blue

plant ground
data decoupling for Profi Kit components,
only available with the Profi Kit

Fig. 5.1.1 Alarm system

Note:
The required "relative manipulation safeness" is provided by the use of
the intelligent sensor IG5886. This can be clarified by using fig. 5.1.2.
The signals "ready for operation" and "safe range" explained in this
figure can be evaulated for this purpose. The damping element (metal
plate or similar) is installed at a distance of between 10% and 80% of the
sensing range. An attempt to replace the damping element "sticking on"
a piece of metal results in the "ready for operation" signal going to 0.
Attempting to damp the switch with an element which is not within the
safe range of the switch will result in the signal "safe range" going to 0.

page 5-2 manual ecolog asi system


IG5886 damping element

distance from active


face
ready for
operation

safe range
damped not damped

switching state

Fig. 5.1.2 Signal function IG5886

5.2 Connecting the system (...slowly, don't connect


everything all at once)

It is better with the Profi Kit, but


you can get along without as well
We assume that you have the components depicted in fig. 5.2.1 (for
example from a Profi Kit). If you do not have these components you can
use the simulation mode as in chapter 3 and 4. After all a "dry run" can
also be a good learning experience.

The hardware set-up of the alarm system is shown in fig. 5.2.1. The
states of the actuators H1 and H2 can be displayed via the LEDs
contained in slave AC2018. The buttons T1 und T2 can be realized using
those located in slave AC2018.

manual ecolog asi system page 5-3


AC2000 (module upper part) slave AC2018 (module upper part)
+ AC5000 (module lower part) + AC5000 (module lower part)

AS-i flat cable AC4000

slave IG5886 mounted on E10441

plug-in power supply AC1201

AS-i
controller
AC1003

red

brow
n connecting cable AC4010

blue

data decoupling for Profi Kit components,


only available with the Profi Kit

plant ground

Fig. 5.2.1 Hardware set-up

Set your system up as shown in fig. 5.2.1 with the exception of the
slaves. For the time being leave the slaves disconnected, since it may
be that both have the address zero. Directions for connecting the slaves
will be given in the next section!

The small printed circuit board (pcb) containing the data decoupling
circuit is available only with the Profi Kit. Using this pcb both slaves
can be operated in a laboratory environment, without the use of a
separate AS-i power supply. Place this pcb in the terminals of the
controller as shown in fig. 5.2.1 above. Fasten it by tightening all the
screws in the terminal block.

Important note
The AS-i slaves are supplied with 24V via the 24V plug-in power supply
by means of the a.-m. pcb. This is not in accordance with the AS-i

page 5-4 manual ecolog asi system


specification (the AS-i power supply delivers 31V and contains a more
extensive data decoupling circuit). For this reason this pcb may only be
operated in a laboratory environment using the Profi Kit components.

!
The operation of this system in an industrial environment requires
the use of a separate AS-i power supply (for example AC1206)!
(see fig. 5.2.2)

AS-i power supply


AC1206

Fig. 5.2.2. Operation with separate AS-i power supply

5.3 Realizing the alarm system using asisys

The system is to have the specified features as listed in section 5.1. We


are to use asisys and AS-i to accomplish this. Several of the necessary
steps have been discussed in section 5.2. The remaining steps shall be
described below.

Note
It is absolutely necessary that you set-up the AS-i system (addressing of
slaves etc.) in accordence with the following. This is required to ensure
the proper operation of the example project 'alarm1e5.pro'.

We assume that the asisys software has been installed and that the
system is active. If you have any questions concerning installation of

manual ecolog asi system page 5-5


asisys or its basic operation please refer to chapter 3. If you have not
worked thru chapter 3 you should take the time (approx. 1 hour) to do so
before proceeding.

Begin with a few important


adjustments
Please start by doing the following :

• deactivate the simulation mode


• enter the proper communication parameters
• check the library

Simulation mode
Choose the ’Online’ option. The simulation mode is to be deactivated
(no 4 next to 'Simulation'). If this mode is active please deactivate by
clicking next to the word 'Simulation'.

Communication parameters
Choose the ’Online/Communication Parameters...’ option. A screen
similar to that in fig. 5.3.1 appears.

Fig.5.3.1 Communication parameters

The protocol uses 1 ‘Stop Bit’ and has no parity check (see fig. 5.3.1:
Stop Bit = 1, Parity = No Parity). The PC-communication port
(COM1, COM2, ...) should correspond to the one to which the controller
is connected. No other communication port driver (mouse driver etc.)
may be assigned to this port.

The baud rate must be the same as that which is entered in the
controller. The baud rate can be displayed and entered into the controller
via the operation and display elements located on the controller (function
b; see appendix G).

Libraries
The libraries 'ST8051.LIB' and 'ECOASI.LIB' must both be loaded.
Check that these libraries are entered and if not please load them as
indicated below.

Choose the 'Window/ Library Manager' option. A screen as shown in


fig. 5.3.2 appears.

page 5-6 manual ecolog asi system


Fig. 5.3.2 Library Manager

If your screen is not as that in fig. 5.3.2 please call the 'Insert/Additional
Library...' option. A screen as in fig. 5.3.3 appears. Choose the libraries
'ST8051.LIB' and 'ECOASI.LIB' and confirm your choice with 'OK'.

Fig. 5.3.3

Insert a new project 'test.pro'

We shall now configure the AS-i system. To do this please insert a new
project having the name 'test.pro'.

We proceed by calling the 'File\New' option and then calling the


'Projekt\Add Object...'. A screen similar to fig. 5.3.4 appears. Please
insert a new POU as follows:

Name: PLC_PRG
Type: Program
Language: IL

Confirm your choice with 'OK'.

manual ecolog asi system page 5-7


Fig.5.3.4 Projekt/Add Object...

Just a reminder, the name PLC_PRG is to be used as this is the "main"


POU. As you are aware one and only one POU with this name is
allowed in a project !

Another reminder, you can save your project (not necessary at this point)
by calling the option 'File\Save' . A screen similar to that of fig. 5.3.5
appears. Enter the name test.pro and confirm the entry with 'OK'.

Fig. 5.3.5 Save a file

Configuring the AS-i system


Often the number and type of sensors and actuators is determined and
entered into the project in the planning office. Parallel to this activity the
plant is being constructed on site. We want to introduce several options
which are used to establish the contents of the project concerning
sensors and actuators (inputs/outputs). This determination is refered to
as configuration. These options allow you to do important work without
the need to connect your controller.

For the following discussion we assume that asisys is in the offline


mode. This is indicated in that the message in the
status line is not displayed.

Call the option ‘Window/PLC Configuration’ or click the button. A


screen similar to that in fig.5.3.6 appears.

page 5-8 manual ecolog asi system


Fig. 5.3.6 PLC Configuration

The 'PLC Configuration' in fig. 5.3.6 shows an overview of all slaves


in an AS-i system. AS-i line 1 is the default system. That is the AS-i
which is connected to the ASI 1+ und ASI 1- terminals. This is displayed

in the title line: . Projected slaves (slaves


which are to be connected to the system) are indicated by a dark grey
background.

Displaying the other AS-i line

The option 'Extra/Change AS-i' or the button can be used to


change to the other AS-i line.

To enter a new slave into the system (project a new slave) it is


necessary to open the dialogue for editing slaves and to close with 'OK'.

This can be carried out in three ways, which we discuss below.

Insert slave (via menu )


Call the option 'Extra\Slave'. A screen similar to that in fig. 5.3.7
appears. Enter the name of the slave which is to be added in the space
provided and confirm your choice with 'OK' .

Fig.5.3.7 Slave selection

A screen,’ Slave Configuration’, similar to that shown in fig. 5.3.8


appears. Confirm your choice with 'OK'. This confirmation is indicated in
that the field of this slave in the screen 'Configuration ASI... 1' has a
dark grey background.

manual ecolog asi system page 5-9


Fig.5.3.8 Slave Configuration

Insert slave (via mouse)


Display the screen ‘Configuration ASI 1’ (fig. 5.3.6) and double click
the field of the desired slave.The 'Slave Configuration' screen is
displayed and you can proceed as above.

Insert slave (via keys)


With the ‘Configuration ASI 1’ (fig. 5.3.6) displayed use the cursor to
move the dashed rectangle to the field of the desired slave and press the
<ENTER> key. You can now proceed as above.

The action "delete slave" can be carried out in two ways. We discuss
these alternatives below.

Delete slave (via menu)


Call the option 'Window\PLC Configuration' . A screen as in fig. 5.3.9
appears.

Now call the 'Extras\Delete Slave' option. A screen as in fig. 5.3.9


appears. Enter the name of the slave which is to be deleted in the space
provided and confirm your choice with 'OK' .

Fig. 5.3.9

This confirmation is indicated in that the field of this slave in the screen
'Configuration ASI 1' no longer has a dark grey background.

Delete slave (via keys)


With the ‘Configuration ASI 1’ (fig. 5.3.6) displayed use the cursor to
move the dashed rectangle to the field of the desired slave and press the
<Del> key. The result is the same as above.

page 5-10 manual ecolog asi system


Slave editing
We have called the slave dialogue screen ‘Slave Configuration’
several times without discussing the content of this screen. We want to
get this caught-up now.

Let us get started by calling the screen 'Configuration ASI 1' as in fig.
5.3.6. Display the screen ‘Slave Configuration’ by double clicking any
one of the slave fields in the AS-i configuration screen.This causes a
screen as in fig. 5.3.10 to appear.

Fig.5.3.10 Slave Configuration

The following data concerning a given slave can be entered via this
screen:

• symbolic name as an identification


• entry in the List of the Projected Slaves (LPS)
• slave input data (relevant only in simulation mode)
• slave output data
• slave parameters
• projected slave parameters
• projected slave ID code
• projected slave I/O configuration

The input data, output data, parameters, and the projected parameters
can all be changed by clicking the corresponding fields (colored circles).

The most current changes to the variable values take effect if the screen
is closed with the confirming 'OK'. If the dialogue is closed with 'Cancel'
the changes have no effect. Of course changes are not transfered to the
controller when the system is in 'Offline'.

Open project 'alarm1e5.pro'

Call the option 'File/Open...' (or icon ).

Choose the project 'alarm1e5.pro' and confirm your choice with 'OK'.

manual ecolog asi system page 5-11


What happens at login?
When login takes place an active connection between the PC and the
controller is created. That is to say that for example the state of the
inputs and outputs displayed via asisys correspond to those in the plant.

Before 'login' is carried out asisys determines whether the called


project (configuration, executable code and data) and that stored in the
controller are the same.

If there is agreement then the login is carried out.

A difference between the


• configuration and/or the
• executable code and data
in the PC and controller can lead to this disagreement.

The user is asked to decide if this disagreement is to be removed by


downloading (transfering ) the project from the PC to the controller.

The user can decide upon a download after which the login is carried
out. Should a decision against a download be made no login is
carried out at this point.

LoginCall the option 'Online/Login' (or use tool bar symbol ).

Should the a.-m. disagreement take place for example


• at the first run thru of this projector
• after changes to the executable code or data - which you should
avoid doing with this example at least for the time being -

then a screen similar to that in fig. 5.3.11 appears.

Fig. 5.3.11 Equalize Projection

Select to transfer the configurations from the


project file to the controller and confirm this with 'OK'. The window as
shown in figure 5.3.12 opens.

page 5-12 manual ecolog asi system


Fig. 5.3.12

Please answer the question with yes and 'download' the project
‘alarm1e5.pro’.

You have just transferred the project to the controller. This is normally
enough.

We would like to discuss another situation which should not occur here. It
is nonetheless appropriate to consider it at this time.

..and when the project file is


missing?
There are several causes for not having the project file. We shall not
consider them here. We simply assume that the file is missing. You can
transfer the project contained in the controller to the PC and vice versa.
Please understand that the source code is not available, only that form
of the project which is normally understandable by the controller. This is
nevertheless of great help because the operation of the controller is at
least possible.

The binary-download operation which we have already mentioned


along with its companion operation binary-upload are used for this
purpose.

Binary-upload
Call the option 'Online\Login' as described above. Choose the option
'Extras/Bin.Upload'. A screen with the title 'Open' apperars.You are
requested to enter a name having the extension '.bin'. Enter a name and
confirm your choice with 'OK'. The project is transfered from the
controller and stored in a file having the name entered above and the
extension '.bin'.

Binary-download
The counterpart to upload is download. This is the transfer of the project
from a file to the controller. Call the option 'Online\Login' as described
above. Choose the option‘Extras/Bin.Download’. A screen with the title
'Open' appears. You are requested to choose which file is to be
transfered. Enter a name and confirm your choice with 'OK'. The project
is transfered from the '.bin' file to the controller.

Version
You can determine which version of the controller hardware and software
(controller operating system) your controller has by means of the
'Version' option. Test this by calling the ‘Extras/Version’ option. A
screen similar to that in fig. 5.3.13 appears.The above-mentioned
version numbers are given in this screen.

manual ecolog asi system page 5-13


Fig .5.3.13 Version

Master: system check


Information concerning the master is available to the user. To familarize
yourself with what is offered please call the 'Window\PLC
Configuration' option followed by the 'Extras/Master' option (or the tool
bar symbol

). A screen similar to that in fig. 5.3.14 appears.

Fig. 5.3.14 Master AS-i 1

The condition of the system need not be exactly as that shown in the
master screen of fig. 5.3.14.

As orientation you find the name of each field in the screen. The
meaning is explained where needed. The expected contents is given and
action to be taken in case of a deviation from the expected is
encountered.

page 5-14 manual ecolog asi system


The cyclic data interchange between AS-i master
and slaves is taking place.

Deviation:
• Error , no slaves/no master connected.

The projection mode has been chosen. This is


usually the case when the AS-i system is being
configured (set-up).

Manual projection and addressing is possible,


automatic addressing is not possible.

The presence of slave zero does not lead to an


error.

The actual and predefined configurations are not


compared (i.e. all detected slaves are activated).

The AS-i master remains in this mode as long as a


slave having the address zero in connected.

Deviation:
Choose the projection mode.

The voltage for the AS_i system is correct, the AS-i


power supply is operating correctly.

Deviation:
• The AS-i voltage is not correct. Check the
hardware (power supply, connections, load,
possible short-circuits, etc.)

This is correct in the projection mode since no


automatic addressing is allowed in this mode.

Deviation:
• The automatic addressing of a missing slave is
allowed and active in the protected mode.
Choose the projected mode!

This is correct in the projection mode since


automatic addressing is not allowed in this mode.

Deviation:
• Automatic addressing is allowed, since one and
only slave is missing. This is only allowed in the
protected mode. Choose the projection mode!

manual ecolog asi system page 5-15


The AS-i master is in standard condition. The
offline-phase is carried out when the system is
turned on or when the protected mode is activated.

Deviation:
• The AS-i master is not in standard condition.
Some of the reasons why this condition could
prevail are that no slaves are present, a voltage
error has occured initialisation phase is active,
the watch dog has been activated.

LDS and LPS are not in agreement, i.e. at least


one slave is missing, improperly configured or not
projected.

Deviation:
• The system is operating correctly i.e. the slaves
which are connected were also projected.

No slave having the address zero is present.

Deviation:
• A slave having the address zero is present.
Please disconnect all slaves (see section 5.2).

User activation of the automatic addressing option.

Deviation:
• This is irrelevant when the projection mode is
active.

User activation of the automatic addressing option.


This means that even when more than one slave is
missing automatic addressing of new slaves is
allowed. The address assignment begins with the
lower (lowest) missing address.

Deviation:
• This is irrevelent when the projection mode is
active.

page 5-16 manual ecolog asi system


Communication is taking place at present with
controller number 1.The controller ID can be
entered here when the offline mode is active. These
numbers must be equal otherwise communication is
not possible. The controller ID is also of importance
when the communication is via the RS485 interface.

Deviation:
• This is allowed as long as communication is with
the desired controller (value 1..124).

Addressing and projecting the two


slaves
Instructions for the addressing and projecting of the slaves provided in
the Profi Kit are given below.

Addressing
Please use the following correspondence:

• Slave IG5886: address 1


• Slave AC2018: address 2

Slave IG5886:
Connect slave IG5886.

Do this as follows:
• Connect the AC2000 module
− place the flat cable in the AC5000 module
− fasten the AC2000 with the captive screws provided
• Fasten the connection cable of the slave in one of the ports of the
AC2000

Call the 'Window\PLC Configuration' option (when this option is not


already active). A screen similar to that in fig. 5.3.15 appears.

Fig. 5.3.15 Configuration ASI 1

Refering to fig. 5.3.15 we observe that slave 0 is detected (red point


under D).

There are three methods for slave addressing (or readdressing). These
are discussed below.

Addressing is possible only in


projection mode
You must switch to the projection mode to change slave addresses. Call
the 'Extras' option and click the 'projecting mode' (or use the icon).

manual ecolog asi system page 5-17


Note
Due to this change both asisys and the AS-i master are in the
projection mode.

Addressing via menu


Call the 'Extras' option and click 'change address' (or use the icon).
A screen similar to fig. 5.3.16 appears. The entries in this screen have
the effect of changing the address of slave Slave IG5886 from 0 to 1.

Fig 5.3.16 Change address

All slaves are given the address 0 when they are manufactured and
therefore should have the address 0 upon delivery. If the slave IG5886
does not have the address 0 but for example the address 7 then the
detection of slave 7 will be displayed. In this case please proceed as
follows:
• enter 0 in the field 'Old Address'
• enter 1 in the field 'New Address'
• confirm with 'OK'
Slave IG5886 now has the operating address 1.

Addressing via mouse


Place the cursor on slave 0 and depress the left mouse key. Drag the
rectangle which appears to slave 1 and release the mouse key. The new
address is 1.

Addressing via keys


Place the cursor on slave 0 (indicated by dotted rectangle). Depress the
<Shift> key and use the cursor arrows to bring the rectangle to slave 1.
Release the <Shift> key.

Exercise
The methods discussed above are generally applicable. Use one of your
choice to assign slave AC2018 the opperating address 2.

Solution
Connect slave AC2018 to the system by doing the following:
• place the flat cable in the AC5000 module
• fasten the AC2018 with the captive screws provided

What we discussed concerning address 0 (i.e. all slaves have this


address upon delivery) pertains here as well. We assume that the slave
has the address 0 and that you assign it the address 2 as described
above for slave IG5886.

Do no proceed until Slave AC2018 has the address 2 !

We now continue by projecting the system:

page 5-18 manual ecolog asi system


That is nice but what do you mean
by "projecting"?
By "projecting" we mean that the slaves which are to be contained in the
system are
• entered into the LPS (List of Projected Slaves) and
• their types are defined i.e.
− I/O configuration
− ID code
(A detailed discussion is contained in chapter 2.)

This information is stored in the project file and in the controller (when
the project is transfered).

What about taking this information


from actually connected slaves?
Right you mean "connecting everything and then taking projection data
from what is connected". The answer is yes we can do this. (But don't
forget, this is not always possible - you may be doing this projection in
the office while the system is being assembled on site).
Is projection possible without
writing POUs?
Yes. The project does not have to contain POUs. If you are using the
controller gateway, without any preprocessing then of course no POU's
are needed.

Let us make sure we are together.


The PLC Configuration screen is to appear similar to that as shown in
fig. 5.3.17 below. It can be seen that slaves 1 and 2 are projected (dark
grey background).

Fig. 5.3.17

Note:
These two slaves were already projected, since as mentioned above, the
projection data is part of the project and stored with the project file. (In
this case 'alarm1e5.pro'). The projection of a system is usually
necessary only once. The projection procedure is described and carried
out below to familarize the reader.

Project all
(actual configuration
Ô PC, controller)
We assume that all the AS-i slaves that are to be used in the system are
connected. Call the 'Extra/project all' option( or use the icon). A
screen similar to that in fig. 5.3.18 appears. Confirm your request with
'OK' and the projection data of the connected system is transfered to the
controller and PC.

manual ecolog asi system page 5-19


Fig. 5.3.18

A deviation between the current projection data and that from before is
due to a difference in the hardware configuration. As mentioned it is
necessary that the projection data be as stored in the project file. Make
the necessary changes insuring that this is the case. (That is, hardware
corrections and repeated transfer of the projection data.)

The projection operation has been completed as far as the requirements


of our example are concerned. Nonetheless we want to discuss two other
variations of this procedure.

Load projection data


(PCÙ Controller)
Using this variation the projection data of the project file is transfered to
the controller.

This option can be used by first calling the projection mode (using for

example the icon) and then choosing the 'Extras\load projection'.


This variation can also be directly called using the corresponding icon
(see the tool bar).

Slave configuration
(actÙproj.)
With the projection mode active and the slave dialogue screen 'Slave

configuration' active the button can also be used. Using


this option one can cause the current settings of the slave whose
configuration screen is being displayed to be stored as projection data
for that slave.

This option can be used by first calling the projection mode (using for

example the icon) and then calling the screen Slave Configuration
from the screen 'Configuration ASI 1' for the desired slave. A screen as
shown in fig. 5.3.8 appears. The required settings can be made and the

choice confirmed with button.

5.4 Start-Up

Generally one begins the start-up of a system by checking the sensors


and actuators (i.e. I/O check). We shall do this here as well. It is
assumed that you have worked thru section 5.3 and that the following is
true:

• asisys is active

page 5-20 manual ecolog asi system


• the project ‘alarm1e5.pro’ has been opened
• the configuration data corresponds with that in section 5.3
• slaves 1 und 2 are connected
• slaves 1 und 2 are projected and detected

The proper operation of slave 1 can be checked using the simulator


provided in the Profi Kit. The following assignment applies:

• D0: "switching -signal"


• D1: "safe range "
• D2: "ready for operation"
"safe range“
" ready for operation "

permanently off "switching signal“

Turn the damping cylinder of the simulator and determine if the signals
are as in fig. 5.1.2.
The corresponding test for slave 2 can be carried out by pressing the two
buttons on the slave. It can also be carried out by clicking the elements
in the slave dialogue screen which correspond to the outputs.

"green button"
status of "red LED“

"red button"
status of "green LED“

"green LED" "red LED“

• D0: "red button"


• D1: "green button“
• D2: "red LED“
• D3: "green L ED“

manual ecolog asi system page 5-21


Additional information is contained in the slave dialogue screen ('Slave
Configuration'). Display the corresponding screen for each slave by
double clicking the appropriate field in the 'PLC Configuration' screen.
Ensure that these screens comply with those shown fig. 5.4.1 (for slave
1) and fig. 5.4.2 ( for slave 2).

Fig. 5.4.1

Fig. 5.4.2

In the following we refer to slave 1. For your convenience find below the
expected contents of the screen (as needed with meaning) as well as
help in case of possible deviations.

Slave 1 is in the LPS (list of the projected slaves).

Deviation:
• Click this field (activate the projection mode if
not already active).

Slave 1 is in the LDS (list of the detected slaves).

Deviation:
• Slave is not connected or is not properly
addressed.

page 5-22 manual ecolog asi system


Slave 1 is in the LAS (list of the activated slaves).

Deviation:
• When the projection mode is active all
detected slaves are activated. When the
protected mode is active only slaves which are
properly projected are activated. Please
ensure that the configuration data is correct (ID
code and I/O configuration).

Current ID codeof the slaves


represented as a number (0...15). The
ID code indicates definition of the
signal assignment (i.e. switching
signal D0 etc.). This definition is given
in the profile which is determined by
the AS-i organization.

Deviation:
• An incorrect slave has been connected.

Projected ID code of the slave


represented as a number (0...15).

Deviation:
• Choose the correct entry (see current ID code).

Clicking the opens the following box:

manual ecolog asi system page 5-23


I/O configuration of the slave
represented as a number (0...15).
The I/O configuration defines the
direction of the data signal (input,
output or bidirectional). In the case of
the bidirectional data signal the data
port allows signals to be transfered in
both directions. The definition of the
possible configurations is determined
by the AS-i organization.

Deviation:
• An incorrect slave has been connected.

I/O-configuration of the slave


represented as a number (0...15).

Deviation:
• Choose the correct entry (see current I/O

configuration). Clicking the opens the


following box :

The hardware configuration of our project has now been completed. We


shall have a short look at the POU contained in the project. If you have
any questions to the writing of POUs please refer to chapters 3 and 4.
The syntax of the commands used here is to be found in the appendix.

The project contains several POUs (PLC_PRG and function blocks).

Declaration part
The declaration part of the PLC_PRG is as follows:

page 5-24 manual ecolog asi system


As you remember variable names are declared (defined) here. The
name is to be
• written without spaces
whereas
• capital and small letters may be mixed.

The declaration is to be modified when the variable is assigned a


specific address as for example in the case of
• inputs
• outputs
• flags, bytes and words.
The modification is in the form of ‘AT %....’ .
The variable address syntax is given in fig. 5.4.3. Please ensure that you
fully understand these rules as they must be adhered to when addressing
variables using asisys.

bit address (only variables of length X):


0..3 : for AS-i inputs/outputs
(data bit D0..D3)
0..7 : for flags or inputs / outputs to the field
bus system
AT %IX1.2.1 slave or flag adresses:
0..63/31 : for inputs/outputs of the field bus
variable type: system (byte number)
I : input 1..31 : for inputs/outputs (slave number)
Q : output 0..255: for byte-wise addressing of flags
manual ecologMasi: flag
system 0..127: for word-wise addressing of flags page 5-25
0..63 : for double-word-wise addressing of flags
Fig.5.4.3

Let us look at two examples from the declaration part.

Fig. 5.4.4
Refering to fig.5.4.4 we see that variable 'T1' is assigned an address (via
AT %IX1.2.1). This indicates that 'T1' is assigned to an
• input bit from the
• first AS-i master
• slave 2
• bit 1
Further we see that 'T1' is a bit variable (BOOL). In this case using bit
1 of the slave assigns 'T1' to the green button of the push button
module.

Fig. 5.4.5

Refering to fig.5.4.5 we see that variable 'H1LED' is assigned an address


via (AT %QX1.2.3). This indicates that 'H1LED' is assigned to an
• output from the
• first AS-i master
• slave 2
• bit 3
Further we see that 'H1LED' is a bit-variable (BOOL). Using bit 3 of
the slave assigns ' H1LED' to the green LED of the push button
module.

A more detailed discussion of this subject is to be found in appendix D.


Body
Let us briefly discuss the body of the PLC_PRG.

page 5-26 manual ecolog asi system


Fig. 5.4.6

Network 1
The alarm system can be turned on and off (activated /deactivated) via
the button T1. This is to be done using a 'rising edge' of this signal.

manual ecolog asi system page 5-27


Network 2
The value of 'H1' is transfered to the variable 'H1LED'.

Network 3
The alarm condition is to be activated when the door has been opened or
when the sensor has been manipulated or damaged. The necessary
operatinos are contained in a function block of type 'Sensor', which is
called here.

Networks 4/5
When the alarm condition exists the horn is turned on. It is turned off via
the button 'T2'. The horn LED ('HornLED') is also turned on and off.

Network 6
The alarm condition is indicated by blinking display in the visualisation
screen. The tact generator for this blinking is contained in this network.

The function block 'Sensor'


The 'POU' 'DoorSensor1' is an instance of the function block 'Sensor'.
This function block serves to process sensor signals. Other sensors in
the plant can be processed using another instance of this function block
(for example 'DoorSensor2').

Generally speaking, since a function block may be applied in other


POUs, one should not use global variables internally. This is true for
variables having specific addresses as well, such as flags, inputs and
outputs.

Should flags having specific addresses be required (bit manipulation in a


byte) one should first transfer the contents of these flags to other
variables. The required operation can be carried out using these
variables (see network1...network4).

When writing function blocks in which inputs and/or outputs are accessed
one should use functions which are contained in the library 'ecoasi.lib.
This library is contained in asisys. An example of such a function is
‘InputLesen()’ (read input).

The POU 'BLINK' is an instance of the function block 'TactGenerator'.


This is a block having an output which is a "square wave". The period of
this signal can be entered using the two inputs of the block (time high,
time low).

Project test
Call the visualisation screen named 'profikit' by doing the following:

• click the arrow next to the field

• choose the screen 'profikit' (double click) from the list

which appears (see also fig. 5.4.7).

The project also contains another visualisation screen called


'AlarmSystem', which you can also call and use to test the operation of
the project.

page 5-28 manual ecolog asi system


Place asisys 'on line' and in the 'run mode' if the system is not already
in this mode.

Fig. 5.4.7 Visualisation screen 'profikit'

A detailed description of the software components used in this project is


to be found in the chapters that follow

Test the operation of the project using the sensors and visualisation
elements and observing the reactions. Have fun!
.

I like this project. Can I get it to


start automatically?
We are happy to hear that and yes you can cause it to start
automatically. We have the auto start option for that purpose. Use the
following procedures :
• activate the MS-Windows 'Program Manager'
• select the option 'File\Properties'
• add complete path and project name at the end of the command
line field of the 'File\Properties' screen. Leave a space in between this
entry and the present one.
When asisys is started the project entered above is loaded and the
online option is activated.The state of the controller is not changed (for
example if the run mode is active it remains so etc.).

manual ecolog asi system page 5-29


page 5-30 manual ecolog asi system
6. Components of asisys in detail

In the following sections, you will find detailed descriptions of the


features of asisys. We will have a close look on each menu item and
what it does.

The two menu items ‘Insert’ and ‘Extras’ are dependent on the active
window (normally the window with the cursor). Therefore they are
described in the chapter where the editors are described.

6.1 Handling projects

The commands which can be used for the whole project are located
under the menu items 'File' and 'Project'. Some of the commands under
'Project' can only be used for objects (the ... Object items). They are
described in the next chapter.

'File''New'
With this command a new project is opened with the name 'Untitled'.
This name has to be changed when the project is saved.

'File''Open'
This command opens an existing project. If a project has already been
opened and modified, asisys asks you whether to save it or not.

The standard Windows File Open dialogue appears. Select a project file
with the extension "*.pro“ from the file list. The file must exist, it is not
possible to create a project with the Open command. To do so, use New
(Menu File).

To open one of the most recently used projects, use the menu
commands after the Exit command in the File menu.

'File''Close'
This command closes the project which is currently open. If the current
project was modified, asisys asks you whether to save it or not.

If the project to be saved is named "Untitled", a name must be specified


as described under ‘File’ ‘Save as’.

'File''Save'
This command saves the current project, if it was modified.

Short cut: <Ctrl>+<S>.

If the project to be saved is named "Untitled", a name must be specified


as described under ‘File’ ‘Save as’.

'File''Save as'
This command saves the current project in a different file. The original
project file is not changed.

After choosing the command, the standard Windows Save dialogue


opens. Select an existing file name or enter a new file name. Then click
on OK. The current project is saved in the specified file.

manual ecolog asi system page 6-1


If the file name already exists, asisys asks you whether to overwrite it or
not.

'File''Save as library'
This command saves the current project as library for use in other
projects.

First, the standard Windows Save dialogue is shown. Select an existing


file name or enter any file name. Then click on OK.

The whole project is rebuilt. If any errors occur, asisys shows a message
that a correct project is necessary to create a library. The project is not
saved as library.

Otherwise the current project is saved as library in the specified file.

If the filename already exists, asisys prompts you, whether to overwrite


it.

What a library is good for is described in the chapter Library Manager.

'File''Print'
This command prints the contents of the active window.

Short cut: <Ctrl>+<P>.

With this command the standard Windows Print dialogue is shown.


Select the options you need or configure the printer and then click on
OK. The object shown in the active window is printed.

For documentation of project parts or the whole project, use the menu
item ‘Project’ ‘Documentation’.

It is possible to insert comments from an external file into the


documentation of an object. How to do this is described in the chapter
Global Variables.

To edit the documentation frame, use the command ‘File’ ‘Printer


Setup’.

'File''Printer Setup'
This menu option allows you to edit the documentation frame. With this
command the documentation setup dialogue appears.

page 6-2 manual ecolog asi system


Fig. 6.1: Dialogue for editing the documentation frame

Enter the name of the file in which you want to save your documentation
frame in the field „File“. The default name in this field is
"DEFAULT.DFR“. To load another documentation frame press the
button "Browse“. Then the file open dialogue appears.

You can choose in the dialogue whether or not each new object should
start on a new page.

With "Printer Setup“ the printer setup dialogue opens.

With "Edit“ the documentation frame editor opens. In this editor you can
insert placeholders for the page number, date, name of file and POU as
well as graphics and the place for the content of the POUs.

Fig. 6.2: The documentation frame editor

manual ecolog asi system page 6-3


To insert new placeholders choose the command ‘Insert’ ‘Placeholder’
and select one of the five possible placeholders (Page, POU-Name,
Filename, Date, Content). Then click on the editing field and draw a
rectangle with the left mouse button being pressed. The inserted
rectangle contains the chosen placeholder. The placeholders are
replaced in the printout as follows:

{Page} is replaced by the current page number of the


printout.

{POUName} is replaced by the name of the currently printed POU.

{FileName} is replaced by the name of the project.

{Date} is replaced by the current date.

{Content} is replaced by the content of the POU.

Furthermore you can insert a bitmap with the command ‘Insert’


‘Bitmap’. After choosing a bitmap file (with extension *.bmp), insert the
bitmap in the editing field by moving the mouse cursor with the left
mouse button being pressed.

When the window is closed, the documentation frame is saved


automatically.

'File''Exit'
This command quits asisys.

Short cut: <Alt>+<F4>.

If a project has already been opened and modified, asisys asks you
whether to save it or not.

'Project''Rebuild all'
Generates a code for all POUs and structures.

The error window is opened to display the progress of compilation and


the occurring errors.

Message window
The message window shows the progress of the compilation. In case an
error occurs, the POU, the line and the type of the error is displayed.
Select the line in the message window where an error is displayed and
enter <ENTER> (or double mouse click). A window with the POU opens
and the incorrect line or network is selected. Now you can easily fix it.

You can get to the next (previous) error with <F4> (<Shift>+<F4>).

page 6-4 manual ecolog asi system


Fig. 6.3: Message window: 10 POUs were compiled, 4 errors occurred.

In appendix E all error messages are listed.

Note
The cross reference list is built only during the compilation and will not
be stored with the project! To use the functions ‘Show Call Tree’ and
‘Show Cross Reference’, the project must be rebuilt after loading or
changing.

'Project' 'Options'
This menu item contains all menu items for optional settings of your
project. The options which can be set are described on the following
pages.

Autosave before compilation


If this option is checked (√) in front of the menu command, your program
will be saved automatically before any compilation.

manual ecolog asi system page 6-5


Ask for project info
If this option is checked (√) in front of the menu command, the project
information dialogue opens automatically, when a project is saved for the
first time or an project is saved with a new name.

This option is specific for a working place. It is not saved in the project
file, but in the asisys.ini file.

User Info
With this command you open a window which contains information about
the project user.

Fig. 6.5: A possible User Information window

The user information consists of the name of the user, his initials, and
the company he works for.

These items are specific for a working place. They are not saved in the
project file, but in the asisys.ini file.

Directories
With this command a dialogue opens in which you can insert the
directory path where the libraries and the compilation files for asisys are
located.

Fig. 6.6: Possible directory paths

These paths are specific for a working place. They are not saved in the
project file, but in the codesys.ini file.

Save options
After choosing this command, the following dialogue opens:

page 6-6 manual ecolog asi system


Fig. 6.7: Dialogue for Save Options

You can choose whether asisys is to create a backup version when you
save the project next time. If this option is checked, asisys additionally
saves the current project in a file with the extension .bak. So you can
always restore the version before the last save operation. Existing .bak
files are not overwritten. For getting a new .bak file, delete or remove an
existing one.

If the option Auto Save is checked, the project is saved after the time
indicated in the field Auto Save Interval. asisys saves the project in a
temporary file with the extension .asd. When asisys terminates
normally, this file is deleted, otherwise this file is not deleted. When the
file is opened again, asisys detects this safety file and opens the
following message:

Fig. 6.8: Dialogue for opening a corrupted project

You can choose whether you want to open the auto save backup or the
project as explicitly saved the last time.

Note that when you have chosen the auto save option, the command
‘Extras’ ‘Previous Version’ resets an object to the last saving which
can be manually or automatically made.

The autosave option is highly recommended because it saves your work


in case your computer crashes (which will most likely not be caused by
asisys) or in case of power failure.

asisys offers data protection


To protect your project from unauthorized use, asisys offers the
possibility to define passwords for opening and saving a project. To do
so, open the password dialogue with the command ‘project’ ‘options’
‘password’. The following dialogue appears:

manual ecolog asi system page 6-7


Fig. 6.9: Password dialogue

Enter the desired password for opening your project in the field
password. For every typed letter, an asterisk appears on the screen.
Confirm your password in the field Confirm Password. Close the dialogue
with OK. If the message

The password and its confirmation are not equal

appears, your password and confirmation are unequal. Reenter the


password and confirmation.

If you now save the file and open it again, asisys prompts you to enter
the password. The project is only opened after the correct password has
been entered..

In additon to this general password, you can define a write protection


password. Therefore enter the desired write protection password in the
corresponding field of the upper dialogue (fig. 6.9), and confirm your
password.

A write protected project can be opened without knowing the write


protection password. Therefore press the button Cancel when asisys
asks you to enter the password. Now you can compile the project, load
the project, simulate the project etc., but you cannot save the project.

Make sure that you do not forget your passwords! Otherwise address
your support.

Autoformat
If this option is checked (√) in front of the menu command, the text
written in the IEC 1131-3 language instruction list (IL) will be formatted
automatically. Tabs are inserted and keywords are written in upper case.
Just try. This will help you to write more readable programs.

Autoload
If this option is checked (√) in front of the menu command, the project
you last worked on is opened (with the work space last saved) each time
you start asisys. This is normally very useful.

page 6-8 manual ecolog asi system


Autodeclare
If this option is checked with a checking mark (√) in front of the menu
command, a declaration dialogue for this variable opens each time you
enter a variable which has so far not been declared.

Now all options are explained and we go on with the Project menu.

'Project''Document'
This command allows you to print a documentation of the whole project
or parts of it.

A full documentation consists of:

• POUs

• Structures

• Visualisations

• Sampling Trace

• Cross references

• The call trees of POUs and structures

• The global variable list

• The plc configuration

• A table of contents

After choosing the command, a dialogue appears where you can select
the parts of the project you want to print.

Fig. 6.10: The Document Project dialogue

Export and import of projects


asisys offers the possibility to export or import projects. You can
therefore exchange projects between different IEC programming

manual ecolog asi system page 6-9


systems. Until now there has only been a standardized exchange format
for the languages IL and ST. For this reason asisys uses an own format
for the graphical languages.

'Project''Export'
All POUs, the global variables, the plc configuration and the structures of
a program are stored in an ASCII file. The format of these elements
corresponds to that of the Common Elements in IEC 1131-3.

The plc configuration and POUs written in FBD or LD have a special


asisys format.

'Project''Import'
An export file is imported into the project.

If an imported POU has the same name as an already existing POU, its
name starts with a leading underscore.

‘Project’ ’Import from a S5 project


file’
This command imports a project file written in S5 (Step 5).

'Project''Merge'
Merge allows you to copy objects from another project. The standard
Windows file open dialogue opens and you have to select the desired
project.

Then another dialogue opens which allows you to select the objects you
want to copy:

Fig. 6.11: The Merge Project dialogue

From the POU list you can select the desired POUs; from the structure
list or visualisation list you can select the desired structures or
visualisations. You can also choose whether you want to copy the
Sampling Trace, the Global Variables, or the PLC Configuration.

After confirming with OK, the selected objects are copied from the
selected project to the current project.

page 6-10 manual ecolog asi system


If a merged POU has the same name as an already existing POU, its
name starts with a leading underscore.

‘Project’ ‘Project Info’


With this command you can store information in your project. After
choosing the command, the following dialogue appears:

Fig. 6.12: Dialogue for project information

A full project information contains the following entries:

• File name

• Directory

• The date of the last change

These entries are given by asisys. You cannot change these entries in
the project information dialogue.

You can add the following entries:

• A title for the project

• The name of the author

• The version number

• A description of the project

manual ecolog asi system page 6-11


Each of these entries is optional. When you press the button ‘Statistics’,
you get statistic notes about the currently loaded project.

Fig. 6.13: The Project Statistics window

'Project''Global Search'
Global search allows the search for a certain string throughout the whole
project or parts of it.

'Project''Global Replace'
Global replace allows the replacement of a certain string throughout the
whole project or parts of it.

6.2 Handling objects

Object/Object List
Below an "object" either refers to a POU, a structure or a visualisation
element. The object list (small window on the left of your screen)
contains all objects of a project. The type of the shown objects can be
chosen in the combo box at the top of the object list.

For changing from POUs to structures, click on ‘POUs’ and select


structures.

'Project''Delete Object'
This command deletes the currently selected object (POU, structure or
visualisation element) in the object list (short cut: <DEL>).

After choosing the command the system prompts you to confirm the
command. Press the 'Yes' button to delete the object.

If the editor window of the object is open, it will automatically be closed


after deletion of the object.

page 6-12 manual ecolog asi system


'Project''Add Object'
Creates a new object (Short cut: <INS>). The type of the new object
depends on the current selection in the Object Class Selection combo
box.

After choosing the command, a dialogue appears depending on the type


of the new object:

If the new object is a POU, the type (function, function block or program)
and the desired language for the new POU have to be selected.

Note that the name of the object must be unique.

Fig. 6.14: Dialogue for creating a new POU

'Project''Rename Object'
This command renames the currently selected object (POU, structure or
visualisation element) in the object list.

‘Project’ ‘Convert Object’


With this command you can convert a POU written in the languages IL,
ST, FBD, LD, S5 or SFC to one of the languages IL, LD and FBD.

Before converting objects the project has to be compiled. After choosing


the command the following dialogue opens:

Fig. 6.15: Dialogue for converting POUs

Choose the language to which you want to convert the POU and give the
new POU a new name (or the new POU will replace the original one). By
pressing OK the new POU is added to your project.

manual ecolog asi system page 6-13


Note: Comments will get lost when a POU is converted. Converting a
POU written in IL to FBD and back to IL results in a POU which looks
different but does the same.

'Project''Open Object'
This command loads the currently selected object (POU, structure or
visualisation element) of the object list in the appropriate editor.

‘Project’’View Instance’
With this command you can open single instances of a function block.
The required function block must be selected before executing this
command.

Note
Instances cannot be opened until the project is logged in! (Correctly built
and downloaded to the controller by ‘Online’’Login’)

'Project''Show Call Tree'


This command opens a window with the call tree of the currently selected
object (POU, structure) in the object list.

Note
The project has to be compiled!

The call tree contains calls of POUs as well as references to structures.

Fig. 6.16: Example for a call tree

'Project''Show Cross Reference'


This command opens a dialogue for finding the locations where variables
are used. The references are generated during the project compilation.
So first compile your project.

page 6-14 manual ecolog asi system


Fig. 6.17: Cross References to the symbol In1 with POU, line number,
usage of Read/Write

Enter the name or address of a variable to find out where it is used and
press the ‘Get References’ button. If you want to go to a certain location,
select the location and press the ‘Go To’ button (or <Enter> or double
mouse click).

'Project''Show Unused variables'


With this command you get a list of all defined but unused variables.

‘Extras’ ‘Previous Version’


With this command the object which is currently edited (loaded in the
active window) is reset to the state of the last saved version. This can be
a manual saving as well as an automatic saving. If you have chosen the
auto save option, it might happen that unwanted changes cannot be
undone with this command.

6.3 Common edit commands

The following commands are the same in all asisys editors. These
commands are located in the menu 'Edit'.

'Edit''Undo'
Undoing the last action made in the currently opened editor window.

Short cut: <Ctrl>+<Z>.

Note that not all editors support the undo function and that undo cannot
be applied to changes of the whole project such as inserting, deleting or
renaming a POU or a structure.

manual ecolog asi system page 6-15


If Undo is used twice, the state before the first undo is restored.

'Edit''Cut'
Moves the current selection of the editor window to the clipboard. The
selection is removed in the editor window.

Short cut: <Ctrl>+<X>.

'Edit''Copy'
Copies the current selection from the editor window to the clipboard. The
contents of the editor window are not modified.

Short cut: <Ctrl>+<C>.

'Edit''Paste'
Inserts the contents of the clipboard at the current cursor position in the
editor window. In the graphic editors, pasting will only be executed, if the
resulting structure is syntactically correct.

Short cut: <Ctrl>+<V>.

'Edit''Delete'
Deletes the current selection of the editor window. The contents of the
clipboard are not changed.

Short cut: <Del>.

'Edit''Search'
The Find command allows the search for a certain text in the current
editor window. After choosing the command, the standard Windows Find
dialogue appears which stays open until the button 'Cancel'/'Close' is
pressed.

Dialog options:

• Find What: Enter in this field the text you want to search for.

Match Whole Word only: If this item is checked, the find command
searches for the search text as a whole word and not as
part of a word.

• Match Case: If this item is checked, the search is case sensitive,


which means that for example the search string 'Case'
does not match the string 'case'.

• Direction: If 'Up' is checked, the search is performed from the


current position to the top of the editor, otherwise the
find command extends from the current position to the
bottom of the editor.

• Find next: Starts the searching at the selected position in the


chosen direction. If the text is found, it is marked. If the
text is not found, a message box with the text '<Text>
not found.' appears. Note that a text found, may be
hidden by the find dialogue. Search stops at the
beginning or the end of the editor window contents.

• Cancel/Close: Quits the find command.

page 6-16 manual ecolog asi system


Note
Declaration part and body are different find areas. If you want to search
different objects relative to a character string, use ‘Project’ ‘Global
find’.

'Edit''Find next'
Repeats the find operation with the parameters (text to find, search
direction etc.) specified with the last Find (Menu Edit) command.

Short cut: <F3>.

'Edit''Replace'
This command allows to search for a text and replace it with a different
text.

After choosing the command, the standard Windows find and replace
dialogue appears which stays open until the button 'Cancel'/'Close' is
pressed. In addition to the search dialogue, there is a field to type in the
text to be used to replace the searched text.

Note
Declaration part and body are different replace areas. If you want to
search different objects relative to a character string, use ‘Project’
‘Global replace’.

‘Edit’’Input Selection’
With this command, you can get a list of all possible variables to insert in
a watch list or to use as trace and trigger variables.

Short cut: <F2>

‘Edit’’Next Error’
If the compilation of a project fails, the next error could be displayed with
this command.

Short cut: <F4>

‘Edit’’Previous Error’
If the compilation of a project fails, the previous error could be displayed
with this command.

Short cut: <Shift>+<F4>

6.4 Common Online commands

After writing your program you most likely want to run it in your hardware
or simulate it in the PC. You want to get a connection to the controller,
download your program to the controller, see what it is doing, debug it
and change it. All commands which deal with these subjects are located
under ‘Online’ because when not simulating, you will need an online
connection from the PC to your controller (RS232C, RS485).

manual ecolog asi system page 6-17


When you enter a command, a service will be sent to the controller and
the PC will get a response.

All available online commands are located under the menu item Online.
The effect of some commands depends on the selected editor.

In simulation mode, your program is executed within the PC. All online
functions are available, so you can debug your project without the need
of special hardware. A very useful feature, not only for your first small
projects!

'Online''Login'
This command connects the system to the controller. If the project was
not built, it is built automatically. If the compilation results in errors,
asisys does not switch to online mode.

When logging into the system, asisys checks whether there is a user
program loaded in the controller. If there is one, it checks whether the
program is identical to the project actually loaded in asisys. If this is the
case, the programming system switches form editing mode to online
mode. Otherwise it asks you whether you want to download the new
program.

Online mode means:

• Editing the project is not possible.

• All supported online functions are available.

• The values of all visible variables are shown (monitored).

Note
When logging into your hardware, asisys tries to get an online
connection. This might fail for several reasons.

If it fails, the message

"Communication Error: Logout Performed"

is displayed.

Check whether the settings in 'Online''Communication Parameters'


match the parameters of your controller, in particular whether the
interface number is correct (COM1: Is the cable connected to COM1?)
and whether the baud rates in the controller and in the programming
system are the same (the default in asisys is 19200).

Note
When logging in was successful, asisys compares the project last
loaded into the Controller with the project actually loaded in asisys.

If they are different, you get the message:

"Program has changed! Download the new program?"

page 6-18 manual ecolog asi system


You can now choose either "No" and switch to online mode, or you enter
"Yes" and the currently loaded project is downloaded to the controller.

'Online''Logout'
This command switches back from online mode to editing mode. The
connection to the controller is closed or the simulation is quitted.

'Online''Download'
This command loads a compiled project to the controller. This command
is implicitly performed when logging into the controller.

'Online''Run'
This command starts the execution of the program you successfully
wrote with asisys. Short cut: <F5>.

After you loaded a new program, the controller normally (depends on the
firmware) remains in ‘Stop’, which means that the loaded program is not
yet executed. Enter run and it will be executed until it is stopped by a
breakpoint, a stop or a single cycle command.

The asisys status bar shows whether the user program is executed (run)
or not (stop, stop in breakpoint).

'Online''Stop'
Stops the execution of the program loaded to the controller.

‘Online’ ‘Reset’
The data in the controller are initialized. They get the values they
explicitly got in the declaration parts of the POUs or 0. For safety
reasons, you have to confirm this command before the controller is reset.
After a reset the user program is not executed (Stop).

'Online''Toggle Breakpoint'
The action of this command depends on the current cursor position. If
the cursor is on a valid breakpoint position, a breakpoint is set or cleared
at this position.

Breakpoints can only be used in simulation mode.

Valid breakpoint positions are:

• every network in FBD or ladder diagram

• every step in SFC

• every line with a dark grey line number filed in IL and ST

Short cut: <F9> or <Shift> and double mouse click.

A breakpoint is displayed in blue.

After the program execution reaches a breakpoint, the program stops


and the breakpoint becomes red. To continue the program, use the
commands Run, Single Cycle, Step In or Step Over (all in the Online
menu).

manual ecolog asi system page 6-19


'Online'‘Breakpoint Dialog'
Opens a dialogue for setting and clearing breakpoints throughout the
whole projects. The dialogue shows all breakpoints and allows to find the
position where the breakpoint is set.

Breakpoints can only be used in simulation mode.

Fig. 6.18: Breakpoint dialogue

The POU drop down list contains all POUs of the project. The location
drop down list contains all valid breakpoint positions of the selected
POU.

Add sets a breakpoint in the selected POU at the selected line (or
network or step). The breakpoint is added to the breakpoint list.

Delete deletes the breakpoint selected in the list of breakpoints.

Delete all deletes all breakpoints.

Goto opens the POU and sets the cursor on the line with the breakpoint
actually selected in the breakpoint list.

'Online''Step Over'
A single step is performed. A call of POUs is treated as one step
(execution is stopped after the execution of the POU). In SFC, a whole
action is executed.

Short cut: <F10>.

Single steps can only be used in simulation mode.

'Online''Step In'
Steps to the next statement, even if it is in a different POU.

If the next statement is the call of another POU, execution stops before
the first statement of the called POU.

Short cut: <F8>.

Single steps can only be used in simulation mode.

page 6-20 manual ecolog asi system


'Online''Single Cycle'
Execution starts and stops at the end of one plc cycle (or when reaching
the next breakpoint).

'Online’'Write Values to PLC'


and

'Online''Force Values to PLC'


For changing the value of a variable, perform a double mouse click on
the declaration of the variable or select the variable and press
<ENTER>.

You will get a dialogue for changing the value of the selected variable.

Fig. 6.19: Dialogue for writing new variable values

After you enter OK, the value is just marked for changing, but not
actually changed in the controller. The values of all marked variables are
displayed in red. This gives you the possibility of changing several
variables at once (between two controller cycles).

With the command 'Write values’, the new values of all marked variables
are written to the controller (and then monitored again). They are just
written and can immediately be changed by the user program.

The command 'Force values’ has the same function as 'Write values’,
but the values are written after each controller cycle until 'Release Force'
is executed. As long as the values are forced, they are displayed in red.

'Online''Release Force'
The force list in the controller is released. The values are no longer
forced.

'Online''Show Call Stack'


You can perform this command when the execution has stopped at a
breakpoint.

Breakpoints can only be used in simulation mode.

A dialogue opens with a list of the POUs currently in the call stack and
the line (or network) number which is being executed.

manual ecolog asi system page 6-21


Fig. 6.20: Example for call stack

The first POU is always PLC_PRG because here execution starts.

The last POU is always the POU where execution was stopped.

After selecting one of the POUs from the list and pressing the 'Go To'
button, a window with the selected POU opens and the line or network
which is being executed is displayed.

'Online' 'Display Flow Control'


The flow control helps you to debug your project without stopping the
execution. Flow control is active while the menu item is checked (√).
Flow control can only be used in simulation mode.

The flow control works on the active selected editing window and
depends on the language the POU is written in. If the active window does
not contain a POU written in IL, ST or FBD, no flow control is shown.

Flow Control in IL

Fig. 6.21: Flow control in IL

page 6-22 manual ecolog asi system


An additional field is displayed to the left of each line. When the
controller is running and the line was executed, the line number field is
marked (green) and the accumulator contents are displayed.

Flow Control in FBD

Fig. 6.22: Flow control in FBD

In FBD, the network number field of each passed line is marked (green).

For every line you get the current value ‘passed’ over this line. For
Boolean values, the line is highlighted (blue) when a TRUE value is
passed and is normal otherwise. For other than Boolean values, a text
field is inserted containing the current value passed over this line.

'Online''Simulation'
If simulation is selected, the online services do not work on the
controller, but on the simulation program which runs under the same PC
as the programming system.

'Online''Communication
parameters'
This command allows you to set the parameters of the serial interface.

manual ecolog asi system page 6-23


Fig. 6.23: Communication Parameters dialogue

It is important that the communication parameters in the PC and in the


controller are the same.

The selected parameters are stored with the project.

6.5 A matter of View

asisys offers some possibilities to configure the asisys window. To do


so, use the commands under the menu topic 'Options'. All configurations
are stored in the file "asisys.ini" and will be restored at the next start of
asisys.

'Options''Toolbar'
With this command the tool bar above the workspace of asisys is shown
or removed. A check mark (√) after the menu command shows that the
tool bar is visible.

Fig. 6.24: Tool bar with icon buttons

'Options''Statusbar'
With this command the status bar at the bottom is shown or removed. A
check mark (√) after the menu command shows that the status bar is
visible.

Fig. 6.25: Status bar with the current project file and the online status

Usually, the status bar displays the file of the current project. If a menu
command is selected, the status bar gives a brief description of the
function of the command as long as the mouse button is pressed.

If this command is not the right one, you can move the mouse cursor
away and release the mouse button.

page 6-24 manual ecolog asi system


'Options’’Declarations as Tables'
All declarations can be displayed either in normal text mode or in table
mode. With this command you switch between text and table.

'Options''Font'
With this command you choose the font for all asisys editors. The size
of the font is the base unit for all drawing operations. This is why the
selection of a bigger font size enlarges the display and also the printout
of any editor in asisys.

'Options’‘Colors’
With this command you can edit the colour settings of asisys. You can
set the colour of the Line Number fields, of Breakpoint Positions, of an
Active Breakpoint, of the Current Position, of the Passed Position or of
the Monitoring of BOOL Values.

After choosing one of these menu items, the standard windows dialogue
for editing colours opens.

‘Options’ ‘Position Mark’


Under this menu command you can choose whether you want your
current selection to be displayed as a Dotted Rectangle, a Lined
Rectangle, or a Filled Rectangle.

‘Options’ ‘Monitoring’
Values of variables of type BYTE, WORD or DWORD can be displayed
either decimal, hexadecimal or binary.

6.6 Arranging windows

For arranging your asisys windows, you have the choice among four
different commands, all located under the topic 'Window'.

'Window''Tile vertical'
With this command, all opened windows are arranged side by side, so
that they do not overlap and cover the whole workspace. Vertical is
preferred.

'Window''Tile horizontal'
With this command, all opened windows are arranged one upon another,
so that they do not overlap and cover the whole workspace. Horizontal is
preferred.

'Window''cascade'
All opened windows are arranged in a cascade.

'Window''Arrange Symbols'
All iconized windows are arranged in a row at the bottom of the
workspace of the main window.

‘Window’’Close All’
All opened windows are closed with this command.

manual ecolog asi system page 6-25


'Window'‘Messages’
After choosing this command, the message window opens with the last
compilation messages. By clicking on a certain message, you can switch
to the window with the POU to which the message refers. If you have
clicked on an error, the line in which the error occurred is displayed in
blue.

'Window'‘Compare Projects’
With this command you can compare the opened project with another
project. For example, if you want to save an object and are not sure
where you have made changes since the last saving, you can compare
the project to itself.

After choosing the command, the standard windows dialogue for opening
projects appears. Select the project you want to compare the current
project with. By pressing the OK button a window opens in which the
result of the comparison is displayed. All POUs of the selected project
are listed and after each POU you can find the changes of this POU in
brackets. Five different messages are possible:

• „Unchanged“: The POU is the same as in the current POU.

• „Deleted“: The POU does not exist in the current POU.

• „Implementation changed“: The implementation part of the current


POU is different from the compared POU.

• „Interface changed“: The declaration part of the current POU is


different from the compared POU.

• „Interface and Implementation changed“: The declaration part and the


interface of the current POU is different from the
compared POU.

'Window' ‘PLC Configuration’


After choosing this command, the editor for configuring your controller
opens (see chapter 5.).

'Window’‘Global Variables’
After choosing this command, the window for editing global variables
opens (see chapter 7).

‘Window’’Variable Configuration’
After choosing this command, the window for editing variable
configurations opens (see chapter 7).

'Window'‘Library Manager’
After choosing this command, the library manager opens (see chapter 7).

'Window'‘Watch Variables’
After choosing this command, the watch window opens (see chapter 7).

'Window'‘Sampling Trace’
After choosing this command, the window for defining the sampling trace
opens (see chapter 7).

page 6-26 manual ecolog asi system


6.7 Help!

If you have any questions on how to use asisys or on the language


elements of IEC 1131-3, consult the asisys online help. There you will
find all the information of this handbook. You can use the Help in two
different ways.

The <F1> key always opens the help dialogue and, if possible, gives you
help with the actually selected topic (keyword, menu item, dialogue etc.).

The asisys online help works like most Windows online help. So if you
are experienced with Windows programs, skip the following page.

'Help''Contents'
With this command you enter the title page of the asisys online help. By
clicking with your mouse on a green and underlined catchword, a new
section in the Help is opened where this catchword is explained. Just a
few clicks with your mouse, and you should be able to get any desired
information.

In the help content window there are 4 buttons to move in the help
pages:

• Content opens the main page of the help

• Search opens a search dialogue (see next section)

• Back opens the page before

'Help''Search'
You can also search for a special catchword. If you are already in the
Help, you can use the button 'Search' for opening the search dialogue.

At the top of the search dialogue, there is a list of all catchwords of the
Help. Select the desired catchword (or type it in the line at the top of the
list), and press the button 'list subjects'. In the field below a list appears
with all subjects where the catchword is used. Select one of these
subjects and press the button 'Go to' to switch to the proper page of the
Help.

Context sensitive Help


You can open a required help page directly by marking the notion and
then press the <Ctrl>+<F1> buttons. After that, the help page will be
opened in which the notion is found. If the notion could not be found, the
search dialogue will be opened.

manual ecolog asi system page 6-27


page 6-28 manual ecolog asi system
7. The editors of asisys

7.1. The declaration editor

All language editors of asisys consist of a declaration part and a body.


These are separated by a divider. To shift the divider, click on the divider
and move it with your mouse while holding the mouse button pressed.

KEYWORDS
Keywords are written with capital letters in all asisys editors.

Declaration part
In the declaration part, all variables are declared which are only used in
this POU. The declaration syntax is the standard syntax of the IEC1131-
3.

Example of a correct variable declaration in a asisys editor:

Fig. 7.1. Declaration editor

Input variables
Between the keywords VAR_INPUT and END_VAR all variables are
declared which can be used as input variables, i.e. their values can be
set at the call.

Output variables
Between the keywords VAR_OUTPUT and END_VAR, all output
variables are declared. They are accessible within the calling POU.

Local variables
Between the keywords VAR and END_VAR, all local variables are
declared. These variables cannot be used outside the POU where they
are declared.

'Insert' 'Declaration Keyword' or


'Insert' 'Type'
Under the menu point 'Insert' you find the commands 'Declaration
Keywords...' and 'Type...'. If you use one of these commands, you get a
list of all allowed keywordsor a list of all allowed types. If you click on
one keyword, it is automatically inserted at the cursor position.

manual ecolog asi system page 7-1


asisys supports the following elementary data types:

BOOL (8 Bit), INT (16 Bit), DINT (32 Bit), STRING (variable length),
BYTE (8 Bit), WORD (16 Bit), DWORD (32 Bit), TIME (16 Bit).

In addition to this, asisys supports one, two, and three dimensional


arrays. The syntax of a two-dimensional array is as follows:

<array name>:ARRAY [<lb1>..<ub1>,<lb2>..<ub2>] OF <elem. Type>.

lb1, lb2 denote the lower borders of the array, ub1, ub2, the upper
borders.

Example:

pack_of_cards: ARRAY [1..13, 1..4] OF INT;

The short cut expansion feature


In offline mode quitting a line with <Ctrl>+<Enter> activates the short cut
expansion feature of the declaration editors. The following short cuts are
implemented when entering declarations:

All but the last identifiers of a line become the variable names of the
declaration. The type of the declaration is determined by the last
identifier of the line

• B or BOOL BOOL

• I or INT INT

• S or STRING STRING

If no type was determined by the last rule, the type is BOOL and the last
identifier is not used as type (first example).

• Any integer value becomes an initial value or a string length


depending on the type of the declaration (second and third example).

• An address (%IX1.1.3) is expanded to an AT ... modifier (fourth


example).

• Any text following a semicolon (;) becomes a comment (third and


fourth example).

• All other characters in the line are ignored (e.g. the exclamation mark
in the last example).

page7-2 manual ecolog asi system


Examples:

1. A
A: BOOL;

2. ABI2
A, B: INT := 2;

3. ST S 2; This is a string
ST: STRING(2); (* This is a string *)

4. X %MB12 I 5; new value


X AT %MB12: INT := 5; (* new value *)

5. B !
B: BOOL;

Line numbers in the declaration


editor
In offline mode a single click on a certain line number marks the whole
line.

In online mode a single click on a certain line number expands or


collapses the variable in this line provided that it was a structured
variable (structured variables can be recognized by the diamond in front
of them).

'Options''Declarations as Tables'
With this command, you get the declarations editor displayed as a table.
As for a card-index box, you can select a separate card for input
variables, output variables, local variables and input and output
variables.

For each variable you can make entries in the following fields:

Name: Insert the name of the variable

Address: Insert the address of the variable (AT-declaration)

Type: Insert the type of the variable (if the variable is the instance
of a function block, then insert the function block)

Initial: Insert the initial value of the variable (similar to the


assignment operator ":=").

Comment: Insert a comment in this field.

Enter new variables in the


declaration table
To enter a new variable declaration in the table, you have to execute
'Insert' 'New Declaration'. With this command, a new line is displayed
in the declarations editor. The line has the default inputs 'Name' in Name
and 'BOOL' in Type. You should change these values to the desired
ones.

manual ecolog asi system page 7-3


Example:

Fig. 7.2: Declarations as table

Address, Initial and Comment are optional fields. A correct variable


declaration just needs the name and the type of the variable. You can
switch between the representation as table and the textual representation
without any problem at any time. In online mode, there is no difference
between the two representations.

Switching between table and text mode is done with ‘Options’


‘Declarations as tables’.

The declaration editor in online


mode
In online mode, the declaration editor becomes a monitoring window.
Each line contains a variable, followed by an equality mark (=) and the
current value of the variable. If the variable is undefined, three question
marks (???) are displayed.

In front of each multi element variable is a diamond, for example:

A double mouse click on the diamond expands the variable, in the


following example the structure BAND3 and the substructure TIMER got
expanded:

If a variable is expanded, all its components are listed below. The


diamond in front of the variable becomes empty. Another double click on
the diamond collapses the variable and the diamond is full again.

A double click on a single element variable opens the dialogue for writing
variables. There, it is possible to change the values of variables.

The new value is displayed red and stays unchanged. When the
command 'Online''Write Values to PLC' is given, all changed values
are written to the PLC and they are displayed black again.

page7-4 manual ecolog asi system


With the command 'Online''Force Values to PLC' all changed variables
are forced to the new values until the command 'Online''Release Force'
is given.

7.2 The text editors

The text editors of asisys have the usual functions of Windows text
editors. The following menu commands are used in the text editors:

Fig. 7.3: Two opened windows with text POUs (Instruction List and Structured Text).

'Insert''Operator'
A list of all operators which are available in this language is displayed. If
one of the operators is selected and the list is closed with OK, the
selected operator is inserted at the current cursor position.

'Insert''Operand'
With this command you open the help dialogue with all defined variables
(Short Cut <F2>).

For getting the operand help dialogue in IL and ST, use ‘Insert’
‘Operand’.

manual ecolog asi system page 7-5


Fig. 7.4. Insert operand help dialogue. Last line shows the comment to
this variable.

'Insert''Function'
A list of all usable functions is displayed. You can select among standard
or user defined functions. If one of the functions is selected, and the
dialogue is closed with OK, the selected function is inserted at the
current cursor position.

'Insert''Function Block'
A list of all available function blocks is displayed. You can select among
standard or user defined function blocks. If one of the function blocks is
selected and the dialogue is closed with OK, the selected function block
is inserted at the current cursor position.

The text editors in online mode


The online features in the editors are the setting of breakpoints and
stepping. Together with monitoring, the user has the debug functions of a
modern high level language debugger .

In Online mode, the text editor window is devided by a vertical line into
two parts. On the left of the window is the normal program text. On the
right, the variables which are used on the left are displayed together with
their current values. In front of each multi element variable is a diamond.
By double mouse click on the diamond, the diamond gets expanded
collapsed (see Watch Window, section 7.12.).

‘Extras’ ‘Monitoring Options’


With this command you can configure your text editor window in online
mode. You can adjust which part of the text window should be reserved
for monitoring variables and the distance between two monitoring
variables in one line. The distance unit 1 is equal to the height of a line in
the chosen font.

page7-6 manual ecolog asi system


Fig. 7.5: Monitoring Options

Where can breakpoints be


inserted?
Breakpoints can be used in the simulation mode. Not every line in IL is a
breakpoint position. Breakpoint positions are those lines after which
values have changed or where execution forks. These are the positions
of interest.

In IL, we have the following possible breakpoint positions:

- At the beginning of a POU


- On each LD, LDN (or in the case, that a LD follows directly
on a label, then on the label)
- On each JMP, JMPC, JMPCN
- On each label
- On each CAL, CALC, CALCN
- On each RET, RETC, RETCN
- At the end of the POU

In Structured Text, we have the following breakpoint positions:

- On each assignment (:=)


- On each RETURN and EXIT-statement
- In lines, where conditions are evaluated
(WHILE, IF ELSIF, UNTIL)
- At the end of the POU

You can identify a breakpoint position by the colour of its number field.
The colour is a darker grey than that of the other lines (see fig. 7.6).

How do I set a breakpoint?


You set a breakpoint in simulation mode by clicking with the mouse on a
line number field. If it is a breakpoint position, its colour turns from dark
grey to blue. The breakpoint is instantly activated in the PLC.

Deleting breakpoints
A breakpoint is deleted by clicking on the line number field breakpoint of
the line where the breakpoint was set.

Setting and deleting breakpoints can also be done by using the menu
commands ('Online''Toggle Breakpoint') or by using the function key
F9.

What happens when execution


reaches a breakpoint?
When the execution of the user program is stopped at a breakpoint,
asisys shows the POU and the line within the POU where execution
stopped.

manual ecolog asi system page 7-7


You can continue execution of the user program by entering the
command 'Online''Run' (short cut F5). Besides this, you can step to the
next breakpoint position with the commands 'Online' 'Step over' (short
cut F10) and 'Step in' (short cut F8).

If one of the lines between the current line (line where execution was
stopped) and the next breakpoint position contains the call of a POU,
'Online' 'Step in' will in this POU. With 'Online' 'Step over' you stop
after calling the POU.

Fig. 7.6: IL editor with possible breakpoint positions (darker network


number fields)

7.2.1 The Instruction List editor

Instruction list is an assembler level language for PLCs. It is easy to


understand but the constructs are all very low level.

The Instruction List editor is a text editor. In the language IL, the
following operators and modifiers can be used:

Modifiers are:

C with JMP, CAL, RET: The instruction is only executed, if the result
of the previous expression was TRUE.

N with JMPC, CALC, RETC: The instruction is only executed, if the


result of the previous expression was FALSE.

N with AND, OR, XOR: Negation of the last operand (not of the stack
contents)

page7-8 manual ecolog asi system


The left parenthesis modifier "(" indicates that evaluation of the operator
is deferred until a right parenthesis operator ")" is encountered, e.g., the
sequence of instructions

AND( %IX1
OR %IX2
)

is interpreted as

result := result AND (%IX1 OR %IX2)

A complete list of the IL operators:

Operator Modifiers Semantics


LD N Set current result equal operand
ST N Store current result to operand location
S Set Boolean operand to TRUE, if and only if current result is TRUE
R Set Boolean operand to FALSE, if and only if current result is TRUE
AND N,( Bit-wise AND
OR N,( Bit-wise OR
XOR N,( Bit-wise exclusive OR
ADD ( Addition
SUB ( Subtraction
MUL ( Multiplication
DIV ( Division
GT ( >
GE ( >=
EQ ( =
NE ( <>
LE ( <=
LT ( <
JMP C,N Jump to label
CAL C,N Call function block
RET C,N Return from called function block
) Evaluate deferred operation

A listing of all IEC operators can be found in the appendix.

Example of an IL-program using some modifiers:

LD TRUE (* Load TRUE into the accu *)


ANDN BOOL1 (* execute AND with the negated value *)

manual ecolog asi system page 7-9


(* of the variable BOOL1 *)
JMPC end (* if the result was TRUE, jump *)
(* to the label "end" *)

LDN BOOL2 (* Store the negated value of *)


ST ERG (* BOOL2 to ERG *)
end:
LD BOOL2 (* Store the value of *)
ST ERG (* BOOL2 to ERG *)

Flow control
In the simulation mode, flow control in IL shows the value of the
accumulator in every line which was performed.

With the command ‘Online’ ‘Display Flow Control’, an additional field


is inserted on the left of the window next to the line number field. This
field contains the value of the accumulator at the last instance this line
was executed. You can distinguish between lines which were executed at
the last PLC cycle and lines which were not executed by the colour of the
line number field of the breakpoint positions (default for executed lines:
green).

Note: Only the active window shows a Flow Control. Click somewhere
into your IL editor window to make it active.

7.2.2 The Structured Text editor

Structured text is the high level language of the IEC 1131-3. It is


somehow similar to PASCAL, but people who know C should also have
no problems to understand the language.

The following definitions are copied from the IEC 1131-3 standard. If you
are used to high level programming languages, just have a look at the
examples and you will be fine.

The language Structured Text is designed for structured programming,


i.e. ST offers certain structures for the programming of often used
constructs such as loops or conditional expressions. The advantage is
less probability of bugs and better readability of the program.

Let us for example compare two program sequences, one written in ST


the other in IL, both doing the same:

page7-10 manual ecolog asi system


A loop for computing powers of 2 in IL:

loop:
LD Counter
EQ 0
JMPC end

LD Var1
MUL 2
ST Var1

LD Counter
SUB 1
ST Counter
JMP loop

end:
LD Var1
ST Result

The same loop programmed in ST would result in:

WHILE Counter <> 0 DO


Var1 := Var1 * 2;
Counter := Counter - 1;
END_WHILE

Result := Var1;

Obviously, the loop in ST is shorter and easier to understand. ST has a


big advantage over the other languages when you have to write a
program which needs a lot of execution control (if ... then, while, for).

Expressions
An expression is a construct, that returns a value after execution.

Expressions are composed of operators and operands. An operand is a


literal, a variable, a function invocation or another expression.

Evaluation of expressions
The evaluation of an expression consists of applying the operators in a
sequence defined by the operator precedence. The operator with the
highest precedence in an expression is applied first, followed by the
operator of the next lower precedence etc., until evaluation is complete.

Operators of equal precedence are evaluated from left to right.

Example: If A,B,C,D are INT variables with values 1,2,3,4, then

A + B - C * ABS(D)

evaluates to -9

(A + B - C) * ABS(D)

evaluates to 0

manual ecolog asi system page 7-11


List of ST operators:

Operation Symbol Precedence


Parenthesis ( Expression ) HIGHEST
Function evaluation Function name ( argument list)
Negation, Complement - NOT
Multiply, Divide, Modulo * / MOD
AddSubtract + -
Comparison < > <= >=
Equality, Inequality = <>
Boolean AND AND
Boolean XOR XOR
Boolean OR OR LOWEST

page7-12 manual ecolog asi system


List of ST statements:

Statement type Example


Assignment A:=B;
CV := CV + 1;
C:=SIN(X);
Function block CMD_TMR (IN := %IX5, PT := 300);
invocation and FB A:=CMD_TMR.Q
output usage
RETURN RETURN;
IF D := B * B;
IF D < 0 THEN
C := A;
ELSIF D = 0 THEN
C := B;
ELSE
C := D;
END_IF;
CASE CASE INT1 OF
1: BOOL1 := TRUE;
2: BOOL2 := TRUE;
ELSE BOOL1 := FALSE;
BOOL2 := FALSE;
END_CASE;
FOR J:=101;
FOR I := 1 TO 100 BY 2 DO
IF ARR[I] = 70 THEN
J := I;
EXIT;
END_IF;
END_FOR;
WHILE J := 1;
WHILE J <= 100 AND ARR[J] <> 70 DO
J := J + 2;
END_WHILE;
REPEAT J := -1;
REPEAT
J:=J+2;
UNTIL J = 101 OR ARR[J] = 70
END_REPEAT;
EXIT EXIT;
Empty Statement ;

The assignment operator


On the left of an assignment is an operand (variable, address) which is
assigned the value of the expression on the right. Example:

Syntax
<Operand> := <Expression>;

manual ecolog asi system page 7-13


Meaning
The result of expression is assigned to operand.

Example
Var1 := Var2 * 10;

The invocation of a function block


A function block is called by simply writing the name of the instance of
the function block. You can assign values to the input parameter of the
function block by just writing the assignments enclosed by brackets. The
assignment of the inputs is optional, the order of the assignments is not
relevant.

Syntax
<Instance_Name> (Input1 := <Operand>, ... ,Inputn := <Operand>);

Meaning
Call the function block instance named ‘Instance_Name’. Before calling,
assign the Operands to Inputs.

Example
In the following example a timer is called with assignments for the
parameters IN and PT. After that, the resulting value Q is assigned to the
variable A.

The resulting value Q of the function block is addressed by writing the


name of the instance of the function block, then by writing a point and
the name of the variable.

CMD_TMR (IN := %IX5, PT := 300);


A := CMD_TMR.Q;

The RETURN statement


When execution comes to a "RETURN" statement, the actually executed
POU is left.

Syntax
RETURN;

Meaning
Leave the POU at this point and return to the location where it was
called.

Example
The following example shows the first statement of a function which
needs a positive input variable var1.

func := FALSE;

IF var1 < 0 THEN


RETURN;
END_IF;

The IF statement
The IFstatement allows the execution of some expressions depending on
a certain condition.

page7-14 manual ecolog asi system


Syntax
IF <condition> THEN
<statement1>;
ELSIF <condition2> THEN
<statement2> ;
.
.
ELSIF <condition_n> THEN
<statement_n>;
ELSE
<statement_n+1>;
END_IF;

The ELSIF branches are optional. The ELSE branch is also optional.

Meaning
If ‘condition’ is TRUE, then execute statement1. If contition1 is FALSE,
but condition2 is TRUE, then else execute statement2 and so on. If none
of the conditions is TRUE, statement_n+1 is executed.

Example
IF temp < 17 THEN
heating_on := TRUE;
ELSE
heating_on := FALSE;
END_IF;

The heating is turned on if the temperature falls below 17°, otherwise it


stays off. The ELSE branch is optional. You can combine several
conditions by using ELSIF.

The CASE statement


With a CASE statement one can combine several conditional statements
with the same conditional variable to one construct.

Syntax
CASE <Var1> OF
<value 1>:
<statement 1>;
<value 2>:
<statement 2>;
...
<value n>:
<statement n>;
ELSE
<ELSE-statement>;
END_CASE;

The ELSE is optional. Value 1 to Value n have to be constants of the


type of Var1. All types except strings and BOOL are allowed.

Meaning
If the value of <Var1> is <value i>, then the statement <statement i> is
executed. IF <Var1> has none of the given values, then the <ELSE-
statement> is executed.

manual ecolog asi system page 7-15


If several values have the same statement, these values can be
combined, separated by commas.

Example
CASE INT1 OF
1, 5: BOOL1 := TRUE;
BOOL3 := FALSE;
2: BOOL2 := FALSE;
BOOL3 := TRUE;
ELSE
BOOL1 := NOT BOOL1;
BOOL2 := BOOL1 OR BOOL2;
END_CASE;

The FOR loop


If a statement has to be repeated several times, you can use loops
instead of jumps. ST offers three different kinds of loops. The FOR
statement is used, if the number of iterations can be determined in
advance; otherwise, the WHILE or REPEAT constructs are used.

Syntax
FOR <Index_Var> := <Const1> TO <Const2> BY <Const3> DO
<Statements>;
END_FOR;

Index must be a Variable of an ANY_INT type, the consts are integer


constants.

Meaning
Index_Var is initialized with Const1. After the keyword TO the upper
border of the Index_Var is determined. The loop is left when Index_ is
greater than this Const2.

After the keyword BY the increment of the counter is determined. After


each execution of <Statements> Index_Varin is incremented by this
value. The default increment is 1, for this reason it is not necessary to
write "BY 1" in our example below.

The keyword DO is followed by the statements which should be


executed. After each execution of statements, it is checked whether
Index_Var is still less equal Const3.

The keyword END_FOR finishes the FOR loop.

Example
Using the FOR loop, the upper example for computing powers of 2 would
be as follows:

FOR Counter := 1 TO 5 BY 1 DO
Var1 := Var1 * 2;
END_FOR;

Result := Var1;

page7-16 manual ecolog asi system


Consider that the variable Var1 is initialized with the value 1. After the
execution of the FOR statement it will have the value 32.

Note: Loops are a very dangerous construct. It is very easy to program


endless loops. To encounter such errors, run your program in simulation
mode and asisys will show you where an endless loop was programmed.
Endless loop means, Index_Var never reaches Const3. Imagine a loop
where Index_Var is to be incremented by 1 and one of the statements
decrements it by 1.

The WHILE loop


The WHILE statement causes the sequence of statements up to the
END_WHILE keyword to be executed repeatedly until the associated
Boolean expression is FALSE. If the expression is initially FALSE, then
the group of expressions is not executed at all.

Syntax
WHILE <Condition> DO
<statements>;
END_WHILE;

Meaning
As long as condition is TRUE, statements are executed.

Example
WHILE Counter <> 0 DO
Var1 := Var1 * 2;
Counter := Counter - 1;
END_WHILE

The keyword WHILE is followed by the condition for the execution, in our
case the Counter is compared with 0. As long as the counter is unequal
to 0, all statements between DO and END_WHILE are being executed.

Note: It is your job to make sure that the <condition> becomes FALSE
sometimes. If not, you have a loop which will never be left. In asisys
simulation you can easily find the location of such a loop. Simulation
stops and tells you WATCHDOG error. With the call stack you get the
location where the execution has been interrupted. The watchdog in the
AS-i Controller will stop the program execution!

The REPEAT loop


A REPEAT loop is a WHILE loop where the condition is checked at the
end. The end condition of the REPEAT loop is evaluated after the
execution of the statements, i.e. even if the condition is initially FALSE,
the statements are executed once.

Syntax
REPEAT
<statements>
UNTIL
<condition>
END_REPEAT;

manual ecolog asi system page 7-17


Meaning
The statement list between the keywords REPEAT and UNTIL is
executed as long as the condition after UNTIL is evaluated to FALSE.

Example
REPEAT
Var1 := Var1*2;
Counter := Counter-1;
UNTIL
Counter=0
END_REPEAT;

Note: The programmer has to make sure that the REPEAT loop is not
repeated infinitely. Therefore, he has to write a statement in which the
condition is updated, for example a counter has to be updated by a
special statement in the statement list. Once again, use simulation for
checking for endless loops.

The EXIT statement


An EXIT statement located in a loop causes the termination of the most
inner loop despite the condition.

Syntax
EXIT;

Meaning
Leave the most inner loop at this point.

Example
REPEAT
Var1 := Var1 * 2;
Counter := Counter - 1;
IF Var1 > 1000000 THEN
EXIT;
END_IF;
UNTIL
Counter = 0
END_REPEAT;

Flow control
In ST flow control shows the lines which were executed at the last PLC
cycle.

With the command ‘Online’ ‘Display Flow Control’, the flow control is
activated when simulation mode is selected. The line number fields of
the executed lines get a different colour (default: green).

Note: Only the active window shows a Flow Control. Click somewhere
into your ST editor window to make it active.

7.2.3 The S5-IL editor

page7-18 manual ecolog asi system


The S5-IL editor in asisys provides the following options:

• Programming in S5-IL in the way many people are used to

• Transfer of existing STEP5 projects (S5D and SEQ import)

• Conversion of STEP5 blocks to IEC IL/LD/FBD

• Comparison of the "old" STEP5 block and the "new" IEC POU, thus
simpler learning of IEC programming

• S5 projects are prepared to be transferred to a plc which is not from


Siemens.

The S5-IL editor


STEP5 is the programming language for the SIMATIC-S5 plc from
Siemens. As opposed to all languages defined in IEC 1131-3 STEP5 is
in principle a machine language which can only directly run on S5 or
compatible plcs. For all other plc types STEP5 must first be translated
into the machine language of the target plc.

In asisys this is done as follows:

• First, the STEP5 code is analysed and translated into the asisys
intermediate language.
• From this language the code for the controller is generated.
• From this intermediate code conversion to one of the IEC languages
IL, FBD, LD takes place.

Not all STEP5 commands are allowed, only those commands which can
be converted to IEC 1131-3. During the translation or conversion of such
commands the error message "Command cannot be converted o IEC
1131-3“ is indicated.

In the following sections the Siemens programming language is called


STEP5 and the corresponding asisys language S5-IL.

Introduction into S5-IL


An introduction into STEP5 programming would go beyond the scope of
this manual. This is why only the differences between STEP5 and S5-IL
can be explained. For an introduction into the language STEP5, way of
programming and syntax we refer you to the excellent specialist
literature which can be obtained from book shops.

STEP5 commands
In STEP5 IL, LD and FBD are only different ways of looking at one and
the same code. In principle, STEP5 IL is more powerful than LD and
FBD as regards representation. Each network which can be represented
in LD or FBD can be represented in IL but not necessarily vice versa.

Variable names and STEP5


addresses
Since STEP5 is a machine language there are no real variables. It is
only possible to replace each operand identifier by a text which is more
or less meaningful.

manual ecolog asi system page 7-19


For example the input I0.0 can always be replaced by "emergency stop"
or "-YA#.-?“. The corresponding reference list can be available in several
formats, e.g. as a symbol list in a SEQ file which can be read easily.

Variable transfer to STEP5 blocks


Most STEP5 blocks have no interface as defined by a high-level
language. This means they have no input or output parameters.

Exceptions are the function blocks (FBs) which can have input and
output parameters (so-called formal parameters).

Some background information


The way the parameters are transferred is relatively unusual. This can be
best described as call-by-text at machine language level.

Since this is very time intensive and requires a complex processor it is


not possible to execute all instructions as formal parameters.

This is why FBs with parameters are only seldom used. In most cases
they are only available as firmware and are used to trigger modules for
positioning, control or communication.

Structuring in STEP5
Consequently, STEP5 programs are not structured as defined by a high-
level programming language. The means of structuring used are
comparable with those of the former BASIC dialects:

Sub-programs have no parameters and are called with simple jump


operations and left by means of return operations.

Loal variables in STEP5


On no account do STEP5 blocks have local variables. Each STEP5
block can access each operand so that a symbol list can be seen as a
preliminary stage to a global variable list.

System commands in STEP5


In function blocks all operations are allowed incl. the system commands.
In all other blocks only a subset of all operations is allowed.

Accumulators in STEP5
S5 plcs provide two asynchronous logic operation paths for bit and
(double) word processing. These logic operation paths are more or less
independent of each other.

Common points exist for example for comparison operations. S5 plcs


also have more than one accumulator for (double) word operands. There
are operations which influence the contents of one, two, three, four
accumulators or no accumulator at all or which depend on them.

asisys S5-IL commands


The commands supported by S5-IL do not cover all STEP5 commands,
e.g. the system commands are missing.

The following rules of thumb apply to the supported commands:

• Operations which are allowed outside FBs in STEP5 are normally


supported.

page7-20 manual ecolog asi system


Operations which are only allowed in FBs in STEP5 are normally
not supported.

• Operations which are supported by all S5 CPUs are in general


supported.

Operations which are not supported by all (only by some) S5 CPUs


are normally not supported.

• Networks (or code sequences) which can be represented


graphically as ladder diagram or function block diagram by
STEP5 programming systems are normally supported. Exception:
characteristics of timers such as reset inputs, time value BCD format
and retriggering ("release") which have no equivalent in IEC 1131-3
are normally not supported.

Networks (or code sequences) which cannot be represented


graphically as ladder diagram or function block diagram by STEP5
programming systems but only as instruction list are normally not
supported.

• Operands are entered according to the STEP5 syntax, e.g. "I 1.12.0"
for input bit 0 in slave 12 of the master 1. Symbolic operands are
preceded by a hyphen.

Note!
The English and French instructions in S5-IL do not correspond to the
syntax of the German instructions. In the English version outputs, for
example, are designated with Q and in the German verison with A for
Ausgang. This is why S5-IL POUs created with the German asisys
version cannot be translated by means of the English or French version!
These POUs must first be converted to one of the IEC1131-3
programming languages.

manual ecolog asi system page 7-21


Supported commands
The following commands are supported.

A, AN, O, ON, S, R, = with bit operands: I, Q, F, D


A, AN, O, ON with operands: T, C
S, R with operands: C
SU, RU, T, TN with operands: I, Q, F, D
O, O(, A(, )
L, T with operand types: I, Q, F, T, C and operand sizes: B, W,
D, L
L with constant formats: DH, KB, KF, KH, KM, KT, KC
SP, SD, SF with operands: T
CU, CD with operands: C
+, -, X, : with operands: F
+, - with operands: D
!=, ><, >, <, >=, <= with operands: F, D
ADD with operands: BN, KF
JU, JC with operands: PB, FB (without parameter), SB
C with operands: DB
BE, BEU, BEC
BLD, NOP, ***
AW, OW, XOW
CFW, CSW
SLW, SRW, RRD, RLD
JU=, JC=
TAK

page7-22 manual ecolog asi system


Commands which are not
supported
All commands which are not listed on the preceding page are not
supported.

A, AN, O, ON, S, R, = with bit operands S, timer- and counter bits


(T0.0, C0.0)
L, T with operand types S, Q
L with constant formats KY, KS
LD with operands T, C
SE, SS, R, FR with operand T
FR with operand C
All formal operand operations
JU, JC with operand OB
BA, BAB with operand FX
G with operand DB
JZ=, JN=, JO=, JS=, JP=, JM=,
JR
IA, RA
D, I
DO with operands DW, MW, BS
LIR, TIR,

manual ecolog asi system page 7-23


7.3 The graphical editors

In this section the common features of the two graphic oriented


languages LD (Ladder Diagram) and FBD (Function Block Diagram) are
described.

Networks
POUs written in FBD or LD are build up of networks. A network is a
collection of blocks and operands connected by lines. The execution of
the POU starts at the first network and if no jumps are programmed goes
from network X to network X+1.

Labels
A label field which can be empty is associated with each network. To
enter a label, move your cursor to the first line of the network and write
the label text. A label must be followed by a colon.

Comments in networks
Each network can contain a comment. When a FBD or LD window is
active, you can change the maximum number of lines for a comment
with the 'Extras' 'Options' menu. The default number of comment lines
is four. There is also the possibility to adjust a minimum number of lines
in each network for making comments.

If this minimum number is for example adjusted to 2, each network


contains two empty comment lines after the label. The default for this
option is 0, which has the advantage that more networks can be seen on
the screen.

If the minimum number of lines for comments is more than 0, then you
can insert or edit a comment by a simple mouse click on the comment
line. Otherwise you have to perform an 'Insert' 'Comment'. Comments
are displayed in grey in contrast to the program code.

Insert networks
To insert a new network, choose 'Insert' 'Network (before)', if you want
to insert the new network before the current network, or 'Insert' 'Network
(after)', if you want to insert the network after the current network.

The current network


The current network is the network with the dotted rectangle under the
network number. The current network is selected either by mouse click or
by using the cursor keys. For selecting more than one network, press the
<shift>-key. The menu commands 'Edit' 'Cut', 'Edit' 'Copy', 'Edit'
'Paste' and 'Edit' 'Delete' now work on the selected networks.

Graphical editors in online mode


In FBD and LD, breakpoints can only be set on networks (and also only
in simulation mode). If a breakpoint is set on a network, the network
number field is displayed blue. Execution stops before the network is
executed. The colour of the network number field changes to red.
Stepping is performed from network to network.

Flow control is started with the command ‘Online’ ‘Display Flow


Control’. With flow control you can see all values that are transmitted in
a network. If a link transmits a non Boolean value, an additional field is

page7-24 manual ecolog asi system


inserted in which the value is displayed. If the link transmits Boolean
values, this link is displayed blue, if the value is TRUE.

manual ecolog asi system page 7-25


7.3.1 The Function Block Diagram editor

A POU written in FBD:

Fig. 7.7: A POU written in FBD

The FBD editor is a graphical editor. It works with lists of networks. A


network is a connected structure which consists of logical and
arithmetical expressions, function blocks, jumps and return statements
(see fig. 7.7).

Cursor positions in networks, keyboard interface

Cursor positions
Any text is a possible cursor position. Text selection is marked by a blue
background colour.

page7-26 manual ecolog asi system


Otherwise, cursor positions are remarked by a dotted rectangle. Below
you can see a list of all possible cursor positions:

1) Any text (possible cursor positions are surrounded by a black


frame):

2) Any input:

3) Any operator, function or function block:

4) Outputs if an assignment or a jump is following:

5) The spot above an assignment, a jump or a return:

6) Right from the last object of each network ("last cursor position", this
is also the cursor position, if a new network is selected):

7) The spot right in front of an assignment:

How to set the cursor


The cursor can be set by a mouse click or by using the cursor keys. By
using the cursor keys the next cursor position in the desired direction is
selected. If you do so, any possible cursor position can be reached. If the
last cursor position is selected, the cursor can be moved with 'cursor up'
and 'cursor down' to the last cursor position of the preceding or the
following network.

manual ecolog asi system page 7-27


Note:
To determine where the valid cursor positions are it is recommended to
use the keyboard interface when you start to work with the asisys FBD.

Inserting elements
An empty network contains only one operand TRUE. By clicking to the
right of this TRUE, the last cursor position is selected.

Inserting an assignment a jump or


a return
At the cursor positions 2), 4), 5) and 6) it is possible to insert
assignments, jumps and returns. Therefore, you have to select a correct
cursor position and perform 'Insert' 'Assignment', 'Insert' 'Jump' or
'Insert''Return'.

Depending on the selected position, the insertion takes place right in


front of the selected input, right behind the selected output, right in front
of the selected line cross or at the end of the network.

If an assignment is inserted, the default text "Return" appears. This text


is selected and can be changed to the desired text.

If a jump is inserted, the default text "Label" appears. This text is


selected and can be changed to the desired text.

Inserting an operator
At the cursor positions 2), 4), 5) (not possible, if an assignment lies
below) and 6) it is possible to insert operators. Therefore you have to
select a proper cursor position and perform 'Insert' 'Operator'.

The inserted operator is always an AND operator. Like any other


operator, this can be changed by selecting and typing the desired new
operator. With <F2> you get a list of all possible operators. If the new
operator has a greater minimum number of inputs, the additional inputs
will be inserted. If the new operator has a smaller maximum number of
inputs, the last inputs with the whole connected branch will be deleted.

If there is a branch on the left of the inserted operator, this will be


connected with the first input.

If there is a branch on the right of the inserted operator, this will be


connected with the output. All new inputs with no connection will be
connected with TRUE. This TRUE can be changed to the desired value
like any other text in the network.

At the cursor position 2) the selected operator, function or function block


will be changed to the AND operator. The number of the inputs is at
least 2. All old inputs more than two are not removed.

Inserting functions or function


blocks
At the cursor positions 2), 4), 5) (not possible, if an assignment lies
below) and 6) it is possible to insert a function or a function block.
Therefore you have to select a proper cursor position and perform
'Insert' 'Function', or 'Insert' 'Function Block'. A dialogue opens
where the desired function or function block can be selected from a list.

page7-28 manual ecolog asi system


The insertion is performed in the same way as the insertion of operators,
including the attaching to the inputs and outputs. If there is a branch to
the right of an inserted function block, this will be connected to the first
output, the other outputs are not connected anywhere.

Inserting an input
Many operators can have a various number of operands (for example
ADD can have two or more inputs). To add an input to such an operator,
it is necessary to select an input of the operator or the operator itself.
Now perform 'Insert' 'Input'. If the selection was an input, the new input
will be inserted after the selected one. If it was an operator, the new input
will be the last input of the operator. The new input is connected with
TRUE. This value can be changed like any other text.

Inserting an output
For inserting an additional assignment to an existing assignment, select
the spot before the assignment variable, the line cross above the
assignment or an output right before the assignment.

Then perform 'Insert' 'Output'. If the selection was the line cross in front
of the assignment or an output, then the new assignment is inserted after
the old assignments. If the selection was the spot in front of the
assignment, the new assignment will be inserted above the selection.

The name of the variable is result and has to be changed to the real
variable name.

Negation of inputs
To negate an input or an output, select it and perform the command
'Extras''Negate'.

Set/Reset outputs
With the command ‘Extras’’Set/Reset’, you can define an output as Set
or Reset output.

Fig. 7.8: Set/Reset outputs

The Set output is set to TRUE, if the corresponding operator delivers


TRUE. The output retains the value TRUE, even if the operator delivers
FALSE.

The Reset output is set to FALSE, if the corresponding operator delivers


FALSE. The output retains the value FALSE, even if the operator
delivers TRUE.

Cut, copy, paste, delete


The commands for cut, copy, paste and delete can all be found under
the menu item 'Edit'.

manual ecolog asi system page 7-29


The possible cursor positions for cut, delete and paste are the positions
2), 3), 4), 5) and 6).

If a line cross is selected, the assignments, jumps or the return below will
be cut, deleted or copied.

If an operator, a function or a function block is selected, the selected


object and all inputs, except the first, will be cut, deleted or copied.

Otherwise, the branch to the left of the cursor will be cut, deleted or
copied.

After a part of the network was copied or cut, it is saved in the clipboard
and you can insert it as often as you like.

For pasting, you have to select a proper position. Valid positions for
pasting are inputs and outputs.

Now perform 'Edit' 'Input'. If the contents of the clipboard are an


operator, a function or a function block (remember that all input branches
except the first are in the clipboard, too), the branch to the left is
connected to the first input of the inserted element.

Otherwise, the whole branch to the left will be replaced by the contents
of the clipboard.

Note:
You can very easily change the order of the inputs connected to a box:
Select the first input and perform a 'Edit' 'Cut'. Then select the second
input and perform 'Edit' 'Paste'. The branch is now connected to the
second input.

The Function Block Diagram in


online mode
In FBD breakpoints can only be set on networks. If a breakpoint is set on
a network, the network number field is displayed blue. Execution stops
when reaching a network with breakpoint. In this case, the colour of the
network number field changes to red. Stepping is performed from
network to network.

The values of all variables used in the diagram are displayed in a text
field next to the variable. They are not the values the variable had after
the corresponding operation was executed, but after the controller cycle
was executed.

To obtain the intermediate result of each operation, start flow control and
every line will have a text field showing the value that ‘passed’ this line in
the last cycle. Boolean values are shown in blue (TRUE) and with black
(FALSE) lines.

page7-30 manual ecolog asi system


7.3.2 The Ladder Diagram editor

A POU written in LD:

Fig. 7.9: POU in LD

Cursor positions in LD
Below you can see a list of all possible cursor positions. Function block
and program calls are treated like contacts. Components with EN inputs
and components connected to them are treated as in the FBD editor.

1. Any text (possible cursor positions are surrounded by a black ellipse)

2. Each contact or function block

manual ecolog asi system page 7-31


3. Each coil

4. The link between coils and contacts.

The following menu commands are specific for the ladder diagram
editor.

'Insert''Contact'
With this command, a new contact is inserted in front of the selection.
The contact gets the default value TRUE. You can select this value and
change it to the desired variable or constant.

'Insert'''Parallel Contact'
Inserts a parallel contact below the selection in the ladder diagram editor.
If the selection is a coil or the link between coils and contacts, the new
contact is inserted in parallel to the whole contact network. The new
contact gets the default value TRUE. You can select this text and
change it to the correct variable or constant.

'Insert''Function Block'
A dialogue opens for selecting a function block or a program. You can
choose from standard POUs or user defined POUs.

The new POU is inserted equally to a new contact, the first input of the
new function block or program is connected to the input link, the first
output of the program is connected to the output link. These parameters
have to be of type BOOL. All other inputs and outputs get the default
value TRUE. You can select these default values and change them to
the correct variable, address or constant.

'Insert''Coil'
Inserts a coil in a ladder diagram. If the current selection is the whole
network, the coil is inserted below the last coil, if another coil is selected,
the new coil is inserted above the selected coil. This command cannot be
performed if the selection is a contact. The new coil gets the default
name "out". This name has to be changed.

LD-components with an enable


Input
If you want to use any given operator or POU-call in LD, you have to
insert a component with an EN-Input. Such a component is connected in
parallel to the coils. Starting with an EN component, you can develop the
network as in FBD. The commands for inserting at an existing EN
component are located under the menu item ‘Insert’ ‘Insert at blocks’.

page7-32 manual ecolog asi system


An operator, a function block or a function with an enable input behaves
like the same component without this special input with the difference
that the evaluation of this component is controlled by the enable input.
This input is connected to the link between coils and contacts. The
evaluation of the component starts when this link transmits the
information ON.

Once an enable component is introduced to the ladder diagram, a


network as in FBD can be developed starting with this component.

‘Insert’ ‘Operator with EN’


With this command an operator with enable input is inserted into a LD
network. The new operator is connected in parallel below the coils and is
labeled with AND. You can change this name to the desired one.

‘Insert’ ‘Function Block with EN’


After choosing this command a dialogue opens in which you can select if
you want to insert a standard function block or program or a self-defined
function block or program. Choose the desired component from the
proper list. After your selection close the dialogue with OK, and the new
component is inserted below the coils in parallel to them.

‘Insert’ ‘Function with EN’


After choosing this command a dialogue opens in which you can select if
you want to insert a standard function or a self-defined function. Choose
the desired component from the proper list. After your selection close the
dialogue with OK and the new function is inserted below the coils in
parallel to them.

‘Insert’ ‘Insert at Blocks’


With this command, you can connect a new component to an existing
component. The commands under this menu item are executable at the
same cursor positions as the corresponding commands in FBD (see
section 7.7.).

With input a new input is added to the component.

With output a new output is added to the component.

With operator a new operator is inserted at the component. The output of


the operator is connected to the selected input.

With assignment an assignment is inserted to the selected input or


output.

With function a dialogue opens to select a function from the list of self-
defined or standard functions. The new function is connected to selected
input.

With function block a dialogue opens to select a function block (or a


program) from the list of self-defined or standard functions (or
programs). The new function block is connected to selected input.

'Insert''Jump'
A jump can be inserted at the cursor positions 3) and 4). The jump is
inserted below the coils. The default target of the jump is "label". Change
this text to the desired text.

manual ecolog asi system page 7-33


The jump will be performed, if the input of the jump is in the state "On".

'Insert''Return'
A return can be inserted at the cursor positions 3) and 4). The return is
inserted below the coils.

If the input of the jump is in the state "On", the execution of the POU will
be interrupted at this network.

'Extras''Paste after'
With this command the contents of the clipboard are inserted on the right
of the selection, the output of the selection gets the input of the insertion.
This command can only be performed, if the contents of the clipboard
and the selection consist of contacts.

'Extras''Paste below'
With this command the content of the clipboard is inserted in parallel
below the selection. This command can only be performed, if the
contents of the clipboard and the selection consist of contacts.

'Extras''Paste above'
With this command the contents of the clipboard are inserted in parallel
above the selection. This command can only be performed, if the
contents of the clipboard and the selection consist of contacts.

'Extras''Negate'
With this command the contact or the coil at the current cursor position is
negated.

A slash ((/) or | / |) appears between the brackets of the coil or the


vertical lines of the contact. This command cannot be performed, if the
current cursor position is the link between the contacts and coils.

A negated coil copies the negated value of the left link to the associated
Boolean variable. A negated contact copies the value of the left link to
the right link, if the associated Boolean variable returns the value
FALSE.

‘Extras’‘Set/Reset’
With this command being performed on a normal (not negated) coil, you
get a set coil. A set coil never changes the value TRUE of the associated
Boolean variable. That is if the value of this variable was once changed
to TRUE, it stays TRUE. A set coil is indicated by „S“ in the coil symbol.

With this command being performed on a negated coil you get a reset
coil. A reset coil never changes the value FALSE of the associated
Boolean variable. That is if the value of this variable was once changed
to FALSE, it stays FALSE. A reset coil is indicated by „R“ in the coil
symbol.

With this command being performed on a set or a reset coil, the coil is
changed back to a normal or a negated coil.

LD in online mode
In online mode all links and all contacts and coils in the state "On" are
displayed blue. At the inputs and outputs of function blocks, the values of
the corresponding variables are displayed.

page7-34 manual ecolog asi system


Breakpoints can be set on networks. Stepping is performed from network
to network.

In LD, breakpoints can only be set on networks. If a breakpoint is set on


a network, the network number field is displayed blue. Execution stops,
when arriving at a network with breakpoint. In this case, the colour of the
network number field changes to red. Stepping is performed from
network to network.

manual ecolog asi system page 7-35


7.3.3 The Sequential Function Chart editor

A POU written in SFC:

Fig. 7.10: A POU in SFC and one of its actions

The Sequential Function Chart as programming language is briefly


described in chapter 2. The SFC editor has to support the SFC features.
The following menu commands are used for SFC.

Menu Insert
Under the menu 'Insert' new elements can be inserted into the program.
Therefore a selection has to be done.

Selections
A selection is indicated by a dotted rectangle. In the upper figure the
transition "Left“ in the PLC_PRG window is selected.

An element (a step, a transition or a jump) can be selected by moving


the mouse cursor on the element and pressing the left mouse button or
by using the cursor keys.

page7-36 manual ecolog asi system


<Shift> + click selects an area around the last selected element and the
new selected one.

The following commands can only be performed if the resulting diagram


conforms to the conventions of the language.

Step-Transition (before)
Inserts a step followed by a transition before the selected block. The
selected block must have a transition as predecessor.

Step-Transition (after)
Inserts a step and a transition after the first transition in the selected
block. The selected block must begin with a transition.

Transition-Step (before)
Inserts a transition and a step before the selected block. The selected
block must have a step as predecessor.

Transition-Step (after)
Inserts a transition and a step after the first step in the selected block.
The selected block must begin with a step.

Alternative Branch (right)


Inserts an alternative branch as the right branch of the selected block.
The selected block must begin and end with a transition. The new branch
consists of one transition.

Alternative Branch (left)


Inserts an alternative branch as the left branch of the selected block. The
selected block must begin and end with a transition. The new branch
consists of one transition.

Parallel Branch (right)


Inserts a parallel branch as the right branch of the selected block. The
selected block must begin and end with a step. The new branch consists
of one step.

Parallel Branch (left)


Inserts a parallel branch as the left branch of the selected block. The
selected block must begin and end with a step. The new branch consists
of one step.

Jump
Inserts a jump at the end of the branch with the selected block. The
branch must be an alternative branch.

Transition-Jump
Inserts a transition followed by a jump at the end of the selected branch.
The branch must be a parallel branch.

Menu Extras
The edit commands in the menu 'Extras' offer special editing options for
SFC such as inserting from the clipboard or zooming of SFC elements.

Paste Parallel (right)


Inserts the contents of the clipboard as the right parallel branch of the
selected block. Therefore the selected block must begin and end with a

manual ecolog asi system page 7-37


step. The contents of the clipboard must be a SFC block which begins
and ends with a step.

Paste after
Inserts the SFC block in the clipboard after the first step or transition of
the selected block (normal pasting inserts it before the selected block).
This is only done, if the resulting structure will be a syntactically correct
SFC structure.

Zoom Action/Transition
The action of the first step of the selected block or the transition body of
the first transition of the selected block is loaded to the editor. If the
action or transition body is empty, the language for programming has to
be chosen.

An action which is already programmed is indicated by a black triangle in


the upper left corner of the action box.

A transition with a transition body is indicated by a black triangle on the


left of the link at the location of the transition.

Clear Action/Transition
The action of the first step of the selected block or the transition body of
the first transition of the selected block is cleared.

The black triangle which indicates the presence of an action or transition


body is removed.

Step Attributes
To perform this command, you have to select a step. After choosing the
command a dialogue opens in which you can edit attributes of the
selected step:

Fig. 7.11: Dialogue for editing step attributes

You can make three different entries in the dialogue. In the field
Minimum time insert the minimum duration of processing the step. In the
filed Maximum time insert the maximum duration of processing this step.

page7-38 manual ecolog asi system


Note that the insertions have to be of type TIME. Therefore, use the
syntax as described in appendix C.

In the field ‘Comment’ you can insert a comment on the step. With
‘Extras’ ‘Options’ you can define whether the comments or the time
attributes are to be displayed in the SFC-editor. According to your
selection, you can find either the comment or the time attributes
displayed to the right of the step.

Fig. 7.12: Time attributes in SFC

Fig. 7.12 shows a SFC step in online mode. The step has been active for
9.5 s. The minimum time to be active for this step is 10 s, the maximum
time is 5 min.

SFC flags
When in SFC a step is active longer than defined in its attributes, some
special flags are set. To use the flags, you have to declare them in some
declaration editor. This can be done as an input variable as well as an
output variable.

SFCEnableLimit: This variable is of type BOOL. If it is TRUE,


exceeded time is recorded, if not it is ignored.

SFCInit: This variable is of type BOOL. If it is TRUE, the SFC


POU is reset to the Init step. The init step stays active
as long as this variable is TRUE.

SFCQuitError: A variable of type BOOL. As long as this variable is


TRUE, execution of the SFC-diagram is stopped. If the
variable is set to FALSE, all previous time durations in
the active steps are reset.

SFCError: This Boolean variable is set if the time limit has been
exceeded.

SFCErrorStep: This variable is of type STRING. If a time limit has


been exceeded, the name of the step which caused this
occurrence is stored in this variable.

SFCErrorPOU: This variable is of type STRING. If a time limit has


been exceeded, the name of the POU in which this
occurrence happend is stored in this variable.

If an exceeded time limit has been registered, no further exceeded time


limit is registered until the variable SFCError has been assigned the
value FALSE.

Time overview
After choosing this command, a window opens in which all time limits
defined in the currently active SFC window are displayed.

manual ecolog asi system page 7-39


Fig. 7.13: Time Limit Overview in SFC

In the Time Limit Overview all steps are displayed. If you have defined
time limits for a step, they are shown to the right of the step (the
minimum time in the middle, the maximum time on the right). You can
edit the time limits by clicking on the desired line and writing in the boxes
below the time list. By closing the window with OK, all changes in the
time limit overview are saved.

In fig. 7.13 all steps have an upper time limit of 5 min. Minimum_Time
has a minimum time limit of 3 s and a maximum time limit of 20 s.

Options
After choosing this command, a dialogue opens in which you can define
several options for your SFC POU.

Fig. 7.14: Dialogue for SFC options

page7-40 manual ecolog asi system


You can make three entries in the SFC options dialogue. In the field
‘Height of Steps’, you can indicate how high a step is to be drawn in
your SFC editor. The default is four lines in the chosen font. In the field
‘Width of Steps’ indicate the width with which a step is to be drawn in
your SFC editor.

In addition, you can set which information is to be displayed on a step.


You have three possibilities: you can either choose Nothing, Comment or
Time Limits. The comment and the time limits are displayed as set in
Step Attributes.

SFC in online mode


In online mode, the currently active steps are displayed in blue (see fig.
7.15). When you have selected the option in ‘Extras’ ‘Options’, the time
limits are displayed to the right of the steps. When the step is active, you
can read the duration of how long it has been active below the time
limits.

Breakpoints
With the command 'Online' 'Toggle Breakpoint' (or F9, <Shift> double
click), a breakpoint can be set on a step in simulation mode. Execution
stops when reaching a breakpoint and the step is coloured in blue.

If there are more than one active steps (execution is forked in parallel
branches), the step with the action to be executed next is indicated in
red.

'Online' 'Step Over' (or F10) performs stepping from step to step in
simulation mode.

You can step into the action of a step by activating 'Online' 'Step In' (or
F8). The debugging function for actions and transitions depends on the
language it is written in. There are no restrictions to POUs written in this
language.

manual ecolog asi system page 7-41


Fig. 7.15: SFC in online mode with active steps (Parallel1 and Parallel2).

7.4 plc configuration

The plc configuration depends on the hardware which is to be configured.


By means of the plc configuration asisys can check the correctness of
an IEC address and compute the corresponding address in the controller.
Please see chapter 5 for a detailed description of this subject.

7.5 Global variables

Edit global variables


With the menu command 'Window' 'Global Variables' you can define
or edit global variables. A window opens with a list of all previously
defined global variables. The editor for the global variables has the same
function as the editor for variable declarations.

page7-42 manual ecolog asi system


Global variables have to be declared between the keywords
VAR_GLOBAL and END_VAR. Global variables can be used in the
whole project.

‘Extras’ ‘Add List’


If you have declared a large number of global variables and you want to
improve the structure of your global variable list, you can open a new list
with the command ‘Extras’ ‘New List’. Each new list has to start with the
keyword VAR_GLOBAL and end with the keyword VAR_END.

If you have made a number of lists, you can load the previous list with
the command ‘Extras’ ‘Previous List’. With ‘Extras’ ‘Previous List’,
the next list is loaded, with ‘Extras’ ‘Delete List’, the currently loaded list
is deleted.

7.6 Library manager

The library manager of asisys:

Fig. 7.16: Library manager

In the figure above you can see the parameters of the POU CTU of the
standard library.

Standard library
The standard library 'st8051.lib' is part of asisys. This library includes the
functions and function blocks which are described in the IEC1131-3 as

manual ecolog asi system page 7-43


standard POUs (e.g. timers, string functions etc.). If you link this library
to your project, you can use all this POUs.

User defined libraries


If a project is finished and compiled with no errors occurring, then it can
be saved as a library by using the command 'File' 'Save as Library'.
The project itself has not changed. A self-defined library can be used like
the standard library.

How to link a library


If the library manager is opened (with 'Window''Library Manager'), you
can link a library to your project ('Insert' 'Additional Library'). Now you
can use the POUs of the library like self-defined POUs.

Using the library manager


The window of the library manager is divided into four parts (see fig.
7.16). In the upper left corner you can see a list of all libraries linked to
the project. In the bottom left corner you can find a list of all POUs of the
selected library. On the right, there is the interface of the selected POU,
above in the same notation as in the declaration editor and below in a
black box representation.

How to delete a library


With the command 'Edit' 'Delete' you can delete a library from your
project.

7.7 Watch window

The watch window is a special window to display the values of variables.


The watch window enables to write defined values to the variables (Write
Receipt). It is also possible to read actual variable values into the watch
list (Read Receipt).

Watch window in off-line mode


In offline mode, the watch window is a text editor where names of
variables can be entered. The window is opened with the command
'Window' 'Watch Variables' (see fig. 7.17). Now you can insert a new
watch list with the command ‘Insert’’New Watch List’.

Fig. 7.17: Watch window in offline mode

The easiest way to insert variables into the watch list is to press <F2>
and then select the required variables (see section Help manager).

For manual insertion in the watch window use the following notation:

page7-44 manual ecolog asi system


<name of the POU>.<name of the variable>

Global variables are declared without a name of the POU. Parts of


structured variables (structures, arrays) can also be entered in the watch
window. Addresses can be inserted directly.

Example for a component of a structured variable:

PLC_PRG.Instance1.Instance2.Structure.Component

Example for a global variable:

.Global.component1

The variables in the watch list can be set with default values. In online
mode, these default values can be loaded into the variables by calling
the command ‘Online’’Write Receipt’. Therefore, the default value
must be entered with := after the variable:

Example
PLC_PRG.Timer:=50

In fig. 7.17 the variable PLC_PRG.COUNTER is set with the default


value 6.

Help manager
With <F2> (or 'Edit' 'Input Selection') the help manager opens. This
feature cannot be used before the project is compiled. The help manager
window contains a list of all POUs of the project and a single point for the
global variables. A double mouse click or <Enter> opens a list of
variables of the selected POU. Instances of function blocks and
structures can be expanded. By pressing OK the selected variable is
inserted in the list.

Watch window online

Fig. 7.18: Watch window in online mode

In online mode the values of the inserted variables are displayed. To


insert new variables in online mode, perform 'Extras' 'Monitoring
active'. After inserting the variables, you can enable the monitoring of
the variables with the same command.

The variables can be set with default values (see section "Watch
window in offline mode“). These default values can be loaded into the
variables in the plc with the command ‘Online’’Write Receipt’.

manual ecolog asi system page 7-45


With the command ‘Online’’Read Receipt’, the actual values of the
variables in the plc can be loaded and displayed in asisys. In this case
the default values are replaced by the actual values.

Example
PLC_PRG.COUNTER[:= <actual value>] = <actual value>

Note:
Only the variable values of one selected watch list are loaded!

Force values
In the watch window, you can force values of variables. If you click on
the corresponding variable name, a dialogue opens in which you can
insert the new value of the variable. asisys checks whether the new
value conforms to the declaration. If this is the case, the value is
accepted. Changed variables are displayed red in the watch window.

7.8 Sampling Trace

What is sampling trace?


It is possible to trace a set of variables for a certain duration. The values
of these variables are written to a ring buffer. When the buffer is full, the
first and therefore oldest values are overwritten. For up to 20 variables
up to 500 values can be traced.

How to start the sampling trace?


To perform tracing, you have to open the trace window ('Window'
'Sampling Trace'). The commands for tracing are now available via the
Extra menu.

page7-46 manual ecolog asi system


Trace configuration

Fig. 7.19: The Trace Definition dialogue

Inserting trace variables


You can set all trace parameters in a configuration dialogue. To do so,
perform 'Extra''Trace Configuration...'. In the trace definition dialogue
you can then enter the tracing variables, the trigger variable (tracing
stops, after this variable had a falling or rising edge) and set the tracing
parameters (see fig. 7.19).

At first, the list of the trace variables is empty. To insert a variable, you
have to write it in the field below the list. Then press the button "Add",
and the variable is inserted.

The notation for an insertion in the trace definition dialogue is as follows:

<name of the POU>.<name of the variable>

To remove a variable from the list, select the variable and then press the
button "Delete".

In the field "Time per Scan [10ms]:" you can define the time between
two scans in milliseconds. The default value "0" means one scan per
cycle.

Stopping the trace


In the trigger field a Boolean variable, the trigger variable, can be
inserted. This variable defines the trigger event which is the rising or
falling edge of the trigger variable. The default value in the field
"Trigger on Rising Edge" is the rising edge. To change this option,
select this field and the field becomes unmarked.

manual ecolog asi system page 7-47


The field of the trigger variable can remain empty. In this case, trace is
written until the user explicitly stops the sampling trace ('Extras' 'Stop
Trace').

After the trigger event a certain percentage of the sampling trace ring
buffer in the controller is filled. Then the tracing in the controller is
stopped. The percentage of the ring buffer which is filled after the trigger
event is defined in the dialogue field "Percentage of Values recorded
after Trigger".

Help Manager
With <F2> the help manager opens. It is the same manager as in the
watch window.

All settings in the trace definition are saved with the project.

Start and load the trace.

'Extras' 'Define Trace'


The trace configuration is loaded into the controller. The configuration
remains there until the trace is completed or stopped.

'Extras' 'Start Trace'


This command starts tracing in the plc.

'Extras' 'Read Trace'


This command uploads the current trace buffer. The values of the
variables are displayed.

‘Extras’’Auto Read’
The current trace buffer is automatically read from the plc and the trace
variables are continuously displayed.

'Extras' 'Stop Trace'


Stops tracing in the controller. Before a new tracing is executable, the
trace definition has to be downloaded and the trace has to be started.

Selection of the displayed


variables
The combo boxes on the right of the trace windows allow the choice of
up to 5 variables from the defined list in the trace configuration.

The tracing curves of these variables are displayed. New variables can
be inserted even if there are already curves displayed.

page7-48 manual ecolog asi system


Representation

Fig. 7.20: Sampling trace of five different variables with a trigger

The x-axis is the time axis. If no scan time was defined, it is just an
increasing plc cycle number. In fig. 7.20 about 250 values are displayed.

If a scan time was defined, the x-axis gives the time of the scan. The
oldest traced value gets the time 0.

The y-axis is the representation of the variable value. The highest and
the lowest value of the variable define the highest and the lowest scaling
number. In fig. 7.20 for instance, the lowest value of Var3 was -50, and
the highest value was 500.

If the trigger event took place, a vertical line is displayed at the time of
the trigger event. In fig. 7.20 you can see this line lying exactly on the
edge of the trigger variable (Var 1).

An already read buffer remains until the project is changed or the system
is left.

'Extras' 'Cursor Mode'


Pressing the left mouse button or performing 'Extra' 'Cursor Mode'
displays a cursor in form of a vertical line. The cursor can be moved by
the mouse or with the cursor keys. By pressing <CTRL> <CURSOR
LEFT> or <CTRL> <CURSOR RIGHT> the speed of the movement
increases.

manual ecolog asi system page 7-49


If a cursor is displayed, its current x-position is displayed at the top of the
trace window. The y-positions of each displayed variable is shown next
to the text ‘var <number>‘.

'Extras' 'Multi Channel'


With the menu item 'Extra' 'Multi Channel' you can toggle between one
channel for each displayed curve or an overlapping display in one
channel. If multi channel is selected, there is a tick (√) behind the menu
item.

The default selection is multi channel. The tracing window is partitioned


in up to five parts, one for each tracing curve. The highest and the lowest
values of the curves are displayed on the left. Fig. 7.20 shows a multi
channel representation.

'Extras' 'Y scaling'


With this command, you can change the y-scaling of the system. A
dialogue opens in which you can change the old lowest and highest
values of the y-axis.

'Extras' 'Save Trace'


Saves the trace configuration and the actually loaded trace image in a
file.

'Extras' 'Load Trace'


Loads a trace configuration and a trace image from a file.

Extras' ‘Trace in ASCII File'


With this command you can export your trace image to an ASCII-file.
The curve values are listed, separated by commas. This file could be
loaded by other tools (f.e. MathCad).

page7-50 manual ecolog asi system


8. Visualisation and DDE

8.1 Visualisation

asisys places a visualisation at your disposal. With support of this tool


you can draw offline geometrical objects which change shape in online
mode depending on the values of certain project variables.

Fig. 8.1: Example for a visualisation picture

For instance, if you want to display the behavior of growth of a certain


variable, you can draw a rectangle which grows or shrinks in accordance
to the variable value.

8.1.1 Setup a visualisation

To make a visualisation, you have to select visualisations in the object


class selection combo box (the field above the object list).

'Project''Add Object'
All commands in the menu bar now apply to visualisations. If you want to
add a new visualisation to your project, you have to perform 'Project'

manual ecolog asi system page 8-1


'Add Object'. A dialogue opens in which you can insert a name for your
visualisation. By closing the dialogue with OK, a new window opens in
which you can edit the visualisation.

8.1.2 Inserting visualisation elements

You can insert four different geometrical objects and bitmaps into a
visualisation.

The following geometrical objects are available: rectangles, rounded


rectangles circles and polygons. To insert one of these elements choose
the menu 'Insert', and perform 'Rectangle', 'Rounded Rectangle',
'Circle' or ‘Polygon’. Now click in the visualisation window and move
the mouse cursor with the left mouse button pressed until the object has
the desired size (this is the way for rectangles and circles).

If you would like to insert a polygon, select the first edge by clicking with
the mouse on the required position and then select the further edges. To
close the polygon, double click on the last edge.

Bitmaps can be inserted into visualisations with the command


‘Insert’’Bitmap’. After this a dialogue box appears to select the required
bitmap file.

Last but not least it is possible to insert complete visualisations with the
command ‘Insert’’Visualisation’. A selection list of all existing
visualisations opens. Select the requested visualisation and then press
the left mouse button to tear up a window. In this window the selected
visualisation will be inserted.

8.1.3 Editing of visualisation elements

By clicking on an already inserted element, it is selected. A selected


element is moved with the left mouse button being pressed.

Little black squares appear at the edges of the element (circles have
these squares at the edges of the surrounding rectangle). By clicking on
the square at the bottom right, you can change the size of the element by
moving your mouse with the left mouse button being pressed.

If you have selected a polygon, all edges are marked by black squares
and the center will be displayed additionally. Around this center the
polygon rotates if you have configured a motion/angle to this polygon
(see chapter 8.1.5). If you click on the black square at the edge of a
polygon you can move this edge by tearing with the mouse (press the left
mouse button). If you press the Ctrl-Button and click on a black square, a
new edge will be inserted. With the buttons Shift+Ctrl and a click on a
black square, an edge will be deleted.

8.1.4 Configuration of visualisation elements

page8-2 manual ecolog asi system


After a double mouse click on a visualisation element (rectangle,
rounded rectangle, circle), you get the following multi-element dialogue:

Fig. 8.2: Multi-element dialogue for editing visualisation elements

Your object can have the following functionality:

Colour and colour changing


With the colour buttons Inside and Frame you can select the normal
colours of your object. With the alarm colour buttons Inside and Frame
you can select the alarm colours of your object. Now select ‘Variables’
and enter a Boolean variable in the field Color. Your object will have the
normal colour as long as the variable remains FALSE and the alarm
colour, if it is TRUE.

Note:
The colour changing function is only active in the online mode!

Input
Toggle a Boolean variable:

In the box ‘Input’ you can define whether inputs with the mouse should
be possible or not. The default selection is No input, so a mouse click on
the visualisation element has no effect. If the field ‘Toggle Variable
'Color Change' on mouse click’ is selected, any mouse click on the
visualisation element negates the value of the variable ‘Color Change’,
and the colour of the visualisation element toggles between colour and
alarm colour.

Zooming into another visualisation:

If the field ‘Zoom to visualisation’ of the Input dialogue is selected, you


have to insert the name of a visualisation into the following field. In
online mode, the window with this visualisation will open when clicking
on the object.

Changing the value of an analog variable:

If the field ‘Text Input of Variable Text Display’ of the input dialogue is
selected, you can change the value of a variable connected to the object.
The variable is defined as is described in ‘Display the value of a
variable’. If you select the value of the variable in online mode, you get

manual ecolog asi system page 8-3


an edit control for entering a new value. The value is written when
leaving the edit control.

Motion
You can enter variables for right, left, top and bottom edge of your
object. This edge will move in relation to the assigned variable (one pixel
per unit).

Enter the variables the following way:

<name of the POU>.<name of the variable>

Global variables are preceded by a dot.

.GlobVar

The easiest way to enter a variable is to use the function key <F2> and
to select the variable from the list.

Note:
The horizontal edge will be moved downwards for positive variable
values and the vertical edge will be moved to the right!

Shape
Here you can change the shape of a selected element.

Variables
In the field ‘Invisible’ you can enter a Boolean variable to enable the
visibility of the element depending on the variable. If the variable is
FALSE, the element is visible. If the variable is TRUE, the element is
invisible.

In the field ‘Color’ you can enter a Boolean variable to enable the colour
changing of the element depending on the variable. If the variable is
FALSE, the element is displayed in the base colour. If the variable is
TRUE, the element is displayed in the alarm colour.

To display the value of a variable select ‘variables’ and enter the


variable you want to display in the field ‘Text Display’.

Attention:
You also have to enter the output string in the field ‘Text format’. For
the variable itself enter %s.

8.1.5 Configuration of polygons

After selecting a polygon the following dialogue will be opened:

page8-4 manual ecolog asi system


Fig. 8.3: Dialogue to configure a polygon element

Colours
At the menu point ‘Colors’ you can select the colours of the element (the
same as in chapter 8.1.4).

Motion
If you enter variables in the fields X and Y offset, the polygon moves
depending on the variable values in X or Y direction. If the values are
positive, the polygon moves right (X direction) and downwards (Y
direction).

If you enter a variable in the field scale, the size of the polygon will be
scaled by the value of the variable.

If you enter a variable in the field angle, the polygon rotates around its
center depending on the variable value. A positive value rotates the
polygon clockwise and a negative value rotates the polygon
anticlockwise. The center of the polygon appears if you click on the
polygon one time. You can move this center by tearing it with the mouse.

Variables
In this menu point you can set the options ‘Invisible’ and ‘Color’ as for
the other visualisation elements (see chapter 8.1.4). With the option
‘Toggle Variable ‘Color Change’ on mouse click’ you can change the
element colour from the base colour to the alarm colour by clicking with
the mouse on the polygon.

8.1.6 Additional functions for visualisation elements

‘Extras’ ‘Bring to Front’


With this command a selected visualisation element is put to the
foreground.

‘Extras’ ‘Put to Behind’


With this command a selected visualisation element is put to the
background.

manual ecolog asi system page 8-5


‘Extras’‘Select Background
Bitmap’
With this command the dialogue for opening files opens. Select a file
with the extension *.bmp. The selected bitmap appears in the
background of your visualisation.

‘Extras’‘Delete Background
Bitmap’
With this command you delete a background bitmap.

‘Extras’’Align’
With this command you can align several selected elements. To select
some elements, keep the Shift button pressed and then select the
elements with a mouse click or keep the left mouse button pressed to
tear up a window over the elements you would like to select.

The following align options are available:

• Left: all elements are aligned with their left edge at the element that
is at the left position of all selected elements.

• Right, Top, Bottom: corresponding to Left

• Horizontal Center: all elements are aligned in the center of all


elements with their horizontal centers

• Vertical Center: all elements are aligned in the center of all elements
with their vertical centers

‘Extras’’Select All’
With this command you can select all visualisation elements.

‘Extras’’Configure’
With this command you can configure a visualisation element. It has the
same effect as a double click on a element (see chapter 8.1.4).

page8-6 manual ecolog asi system


8.2 DDE interface

asisys has a DDE (dynamic data exchange) interface for reading data.
With this feature the contents of variables (symbolic as well as non-
symbolic) can be transfered to other applications which also have a DDE
interface.

Activating the DDE interface:


The DDE interface is activated as soon as the controller (or controller
simulation) is in the online mode.

General data acquisition:


A DDE data acquisition statement in conjunction with asisys consists of
three parts:
• system name: ASISYS
• project name: This is the complete name of the project from which
the data are to be read. It must be exactly the same name as in the
status line shown in asisys (name including path,
example:C\Example\Examp.PRO)
• variable name: The name of the variable whose value is to be
transferred. It is to appear just as in the watch screen.

Which variables can be read?


All variables (symbolic and non-symbolic) can be read. The variable
name is, as mentioned above, entered as in the watch screen.

Examples:
%IX1.4.1 : read an input
PLC_PRG.test : read variable 'test' from the POU 'PLC_PRG'.
.GlobVar1 : read the global variable '.GlobVar1'

Data acquisition with 'MS WORD


for Windows':
To transfer the value of the variable 'TEST' from the POU 'PLC_PRG'
using the software system 'MS WORD for Windows' a field is to be
entered (insert field). The field is as follows:

{ DDEAUTO ASISYS "C:\\ASISYS\\PROJECT\\IFMBSP.PRO"


"PLC_PRG.TEST" }

Data acquisition with 'MS EXCEL':


To transfer the value of the variable 'TEST' from the POU 'PLC_PRG' to
a cell using the software system 'MS EXCEL' the following is to be
entered:

=ASISYS|'C:\ASISYS\PROJECT\IFMBSP.PRO'!PLC_PRG.TEST
This means :
• type: ASISYS
• source file: C:\ASISYS\PROJECT\IFMBSP.PRO
• element: PLC_PRG.TEST

manual ecolog asi system page 8-7


Data acquisition with 'InTouch'

Data acquisition using the system 'InTouch' from Wonderware


Corporation is carried out as follows:

• In your project define a DDE Access Name <AccessName> with


− the application name ASISYS and the
− DDE topic name C:\CODESYS\PROJECT\IFMBSP.PRO
• Next define a variable of
− type DDE with
− Access Name <AccessName>
• Then the
− item name is variable name (for example PLC_PRG.TEST )

page8-8 manual ecolog asi system


manual ecolog asi system page 8-9
Appendix

A. The IEC operators

asisys supports nearly all IEC operators. As opposed to the IEC


standard POUs, operators are implicitly known to the programming
system (i.e. it is not necessary to link a library to the project in order to
use these operators). In the POU bodies, operators are used like
functions. Appendix A contains a list of all supported operators.

A.1 Arithmetic operators

ADD
Addition of variables of type BYTE, WORD, DWORD, DINT and INT.

Example in IL:

LD 7
ADD 2,4,7
ST var1

Example in ST:

var1 := 7+2+4+7;

Example in FBD:

Example in LD (here conditional ADD with an ENable input):

MUL
Multiplication of variables of type BYTE, WORD, DWORD, DINT and
INT.

manual ecolog asi system page Appendix-1


Example in IL:

LD 7
MUL 2,4,7
ST var1

Example in ST:

var1 := 7*2*4*7;

Example in FBD:

SUB
Subtraction of one variable of type BYTE, WORD, DWORD, DINT or
INT from another variable of one of these types.

Example in IL:

LD 7
SUB 8
ST var1

Example in ST:

var1 := 7-2;

Example in FBD:

DIV
Division of one variable of type BYTE, WORD, DWORD, DINT or INT by
another variable of one of these types.

Example in IL:

LD 8
DIV 2
ST var1

Example in ST:

var1 := 8/2;

Example in FBD:

page Appendix-2 manual ecolog asi system


MOD
Module division of one variable of type BYTE, WORD, DWORD, DINT
or INT by another variable of one of these types.

Example in IL:

LD 9
MOD 2
ST var1 (* Result is 1 *)

Example in ST:

var1 := 9 MOD 2;

Example in FBD:

A.2 Bit string operators

AND
Bit-wise AND of operands. The operands have to be of type BOOL,
BYTE or WORD.

Examples in IL:

LD Start
AND Enable
ANDN EmergencyOFF
ST Motor

LD 2#1001_0011
AND 2#1000_1010
ST Var1 (* Result is 2#1000_0010 *)

Examples in ST:

Motor := Start AND Enable AND NOT EmergencyOFF;

var1 := 2#1001_0011 AND 2#1000_1010;

Examples in FBD:

manual ecolog asi system page Appendix-3


Example in LD for boolean variables:

Example in LD for byte variables with ENable input (in this example EN
is always TRUE):

OR
Bit-wise OR of bit operands. The operands have to be of type BOOL,
BYTE, WORD.

Example in IL:

Var1 :BYTE;
LD 2#1001_0011
OR 2#1000_1010
ST Var1 (* Result is 2#1001_1011 *)

Example in ST:

var1 := 2#1001_0011 OR 2#1000_1010;

Example in FBD:

XOR
Bit-wise XOR of bit operands. The operands have to be of type BOOL,
BYTE or WORD.

Example in IL:

Var1 :BYTE;

page Appendix-4 manual ecolog asi system


LD 2#1001_0011
XOR 2#1000_1010
ST Var1 (* Result is 2#0001_1001 *)

Example in ST:

var1 := 2#1001_0011 XOR 2#1000_1010;

Example in FBD:

NOT
Bit-wise NOT of a bit operand. The operands have to be of type BOOL,
BYTE or WORD.

Example in IL:

Var1 :BYTE;
LD 2#1001_0011
NOT
ST Var1 (* Result is 2#0110_1100 *)

Example in ST:

var1 := NOT 2#1001_0011;

Example in FBD:

A.3 Selection operators

All selection operators can be used for variables as well. In the following
examples, we use constants as operands only for brevity.

SEL
Binary selection.

OUT := SEL(G, IN0, IN1) means:


OUT := IN0 if G=FALSE;
OUT := IN1 if G=TRUE.

Transfers the value of IN0 to OUT if G is FALSE, or transfers the Value


IN1 to OUT if G is TRUE. IN0, IN1 and OUT can have any type, G must
be of type BOOL.

Example in IL:

LD TRUE
SEL 3,4
ST Var1 (* Result is 4 *)

manual ecolog asi system page Appendix-5


LD FALSE
SEL 3,4
ST Var1 (* Result is 3 *)

Example in FBD:

MAX
Two values are operands and the result is the maximum of these two
values.

OUT := MAX(IN0, IN1)

IN0, IN1 and OUT can have any type.

Example in IL:

LD 90
MAX 30
MAX 40
MAX 77
ST Var1 (* Result is 90 *)

Example in FBD:

MIN
Minimum operator. Yields the minimum of two values.

OUT := MIN(IN0, IN1)

IN0, IN1 and OUT can have any type.

Example in IL:

page Appendix-6 manual ecolog asi system


LD 90
MIN 30
MIN 40
MIN 77
ST Var1 (* Result is 30 *)

Example in FBD:

MUX
Multiplexer.

OUT := MUX(K, IN0,...,INn) means:

OUT := INK.

IN0, ...,INn and OUT can have any type. K must be of type BYTE,
WORD, DWORD, INT, DINT. MUX selects the (K+1)th value from a set
of values.

Example in IL:

LD 3
MUX 30,40,50,60,70,80
ST Var1 (* Result is 60 *)

Example in FBD:

Example in LD:

manual ecolog asi system page Appendix-7


A.4 Comparison operators

GT
Greater than.

A Boolean operator with result TRUE, if the first operand is greater than
the second. The operands can be of type BOOL, BYTE, WORD, INT.

Example in IL:

LD 20
GT 30
ST Var1 (* Result is FALSE *)

Example in ST:

var1 := 20 > 30;

Example in FBD:

Example in LD:

LT
Less than.

A Boolean operator with result TRUE, if the first operand is less than the
second. The operands can be of type BOOL, BYTE, WORD or INT.

Example in IL:

LD 20

page Appendix-8 manual ecolog asi system


LT 30
ST Var1 (* Result is TRUE *)

Example in ST:

var1 := 20 < 30;

Example in FBD:

LE
Less equal

A Boolean operator with result TRUE, if the first operand is less than the
second operand or equal to the second operand. The operands can be of
type BOOL, BYTE, WORD or INT.

Example in IL:

LD 20
LE 30
ST Var1 (* Result is TRUE *)

Example in ST:

var1 := 20 <= 30;

Example in FBD:

GE
Greater equal

A Boolean operator with result TRUE, if the first operand is greater than
the second operand or equal to the second operand. The operands can
be of type BOOL, BYTE, WORD or INT.

Example in IL:

LD 20
GE 20
ST Var1 (* Result is TRUE *)

Example in ST:

var1 := 60 >= 40;

manual ecolog asi system page Appendix-9


Example in FBD:

EQ
Equality

A Boolean operator with result TRUE, if the operands are equal. The
operands can be of type BOOL, BYTE, WORD or INT.

Example in IL:

LD 40
EQ 40
ST Var1 (* Result is TRUE *)

Example in ST:

var1 := 40 = 40;

Example in FBD:

NE
Inequality

A Boolean operator with result TRUE, if the operands are not equal. The
operands can be of type BOOL, BYTE, WORD or INT.

Example in IL:

LD 40
NE 40
ST Var1 (* Result is FALSE *)

Example in ST:

var1 := 40 <> 40;

Example in FBD:

A.5 Address operator

page Appendix-10 manual ecolog asi system


ADR
Address operator

ADR returns the address of its argument in a WORD. This address can
be passed to user defined POUs and will there be treated as a pointer.

Example in IL:

LD var1
ADR
ST var2
man_fun1

A.6 Call operator CAL

CAL
The CAL operator is used to activate (start or summon) a POU (program
or function block, functions are activated differently).

In IL a POU is activated with CAL. The values of the input parameters


can be assigned in brackets after the POU name (in the case of a
function block the instance is used).

Example: Activation of the instance 'MyFuncBlk' of a given function


block. The parameters Par1, Par2 are assigned the values 0 or TRUE.

CAL MyFuncBlk(PAR1 := 0, PAR2 := TRUE)

A.7 Copy operator MOVE

MOVE
Assignment of the contents of a variable

With MOVE the contents of a variable or a constant value can be copied


to another variable. It applies to all variable types. The operator can be
used in every programming language. But the main application is the
ladder diagram.

Example in LD:

A.8 Comparison of programming in STEP5 and IEC 1131-3

manual ecolog asi system page Appendix-11


Since most programmers have excellent knowledge of STEP 5 but less
knowledge of the standard the two IL based programming languages will
therefore be compared below.

STEP 5 IEC 1131-3


Binary operations with inputs
and outputs
Load bit value Not available, help by first LD %I1.2.0
scanning with A/AN/O/ON. This LDN %I2.2.1
means that for example the first A
scanning in the block is never an
AND operation but loading.
AND operation for bit value A I 1.2.0 AND %I1.2.0
AND operation for negated bit AN I 1.3.0 ANDN %I1.3.0
value
OR operation for bit value O I 1.2.0 OR %I1.2.0
OR operation for negated bit value ON I 1.3.1 ORN %I1.3.1
Store bit value = Q 1.2.0 ST %Q1.2.0
Store negated bit value Not possible, help with STN %Q1.2.0
= Q 1.2.0
AN Q 1.2.0
= Q 1.2.0
Conditional setting of bit value S Q 1.2.0 S %Q1.2.0
Conditional resetting of bit value R Q 1.2.1 R %Q1.2.1
XOR operation for bit value Not directly possible XOR %I1.2.0
XOR operation for negated bit Not directly possible XORN %I1.2.0
value
Binary operations with other
operands
Flags (F) The same possibilities as with The same possibilities as with
inputs and outputs inputs and outputs
A F 0.0 AND %M0.0
Note that flag management is
normally done by the IEC
programming system itself.
S flags A S 0.0 Does not exist in the standard.
Data bits A D 0.0 Data blocks, words, bytes, double
words and bits do not exist in the
standard. So data bits cannot be
directly addressed. For more
details see word processing.

page Appendix-12 manual ecolog asi system


STEP 5 IEC 1131-3
Binary operations with other
operands
Scan timer status (timer still A T0 LD TimerHugo.Q or
running?) AND TimerHugo.Q
Scan bit of a timer word A T 0.0 No equivalent in the standard
Scan counter status (counter still A C0 LD CounterHugo.Q or
running?) AND CounterHugo.Q
Scan bit of a counter word A C 0.0 No equivalent in the standard
Bracket operations
A( AND( %I1.2.0
O I 1.2.0 OR %I1.2.1
O I 1.2.1 )
)
or
or
OR( %I1.2.0
O( AND %I1.2.1
A I 1.2.0 )
A I 1.2.1
or
)
OR( %I1.2.0
or
AND %I1.2.1
O )
A I 1.2.0 OR %I1.2.2
A I 1.2.1
In some IEC programming
O I 1.2.2
systems bracket operations are
Bracket operations are mainly used to translate FBD/LD networks
used to translate FBD/LD networks in IL and vice versa but not in
in IL and vice versa (consequently asisys (each IL network can be
it is not possible to represent all IL converted to FBD or LD). More
networks in LD/FBD). For "(" or operators can be put into brackets
"O“ the RLO is retained and the (not only AND and OR). The
next operation is a first scanning operation in brackets corresponds
(loading). For ")“ or at the end of to deferring and loading of the
the AND block in case of "O“ the operand as defined.
deferred operation is performed
(an AND operation for "A(" or an Example:
OR operation for "O(" and "O“). AND( hugo
...
)
corresponds to:
(* Retain current result *)
LD hugo
....
AND "Retained result“

manual ecolog asi system page Appendix-13


STEP 5 IEC 1131-3
Word operations
Loading of an input, output, (S) L IW 0 LD %IW0
flag word L QW 0 LD %QW0
L FW 0 LD %MW0
L SW 0
No equivalent.
For direct addressing of flags refer
to what was said about flag bits.
There are no S flags in the
standard (see above).

Loading of a data word (C DB 5 )


Storing of a data word L DW 3 LD erwin
(C DB 5 )
T DW 3 ST erwin
There are no data blocks in the
standard. If you declare a variable
„w : INT;“ it is automatically
placed onto a word in a suitable
data area. If you access the
variable w, e.g. with „ST w“, the
correct code is automatically
generated.
Bit-wise operation for words L IW 10 LD %IW10
L IW 12 AND %IW12
AW
instead of AW: (X)OW instead of AND: (X)OR
Loading of constants
L KH 0fab LD 16#0fab
L DH 0fab 1234 LD 16#0fab_1234
L KB 230 LD 230(only possible as word)
L KS FU LD 16#4655(corr. to hex num)
L KF +123 LD 123
L KM 1111 0000 1100 0011 LD 16#f0c3(corr. to hex num)
L KT 1.2 LD T#1s
L KY 255,1 LD 16#ff01
L KC 999 No direct equivalent
RS and SR flipflops
SR flipflop A F 12.2 LD flag12_3
R F 100.0 ST srelement.SET1
A F 12.3 LD flag12_2
S F 100.0 ST srelement.RESET
A F 100.0 CAL srelement
LD srelement.Q1

page Appendix-14 manual ecolog asi system


STEP 5 IEC 1131-3
RS and SR flipflops (to be
continued)
RS flipflop A F 12.3 LD flag12_2
S F 100.0 ST rselement.RESET1
A F 12.2 LD flag12_3
R F 100.0 ST rselement.SET
A F 100.0 CAL rselement
LD rselement.Q1
In STEP5/7 the sequence of the IL commands always determines
whether a setting/resetting element represents a SR or RS flipflop
(i.e. whether setting or resetting "has priority" if there is at the same
time a high signal on the SET or RESET inputs). In the standard a
flipflop must be declared to be SR or RS right from the start, the
order in which the inputs of the flipflop are called is then not
important.
Arithmetic
16-bit fixed point numbers (with L KF +123 LD 123
sign) L KF +456 ADD 456
+F
The same for SUB / MUL / DIV for
The same for -F / xF / :F for subtraction, multiplication and
subtraction, multiplication and division
division
32-bit fixed point numbers (with L DH 0001 0000 LD 65536
sign) L DH 0000 FFFF ADD 65535
+D
The same for -D for subtraction The same for SUB subtraction
Comparisons
16-bit fixed point numbers L KF +123 LD 123
L KF +456 GT 456
>F
The same for The same for
>=F / <F / <=F / !=F / ><F for GE / LT / LE / EQ / NE for greater
greater equal, less than , less equal, less than, less equal, equal
equal, equal and not equal and not equal
32-bit fixed point numbers L DH 0001 0000 LD 65536
L DH 0000 FFFF GT 65535
>D
The same for The same for
>=D / <D / <=D / !=D / ><D for GE / LT / LE / EQ / NE for greater
greater equal, less than, less equal, less than, less equal, equal
equal, equal and not equal and not equal

manual ecolog asi system page Appendix-15


STEP 5 IEC 1131-3
Block calls and types
OBs for system programming For example OB32 for error There are no OBs in the standard.
processing is not explicitly called
by the user but is only
programmed and automatically
called by the system program
OBs which must be explicitly For example OB31 for cycle time LD 50
called setting after a restart CAL OB31
L KB50
JU OB31
Open data blocks C DB 3 There are no data blocks in the
standard. A variable is
automatically placed into a data
area by asisys.

Block end
"Physical“ end of the block BE No equivalent, the command BE is
automatically generated at the end
of each POU.
End block in the middle of the BEU RET
code
End block conditionally in the BEC RETC
middle of the code
End block negated-conditionally in Not directly possible RETCN
the middle of the code
Network end *** Is not transferred as a command to
(BLD 255) the plc program
Jump functions
Absolute (unconditional) jump JU= m001 JMP label1
Conditional jump JC= m002 JMPC label2
Conditional negated jump Not directly possible JMPCN label3
Label m001: longer label name:
Other jump commands JZ=, JN=, JP=, JM=, JO=, JS= No equivalent

page Appendix-16 manual ecolog asi system


STEP 5 IEC 1131-3
Jump functions (to be
continued)
Long jumps JR +20000 JMP label
JMPC label
The jump goal cannot be
JMPCN label
symbolically indicated, but the
jump distance must be determined
empirically and be indicated with asisys generates long jumps.
the command. Commands such as
"write block" or "compress" destroy
programs which contain JR
commands. No conditional long
jumps are possible.
What happens after a jump? Note that the command JC= sets After a jump not all operations are
the RLO to 1 and that the next bit allowed because such programs
scanning (e.g. „A F0.0“, „AN are unreadable. So after a jump
I1.1.0“, „O I1.1.1“) is a first command and at a jump label only
scanning, i.e. loading and no logic the following commands are
operation. allowed: loading of a value with
LD(N), call of function block
instances with CAL(C(N)), jumps
JMP(C(N)) and RET(C(N)).
Jumps in brackets Are possible, generate in most Make it difficult to understand
cases some unintended effects programs and make them error-
(errors). prone, so they are not allowed.

Counters in the standard differ much from counters in STEP5/7. To


initialise a counter with the constant 999 the following IL sequence is
used:

As a start value for a down-counter:

LD TRUE
ST counterdw.LOAD
LD 999
ST counterdw.PV

As a count goal for an up-counter:

LD 999
ST counterup.PV

Timers and counters


In the standard the definition of these basic plc functions is different from
that in STEP5/7. See the standard library in the asisys help system or in
the corresponding chapter of the appendix for the standard library in this
manual.

In the DIN/IEC standard and STEP5/7 the timers are relatively similar. It
is in principle not possible in the standard to reset a timer (R T1) or to

manual ecolog asi system page Appendix-17


release a timer (retrigger with FR T1 etc.). The following timer types are
considered in the standard: TON (switch-on delay), TOF (switch-off
delay) and TP (pulse).

In the DIN/IEC standard and STEP5/7 the counters are very different.
The following counter types are considered in the standard: CTU (up-
counter), CTD (down-counter) and CTUD (combined up and down
counter).

In the standard timers and counters must be treated as variables of the


corresponding type.

VAR
hugo : TON;
END_VAR
....
LD %I1.1.0
ST hugo.IN (* Start input *)
LD T#20s
ST hugo.PT (* 20 s as default *)
LD hugo.Q (* Timer elapsed? *)

Other commands
Most other STEP5 commands have no equivalent in the standard IEC
1131-3. For shift, rotation and conversion functions there are standard
functions in the standard which you can look up in the standard library.

Other basic differences


In STEP5 there are several accumulators which are 16 or 32 bits long (1
or 2 words) depending on the plc type. In addition, there is the RLO
(result of the logic operation) which can take 1 bit. Word commands such
as "L KF+123" or "L IW12" influence the accumulators, bit commands
such as "AN I 1.1.0" the RLO. In STEP5 the accumulators and the RLO
operate in parallel and only interfere seldom (only for comparisons). This
means that after a bit command some word commands can be executed
and the RLO of the last bit operation remains. So after the word
commands you can continue with for example "A I1.1.0", an AND
operation is performed with the RLO of the last bit operation.

In the standard there is only an "abstract" accumulator which can take


values of any type (BOOL, WORD, DINT, etc.). Loading determines the
current type of the accumulator. Until the next loading command (or a
function call) only such operations are allowed which match this type (for
example addition for INT but not for BOOL). It is not possible to use bit
and word commands simultaneously. If bit processing is active, no word
commands can be used. First a word must be loaded into the
accumulator, in this case the bit result is lost. This leads to readable
programs.

Example:

page Appendix-18 manual ecolog asi system


STEP 5 IEC 1131-3
= F0.1 (* last bit operation *) ST varBool
L KF+100 LD 100
L KF+1 ADD 1 (* !!! impossible *)
+F AND %I1.2.0 (* !!!
A I1.2.0 (*here a logic operation impossible*)
with the RLO of the last bit
operation is carried out *)

In STEP 5 there are several accumulators. During the loading operation


into the accumulators the value is written to the accumulator 1 and the
old contents of the accumulator 1 are shifted to the accumulator 2. With
the operation TAK the contents of the accumulator 1 and accumulator 2
can be swapped again, so a reloading may not be necessary. In the
standard there is only one accumulator and so no TAK.

A.9 The language S5-IL in asisys

In addition to the 5 IEC 1131-3 languages it is possible with asisys to


write POUs in S5-IL.

Existing S5 projects can be


transferred

You can transfer blocks from a S5D file (the standard Siemens program
file) to an asisys project and transfer the corresponding SEQ symbol file
more or less unchanged to the global variable list.

"More or less unchanged" means that some symoblic names cannot be


transferred from the SEQ file because they contain characters which in
IEC 1131-3 are not allowed within a name. Such names are
automatically converted when a STEP5 project is imported. In the global
variable list you find the original name as used in SEQ in a comment in
addition to the generated new IEC variable.

Conversion from STEP5 to an IEC


language
Many S5-IL POUs can be converted to an IEC language (when they are
imported from the S5D file or later).

Those STEP5 blocks without system commands which only operate for
certain S5 CPUs can be converted to IEC IL/LD/FBD. So the STEP5 set
of basic commands can be converted to an IEC code by pressing a
button.

The basic command set which can be converted to IEC 1131-3 can be
roughly described as follows:

• It covers all commands which in a STEP5 programming system can


be converted to LD or FBD as well as all commands which are
allowed in a STEP5 PB (program block).

manual ecolog asi system page Appendix-19


• In addition, from the STEP5 commands which are allowed only in IL
or only in FBs (function blocks) mainly those commands can be
converted to IEC which are really available on every S5 CPU, for
example absolute and conditional jumps, (word) shift commands, etc.

• The only exception or limitation for conversion concerns the resetting


of timers. This can be done in STEP5 but not in IEC 1131-3. The
standard timers defined in the standard have no reset option.

IEC 1131-3 defines a programming language which covers all that is


needed for a plc program. But understandably enough, no operand areas
such as BS, BA, etc. are defined.

A good example of machine-dependent program parts are the STEP5


function blocks (Siemens system blocks) to trigger S5-CP/IP peripheral
equipment, e.g. for sending and receiving data via a H1 module. These
blocks are defined and have a call interface with parameter formats
which are not specified in the standard or which are a bit different. But
these calls are not necessary in the controller due to their hardware
reference or they have already been implemented as an asisys function
block. So a conversion of these blocks is not necessary.

As mentioned above, there is the problem of resetting timers, which is


not possible in the standard. Tricks such as a changed call of the start
input do not work either. If you reset a timer in a STEP5 block, this
cannot be converted to IEC 1131-3.

Step-by-step introduction
asisys enables a simple and step-by-step introduction to the
programming to IEC 1131-3.

You can convert your blocks to IEC 1131-3 whenever you wish. By
comparing the "old" STEP5 code with the POU generated in IEC-IL or
IEC-FBD you can see how your problem is solved in IEC 1131-3.

The portability of existing STEP5 projects is excellent.

POU programming in S5-IL


A new POU in S5-IL is created exactly the same way as in IEC-IL, i.e.
with the command 'Project/Add Object' or you click in the object list on
the very left and then press the insert key. Enter the POU name and click
on the language "S5".

After that you can directly input S5-IL in a text editor. When changing to
another line the input is automatically formated if
'Project/Options/Autoformat' is active.

Operands in S5-IL
The main difference between STEP5 and IEC 1131-3 is that there are no
local variables. The variables indicated in the POU declaration part are
different from the general STEP5 understanding because they are only
locally available. But a SEQ file is imported to the global variable list.

Operands are input based on the STEP5 syntax, e.g. "I 1.12.0" for the
input bit 0 in slave 12 of the master 1.

page Appendix-20 manual ecolog asi system


Symbolic operands
Symbolic programming is also allowed. As is usual in STEP5, the
symbolic name in the program is marked by a minus sign preceding the
variabale name, for example "A -button" if you want to access the
variable "button".

Most S5-IL POUs can be converted to IEC-IL etc. by executing


'Project/Convert Object'. After conversion you must not forget to check
for correctness by compiling and testing the project.

Conversion of S5-IL POUs to IEC-


IL/FBD
During conversion some changes are in most cases made automatically.
Despite this, you may in some places not directly understand the
generated code. This concers timers and counters.

Convert timers
Timers are structured data types in IEC 1131-3, i.e. a timer must be
declared as a variable, e.g. with

VAR
time : TON;
END_VAR

for a switch-on delay.

In S5-IL the timers T0 to T255 are defined. In the symbol list it is


possible to define the name "time" for "T10" but it cannot be seen in the
symbol list whether in the program the timer is used as switch-on delay,
pulse, etc.

When a SEQ file or a S5D file is imported to asisys first a declaration of


a TON timer is generated with a comment that this declaration "may be
incorrect". If you then start the timer as a pulse in a S5 POU and convert
the POU to IEC 1131-3, the corresponding declaration is automatically
generated or changed in the global variable list. If the timer has so far
not been declared, a new line "T10 : TP" is inserted. If the timer was
imported from a SEQ file, the declaration generated during the import

T10 : TON; (* Timer delay (T10) in SEQ is assumed to be TON


(which may not be correct *)

is converted to

T10 : TP; (* Timer delay (T10) in SEQ is assumed to be TON


(which may not be correct *)

The comment is now no longer necessary and can be deleted after a


check.

Convert counters
Counters are structured data types in IEC 1131-3, i.e. a counter must be
declared as a variable, e.g. with

VAR
ProducedPartsOk : CTUD;
END_VAR

manual ecolog asi system page Appendix-21


for an up and down counter. For the conversion of a S5-IL counter to an
IEC counter a global variable type CTUD is always generated (the types
CTU and CTD are not useful).

Since in STEP5 the input for loading the counter with a preset value
(count goal for counting up or start value from which you count down) is
edge-triggered, which is not the case in IEC 1131-3 an edge detector is
automatically inserted before this input. Since the IEC edge detector is
also a structured data type, a global variable called for example
"RisingEdge10" type R_TRIG is inserted.

Data blocks
Data blocks do not exist in IEC 1131-3. Instead of this, programming is
done with normal variables. For import and conversion of data blocks
pseudo IEC POUs are generated without a code.

Consequently, during the conversion of S5-IL to IEC 1131-3 a local


variable type WORD is created for every word from a data block, e.g.
"W2" for word 2 in DB3. For the declaration the variable is assigned an
initialisation value which is taken from the corresponding DB.

Note
If in another POU you access the corresponding area byte-wise or double
word-wise instead of word-wise, you have to modify the generated code.
In this case you receive error messages and the byte, bit or double word
access must be changed.

Import of a STEP5 project


An existing STEP5 application is imported via the menu point
‘Project/Import S5-file’. Blocks are imported from a S5D file and global
variables from a SEQ symbol file. The S5D file can be selected in a
standard file dialogue.

A second dialogue is opened. There you can select the blocks to be


imported. If you wish, you can try and convert the blocks to an IEC
language by selecting the target language when import takes place.

If you cross "Import SEQ file as global variables", the corresponding


STEP5 symbol file is imported to the global variable list.

This SEQ file must meet the following conditions:

• It is in the same directory as the S5D file.

page Appendix-22 manual ecolog asi system


• Its name starts the same way as the corresponding S5D file.

• Its name ends with "Z0" (before the point).

• It has the extension "SEQ“.

• It possibly contains at signs "@“ before "Z0“.

If it is necessary, the file must first be renamed. The SEQ file must be
available in the original Siemens format. So please do not work on this
file manually with an ASCII editor. It can easily happen that TAB
characters get lost.

During import some error messages can occur.

The input and output address have another structure in the controller
than for the Siemens plcs and must therefore always be reassigned.

Also note that for the import with simultaneous conversion to IEC 1131-3
instructions can be found in a block which can prevent the conversion. In
this case you receive error messages but the block is not imported. This
is why you cannot see what the error message refers to.

Then import the POU in S5-IL and convert it to an IEC language. You
then receive the same error messages but by double clicking on the error
message you can jump to the critical position in the S5-IL POU.

During the import it can happen that the symbolic names undergo some
bigger modifications.

In IEC 1131-3 a variable name must start with a letter or an underscore,


then underscores, numbers or letters can occur in any order but never
more than one underscore at a time.

During the import country-specific characters, blanks, etc. (which are


allowed in STEP5 symbolic names) are converted to underscores. If
several unallowed characters come one after the other, zeros are

manual ecolog asi system page Appendix-23


inserted after the underscore. If a STEP5 symbolic name had to be
converted during the import, a comment is inserted into the line with the
declaraction in the global variable list which contains the original name
from SEQ.

Also note that the symbolic names such as "Bä1" and "Bö1" are both
converted to "B_1". This results in a double variable declaration, which
leads to compilation errors.

Example for a conversion


A simple example shows how conversion works.

In principle, a conversion only works if the POU can be correctly


compiled. Suppose you have a correct project with a S5-IL POU called
PB1 which is as follows:

First, ensure with ‘Project/Rebuild all’ that your POU is without errors.
Otherwise, you receive an error message when you try to convert the
POU.

If there are no errors, click on PB1 in the object list and execute
‘Project/Convert Object’. In the dialogue you select the target language,
e.g. FBD and indicate a new POU name. In this case the old PB1 POU is
retained in S5-IL and you can compare it with the new POU which results
from the conversion.

This is the converted POU in FBD:

Since a timer T0 is started as a pulse, there is a new input "T0 : TP" in


the global variable list.

page Appendix-24 manual ecolog asi system


And another small POU which can be seen converted to S5-IL and FBD.

manual ecolog asi system page Appendix-25


B. The elements of the standard library

asisys supports all IEC standard functions. As opposed to operators,


standard functions are not implicitly known to the system. In order to use
standard functions, the standard library 'ST8051.lib' has to be linked to
the project.

B.1. Type conversion functions

It is not allowed to implicitly convert a "longer" variable type to a


"smaller" one (e.g. from INT to BYTE or from DINT to WORD). If you
want to do this, special type conversion functions must be used. Strings
cannot be converted, conversions to extensive types or types of the
same "size" are carried out implicitly (e.g. from INT to WORD and vice
versa or from INT to DINT).

BOOL_TO_WORD
Converts a bit operand to a word operand.

Example in IL:

LD TRUE
BOOL_TO_WORD
ST Var1 (* Result is 1, Var1 is a WORD *)

Example in FBD:

DINT_TO_INT
Converts a 32-bit operand of type DINT to a 16-bit operand of type INT
by retaining the sign.

Example in IL:

LD Var1 (* It should be possible to represent the *)


(* contents of Var1 (DINT) with 16 bits *)
DINT_TO_INT
ST Var2 (*Var2 is an INT *)

DINT_TO_BYTE
Converts a 32-bit operand of type DINT to a 16-bit operand (without
sign).

page Appendix-26 manual ecolog asi system


Example in IL:

LD Var1 (* It should be possible to represent the *)


(* contents of Var1 (DINT) with 16 bits *)
DINT_TO_INT
ST Var2 (*Var2 is a BYTE *)

INT_TO_BYTE
Converts an integer operand to a byte operand.

Example in IL:

LD -1
INT_TO_BYTE
ST Var2 (* Result is 255, Var2 is a BYTE *)

Example in FBD (in online mode):

TIME_TO_WORD
Converts a time operand to a word operand.

Note
Times greater than 65535 ms generate a wrong value (overflow).

Example in IL:

LD T#10s
TIME_TO_WORD
ST Var1 (* Result is 10000, Var1 is a WORD *)

Example in FBD:

WORD_TO_BOOL
Converts a word operand to a Bool operand.

Example in IL:

LD 1
WORD_TO_BOOL
ST Var1 (* Result is TRUE, Var1 is BOOL *)

WORD_TO_BYTE
Converts a word operand to a byte operand.

Example in IL:

manual ecolog asi system page Appendix-27


LD 1000
WORD_TO_BYTE
ST Var1 (* Result is 232, Var1 is a BYTE *)

Example for FBD (in online mode):

WORD_TO_TIME
Converts a word operand to a time operand.

Example for IL:

LD 1000
WORD_TO_TIME
ST Var1 (* Result is 1s, Var1 is a TIME *)

Example for FBD (in online mode):

B.2 Numerical functions

ABS
Absolute value

ABS(-2) is 2

B.3 Bit shift functions

The following functions are illustrated with examples written in FBD.


These examples are similar to those in the library manager of asisys.

SHL

Shift left: A:= SHL (IN, N)

A, IN and N have to be of type BYTE or WORD. IN is shifted to the left


by N bits. The positions of the shifted bits are assigned the value zero
from the right.

page Appendix-28 manual ecolog asi system


Example:

LD 1
SHL 1
ST Var1 (* Result is 2 *)

SHR

Shift right: A:= SHR (IN, N)

A, IN and N have to be of type BYTE or WORD. IN is shifted to the right


by N bits. The positions of the shifted bits are assigned the value zero
from the left.

Example:

LD 32
SHL 2
ST Var1 (* Result is 8 *)

ROL

Rotate left: A:= ROL (IN, N)

A, IN and N have to be of type BYTE or WORD. IN is rotated to the left


by N bits (circularly).

Example:

Var1 :BYTE;
LD 2#1001_0011
ROL 3
ST Var1 (* Result is 2#1001_1100 *)

ROR

Rotate right: A:= ROR (IN1, N)

A, IN1 and N have to be of type BYTE or WORD. IN1 is rotated to the


right by N bits (circularly).

Example:

manual ecolog asi system page Appendix-29


Var1 :BYTE;
LD 2#1001_0011
ROR 3
ST Var1 (* Result is 2#0111_0010 *)

B.4. Bistable function blocks

SR

Bistable function block, set dominant:

Q1 = SR (SET1, RESET) means:


Q1 = (NOT RESET AND Q1) OR SET1
Q1, S1 and R1 are of type BOOL.

The set and the reset input (S1 and R0) as well as the output Q1 must be
of type BOOL. Q1 retains its value even if the input condition no longer
applies (stored setting and resetting). If both input conditions are met
simultaneously, the output is set.

RS

Bistable function block, reset dominant

Q1 = RS (SET, RESET1) means:


Q1 = NOT RESET1 AND (Q1 OR SET)
Q1, S1 and R1 are of type BOOL.

The set and the reset input (S1 and R0) as well as the output Q1 must be
of type BOOL. Q1 retains its value even if the input condition no longer
applies (stored setting and resetting). If both input conditions are met
simultaneously, the output is reset.

SEMA

A software semaphore (interruptible)

BUSY = SEMA(CLAIM, RELEASE) means:


BUSY := X;
IF CLAIM THEN X:=TRUE;
ELSIF RELEASE THEN BUSY := FALSE; X:= FALSE;
END_IF

page Appendix-30 manual ecolog asi system


X is an internal BOOL variable initialized with 0.

BUSY, CLAIM and RELEASE are of type BOOL.

B.5 Edge detection

R_TRIG

Rising edge detection

As long as the input variable S1 is FALSE, the output Q0 and the internal
variable M are FALSE. As soon as S1 is TRUE, the output Q0 yields
TRUE and then M is set to TRUE, i.e. in any further call of R-TRIG Q0
will be FALSE until S1 has a falling and again a rising edge.

F_TRIG

Falling edge detection

As long as the input variable S1 is TRUE, the output Q0 and the internal
variable M are FALSE. As soon as S1 is FALSE, the output Q0 yields
TRUE and then M is set to TRUE, i.e. in any further call of F-TRIG Q0
will be FALSE until S1 has a rising and again a falling edge.

B.6 Counter

CTU

Up-counter:

CU, R0 and Q0 are of type BOOL, PV and CV are of type INT.

If R0 is TRUE, the counter variable CV is set to 0. Upon each rising edge


of CU CV is increased by 1 in any call of the function block, as long as
CV is less than PVmax (as long as CV does not cause an overflow).

Q0 yields TRUE, if CV is greater or equal to PV.

manual ecolog asi system page Appendix-31


CTD

Down-counter

CD, LD_ and Q0 are of type BOOL, PV and CV are of type INT. (Note:
LD_ is named LD_ because LD would be a key word).

IF LD_ is TRUE, the counter variable CV is set to the preset value PV. If
LD_ is FALSE, CV is decreased by 1 with each rising edge CD, as long
as CV is greater than PVmax (as long as CV does not cause an
underflow).

Q0 is TRUE if CV is less than or equal to 0.

CTUD

Up-down counter

CU, CD, R0, LD_, QU and QD are of type BOOL, PV and CV are of type
INT.

If R0 is TRUE, CV is initialized with 0. If LD_ is TRUE, CV is initialized


with PV.

CV is increased by 1 with each rising edge of CU, as long as CV causes


no overflow. CV is decreased by 1 with each rising edge of CD, as long
as CV causes no underflow.

QU is TRUE if CV is greater than or equal to PV.

QD is TRUE if CV is less than or equal to 0.

B.7 Timer

TP

Timer Pulse

TP(IN, PT, Q0, ET) means:

page Appendix-32 manual ecolog asi system


IN and PT are input variables of type BOOL and TIME. Q0 and ET are
output variables of type BOOL and TIME. If IN is FALSE, then Q0 is
FALSE and PT is 0.

As soon as IN is TRUE, ET (elapsed time) starts running. This continues


until ET is equal to PT (preset time).

Q0 is TRUE if IN is TRUE and ET is less than PT. Otherwise it is FALSE.


So Q0 yields a pulse of duration PT.

The behaviour of TP is represented graphically below.

TON

Timer delay ON

TON(IN, PT, Q0, ET) means:

IN and PT are input variables of type BOOL and TIME. Q0 and ET are
output variables of type BOOL and TIME. If IN is FALSE, then Q0 is
FALSE and PT is 0.

As soon as IN is TRUE, ET (elapsed time) starts running. This continues


until ET is equal to PT (preset time).

Q0 is TRUE, if IN is TRUE and ET is equal to PT. Otherwise it is FALSE.


So the rising edge of input IN (the TRUE value) is transferred time
delayed (delay = PT) to the output Q0.

The behaviour of TON is represented graphically below.

manual ecolog asi system page Appendix-33


TOF

Timer delay OFF

TOF(IN, PT, Q0, ET) means:

IN and PT are input variables of type BOOL and TIME. Q0 and ET are
output variables of type BOOL and TIME. If IN is TRUE, then Q0 is
FALSE and PT is 0.

As soon as IN is FALSE, ET (elapsed time) starts running. This continues


until ET is equal to PT (preset time).

Q0 is FALSE, if IN is FALSE and ET is equal to PT. Otherwise it is


TRUE. So the falling edge of input IN (the FALSE value) is transferred
time delayed (delay = PT) to the output Q0.

The behaviour of TOF is represented graphically below.

page Appendix-34 manual ecolog asi system


C. The elements of the AS-i library

The defined POUs in the controller have direct access to most of the AS-
i data so that the work with AS-i is very simple and effective. There is a
number of AS-i functions in a special library (ecoasi.lib) for this purpose.
To use these functions the library must be linked to the project.

C.1 The lists (LDS, LAS, LPS)

There are functions which are used for writing to or reading from the lists
of the AS-i slaves defined in the project.

LDS_lesen (read LDS)


LDS_lesen (BYTE Slave, BYTE ASI_Master_Strang) : BOOL
Determines if a slave (named ‘Slave’) is contained in the List of
Detected Slaves.
This is the case when the specific slave is detected by the AS-i master in
the specific AS-i line ('ASI_Master_Strang').
Slave and ASI_Master_Strang are of type BYTE. The result is of type
BOOL.
The result is TRUE if the slave searched is detected.

Example:

LD SlaveSearched
LDS_lesen 1 (* AS-i line 1*)
JMPCN SlaveMissing

LAS_lesen (read LAS)


LAS_lesen (BYTE Slave, BYTE ASI_Master_Strang) : BOOL
Determines if a slave (named ‘Slave’) is contained in the List of Active
Slaves.
This is the case when the specific slave is detected by the AS-i master in
the specific AS-i line ('ASI_Master_Strang') and its configuration data
corresponds to the projected data.
Slave and ASI_Master_Strang are of type BYTE. The result is of type
BOOL.
The result is TRUE if the slave searched is detected and its configuration
data are the same as the projected data.

Example:

LD SlaveSearched
LAS_lesen 1 (* AS-i line 1*)
JMPCN SlaveNotCorrect

LPS_lesen (read LPS)


LPS_lesen (BYTE Slave, BYTE ASI_Master_Strang) : BOOL
Determines if a slave (named ‘Slave’) is contained in the List of
Projected Slaves.

manual ecolog asi system page Appendix-35


This is the case when the specific slave in the specific AS-i line
('ASI_Master_Strang') has been projected (planned) by the project
engineer (i.e. it has been entered in the LPS).

Slave and ASI_Master_Strang are of type BYTE. The result is of type


BOOL.
The result is TRUE if the slave searched has been projected.

Example:

LD SlaveSearched
LPS_lesen 1 (* AS-i line 1*)
JMPCN SlaveNotProjected

C.2 Slave information

A distinction is made between current (actual) and projected (planned)


parameters and configuration. This information is also accessed via
functions contained in the library ecoasi.lib.

akt_IOConf_lesen (read actual I/O


configuration)
akt_IOConf_lesen (BYTE Slave, BYTE ASI_Master_Strang): BYTE
Reads the actual I/O configuration of a given slave in the specific AS-i
line ('ASI_Master_Strang'). The I/O configuration defines the type of data
bits for a given slave (input / output / bidirectional).

Slave, ASI_Master_Strang and result (output of function) are of type


BYTE. The I/O configuration requires only 4 bits since it ranges from
0...15. The result is therefore also in this range.

Example:

LD SlaveSearched
akt_IOConf_lesen 1 (* AS-i line1*)
EQ 7
JMPC SlavesBidirectional

akt_IDCode_lesen (read actual ID-


code)
akt_IDCode_lesen (BYTE Slave, BYTE ASI_Master_Strang): BYTE
Reads the actual ID code of a given slave in the specific AS-i line
('ASI_Master_Strang'). The ID code defines the type of the data bits for a
given slave (switching signal, ready for operation etc.). The ID code of a
slave is usually given in its data sheet.
Slave, ASI_Master_Strang and result (output of function) are of type
BYTE. The ID code requires only 4 bits since it ranges from 0...15. The
result is therefore also in this range.

Example:

page Appendix-36 manual ecolog asi system


LD SlaveSearched
akt_IDCode_lesen 1 (* AS-i line 1*)
EQ 16#F
JMPC SlavesManufacturerSpecific

akt_Parameter_lesen (read actual


parameter)
akt_Parameter_lesen (BYTE Slave, BYTE ASI_Master_Strang): BYTE

Reads the actual parameters of a given slave in the specific AS-i line
('ASI_Master_Strang'). The parameters define additional options for an
intelligent slave (sensing range etc.).

Slave, ASI_Master_Strang and result (output of function) are of type


BYTE. The parameters require only 4 bits since they range from 0...15.
The result is therefore also in this range.

Example:

LD LevelSensorTop (*slave number*)


akt_Parameter_lesen 1 (* AS-i line 1*)
ST SensingRange

proj_IOConf_lesen (read projected


I/O configuration)
proj_IOConf_lesen (BYTE Slave, BYTE ASI_Master_Strang):BYTE

Reads the projected I/O configuration of a given slave in the specific AS-
i line ('ASI_Master_Strang'). The I/O configuration defines the type of
data bits for a given slave (input / output / bidirectional).

Slave, ASI_Master_Strang and result (output of function) are of type


BYTE. The I/O configuration requires only 4 bits since it ranges from
0...15. The result is therefore also in this range.

Example:

LD SlaveSearched
proj_IOConf_lesen 1 (* AS-i line 1*)
EQ 7
JMPC SlaveShouldBeBidirectional

proj_IDCode_lesen
(read projected ID code)
proj_IDCode_lesen (BYTE Slave, BYTE ASI_Master_Strang):BYTE
Reads the projected ID code of a given slave in the specific AS-i line
('ASI_Master_Strang'). The ID code defines the type of the data bits for a
given slave (switching signal, ready for operation etc.). The ID code of a
slave is usually given in its data sheet
Slave, ASI_Master_Strang and result (output of function) are of type
BYTE. The ID code requires only 4 bits since it ranges from 0...15. The
result is therefore also in this range.

Example:

manual ecolog asi system page Appendix-37


LD SlaveSearched
proj_IDCode_lesen 1 (* AS-i line 1*)
EQ 16#F
JMPC SlaveShouldBeManufacturerSpecific

Input_lesen (read input)


Input_lesen (BYTE Slave, BYTE ASI_Master_Strang):BYTE
Reads the input data of a given slave in the specific AS-i line
('ASI_Master_Strang'). The data can be accessed via slave number and
AS-i line. Consequently this data can be used in function blocks.

Slave, ASI_Master_Strang and result (output of function) are of type


BYTE. The input data requires only 4 bits since it ranges from 0...15. The
result is therefore also in this range.

Example:

LD SlaveNum (*Slave number*)


Input_lesen 1 (* AS-i line 1*)
ST %MB70 (*Processed as bit address*)

Output_schreiben (write output)


Output_schreiben (BYTE Wert, BYTE Slave, BYTE ASI-Master-
Strang):BYTE

Writes the output data ('Wert') of a given slave in the specific AS-i line
('ASI_Master_Strang'). The data can be accessed via slave number and
AS-i line. Consequently this data can be used in function blocks.

Slave, ASI_Master_Strang are of type BYTE. The value ('Wert') is of


type BYTE. The output data requires only 4 bits and consequently the
value of 'Wert' must be in the range 0...15.

Example:

LD %MB70 (*Result of bit operation*)


Output_schreiben SlaveNum, 1 (*Slave number, AS-i line 1*)

proj_Parameter_schreiben (write
projected parameter)
BYTE proj_Parameter_schreiben (BYTE Parameter, BYTE Slave,
BYTE ASI_Master_Strang)
Writes the projected parameters of a given slave in the specific AS-i line
('ASI_Master_Strang') to that slave. The parameters can be accessed via
slave number and AS-i line. Consequently they can be used in function
blocks.

Slave, ASI_Master_Strang and the variable Parameter are of type


BYTE. The result is therefore also in this range. The parameters require
only 4 bits and consequently the value of Parameter must be in the
range 0...15.

Example:

page Appendix-38 manual ecolog asi system


LD Parameter
proj_Parameter_schreiben Sensor, 1 (*Slave number, AS-i line 1*)

akt_Parameter_schreiben (write
parameters)
akt_Parameter_schreiben (BYTE Parameter, BYTE Slave, BYTE
ASI_Master_Strang) :BYTE

Writes the parameters of a given slave in the specific AS-i line


('ASI_Master_Strang') to that slave. The parameters can be accessed via
slave number and AS-i line. Consequently they can be used in function
blocks.

Slave, ASI_Master_Strang and the variable Parameter are of type


BYTE. The result is therefore also in this range. The parameters require
only 4 bits and consequently the value of Parameter must be in the
range 0...15.

Example:

LD SensingRange
akt_Parameter_schreiben Sensor, 1 (*Slave number, AS-i line 1*)

Ist_Konfigurations-
daten_projektieren
(project actual configuration data)
Ist_Konfigurationsdaten_projektieren(BYTE ASI_Master_Strang):BYTE

The AS-i-master reads and stores the configuration and actual


parameters of the connected slaves in the specific AS-i line
('ASI_Master_Strang'). The configuration is now remanently stored (i.e.
remains even if the voltage is removed). The controller indicates a
deviation from this configuration via the LED ‘ALARM KONFIG’.

ASI_Master_Strang is of type BYTE.

Example:

LD 1 (* AS-i line 1 *)
Ist_Konfigurationsdaten_projektieren

manual ecolog asi system page Appendix-39


D. The asisys operands

In asisys operands can be constants, variables and addresses. The


various types of operands with their characteristics are listed below.

D.1 BOOL constants

BOOL constants are the values TRUE and FALSE. Variables of type
BOOL are assigned one of these values depending on the POU and the
state of other variables in the system.

D.2 TIME constants

In asisys constants of type TIME can be declared. The timer function


blocks of the standard library use for example TIME constants. A TIME
constant consists of a leading "t" or "T" and a cross "#" followed by the
time declaration which consists of minutes ("m"), seconds ("s") and
milliseconds ("ms"). Note that the time values have to be ordered by
size, i.e. seconds are declared before milliseconds; minutes before
seconds, etc. Some values can also be missing. The time range can be
set to max. 655,350 ms (i.e. approx. 10 min. 55 s)

Examples for correct initialisation of TIME constants are:

T1:TIME:= T#14ms;
T2:TIME:= T#100S12ms; (*Overflow in the first component*)
(*is permitted*)
T3:TIME := t#4m15s20ms;

not correct would be:

T4:TIME := t#5m68s; (*Overflow in a lower time value. *)


(*Correct would be: t#6m8s*)
T5:TIME := 15ms; (*missing T#*)
T6:TIME := t#4ms13m; (*wrong order of the time values*)
T6:TIME := 19m; (*too high, max. value is 10m55s*)

D.3 Numbers

In asisys, numbers can be denoted as duals, octals, decimals or


hexadecimals. If a number is not a decimal, the base has to be denoted
followed by a "#" and the number. The hexadecimal digits 10 to 15 are
denoted by the letters A-F.

Underscores within a digital value are not allowed.

page Appendix-40 manual ecolog asi system


Examples:

14 (decimal)
2#1001_0011 (dual)
8#67 (octal)
16#A (hexadecimal)

The type of these numbers can be BYTE, WORD, DWORD, INT or


DINT

D.4 Strings

A string is any sequence of characters. String constants are limited by


apostrophes on the left and right. Blanks can also be entered and are
treated the same way as all other characters.

Examples:

‘enough water?’
‘calibrated value: 200’
‘:-)’

D.5 Variables

Variables are declared either locally (in the declaration part of a POU) or
globally (in the global variable list).

The identifiers of variables (names) must contain no spaces, they must


not be declared twice and must not be identical to keywords.

Variables can be used wherever the declared type is permitted.

D.6 Addresses

Direct representation of a single element variable is provided by a


special symbol formed by the concatenation of the percent sign "%", a
location prefix and a size prefix and one or more unsigned integers,
separated by periods.

manual ecolog asi system page Appendix-41


bit address (only variables of length X):
0..3 : for AS-i inputs/outputs
(data bit D0..D3)
0..7 : for flags or inputs / outputs to the field
bus system
AT %IX1.2.1 slave or flag adresses:
0..63/31 : for inputs/outputs of the field bus
variable type: system (byte number)
I : input 1..31 : for inputs/outputs (slave number)
Q : output 0..255: for byte-wise addressing of flags
M : flag 0..127: for word-wise addressing of flags
0..63 : for double-word-wise addressing of flags
variable length:
X : 1 bit (bool) master:
B : 8 bit (byte) 0 : optional field bus system
W : 16 bit (word) 1 : first AS-i system
D : 32 bit 2 : optional second AS-i system
(double word) For flag addresses this entry and the
following point are not used.

The following location prefixes are supported:

I Input location
Q Output location
M Memory location

The following size prefixes are supported:

X Single bit size


None Single bit size
B Byte (8 bits) size
W Word (16 bits) size
D Double word (32 bits) size

Examples:

%QX1.16.2 or
%Q1.16.2 Output data bit 2, slave 16, AS-i line 1
%IB1.21 Input byte, slave 21, AS-i line1 (Note that only the
lower 4 bits are relevant here, since a slave is
assigned only 4 bits) .
%QB2.7 Output byte, slave 7, AS-i loop 2, a second AS-i line
is present for example with the AC1004 (Note that
only the lower 4 bits are relevant here, since a slave
is assigned only 4 bits) .

page Appendix-42 manual ecolog asi system


D.6 Flags

Flags
The controller contains 256 flag bytes (%MB0... MB255), the first 64 flag
bytes are remanent (%MB0...%MB63). The remaining flag bytes
(%MB64... %MB255) are initialized to zero when the controller is turned
on.

All allowed variable types can be used to address flags.

Examples:

%MW48 can be used to access bytes 96 and 97 (48*2=96).


%MX5.0 can be used to to access the first bit of byte 5.

System flags
System flags are variables which access additional information from the
AS-i master or the Profibus connection. To find out which system flags
your system has, press F2. A screen appears in which 'System Variable'
can be selected.

In addition, the time monitoring status (watchdogs) of the programming


and process interface can be scanned.

A TRUE before %IX1.0.0 indicates that the time monitoring of the


programming interface has elapsed. But before this it must have been
activated by a call in the interface protrocol. asisys does not support this
call.

A TRUE before %IX1.0.1 indicates that the time monitoring of the


process interface (Profibus DP, InterbusS, DeviceNet, ...) has elapsed,
i.e. there is no connection to the higher-level system.

manual ecolog asi system page Appendix-43


A list of system variables as shown below then appears.

ASI1_OFFLINE No exchange of data in the AS-i system 1


ASI1_SPANNUNGSFEHLER AS-i system 1 voltage supply faulty
ASI1_NORMAL AS-i system 1 in normal operation
ASI1_PROJEKTIER_MODUS AS-i system 1 in the projection mode
ASI1_AUTO_ADRESS_MOEGLICH Autom. addressing possible in the AS-i system 1
ASI1_AUTO_ADRESSIERUNG Autom. addressing allowed in the AS-i system 1
ASI1_SLAVE0_VORHANDEN Slave 0 connected to the AS-i system 1
ASI1_KONFIG_OK Configuration of the AS-i system 1 is OK

ASI2_OFFLINE No exchange of data in the AS-i system 2


ASI2_SPANNUNGSFEHLER AS-i system 2 voltage supply faulty
ASI2_NORMAL AS-i system 2 in normal operation
ASI2_PROJEKTIER_MODUS AS-i system 2 in the projection mode
ASI2_AUTO_ ADRESS _MOEGLICH Autom. addressing possible in the AS-i system 2
ASI2_AUTO_ ADRESSIERUNG Autom. addressing allowed in the AS-i system 2
ASI2_SLAVE0_VORHANDEN Slave 0 connected to the AS-i system 2
ASI2_KONFIG_OK Configuration of the AS-i system 2 is OK

They can be used like normal global variables in the plc program.

D.7 Arrays

asisys supports 1, 2 and 3 dimensional arrays. The syntax of a two


dimensional array is as follows:

<Array_Name>: ARRAY [<lb1>..<ub1>,<lb2>..<ub2>] of <elementary


data type>.

Array_Name is an identifier and lb1, ub1, lb2 ub2 have to be integer


literals.

Example:

Cardgame: ARRAY [1..13, 1..4] OF INT;

If an element of an array is used as an operand, it is addressed as


follows:

<Array_Name>[Index1, Index2]

Element (9, 2) in the upper example array would be addressed as


follows:

Cardgame[9, 2]

page Appendix-44 manual ecolog asi system


Addressing of structure
components
Components of structured variables are addressed as follows:

<Structure_Name>.<Component_Name>

Consider for example a structure with the name "Week" which contains a
component called "Monday". This component would be addressed as
follows:

Week.Monday

Addressing of POU variables


Variables of function blocks and programs are addressed in the same
way as structured components. First the name of the POU has to be
indicated, then a point followed by the name of the desired variable.

manual ecolog asi system page Appendix-45


E. Error message reference

The parser may produce the following errors:

"Non-Boolean expression <name> used with


contact"

Change the expression associated with the contact to a Boolean


expression.

"Non-Boolean expression <name> used with


coil"

Change the expression associated with the coil to a Boolean expression.

"Identifier expected"

Write a valid identifier at the beginning of the declaration line.

"Overflow of identifier list"

Reduce the number of identifiers (64,000 are possible).

"VAR, VAR_INPUT, VAR_OUTPUT or


VAR_INOUT expected"

The first line after the name of a POU must contain one of these
keywords.

"Unexpected end"

In the declaration part: Add the END_VAR keyword at the end of the
declaration part.

Text editor: Add statements which end the last statement sequence.

"END_VAR or identifier expected"

Write a valid identifier at the beginning of the declaration line or


END_VAR.

"Expecting... or ..."

Write one of the two items in the line where the error occurred.

"Name used in interface is not identical with


POU Name"

Rename POU with 'Project' 'Rename Object' or change the name of the
POU in the declaration part of the POU. The name must be written
immediately after the PROGRAM, FUNCTION or FUNCTION BLOCK
keyword.

page Appendix-46 manual ecolog asi system


"Expecting type specification"

Write a valid type after the identifier of the declaration

"Error in initial value"

Write a literal corresponding to the type of the declaration as initial


value.

"Duplicate definition of identifier <Name>"

Rename one of the identifiers with the same name.

"Identifier <Name> not defined"

Declare this identifier in the declaration part of the POU or in the global
variable list.

"LD expected"

In this line only a LD statement is allowed.

"IL Operator expected"

Change the first string of the line to a valid operator or function.

"Variable with write access or direct address


required for ST, STN, S, R"

Replace the operand by a variable with write access.

"Type mismatch: Cannot convert <Type1> to


<Type2>."

Check the required types of the operand (to do so, search the operand in
your Help File). Change the type of the variable which produced the error
to an allowed type or take another variable.

"Unexpected end of text in brackets"

Insert a closing bracket.

"<Operator> in brackets not allowed"

This operator is not allowed within brackets. Either remove the brackets
or the operator.

"Closing bracket with no corresponding opening


bracket"

Delete the closing bracket or add an opening bracket.

manual ecolog asi system page Appendix-47


"Operand expected"

Add an additional operand.

"Operator is not extensible"

Check the number of operands for this operator and remove the
supernumerary ones.

"Number expected after '+' or '-'"

Change the string after the + or - to a valid literal.

"No comma allowed after ')'"

Remove the comma.

"Unknown type <string>"

Change <string> to a valid type.

"'[<index>]' needs array variable"

Declare the identifier preceding the brackets as an array or change it to a


declared array variable.

"Index expression of an array must be of type


INT"

Change the index to an INT literal or a variable of type TYPE INT.

"Too many indexes for array"

Check the number of indexes (1, 2 or 3) the array is declared for and
remove the supernumerary indexes.

"Too few indexes for array"

Check the number of indexes (1, 2 or 3) the array is declared for and add
the missing indexes.

"'.' needs structure variable"

The identifier to the left of '.' is not a structure variable or a function block
instance. Change it to a structure variable or a function block instance or
remove the point and the identifier to the right of the point.

"<component> is not a component of


<variable>"

If variable is a structure, change <component> to one of the variables


declared in this structure. If variable is a function block instance, change
<component> to one of the input or output parameters declared in the
function block.

page Appendix-48 manual ecolog asi system


"'N' modifier requires operand of type BOOL"

Remove N and negate the operand explicitly with the NOT operator.

"<identifier> is no function"

Change <identifier> to one of the functions of the libraries linked to the


project or one of the functions declared in the project.

"Type mismatch in parameter <number>:


Cannot convert <Type1> to <Type2>."

Check the required types of the operand number <number> for this
operator, function or function block. Change the type of the variable
which produced the error to an allowed type or take another variable of
an allowed type.

"Conditional Operator requires type BOOL"

The result of the preceding instructions is not of type BOOL. Insert an


operator or a function which has a Boolean result.

"Function name not allowed here"

Replace the function call by a variable or literal.

"Label in brackets not allowed"

Remove the label or the brackets.

"Label <LabelName> is not defined"

Define a label <LabelName> or change <LabelName> to a defined label.

"CAL, CALC or CALN require function block


instance as operand"

Declare an instance of the function block you want to call.

"Address expected after 'AT'"

Insert a valid address after the AT keyword or remove the AT keyword.

"Only BOOL variables allowed on bit


addresses"

Change type of the declaration to BOOL or change address to another


size.

"Only VAR and VAR_GLOBAL can be located


to addresses"

Remove address location.

manual ecolog asi system page Appendix-49


"It is not possible to locate a multidimensional
array to an address"

Remove address location.

"It is not possible to locate an array of strings to


an address"

Remove address location.

"It is not possible to locate an array of an array


to an address"

Remove address location.

"Unrecognized variable or address"

This watch variable is not declared in the project. You get help for
declared variables when pressing <F2>.

"Extra characters following valid watch


expression"

Remove these extra characters.

"POU <name> is not defined"

Define a POU <name> with 'Project' 'Add Object' or change <name> to


the name of a defined POU.

"<Name> is not an input variable of the called


function block"

Check the input variables of the called function block and change
<Name> into one of these variables.

"Type mismatch on input variable <Name>:


Cannot convert <Type1> to <Type2>."

<Name> is assigned a value of inappropriate type. Change the variable,


literal or statement assigned to <Name>.

"Jump and Return is only allowed on the right


side of a network"

Remove the Jump or Return.

"Jump and Return require BOOL as input type"

The result of the preceding instructions is not of type BOOL. Insert an


operator or a function which has a Boolean result.

"A jump must have exactly one label"

Change the text of the jump statement to a defined label.

page Appendix-50 manual ecolog asi system


"POU <Name> need exactly <number> inputs"

Check the number of inputs required for this POU and remove or add the
supernumerary or missing ones.

"Another ST statement or end of POU


expected"

The POU ends in an incomplete statement. Complete the statement or


remove it.

"Too many parameters in function <name>"

Remove the supernumerary parameters.

"Too few parameters in function <name>"

Add the missing parameters.

"IF or ELSIF require BOOL expression as


condition"

Change expression to an expression with result BOOL.

"WHILE requires BOOL expression as


condition"

Change expression to an expression with result BOOL.

"UNTIL requires BOOL expression as


condition"

Change expression to an expression with result BOOL.

"NOT requires BOOL operand"

Change operand to a Boolean operand.

"No instance specified for call of FB <Name>"

Change the text of the function block instance (initially "Instance") to the
identifier of a valid function block instance declaration.

"<Name> must be a declared instance of FB


<FBName>"

Change the text of the function block instance (initially "Instance") to the
identifier of a valid function block instance declaration.

"Variable of FOR statement must be of type


INT"

Change the variable to a variable of type INT.

manual ecolog asi system page Appendix-51


"Expression in FOR statement is no variable
with write access"

Change the variable to a variable with write access.

"Start value of FOR statement must be of type


INT"

Change the variable to a variable of type INT.

"End value of FOR statement must be of type


INT"

Change the variable to a variable of type INT.

"Increment value of FOR statement must be of


type INT"

Change the variable to a variable of type INT.

"EXIT outside a loop"

Remove the exit.

"Illegal address: <Address>"

Check in your plc configuration which addresses are valid and replace
the address by a valid one or change the plc configuration.

"END_STRUCT or identifier expected"

The structure definition must end with an END_STRUCT keyword.

"<string> is no operator"

Replace <string> by a valid operator.

"Type mismatch in parameter <Name> of


<FBName>: Cannot convert <Type1> to
<Type2>."

For the assignment to the parameter <Name> use a variable of


<Type2>, or change the type of the assigned variable to <Type1>.

"Type mismatch in parameter <parameter> of


<POU>: Cannot convert <Type1> to <Type2>."

Check the required type of <parameter> of <POU>. Change the type of


the variable which produced the error to <Type2> or select another
variable of <Type2>.

"<name> is no function block"

Replace <name> by a valid function block name.

page Appendix-52 manual ecolog asi system


"No write access to variable <name> allowed"

Replace <name> by a variable with write access.

"Out of Memory"

Save the project and leave the system. Leave Windows, start new and
try again to build the project.

"<number> operands are too few for


<Operator>. At least <number> are needed"

Check how many operands <Operator> needs and remove the


supernumerary ones.

"<number> operands are too many for


<Operator>. Exactly <number> are needed"

Check how many operands <Operator> needs and add the missing ones.

"ADR needs a variable, not a expression or


constant as operand"

Replace expression or constant by a variable.

"Duplicate definition of label <name>"

You declared two labels with the same name. Rename one of them.

"Illegal duration constant"

You typed a wrong duration constant, possible errors are:

Missing t or # at the beginning.

Two occurrences of the same time unit (e.g.: t#4d2d).

Wrong order of time units.

Wrong time unit (no d, h, m, s or ms).

"Expecting Number, ELSE or END_CASE"

A CASE statement is finished incorrectly. Add the keyword END_CASE.

"CASE requires selector of an integer type"

The type of the selector variable is wrong. Change the selector to a


variable of type INT or change the type of the selector.

"Number expected after ','"

Remove ',' or add another number.

manual ecolog asi system page Appendix-53


"At least one statement is required"

Insert a statement.

"Integer number or symbolic constant


expected"

In this case (e.g. a CASE statement), only a integer number or symbolic


constant is allowed. Replace the wrong value.

"Multiple underlines in identifier"

Multiple underlines within identifier names are not allowed. Remove the
supernumerary ones.

"Comments are only allowed at the end of line


in IL"

Move the comment at the end of a line.

"At most 4 numerical fields allowed in


addresses"

Remove the supernumerary numerical fields.

"Keywords must be uppercase"

Write the keyword in capitals.

"Function block call requires function block


instance"

In the declaration part of the POU declare an instance of the function


block.

"Expression expected"

In this case an expression is expected.

"INI operator needs function block instance or


data unit type instance"

Change the operand to the instance of a function block. To do so,


declare the operand as a function block instance or use a declared
function block instance or use the instance of a data unit type.

"The global variables need too much memory.


Increase the number of segments in
'Project''Build Options'"

Just do what the message is telling you.

"Overflow in duration constant"

You used a duration constant which was too large.

page Appendix-54 manual ecolog asi system


"Step name is no identifier '<name>'"

Replace <Name> by a valid identifier.

"Extra characters following valid step name:


'<name>'"

Remove the extra characters.

"Step name duplicated: '<name>'"

Change one of the duplicate step names.

"Jump to undefined Step: '<name'"

Change <name> to the name of an existing step or insert a step with the
required name.

manual ecolog asi system page Appendix-55


F. AS-i-technical data

A list of technical data for AS-i systems is given below:

Topology: Tree structure


Medium: Unscreened 2-wire cable for data and power
supply to participants. (24V DC, max. 8 A per
system)
Size of system: 100 m, possible extension by means of repeaters.
Number of slaves: Up to 31 per AS-i system
Participants: Combination of 31 intelligent or 124 binary
participants per system, up to 248 participants with
bidirectional slaves.
Type of access: Master-slave (cyclical polling), single-master-
operation
Message: One address call of the master with direct answer
by the slave
Addressing: Definite address in the slave, addressing via the
master possible
Data: 4 bit data per slave call (cyclical); 4 bit parameter
(acyclic)
Cycle time: Max. 5 ms
Error protection: Identification and repetition of distorted telegrams

page Appendix-56 manual ecolog asi system


Function for the transfer of AS-i information via the serial interface:

AS-i information can be transferred via the serial interface. This


information is accessed using functions especially created for this
purpose. A list of these functions is given in the table below. A more
detailed description of the interface protocol can be obtained from ifm
electronic.

service comment
Login log in
Logout log out
Start execute user program
Stop do not execute user program
ReadVar read variables
WriteVar write variables
ReadStatus read status
DefineVarlist define variable list for reading
DeleteVarlist delete variable list for reading
Cycle execute user program exactly once
ForceVariables force variables
ReleaseVariables release forced variables
ReadWriteVar )* write and read variables
Masterflag read ASI flags from master to host
SlaveAdress readdress slave
ProjWrite write projected data of an ASI slave
LPSWrite write list of the projected slaves
ASIDataRead read current parameters, ID code and I/O conf. of a slave
SetProjMode set operating mode of the ASI master
IstZuSoll project current configuration data
SetAdrMode set simple/multiple automatic addressing
GetAdrMode scan simple/multiple automatic addressing
GetVersion scan hardware and software version
ParaWrite write parameter to a slave
GetHWKonfig )* get hardware configuration of the controller
SetSer0Wdg )* set watchdog for programming-port (Ser 0)

)* only ASI controllers with SW-version 1.14 or higher!

manual ecolog asi system page Appendix-57


page Appendix-58 manual ecolog asi system
G. Controller installation and user instructions

Proper application
The AS-i controller has one or two AS-i masters depending on the
controller type. Each is in accordance with the master specification for
profile M1.

As many as 31 slaves can be connected to each master. The amount of


data is 4 bits per slave resulting in 124 I/O's with standard modules or
248 I/O's with bidirectional modules. The 124 parameter bits can also be
used.

The serial interface is for data transfer between the controller and for
example a PC. It also serves to transfer projects (code and data) to the
controller.

The ASI-DP-controller has in addition an interface as Profibus (L2) DP


slave.

The controller can be operated in the field using the operating and
display elements or via a PC.

Mounting
The unit can be mounted using a 35 mm-DIN-mounting rail (EN 50022).
The protection rate is IP20 and therefore it is to be mounted in for
example a switching cabinet.

Electrical connections
Disconnect power. Connect the unit in accordance with the terminal
markings.

Pay attention to proper polarity of ASI+, ASI- and 24V+ and 0V. Do not
connect the minus potentials together. Do not connect the minus
potentials to the PE connection!

The PE connection is to be connected to the plant ground.

For the serial and/or Profibus connection please use the proper cable.

Operating and display

manual ecolog asi system page appendix-59


Status-LED Color Meaning

ALARM CONFIG red actual and preset configuration different

NOT AUTO ADDR red automatic addressing not enabled

ASI PWR green AS-i -voltage o.k.

COM MODE green normal operation mode

PROJ MODE yellow projecting mode, all slaves activated

PROJ MODE yellow slave 0 detected, switching into protected mode


flashing not possible

CTRL yellow controller in run-mode

Mode: mode select / next mode

Set: acknowledge / next field

Display
1st digit: mode

2nd digit: master 1 or 2

3rd+4th digit: slave address

Power up
After the supply voltage has been turned on the LED-test is automatically
carried out. All status LED's and display segments are turned on for 1
second.

Then the version number of the controller hardware, the software


operating system and the software version of the AS-i master are
displayed. This information is stored (indelibly, as far as the user is
concerned) by the manufacturer in a PROM before shipment.

To prevent improper entries during operation functions 5 and above are


disabled at power up.

All functions can be enabled by pressing 'MODE’ and ‘SET’ for 5


seconds.

page appendix-60 manual ecolog asi system


Function

1 display of missing or defective only active in the protected mode


slaves (LES<>LPS)
2 display of detected slaves (LDS)
3 display of projected (configured)
slaves (LPS)
4 display of activated slaves
(LAS)
5 allocate address 0 to a slave only allowed in the projecting mode
(from the LDS)
6 allocate an address to slave 0 proper addresses can be selected
7 enable automatic addressing for one or more defective slaves
88.PP project the detected slaves separately selectable for master 1 and
(LDS -> LPS) 2
8.7 special function: operation limit functions 5 and above enable/disable
9 controller run/stop
A controller-address for RS232C-/ RS485- and Profibus-DP-
operation (default=1)
b baud rate of serial interface for RS232C-/ RS485- operation
(default=19200 baud)

No error detected :
Display remains out!

Function 1 :
Display missing or defective slaves.

Missing or defective slaves are automatically displayed when the


protected mode is active.

In this example the slave having address 20 in AS-i master 1 is missing.


Should more than one slave be missing then their addresses are
displayed one after the other in an interval of 1 second.

Functions 2 - 6 :
see the table above

Function 7 :
Automatic Addressing

The automatic addressing of AS-i participants can be enabled/disabled.

manual ecolog asi system page appendix-61


The option 'multiple automatic addressing' is also selectable. This
option allows the replacement of more than one missing slave. The
addressing takes place in ascending order in accordance with the LPS
(List of Projected Slaves).

Function 7 is valid for one or two AS-i masters.

Meaning:
automatic multiple autom.
addressing addressing
disabled enabled master 1 enabled master 2

Function 8 :
Project (configure) detected slaves

A quick and easy commissioning of the AS-i system is made possible


using this function.

Example:
Transfer projected slaves:

After addressing and installation the slaves are in the LDS = List of
Detected Slaves. The master reads this list, which then becomes the
LPS (List of Projected Slaves). This list is stored in an EEPROM.

To perform this function the master switches into the projecting mode
and then back to the protected mode.

Operation:
1. Select function 8 and master 1 (or 2)

2. After pressing ‘SET’ the last two display fields (at the right) show a
flashing ‘PP’, indicating that the master is in the projecting mode.

3. After pressing ‘SET’ again the display stops flashing for 2 seconds.The
data is then stored as described above. The operation is now complete
and 'PP' is no longer displayed.

page appendix-62 manual ecolog asi system


Function 8.7 :
Operation limit: functions 5 and above enable/disable

To prevent improper entries during operation functions 5 and above are


disabled at power up. This can also be carried out using this function.

This takes place by selecting the following code:

This function can be disabled by pressing 'MODE’ and ‘SET’ for 5


seconds.

Function 9 :
Controller run/stop

The integrated controller processor can be influenced with this function:

RUN = Project is processed


STOP = Project is not processed

Display:

(run) (stop)

Function A :
Controller-Address

The controller has a permanently stored address (remains even if


voltage is turned off) by means of which it can be accessed via the serial
interface.

This is especially to be considered in the case of multi-point operation of


several controllers using the RS485 interface or using Profibus DP.

All controllers are given the address 001 upon manufacture. This
address can be changed using function A.

Display:

Function b : baud rate of the


serial interface
The transfer rate (baud rate) of the RS232C/RS485 interface can be
permanently set using this function.

manual ecolog asi system page appendix-63


The display and corresponding rates are:

048 4800 baud

096 9600 baud

192 19200 Baud

384 38400 Baud

576 57600 Baud

In the case of multi-point operation of several controllers please ensure


that all controllers have the same baud rate.

The value entered upon manufacture is 192 (=19200 baud).

Display:

Error messages

E - 00 Software-version AS-i-line1 different from


AS-i-line 2
E - 01 Error Profibus DP initialisation
E - 34 AS-i-master 2: mode already active
E - 35 AS-i -master 2: addressing mode already
active
E - 36 AS-i-master 2: error in allocating new address
E - 37 AS-i-master 2: error in deleting old address
E - 38 AS-i-master 2: slave with old address not
detected
E - 39 AS-i-master 2: slave with new address
detected
E - 40 AS-i-master 2 offline / slave 0 detected
E - 41 AS-i-master 2 not in proj.-mode
E - 42 AS-i-master 2 not in proj.-mode
E - 43 AS-i-master 2 not in proj.-mode / configuration
data invalid
E - 44 AS-i-master 2 not in proj.-mode
E - 45 AS-i-master 2 offline
E - 46 AS-i-master 2: parameter value invalid

page appendix-64 manual ecolog asi system


E - 47 AS-i-master 1: mode already active
E - 48 AS-i-master 1: addressing mode already
active
E - 49 AS-i-master 1: error in allocating new address
E - 50 AS-i-master 1: error in deleting old address
E - 51 AS-i-master 1: slave with old address not
detected
E - 52 AS-i-master 1: slave with new address
detected
E - 53 AS-i-master 1 offline / slave 0 detected
E - 54 AS-i-master 1 not in proj.-mode
E - 55 AS-i-master 1 not in proj.-mode
E - 56 AS-i-master 1 not in proj.-mode / configuration
data invalid
E - 57 AS-i-master 1 not in proj.-mode
E - 58 AS-i-master 1 offline
E - 59 AS-i-master 1: parameter value invalid
E - 60 AS-i-master 2 not connected
E - 61 no project in controller
E - 70 no entries in LDS
E - 71 no entries in LPS
E - 72 no entries in LAS
E - 73 no free slave address
E - 90 slave 0 not detected
E - 91 target address already allocated
E - 92 new address could not be allocated
E - 93 multiple auto-addressing disabled
E - 94 I/O-configuration incorrect
E - 95 ID-code incorrect
E - 96 addressing not possible, automatic addressing
not selected
E - 97 addressing of more than one slave not
possible, multi auto-addressing not selected
E - 98 protected mode not active
E - 99 slave 0 already detected

manual ecolog asi system page appendix-65


page appendix-66 manual ecolog asi system
H. Description of AS-i ↔ Profibus-DP interface

The Profibus-DP controller includes a Profibus-DP slave interface in


accordance with DIN 19245 part 3. A Profibus-DP master system can
cyclically exchange data with the Profibus-DP controller via this
interface. The data are exchanged either with or without signal pre-
processing. Operation without signal pre-processing is also called
gateway operation.

The Profibus-DP process data interface is equipped with a Profibus IC


SPC 3 permitting transfer rates of between 9.6 KBd and 12 MBd. The
Profibus-DP transfer rate is automatically recognised and set by the
controller. The interface is designed so that during normal operation the
PLC CPU is not affected as far as time is concerned.

The freeze mode as well as the sync mode of the Profibus-DP are
supported.

The Profibus-DP address is displayed and modified via the operator


interface of the controller under option A. Changes are also possible via
Profibus-DP.

Please note that the address is likewise used as controller address on


the new programming interface. Therefore please set the new
address also in the configuration of asisys in the master window
accordingly since otherwise a communication error with asisys will
occur!

The asisys diskette also contains the GSD file and various type files for
the controller:

• IFM_00AB.GSD: GSD file for Siemens master CP 5412 A2 (PC


card) as well as Bosch master and others

• IF00ABTD.200: type file for Siemens software COM ET 200 V4.X


German
IF00ABTE.200: type file for Siemens software COM ET 200 V4.X
English
IF00ABTF.200: type file for Siemens software COM ET 200 V4.X
French
IF00ABTI.200: type file for Siemens software COM ET 200 V4.X
Italian
IF00ABTS.200: type file for Siemens software COM ET 200 V4.X
Spanish

• IF00ABAX.200: type file for Siemens software COM ET 200


Windows V2.X for modules IM 308 C, CP342-5
(master for S7) and others

manual ecolog asi system page appendix-67


Two modes of operation are distinguished for the controller:

• Gateway function

If the controller is in the STOP mode of operation, only the I/O data of
the AS-i masters can be directly read and written. In this case the
controller operates as gateway.

• Signal pre-processing

If the controller is in the RUN mode of operation, data between the


Profibus master and the PLC in the controller can also be exchanged.

Table H1 shows the data structure. The PLC in the controller can, for
example, exchange analog data from and to slaves via a function
block in the user program and to make them available to the higher-
level system in prepared form. In order to avoid possible conflicts
between the output data of the Profibus master and the PLC the
direct output of Profibus data to the AS-i master is not possible in this
mode of operation; only the PLC can write output data (see table H1).

Profibus DP AS-interface
gateway
AS-i Profibus-DP controller
32-byte outputs 32-byte inputs
no CTRL address %IB1.1 -%IB1.31
or
CTRL run/stop
%IB2.1 -%IB2.31
32-byte inputs
CTRL addresses
%IB0.32 -%IB0.63 32-byte outputs
%QB1.1 -%QB1.31
additional area or
32-byte outputs %QB2.1 -%QB2.31
CTRL addresses
%QB0.0 -%QB0.31 signal preprocessing

32-byte inputs CTRL


CTRL addresses
%IB0.0 - %IB0.31

Table H.1 Assignments in the AS-i Profibus-DP controller

page appendix-68 manual ecolog asi system


To optimise the data transfer time and the memory requirement in the
Profibus-DP master it is possible to transfer the data fields completely,
partly or not at all. The scope of input range and output range is always
the same. The coupling/interface area (first area) can be configured to
0, 16 or 32 bytes.

A second area exchanges the data directly with signal pre-processing


and can only be used if the latter is activated. The second area can be
configured in 2-byte steps between 0 and 32-byte scope.

It has to be noted that an indication within the projection tool in area 1 is


at any rate required. If no PLC data are needed, the indication can be
omitted in area 2.

The assignment of the coupling/interface area to the I/O data is as


follows:

byte no. bits 4-7 bits 0-3


0 status/control nibble slave 1
1 slave 2 slave 3
2 slave 4 slave 5
3 slave 6 slave 7
4 slave 8 slave 9
5 slave 10 slave 11
6 slave 12 slave 13
7 slave 14 slave 15
8 slave 16 slave 17
8 slave 18 slave 19
10 slave 20 slave 21
11 slave 22 slave 23
12 slave 24 slave 25
13 slave 26 slave 27
14 slave 28 slave 29
15 slave 30 slave 31

The allocation of the status nibble is:

bit no. meaning =1 =0


7 signal pre-processing active inactive
6 AS-i power / configuration not O.K. O.K.
5 start up finished yes no
4 reserved

The control nibble does not yet have any meaning.

manual ecolog asi system page appendix-69


Projection check list of a Profibus-DP system

To project a Profibus-DP system some PLC manufacturers such as Allen


Bradley, Bosch, Siemens and others supply projection tools which permit
parameterization and projection of a Profibus system.

The following contains a brief explanation of the projection tool COM ET


200 Windows V2.X supplied by the SIEMENS AG company.

This does not replace the corresponding manual. For more detailed
information please refer to one of these manuals.

• Start check list

⇒ Copy the IF00ABAX.200 controller type file into the subdirectory


TYPDAT5X.

⇒ Call the projection tool COM ET 200 Win as per manual.

⇒ Select the FILE window and the Read Type File menu item. The new
type file of the controller is read.

⇒ Select the FILE window and the New menu item. Acknowledge
selection of the master and the host system with OK.

Example of the representation of the Master system

⇒ Now enter the corresponding master, host and bus parameters as


described in the manual COM ET 200 Win.

page appendix-70 manual ecolog asi system


• Enter slave parameters for AS-i controller

⇒ To project the slave participants click the AS-I symbol in the Slaves
window and attach it to the lower end of the Profibus by clicking the
left mouse button.

⇒ As a result a selection window for the station number of the slave will
appear.

⇒ Now enter your slave number (e.g. 3 ) and acknowledge with OK.

The Slave Parameters window will appear.

Example of the representation Slave Parameters AS-I

⇒ Select the AS-I DP Controller with the order number ifm electronic
as station type under family AS-I and enter a text in the field
designation. Then acknowledge your entry with OK.

⇒ The Profibus-DP will be extended by the slave participant in the


Master System user window.

⇒ Since no more slave participants are needed for this example, finish
the station selection in the Slaves window by clicking the
button with the mouse.

If other slave participants are needed, the described procedure will


have to be repeated.

manual ecolog asi system page appendix-71


• Configure slave participants

⇒ Select the slave with number 3 by double-clicking the left mouse


button. A box will now appear around the slave. By double-clicking
the left mouse button you will again get to the Slave parameters
window. Here select the Configure button.

The Configure: ASI-DP Controller # 3 window will appear.

Here it is now getting exciting and very important! You will have to
decide if the AS-i-DP controller is to be configured as Gateway or
with a signal pre-processing. Both options will be explained.

♦ Gateway function

⇒ Click the ID (Identification) button with the mouse. You will get to the
ID (Identification) window.

Here you will select the following options:

⇒ With OK the window will be closed and number 119 will be adopted in
line 0, ID column.

You can also enter number 119 directly.

Line 0 is also called field 1!

⇒ Enter e.g. gateway function into the Remarks column.

⇒ You can enter any address of your choice into the I Addr./O Addr.
columns (P064 in our example) or you can get an address suggested
by the Auto Addr. button. It is only the start addresses of the I/O PLC
storage area that have to be entered.

page appendix-72 manual ecolog asi system


The selected storage area will be reserved in the Profibus-DP master
system (PLC) on the basis of the identification! Here the ASI-DP
controller uses 8 subsequent words (= 16 bytes).

Check your entries on the basis of the following table and


acknowledge with OK.

Example of the representation Configure ASI-DP Controller # 3

You will again get to the Slave Parameters window. Here again you
acknowledge with OK and will get to the Master System window.

This ends the entries of all important parameters.

♦ Signal Pre-processing

If not all AS-i slaves are used in the AS-i system, the storage needed can
be divided into 2-byte steps so as to be transferred to the higher-level
controller system (host).

These data are only pre-processed via the PLC area in the AS-i
controller (allocation program) and passed on to the Profibus-DP.

Example: In an AS-i system 15 AS-i slaves are installed. This means


8 bytes are needed (4 bits, 2 slaves per byte per AS-i
slave).

manual ecolog asi system page appendix-73


We are in the Configure: ASI-DP Controller # 3 window.

⇒ Click the ID (Identification) button with the mouse. You will get to the
ID (Identification) window.

Here you select the following options for line 0 (field 1):

⇒ With OK the window will be closed and line 0 in the ID column will
adopt number 000.

You can also enter number 000 directly.

⇒ Enter e.g. no AS-i I/O data into the Remarks column.

No address is entered into the I Addr./O Addr. columns.

⇒ Please change to line 1 (field 2), ID column.

⇒ Click the ID (Identification) button with the mouse. You will get to the
ID (Identification) window.

Here select the following options for line 1 (field 2):

page appendix-74 manual ecolog asi system


⇒ The window is closed with OK and number 115 is adopted in line 1,
ID column.

You can also enter number 115 directly.

⇒ Enter e.g. 8-byte I/O data PLC into the Remarks column.

⇒ You can enter any address of your choice into the I Addr./O Addr.
columns (P064 in our example) or you can get an address suggested
by Auto Addr. It is only the start addresses of the I/O PLC storage
area that have to be entered.

The selected storage area will be reserved in the Profibus-DP master


system (PLC) on the basis of the identification! Here the ASI-DP
controller uses 4 subsequent words (= 8 bytes).

Check your entries on the basis of the following table and


acknowledge with OK.

Example of the representation Configure ASI-DP Controller # 3

You will again get to the Slave Parameters window. Here again you
acknowledge with OK and will get to the Master System window.

This ends the entries of all important parameters.

manual ecolog asi system page appendix-75


♦ Possible configurations of the AS-i controllers AC 1005 / AC
1006

Identification Remarks

000 field 1 none AS-i I/O data

119 field 1 16 bytes AS-i I/O data master 1


127 field 1 32 bytes AS-i I/O data masters 1 + 2

112 field 2 2 bytes PLC I/O data


113 field 2 4 bytes PLC I/O data
114 field 2 6 bytes PLC I/O data
115 field 2 8 bytes PLC I/O data
116 field 2 10 bytes PLC I/O data
117 field 2 12 bytes PLC I/O data
118 field 2 14 bytes PLC I/O data
119 field 2 16 bytes PLC I/O data
120 field 2 18 bytes PLC I/O data
121 field 2 20 bytes PLC I/O data
122 field 2 22 bytes PLC I/O data
123 field 2 24 bytes PLC I/O data
124 field 2 26 bytes PLC I/O data
125 field 2 28 bytes PLC I/O data
126 field 2 30 bytes PLC I/O data
127 field 2 32 bytes PLC I/O data

240 field 2 2 bytes cons. PLC I/O


241 field 2 4 bytes cons. PLC I/O
242 field 2 6 bytes cons. PLC I/O
243 field 2 8 bytes cons. PLC I/O
244 field 2 10 bytes cons. PLC I/O
245 field 2 12 bytes cons. PLC I/O
246 field 2 14 bytes cons. PLC I/O
247 field 2 16 bytes cons. PLC I/O
248 field 2 18 bytes cons. PLC I/O
249 field 2 20 bytes cons. PLC I/O
250 field 2 22 bytes cons. PLC I/O
251 field 2 24 bytes cons. PLC I/O
252 field 2 26 bytes cons. PLC I/O
253 field 2 28 bytes cons. PLC I/O
254 field 2 30 bytes cons. PLC I/O
255 field 2 32 bytes cons. PLC I/O

page appendix-76 manual ecolog asi system


Once you have entered all parameters, your Profibus-DP system should
look like follows:

Example of the representation of the DP Master System

• Storing, documenting, transferring data

⇒ Select the FILE window. Select the Save As... menu item. Enter file
name and acknowledge with OK.

⇒ Select the DOCUMENTATION window. Select the Station-oriented


Address Assignment menu item and follow the indications in the
COM ET 200 Win manual -> print.

⇒ Select the FILE window. Select the Export menu item. Selection of
the transfer medium and follow the indications in the manual COM ET
200 Win. The data are transferred to the master system.

⇒ Quit the program with ALT F4.

• Connection of all participants to the Profibus - DP

⇒ Establish the connection from the Profibus-DP master system to the


AS-i-DP controller by means of the Profibus cable,

via bus plug connectors (9-pin SUB-D, 12MBaud),

set terminating resistors

according to the manual Profibus-DP master system.

manual ecolog asi system page appendix-77


• Controller Operation

⇒ Application of the supply voltage

When the supply voltage has been applied, an LED test is made. All
status LEDs and the display segments are switched on for 1 second.

Then the output status of the controller hardware and software are
displayed for 1 second each. On manufacture both are stored in the
PROM and cannot be changed.

After the booting phase of the controller bF = bus failure will be


displayed.

⇒ N.B.!!! First of all the menu latch in the controller will have to be
unlocked by pressing the MODE and SET buttons at the same time
for 5 seconds.

⇒ set the controller address

Function A

1. Continue switching with the MODE button until an A appears in


the 1st position in the display. Then acknowledge with the SET
button.

2. Continue switching with the SET button until the 4th position starts
flashing. Now the address is set with the MODE button, in our
example number 3, and confirmed with the SET button.

• •
MODE SET

A003
1st 2nd 3rd 4th position

Example display AS-i controller

⇒ Then the bF = bus failure display on the AS-i DP controller goes out
and only one green RUN LED should be lit in your Profibus-DP
master system.

page appendix-78 manual ecolog asi system


⇒ project AS-i slaves

Function 8

This function permits quick commissioning of the controller.

Adopt projected slaves:

After addressing and installation of the AS-i slaves the latter (LES =
list of recognised slaves) will be read by the master and permanently
stored in the EEPROM as list of projected slave (LPS).

To execute function 8 the master switches briefly into the projection


mode and then back into the protected mode.

Operation:

1. Select function 8 and master 1 (or 2).

• •
MODE SET

81
2. After activation of SET, the last two positions of the display are
flashing with PP, the master is in the projection mode.

• •
MODE SET

81PP
3. After another activation of SET, the display will not change for
approx. 2 seconds. The data are written into the memory.

• •
MODE SET

81PP
⇒ Controller RUN/STOP

manual ecolog asi system page appendix-79


Function 9

The built-in controller processor can be influenced by:

STOP = gateway function

• •
MODE SET

9C-S
The yellow CTRL LED is not lit. Only the I/O data of the AS-i master
can be directly read and written. The controller will then operate as
gateway.

RUN = signal pre-processing

• •
MODE SET

9C-r
The yellow CTRL LED is lit, i.e. the controller is in the RUN mode of
operation. Here data can be exchanged between the Profibus-DP
master and the PLC in the controller. Thus the PLC in the controller
could e.g. exchange analog data from and to slaves via a function
block in the user program and then make them available to the
higher-level system in processed form.

To avoid possible conflicts between the output data of the Profibus-


DP master and the PLC, direct output of Profibus-DP data to the AS-i
master is forbidden in this mode of operation; only the PLC can write
output data.

page appendix-80 manual ecolog asi system


⇒ restrict operation

Function 8.7

To prevent improper entries during operation functions 5 and above


are disabled at power up.

This is made via selection of the following code:

• •
MODE SET

8777

• End of check list

• Excerpt pre-processing

manual ecolog asi system page appendix-81


0001 PROGRAM PLC_PRG
0002 VAR
0003 END_VAR

0001
0002 (* AS-i DP address assignment for free memory configuration
0003
0004 Legend:
0005 syntax -> %IX1.1.0
0006
0007 bits 0-7
0008 slaves 1 to 31
0009 1=master 1, 2=master 2, 0=DP area
0010 X=bit, B=byte, W=word
0011 I=input, Q=output, M=flag
0012 syntax IEC 1131-3
0013 If e.g. in the projection tool COM ET 200 Windows field 2 is
0014 assigned identification e.g. 115, in the controller program
0015 (ecolog asi) the AS-i inputs and outputs are to be given to the
0016 Profibus-DP as follows:
0017
0018 The identification in field 2 describes the number of bytes which
0019 are to be given to the Profibus-DP.
0020
0021 The PLC addresses are defined in tool COM ET 200.
0022
0023 Example for signal pre-processing:
0024
0025 AS-i DP controller PLC S5-115U
0026
0027 %Q 0.0.0 E 64.0
0028 … data …
0029 %Q 0.0.3 E 64.3
0030 … …
0031 %Q 0.0.7 E 64.7
0032
0033
0034 %I 0.0.0 A 64.0
0035 … data …
0036 %I 0.0.3 A 64.3
0037 … …
0038 %I 0.0.7 A 64.7
0039
0040
0041
0042

page appendix-82 manual ecolog asi system


0043 Program 1:
0044
0045 Read AS-i inputs into the PLC via DP: e.g. input 1 of
0046 slave 1 *)
0047
0048 LD %IX1.1.0 (*load AS-i master 1, slave 1, input 1 *)
0049 ST %QX0.0.0 (*store DP byte 0, bit 0 *)
0050
0051 (* if the input start address P064 was entered into the tool of COM
0052 ET 200, the input is programmed with U E 64.0 in S5-115U!
0053
0054
0055 Output PLC outputs via DP to AS-i: e.g. output 1 of
0056 slave 1
0057
0058 LD %IX0.0.0 (* load DP byte 0, bit 0 *)
0059 ST %QX1.1.0 (* store AS-i master 1, slave 1, output1 *)
0060
0061 if the input start address P064 was entered into the tool of COM
0062 ET 200, the input is programmed with U E 64.0 in S5-115U! *)
0063
0064
0065 END_PROGRAM
0066
0067
0068
0069 Program 2:
0070
0071 FUNCTION SlaveInToByte
0072
0073 This function permits complete input information of 2 AS-i slaves
0074 to be written into one byte (e.g. Profibus-DP). The data of slave
0075 1 are reflected in the LOW part and the data of slave 2 are
0076 reflected in the HIGH part of the byte.
0077
0078
0079 SlaveInToByte
0080 slave no. 5 slave1 %QB0.1
0081 slave no. 3 slave2
0082 AS-i line 1 master
0083
0084
0085
0086
0087
0088
0089
0090
0091 FUNCTION ByteToSlaveOut
0092

manual ecolog asi system page appendix-83


0093 This function permits e.g. output data to be written to 2 AS-i
slaves
0094 (AS-i slave outputs) via Profibus-DP. The data of slave 1 are
0095 reflected in the LOW part and the data of slave 2 are reflected
0096 in the HIGH part of the byte.
0097
0098
0099 ByteToSlaveOut
0100 %IB0.1 in byte
0101 slave no. 5 slave1
0102 slave no. 3 slave2
0103 AS-i line 1 master
0104
0105
0106
0107 The functions SlaveInToByte and ByteToSlaveOut can be read
0108 and processed via the DEMO_LIB.LIB library administration.
0109 For a detailed description we refer you to the pages 4-39 ff. of
0110 the ecolog asi system manual.
0111
0112

• Diagnosis via display/operation field

There are two areas of diagnostic possibilities of the AS-i DP controller:

page appendix-84 manual ecolog asi system


− the AS-i range with display of failed slaves

− the range specific to Profibus-DP.

The display and operation field enables the user to make precise local
diagnosis.

display/operation field

For the meaning of the individual LEDs we refer you to the table below.

Status LED Colour Meaning


ALARM CONFIG red actual configuration not equal to preset
configuration
NOT AUTO ADDR red automatic addressing not released
AS-i PWR green AS-i voltage o.k.
COM MODE green standard operation
PROJ MODE yellow projection mode, all slaves activated
PROJ MODE yellow slave 0 recognised, switching over to
flashing protected mode is not possible
CTRL yellow controller in the RUN mode

Another possibility of local diagnosis is the 4-position LED display. Here


the failed slaves or other status messages (see annex page 44) are
represented flashingly.

manual ecolog asi system page appendix-85


Example:

Function 1

No error recognised => display remains dark !

Missing slaves display

In the protected operation any missing slaves are displayed.

In the example the slave with address 28 connected to master 2 is


missing. If more than one missing slave are recognised, they are scrolled
in intervals of one second.

• •
MODE SET

1228
1st 2nd 3rd 4th position

Example display AS-i controller

1st position => error messages

2nd position => 1 = master 1, 2 = master 2

3rd + 4th position => slave no.

Should the display look as follows this means that there is no


communication from the AS-i DP controller to the Profibus-DP.

• •
MODE SET

bF
1st 2nd 3rd 4th position

Example display bF = bus failure

page appendix-86 manual ecolog asi system


• Diagnosis via user program in the host system

The Profibus-DP offers many possibilities to process diagnostic


messages of the Profibus-DP slave participants. As soon as a diagnostic
message is necessary on the slave side, the DP slave responds with a
high-priority response message in the current data exchange. Then the
master requests a diagnosis from this DP slave in the next bus cycle
instead of performing normal data exchange.

All Profibus-DP masters can request diagnostic data from any DP slave.
The diagnostic information of a DP slave consists of standard diagnostic
information (6 bytes) and possibly user-specific diagnostic information.

The first 6 bytes of the diagnostic message (byte 0 to byte 5 or octet 1 to


octet 6) are also called DP standard part. They are independent of the
DP slave used.

They can be read with the corresponding tools of the master modules
(see manuals of the various manufacturers).

The diagnostic message of the AS-i DP controller consists of 6-byte


data. This structure of the diagnostic message corresponds to the
Profibus-DP standard. The structure is represented in the following
table:

Byte Contents

0 station status 1

1 station status 2

2 station status 3

3 station number DP master

4 manufacturer ID (high byte)

5 manufacturer ID (low byte)

Structure of the diagnostic message

manual ecolog asi system page appendix-87


The diagnostic bytes are structured as follows:

Byte 0 (octet 1) - station status 1


7 … 0
1 1 1 1 1 1 1 1

AS-i DP controller does not


exist (set by the master)
AS-i DP controller is not yet
ready for the data exchange

configuration data do not


match
AS-i DP controller has
external diagnosis
requested function is not
supported by the AS-i DP
controller

invalid slave response

wrong parameterization (ID


no. etc.)

ASi-DP controller is
parameterized by another DP
master

Byte 1 (octet 2) - station status 2


7 … 0
0 0 1 1 1 1 1 1

AS-i DP controller has to be


parameterized
static diagnosis

fixed, set to "1“

watchdog active

FREEZE command received

SYNC command received

reserved
AS-i DP controller is
deactivated

Byte 2 (octet 3) - station status 3

page appendix-88 manual ecolog asi system


7 … 0
1 0 0 0 0 0 0 0

reserved
resered

reserved

reserved

reserved
reserved

reserved

overflow

Byte 3 (octet 4) - station number DP master


7 … 0
1 1 1 1 1 1 1 1

master address after


parameterization (FF without
parameterization)

Byte 4 (octet 5) - manufacturer identification


7 … 0
0 0 0 0 0 0 0 0

ident number high byte

Byte 5 (octet 6) - manufacturer identification


7 … 0
1 0 1 0 1 0 1 1

ident number low byte


(AB)Hex

manual ecolog asi system page appendix-89


• GSD/type files

For each Profibus-DP unit a GSD (Geräte Stamm Daten = device master
file) or a type file is necessary. These files contain the technical features
of the unit and are needed for projection. They are supplied on the
ecolog asi system diskette (full/demo version).

The GSD/type file describes a Profibus slave with regard to the number
of inputs/outputs, number of parameter values, FREEZE/SYNC
capability, number of diagnostic bytes, etc.

The AS-i DP controller type file IF00ABAX.200 looks as follows:

page appendix-90 manual ecolog asi system


The AS-i DP controller GSD file IFM_00AB.GSD looks as follows:

;============================================================================
; Geraetestammdatendatei nach DIN 19245 Teil 3 (PROFIBUS-DP)
;============================================================================
;
; FILE NAME : IFM_00AB.GSD
;----------------------------------------------------------------------------
; UNIT : ASI-Controller
;----------------------------------------------------------------------------
; PROTOCOL : Profibus DP (Slave)
;----------------------------------------------------------------------------
; MANUFACTURER : ifm electronic,
; Teichstrasse 4
; 45127 Essen
; Tel.: (0201) 24220
;----------------------------------------------------------------------------
; VERSION : 1.0
;----------------------------------------------------------------------------
; DATE : 08.02.96
;----------------------------------------------------------------------------
; CHANGES :
;
;============================================================================
;
#Profibus_DP ; Anfangskennung
Vendor_Name = "ifm electronic"
Model_Name = "ifm ASI-DP-Controller"
Revision = "Ausgabestand 1"
Ident_Number = 0x00AB
Protocol_Ident = 0 ; Profibus DP
Station_Type = 0 ; DP Slave
FMS_supp = 0 ; kein FMS-Support
Hardware_Release = "Version 1.3"
Software_Release = "Version 1.18"
9.6_supp = 1 ; Unterstuetzte Baudraten
19.2_supp = 1
93.75_supp = 1
187.5_supp = 1
500_supp = 1
1.5M_supp = 1
3M_supp = 1
6M_supp = 1
12M_supp = 1
MaxTsdr_9.6 = 60 ; max. Antwortzeit des Slaves
MaxTsdr_19.2 = 60
MaxTsdr_93.75 = 60
MaxTsdr_187.5 = 60
MaxTsdr_500 = 100
MaxTsdr_1.5M = 150
MaxTsdr_3M = 250
MaxTsdr_6M = 450
MaxTsdr_12M = 800
;
;============================================================================
; Slave spezifische Daten
;============================================================================
;
Freeze_Mode_supp = 1 ; Unterstuetzte Modi
Sync_Mode_supp = 1
Auto_Baud_supp = 1
Set_Slave_Add_supp = 1
Min_Slave_Intervall = 1 ; Minimale Pollzeit
;
;============================================================================
; Modularer Slave:
; Feld 1 (ASI-I/O-Daten) muss immer angegeben werden. Werden keine
; ASI-I/O-Daten benoetigt, muss "Feld 1: keine ASI-I/O" projektiert werden.
; Daran angehaengt wird Feld 2 (PLC-I/O-Daten). Werden keine PLC-I/O-Daten
; benoetigt, muss Feld 2 nicht projektiert werden.
;============================================================================
;
Modular_Station = 1
Max_Module = 2
Max_Input_Len = 0x40 ; max. 64 Byte Input
Max_Output_Len = 0x40 ; max. 64 Byte Output
Max_Data_Len = 0x80 ; max. 128 Byte I/O

Module = "Feld 1: keine ASI-I/O" 0x00


EndModule
Module = "Feld 1: 16 Byte ASI-I/O" 0x77
EndModule

manual ecolog asi system page appendix-91


Module = "Feld 1: 32 Byte ASI-I/O" 0x7F
EndModule
Module = "Feld 2: 2 Byte PLC-I/O" 0x70
EndModule
Module = "Feld 2: 4 Byte PLC-I/O" 0x71
EndModule
Module = "Feld 2: 6 Byte PLC-I/O" 0x72
EndModule
Module = "Feld 2: 8 Byte PLC-I/O" 0x73
EndModule
Module = "Feld 2: 10 Byte PLC-I/O" 0x74
EndModule
Module = "Feld 2: 12 Byte PLC-I/O" 0x75
EndModule
Module = "Feld 2: 14 Byte PLC-I/O" 0x76
EndModule
Module = "Feld 2: 16 Byte PLC-I/O" 0x77
EndModule
Module = "Feld 2: 18 Byte PLC-I/O" 0x78
EndModule
Module = "Feld 2: 20 Byte PLC-I/O" 0x79
EndModule
Module = "Feld 2: 22 Byte PLC-I/O" 0x7A
EndModule
Module = "Feld 2: 24 Byte PLC-I/O" 0x7B
EndModule
Module = "Feld 2: 26 Byte PLC-I/O" 0x7C
EndModule
Module = "Feld 2: 28 Byte PLC-I/O" 0x7D
EndModule
Module = "Feld 2: 30 Byte PLC-I/O" 0x7E
EndModule
Module = "Feld 2: 32 Byte PLC-I/O" 0x7F
EndModule
Module = "Feld 2: 2 Byte cons. PLC-I/O" 0xF0
EndModule
Module = "Feld 2: 4 Byte cons. PLC-I/O" 0xF1
EndModule
Module = "Feld 2: 6 Byte cons. PLC-I/O" 0xF2
EndModule
Module = "Feld 2: 8 Byte cons. PLC-I/O" 0xF3
EndModule
Module = "Feld 2: 10 Byte cons. PLC-I/O" 0xF4
EndModule
Module = "Feld 2: 12 Byte cons. PLC-I/O" 0xF5
EndModule
Module = "Feld 2: 14 Byte cons. PLC-I/O" 0xF6
EndModule
Module = "Feld 2: 16 Byte cons. PLC-I/O" 0xF7
EndModule
Module = "Feld 2: 18 Byte cons. PLC-I/O" 0xF8
EndModule
Module = "Feld 2: 20 Byte cons. PLC-I/O" 0xF9
EndModule
Module = "Feld 2: 22 Byte cons. PLC-I/O" 0xFA
EndModule
Module = "Feld 2: 24 Byte cons. PLC-I/O" 0xFB
EndModule
Module = "Feld 2: 26 Byte cons. PLC-I/O" 0xFC
EndModule
Module = "Feld 2: 28 Byte cons. PLC-I/O" 0xFD
EndModule
Module = "Feld 2: 30 Byte cons. PLC-I/O" 0xFE
EndModule
Module = "Feld 2: 32 Byte cons. PLC-I/O" 0xFF
EndModule
;
;============================================================================
; END
;============================================================================
;

page appendix-92 manual ecolog asi system


• Important technical data

RS 232 - C Profibus-DP
interface interface

Order no. AC 1005 / AC 1006

Operating voltage [V] 10 - 30 V, typ. 24 V DC

Power consumption [W] ≤ 10

Serial interface RS 232 C


transfer rate 4800 - 62400 baud

AS-i interface to specification

Number of screw terminals 5/7


[pieces]

Function display LED 2 x red, 2 x green, 2 x yellow

Operating buttons / LED display 1 x MODE, 1 x SET / 4 digits

Operating temperature [°C] 0 ... + 70

Housing DIN rail mounting possible

Protection housing IP 20, terminals IP 20

Mounting horizontally on DIN rail

General technical data

manual ecolog asi system page appendix-93


Order no. AC 1005 / AC 1006
max. number of controllers that 31
can be switched in parallel
max. distance between controller depending on the Baud rate
and Profibus-DP master
electrical separation of the yes
controller supply
monitoring by watchdog yes, watchdog to be configured by
Profibus-DP master
manufacturer ID 0 x 00AB
freeze mode, sync mode are supported

Profibus-specific data

Baud rate max. cable length


(automatic setting) of a segment (in m)
9600 baud 1200
19200 baud 1200
93750 baud 1200
187.5 kbaud 1000
500 kbaud 400
1.5 Mbaud 200
3 Mbaud 100
6 Mbaud 100
12 Mbaud 100

permissible cable length depending on the baud rate

Profibus-DP RS 232-C
pin 3: signal B pin 2: RxD
pin 4: RTS signal pin 3: TxD
pin 5: GND pin 5: GND
pin 6: VCC
pin 8: signal A

pin connection 9-pin Sub-D

page appendix-94 manual ecolog asi system


manual ecolog asi system page appendix-95
I. Description of AS-i ↔ DeviceNet interface

This section contains all you need to know about using your DeviceNet
Controller. The following points are covered:

• description
• connection
• data mapping
• configuration
• set-up guide with examples

I.1.1 General overview

PLC System Scanner

DeviceNet

AS-i DeviceNet
Controller

AS-i

Fig. I.1.1.1 Typical AS-i DeviceNet-Controller application

As shown in fig.I.1.1.1 the principal subsystems of a typical AS-i


DeviceNet application are

• PLC
• Scanner
• DeviceNet system
• AS-i DeviceNet Controller
• AS-i system

The PLC and scanner are generic, whereas typical examples would be
those manufactured by the Allen-Bradley Company, Inc. It is assumed
that a

• SLC 5/03 PLC and a


• DeviceNet scanner

both from Allen-Bradley Company, Inc are being used here. Discussion
of these systems will be limited to the amount required to set up your
AS-i DeviceNet Controller.

manual ecolog asi system page appendix-95


The AS-i system has already been explained. A good knowledge of this
system on the part of the user will be assumed in this documentation
(see chapter 5 of this publication for information concerning the AS-i
system).

A description of the DeviceNet system is beyond the scope of this


documentation. A working knowledge is necessary to use this manual
effectively. Please refer to the corresponding publications for additional
information.

The AS-i-DeviceNet-Controller (referred to in the following as controller)


includes a group 2 only slave interface in accordance with the DeviceNet
specification 2.0. A DeviceNet scanner card can cyclically exchange data
with the AS-i-DeviceNet controller via this interface.

The DeviceNet data interface is equipped with a CAN microprocessor


permitting transfer rates of between 125 KBd and 500 KBd. This transfer
rate must be set by the user in the controller.

The DeviceNet node address (MAC ID) is displayed and modified via the
operator interface of the controller under menu option A. Changes are
also possible via DeviceNet Manager (configuration software).

The node address has the value 63 when it is delivered from the
manufacturer. You may need to change this address to comply with our
system.
Note that the node address is also used as the controller address in
asisys. Please set this same address in the master window of
asisys, since otherwise a communication error will occur! This is
very important since the default node address accepted by asisys
is 1!

The asisys diskette also contains the EDS file for the controller. (Note
that in some cases this file may have been supplied separately.)

I.1.2 Modes of Operation

Two modes of operation are available for the controller:

• Gateway or Stop mode


• Signal pre-processing or Run mode

These two modes are discussed below .

page appendix-96 manual ecolog asi system


I.1.2.1 Gateway or Stop mode

PLC DeviceNet
Scanner actuators

sensors

DeviceNet AS-i DeviceNet AS-interface


port Controller port

CTRL STOP

signal pre-
processing

Fig. I.1.2.1.1 Block diagram of Stop mode (gateway mode)

If the controller is set to STOP data are transferred from sensors via the
AS-i and the DeviceNet systems contained within the controller.
These data are sent to the DeviceNet scanner and ultimately to the
PLC.

Data to actuators are transferred in the opposite direction to that from


sensors as shown in fig. I.1.2.1.1 above.

The controller is said to operate in the STOP or gateway mode.

manual ecolog asi system page appendix-97


I.1.2.1 Pre-processing or RUN mode

PLC DeviceNet
Scanner actuators

sensors

DeviceNet AS-i DeviceNet AS-interface


port Controller port

CTRL RUN

signal pre-
processing

Fig. I.1.2.2.1 Block diagram of Run mode (pre-processing mode


operation)

If the controller is set to RUN, data from sensors can be transferred as


in the gateway mode. In addition, data can be sent to the signal pre-
processing system in the AS-i controller, where arithmetic/logic
operations can be performed before transfer to the PLC takes place.
For example, several digital signals could be logically combined (for
instance using an AND-gate) only the result of the combination being
transferred. Or an analog signal could be calibrated before transfer,
thus reducing the work load in the PLC.

As opposed to the gateway mode signals to actuators can only be


transferred via the signal pre-processing system. In this manner
a given actuator is ultimately controlled only from the
arithmetic/logic unit in the pre-processing system. Thus the case of
for example an actuator being activated from the PLC and being
deactivated from the signal pre-processing system or vice-versa is
avoided.

The controller is said to operate in the RUN or pre-processing mode.

page appendix-98 manual ecolog asi system


I.2. Connection of the system
The hardware connections for the AS-i _DeviceNet Controller is
described in this section.

I. 2.1 Connection using a conventional power supply


The AS-i-DeviceNet controller requires a 24 volt dc external power source
(e.g. AC1206).

1: Shield bare

2: V+ red

3: V- black

4 : CAN_H white

5: CAN_L blue

Figure I.2.1.1 Connection of controller and power supplies

manual ecolog asi system page appendix-99


I. 2.1 Connection using a Power Decoupler (AC1211)

The power requirements for the AS-i-DeviceNet Controller can be met


using a Power Decoupler (AC1211) from ifm electronic. This unit is
attached to the AS-i cable as if it were a slave and is then used in place
of for example an AC1206. It is important to note that if this unit is used
the maximum number of slaves is decreased by one (for example 30
instead of 31).

The pertinent technical data are as follows:

• Current consumption : 430 mA

• Current rating: 380 mA max, continuous 300 mA

• Output voltage: 24 V DC (+ / -) 20 %

• Impedance : same as 1 AS-i slave!

page appendix-100 manual ecolog asi system


I.3. Data Mapping

Typically the user starts by deciding both the

• mode of operation (gateway or pre-processing) and the


• number / type of transferred data (input, output or pre-processed).

Based on this decision the system configuration is carried out. Simply


stated, this means that the necessary provisions with respect to the two
sub-systems AS-i DeviceNet Controller and DeviceNet Scanner are
made. Put another way the configuration determines "which data go
where". A detailed answer to this question is given below.

I.3.1 Mode of Operation and Transferred Bytes

The two modes of operation and AS-i controllers having two AS-i
masters lead to a very large number of possible combinations of
operating mode and transferred data (configurations). A list of values
which can be chosen from is shown below.

Mode of Operation: gateway

AS-i System 1 AS-i System 2


Number of I/O Number of I/O
bytes transferred bytes transferred

0...16 0...16

Mode of Operation: pre-processing


Number of pre-processed AS-i System 1 AS-i System 2
bytes transferred Number of I/O Number of I/O
bytes bytes
transferred transferred

1..32 0...16 0...16

Fig.I.3.1.1 Value choices for technically meaningful system


configuration

The total number of system configurations using the choices indicated in


fig. I.3.1.1 is as follows:

Number of system configurations = (17) (17) + (32) (17) (17)

= (33) (17) (17)

= 9537

The configuration used is dependent upon the application.

manual ecolog asi system page appendix-101


I.3.2 Basic Concept of Mapping

PLC DeviceNet
Scanner
DeviceNet

AS-i DeviceNet
Controller

AS-i

Fig.I.3.2.1 Data mapping : basic concept

Probably the most important information for the user is the answer to the
question:

What addresses do the AS-i data bits have with respect to the PLC
connected to the DeviceNet Scanner and vice versa?

The result of the data mapping (i.e. the data map) is the answer to this
question. This basic concept is indicated in fig.I.3.2.1. The detailed data
map is dependent upon the configuration used in the specific application.

As mentioned the user generally decides upon the mode of operation at


the time of configuration. In the discussion below we shall consider first
the case of the gateway mode and secondly that of the pre-processing
mode.

I.3.3 Map structure: an overview

A maximum of 64 bytes can be transferred between the AS-i controller


and the PLC. These bytes are separated into three sets of bytes or
blocks as indicated in fig. I.3.3.1 below. The block code and the
maximum size of each block are also indicated in fig.I.3.3.1. The block
code and the actual size of the corresponding block are to be entered
into the AS-i controller during set-up (this is discussed later in more
detail). The nomenclature used for the bit-wise addressing of these data
is given as well in fig. I.3.3.1.

page appendix-102 manual ecolog asi system


AS-i controller address range

data block block max gateway gateway pre-processing pre-processing


type code length mode: mode: mode: mode:
(bytes) to PLC from PLC to PLC from PLC
(bits) (bits) (bits) (bits)
AS-i 1 C1 16 %IX1.0.0... %QX1.0.0... %IX1.0.0... %IX0.32.0...
%IX1.31.3 %QX1.31.3 %IX1.31.3 %IX0.47.7
AS-i 2 C2 16 %IX2.0.0... %QX2.0.0... %IX2.0.0... %IX0.48.0...
%IX2.31.3 %QX2.31.3 %IX2.31.3 %IX0.63.7
pre- CC 32 none none %QX0.0.0... %IX0.0.0...
processed %QX0.31.7 %IX0.31.7

Fig. I.3.3.1

PLC bits bits


input 15...8 7...0
word
I:1.0 RESERVED

I:1.1 second C1 - byte first C1 - byte

I:1.2 first C2 - byte third C1- byte

I:1.3 first CC - byte second C2 - byte

I:1.4 third CC - byte second CC - byte

I:1.5 fifth CC - byte fourth CC - byte

PLC bits bits


output 15...8 7...0
word
O:1.0 RESERVED
O:1.1 second C1 - byte first C1 - byte

O:1.2 first C2 - byte third C1- byte

O:1.3 first CC - byte second C2 - byte

O:1.4 third CC - byte second CC - byte

O:1.5 fifth CC - byte fourth CC - byte


Fig.I.3.3.2 Example : C1 = 3, C2 = 2, CC = 5
The memory area which is occupied by the AS-i bytes and the pre-
processed bytes in the PLC system is shown in the example of fig.
I.3.3.2. This should illustrate that the distribution is dependent upon the
number of bytes to be transferred (i.e. C1, C2 and CC).

To reinforce the discussion above, a block diagram showing a


superposition of the gateway and the pre-processing modes is shown in

manual ecolog asi system page appendix-103


fig. I.3.3.3. The relationship between these modes and the system
mapping (i.e. which data goes where) is indicated in this block diagram.

PLC DeviceNet
Scanner actuators

sensors

DeviceNet AS-i DeviceNet AS-interface


port
port Controller
bytes
%IB1.0...31
%IB2.0...31
CTRL RUN/STOP

bytes
%QB1.0...31
bytes %QB2.0...31
%IB0.0...31
%IB0.32...47
%IB0.48...63 signal pre-
processing
bytes
%QB0.0...31

Fig. I.3.3.3 Superposition gateway and pre-processing modes showing


mapping

As further illustration of mapping several examples are given below.


Please note that these are only examples. Your system may be different
from those shown, since the number of DeviceNet nodes and the type of
mapping also affects the resulting map. It has been assumed here that
only the DeviceNet controller has been connected and that auto-
mapping has been used.

page appendix-104 manual ecolog asi system


C2 C1 CC
Configuration (AS-i System 2 (AS-i System 1 (Number of pre-processed
Number of I/O bytes Number of I/O bytes bytes transferred)
transferred) transferred)

1 0 16 0

2 16 0 0

3 16 16 0

Fig. I.3.3.4 Example configurations using gateway mode

C2 C1 CC
Configuration (AS-i System 2 (AS-i System 1 (Number of pre-processed
Number of I/O bytes Number of I/O bytes bytes transferred)
transferred) transferred)

1 0 16 0

2 0 16 32

3 16 0 0

4 16 0 32

5 16 16 0

6 16 16 32

Fig. I.3.3.5 Example configurations using pre-processing mode

manual ecolog asi system page appendix-105


PLC bits bits bits bits
input word 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
I:1.0 RESERVED
AS-i System1
I:1.1 %IX1.2.3 ... 0 %IX1.3.3 ... 0 status/control %IX1.1.3 ... 0
I:1.2 %IX1.6.3 ... 0 %IX1.7.3 ... 0 %IX1.4.3 ... 0 %IX1.5.3 ... 0
I:1.3 %IX1.8.3 ... 0 %IX1.9.3 ... 0
Fig. I.3.3.6 PLC inputs, example:
Gateway, C1 = 5, C2 = 0, CC =0

PLC bits bits bits bits


output word 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
O:1.0 RESERVED
AS-i System1
O:1.1 %QX1.2.3 ... 0 %QX1.3.3 ... 0 status/control %QX1.1.3 ... 0
O:1.2 %QX1.6.3 ... 0 %QX1.7.3 ... 0 %QX1.4.3 ... 0 %QX1.5.3 ... 0
O:1.3 %QX1.8.3 ... 0 %QX1.9.3 ... 0
Fig. I.3.3.7 PLC outputs , example:
Gateway, C1 = 5, C2 = 0, CC =0

PLC bits bits bits bits


input word 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
I:1.0 RESERVED
AS-i System1
I:1.1 %IX1.2.3 ... 0 %IX1.3.3 ... 0 status/control %IX1.1.3 ... 0
I:1.2 %IX1.6.3 ... 0 %IX1.7.3 ... 0 %IX1.4.3 ... 0 %IX1.5.3 ... 0
I:1.3 %QX0.0.0 ... 7 %IX1.8.3 ... 0 %IX1.9.3 ... 0
I:1.3 %QX0. 2.0 ... 7 %QX0.1.0 ... 7
Fig. I.3.3.8 PLC inputs , example:
Pre-processing, C1 = 5, C2 = 0, CC =3

PLC bits bits bits bits


output word 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
O:1.0 RESERVED
O:1.1 %IX0.33.7 ... 0 %IX0.32.7 ... 0
O:1.2 %IX0.35.7 ... 0 %IX0.34.7 ... 0
O:1.3 %IX0.0.7 ... 0 %IX0.36.7 ... 0
O:1.4 %IX0.2.7 ... 0 %IX0.1.7 ... 0
Fig. I.3.3.9 PLC outputs, example:
Pre-processing, C1 = 5, C2 = 0, CC =3

page appendix-106 manual ecolog asi system


I.3.4 Status Nibble

The allocation of the status nibble is as follows:

bit meaning =1 =0
number
7 signal pre-processing active inactive
6 AS-i power / configuration not O.K. O.K.
5 start up finished yes no
4 reserved - -

Fig. I.3.4.1 Status nibble

manual ecolog asi system page appendix-107


I.4. Configuration

I.4.1 Configuration using the DeviceNet Manager

It is assumed that the configuration of the AS-i-DeviceNet Controller is


to be carried out using the DeviceNet Manager (configuration tool)
designed by the company Allen Bradley. An Electronic Data Sheet (EDS)
as well as a bit map to depict the Controller are to be used in conjunction
with the above mentioned configuration tool. These files are accessed at
the start of the DeviceNet Manager.

Fig I.4.1.1 shows the representation of the AS-i DeviceNet Controller


(Node_2) as depicted in the Network Who (part of the DeviceNet
Manager).

Fig I.4.1.1 : ASI-DeviceNet Controller in Network Who

page appendix-108 manual ecolog asi system


I.4.2 AS-i DeviceNet Controller Parameters

The AS-i DeviceNet Controller parameters as accessed via the


DeviceNet Manager are shown in Fig. I.4.2.1 below. A discussion of
these parameters is given in this section.

Fig. I.4.2.1 : ASI-DeviceNet Controller parameter

Before we proceed with the specific discussion of the various parameters


please note the following:

• Those parameters which are changeable (i. e. type=read/write) can


only be changed when no I/O data transfer between DeviceNet and
the AS-i Controller is taking place. Should this be attempted the
controller sends an error message to the DeviceNet Manager as an
indication to the user.

• The parameter change is initiated by means of a double click to the


parameter name.

manual ecolog asi system page appendix-109


IO Length ASI Master 1
Indicates the number of I/O bytes to be transferred via AS-i System 1
and corresponds to C1 as discussed in section 3. Type: read/write.

IO Length ASI Master 2


Indicates the number of I/O bytes to be transferred via AS-i System 2
and corresponds to C2 as discussed in section 3. Type: read/write.

Poll/COS Rx Length
Indicates the length of the Poll Command Message from the DeviceNet
system to the AS-i DeviceNet Controller. Type: read only.

Poll Tx Length
Indicates the length of the Poll Response Message from the AS-i
DeviceNet Controller to the DeviceNet system. Type: read only.

COS/Cyclic Tx Length
Indicates the length of the Change-of-State/Cyclic transfer from the ASI-
DeviceNet Controller to the DeviceNet system. Type: read only.

COS/Cyclic Ack. Length


Indicates the length of the Acknowlegde Message from the DeviceNet
system in response to a Change-of-State/Cyclic transfer from the AS-i
DeviceNet Controller. Type: read only.

Bit Strobe Tx Length


Indicates the length of Bit-Strobe Response Message from the AS-i
DeviceNet Controller to the DeviceNet system. Type: read only.

IO Error Action
Controls Inputs/Outputs after a DeviceNet communication error (for
example failure of the DeviceNet Scanner). This parameter indicates
what action is to be taken when communication is restored:
• all outputs retain the state they had before the communication error
• all outputs turned off (all outputs = FALSE)
Parameter is of type: read/write.

Controller Address
The address of the DeviceNet Controller can be entered via this
parameter. Type: read/write.

Baud Rate
The Baud rate of DeviceNet data transfer can be entered via this
parameter. A change to this parameter is effective only after the AS-i
DeviceNet Controller has been reset (Address reentered). Type:
read/write.

page appendix-110 manual ecolog asi system


I.5. Set-Up Guide: Two Step-by-Step Examples

In the following it is assumed that the information contained in the


previous theoretical sections is known on the part of the reader. The goal
of this section is to supply the user with a step-by-step guide on how to
set up the desired system. Two examples are given, one for the gateway
mode and another for the pre-processing mode.

I.5.1 Gateway Application

The application is as follows:

• An AS-i Controller AC 1014 (double master) is to be connected to a


SLC-500 PLC system via an Allen Bradley DeviceNet Scanner.

• All AS-i inputs and outputs are to be transferred (32 bytes input/ 32
bytes output).

• Configuration is to be carried out with the Allen-Bradley DeviceNet


Manager

• Auto-Mapping is to be used.

Step 1: Hardware Connection


Connect the AS-i components (controller and power supplies) using
section I.2 as a guide.

Connect the SLC-500, Scanner and DeviceNet system as indicated in


the corresponding documentation. Remember terminating resistors are
to be connected in accordance with DeviceNet specifications. If you are
not sure about this point please refer to your DeviceNet documentation.

Connect an Allen-Bradley 1770-KFD (KFD) into the DeviceNet system.


Attach the configuration PC via the RS-232 port to the KFD.

Step 2: Controller (DeviceNet


node) address and Baud
Rate
Enter the controller (DeviceNet node) address and DeviceNet Baud Rate
via the MODE/SET buttons on the controller. In this example it is
assumed that this address is 3.

Note that this address is also to be entered in the asisys software


as well in order to access the controller. Do this by means of the
Master screen of the asisys software.

The general use of the MODE/SET buttons is explained in appendix G


of this document (as well as in the User Instructions for your AS-i
Controller). Entering the address and Baud Rate is discussed briefly
below for your reference.

First of all the menu latch in the controller will have to be unlocked by
pressing the MODE and SET buttons at the same time for 10 seconds.

manual ecolog asi system page appendix-111


Set the controller address using Function A

• Continue switching with the MODE button until an A appears in the


1st position in the display. Then acknowledge with the SET button.

• Continue switching with the SET button until the 4th position starts
flashing. Now the address is set with the MODE button, in our
example number 3, and confirmed with the SET button.

• •
MODE SET

A003
1st 2nd 3rd 4th position

Set the DeviceNet Baud Rate using Function d

• Continue switching with the MODE button until d appears in the 1st
position of the display. Then acknowledge with the SET button.

• The number to the right of d starts flashing. This is the Baud Rate in
Kilobaud. Use the MODE button to scroll to the desired rate (we will
use 125 Kilobaud here) and confirm your choice with the SET button.

d125
Step 3: Start the DeviceNet
Manager

Start the DeviceNet Manager. Click the icon to establish a

connection. A screen as in fig. I.5.1.1 appears. Click to


continue.

Fig. I5.1.1

page appendix-112 manual ecolog asi system


A screen as in fig. I5.1.2 appears. Ensure that the entries are correct for

your specific system and click to continue.

Fig. I5.1.2

Step 4: Install EDS Files


If this is the first use of the DeviceNet Manager in conjunction with an
AS-i-DeviceNet Controller it will be necessary to transfer the data
contained on the EDS (Electronic Data Sheet) to your pc. The EDS files
have been supplied to you or you have obtained them from the Internet.

To initiate the installation process place the disk containing the EDS files

in drive A and select . A screen similar to that


of fig. I.5.1.3 appears.

manual ecolog asi system page appendix-113


Fig. I.5.1.3

Here select and chose the file AC1008.eds


or AC1014.eds depending on the controller you are using, resulting in a
screen similar to fig.I.5.1.4.

Fig.I.5.1.4

Click in the screen of fig. I.5.1.4 causing a screen as in


fig. I.5.1.5 below to appear.

page appendix-114 manual ecolog asi system


Fig. I.5.1.5

Click in the screen of fig. I.5.1.5 to set the


corresponding device bitmap.(This bitmap is a graphical representation
of the AS-i DeviceNet Controller which appears in a subsequent screen.)
You should have a screen as in fig. I.5.1.6 below.

Fig. I.5.1.6

Select , and

in the screen of fig.I.5.1.6 resulting in a screen as in fig.

I.5.1.7 below. Click to set the device bitmap.

Fig. I.5.1.7

manual ecolog asi system page appendix-115


Step 5: Network Who
Click the icon to call the Network Who. A screen as in fig. I.5.1.8
appears. As the name indicates the Network Who informs the user what
devices are connected to the system.

Fig. I.5.1.8

Step 6: Edit Scan List

Double click the icon to call the screen of fig. I.5.1.9.

Fig. I.5.1.9

page appendix-116 manual ecolog asi system


Click of fig. I.5.1.9 which causes a screen
as in fig. I.5.1.10 to appear.

Fig. I.5.1.10

Click Who of the icon in the screen of fig.I.5.1.10


causing the following screen to appear.

Fig. I.5.1.11

Drag and drop the icon to the icon (fig. I.5.1.11).

manual ecolog asi system page appendix-117


Fig. I.5.1.11

A screen now appears as fig. I.5.1.11 above. Note the 0 to the right of
the AS-i DeviceNet Controller, indicating the association with Scanner 0.

Click the icon (fig.I.5.1.11), thereby entering the


Controller into the Scan List. A screen similar to that of fig.I.5.1.12 then
appears. ( Note that the entries corresponding to Node 3 will not
necessarily be the same in your screen as in the figure below).

Fig.I.5.1.12

Step 7: Enter Block Code


As indicated in the application description all AS-i I/O data (both AS-i
systems) are to be transfered between the AS-i DeviceNet Controller
and the Scanner and no pre-procecced data. As discussed in section
I.3.3 above this information is given to the AS-i DeviceNet Controller by
means of Block Code C1, C2 and CC. For this application the required
values are

• C1 = 16
• C2 = 16
• CC = 0

page appendix-118 manual ecolog asi system


Enter these values via the MODE/SET buttons on the controller using
menu C.

As mentioned the general use of the MODE/SET buttons is explained in


appendix G of this document (as well as in the User Instruction for your
AS-i Controller). Entering the block code is discussed briefly below for
your reference.

If you have not already done so the menu latch in the controller will
have to be unlocked by pressing the MODE and SET buttons at the
same time for 10 seconds.

Set the block code using Functions C

We begin with C1 followed by C2 and CC.

• Continue switching the MODE button until a flashing C appears in the


1st position of the display. Then acknowledge with the SET button.

• The number to the right of C starts flashing. Since C1 is to be entered


first, confirm your choice with the SET button.

• The third and fourth positions start to flash. Continue switching with
the MODE button until the desired number appears next to C1 (here
16), then acknowledge with the SET button.

C116
• A flashing C appears again. Continue switching the MODE button
until a flashing C2 appears. Enter C2 by repeating the procedure for
C1 acknowledging your choice (here 16 ) with the SET button.

C216
• A flashing C reappears. Continue switching the MODE button until a
flashing CC appears. Enter CC by repeating the procedure for C1
acknowledging your choice (here 00 ) with the SET button.

CC00
To cause these values to be activated please repeat step 2:Enter
the Controller(DeviceNet node) address.

manual ecolog asi system page appendix-119


Step 8: Edit Scan Parameters
The information ( transfer of all AS-i I/O data, no pre-processed data) is
given to the Scanner by means of the Scan - Parameters, which are to
be entered at this time. To initiate this process double click the Node_3
line (fig.I.5.1.12). A screen as in fig. fig.I.5.1.13 then appears.

Fig.I.5.1.13

Click the icon (fig. I.5.1.13) causing the default


parameters to be entered. Then edit in the screen of fig.I.5.1.13 until it is
identical to that of fig. I.5.1.14 below.

Fig. I.5.1.14

page appendix-120 manual ecolog asi system


The following screen is then called.

Fig.I.5.1.15

Continue the process by clicking (fig. I.5.1.15).

Step 9: Creat I/O-Map


An Input/Output-Map is to be created. Please ensure that the Node_3
line is highlighted (selected) as shown (fig.I.5.1.16) !!! Initiate this

process by clicking Auto Map.. in the screen of


fig.I.5.1.16

Fig.I.5.1.16

The screen of fig.I.5.1.17 then appears.

Fig.I.5.1.17

Complete the mapping by clicking (fig.I.5.1.17).

manual ecolog asi system page appendix-121


The map that has been created can be viewed by clicking

in the screen of fig.I.5.1.16, which causes the screen


below to appear.

Fig.I.5.1.17

The Input-Map is shown in fig.I.5.1.17. Clicking (Output)

(fig.I.5.1.17) causes the Output-Map to be


displayed as in fig.I.5.1.18 below.

Fig.I.5.1.18

Continue by clicking (fig.I.5.1.18) causing the screen of


fig.I.5.1.19 to appear.

Step 10: Transfer Parameters to


Scanner and File
The parameters are to be transferred to the Scanner (SDN). Please
ensure that the Node_3 line is highlighted (selected) as shown
(Fig.I.5.1.19)!!!

page appendix-122 manual ecolog asi system


Initiate this transfer by clicking (SDN...) in the
screen of fig.I.5.1.19 below.

Fig.I.5.1.19

The screen of fig.I.5.1.20 then appears.

Fig.I.5.1.20

Continue by clicking (fig.I.5.1.20) perhaps causing the

following to appear. Click and place the Scanner


keyswitch in the Program Mode.

Fig.I.5.1.21

Repeating Step 10 up to this point , this time with the above mentioned
switch in the proper position, causes the following screen to appear. Click
(fig.I.5.1.22 ) to complete the transfer.

manual ecolog asi system page appendix-123


Fig.I.5.1.22

Clicking (File) in the screen of fig.I.5.1.19


causes the following screen to appear.

Here the file name GateW1.sl4 has been used, however file and disk
drive names are specific to your project.

Fig.I.5.1.23

Complete the file saving process by clicking (fig.I.5.1.23).


The screen of fig.I.5.1.24 is then called.

Step 11: Transfer Module Config.


to Scanner and File

Fig.I.5.1.24

Transfer Module Configuration to Scanner and File by proceeding in a


manner similar to that indicated in step 10.

To complete the set-up click (fig.I.5.1.24) and


in the screen that then appears. If you have no further set-ups to carry
out you can exit the DeviceNet Manager.

page appendix-124 manual ecolog asi system


Looking at the results
The steps discussed above are to be used whenever a gateway
application is to be configured. They can be modified depending on the
number of I/O-bytes to be transferred. The resulting I/O- Maps viewed
from the PLC-side (here an SLC-500) is given below for your reference.

PLC bits bits bits bits


input word 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
I:1.0 RESERVED
AS-i System 1
I:1.1 %IX1.2.3 ... 0 %IX1.3.3 ... 0 status/control %IX1.1.1 ... 0
I:1.2 %IX1.6.3 ... 0 %IX1.7.3 ... 0 %IX1.4.3 ... 0 %IX1.5.3 ... 0
I:1.3 %IX1.10.3 ... 0 %IX1.11.3 ... 0 %IX1.8.3 ... 0 %IX1.9.3 ... 0
I:1.4 %IX1.14.3 ... 0 %IX1.15.3 ... 0 %IX1.12.3 ... 0 %IX1.13.3 ... 0
I:1.5 %IX1.18.3 ... 0 %IX1.19.3 ... 0 %IX1.16.3 ... 0 %IX1.17.3 ... 0
I:1.6 %IX1.22.3 ... 0 %IX1.23.3 ... 0 %IX1.20.3 ... 0 %IX1.21.3 ... 0
I:1.7 %IX1.26.3 ... 0 %IX1.27.3 ... 0 %IX1.24.3 ... 0 %IX1.25.3 ... 0
I:1.8 %IX1.30.3 ... 0 %IX1.31.3 ... 0 %IX1.28.3 ... 0 %IX1.29.3 ... 0
AS-i System 2
I:1.9 %IX2.2.3 ... 0 %IX2.3.3 ... 0 status/control %IX2.1.1 ... 0
I:1.10 %IX2.6.3 ... 0 %IX2.7.3 ... 0 %IX2.4.3 ... 0 %IX2.5.3 ... 0
I:1.11 %IX2.10.3 ... 0 %IX2.11.3 ... 0 %IX2.8.3 ... 0 %IX2.9.3 ... 0
I:1.12 %IX2.14.3 ... 0 %IX2.15.3 ... 0 %IX2.12.3 ... 0 %IX2.13.3 ... 0
I:1.13 %IX2.18.3 ... 0 %IX2.19.3 ... 0 %IX2.16.3 ... 0 %IX2.17.3 ... 0
I:1.14 %IX2.22.3 ... 0 %IX2.23.3 ... 0 %IX2.20.3 ... 0 %IX2.21.3 ... 0
I:1.15 %IX2.26.3 ... 0 %IX2.27.3 ... 0 %IX2.24.3 ... 0 %IX2.25.3 ... 0
I:1.16 %IX2.30.3 ... 0 %IX2.31.3 ... 0 %IX2.28.3 ... 0 %IX2.29.3 ... 0
Fig.I.5.1.25 PLC inputs, example :
Gateway mode, C1 = 16, C2 = 16, CC = 0

PLC bits bits bits bits


output word 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
O:1.0 RESERVED

manual ecolog asi system page appendix-125


AS-i System 1
O:1.1 %QX1.2.3 ... 0 %QX1.3.3 ... 0 status/control %QX1.1.3 ... 0
O:1.2 %QX1.6.3 ... 0 %QX1.7.3 ... 0 %QX1.4.3 ... 0 %QX1.5.3 ... 0
O:1.3 %QX1.10.3 ... 0 %QX1.11.3 ... 0 %QX1.8.3 ... 0 %QX1.9.3 ... 0
O:1.4 %QX1.14.3 ... 0 %QX1.15.3 ... 0 %QX1.12.3 ... 0 %QX1.13.3 ... 0
O:1.5 %QX1.18.3 ... 0 %QX1.19.3 ... 0 %QX1.16.3 ... 0 %QX1.17.3 ... 0
O:1.6 %QX1.22.3 ... 0 %QX1.23.3 ... 0 %QX1.20.3 ... 0 %QX1.21.3 ... 0
O:1.7 %QX1.26.3 ... 0 %QX1.27.3 ... 0 %QX1.24.3 ... 0 %QX1.25.3 ... 0
O:1.8 %QX1.30.3 ... 0 %QX1.31.3 ... 0 %QX1.28.3 ... 0 %QX1.29.3 ... 0
AS-i System 2
O:1.9 %QX2.2.3 ... 0 %QX2.3.3 ... 0 status/control %QX2.1.3 ... 0
O:1.10 %QX2.6.3 ... 0 %QX2.7.3 ... 0 %QX2.4.3 ... 0 %QX2.5.3 ... 0
O:1.11 %QX2.10.3 ... 0 %QX2.11.3 ... 0 %QX2.8.3 ... 0 %QX2.9.3 ... 0
O:1.12 %QX2.14.3 ... 0 %QX2.15.3 ... 0 %QX2.12.3 ... 0 %QX2.13.3 ... 0
O:1.13 %QX2.18.3 ... 0 %QX2.19.3 ... 0 %QX2.16.3 ... 0 %QX2.17.3 ... 0
O:1.14 %QX2.22.3 ... 0 %QX2.23.3 ... 0 %QX2.20.3 ... 0 %QX2.21.3 ... 0
O:1.15 %QX2.26.3 ... 0 %QX2.27.3 ... 0 %QX2.24.3 ... 0 %QX2.25.3 ... 0
O:1.16 %QX2.30.3 ... 0 %QX2.31.3 ... 0 %QX2.28.3 ... 0 %QX2.29.3 ... 0
Fig.I.5.1.26 PLC outputs, example:
Gateway mode, C1 = 16, C2 = 16, CC = 0

One more very important point


In order to allow a transfer of PLC outputs to the AS-i system it is
necessary that bit 0 of output word 0 of the PLC has the value
TRUE. Please ensure that this is accomplished before attempting to
transfer any bits from the PLC-side (here an SLC-500) to the AS-i
system.

I.5.2 Pre-Processing Application

page appendix-126 manual ecolog asi system


The application is as for the Gateway example above (section I.5.1) with
the following additions:

• The data to be transferred is as follows

- All AS-i I/O data (both AS-i systems)


-30 bytes of pre-processed data

• Analog modules are to be connected to the AS-i system, these are as


follows:

- PT100 AC2606 (slave 6)

- Analog input AC2610 (slave 10)

- Analog output AC2611(slave 11)

• Function Blocks for these modules are to be run in the DeviceNet-


AS-i Controller

• The analog values are to be mapped as follows:

- analog value from inputs of slave 6 are to be transferred


contiguously starting at PLC address I:1.21

- analog value from input of slave 10 to PLC word address I :1.17

- analog value from PLC word address O:1.17 to output of slave 11

Step 1: Hardware Connection


The hardware connection in conjunction with the AS-i-DeviceNet
Controller and the DeviceNet system is as in section I.5.1 above. Please
refer to this section for information concerning this procedure.

Step 2-Step 6:
Configuration:Scanner and
AS-i -DeviceNet Controller
The steps to be followed are similar to those given in section I.5.1.
Please proceed with step 2 thru step 6 of that section (where
necessary).

Step 7: Enter Block Code


As indicated in the application description all AS-i I/O data (both AS-i
systems) are to be transferred between the AS-i DeviceNet Controller
and the Scanner. In addition 30 bytes of pre-processed data are also to
be transferred. As discussed in section I3.3 above this information is
given to the AS-i DeviceNet Controller by means of Block Code C1, C2
and CC. For this application the required values are

• C1 = 16
• C2 = 16
• CC = 30
Enter these values via the MODE/SET buttons on the controller using
menu C. To accomplish this please proceed as in step 7, section I.5.1
above, using the desired values for C1,C2 and CC.

manual ecolog asi system page appendix-127


Remember that to cause these values to be activated please repeat
step 2:Controller(DeviceNet node) address.

Step 8: Edit Scan Parameters


The information ( transfer of all AS-i I/O data, 30 bytes pre-processed
data) is given to the Scanner by means of the Scan Parameters, which
are to be entered at this time. Please proceed as in step 8, section I.5.1
above. The only deviation between this and the previous section are
the entries in the screen. This screen is shown for your reference below.
Please ensure that your screen is identical.

Fig. I.5.2.1

Step 9 - Step11:
Proceed as in section I.5 Steps 9 thru Step 11.

Looking at the results


The steps discussed above are to be used whenever a pre-processing
application is to be configured. They can be modified depending on the
number of I/O-bytes to be transferred. The resulting I/O- Maps viewed
from the PLC-side (here an SLC-500) are given below for your reference.

PLC bits bits bits bits


input word 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

I:1.0 RESERVED
I:1.1 %IX1.2.3 ... 0 %IX1.3.3 ... 0 status/control %IX1.1.3 ... 0

page appendix-128 manual ecolog asi system


I:1.2 %IX1.6.3 ... 0 %IX1.7.3 ... 0 %IX1.4.3 ... 0 %IX1.5.3 ... 0
I:1.3 %IX1.10.3 ... 0 %IX1.11.3 ... 0 %IX1.8.3 ... 0 %IX1.9.3 ... 0
I:1.4 %IX1.14.3 ... 0 %IX1.15.3 ... 0 %IX1.12.3 ... 0 %IX1.13.3 ... 0
I:1.5 %IX1.18.3 ... 0 %IX1.19.3 ... 0 %IX1.16.3 ... 0 %IX1.17.3 ... 0
I:1.6 %IX1.22.3 ... 0 %IX1.23.3 ... 0 %IX1.20.3 ... 0 %IX1.21.3 ... 0
I:1.7 %IX1.26.3 ... 0 %IX1.27.3 ... 0 %IX1.24.3 ... 0 %IX1.25.3 ... 0
I:1.8 %IX1.30.3 ... 0 %IX1.31.3 ... 0 %IX1.28.3 ... 0 %IX1.29.3 ... 0
I:1.9 %IX2.2.3 ... 0 %IX2.3.3 ... 0 status/control %IX2.1.3 ... 0
I:1.10 %IX2.6.3 ... 0 %IX2.7.3 ... 0 %IX2.4.3 ... 0 %IX2.5.3 ... 0
I:1.11 %IX2.10.3 ... 0 %IX2.11.3 ... 0 %IX2.8.3 ... 0 %IX2.9.3 ... 0
I:1.12 %IX2.14.3 ... 0 %IX2.15.3 ... 0 %IX2.12.3 ... 0 %IX2.13.3 ... 0
I:1.13 %IX2.18.3 ... 0 %IX2.19.3 ... 0 %IX2.16.3 ... 0 %IX2.17.3 ... 0
I:1.14 %IX2.22.3 ... 0 %IX2.23.3 ... 0 %IX2.20.3 ... 0 %IX2.21.3 ... 0
I:1.15 %IX2.26.3 ... 0 %IX2.27.3 ... 0 %IX2.24.3 ... 0 %IX2.25.3 ... 0
I:1.16 %IX2.30.3 ... 0 %IX2.31.3 ... 0 %IX2.28.3 ... 0 %IX2.29.3 ... 0
I:1.17 %QX0.1.7...0 %QX0.0.7...0
I:1.18 %QX0.3.7...0 %QX0.2.7...0
I:1.19 %QX0.5.7...0 %QX0.4.7...0
I:1.20 %QX0.7.7...0 %QX0.6.7...0
I:1.21 %QX0.9.7...0 %QX0.8.7...0
I:1.22 %QX0.11.7...0 %QX0.10.7...0
I:1.23 %QX0.13.7...0 %QX0.12.7...0
I:1.24 %QX0.15.7...0 %QX0.14.7...0
I:1.25 %QX0.17.7...0 %QX0.16.7...0
I:1.26 %QX0.19.7...0 %QX0.18.7...0
I:1.27 %QX0.21.7...0 %QX0.20.7...0
I:1.28 %QX0.23.7...0 %QX0.22.7...0
I:1.29 %QX0.25.7...0 %QX0.24.7...0
I:1.30 %QX0.27.7...0 %QX0.26.7...0
I:1.31 %QX0.29.7...0 %QX0.28.7...0
Fig. I.5.2.2 PLC inputs, example:
Pre-processing mode, C1 = 16, C2 = 16, CC =30

PLC bits bits bits bits


output word 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

O:1.0 RESERVED

manual ecolog asi system page appendix-129


O:1.1 %IX0.33.7...0 %IX0.32.7...0
O:1.2 %IX0.35.7...0 %IX0.34.7...0
O:1.3 %IX0.37.7...0 %IX0.36.7...0
O:1.4 %IX0.39.7...0 %IX0.38.7...0
O:1.5 %IX0.41.7...0 %IX0.40.7...0
O:1.6 %IX0.43.7...0 %IX0.42.7...0
O:1.7 %IX0.45.7...0 %IX0.44.7...0
O:1.8 %IX0.47.7...0 %IX0.46.7...0
O:1.9 %IX0.49.7...0 %IX0.48.7...0
O:1.10 %IX0.51.7...0 %IX0.50.7...0
O:1.11 %IX0.53.7...0 %IX0.52.7...0
O:1.12 %IX0.55.7...0 %IX0.54.7...0
O:1.13 %IX0.57.7...0 %IX0.56.7...0
O:1.14 %IX0.59.7...0 %IX0.58.7...0
O:1.15 %IX0.61.7...0 %IX0.60.7...0
O:1.16 %IX0.63.7...0 %IX0.62.7...0
O:1.17 %IX0.1.7...0 %IX0.0.7...0
O:1.18 %IX0.3.7...0 %IX0.2.7...0
O:1.19 %IX0.5.7...0 %IX0.4.7...0
O:1.20 %IX0.7.7...0 %IX0.6.7...0
O:1.21 %IX0.9.7...0 %IX0.8.7...0
O:1.22 %IX0.11.7...0 %IX0.10.7...0
O:1.23 %IX0.13.7...0 %IX0.12.7...0
O:1.24 %IX0.15.7...0 %IX0.14.7...0
O:1.25 %IX0.17.7...0 %IX0.16.7...0
O:1.26 %IX0.19.7...0 %IX0.18.7...0
O:1.27 %IX0.21.7...0 %IX0.20.7...0
O:1.28 %IX0.23.7...0 %IX0.22.7...0
O:1.29 %IX0.25.7...0 %IX0.24.7...0
O:1.30 %IX0.27.7...0 %IX0.26.7...0
O:1.31 %IX0.29.7...0 %IX0.28.7...0
Fig. I.5.2.3 PLC outputs, example:
Pre-processing mode, C1 = 16, C2 = 16, CC =30

Step 12: The AS-i Controller


Project
A detailed discussion of the AS-i controller project necessary for this
application is beyond the scope of this document.

page appendix-130 manual ecolog asi system


A listing of a sample project corresponding to this application is given
below.

Please be aware that due to the difference between the memory


organization of the AS-i- DeviceNet Controller and the SLC-500 system it
is necessary to exchange the BYTES in a given WORD when
transfering WORD values between the two systems. This is carried out
by means of the Function SwapByte as shown below in the listing.

Fig. I.5.2.4 Variable declaration

Fig. I.5.2.5 Analog input Function Block call (note SwapByte after
transfer)

manual ecolog asi system page appendix-131


Fig. I.5.2.6 Analog output Function Block call (note SwapByte before
transfer

Fig. I.5.2.7 PT100 Function Block call (note SwapByte is carried out in
the Function Block TempTestPrepareAndTransfer)

page appendix-132 manual ecolog asi system


Fig. I.5.2.8 Function SwapByte

manual ecolog asi system page appendix-133


K. Description of AS-i ↔ Interbus interface

The InterBus-S controller incorporates an InterBus-S remote bus slave


interface. Via this interface an InterBus-S master system can cyclically
exchange data with the AS-i InterBus-S controller. This exchange of data
can be performed with and without signal preprocessing. The operation
without signal preprocessing is also called coupling or gateway operation.
The controller has the module ID 3 (combined input/output module
without PCP channel), the length of the process data channel depends
on the controller settings.

The InterBus-S process data interface is fitted with an InterBus-S IC


SUPI3. The data lengths to be transmitted are set via the buttons of the
InterBus-S controller, menu point C.
For the initialization of the InterBus-S the data lengths are considered
according to the controller settings. Data lengths between 4 bytes up to
max. 32 bytes are possible.

For the controller a distinction is made between two modes of operation:

• Gateway function (coupling operation)

If the controller is in the STOP mode (i.e. no signal preprocessing), only


the I/O data of the AS-i master can be directly read and written. In
this case the controller operates as a gateway.

• Signal preprocessing

If the controller is in the RUN mode (i.e. signal preprocessing active), it is


also possible to exchange data between the InterBus-S master and
the signal preprocessing in the controller.

The figure K1 shows the data structures. So the signal preprocessing in


the controller can for example exchange analog data with the slaves
via a function block in the application program and provide the
processed data to the higher-level system. To avoid possible conflicts
between the output data of the InterBus-S master and the signal
preprocessing the direct transfer of InterBus-S data to the AS-i master
is not possible in this mode, only the signal preprocessing can write
output data (see the next page - figure K1).

Manual ecolog asi system Appendix-133


AS-i InterBus-S controller
InterBus-S
AS-Interface
coupling area (C1 + C2)
32-byte outputs 32-byte inputs
gateway %IB1.1 -%IB1.31
no CTRL address or
CTRL Run/Stop
%IB2.1 -%IB2.31
32-byte inputs
CTRL addresses
%IB0.32 -%IB0.63 STOP 32-byte outputs
%QB1.1 -%QB1.31
or
RUN %QB2.1 -%QB2.31
additional area (CC)
32-byte outputs
CTRL addresses
%QB0.0 -%QB0.31 signal preprocessing
32-byte inputs CTRL
CTRL addresses
%IB0.0 - %IB0.31

Fig. K.1 Signal assignment in the AS-i InterBus-S controller

To optimise the data transfer and the required memory space in the
InterBus-S master it is possible to transfer the data fields completely, in
part or not at all. The size of the input area and output area is always the
same. Via the push buttons Mode and Set at the front of the controller
the length of the data of the coupling area can be configured. In the
menu point C, sub-point 1 for the AS-i master 1 or in the menu point C,
sub-point 2 for the AS-i master 2 (only for AC1020) the data length can
be adjusted to 4, 8, 12 or 16 bytes.
If there is only the AS-i master 1 (AC1019) and if the menu point C, sub-
point 2 is selected, the controller display indicates the error number 60
(E-60) which means "AS-i master 2 not connected"!

An additional area directly exchanges the data with the signal


preprocessing. Its use only makes sense if the signal preprocessing is
active, i.e. the controller is in the RUN mode. In the menu point C, sub-
point C this additional area can be configured between 0 and 32 bytes in
steps of 4 bytes.

The factory pre-set of the controller data lengths is as follows:

C1 = 16 ⇒ AS-i master 1 has 16-byte I/O data (= 31 AS-i slaves)


C2 = 16 ⇒ AS-i master 2 has 16-byte I/O data (= 31 AS-i slaves to
AS-i master 2 - only for the double master AC1020)
CC = 00 ⇒ No data from the signal preprocessing

Appendix 134 manual ecolog asi system


The total data lengths of the coupling and additional areas must not
exceed 32 bytes (C1 + C2 + CC 32). If a total data length greater than
32 bytes is set, the controller display shows the error number 80 (E-80)
which means "Maximum data length exceeded"!

Note that for the gateway operation it is absolutely necessary to make


an indication in the menu point C, sub-point 1 (for AC1019 and AC1020)
and sub-point 2 (only for AC1020). Only if the controller is used with
signal preprocessing (RUN mode), a data length must be indicated in the
menu point C, sub-point C.

Provided that a data length of 16 bytes each is set in the menu point C,
sub-points 1 and 2, that means C1-16, C2=16 and CC=0, the assignment
of the coupling area is as follows:

Byte no. Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
n+0 status/control nibble master 1 Master 1, Slave 1
n+1 master 1, slave 2 master 1, slave 3
n+2 master 1, slave 4 master 1, slave 5
n+3 master 1, slave 6 master 1, slave 7
n+4 master 1, slave 8 master 1, slave 9
n+5 master 1, slave 10 master 1, slave 11
n+6 master 1, slave 12 master 1, slave 13
n+7 master 1, slave 14 master 1, slave 15
n+8 master 1, slave 16 master 1, slave 17
n+9 master 1, slave 18 master 1, slave 19
n + 10 master 1, slave 20 master 1, slave 21
n + 11 master 1, slave 22 master 1, slave 23
n + 12 master 1, slave 24 master 1, slave 25
n + 13 master 1, slave 26 master 1, slave 27
n + 14 master 1, slave 28 master 1, slave 29
n + 15 master 1, slave 30 master 1, slave 31
n + 16 status/control nibble master 2 master 2, slave 1
n + 17 master 2, slave 2 master 2, slave 3
n + 18 master 2, slave 4 master 2, slave 5
n + 19 master 2, slave 6 master 2, slave 7
n + 20 master 2, slave 8 master 2, slave 9
n + 21 master 2, slave 10 master 2, slave 11
n + 22 master 2, slave 12 master 2, slave 13
n + 23 master 2, slave 14 master 2, slave 15
n + 24 master 2, slave 16 master 2, slave 17
n + 25 master 2, slave 18 master 2, slave 19
n + 26 master 2, slave 20 master 2, slave 21
n + 27 master 2, slave 22 master 2, slave 23
n + 28 master 2, slave 24 master 2, slave 25
n + 29 master 2, slave 26 master 2, slave 27
n + 30 master 2, slave 28 master 2, slave 29
n + 31 master 2, slave 30 master 2, slave 31
n = start address of the memory area in the PLC (offset)

Manual ecolog asi system Appendix-135


The assignment of the status nibbles of the InterBus inputs is as
follows:

Bit no. Meaning =1 =0


7 signal preprocessing (Run / Stop) runs stops
6 AS-i power / configuration not OK OK
5 start-up completed yes no
diagnostic process data
4 extended diagnosis
data

The assignment of the control nibble of the InterBus outputs is as


follows:

Bit no. Meaning =1 =0


7 not used -- --
6 not used -- --
5 not used -- --
request request
4 extended diagnosis diagnostic process data
data

If only 8-byte data are configured per master (C1=8, C2=8, CC=0), the
assignment is as follows:

Byte no. Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
n+0 status/control nibble master 1 master 1, slave 1
n+1 master 1, slave 2 master 1, slave 3
n+2 master 1, slave 4 master 1, slave 5
n+3 master 1, slave 6 master 1, slave 7
n+4 master 1, slave 8 master 1, slave 9
n+5 master 1, slave 10 master 1, slave 11
n+6 master 1, slave 12 master 1, slave 13
n+7 master 1, slave 14 master 1, slave 15
n+8 status/control nibble master 2 master 2, slave 1
n+9 master 2, slave 2 master 2, slave 3
n + 10 master 2, slave 4 master 2, slave 5
n + 11 master 2, slave 6 master 2, slave 7
n + 12 master 2, slave 8 master 2, slave 9
n + 13 master 2, slave 10 master 2, slave 11
n + 14 master 2, slave 12 master 2, slave 13
n + 15 master 2, slave 14 master 2, slave 15
n = start address of the memory area in the PLC (offset)

Appendix 136 manual ecolog asi system


• Controller operation

⇒ Power up

After power up the LED’s are tested. All status LED’s and the display
segments are switched on for 1 s.

Then the controller hardware and software versions are indicated for
1 s each. They are unchangeably stored in the PROM by the
manufacturer.

After the start-up phase of the controller a bus failure (controller display:
bF) flashes. This means "InterBus communication not active".

⇒ Caution!!! For commissioning without PC, first the "locking" (menu


blocked) must be removed in the controller by simultaneously
pressing the MODE and SET buttons for 5 s.

Function 8 ⇒ project AS-i slaves

This function enables a quick set-up of the controller.

Adopt projected slaves:

After addressing and installation of the AS-i slaves they are read by
the master (LDS = list of detected slaves) and permanently stored as
list of projected slaves (LPS) in the EEPROM.

To execute the function 8 the master briefly passes into the projection
mode and then returns to the protected mode.

Operation:

1. Select function 8 and master 1 (or 2)

• •
MODE SET

81
2. After pressing SET the last two digits of the display flash with PP, the
master is in the projection mode.

Manual ecolog asi system Appendix-137


• •
MODE SET

81PP
3. After pressing SET again the display stops flashing for about 2 s. The
data are written to the memory.

• •
MODE SET

81PP

Function 9 ⇒ Controller RUN/STOP

The integrated controller processor can be influenced by this function:

STOP = Gateway function

• •
MODE SET

9C-S
The yellow LED CTRL is not lit. Only the I/O data of the AS-i master can
be directly read and written. Then the controller operates as a
gateway.

Appendix 138 manual ecolog asi system


RUN = Signal preprocessing

• •
MODE SET

9C-r
The yellow LED CTRL is lit, i.e. the controller is in the RUN mode. Data
can thus be exchanged between the InterBus-S master and the
signal preprocessing via the additional area of the controller (see
function C "Setting of the data lengths for the InterBus coupling"). So
the signal preprocessing in the controller can exchange analogue data
with slaves via a function block in the application program and
provide the processed data to the higher-level system.

To avoid possible conflicts between the output data of the InterBus-S


master and the signal preprocessing the direct transfer of InterBus-S
data to the AS-i slaves is not possible in this mode, only the signal
preprocessing can write output data.

Function A ⇒ Set the controller address for the serial program-


ming interface

1. Press the MODE button until A is indicated at the 1st digit in the
display. Then confirm with the SET button.

2. Press the SET button until the 4th digit flashes. Now the address is set
with the MODE button, in our example the figure 1. To confirm press
the SET button.

• •
MODE SET

A001
1st 2nd 3rd 4th digit

Example display AS-i controller (factory pre-set)

Manual ecolog asi system Appendix-139


⇒ The set address in the menu point A is not important for the data
coupling with the InterBus-S. But the address is used as a controller
address for the programming interface. So make sure that in the
configuration of the software asisys in the window „Configuration“
the address set under the controller function A is indicated at the
position "Controller Number" in the menu point "Extras", sub-point
"Master". (Since the address is not important for the function of the
InterBus-S there is no reason not to provide all controllers connected
to the InterBus-S with the same address in the function A. This saves
you the trouble to always have to select another address for the
programming interface in your software.)

Function b ⇒ Set the transmission rate of the programming


interface

To set the transmission rate of the serial programming interface proceed


as follows:

1. Press the MODE button until b is indicated at the 1st digit in the
display. Then confirm with the SET button.

2. After pressing the SET button the last three digits of the display flash.
Set the requested transmission rate with the MODE button and
confirm with the SET button.

Possible settings: b_48 = 4800 baud


b_96 = 9600 baud
b192 = 19200 baud (factory pre-set)
b384 = 38400 baud
b576 = 57600 baud
b624 = 62400 baud

• •
MODE SET

b192
1st 2nd 3rd 4th digit

Example display AS-i controller (factory pre-set: 19200 baud)

Appendix 140 manual ecolog asi system


Function C ⇒ Setting of the data lengths for the InterBus-S
coupling

1. Select function C with the Mode button and confirm with the SET
button.

2. Select the data area of the AS-i master 1 with the MODE button and
confirm with the SET button.

• •
MODE SET

C1
1st 2nd 3rd 4th digit

Example display AS-i controller, master 1

3. After pressing the SET button the last two digits of the display flash
with the set value. Press the MODE button to select the requested
number of bytes for the data length of the coupling area of the AS-i
master 1 and confirm with the SET button.

• •
MODE SET

C116
1st 2nd 3rd 4th digit

Example display AS-i controller (factory pre-set master 1: 16 bytes)

Manual ecolog asi system Appendix-141


4. Repeat the points 2 and 3 for the data area of the AS-i master 2 (only
for the AC1020 double master).
If this point is executed for AC1019, the error message "E-60" is
displayed because AC1019 is a single master.

• •
MODE SET

C216
1st 2nd 3rd 4th digit

Example display AS-i controller (factory pre-set master 2: 16 bytes)

5. Select the data area of the signal preprocessing with the MODE button
and confirm with the SET button.

• •
MODE SET

CC
1st 2nd 3rd 4th digit

Example display AS-i controller (additional area signal preprocessing)

6. After pressing the SET button the last two digits of the display flash
with the set value. Press the MODE button to select the requested
value for the data length of the additional area of the signal
preprocessing and confirm with the SET button.

Appendix 142 manual ecolog asi system


• •
MODE SET

CC00
1st 2nd 3rd 4th digit

Example display AS-i controller


(factory pre-set: CC00,
i.e. no data from the signal preprocessing)

The total data lengths of the coupling and additional areas must not
exceed 32 bytes (C1 + C2 + CC 32). If a total data length greater than
32 bytes is set, the controller display shows the error number 80 (E-80)
which means "Maximum data length exceeded"! If the max. permitted
number of 32 bytes is exceeded because of the data length setting of the
additional area of the signal preprocessing, the data lengths of the
coupling areas (menu points C1 and C2) must be reduced first.

In general, you decide either to use the system as a gateway (operation


as a coupler and use of the coupling area) or to use the signal
preprocessing (and the additional area), but combinations of both are
possible too.

To activate the new or changed settings of the data lengths the


controller must be disconnected (cold restart). Only with the
initialization with power up are the new values activated!

Manual ecolog asi system Appendix-143


With power up for the first time or with the MODE button pressed (resetting
the controller to the factory pre-set) the data lengths of the controller are
configured as follows:

Function Sub-point Settings


C 1 16
C 2 16
C C 00

Caution: Resetting the controller to the factory pre-set deletes an


already loaded application program (signal preprocessing) !!!

In addition, the signal preprocessing is in the stop mode, i.e. the function 9
is as follows:

Function Sub-point Settings


9 C -S

This parameter setting corresponds to the operation as a gateway with the


maximum possible data lengths being used, i.e. the factory pre-set.

Function 8.7 ⇒ Restrict the operation

To avoid entries by unauthorised persons during the operation the functions


greater 5 can be blocked.

This is done by selecting the following code:

• •
MODE SET

8777
1st 2nd 3rd 4th digit

Example display AS-i controller

Appendix 144 manual ecolog asi system


• Extract preprocessing

0001 PROGRAM PLC_PRG


0002 VAR
0003 END_VAR

0001
0002 AS-i InterBus-S address assignment for a free memory
configuration
0003
0004 Legend:
0005 Syntax -> %IX1.1.0
0006
0007 bit 0-7
0008 slaves 1 to 31
0009 1=master 1, 2=master 2, 0=fieldbus IBS
0010 X=bit, B=byte, W=word
0011 I=input, Q=output, M=flag
0012 syntax IEC 1131-3
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023 Example for the signal preprocessing:
0024
0025 AS-i IBS controller PLC S5-115U
0026
0027 %QX 0.0.0 I 64.0
0028 … data …
0029 %QX 0.0.3 I 64.3
0030 … …
0031 %QX 0.0.7 I 64.7
0032
0033
0034 %IX 0.0.0 O 64.0
0035 … data …
0036 %IX 0.0.3 O 64.3
0037 … …
0038 %IX 0.0.7 O 64.7
0039
0040
0041
0042

Manual ecolog asi system Appendix-145


0043 Program 1:
0044
0045 Read the AS-i inputs to the PLC via IBS, e.g. input 1 of slave 1
0046
0047
0048 LD %IX1.1.0 (* Load AS-i master 1, slave 1, input 1 *)
0049 ST %QX0.0.0 (* Store IBS byte 0, bit 0 *)
0050
0051
0052
0053
0054
0055 Transfer PLC outputs to AS-i via IBS: e.g. output 1 of slave 1
0056
0057
0058 LD %IX0.0.0 (* Load IBS byte 0, bit 0 *)
0059 ST %QX1.1.0 (* Store AS-i master 1, slave 1, output 1 *)
0060
0061 END_PROGRAM
0062
0063
0064
0065
0066
0067
0068
0069 Program 2:
0070
0071 FUNCTION SlaveInToByte
0072
0073 With this function the complete input information of 2 AS-i slaves
0074 is written to one byte (e.g. InterBus-S). The data of slave 1 are
0075 in the LOW part and the data of slave 2 in the HIGH part of the
0076 byte.
0077
0078
0079 SlaveInToByte
0080 slave no 5 slave1 %QB0.1
0081 slave no. 3 slave2
0082 master system 1 master
0083
0084
0085
0086
0087

Appendix 146 manual ecolog asi system


0088
0089
0090 FUNCTION ByteToSlaveOut
0091
0092 With this function output information can be written to 2 AS-i
slaves
0093 (AS-i slave outputs), e.g. via the InterBus-S. The data of slave 1
0094 are in the LOW part and the data of slave 2 are in the HIGH part
of
0095 the byte.
0096
0097
0098 ByteToSlaveOut
0099 %IB0.1 InByte
0100 slave no. 5 slave1
0101 slave no. 3 slave2
0102 master system 1 master
0103
0104
0105
0106 The functions SlaveInToByte and ByteToSlaveOut can be read
0107 and processed via the library management DEMO_LIB.LIB.
0108
0109
0110
0111

The basic address of the memory area of the inputs and outputs can be
set in the software CMD for the interface modules of the generation 4
from Phoenix Contact. In the above example I 64.0 corresponds to P64
in the assignment of the process data in the context menu of the
interface module.
As an alternative, the basic address can be configured in the correspond-
ing parameter setting FB.

Manual ecolog asi system Appendix-147


• Diagnosis via indication/operating panel

The diagnostic possibilities of the AS-i InterBus-S controller can be


divided into two areas:

− AS-i area with display of the failed slaves

− InterBus-S specific area

By means of the indication and operating panel you can carry out a
simple diagnosis on site.

Indication/operating panel

The meaning of the individual LED’s is explained in the following table.

Status LED of the


Colour Meaning
controller
red actual configuration unequal to pre-set
ALARM CONFIG
configuration
red Single automatic addressing not
NOT AUTO ADDR
enabled
AS-i PWR green AS-i voltage o.k.
COM MODE green normal operation
yellow projection mode, all slaves activated
PROJ MODE
yellow slave 0 detected, changeover to the
PROJ MODE
flashing protected mode not possible
CTRL yellow controller in the RUN mode

Appendix 148 manual ecolog asi system


In addition to the LED’s which describe the controller status, there are
further LED’s which describe the InterBus-S status:

Status LED of the


Colour Meaning
InterBus-S
logic voltage
UL green
- supply voltage present
remote bus cable check
RC green - incoming remote bus connection
established
bus active
BA green - data transmission via the InterBus
active
red status remote bus
RD - continuing remote bus disconnected

Another possibility for a diagnosis on site is the 4-digit LED display. The
failed slaves or other status messages (also see appendix page 43)
flash here.

Example:

Function 1

No error detected => display remains dark!

Indicate missing slaves

In the protected mode missing slaves are indicated automatically.

In the example on the following page the slave with the address 28 is
missing in the master system 2. If more than one missing slave is
detected, they are scrolled at intervals of one second.

Manual ecolog asi system Appendix-149


• •
MODE SET

1228
1st 2nd 3rd 4th digit

Example display AS-i controller

1st digit => error messages

2nd digit => 1 = master 1, 2 = master 2

3rd + 4th digits => slave no.

If the display looks as follows, this means that there is no communication


between the AS-i InterBus-S controller and the InterBus-S. At the
same time the red status LED of the InterBus-S must light on the
controller (LED RD = Remote Bus disabled), moreover the state
LED’s BA (LED BA = Bus access) and RC (LED RC = Remote cable
check) must light off.

• •
MODE SET

bF
1st 2nd 3rd 4th digit

Example display bF = bus failure

The message "bF" (bus failure) describes the status that no


InterBus-S is connected or the connected InterBus-S is not active.
However, this does not affect the controller function.

Appendix 150 manual ecolog asi system


• Extended diagnosis via the application program in the host
system

In addition to the simple diagnosis which for each exchange of data


automatically sends diagnostic data stored in the status nibble (data
nibble of the slave 0 - also see assignment of the coupling area), the
controllers AC1019 and AC1020 can also perform an extended
diagnosis. This is triggered by an active setting of the "output bit 4" of
the control nibble via the host system (also see assignment of the control
nibble).

In addition to the status byte the extended diagnosis supplies the


InterBus-S master with an AS-i slave error list. The AS-i slave error list is
stored in bytes 1 to 4 of the corresponding master system. The input of
the status bit 4 in the byte 0 of the status nibble of the corresponding
master system is used to distinguish between diagnostic data and
process data. If the InterBus input bit 4 is set, the slave error lists of the
slaves 1 to 31 are in the bytes 1 to 4.

Meaning
Byte Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
no.
Status byte
1=PLC Run 1= Config 1 = Master For diag- 1 = AS-i 1= Config 1 = Projec- 1 = Watch-dog
Byte 0 0 = PLC Stop Error start-up nostic data power fail Error tion mode RS232 /
0 = o.k. completed always 1 0 = o.k. RS485
elapsed

Byte 1 error list slaves 7 – 0


Byte 2 error list slaves 15 – 8
Byte 3 error list slaves 23 – 16
Byte 4 error list slaves 31 – 24
Byte 5 AS-i data slaves 10/11
Byte 6 AS-i data slaves 12/13
Byte 7 AS-i data slaves 14/15
Byte 8 AS-i data slaves 16/17
Byte 9 AS-i data slaves 18/19
Byte 10 AS-i data slaves 20/21
Byte 11 AS-i data slaves 22/23
Byte 12 AS-i data slaves 24/25
Byte 13 AS-i data slaves 26/27
Byte 14 AS-i data slaves 28/29
Byte 15 AS-i data slaves 30/31

A bit in the slave error list is set if a slave is projected but not activated
or if a slave was detected but is not activated.

Manual ecolog asi system Appendix-151


Example: A configuration error of slave no. 1 is indicated as logic "1" in
bit 1 of the data byte 1 (note: in bit 1, not in bit 0 - in bit 0 of byte 1 the
presence of a slave with the address 0 is indicated).
An error of slave no. 31 is indicated in bit 7 of byte 4.

The group message "Config. Error" (corresponds to the LED "Alarm


Config" on the controller) is indicated by bit 6 and bit 2 in byte 0!

The extended diagnosis is only possible if the data length for the
AS-i I/O data of the corresponding AS-i master is set to greater
than 4 bytes, i.e. 8, 12 or 16 bytes.

In byte 0 more status information is given which has the following


meaning (see above):

Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0


1=PLC Run 1 = Config 1 = Master For diagnos- 1 = AS-i 1 = Config 1 = Projec- 1 = Watch-
0=PLC Stop Error start-up tic data power fail Error tion mode dog RS232 /
0 = o.k. completed always 1 0 = o.k. RS485
elapsed

!!! CAUTION !!!

When the extended diagnosis is used it is absolutely necessary to


evaluate the status bit 4 in the host system. Otherwise there is the
risk to misinterpret process and/or diagnostic data. This is why
care must be taken when the extended diagnosis is used and
evaluated!

!!! CAUTION !!!

Appendix 152 manual ecolog asi system


• Technical data

InterBus-S
REMOTE OUT
D-SUB 9-pole
socket
RS 232 - C
interface
D-SUB 9-pole InterBus-S
plug REMOTE IN
D-SUB 9-pole
plug

Order no. AC 1019 / AC 1020

Operating voltage [V] 22 - 30 V, typ. 24 V DC PELV

Power consumption [W] ≤ 10

Serial interface RS 232 C


transmission rate 4800 - 62400 baud

AS-i interface according to the specification

Number of screw terminals [pcs] 5/7

Function indication LED AS-i 2 x red, 2 x green, 2 x yellow


Function indication InterBus-S 1 x red, 3 x green

Operating buttons / LED display 1 x MODE, 1 x SET / 4-digit

Operating temperature [°C] 0 ... + 60

Housing DIN rail mounting

Protection rating housing IP 20, terminals IP 20

Mounting horizontal on DIN rail

General technical data

Manual ecolog asi system Appendix-153


Order no. AC 1019 / AC 1020
Max. distance between controller according to the InterBus-S
and InterBus-S master specification for remote bus
participants
Monitoring by watchdog yes, InterBus-S watchdog
ID code 3 (combined input/output module
without PCP channel)
Length of the process data depending on the setting of the
channel controller, max. 32 bytes

InterBus-S specific data

AS-i RS232C
(9-pole D-SUB sockets)
Pin 2: RXD
Pin 3: TXD
Pin 5: GND

Pin connection AS-i controller RS232C programming interface

(Connection cable used, order no. AC4010):


PC null modem cable, i.e. RxD and TxD are crossed, GND connected!)

InterBus-S InterBus-S
(9-pole D-SUB pins) (9-pole D-SUB sockets)
Pin 6: DO - negated Pin 6: DO – negated
Pin 1: DO Pin 1: DO
Pin 7: DI - negated Pin 7: DI – negated
Pin 2: DI Pin 2: DI
Pin 3: COM Pin 3: COM
Pin 5: (link pin 5 and
Pin 9: pin 9 !)

Plug connection remote bus cable

Appendix 154 manual ecolog asi system


Manual ecolog asi system Appendix-155
AS-i _DeviceNet Controller A-99
Index ASI 1- 5-9
ASI 1+ 5-9
AS-i controller 8; 1-6; 5-1
—&— AS-i controller block diagram 2-3
&-icon 3-8 AS-i controller electrical connections A-59
AS-i controller family 8
—8— AS-i controller wiring diagram 2-7
8051 family 2-4 AS-i features 1-2
AS-i flat cable 1-3
—A— AS-i master 8; 1-2; 2-3; 5-14
ABS A-28 AS-i master communication 2-5
AC1003 2-1 AS-i modules 1-4
AC1003 data sheet 2-2 AS-i power supply 1-2; 5-5
AC1004 2-1 AS-i Profi Kit 5-1
AC1206 2-8 AS-i save-system 1-5
AC2000 5-17 AS-i system 1-2
AC2010 5-3; 5-17 AS-i voltage 1-6
AC5000 5-17 AS-i system discription 1-1
Actions 4-7 AS-i library A-35
active connection 5-12 ASIC 1-7
actuator 5-1 AS-i-controller 2-1
acyclic data transfer 1-7 AS-i DeviceNet Controller parameter A-109
Add Object 5-7; 6-13 AS-interface 8
Additional Library 5-7 asisys 8; 12; 3-1
address zero 5-16 assignment operator 7-13
Address A-41 AT 5-25
addressing 1-7; 5-17 Autodeclare 6-9
Address operator A-11 Autoformat 6-8
akt_IDCode_lesen A-36 Autoload 6-8
akt_IOConf_lesen A-36 automatic addressing 1-6; 1-7; 5-15; 5-16
akt_Parameter_lesen A-37 automatic start 5-29
akt_Parameter_schreiben A-39 Autosave 6-5
Alarm system 5-2
alarm1e5.pro 5-1; 5-6; 5-20; 5-21
analog inputs 1-5 —B—
Arithmetic Operators A-1 Background Bitmap 8-6
Array A-44 basic modules 2-3
AS-i 1-1; 5-9 baud rate 5-6

manual ecolog asi system page index-1


bin 5-13 Comparison Functions A-8
Bin.Download 5-13 configuration 5-8
binary 1-7 configuration ASI 5-10
binary-download 5-13 configuration ASI 1 5-21
binary-upload 5-13 configuration OK 1-6
Bistable Function Blocks A-30 Contact 7-32
bit 1-7 contactors 1-4
Bitmaps 8-2 controller address A-78
Bitstring Operators A-3 Controller installation and user
instructions A-59
Block Code A-118; A-127
controller number 5-17
block diagram AS-i controller 2-5
controller operating and control
BOOL-Constants A-40
elements 1-4
Branch 7-37
controller processor 2-4
breakpoint 3-2
conventional binary sensor 1-7
Breakpoint Dialog 6-20
Convert Object 6-13
Breakpoints 7-7; 7-41
Copy 6-16; 7-29
Bring to Front 8-5
copy/paste option 3-20
bus 1-7
corresponding data 2-2
Counter A-31
Creating POUs 4-1
—C—
Cross Reference 6-15
C1 A-118
CTD A-32
C2 A-118
CTU A-31
CAL A-11
CTUD A-32
CAN A-96
current ID code 5-23
capacitive proximity switch 1-5
Cut 6-16; 7-29
CASE statement 7-15
cyclical data transfer 1-7
CC A-118
change address 5-18
circle 8-2 —D—
close a project 6-1
damping cylinder 5-21
Coil 7-32
data (port) 1-7
Colors 6-25
data decoupling 2-8
colour changing 8-3
data organization 3-1
COM ET 200 A-70
data types 7-2
Comments 7-24
DDE interface 8-7
communication parameters 5-6; 6-18; 6-23
debugging 3-2
communications interface 2-3; 2-6
declaration 7-1
Compare Projects 6-26
declaration editor 7-1

page index-2 manual ecolog asi system


declaration table 7-3 F2 key 3-9
Declarations as Tables 6-25; 7-3 FBD editor 7-26
DEFAULT.DFR 6-3 Find next 6-17
Delete 6-16; 7-29 Flow Control 6-22; 7-10
Delete Object 6-12 Flow control in ST 7-18
delete slave 5-10 flow monitors 1-5
DeviceNet A-95 Font 6-25
DeviceNet Data Mapping A-101 FOR loop 7-16
DeviceNet Input/Output-Map A-121 Force Values to PLC 6-21
DeviceNet Manager A-108; A-112 forcing 3-2
DeviceNet node address A-96 FREEZE/SYNC A-90
DeviceNet scanner A-95 function 7-6
diagnosis 1-5 function block diagram 3-1
Directories 6-6 function blocks 7-6
display / operating panel 2-4
DN2001 2-8
documentation 3-2 —G—
double addressing 1-3 Gateway A-96
download 5-12; 5-13; 6-19 Gateway (coupler) 1-7
Gateway function A-68; A-72
geometrical objects 8-2
—E— Global replace 6-12
ecoasi.lib 10; 5-28; 5-7 Global search 6-12
Edge Detection A-31 Global Variables 6-26; 7-42
Editor 7-1 graphical editors 7-24
EDS A-108; A-113 GSD file A-67; A-90
EDS file A-96
Electronic Data Sheet A-108
EN 7-33 —H—
encapsulated button/signal station 1-5 hand-held addressing unit 1-3
essential components 1-2 Help manager 7-45
example 4-1 host 1-7
EXIT statement in ST 7-18
Export 6-9
expression 7-11
—I—
I/O configuration 5-24; 5-11
ID-Code 5-11
—F— IEC1131-3 3-1
F_TRIG A-31 IEC-1131-3 standard 3-1

manual ecolog asi system page index-3


IF statement 7-15 lists and flags 1-6
IG5886 5-2; 5-17 load projection 5-20
illuminated buttons 1-5 Local variables 7-1
import 6-9 Login 3-13; 5-12; 6-18
inductive proximity switch 1-5 Logout 3-16; 6-19
Input Selection 6-17 LPS 1-6; 5-16
Input variables 7-1 LPS_lesen A-35
Input_lesen A-38
insert operator 7-28
Installation 3-3 —M—
instruction list 3-1 MAC ID A-96
Instruction list 7-8 manual projection 5-15
intelligent sensor 1-8 master 1-8; 5-14
InTouch 8-8 master call 1-8
invocation of a function block in ST 7-14 memory allocation 2-6
isolation displacement connectorl 1-8 Merge 6-10
Ist_Konfigurationsdaten_projektieren A-39 Message window 6-4
Modifiers 7-8
module 1-8
—J— Monitoring 6-25
Jump in LD 7-33 Monitoring Options 7-6
Jump in SFC 7-37 Motion 8-4
motor starter 1-5
mounting A-59
—K— MS EXCEL 8-7
Keywords 7-1 MS WORD for Windows 8-7

—L— —N—
Labels 7-24 Negate 7-34
ladder diagram 3-1 Negation 7-29
Ladder Diagram editor 7-31 network 3-8
languages 3-12 Network Who A-116
LAS 1-6 Networks 7-24
LAS_lesen A-35 new project 3-4; 6-1
LDS 1-6; 5-16; 5-23 Next Error 6-17
LDS_lesen A-35 normal operation 1-6
library 6-2 Numerical functions A-28
Library Manager 5-7; 6-26; 7-43

page index-4 manual ecolog asi system


—O— powerfail monitoring 2-7

object 3-5 Previous Error 6-17

object list 6-12 Previous Version 6-15

online 5-29; 3-13; 7-6 print 6-2

Online commands 6-18 print a documentation 6-9

online help 6-27 Printer Setup 6-2; 6-3

online mode 7-24; 7-30; 7-34; 7-41 processor chip 2-5

Online\Write Values to PLC 3-14 profi kit 10; 5-3; 5-28

open 5-12 profibus DP interface 2-6

open a project 6-1 Profibus-DP A-67

Open Object 6-14 Program 3-5

operand 7-6 programming languages 3-1

Operands 3-10 proj_IDCode_lesen A-37

operating and display A-59 proj_Parameter_schreiben A-38

operating and display panel 2-6 project 3-1; 6-1

operating panels 1-4 project all 5-20

operator 7-5; A-1 project info 6-6; 6-11

optional components 2-4 Project Options 6-5

Output variables 7-1 projected ID code 5-24

Output_schreiben A-38 projected slaves 5-9


projection data 5-20
projection mode 1-6; 5-15; 5-16; 5-18; 5-23
—P— proper application A-59
parameter (port) 1-8 protection rates 1-4
parameters 1-5 protocol 2-3
parity 5-6
participant 1-8
password 6-7 —R—
Paste 6-16; 7-29 R_TRIG A-31

PC-communication port 5-6 read projected I/O configuration A-37

PELV 1-8 ready for operation 5-2; 5-21

photo-electric proximity switch 1-5 Rebuild all 6-4

placeholder 6-4 rectangle 8-2

plc configuration 5-9; 5-10; 5-17; 5-19; Release Force 6-21


6-26; 7-42 Rename Object 6-13
PLC_PRG 3-5; 3-6; 5-7 REPEAT loop 7-17
polygon 8-2 repeater 1-8
POU 3-1 Replace 6-17
power switches 1-4 Reset 6-19

manual ecolog asi system page index-5


Result 3-10 Show Call Stack 6-21
retentive flags 2-7 Show Call Tree 6-14
RETURN statement 7-14 Show Unused variables 6-15
rising edge 5-28 SHR A-29
ROL A-29 Signal pre-processing A-68; A-73; A-96
ROR A-29 simulation 3-2; 3-22; 5-6; 6-23
RS A-30 Simulations-Mode 5-6
Run 3-13; 5-29; 6-19 Single Cycle 6-21
single-master-system 1-9
slave 0 5-18
—S— slave 0 detected 1-6
S5 project 6-10 slave address 0 1-3
S5-IL-editor 7-19 slave configuration 5-9; 5-22
safe range 5-2; 5-21 slave reply 1-8
Sampling Trace 6-26; 7-46; 3-2 SR A-30
save 5-8 st8051.lib 10; 4-4; 5-7; 7-43
save a project 6-1 standard library 7-43; A-26
Save as... 3-23 standard power supply 2-8
Save options 6-6 standard.lib A-26
Scan - Parameters A-120; A-128 start-up 5-21
Search 6-16 Statusbar 6-24
Selection functions A-5 Step 7-37
SEMA A-30 Step Attributes 7-38
sensor 5-1 Step In 6-20
sequence control program 2-5 Step Over 6-20
sequential function chart 3-2 STEP5 7-20
Sequential Function Chart editor 7-36 Stop 6-19
set up 3-3 stop bit 5-6
Set/Reset 7-29; 7-34 Structured text 7-10
SFC example 4-6 structures 3-1
SFC flags 7-39 switching -signal 5-21
SFCEnableLimit 7-39 symbolic name 5-11
SFCError 7-39 System flag A-43
SFCErrorPOU 7-39
SFCErrorStep 7-39
SFCInit 7-39 —T—
SFCQuitError 7-39 TactGenerator 5-28
SHL A-28 technical data 2-1
short glossary of technical terms 1-7 tele adjustment (paramer adjustment) 1-8

page index-6 manual ecolog asi system


telegram 1-9 —W—
text editors 7-5 Watch Variables 6-26
Tile 6-25 watch window 3-2; 7-44
TIME-Konstanten A-40 watchdog 2-7
Timer A-32 WHILE loop 7-17
timer in IL 4-4 windows 6-25
TOF A-34 wiring diagram 2-8; 9
Toggle Breakpoint 6-19 with built in interface 1-9
TON A-33 without a built-in interface 1-9
Toolbar 6-24 Write Receipt 7-44
Topology 1-9 Write Values to PLC 6-21
TP A-32
Transition 4-7; 7-37
tree structure 1-9
turn your system off 3-23
type files A-67; A-90

—U—
Undo 6-15
Upload 5-13
user data 1-9
User defined libraries 7-44
User defined Programs 3-12
user program 2-5

—V—
valve control unit 1-5
Variable A-41
Variable Configuration 6-26
variable names 5-25
variables definition 3-8
Version 5-13
View Instance 6-14
View\Status 3-14
Visualisation 3-16; 4-12; 8-1; 3-1; 3-16

manual ecolog asi system page index-7


page index-8 manual ecolog asi system

You might also like