Professional Documents
Culture Documents
Manual For Program Development: Manual Ecolog Asi System
Manual For Program Development: Manual Ecolog Asi System
with
ecolog AS-i system
(asisys)
version 1.5
1. AS-i basics (master, slaves, host ... do I have to know all this?) ____________ 1-1
Appendix
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.
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.
• 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!
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.
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.
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.
We wish you all the best with your new system. And do have fun.
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.
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.
Basic equipment
What are the essential components of an AS-i system?
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!
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.
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!
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
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.
Diagnosis
The integration of AS-i slaves in sensors/actuators extends your ability
for plant diagnosis. The options and/or advantages are:
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!
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.
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.
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).
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.
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.
User data
Part of the message consisting of the information to be transferred, 4 bits
for AS-i.
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.
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.
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
To find the corresponding data for your controller version please see ifm
electronic's catalogue.
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.
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:
Important remark!
The protocol of the communications interface has not been
designed for the cyclical exchange of the time-critical control data.
2.3 Correlations
For the block diagram of your controller version please see ifm
electronic's catalogue.
Software systems
A distinction is made between two software systems:
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.
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.
code ( EPROM
or EEPROM ) XDATA
RAM for
sequence control
program
reserve
sequence control display
program UART
DPRAM AS-i 2*
DPRAM AS-i 1
Profibus SPC3*
* = if available
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.
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.
Plant earthing
system
AS-i cable
Power supplies
In addition to the AS-i controller two power supplies can be seen in figure
2.7.1.
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.
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.
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).
• visualisations
• LD (ladder diagram)
• IL (instruction list)
• ST (structured text)
• AS-i-system configuration
- I/O definition
• Component creation
- POUs
- structures
- visualisations
Using the simulation mode along with the many debugging features
available in asisys allows you to complete your precommissioning test
easily and efficiently.
• stepping
- from cycle to cycle
- breakpoint to breakpoint in simulation mode
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:
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
Getting started
These steps are usually the same.
1. Start MS-Windows
2. Start asisys
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
• language is FBD
• Name: PLC_PRG
• Type: Program
• Language: FBD
Fig. 3.3 4
Fig. 3.3.5
• 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.
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.
Fig. 3.3.8
Fig. 3.3.9
• move cursor to the end of line 2 and press the 'Enter' key
Fig. 3.3.10
You may use either form for variable definition. We have often used the
short form in this manual due to space considerations.
Fig. 3.3.11
&- icon for AND operator IN-R icon for result (we
refer to this later)
Fig. 3.3.12
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
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.
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
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
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
Fig. 3.3.27
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.
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
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
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.
A new visualisation has to be created with asisys offline. Use the option
‘Online/Logout’ to bring asisys offline.
• click on the scroll bar of the field on the left containing ‘POUs’ (see
fig. 3.3.35).
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
"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.
• drag the mouse until the rectangle has the desired size
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.
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
Fig. 3.3.41
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:
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
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.
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:
• 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)
Fig. 3.3.47
Input : No Input
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
Fig. 3.3.49
• ‘Online\Login’
• ‘Online\Run’
To use the visualisation screen refer to fig. 3.3.49 thru fig. 3.3.51.
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.
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.
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.
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.
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).
"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.
"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 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:
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
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).
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).
To design the desired timer, the body of the POU has to be programmed
as follows:
"WAIT" body
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.
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:
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).
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.
Now the first level of development of our program is finished. You can
compile the resulting program and test it in the simulation.
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)')
The transitions are called (from top to bottom and from left to right)
FINISH, "TRUE" and "DELAY.OK".
As can be seen, there are two more actions and one transition condition
to be programmed.
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):
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.
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.
In the following sections we will draw a traffic light building with two
traffic lights to visualise the program course.
Insert an element
For the traffic light visualisation, carry out the following steps:
• 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!
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:
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.
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.
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.
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)
slave IG5886
control panel
door to be
monitored
AS-i
controller
AC1003
red
blue
plant ground
data decoupling for Profi Kit components,
only available with the Profi Kit
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.
safe range
damped not damped
switching state
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.
AS-i
controller
AC1003
red
brow
n connecting cable AC4010
blue
plant ground
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
!
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)
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
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.
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.
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
We shall now configure the AS-i system. To do this please insert a new
project having the name 'test.pro'.
Name: PLC_PRG
Type: Program
Language: IL
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'.
The action "delete slave" can be carried out in two ways. We discuss
these alternatives below.
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.
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.
The following data concerning a given slave can be entered via this
screen:
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'.
Choose the project 'alarm1e5.pro' and confirm your choice with 'OK'.
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.
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.
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.
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.
Deviation:
• Error , no slaves/no master connected.
Deviation:
Choose the projection mode.
Deviation:
• The AS-i voltage is not correct. Check the
hardware (power supply, connections, load,
possible short-circuits, etc.)
Deviation:
• The automatic addressing of a missing slave is
allowed and active in the protected mode.
Choose the projected 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!
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.
Deviation:
• The system is operating correctly i.e. the slaves
which are connected were also projected.
Deviation:
• A slave having the address zero is present.
Please disconnect all slaves (see section 5.2).
Deviation:
• This is irrelevant when the projection mode is
active.
Deviation:
• This is irrevelent when the projection mode is
active.
Deviation:
• This is allowed as long as communication is with
the desired controller (value 1..124).
Addressing
Please use the following correspondence:
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
There are three methods for slave addressing (or readdressing). These
are discussed below.
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.
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
This information is stored in the project file and in the controller (when
the project is transfered).
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.
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.)
This option can be used by first calling the projection mode (using for
Slave configuration
(actÙproj.)
With the projection mode active and the slave dialogue screen '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
5.4 Start-Up
• asisys is active
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“
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.
Deviation:
• Click this field (activate the projection mode if
not already active).
Deviation:
• Slave is not connected or is not properly
addressed.
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).
Deviation:
• An incorrect slave has been connected.
Deviation:
• Choose the correct entry (see current ID code).
Deviation:
• An incorrect slave has been connected.
Deviation:
• Choose the correct entry (see current I/O
Declaration part
The declaration part of the PLC_PRG is as follows:
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
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.
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.
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).
Project test
Call the visualisation screen named 'profikit' by doing the following:
Test the operation of the project using the sensors and visualisation
elements and observing the reactions. Have fun!
.
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.
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.
'File''Save'
This command saves the current project, if it was modified.
'File''Save as'
This command saves the current project in a different file. The original
project file is not changed.
'File''Save as library'
This command saves the current project as library for use in other
projects.
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.
'File''Print'
This command prints the contents of the active window.
For documentation of project parts or the whole project, use the menu
item ‘Project’ ‘Documentation’.
'File''Printer Setup'
This menu option allows you to edit the documentation frame. With this
command the documentation setup dialogue appears.
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 "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.
'File''Exit'
This command quits asisys.
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.
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>).
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.
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.
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.
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:
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:
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.
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
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..
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.
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.
• POUs
• Structures
• Visualisations
• Sampling Trace
• Cross references
• A table of contents
After choosing the command, a dialogue appears where you can select
the parts of the project you want to print.
'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.
'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''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:
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.
• File name
• Directory
These entries are given by asisys. You cannot change these entries in
the project information dialogue.
'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.
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.
'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 new object is a POU, the type (function, function block or program)
and the desired language for the new POU have to be selected.
'Project''Rename Object'
This command renames the currently selected object (POU, structure or
visualisation element) in the object list.
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.
'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’)
Note
The project has to be compiled!
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).
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.
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.
'Edit''Cut'
Moves the current selection of the editor window to the clipboard. The
selection is removed in the editor window.
'Edit''Copy'
Copies the current selection from the editor window to the clipboard. The
contents of the editor window are not modified.
'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.
'Edit''Delete'
Deletes the current selection of the editor window. The contents of the
clipboard are not changed.
'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.
'Edit''Find next'
Repeats the find operation with the parameters (text to find, search
direction etc.) specified with the last Find (Menu Edit) command.
'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.
‘Edit’’Next Error’
If the compilation of a project fails, the next error could be displayed with
this command.
‘Edit’’Previous Error’
If the compilation of a project fails, the previous error could be displayed
with this command.
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).
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.
Note
When logging into your hardware, asisys tries to get an online
connection. This might fail for several reasons.
is displayed.
Note
When logging in was successful, asisys compares the project last
loaded into the Controller with the project actually loaded in asisys.
'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.
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.
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.
'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.
You will get a dialogue for changing the value of the selected variable.
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.
A dialogue opens with a list of the POUs currently in the call stack and
the line (or network) number which is being executed.
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.
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
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.
'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.
'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.
'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’ ‘Monitoring’
Values of variables of type BYTE, WORD or DWORD can be displayed
either decimal, hexadecimal or binary.
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.
'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:
'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).
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:
'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.
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.
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.
BOOL (8 Bit), INT (16 Bit), DINT (32 Bit), STRING (variable length),
BYTE (8 Bit), WORD (16 Bit), DWORD (32 Bit), TIME (16 Bit).
lb1, lb2 denote the lower borders of the array, ub1, ub2, the upper
borders.
Example:
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).
• All other characters in the line are ignored (e.g. the exclamation mark
in the last example).
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 *)
5. B !
B: BOOL;
'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:
Type: Insert the type of the variable (if the variable is the instance
of a function block, then insert the function block)
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.
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’.
'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.
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.).
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).
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.
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.
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 AND, OR, XOR: Negation of the last operand (not of the stack
contents)
AND( %IX1
OR %IX2
)
is interpreted as
Flow control
In the simulation mode, flow control in IL shows the value of the
accumulator in every line which was performed.
Note: Only the active window shows a Flow Control. Click somewhere
into your IL editor window to make it active.
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.
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
Result := Var1;
Expressions
An expression is a construct, that returns a value after execution.
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.
A + B - C * ABS(D)
evaluates to -9
(A + B - C) * ABS(D)
evaluates to 0
Syntax
<Operand> := <Expression>;
Example
Var1 := Var2 * 10;
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.
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;
The IF statement
The IFstatement allows the execution of some expressions depending on
a certain condition.
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;
Syntax
CASE <Var1> OF
<value 1>:
<statement 1>;
<value 2>:
<statement 2>;
...
<value n>:
<statement n>;
ELSE
<ELSE-statement>;
END_CASE;
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.
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;
Syntax
FOR <Index_Var> := <Const1> TO <Const2> BY <Const3> DO
<Statements>;
END_FOR;
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.
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;
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!
Syntax
REPEAT
<statements>
UNTIL
<condition>
END_REPEAT;
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.
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.
• Comparison of the "old" STEP5 block and the "new" IEC POU, thus
simpler learning of IEC programming
• 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.
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.
Exceptions are the function blocks (FBs) which can have input and
output parameters (so-called 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:
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.
• 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.
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 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.
Cursor positions
Any text is a possible cursor position. Text selection is marked by a blue
background colour.
2) Any input:
6) Right from the last object of each network ("last cursor position", this
is also the cursor position, if a new network is selected):
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 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'.
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.
If a line cross is selected, the assignments, jumps or the return below 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.
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 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.
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.
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.
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.
'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.
'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 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.
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.
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.
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 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.
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.
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:
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.
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 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.
SFCError: This Boolean variable is set if the time limit has been
exceeded.
Time overview
After choosing this command, a window opens in which all time limits
defined in the currently active SFC window are displayed.
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.
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.
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.
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
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:
PLC_PRG.Instance1.Instance2.Structure.Component
.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
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.
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’.
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.
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.
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.
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.
‘Extras’’Auto Read’
The current trace buffer is automatically read from the plc and the trace
variables are continuously displayed.
The tracing curves of these variables are displayed. New variables can
be inserted even if there are already curves displayed.
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.
8.1 Visualisation
'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'
You can insert four different geometrical objects and bitmaps into a
visualisation.
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.
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.
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.
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.
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
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).
.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.
Attention:
You also have to enter the output string in the field ‘Text format’. For
the variable itself enter %s.
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.
‘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.
• Left: all elements are aligned with their left edge at the element that
is at the left position of all selected elements.
• 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).
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.
Examples:
%IX1.4.1 : read an input
PLC_PRG.test : read variable 'test' from the POU 'PLC_PRG'.
.GlobVar1 : read the global variable '.GlobVar1'
=ASISYS|'C:\ASISYS\PROJECT\IFMBSP.PRO'!PLC_PRG.TEST
This means :
• type: ASISYS
• source file: C:\ASISYS\PROJECT\IFMBSP.PRO
• element: PLC_PRG.TEST
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:
MUL
Multiplication of variables of type BYTE, WORD, DWORD, DINT and
INT.
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:
Example in IL:
LD 9
MOD 2
ST var1 (* Result is 1 *)
Example in ST:
var1 := 9 MOD 2;
Example in FBD:
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:
Examples in FBD:
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:
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;
Example in ST:
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:
Example in FBD:
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.
Example in IL:
LD TRUE
SEL 3,4
ST Var1 (* Result is 4 *)
Example in FBD:
MAX
Two values are operands and the result is the maximum of these two
values.
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.
Example in IL:
Example in FBD:
MUX
Multiplexer.
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:
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:
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
Example in ST:
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:
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:
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:
Example in FBD:
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
CAL
The CAL operator is used to activate (start or summon) a POU (program
or function block, functions are activated differently).
MOVE
Assignment of the contents of a variable
Example in LD:
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
LD TRUE
ST counterdw.LOAD
LD 999
ST counterdw.PV
LD 999
ST counterup.PV
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
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).
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.
Example:
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.
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:
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.
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.
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
is converted to
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
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.
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.
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.
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.
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.
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.
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:
DINT_TO_BYTE
Converts a 32-bit operand of type DINT to a 16-bit operand (without
sign).
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 *)
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:
WORD_TO_TIME
Converts a word operand to a time operand.
LD 1000
WORD_TO_TIME
ST Var1 (* Result is 1s, Var1 is a TIME *)
ABS
Absolute value
ABS(-2) is 2
SHL
LD 1
SHL 1
ST Var1 (* Result is 2 *)
SHR
Example:
LD 32
SHL 2
ST Var1 (* Result is 8 *)
ROL
Example:
Var1 :BYTE;
LD 2#1001_0011
ROL 3
ST Var1 (* Result is 2#1001_1100 *)
ROR
Example:
SR
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
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
R_TRIG
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
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:
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).
CTUD
Up-down counter
CU, CD, R0, LD_, QU and QD are of type BOOL, PV and CV are of type
INT.
B.7 Timer
TP
Timer Pulse
TON
Timer delay ON
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.
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.
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.
There are functions which are used for writing to or reading from the lists
of the AS-i slaves defined in the project.
Example:
LD SlaveSearched
LDS_lesen 1 (* AS-i line 1*)
JMPCN SlaveMissing
Example:
LD SlaveSearched
LAS_lesen 1 (* AS-i line 1*)
JMPCN SlaveNotCorrect
Example:
LD SlaveSearched
LPS_lesen 1 (* AS-i line 1*)
JMPCN SlaveNotProjected
Example:
LD SlaveSearched
akt_IOConf_lesen 1 (* AS-i line1*)
EQ 7
JMPC SlavesBidirectional
Example:
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.).
Example:
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).
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:
Example:
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.
Example:
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.
Example:
akt_Parameter_schreiben (write
parameters)
akt_Parameter_schreiben (BYTE Parameter, BYTE Slave, BYTE
ASI_Master_Strang) :BYTE
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
Example:
LD 1 (* AS-i line 1 *)
Ist_Konfigurationsdaten_projektieren
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.
T1:TIME:= T#14ms;
T2:TIME:= T#100S12ms; (*Overflow in the first component*)
(*is permitted*)
T3:TIME := t#4m15s20ms;
D.3 Numbers
14 (decimal)
2#1001_0011 (dual)
8#67 (octal)
16#A (hexadecimal)
D.4 Strings
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).
D.6 Addresses
I Input location
Q Output location
M Memory location
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) .
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.
Examples:
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.
They can be used like normal global variables in the plc program.
D.7 Arrays
Example:
<Array_Name>[Index1, Index2]
Cardgame[9, 2]
<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
"Identifier 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.
"Expecting... or ..."
Write one of the two items in the line where the error occurred.
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.
Declare this identifier in the declaration part of the POU or in the global
variable list.
"LD expected"
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.
This operator is not allowed within brackets. Either remove the brackets
or the operator.
Check the number of operands for this operator and remove the
supernumerary ones.
Check the number of indexes (1, 2 or 3) the array is declared for and
remove the supernumerary indexes.
Check the number of indexes (1, 2 or 3) the array is declared for and add
the missing indexes.
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.
Remove N and negate the operand explicitly with the NOT operator.
"<identifier> is no function"
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.
This watch variable is not declared in the project. You get help for
declared variables when pressing <F2>.
Check the input variables of the called function block and change
<Name> into one of these variables.
Check the number of inputs required for this POU and remove or add the
supernumerary or missing ones.
Change the text of the function block instance (initially "Instance") to the
identifier of a valid function block instance declaration.
Change the text of the function block instance (initially "Instance") to the
identifier of a valid function block instance declaration.
Check in your plc configuration which addresses are valid and replace
the address by a valid one or change the plc configuration.
"<string> is no operator"
"Out of Memory"
Save the project and leave the system. Leave Windows, start new and
try again to build the project.
Check how many operands <Operator> needs and add the missing ones.
You declared two labels with the same name. Rename one of them.
Insert a statement.
Multiple underlines within identifier names are not allowed. Remove the
supernumerary ones.
"Expression expected"
Change <name> to the name of an existing step or insert a step with the
required name.
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)
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.
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 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!
For the serial and/or Profibus connection please use the proper cable.
Display
1st digit: mode
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.
No error detected :
Display remains out!
Function 1 :
Display missing or defective slaves.
Functions 2 - 6 :
see the table above
Function 7 :
Automatic Addressing
Meaning:
automatic multiple autom.
addressing addressing
disabled enabled master 1 enabled master 2
Function 8 :
Project (configure) detected slaves
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.
Function 9 :
Controller run/stop
Display:
(run) (stop)
Function A :
Controller-Address
All controllers are given the address 001 upon manufacture. This
address can be changed using function A.
Display:
Display:
Error messages
The freeze mode as well as the sync mode of the Profibus-DP are
supported.
The asisys diskette also contains the GSD file and various type files 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
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
This does not replace the corresponding manual. For more detailed
information please refer to one of these manuals.
⇒ 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.
⇒ 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.
⇒ 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.
⇒ 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.
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.
⇒ With OK the window will be closed and number 119 will be adopted in
line 0, ID 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.
You will again get to the Slave Parameters window. Here again you
acknowledge with OK and will get to the Master System window.
♦ 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.
⇒ 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.
⇒ Click the ID (Identification) button with the mouse. You will get to the
ID (Identification) window.
⇒ 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.
You will again get to the Slave Parameters window. Here again you
acknowledge with OK and will get to the Master System window.
Identification Remarks
⇒ Select the FILE window. Select the Save As... menu item. Enter file
name and acknowledge with OK.
⇒ 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.
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.
⇒ 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.
Function A
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
⇒ 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.
Function 8
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).
Operation:
• •
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
• •
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.
• •
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.
Function 8.7
• •
MODE SET
8777
• Excerpt pre-processing
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
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.
Function 1
• •
MODE SET
1228
1st 2nd 3rd 4th position
• •
MODE SET
bF
1st 2nd 3rd 4th position
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.
They can be read with the corresponding tools of the master modules
(see manuals of the various manufacturers).
Byte Contents
0 station status 1
1 station status 2
2 station status 3
ASi-DP controller is
parameterized by another DP
master
watchdog active
reserved
AS-i DP controller is
deactivated
reserved
resered
reserved
reserved
reserved
reserved
reserved
overflow
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.
;============================================================================
; 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
RS 232 - C Profibus-DP
interface interface
Profibus-specific data
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
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
DeviceNet
AS-i DeviceNet
Controller
AS-i
• 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
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.
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.)
PLC DeviceNet
Scanner actuators
sensors
CTRL STOP
signal pre-
processing
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.
PLC DeviceNet
Scanner actuators
sensors
CTRL RUN
signal pre-
processing
1: Shield bare
2: V+ red
3: V- black
4 : CAN_H white
5: CAN_L blue
• Output voltage: 24 V DC (+ / -) 20 %
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.
0...16 0...16
= 9537
PLC DeviceNet
Scanner
DeviceNet
AS-i DeviceNet
Controller
AS-i
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.
Fig. I.3.3.1
PLC DeviceNet
Scanner actuators
sensors
bytes
%QB1.0...31
bytes %QB2.0...31
%IB0.0...31
%IB0.32...47
%IB0.48...63 signal pre-
processing
bytes
%QB0.0...31
1 0 16 0
2 16 0 0
3 16 16 0
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
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 - -
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.
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.
• All AS-i inputs and outputs are to be transferred (32 bytes input/ 32
bytes output).
• Auto-Mapping is to be used.
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.
• 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
• 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
Fig. I5.1.1
Fig. I5.1.2
To initiate the installation process place the disk containing the EDS files
Fig.I.5.1.4
Fig. I.5.1.6
Select , and
Fig. I.5.1.7
Fig. I.5.1.8
Fig. I.5.1.9
Fig. I.5.1.10
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.
Fig.I.5.1.12
• C1 = 16
• C2 = 16
• CC = 0
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.
• 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.
Fig.I.5.1.13
Fig. I.5.1.14
Fig.I.5.1.15
Fig.I.5.1.16
Fig.I.5.1.17
Fig.I.5.1.17
Fig.I.5.1.18
Fig.I.5.1.19
Fig.I.5.1.20
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.
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
Fig.I.5.1.24
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).
• 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.
Fig. I.5.2.1
Step 9 - Step11:
Proceed as in section I.5 Steps 9 thru Step 11.
I:1.0 RESERVED
I:1.1 %IX1.2.3 ... 0 %IX1.3.3 ... 0 status/control %IX1.1.3 ... 0
O:1.0 RESERVED
Fig. I.5.2.5 Analog input Function Block call (note SwapByte after
transfer)
Fig. I.5.2.7 PT100 Function Block call (note SwapByte is carried out in
the Function Block TempTestPrepareAndTransfer)
• Signal preprocessing
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"!
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)
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)
⇒ 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".
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:
• •
MODE SET
81
2. After pressing SET the last two digits of the display flash with PP, the
master is in the projection mode.
81PP
3. After pressing SET again the display stops flashing for about 2 s. The
data are written to the memory.
• •
MODE SET
81PP
• •
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.
• •
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.
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
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.
• •
MODE SET
b192
1st 2nd 3rd 4th digit
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
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
• •
MODE SET
C216
1st 2nd 3rd 4th digit
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
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.
CC00
1st 2nd 3rd 4th digit
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 addition, the signal preprocessing is in the stop mode, i.e. the function 9
is as follows:
• •
MODE SET
8777
1st 2nd 3rd 4th digit
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
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.
By means of the indication and operating panel you can carry out a
simple diagnosis on site.
Indication/operating panel
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
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.
1228
1st 2nd 3rd 4th digit
• •
MODE SET
bF
1st 2nd 3rd 4th digit
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
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.
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.
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
AS-i RS232C
(9-pole D-SUB sockets)
Pin 2: RXD
Pin 3: TXD
Pin 5: GND
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 !)
—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
—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