This Manual is valid for the Drive PLC Developer Studio V02.00.
Show/Hide Bookmarks
Important note
The software is supplied to the user as described in this document. Any risks resulting from its quality or use remain the responsibility of the
user. The user must provide all safety measures protecting against possible malopera tion.
We do not take any liability for direct or indirect damage, e.g. profit loss, order loss or any loss regarding business.
ã 2005 Lenze Drive Systems GmbH
No part of this documentation may be copi ed or made available to third parties without the explicit written approval of Lenze Drive Systems
GmbH.
All information given in this online documentation has been carefully selected and tested for compliance with the hardware and software
described. Nevertheless, discrepancies cannot be ruled out. We do not accept any responsibility or liability for any damage that may occur.
Any correc tions required will be implemented in subsequent editions.
Windows, Windows NT and MS-DOS are either registered trademarks or trademarks of Microsoft Corporation in the U.S.A a nd/or other countries.
IBM and VGA are registered trademarks of International Business Machines, Inc.
All other product names are trademarks of the c o rrespondi ng owners.
Version
:
2.301/2005
Drive PLC Developer Studio
Show/Hide Bookmarks
Contents
1 Preface and gener al information1-1...........................................
1.1About this manual1-1................................................................
This Manual offers detailed information on the Drive PLC Developer Studio (DDS).
The Drive PLC Developer Studio is a powerful development environment for your PLC programs on
Lenze IEC 61131 systems.
The Drive PLC Developer Studio utilizes the powerful IEC language tools, offering individual editors
for the six IEC 61131-3 languages as well as commissioning support through monitoring and
debugging functions. The Drive PLC Developer Studio provides all the comfort and ease of fully
matured development environments offered by higher-level programming languages under
Windows.
1.1.1Terminology used
TermIn the following text used for
DDSDrive PLC Developer Studio
GDCGlobal Drive Control
GDOGlobal Drive Oscilloscope (for servo PLC devices)
SBSystem block
FBFunction block
Parameter codesCodes for setting the functionality of function blocks
1.2Applied conventions
This Manual applies the following conventions to distinguish between different types of information:
Type of informationPrintExample
Names of dialog boxes, input
fields and selection lists
ButtonsboldClick OK to...
Menu commandsboldUse the command Messages to ...
Keyboard commands<fett>Use <F2> to open the Help Manager.
Program listingsCourierIF var1 < var2 THEN...
KeywordsCourier bold ...starts with FUNCTION and ends with END FUNCTION.
Important noteCaution!
italicsThe dialog box Options
(parameter setting program for Lenze PLCs/Lenze automation systems)
If the execution of a function requires several commands, the individual commands are
separated by an arrow:
Select File
If a command requires a combination of keys, a ”+” is placed between the key symbols:
Use <Shift>+<ESC> to ...
Do not use the command Online
PC since this command reaches the controller with a time delay.
WOpen to...
WController inhibit for an emergency stop through the
lDDS EN 2.3
TipTIP!
Positioning the mouse pointer briefly over an icon in the tool bar will display a ”tool tip”
with the associated command.
1-1
Drive PLC Developer Studio
Show/Hide Bookmarks
Preface and general information
1-2
DDS EN 2.3
L
2Introduction
Show/Hide Bookmarks
2.1Function overview
Project structure
The project is saved in a file that is named after the project.
The first organization unit created in the new project is automatically called PLC_PRG. Other
organization units (programs, function blocks and functions) can be called from here.
The DDS uses the Object Organizer to differentiate between the different object types within a
project:
• Organization units
• Data types
• Visualization elements (visualization)
• Resources.
Object Organizer
The
following objects, among others:
• Libraries
• Codes
• Task configurations
• etc.
allows fast access to all objects of your project. Resource structuring uses the
Drive PLC Developer Studio
Introduction
Project generation
Addresses not included in the PLC configuration cannot be used.
First configure the control to facilitate access to the system organization units during programming.
Then generate the organization units required for your application, or copy them from existing
projects. Program the required organization units in the desired language.
On completion of the programming process, compile the project and eliminate any reported errors.
Simulation with the DDS
Once allerrors have been eliminated, activate the simulation, log in to the simulated control and start
the project. The DDS is now in online mode.
The window with the PLC configuration can now be opened, and the project can be checked for
correct operation. For this purpose, assign the inputs manually and check that the outputs are set
as required. The organization units also allow a monitoring of local variable current values. Use the
Watch and Receipt Manager to configure the data records to be monitored.
Note!
Lenze function blocks are not simulated.
Simulation is generally restricted.
Debugging with the DDS
In the event of a programming error, breakpoints can be set. If program execution stops at a
breakpoint, the values of all project variables as at that time can be inspected. Logical correctness
of the program can be checked by step-by-step processing (single-stepping).
Program variables and inputs / outputs can be set to specific values.
(^ 6-37)
lDDS EN 2.3
Project documentation using the DDS
The entire project can be documented or exported to a text file at any time.
2-1
Drive PLC Developer Studio
Show/Hide Bookmarks
Introduction
2.2Project components
2.2.1Project
A project includes all objects of a control program. Links with the libraries are saved in a file bearing
the project name.
A project includes the following objects that can be accessed via the Object Organizer:
• Organization units
• Data types
• Visualizations
• Resources
– Libraries
– Codes
2.2.2Organization unit (POU)
Functions, function blocks and programs are organization units of a project and referred to as
program organization units (POU) in the
IEC 61131 programming language.
Every organization unit consists of a declaration part and a body. The body is written in one of the
IEC programming languages (IL, ST, SFC, FBD, LD or CFC).
The DDS supports all IEC standard organization units as well as Lenze-specific organization units.
Use of these organization units in your project requires the associated function library to be linked
to your project with the help of the Library Manager.
Organization units can call other organization units. Recursions cause a compiler error and must be
avoided.
2.2.3Function
A function is asoftware organization unit that returns exactly one data element (that may also consist
of several elements such as fields or structures, for example) on execution and whose call may occur
in textual languages as an operator in expressions.
Note when declaring a function that a type must be assigned to the function, i.e. the function name
must be followed by a colon plus type.
The names of function and function output are identical.
Example of a correct function declaration:
FUNCTION Fct: INT
• A function declaration starts with the keyword FUNCTION.
• A result must be assigned to the function, i.e. the function name is used like an output
variable.
• In ST, a function call may occur as an operand in expressions.
• Functions cannot save their internal statuses. Function calls using the same input parameters
always return the same value.
• No functions can be programmed in SFC.
2-2
DDS EN 2.3
l
Drive PLC Developer Studio
Show/Hide Bookmarks
Introduction
Function CheckBounds
Tip!
Definition of a function with the name CheckBounds in your project will automatically check
whether the boundaries have been exceeded on access to an array in your project! (refer example
below).
Also refer the Checkbound library (Checkbound.lib).
The function name is defined and must not be changed.
The following program example to test the CheckBoundsfunction corrects access outside defined
array boundaries.
The function CheckBounds ensures that the value TRUE is not assigned to position A[10],butto
the upper permissible range limit A[7].
Use the function CheckBounds to correct accesses outside array boundaries.
2.2.3.1Example of a function
Example of a function in IL:Example of the function call of the function shown on the left:
ILLD 7
Fct 4,2
ST result
STresult := Fct(7, 4, 2);
FBD
lDDS EN 2.3
2-3
Drive PLC Developer Studio
Show/Hide Bookmarks
Introduction
2.2.4Function block
A function block is a software organization unit whose execution returns one or several values.
• Unlike a function, a function block does not supply a return value.
• A function block declaration starts with the keyword FUNCTION_BLOCK.
• The creation of instances (data records) of a function block is a prerequisite.
2.2.4.1Function block instances
• Every instance has its own identifier (instance name) and a data structure which includes its
inputs, outputs and internal variables.
• Instances are locally or globally declared like variables by giving the function block name as
identifier type.
Example of an instance named INSTANZ of function block FUB:
INSTANZ: FUB;
• The instances described above are always used to call function blocks.
• Only input and output parameters can be accessed from outside an instance of a function
block, not its internal variables.
Example with the help of a data model:
Instances L_ABS1 ... L_ABSn are instances of the function block type L_ABS. Instance as many
instances as required.
2-4
DDS EN 2.3
l
Drive PLC Developer Studio
Show/Hide Bookmarks
Introduction
Example of access to an input variable:
(* The function block fb has an input variable in1 of type int. *)
PROGRAM prog
VAR
inst1:fb;
END_VAR
LD 17
ST inst1.in1
CAL inst1
END_PROGRAM
• The declaration parts of function blocks and programs may contain instance declarations.
Instance declarations are not allowed in functions. A function cannot call a function block.
• Access to the instance of a function block is restricted to the organization unit in which it was
instanced, unless it was globally declared. Function blocks should never be globally declared
as this would lead to logical errors.
• The instance name of a function block may be used as input for a function or a function
block.
Counter
bExecute
byNodeAdr
byAnalogModuleNr
byFunction_CH1
byFunction_CH2
L_IOParCounterModule
CTRL
nState
EPM-T110
Ixxxh
Counter is the instance name of function block L_IOParCounterModule and can be
used as input in the code.
PROGRAM Counter
VAR
Counter: DINT;
END_VAR
Note!
All values remain the same from one execution of the function block to the next. Therefore function
block calls with the same arguments do not necessarily return the same output values!
Should the function block include at least one Retain variable, the whole instance is stored in the
Retain area.
2.2.4.2Calling a function block
The input and output variables of a function block can be approached by another organization unit.
For this purpose, a function block instance must be generated and the desired variable specified
with the help of the following syntax:
<Instance name>.<Variable name>
Input writes only
Input and output reads
• To set the input parameters on call in the IL and ST text languages, assign values to the
parameters in brackets after the function block instance name (assignment via := as for the
initialization of variables at the point of declaration).
Tip!
SFC allows function block calls in steps only.
lDDS EN 2.3
2-5
Drive PLC Developer Studio
Show/Hide Bookmarks
Introduction
Declaration part:Instruction part:
PROGRAM test
VAR
quad: BOOL;
instanz: fub;
value: INT:=0;
END_VAR
2.2.5Program
A program is an organization unit that returns one or several values on execution.
• A program declaration starts with the keyword PROGRAM.
• Programs are known globally throughout the entire project.
• Programs can be called by programs and function blocks. Program calls in a function are not
allowed. Programs do not have instances.
• If an organization unit calls a program, thus changing program values, these changes remain
active for the next program call, even if the program is called by another organization unit.
ILCAL instanz(par1:=5,par2:=5)
LD instanz.varout2
ST quad
LD instanz.varout1
ST value
STinstanz(par1:=5,par2:=5);
quad:=instanz.varout2;
value:=instanz.varout1;
FBD
Tip!
Only the values in the associated instance of a function block are changed on function block call.
These changes are significant only if the same instance is called.
2.2.5.1Program example
Example of a program in IL:Examples of calling the program shown on the left:
Example of a possible call sequence from a main program:
LD 0
ST PRGexample.par (* par is preset with 0 *)
CAL AWLexample (* result in AWLexample=1*)
CAL STexample (* result in STexample=2*)
CAL FUPexample (* result in FUPexample=3*)
• If the variable par of the program PRGexample is initialized with 0 from the main program, and programs are then called successively
by means of the above program calls, the
• Changing the call sequence will also change the values of the associated result parameters.
ILCAL PRGexample
LD PRGexample.par
ST result
STPRGexample;
result:=PRGexample.par;
FBD
result will have the values 1, 2, and 3 in the programs.
Note!
The string length is limited by the applied automation system.
2-6
DDS EN 2.3
l
Drive PLC Developer Studio
Show/Hide Bookmarks
Introduction
Restrictions occur through limited lengths in the string routines. Only 20 characters can be
processed before the string is cut.
The example below illustrates the restriction in online mode.
2.2.6PLC_PRG
PLC_PRG is a special predefined organization unit for a cyclical task. This organization unit is called
exactly once per control cycle.
• If Project➞
dialog box
Program. This pre-assignment should not be changed!
➞Insert object is run for the first time after a new project has been created, the
➞➞
Organization unit
Caution!
Do not delete or rename the organization unit PLC_PRG if you do not use a task configuration. Do
not attach PLC_PRG to an already created task as PLC_PRG will then be called several times,
leading to logical errors.
PLC_PRG is generally the main program in a single task program.
2.2.7System POUs
System POUs are hardware-dependent POUs (program organization units) with special functions
which are provided by the associated PLC (e.g. 9300 Servo PLC, Drive PLC). (Also refer associated
PLC manual)
is pre-assigned with an organization unit called PLC_PRG of type
lDDS EN 2.3
2-7
Drive PLC Developer Studio
Show/Hide Bookmarks
Introduction
2.2.8Resources
Resources are required to configure and organize your project and to trace variable values:
• Global variables to be used throughout the entire project.
• PLC configuration to configure your hardware.
• Task configuration to control your program through tasks.
• Task monitoring to monitor the task runtimes.
• Watch and Receipt Manager to display and pre-assign variable values
• Automation system settings for selection and, if appropriate, for final configuration of the
automation system
2.2.9Libraries
The Library Manager can link your project to several libraries whose organization units, data types
and global variables can be used in addition to the user-defined ones.
The register card Global Variables contains the variable
Depending on the selected PLC, some libraries are automatically linked when a new project is
created (the library ”standard.lib” , for example).
2.2.10Data types
In addition to the standard data types, users can define some data types of their own. Structures,
enumeration types and references can be created.
2.2.11Visualization
The DDS provides visualization to monitor and modify project variables.
The visualization allows offline drawing of geometrical elements that can then change their
shape/colour/text output online, depending on certain variable values.
g_ErrorCheckBounds
.
2-8
DDS EN 2.3
l
Drive PLC Developer Studio
Show/Hide Bookmarks
2.3Debugging, online functionality
2.3.1Debugging
The DDS debugging functions assist troubleshooting.
Introduction
• To allow debugging, go to dialog box
Debugging.
Note!
The check box Debugging should be ticked for debugging only.
Breakpoint on, Single step or Single cycle are possible only if Debugging is active.
2.3.2Breakpoint
A breakpoint is a point in the program where processing stops.
• Breakpoints enable the user to look at variable values at a certain program location.
• Breakpoints can be set in all editors. In the text editors, breakpoints are set to line numbers,
in FBD and LD to network numbers, in CFC to organization units, and in SFC to steps.
• Breakpoints may be set in the implementation of an initialized function block. No breakpoints
may be set in function block instances.
2.3.3Single step
Single step means in:
Options
, category
Build options
and tick check box
• IL: Execute program to next CAL, LD or JMP command.
• ST: Execute next instruction.
• FBD, LD: Execute next network.
• SFC: Execute action to next step.
• CFC: Execute next organization unit (box) in the CFC program.
The logical correctness of a program can be checked by step-by-step processing.
2.3.4Single cycle
Selection of Single cycle will stop processing after every cycle.
Caution!
If a breakpoint isset, the useof tasks will lose the real-time response. A 1ms-cycle task will no longer
be started every millisecond.
If breakpoints are set, all tasks will be started one after the other after the main program PLC_PRG
has been processed. Event-controlled tasks will be started upon a valid start event only.
This, among other aspects, influences the functionality of the generated overall project.
lDDS EN 2.3
2-9
Drive PLC Developer Studio
Show/Hide Bookmarks
Introduction
2.3.5Changing values online
Variables can be set once-only to a specific value during operation after the command Write values
was transmitted to the control. The value of a variable can also be changed online by simply
double-clicking it. Boolean variables thus change from TRUE to FALSE and viceversa. For the other
variables, the system will display a dialog box
2.3.6Monitoring
In online mode, the current valuesfor all variables displayed on screen will be continuously read from
the control and displayed. Refer declaration and program editor for this display.
Current variable values may be output in the Watch and Receipt Manager and in a visualization.
The display and monitoring of variables from function block instances requires the associated
instance to be opened.
The implementations show the pointer value. The dereferenced value is shown for dereferenced
variables.
Monitoring VAR_IN_OUT variables
When monitoring VAR_IN_OUT variables, the de-referenced value is output in the declaration part
and the program part.
Write variable xy
to edit the variable value.
Monitoring Pointers
Warning!
Monitoring of de-referenced pointer values is not supported by all Lenze target systems.
In online mode, it depends on the target system which de-referenced pointer values (pointer
variable^ ) are indicated.
Some Lenze target systems indicate the pointer value itself.
During monitoring the pointer and the de-referenced value are output in the declaration part. In the
program part, only the pointer is output.
pointervariable= <pointer value>
Pt= <value>
The value of the pointer is indicated in the implementations, whereas in the case of de-referencing
only the de-referenced value is indicated.
Monitoring ARRAY components
The following components are displayed:
• Array components indexed via a constant. anarray[1] = 5
The following components are not displayed:
• Array components with extended index. anarray[i+j] = 5 or anarray[i+1] = 5
2.3.7Simulation
During a simulation onthe processor,the generated control program will be processed together with
the DDS, offering complete online functionality. Thelogical correctness of the program can be tested
to a limited extent only without control hardware.
2.3.8Log
The log records user actions, internal processes, status changes and exceptions chronologically in
online mode and serves monitoring and error tracing.
2-10
DDS EN 2.3
(^ 6-37)
(^ 6-42)
l
Drive PLC Developer Studio
Show/Hide Bookmarks
3Program example “Traffic light”
3.1Introduction
This chapter includes a program tutorial for an easier start with the DDS.
The setup calls for the programming of a mini traffic control system for two traffic lights at an
intersection.
• Both traffic lights will alternate their red/green phases.
• To avoid accidents, the traffic lights will also include amber and amber/red between the red
and green phases, with the amber/ red phase being shorter than the amber phase.
This example illustrates
• how to implement time-controlled programs using IEC 61131-3 language tools.
• how to edit the various standard languages using the DDS.
• how to link the different languages.
• how to simulate a program in the DDS and visualize it on screen.
Program example
l
DDS EN 2.3
3-1
Drive PLC Developer Studio
Show/Hide Bookmarks
Program example
3.2Programming
3.2.1Starting the DDS
1. In the Windows Start menu, select submenu
Programs➞➞➞➞LenzeWDrive PLC Developer Studio and click Drive PLC Developer Studio to
start the DDS.
Tip!
If under Project➞➞➞➞Options, category
the project last edited is opened automatically on DDS start.
3.2.2Creating a new project
2. Select File➞➞➞➞New to create a new project.
Load & Save
, the check box Automatic loading is selected,
3.2.3Selecting PLC
3. Open dialog box
Configuration (e.g.the9300 Servo PLC) and confirm with OK:
Automation system settings
3.2.4Creating organization units
4. The dialog box
do not change name and type of the organization unit (Program).
New POU
already displays the name of the first organization unit as PLC_PRG;
and select a PLC from the combination box
3-2
DDS EN 2.3
l
Drive PLC Developer Studio
Show/Hide Bookmarks
Program example
Tip!
Only the organization unit named PLC_PRG of type “Program” will be processed by the cyclical task.
The cyclical task does not need to be explicitly created.
5. Select Sequential function chart (SFC) as the language for this organization unit and
confirm with OK.
6. Now create two further objects in the
of Project➞➞➞➞ObjectWInsert:
– TRAFFICLIGHT type Function block in the language Function block diagram (FBD)
– WAIT type Function block in the language Instruction list (IL)
Object Organizer
on tab
Organization units
with the help
TRAFFICLIGHT
In the organization unit TRAFFICLIGHT, the individual light phases will be assigned to the traffic
lights, i. e., the red light will be on during the red and amber/red phases, the amber light will be on
during the amber and amber/ red phases, etc.
WAIT
In the organization unit WAIT, a simple timer will be programmed to receive as input the phase
duration in milliseconds and to return an output TRUE as soon as the time has expired.
PLC_PRG
The organization unit PLC_PRG links the organization units with each other so that the traffic light
emits the correct colour at the correct time and for the specified time. It processes the entire project
during the cyclical task.
3.2.5The organization unit TRAFFICLIGHT
7. To edit the organization unit TRAFFICLIGHT, activate its editor window by selecting
Object Organizer
,tab
Organization units
and double-clicking TRAFFICLIGHT.
3.2.5.1Declaration
8. In the declaration editor, declare
– as input variable (between the keywords VAR_INPUT and END_VAR) a variable named
STATE of type INT.
– as output variables (between the keywords VAR_OUTPUT and END_VAR) the variables RED,
AMBER, GREEN and OFF of type BOOL.
lDDS EN 2.3
3-3
Drive PLC Developer Studio
Show/Hide Bookmarks
Program example
Thestatusof thevariableSTATE is used to switch the output variables for the associated light colour:
Traffic light phaseInput variableOutput variables
STATEREDAMBERGREENOFF
Green1FAL SEFA LSETRUEFAL SE
Amber2FALSETRUEFALSEFAL SE
Red3TRUEFALSEFALSEFAL SE
Amber/red4TRUETRUEFAL SEFALS E
Off5FALSEFA LSEFALS ETRUE
The declaration part of the function block TRAFFICLIGHT nowlooksasfollows:
3.2.5.2Function block diagram
Now use the input variable STATE of the organization unit to determine the values of the output
variables.
9. In the lower half of the editor window for the organization unit TRAFFICLIGHT, click the field
to the left of the first network (grey field with number 1) to select the network.
10.Select Insert➞➞➞➞Operator.
A box with the operator AND and two inputs is inserted in the first network:
11.Click “ AND” and change the text to “ EQ”.
12.Select the text “ ???” of the upper input and enter the variable STATE .
13.Select the three bottom question marks and name the input 1.
3-4
DDS EN 2.3
l
Drive PLC Developer Studio
Show/Hide Bookmarks
14.Click behind the EQ box to select the output.
15.Select Insert➞➞➞➞Assignment.
16.Change the text “ ???” at the output to “ GREEN”.
Program example
• STATE is compared to 1. If the result is TRUE, GREEN will be assigned.
This network will switch the traffic light to green if the status value input is 1.
The other traffic light colours RED, AMBER and OFF require three more networks.
17.Select Insert➞➞➞➞Network (after) to create a new network.
18.Select Insert➞➞➞➞Operator.
19.Click “ AND” and change the text to “ OR”.
20.Click behind the OR box to select the output.
21.Select Insert➞➞➞➞Assignment.
22.Change the text “ ???” at the output to “ AM BER”.
23.Select the upper input of the OR box and then Insert➞➞➞➞Operator to insert another operator
before the selected input.
lDDS EN 2.3
3-5
Drive PLC Developer Studio
Show/Hide Bookmarks
Program example
24.Use the above procedures and commands to complete the organization unit as follows:
The first organization unit is complete. TRAFFICLIGHT controls the traffic light colours depending
on the input of value STATE.
3.2.6The organization unit WAIT
The organization unit WAIT is to be a timer to control the duration of the different traffic light phases.
25.To edit the organization unit WAIT, activate its editor window by selecting
tab
Organization units
and double-clicking WAIT.
3.2.6.1Declaration
26.In the declaration editor, declare
– as input variable (between the keywords VAR_INPUT and END_VAR) a variable named
SETTIME of type TIME.
– as output variable (between the keywords VAR_OUTPUT and END_VAR) a variable named
OK of type BOOL.
27.Pre-assign the output variable OK with FALSE by inserting “ :=FALSE” at the end of the
declaration (but before the ;).
The output variable OK is to output the value TRUE as soon as the time specified with SETTIME has
expired. For this function use the organization unit TP, a pulse encoder.
Object Organizer,
3-6
DDS EN 2.3
l
Drive PLC Developer Studio
Show/Hide Bookmarks
Program example
Pulse encoder TP
The pulse encoder TP has two inputs ( IN, PT) and two outputs ( Q, ET).
• If at the input IN TRUE is applied, the output Q ,forthetimePT (in milliseconds) will return the
value TRUE.
• ET outputs the time already expired in milliseconds.
Input variableStatusOutput variablesStatus/value
INFAL SE
INTRUE
(ET < PT)
IN
(ET = PT)
* The output ET counts the t ime in milliseconds.
To use the pulse encoder TP in the organization unit WAIT we must create a local instance of TP
:
28.Use the declaration editor to declare as local variable (between the keywords VAR and
END_VAR) a variable named DELAY of type TP.
QFAL SE
ET0
QTRUE
ET0 ì PT*
QFAL SE
ETPT
3.2.6.2Instruction list
To implement the timer, the instruction list for the organization unit WAIT must be as follows:
lDDS EN 2.3
3-7
Drive PLC Developer Studio
Show/Hide Bookmarks
Program example
Process
The first interrogation establishes whether Q is already set to TRUE ( TRUE: timer running). [
• If QisTRUE, we will not change the assignment of DELAY but instead call function block
DELAY without input (to check whether the time has already expired). [
• If QisFALSE, we will set the variable IN in DELAY to FALSE and thus at the same time ET
to 0 and Q to FALSE.[
All variables are now set to the desired initial status.
– Now save the time required from variable SETTIME in variable PT [
with IN:= TRUE.[
– In the function block DELAY , the variable ET will now be counted up until it reaches the
value SETTIME ; then Q will be switched to FALSE .
• The negated value of Q will be saved after every WAIT cycle in OK [
• As soon as Q becomes FALSE, OK becomes TRUE.
The timer is complete.
3.2.7The main program PLC_PRG
Line 4
Line 7
]
]
Line 10
Line 5/6
Line 14/15
Line 1
]
], and call DELAY
]
]
The organization unit PLC_PRG is the main program for calling the two function blocks WAIT and
TRAFFICLIGHT .
29.To edit the organization unit PLC_PRG, activate its editor window by selecting
Object Organizer,
tab
Organization units
3.2.7.1Declaration
To ensure that the function blocks created before can be used inPLC_PRG , it is necessary to declare
instances of these function blocks. The traffic light example requires two instances of the function
block TRAFFICLIGHT ( LIGHT1, LIGHT2) and one instance of the function block WAIT ( WAIT1).
30.Use the declaration editor to declare as local variable (between the keywords VAR and
END_VAR) the variables for the required instances.
3.2.7.2Sequential function chart
The start-up diagram of an organization unit in SFC always consists of an action Init, a subsequent
transition Tr a ns0 and a jump back to Init.
and double-clicking PLC_PRG .
3-8
DDS EN 2.3
l
Loading...
+ 310 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.