IindraLogic Prog 04 2007 e
IindraLogic Prog 04 2007 e
IindraLogic Prog 04 2007 e
Pneumatics
Service Automation
Mobile Hydraulics
Training manual
Indralogic Basic
Revision 04 / 2007
Impressum Publisher: Bosch Rexroth AG Service Automation didactic Author: Helmut Kleinhans BRC / SAL2
Nachdruck, Vervielfltigung und bersetzung, auch auszugsweise, nur mit unserer vorherigen schriftlichen Zustimmung und mit Quellenangabe gestattet. Wir bernehmen keine Haftung fr die bereinstimmung des Inhalts mit den jeweils geltenden gesetzlichen Vorschriften. Reproduction, copying, or translation of this publication, wholly or in part, only with our previous written permission and with source credit. We assume no responsibility for agreement of the contents with local laws and regulations. Bosch Rexroth AG is exempt from liability, and reserves the right to make changes at any time.
Table of Contents
Table of Contents
II
Table of Contents
III
Table of Contents
IV
Table of Contents
Table of Contents
VI
Table of Contents
VII
Table of Contents
VIII
Table of Contents
IX
Table of Contents
Table of Contents
XI
Chapter 21 Exercises
Network structure I/O Bus Configuration Program structure Global Variables Inputs and Outputs Signal list Switch Box (Bit signals) Signal list Switch Box (Byte & Word) Signal Markers Example 1 Example 3 Example 4 Example 5 Example 6 AND before OR Circuit Circuit with bracket Circuit with ORbracket Transportation Slide Signal list machine model Signal list machine model Exercise Programming of a Function Exercise Programming of a Function Exercise Programming of a Function Block Exercise Programming of a Function Block Manual logic Exercise Programming of a Function Block Automatic logic Automatic Sequence Robot Station Automatic Sequence Robot Station Automatic Sequence Robot Station Automatic Sequence Transportation Slide Automatic Sequence Press In Station Automatic Sequence Press In Station 1 2 3 4 5 5 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
Network
CHAP 1
2004
This manual is the exclusive property of Bosch Rexroth AG, also in the case of Intellectual Property Right applications. Without their consent it may not be reproduced or given to third parties.Errors and technical modifications reserved.
CHAP 1
Note ! Before the setup of the Network Neighborhood, the a Networkcard must have been installed 1. Callup the Windows Control Panel and double click on the System icon
CHAP 1
2. Click onto Network Identification and than onto the button Properties
Note ! The Computer name must be unique in whole the network The Workgroup name must be the same on all computers on the network
Note ! The Workgroup name must be the same on all computers on the network, which should belong to this group
CHAP 1
5. Open the network connection for which you want to set the IPAddress
CHAP 1
7. Select entry Internet Protokol (TCP/IP) and click onto button Properties
CHAP 1
Important note ! It is not recommended to make any other alterations or changes in the Network properties window
CHAP 1
Note ! Before the setup of the Network Neighbourhood, the a Network Card must have been installed 1. Callup the Windows Control Panel via the Start button
CHAP 1
Note ! The Workgroup name should be the same on all computers belonging to this group
CHAP 1
6. Open the Property window by double clicking onto the network connection for which you want to set the IPAddress
CHAP 1
8. Select entry Internet Protokol (TCP/IP) and click onto button Properties
CHAP 1
10
Important note ! It is not recommended to make any other alterations or changes in the Network properties window
CHAP 1
11
Functional overview
StatusDisplay Ethernet connection for Onboard I/O 8 fast inputs usable as interrupt inputs 8 outputs (0,5 A) power supply terminal
8 characters Programming unit or Operating panel communication to: 4 Buttons New controls e.g. adjustment of the (NetVarUDPLib) or communication parameters or to the old CLxx world (BuepE_Client)
Inline I/O Extension with RexrothInline Modules max. 64 Modules max. 32Byte I and O
RS232interface for COM PROG Programming unit COM SERV small operation panel COM USER Programming unit or serial communication with SysLibCom
Progr. memory 32 MB RAM 64 kB NvRAM Boot project Remanence new File types
Profibus DPV1 max. 8 k I/O Add DPSlaves to I/O configuration Access to VCP panel (IL_VCP_DP) Acyclic Services (V1) DP_Diag via function DP_RDREC, DP_WRREC
CHAP 1
12
IndraControl L40 uses the proved Real Time operating system VxWorks. The processor is a 266MHz Geode with 32MB DRAM and 64kByte NvRAM.
Features
User memory Remanent memory 32 MB 64 kByte Runtime Programming languages Programming system Programming interface Functions for monitoring Indralogic (according to EC 611313) according to IEC611313: IL, LAD, FBS, ST, SFC, CFC Rexroth IndraWorks Ethernet or RS232 Monitoring, Online Change, Trace, Write (1 cycle) / Simulation, Breakpoint, single step, single cycle Supplied libraries Standard IEC 61313 library TCP/IP + ser. communication, VCP interface, DP_Diagnosis
Number of tasks 16 Task types In/ Outputs Forcing, cyclic, free wheeling, event controlled 8 Bit I (interrupt) + 8 Bit O on board 512 Bit I/O (central) 8 kByte I/O (decentral via ProfibusDP V1) typical 120 s (1000 Instr. of IL)
Cycle time
CHAP 1
13
Mechanical structure
The IndraControl L40 is mounted to a standard hat rail according to DIN EN50022. (35mm x 7,5mm) Note: Beside the mounting function, the hat rail also has the function of grounding and is additionally used for heat conduction. This means, that the hat rail must always be connected to a grounding bus. Additional the heat is partial conducted via the hat rail. So it is used in conjunction with the metallic ground plate of the L40 as a cooling element. The power supply voltages and the Onboard in and Outputs are wired via the Inline terminals. Sensors and actors at the Onboard I/Os are connected with a 2wire technique (Sensors with 24V and signal, actors with signal and 0V). The connection terminals for all wires are facing located at the front side of the housing. The bending radius should not exceed 120mm. Because of its low protection category IP20, the IndraControl L40 must be mounted inside of a control cabinet or a similar housing. The prefered mounting position is horizontal. Due to thermic reasons, a vertical mounting is not recommended.
For more informations please see manual: Indracontrol L40 Chapter 7 Connections and interfaces
CHAP 1
14
The main circuit may be separated from other circuit segments, which are independent of each other. In that case, the main circuit supplies the main voltage for all these segments. Using this option , a separate supply circuit for actor groups can be realized. The maximum current load is 8 A (Sum of main circuit and all segments). If the limit value is reached (current sum of US and UM), a new (additional) power supply terminal must be used. For more informations please see manual: Indracontrol L40 Chapter 7.2 Power supply
CHAP 1
15
I/O connections
Master
I
CPU
Node 0
Onboard I/O
Node 1
B
Node 2
Profibus DP I/O
. . .
126
Hardware L40 & Network Installation First time installation L40 IPAddress setup
CHAP 1
16
INIT
Enter
RUN
Enter
STOP Ethernet
Enter Display IP Adrress
Ethernet
Enter Display
IP : 10.23.1.27
Enter Input
IP : 10.23.1.27
Display Subnet Mask
AAA : 192
Enter
Subnet : 255.255.0.0
Enter Input
BBB : 168
Enter
AAA : 255
Enter
CCC : 1
Enter
BBB : 255
Enter
DDD : 11
Enter
CCC : 255
Enter
OK : ?
ESC Abort Enter Confirm
DDD : 0
Enter
OK : ?
ESC Abort Enter Confirm
Hardware L40 & Network Installation Firmware Hardware version & Status display L40
CHAP 1
17
INIT
Enter
RUN
STOP
Ethernet
Selection
RS 232
Display
Firmware
Enter
03V03
ESC Abort
Hardware
Enter
CML 40.1NP220NA
ESC Abort
Temp
Enter
+ 44,0C
ESC Abort
OHC CTRL
Enter ESC
1018 h
Abort
OHC FAN
Enter ESC
0h
Abort
Hardware L40 & Network Installation Setup of L40 serial RS232 interface
CHAP 1
18
INIT
Enter
RUN
STOP
Ethernet
Selection
RS 232
Enter
COM SERV
Enter
COM : SERV
Enter
OK : ?
ESC Abort Enter Confirm
COM : USER
Enter
OK : ?
ESC Abort Enter Confirm
COM : PROG
Enter
OK : ?
ESC Abort Enter Confirm
CHAP 1
19
RUN PLC:OK
Enter
Outp. ON
Enter
OUTP: ON
OUTP: OFF
ESC Abort Enter Confirm
PLC RUN
Enter
PLC: RUN
PLC: STOP
ESC Abort Enter Confirm
PLC PROJ
Enter
PROJ:L40_Name.pro
PROJDATE : DT#2006081609:30:23
CHAP 1
20
HW WATCH
1. Disconnect L40 from supply voltage . 2. Reconnect L40 to supply voltage
BOOT1.01
ESC
3. Wait until you see this message 4. Press both keys at the same time and keep them pressed
Enter
delete ?
Enter
OK : ?
Enter Confirm deletion
Bootproj
ESC Exit
INIT
6. Complete L40 program memory has been deleted and PLC Program has to be loaded with IndraLogic
IndraWorks Projects
CHAP 2
2004
This manual is the exclusive property of ROBERT BOSCH GMBH, also in the case of Intellectual Property Right applications. Without their consent it may not be reproduced or given to third parties. Errors and technical modifications reserved.
CHAP 2
Menu parameters
CHAP 2
3. Enter the name of the new project, and select the directory, into whicjh you want to store the project
CHAP 2
6. Drag the selected Target System with the left mouse button still
pressed onto the Project name and release the left mouse button as soon as a line is displayed below the Project name
IndraWorks Projects
CHAP 2
IndraWorks Projects
CHAP 2
17. Apply new settings by 16. Enter the IPAddress of the L40 controller
to which you want to make a connection and confirm the input by pressing the Enter key
IndraWorks Projects
CHAP 2
IndraWorks Projects
CHAP 2
VPP/BTVPanel to which you want to make a connection, and confirm the address by clicking onto the OK button
IndraWorks Projects
CHAP 2
Note ! By clicking with the right mouse button onto the icon Logic, the communication window can be called up again by selecting Properties
IndraWorks Projects Communication with a L40 / VEPxx (Hardware PLC) External PC with IndraWorks / Indralogic
CHAP 2
IndraLogic Programming System Target System L40/VEP30 Communication via Gateway with Local (IP 192.168.1.101) Gateway Server Network adapter (e.g. IPAddresse = 192.168.1.50)
L40 / VEP30 Integrated network adapter (e.g. IP 192.168.1.101) Hardware PLC (VxWorks)
IndraWorks Projects
CHAP 2
10
Communication with a VPP / BTV Panel (Software PLC) External PC with IndraWorks / Indralogic Indralogic Programming System Target System VPP/BTV Communication via Gateway with TCP/IP (192.168.1.202) Network adapter (e.g. IPAddress = 192.168.1.50)
VPP / BTV Network adapter (e.g. IP Address = 192.168.1.202 Gateway Server Communication with VxWin Shared Memory Network via local network IPAddress 192.168.0.2 Software PLC
CHAP 2
11
PLCProgram
CHAP 2
12
mouse button, press the right mouse button and select Properties
3. Check, if the directory for the I/O Confiiguration (GSD Files) is correct
CHAP 3
Nachdruck, Vervielfltigung und bersetzung, auch auszugsweise, nur mit unserer vorherigen schriftlichen Zustimmung und mit Quellenangabe gestattet. Wir bernehmen keine Haftung fr die bereinstimmung des Inhalts mit den jeweils geltenden gesetzlichen Vorschriften. Reproduction, copying, or translation of this publication, wholly or in part, only with our previous written permission and with source credit. We assume no responsibility for agreement of the contents with local laws and regulations Bosch Rexroth AG is exempt from liability, and reserves the right to make changes at any time.
CHAP 3
The hardware based controllers (L40) have integrated inputs and outputs on the motherboard. The onboard inputs can also be used as interrupt inputs. The default start addresses are I0 and Q0. OnBoard Inputs OnBoard Outputs
CHAP 3
inserted into the project with the left mouse button, and keep the mouse button pressed
CHAP 3
4. Enter the I/O Start address 5. Take over the new address by clicking
onto the Apply button
CHAP 3
additionally inserted into the project with the left mouse button, and keep the mouse button pressed
button still pressed onto an existing Inline module, and release the left mouse button as soon as a line is displayed below the selected Inline Module
Important note! The order in the configuration window, must match 100% the order of the installed Inline Modules, otherwise a configuration error is displayed after the program has been loaded into the controller
CHAP 3
11.
Check, if the new address is correct (Caution ! Obey Word / Byte addressing mode)
CHAP 3
ProfibusM, press the right mouse button and select Import GSD files
want to add to the existing list, and take over the selection by clicking onto the Open button
CHAP 3
Note ! To remove an installed GSDFile from the list in IndraWorks, the file must be manually deleted from the Config Directory
CHAP 3
be inserted into the project with the left mouse button, and keep the mouse button pressed
left mouse button still pressed onto the icon Profibus/M, and release the left mouse button as soon as two little squares are displayed
CHAP 3
4. To adapt the ProfibusStation Address, open the inserted module by double clicking on it 5. Enter the station address of the ProfibusDP I/OModule,
Note !
The window with the Station address can be called up again by double clicking onto the corresponding basic module
CHAP 3
10
with the left mouse button still pressed onto the icon of the previously inserted Basic module, and release the left mouse button as soon as two little squares are displayed
7. To adapt the I/OStart Address, open the inserted module by double clicking on it
8. Enter the I/O Start address 9. Take over the new address by
(Caution ! Obey Word / Byte addressing mode) Note ! The I/OAddress input window can be called up again by double clicking onto the Module Type
CHAP 3
11
to be inserted into the project with the left mouse button and keep the mouse button pressed
left mouse button still pressed onto the icon Inline I/O, and release the left mouse button as soon as two little squares are displayed
4. To adapt the I/OStart Address, open the inserted module by double clicking on it
5. Enter the I/O Start addresses 6 Take over the new address by
clicking onto the Apply button
CHAP 3
12
1. Open the Bus parameter window by double clicking onto the Icon Profibus / M
Note ! For the first time installation, it is recommended to set the Transmission rate to 1500MBit. As soon as the ProfibusDP runs in an error free state, the Transmission rate can be increased to the maximum value.
CHAP 3
13
2. Click onto the tab Ressources and open the I/OConfiguration window by double clicking
with the left mouse button onto PLC Configuration (<R> = is managed by IndraWorks)
CHAP 3
14
CHAP 3
15
7. After loading is completed, start the PLC Program using Online / Run
and the status of the connected signals j Signalzustand ist 0 (False) J Signalzustand = 1 (True)
CHAP 4
Nachdruck, Vervielfltigung und bersetzung, auch auszugsweise, nur mit unserer vorherigen schriftlichen Zustimmung und mit Quellenangabe gestattet. Wir bernehmen keine Haftung fr die bereinstimmung des Inhalts mit den jeweils geltenden gesetzlichen Vorschriften. Reproduction, copying, or translation of this publication, wholly or in part, only with our previous written permission and with source credit. We assume no responsibility for agreement of the contents with local laws and regulations Bosch Rexroth AG is exempt from liability, and reserves the right to make changes at any time.
CHAP 4
2. Click onto Load & Save, to define the system properties and the memory handling
Create Backup With every Save a backup file with the extension .bak is generated This *.bak file is kept after closing the project. and can be restored when required Auto Save While you are working, the project is saved according to a defined time interval to a temporary file with the extension .asd., which is erased at a normal exit from the program If for any reason IndraLogic is not shut down normally, then the file will not be erased If the project is opened again, you are promted, if you want to open the original file or the auto save file Ask for project info When saving a new project or saving a project under a new name, the project info is automatically called You can visualize the project info with the command Project / Project info and alter it Auto Load At the next start of IndraLogic the last open project is automatically loaded This can also be achieved by entering entering the project in the command line Save before compile The project will be saved before each compilation inta a file with the extension .asd, which behaves like described under option Auto Save Remind of boot project on exit If the project has been modified and downloaded without creating a new Boot project since the last download, a dialog will remind the user before leaving the project, and the Boot project can be newly generated
IndraLogic Basic Setup Setting the basic parameters for Indralogic Editor
CHAP 4
Autodeclaration If this option is activted , then after the input of a notyetdeclared variable, the Variable declaration window is called up automatically Autoformat If this option is activated, an automatic formatting is carried out when a line completed the following formatting is carried out Operators and Keywords written in small letters are converted into capitals Tabs are inserted automatically to achive uniformly divided columns List components If this option is activated, Intellisense will be activated with the following functions: if you insert a dot at a position where a identifier should be inserted, then a selection list will opened, offering all global variables which are found in the project If you insert the name of a function block instance, followed by a dot, a selection list of all Declarations as tables Variables are displayed in a table instead of using the usual declaration editor. This table is sorted like a card box, where you find tabs for input variables, output variables local variables and in_out variables. Mark the representation of theactual mark in the graphical Editors can be selected as: dotted rectangle a rectangle with solid lines as a filled rectangle Bit values the representation of the binary datatypes (BYTE, WORD, DWORD) in Monotor can be set to Decimal, Hexadecimal order Binary Surpress monitoring of complex types (array, pointer, VAR_IN_OUT) if this option is activated, complex data typs like Arrays, Pointers, VAR_IN_OUTs are not displayed in the Monitor window, when Online Mode is selected Show POU symbols if this option is activated, icons will be displayed inside of the POUBoxes, if they are stored as bitmaps in the Library directory (POUName TON = Symbol name TON.bmp)
IndraLogic Basic Setup Setting the basic parameters for Indralogic Desktop
CHAP 4
language selection for the User Interface, program code is not changed (Code is always in English)
Note !
Language selection is only possible under Windows NT, Windows 2000 und Windows XP mglich Toolbar a toolbar with buttons for faster selection of menu commands is dispalyed below the menu bar Status bar a status bar at the lower edge of the main windowis displayed Online in Security mode: In Online mode with the commands Run, Stop, Reset Toggle Breakpoint, Single cycle, Write values, Force values and Release force, a dialog box appears with the confirmation request whether the command should really be executed This option is saved with the project Query communication parameters before login as soon as the command Online Login is executed, a communication parameter dialog will be displayed To go into online mode, this dialog must be confirmed by clicking onto the OK button Do not save communication parameters in project The settings of the communication parameters dialog (Online Communication Parameters) Printer borders In every editor window, the limits of the currently set print range are marked with red dashed lines Their size depends on the following: paper size orientation F4 ignores warnings After compilation, when F4 is pressed in a message window, the focus jumps only to lines with error messages, warning messages are ignored MDIrepresentation with active MDIOption multiple windows can be opened with deactivated MDIOption only one window can be opened in Full Screen Mode
CHAP 4
Directory selection
in the Project and General sections of this window the default directories can be entered these directories are used to search for Libraries or Control configuration files or to save the compiled program file and the Source upload files Compiled files are of the type .map and .list, the Symbol files however are stored directly into the project directory for the Library and Configuration files several directories can be entered, separated by a semicolon ; Note ! Do not use empty spaces and special characters except for _ in the directory names. Validity of inputs Entries made in the Project section are stored into the Project file Entries made in the Generall section are stored into the .ini file of Indralogic and they are valid for all projects In the section Target the default names of the directories for Libraries and Configuration files are taken from the Target system settings (e.g from the Target configuration file) These fields are blocked for editing, entries however can be selected and copied Note ! The search order is defined as follows first the directories entered in the Project sections are searched next search path is taken from the Target section finally the directories entered n the General section are searched Important note ! If two files with the same name are found, the one in the directory that is searched first will be used
IndraLogic Basic Setup Setting the basic parameters for Indralogic Build
CHAP 4
Note! If the Number of Data segments is not sufficent enough for the current project, the compiler will output an error message
Debugging Additional to the program code, debugging code is created, resulting in a considerably larger file The debugging code is needed in order to make use of the debugging functions offered by IndraLogic (e.g. breakpoints) When this option is switched off, project processing becomes faster and the size of the code decreases. The option is stored with the project. Replace constatnts The value of each constant is loaded directly, in Online mode the constants are displayed in green Forcing, writing and monitoring of a constant is then no longer possible If the option is deactivated, the value is loaded into a storage location via variable access (this does in fact allow writing the variable value, but implies longer processing time). Nested comments Comments can be placed within other comments Example:
the comment that begins with the first bracket is not closed by the bracket following checked, but only by the last bracket Create binary file of the application A binary image of the generated code (boot project) is created in the project directory during compilation (File name: Project_name.bin) Number of data Enter here how many storage segments are to be reserved for your project data in the controller. (This space is required so that an Online Change can still be carried out when new variables are added) Note ! All entries in the Build Options dialog are stored into the project file
CHAP 4
Note ! Source download requires time, when loading a program. If source is not required in PLC dont download it, to speed up load process.
The option Sourcecode only exclusively affects the Indralogic file (file extension .pro) The option All files also includes files such as the associated library files, visualization bitmaps, configuration files, etc. The option Implicit at load allows the selected file range to be automatically loaded into the controller system on the command Online / Login. The option Notice at load offers a dialog, when the command Online / Login is selected, with the question Do you want to write the source code into the controller system? Pressing Yes will automatically load the selected range of files into the controller system, or you can alternatively click onto No, and the source code is not loaded into the controller. The option Implicit an create boot project allows the selcted file range to be automatically loaded into the controller system on the command Online / Create boot project The option On demand loads the source code only, if Online / Sourcecode download is selected in the Online menu
CHAP 4
Function The settings made here, are used to configure the handling of the Symbol file Projectname.sym or as a BinaryFile of the name Projectname.sdb. The Symbol file is required for the data exchange with the controller, and is used by the OPC or GateWay DDE Server. Settings If the option Dump symbol entries is activated, all project variables will be stored automatically into the Symbol file during the compiler run (Projectname.SYM) If the option Dump XML Symbol table is activated, all project variables will be additionally stored into a XMLVersion of the Symbol file (Projectname.SYM_XML) both files will be stored into the project directory Configuration of the Symbol file entries with the button Configure symbol file If the option Symbol configuration from INIFile is activated in the Target settings, the symbol file entries will be generated using the IndraLogic.ini file or from another *.INI file which is defined in the Indralogic.ini file (in this case, the object attributes cannot be edited) If option Symbol configuration from INIFile is not activated in the Target settings, the symbol file entries will be generated according to the selection made with Configure symbol file
CHAP 4
Select all objects from which the variables have to be stored into the Symbol file
The following options are available: Export varibales of objects All variables of the selected objects are taken over into the Symbol file Export data entries for structures and arrays of an object entries for the access to the main variable are generated Export structure components each structure variable is generated as an individual entry in Symbol file Export array entries each element is genertated as an individual entry in the Symbol file Write access all variables in the Symbol file are enabled for Write access
CHAP 4
Depending on the selected Target System, certain functions can be set / reset by IndraLogic using Resources / Target System / General
Note ! Adaptions of the functions is only possible, if the Target System is checked out from the ENIDatabase
CHAP 4
10
Support preemptive multitasking n A Task with a low priority can be interrupted immediately by a task with a higher priority. The Task with low priority is continued after the high priority task has been completed. Byte addressing mode Each variable allocates memory according to its size. The addressing of the Variables is done according to their size (B, W, D) n The addressing of the Variables is done generally Byte by Byte. Online Change Loading of changes requires a STOP of the controller. n Changes are loaded without of a STOP of the controller. Update unused I/Os Variables not used in theprogram are not updated in the I/O Update Cycle n all Variables no matter if they are used in the program or not, are updated in the I/O Update Cycle Download symbol file Symbol files are used as address references for external OPCClients or for the Communication requests of VCP or VPP Panels. They are generated, if the checkbox in Project / Options / Symbol configuration is checked. The Symbol file is not loaded into the L40 n The Symbol file is loaded into the L40 Symbol config from INI file The Symbol configuration is defined in Project / Options under the function Configure symbol file . n The Symbol configuration is read out of the INDRALOGIC.INI file. The button Configure symbol file is not available with this selection. PLC Browser The PLC Browser is a tool, which can communicate with the L40 via command line commands The PLC Browser is not available in the Resources. n The PLC Browser is available in the Resources. Trace The Trace function makes available a 8channel Oscilloscope for digital and analogue values, which can be used to monitor Global Variables. Trace is not available in the Resources. n Trace is available in the Resources. Load boot project automatically The boot project must be updated manually with the command Online / Create boot project in the L40. n The Boot project is updated with each LogIn (Load / Online Change) in the L40 FlashMemory Retain forcing The active forcings remain active, after a new program is loaded
CHAP 4
11
Project structure
Project
Programs / Modules
Global Variables
Data Types
Declarations
Code
Main program PLC_PRG Update of input status Processing of forcing list inputs Processinh of the IndraLogic Application Callup of additional Programs, Functions and Function Blocks Processing of forcing list outputs Update of output status The module PLC_PRG has a special status among all other modules. PLC_PRG is the only module, which is directly called by the runtime system
Functions of the Indralogic Runtime system IndraLogic Application ( user specific program)
CHAP 4
12
CHAP 4
13
CHAP 4
14
CHAP 4
15
Program window
Modules
Data Types
Visualization
Resources
CHAP 4
16
1. Select level under which the new structure is to be generated e.g. POUs
3. Select New Folder object, press right mouse button and select Rename Object
CHAP 4
17
3. Select Type of POU, Language of POU and enter the Name of the new POU
CHAP 4
18
Configuration
Ressource
Task
Program Organization Units (POU) Program (PRG) Function Block (FB) Function (FUN)
The modules which a project is made of are called Program Organization Units by the IEC61131 standard POUs are the same as the Program, Organization, Sequence and Function modules used in the PLCProgramming world To reduce the large variety, very specific meanings of module types and to simlify the programming of them, is the most important goal of the standardization
CHAP 4
19
Organization module
OM
PM
Program module
SM
Sequence module
(PRG) (FB)
DM
Data module
FM
Function module
(FUN)
CHAP 4
20
CHAP 4
21
Interface variables Local variables Program code (POU Body) Declaration section Code section
Declaration section Declarations are are used to define all variables of a POU A difference is made between the Local (internal) variables of a POU and the Interface (In /Out) variables, which can be seen by the outside program Program code section (POU Body) In the Program section of a POU the binary logic and/ or the data processing is to be programmed using one of the following progrmming languages Instruction list (IL) Ladder Diagram (LD) Functions Plan (FBD) Structured Text (ST)
Function_Block FB name Function_Block Continue
CHAP 4
22
as shown in the table above, all variable types can be used together with a Program Function blocks cannot provide global variables to other POUs, this is only permitted in Programs, Ressources and Configurations Function blocks can acces such global variables only by using the variable type VAR_External Functions are the most restrictive POUs, because they can only use VAR and VAR_INPUT variable types Functions return their Result via the Function Value Except for the Local variable type VAR, all other variable types can be used to exchange information between different POUs
CHAP 4
23
Local data
CHAP 4
24
CHAP 4
25
RW
RW
RW
RW
RW
RW
RW
RW
RW
Load / Unload
CHAP 5
2004
This manual is the exclusive property of ROBERT BOSCH GMBH, also in the case of Intellectual Property Right applications. Without their consent it may not be reproduced or given to third parties. Errors and technical modifications reserved.
Load PLCProgram
CHAP 5
*.PRO
Load PLCProgram
CHAP 5
Name.SYM Name.SDB
Load source code
Name0000000br.CI Name0000000br.RI
Untiteled.PRO
Source.DAT
Compile
Load PLCProgram
CHAP 5
Check and compile complete PLCProgram 1. Select Project / Rebuild all in the menubar, to check/compile PLCProgram
Load PLCProgram
CHAP 5
Check interface setting to PLC (IPAddress) 1. Select Online / Communication Parameters in the menubar, to check/set
the IPAddress of the CPS21Panel and the internal IPAddress for the Software PLC
Load PLCProgram
CHAP 5
Load PLCProgram into the PLC 1. Select Online / Login in the menubar, to load the error free compiled
PLCProgram into the PLC
Load PLCProgram
CHAP 5
Generate Boot Project in PLCController 1. Select Online / Create Boot project in the menubar, to generate a Boot project
in the PLCController
Export / Import
CHAP 6
2004
This manual is the exclusive property of ROBERT BOSCH GMBH, also in the case of Intellectual Property Right applications. Without their consent it may not be reproduced or given to third parties. Errors and technical modifications reserved.
CHAP 6
Note ! IndraLogic handles the data entered in a project, in individual sections, inside of the development enviroment. If individual program sections have to be taken over into another project, it would be to difficult to export the data with Copy and Paste. However if the function Export is used, not only the data is copied, but also the structures and the variables. The Export file generated, is a plain ASCII File, which includes all selected programs, structures and variables in ASCII Format.
pressed, then select all directories, individual programs, Variables and data structures in the displayed window, which you want to export
Export / Import Export of Project data 3. Select the Target directory in the displayed Explorer window,
into which the Export file is to be stored
CHAP 6
6. Close the current project via File / Close, before you open the new project
into which you want to Import the exported data
CHAP 6
Note ! In order to insert the previously exported project data from an Export file into another project, the function Import must be used . Caution ! With the Import function not only the program data, but also the directory structures, variables and data types are inserted into the current project (i.e. existing structures, variables and data types in the current project can be overwritten by the imported data).
is overwritten
No existing Structure remains unchanged, a new structure with the extension _1 is created
4. If structures, variables or programs of the same name are present in the current project,
a warning message is displayed. In the displayed window the further processing of the import can be selected (i.e. a selection can be made, if the existing data is to be overwritten or if the imported data is to be discarded)
CHAP 6
5. Check the current project for existing errors, by carrying out a new Compiler run (Project / Rebuild all)
Programming
CHAP 7
2004
This manual is the exclusive property of ROBERT BOSCH GMBH, also in the case of Intellectual Property Right applications. Without their consent it may not be reproduced or given to third parties. Errors and technical modifications reserved.
I/O Definition Address definition of Inputs, Outputs and Markers Structure of address definition % Percentage sign I Input Q Output X without B W D
CHAP 7
M Marker Single Bit Single Bit Byte Word Double Word 2.7 Bit Address 13 Byte Address 18 Word Address 20 Double Word Address
Addressing examples: %QX2.7 %IB13 %IW18 %MD20 Addressing example with Symbolic names: Valve_1 LedBar ST1_Value Temp1 AT %QX2.7 AT %IB13 AT %IW18 AT %MD20 : BOOL : BYTE : WORD : DWORD
Important note ! The address format in Indralogic is set to ByteAddressing mode by default. This means, the ProfibusDP I/O addresses and the addresses used inside of Indralogic are identical If Word addressing mode is selected, the ProfibusDP I/O addresses must be divided by 2, in order to get the correct IndraLogic Word address. Examples Byte addressing mode: IndraLogic Profibus
%QX2.7 %IX7.4 %IX7.7 Q2.7 I7.4 I7.7
CHAP 7
CHAP 7
Important note ! The status of a signal in the display below, is only updated and displayed, if the signal is used somewhere else in the program (Program must be called and processed)
CHAP 7
In the following table the properties of the five data type groups are described: Name (Keyword) Description (Short description) Number of Bits (Data width) value range (with related IECLiteral) Defaullt values initial The data width and the value range given below, is depending on the target system and the implementation of the software Data type BOOL WORD DWORD SINT INT DINT USINT UINT UDINT REAL LREAL Data type DATE TOD DT TIME STRING Description Bits boolean 8 Bit sequence 16 16 Bit sequence 32 32 short integer 8 integer 16 Double integer 32 Unsigned short integer 8 Unsigned integer 16 Unsigned Double int 32 Float 32 long float 64 Description Date Time of day Date & Time Duration Sequence of characters. Range 0,...,255 0,...,65535 0,...,4294967295 128,...,+127 32768,...,+32767 2147483648,...,2147483647 0,...,+255 0,...,+65535 0 ,..., + 4294967295 Default 0 0 0 0 0 0 0 0 0 0.0 0.0
Default d#00010101 (treated like a DWord) tod#00:00:00 (treated like a DWord) dt#0001010100:00:00 (treated like a DWord) t#0s (treated like a DWord) (max. 255 char., Default without definition 80)
Instead of the keyword TOD it also possible to use the keyword TIME_OF_DAY Instead of keyword DT it also possible to use the keyword DATE_AND_TIME Default value for a string is an empty character sequence.
CHAP 7
Global Variables
Program (PRG) Local Variables
VAR . END_VAR
VAR_GLOBAL . END_VAR
Program Program
Local Variables
VAR . END_VAR
Interface Variables
Program
Program
CHAP 7
CHAP 7
CHAP 7
CHAP 7
CHAP 7
10
CHAP 7
11
Programming in LIST
CHAP 8
2004
This manual is the exclusive property of ROBERT BOSCH GMBH, also in the case of Intellectual Property Right applications. Without their consent it may not be reproduced or given to third parties. Errors and technical modifications reserved.
CHAP 8
Level and the Folder under which the New Object is to be inserted 2. Press the right mouse button and select Add Object
3. Select Type of POU, Language of POU and enter the Name of the new POU
S0
CHAP 8
CHAP 8
Logic operations in List are programmed using the statements AND, ANDNOT, OR
and so on the first statement of a rung must be always LD If brackets have to be used, the rules of the Boolean Algebra cannot be applied 100% Note ! Only round brackets ( and ) are valid
Bracket rules: The result of an operation is always set with the close bracket ) statement The result produced at this point, is used as a logical AND with the next contact or the next block of brackets
Rule If more than one contact is connected in parallel to an other contact, this ORBranch must be set into brackets If only one contact is connected in parallel, the rule AND before OR applies and no bracket is required
CHAP 8
Rule If more than one contact is connected in parallel to an other contact, this ORBranch must be set into brackets If only one contact is connected in parallel, the rule AND before OR applies and no bracket is required
CHAP 8
Rule If a contact is in front of another contact block, the complete contact block has to be set into brackets Inside of the contact block which is set into brackets the following rules apply: If more than one contact is connected in parallel to another contact, this ORBranch must be set into brackets If only one contact is connected in parallel, the rule AND before OR applies and no bracket is required
CHAP 8
Rule If a contact is in front of another contact block, the complete contact block has to be set into brackets Inside of the contact block which is set into brackets the following rules apply: If more than one contact is connected in parallel to another contact, this ORBranch must be set into brackets If only one contact is connected in parallel, the rule AND before OR applies and no bracket is required
CHAP 8
Rule If a contact is in front of another contact block, the complete contact block has to be set into brackets Inside of the contact block which is set into brackets the following rules apply: If more than one contact is connected in parallel to another contact, this ORBranch must be set into brackets If only one contact is connected in parallel, the rule AND before OR applies and no bracket is required
CHAP 8
CHAP 8
Level and the Folder under which the New Object is to be inserted
3. Select Type of POU, Language of POU and enter the Name of the new POU
CHAP 8
10
CHAP 8
11
CHAP 8
12
Level and the Folder under which the New Object is to be inserted
2. Press the right mouse button and select Add Object 3. Select Type of POU, Language of POU and enter the Name of the new POU
CHAP 8
13
CHAP 8
14
Memory 1.Instance
Inputs: _Right _Manual _ESTOP _Key_Work _Key_Base Outputs: _Y1_Right
Memory 2.Instance
Inputs: _Left _Manual _ESTOP _Key_Base _Key_Work Outputs: _Y1_Left
CHAP 8
15
CHAP 8
16
2. Select instance by double clicking on it 1. Double click onto the function block in the left window
Programming in LDR
CHAP 9
2004
This manual is the exclusive property of ROBERT BOSCH GMBH, also in the case of Intellectual Property Right applications. Without their consent it may not be reproduced or given to third parties. Errors and technical modifications reserved.
CHAP 9
Level and the Folder under which the New Object is to be inserted
2. Press the right mouse button and select Add Object 3. Select Type of POU, Language of POU and enter the Name of the new POU
CHAP 9
6. Enter the symbolic name of the signal 7. Click with the left mouse button onto the
basic line, in order to insert a new AND contact or an Output element
CHAP 9
1. Press the Shift key and keep it pressed, then select all
contacts to which you want to connect the new OR element in parallel, by clicking with the left mouse button on them
2. Click onto the OR button 3. Enter the symbolic name of the signal
1. Click with the left mouse button onto the element, where
you want to insert the new AND element in front of it
CHAP 9
1. Press the right mouse button and select Network (after) or Network ( before)
Programming in Ladder Addition of Function blocks in LDR 1. Click onto the position where you want to
insert the Function block and position the mouse pointer at this position
CHAP 9
CHAP 9
CHAP 9
F2
CHAP 9
CHAP 9
F2
5. Click with the left mouse button directly onto the base line in front of ???,
and than press the Delete key to delete the output assignment and ???
Note !
Only if the output assignment is deleted an error free compiler run is possible
CHAP 9
10
F2
CHAP 9
11
F2
Function Blocks in the left window, and than select with the left mouse button, the Function Block that you want to insert
CHAP 9
12
Note ! If Programs, Functions and Function Block have to be called conditionally, the function Box with EN has to be used in Ladder diagram 1. Click with the left mouse button onto the base line in front of the Program,
Function or Function Block, which has to called conditionally
CHAP 9
13
CHAP 9
14
Default setting
CHAP 9
15
2. Enter the first line of the comment (to make a new line, press the Enter key)
CHAP 9
16
2. Alter the default label from Label to a desired label (e.g. End)
3. Enter the jump destination label according to the nemae used together with the Jump statement (e.g. End:)
Programming in FBD
CHAP 10
2004
This manual is the exclusive property of ROBERT BOSCH GMBH, also in the case of Intellectual Property Right applications. Without their consent it may not be reproduced or given to third parties. Errors and technical modifications reserved.
CHAP 10
Level and the Folder under which the New Object is to be inserted 2. Press the right mouse button and select Add Object
3. Select Type of POU, Language of POU and enter the Name of the new POU
CHAP 10
F2
CHAP 10
At this Connection point the following FBDElements can be added: Box Assignment Jump Return Set (S) / Reset (R)
At this Connection point the following FBDElements can be added: Box Negation
Programming in FBD
CHAP 10
Definition / Alteration the logic or function of a BasicFBDElement 1. Click with the left mouse button onto the text displayed inside
of the element (Text background is changed to black color)
F2
CHAP 10
Select the Input Pin to be deleted by a click with the left mouse button and delete the pin by pressing the Del key
Del
Deletion of an Output pin Select the Output Pin to be deleted by a click with the left mouse button and delete the pin by pressing the Del key
Del
Deletion of a complete Element Select the Elemet to be deleted by a click with the left mouse button and delete the pin by pressing the Del key
Del
Important note ! If an element is deleted to which other elements are connected to, all elements connected to the input pins of this element will be deleted and the logic is adapted accordingly
CHAP 10
1. Press the right mouse button and select Network (after) or Network (before)
CHAP 10
1. Select Extras / View in the menubar and select the desired display mode
Programming in FBD
CHAP 10
Representation in Blue Logic result = TRUE Representation in Black Logic result = False
Note ! The color for the signal status representation can be adapted under Project / Options / Colors
CHAP 10
2. Enter comment, to make a new comment line, press the Enter key
CHAP 10
10
2. Adapt the default text for the target e.g. Label to End)
3. Enter the target label according to the entered label (e.g. End: )
CHAP 10
11
F2
CHAP 10
12
CHAP 10
13
CHAP 10
14
CHAP 10
15
Input Variables IN : Start signal (BOOL) PT : Time command value (TIME) Example T#2s, T#2000ms Output Variables Q : Timer check Bit (Bool) Q = 1, if IN = 1 and if the actual time (ET) is equal to command value (PT) in alle other cases Q = 0 ET : actual time value (Time) actual time (ET) is counted up as soon as IN = 1 if command value (PT) is reached, actual time (ET) is stopped
CHAP 10
16
Input Variables IN : Start signal (BOOL) PT : Time command value (TIME) Example T#2s, T#2000ms Output Variables Q : Timer check Bit (Bool) Q = 0, if IN = 0 and if the actual time (ET) is equal to command value (PT) in alle other cases Q = 1 ET : actual time value (Time) actual time (ET) is counted up as soon as IN = 0 if command value (PT) is reached, actual time (ET) is stopped
CHAP 10
17
Input Variables IN : Start signal (BOOL) PT : Time command value (TIME) Example T#2s, T#2000ms Output Variables Q : Timer check Bit (Bool) Q = 1, if IN = 1 and if the actual time (ET) is less than command value (PT) in alle other cases Q = 0 ET : actual time value (Time) actual time (ET) is counted up as soon as IN = 1 if command value (PT) is reached, actual time (ET) is stopped
CHAP 10
18
Input Variables EN : Enable signal (BOOL) PT : Date/Time command value (DT) Example : DT#2004041514:00:00 Output Variables Q : Time check Bit (Bool) Q = 1, if EN = 1 in alle other cases Q = 0 CDT : active Date and Time (DT) Example : DT#2004073022:10:23 as soon as EN = 1, the given command value at PDT is set at the output parameter CDT and CDT is incremented in steps of seconds as long as EN = 1 if EN = 0, then DT#1970010100:00 is output at CDT
CHAP 10
19
CHAP 10
20
CHAP 10
21
Input Variable CU : Count signal (BOOL) edge triggert Reset : Reset signal (BOOL) resets actual counter value CV and result bit Q to 0 PV : Command value (INT) max. 65535 Output variables Q : Result Bit (Bool) Q = 1, if actual counter value (CV) is equal or greater than command value (PV) in all other cases Q = 0 CV : actual counter value (INT) actual counter value (CV) is incremented by 1 as soon as the count signal (CU) is changing form 0 to 1 or from 1 to 0 if Reset = 1 the actual counter value (CV) and ouput (Q) are reset to 0 as long as Reset = 1 counting is blocked
CHAP 10
22
Input Variable CU : Count signal (BOOL) edge triggert Load : Load signal (BOOL) sets actual counter value CV to command value (PV) PV : Command value (INT) max. 65535 Reset : Reset signal (BOOL) resets actual counter value CV and result bit Q to 0 Output variables Q : Result Bit (Bool) Q = 1, if actual counter value (CV) is equal to 0 in all other cases Q = 0 CV : actual counter value (INT) actual counter value (CV) is decremented by 1 as soon as the count signal (CD) is changing form 0 to 1 or from 1 to 0 if Load = 1 actual counter value (CV) ist set to the command value (PV) as long as Load = 1 counting is blocked if actual counter (CV) value reaches 0, counting is stopped if Reset = 1 the actual counter value (CV) and ouput (Q) are reset to 0 as long as Reset = 1 counting is blocked
CHAP 10
23
Input Variable CU : Count up signal (BOOL) edge triggert CD : Count down signal (BOOL) edge triggert Load : Load signal (BOOL) sets actual counter value CV to command value (PV) Reset : Reset signal (BOOL) resets actual counter value CV and result bit Q to 0 PV : Command value (INT) max. 65535 Output variables QU : Result Bit (Bool) QU = 1, if actual counter value (CV) is equal or greater than command value (PV) in all other cases QU = 0 QD : Result Bit (Bool) Q = 1, if actual counter value (CV) is equal to 0 in all other cases Q = 0
CV : actual counter value (INT) actual counter value (CV) is incremented by 1 as soon as the count signal (CU) is changing form = t0 1 or from 1 to 0 actual counter value (CV) is decremented by 1 as soon as the count signal (CD) is changing form 0 to 1 or from 1 to 0 if Load = 1 actual counter value (CV) ist set to the command value (PV) as long as Load = 1 counting is blocked if actual counter (CV) value reaches 0, counting is stopped if Reset = 1 the actual counter value (CV) and ouput (Q) are reset to 0 as long as Reset = 1 counting is blocked
Sequence Programming
CHAP 11
CHAP 11
Note ! Indralogic offers 2 different types of SFCProgramming modes. The so called simplified mode, is not compliant to IEC61131. The other SFCMode is compliant to IEC. Before SFC Programming is started, the required mode should be activated, because it is not possible to convert it afterwards. IECLibrary In order to use the IECComliant Sequence, the SFCLibrary IECSFC.LIB must be added to the library window (Window / Library Manager / Additional Library)
CHAP 11
The following StepAction output commands are available in the IEC compliant sequence: N R S L D P SD DS SL
Nonstored overriding Reset Set (Stored) time Limited time Delayed Pulse Stored and time Delayed Delayed and Stored Action is active as long as the step is active Action is deactivated Action is activated and remains active until a Reset for this action is issued Action is activated for a certain time, but only as long as the step remains active Action is activated after a certain time, if the step is still active at this point and remains active as long as the step is active Action is carried out one time, when the step is activated Action is activated after a certain time and remains active until a Reset for this action is issued Action is activated after a certain time, if the step is still active at this point and remains active until a Reset for this action is issued Action is activated for a limited time
The StepAction commands L, D, SD, DS and SL require a time value in the TIMEConstant format, e.g. T#5s or T#500ms
CHAP 11
folder under which the new SFCProgram is to created 2. Press the right mouse button and select Add Object in the menu
Init to N000 and Trans0 to e.g. _S1 = TRUE and enter the action to be carried out by this step e.g. _Y1
CHAP 11
button, press right mouse button and select StepTransition (after) in the popup menu
from Step2 to N001 and Trans1 to e.g. _S3 = TRUE and Action_1 to e.g. _Y2
CHAP 11
button, press CTRL key and keep it pressed, then select Step element with left mouse button
the copied step element, with left mouse button, press the CTRL key and keep it pressed, than press right mouse button and select Paste after
CHAP 11
button, press CTRL key and keep it pressed, then select Step element with left mouse button
CHAP 11
CHAP 11
CHAP 11
CHAP 11
10
CHAP 11
11
CHAP 11
12
CHAP 11
13
Note ! The step Entry logic is processed only once when the step is selected the first time.
CHAP 11
14
CHAP 11
15
CHAP 11
16
CHAP 11
17
CHAP 11
18
Default variables are used together with SFC, to make it possible to check the status of a sequence in other parts of the program Each step has a Flag, which is used to store the status of the step The Step_Flag active or inactive status of a step is called: Stepname.x IECSequence > SqA_080_Robot1.N005.x Stepname Simplified sequence > SqA_080_Robot1.N005 This boolean variable is set to TRUE, if the corresponding step is active, and set to FALSE, if the corresponding step is inactive this variable can be used in each Action and Transition of the SFCPOU To check, if an IECAction is active or not, the variable Actionname.x can be used Together with IECSteps, the active time a step has been active, can be checked using the default variable Stepname.t it is also possible to access the default variables from other programs inside of the project Example: act_step_1 : = SqA_050_Loadstation.N001.x Here the default variable N001.x is used, to check the status of IECStep N001 in POU SqA_050_Loadstation act_step_1_Time : = SqA_050_Loadstation.N001.t Here the default variable N001.t is used, to check the time the step has been active
CHAP 11
19
To use the complete set of the IECSequence Flags, the SFCLibrary AnalyzationNew.lib must be linked into the project (Window / Library Manager / Aditional library)
SFCFlags
For controlling the operation of SFC POUs flags can be used, which are created implicitely during running the project. To read this flags you have to define appropriate global or local variables as inputs or outputs. Example: If in a SFC POU a step is active for a longer time than defined in the step attributes, then a flag will be set, which is accessible by using a variable SFCError (SFCError gets TRUE in this case). For controlling the operation of SFC POUs flags can be used, which are created implicitely during running the project To read this flags you have to define appropriate global or local variables as inputs or outputs Example: If in a SFCPOU, a step is active for a longer time than defined in the step attributes, then a flag will be set, which is accessible by using the variable SFCError (SFCError gets TRUE in this case).
CHAP 11
20
SFCTrans Type BOOL This variable is set to TRUE, when a transition is actuated (next step is selected) SFCErrorStep Type STRING If SFCError registers a timeout, the name of the step, which has caused the timeout, is stored into this variable The declaration of the flag SFCError is a prerequisite, to registers all timeouts in the SFC SFCErrorPOU Type STRING If SFCError registers a timeout, the name of the POU, which has caused the timeout, is stored into this variable The declaration of the flag SFCError is a prerequisite, to registers all timeouts in the SFC SFCCurrentStep Type STRING The name of the active step is stored in this variable this is done independently of the time monitoring If parallel branches exist in a sequence, the step in the branch on the outer right is stored into this variable SFCErrorAnalyzationTable Type Array [0..15] of ExpressionResult This variable provides the result of an analyzation of a transition expression For each component of the expression, which is contributing to a FALSE of the transition and thereby to a timeout of the previous step, the following information is written to the structure ExpressionResult : Name Address Comment actual status This is possible for maximum 16 variables (ArraySize max. 0..15) The structure ExpressionResult as well as the implicitely used analyzation modules are provided with the library AnalyzationNew.lib The analyzation modules also can be used in other POUs, which are not programmed in SFC Note ! It is a precondition for the analyzation of a transition expression, that a timeout is registered in the preceeding step So a time monitoring must be implemented there and also the variable SFCError (see above) must be defined in the declaration window SFCTip, SFCTipMode Type BOOL This variables allow JogMode of the SFC When this is switched on by SFCTipMode = TRUE, it is only possible to skip to the next step, if SFCTip is set to TRUE As long as SFCTipMode is set to FALSE, it is even possible to skip over transitions
CHAP 11
21
CHAP 11
22
Sequence programming
CHAP 11
23
CHAP 11
24
CHAP 11
25
CHAP 11
26
CHAP 11
27
CHAP 11
28
and press the right mouse button, then select Jump or StepTransition (after)
CHAP 11
29
CHAP 11
30
Note ! Display of Comment or Monitoring time has to be selected under Tools / Options (see next page)
Sequence Programming
CHAP 11
31
Comment display
Programming in ST
CHAP 12
Chapter 12 Programming IN ST
2004
This manual is the exclusive property of ROBERT BOSCH GMBH, also in the case of Intellectual Property Right applications. Without their consent it may not be reproduced or given to third parties. Errors and technical modifications reserved.
CHAP 12
Logic operations with Structured Text are programmed using the commands IF / THEN / ELSE / END_IF The status of the used signals are checked using the statments TRUE or FALSE If brackets have to be used, the rules of the Boolean Algebra apply Note ! only round brackets are valid ( and ) Example : Output with Assignment (not latched)
CHAP 12
CHAP 12
CHAP 12
Call of function
CHAP 12
CHAP 12
CHAP 12
Programming in ST
CHAP 12
Bas_Manual (Instance)
Inputs: _S0 _S1 Output: _Y9
Memory Bas_Manual
Inputs: _S0 _S1 Output: _Y9
Manual_Move (FB)
Inputs VAR_INPUT left_limit right_limit END_VAR Outputs VAR_OUTPUT out_ok END_VAR
Bas_Manual_2 (Instance)
Inputs: _S2 _S3 Output: _Y10
Memory Bas_Manual_2
Inputs: _S2 _S3 Output: _Y10
CHAP 12
CHAP 12
10
2. Select instance by double clicking on it 1. Double click onto the function block in the left window
CHAP 12
11
Note Codesys offers 2 different types of SFCProgramming modes. The so called simplified mode, is not compliant to IEC61131. The other SFCMode is compliant to IEC. Before SFC Programming is started, the required mode should be activated, because it is not possible to convert it afterwards.
CHAP 12
12
folder under which the new SFCProgram is to created 2. Press the right mouse button and select Add Object in the menu
SFC in the property window and enter name of sequence module e.g. SqA_020_Pusher1
CHAP 12
13
button, press right mouse button and select StepTransition (after) in the popup menu
CHAP 12
14
button, press CTRL key and keep it pressed, then select Step element with left mouse button
CHAP 12
15
button, press CTRL key and keep it pressed, then select Step element with left mouse button
CHAP 12
16
button onto the step element Note ! If the step element is opend the first time, the programming language in which step program is to be written, can be selected
Programming in ST
CHAP 12
17
CHAP 12
18
CHAP 12
19
CHAP 12
20
CHAP 12
21
CHAP 12
22
and press the right mouse button, then select Jump or StepTransition (after)
CHAP 12
23
CHAP 12
24
Task Managment
CHAP 13
2004
This manual is the exclusive property of ROBERT BOSCH GMBH, also in the case of Intellectual Property Right applications. Without their consent it may not be reproduced or given to third parties. Errors and technical modifications reserved.
CHAP 13
Description In addition to declaring the special PLC_PRG program, you can also control the processing of your project using the task management. A Task is a time unit in the processing of an IEC program It is defined by a name, a priority and by a type determining which condition will trigger the start of the task This condition can be defined by a time (cyclic, freewheeling) or by an internal or external event which will trigger the task; e.g. the rising edge of a global project variable or an interrupt event of the controller For each task you can specify a series of programs that will be started by the task If the task is executed in the present cycle, then these programs will be processed for the length of one cycle. The combination of priority and condition will determine in which chronological order the tasks will be executed Types of Tasks
Communication
L Cycle time
Cyclic Task L S L S
Event
CHAP 13
For the execution of a Task, the following rules apply: That task is executed, whose condition has been met; i.e., if its specified time has expired, or after its condition (event) variable exhibits a rising edge If several tasks have a valid requirement, then the task with the highest priority will be executed If several tasks have valid conditions and equivalent priorities, then the task that has had the longest waiting time will be executed first. The processing of the program calls will be done according to their order (top down) in the task editor None preemtive behavier Advantage : Data consistancy Disadvantage : No fast inputs
Park
time delay
Preemtive behavier Advantage : fast inputs Disadvantage : Data consistancy is not guaranteed
Event
Task managment
CHAP 13
2. Click onto Task configuration in the middle window, press the right mouse button and select Append Task
Task managment
CHAP 13
4. Click onto Task configuration to take over the new parameters into the Task window
Task managment
CHAP 13
F2
6. Select the field Program Call and press the function key F2 to callup the program selection window
7. Select the module which is to be called by the task, in the displayed selection list
CHAP 13
Name a name for the task; with this name the task is represented in the configuration tree the name can be edited there after a mouse click on the entry or after pressing the Space key when the entry is selected Priority (031): a number between 0 and 31 whereas 0 represents the highest, 31 the lowest priority Type: Cyclic The task will be processed cyclically according to the time definition given in the field Interval Interval the period of time, after which the task should be restarted If a number is entered, then you can choose the desired time in the selection box behind the edit field in milliseconds [ms] or microseconds [s] Inputs in [ms] format will be shown in the TIME format (e.g. t#200ms) as soon as the window gets a focus change Inputs in [ms] will always be displayed as a plain number (e.g. 300) Watchdog Time > Monitoring time, after which the PLC is stopped with a Cycle time error Sensitivity> Number of times the Monitoring time can be triggered, before the PLC goes to STOP
CHAP 13
Name a name for the task; with this name the task is represented in the configuration tree the name can be edited there after a mouse click on the entry or after pressing the Space key when the entry is selected Priority (031): a number between 0 and 31 whereas 0 represents the highest, 31 the lowest priority Type: freewheeling The task will be processed as soon as the program is started and at the end of the cycle, it will be automatically restarted in a continuous loop (There is no cycle time definition) Watchdog Time > Sensitivity > Monitoring time, after which the PLC is stopped with a Cycle time error Number of times the Monitoring time can be triggered, before the PLC goes to STOP
CHAP 13
F2
Name a name for the task; with this name the task is represented in the configuration tree the name can be edited there after a mouse click on the entry or after pressing the Space key when the entry is selected Priority (031): a number between 0 and 31 whereas 0 represents the highest, 31 the lowest priority Type: triggered by event The task will be started as soon as the variable, which is defined in the Event field is changing its status from 0 to 1 Properties / Single a Global Variable / Signal is to be entered in this field, which is used to start the Task Watchdog Time Sensitivity
> >
Monitoring time, after which the PLC is stopped with a Cycle time error Number of times the Monitoring time can be triggered, before the PLC goes to STOP
Task managment
CHAP 13
Name a name for the task; with this name the task is represented in the configuration tree the name can be edited there after a mouse click on the entry or after pressing the Space key when the entry is selected Priority (031): a number between 0 and 31 whereas 0 represents the highest, 31 the lowest priority Type: triggered by external event The task will be started as soon as the onboard input (interrupt) of the L40 PLC Controller, which is defined in the Event field is changing its status from 0 to 1 Properties / Event One of the 7 interupt inputs located on the motherboard of the L40 Controller Watchdog Time Sensitivity
> >
Monitoring time, after which the PLC is stopped with a Cycle time error Number of times the Monitoring time can be triggered, before the PLC goes to STOP
Task managment
CHAP 13
10
F2
Task managment
CHAP 13
11
Note ! The library is control specific and therefore can be found in the Target directory of the selected target system
Libraries
CHAP 14
2004
This manual is the exclusive property of ROBERT BOSCH GMBH, also in the case of Intellectual Property Right applications. Without their consent it may not be reproduced or given to third parties. Errors and technical modifications reserved.
Library managment Insertion of a new library into the current project 1. Select Window / Library Manager in the menubar
CHAP 14
CHAP 14
3. Select the upper window with the left mouse button, then press the right mouse button
5. All Functions / Function blocks out of this library can now be used in the current project
Remanence
CHAP 15
2004
This manual is the exclusive property of ROBERT BOSCH GMBH, also in the case of Intellectual Property Right applications. Without their consent it may not be reproduced or given to third parties. Errors and technical modifications reserved.
CHAP 15
PLC Program
Switch Off / On Online Reset Online / Login Online / Reset (Cold)
CHAP 15
CHAP 15
If a variable is declared in a Function Block as Retain / Persistent, the complete instance of this function block is saved into the Retain / Persistent section. But only the variable which is declared as Retain/Persistent will be treated as a remanent variable. All other variables will be cleared.
If a variable is declared in a Function as Retain / Persistent the declaraqtion is ignored and the variable is treated like a non remanent variable (i.e. the Status / value of this variable is cleared, like all the other non remanent variables).
CHAP 15
If a variable is declared in a Programm as Retain / Persistent, exactly this one variable is saved into the Retain / Persistent section
Monitor
CHAP 16
2004
This manual is the exclusive property of ROBERT BOSCH GMBH, also in the case of Intellectual Property Right applications. Without their consent it may not be reproduced or given to third parties. Errors and technical modifications reserved.
CHAP 16
Sometimes it is necessary to see if a part of the program is processed or not. With the function Display Flow Control every line of the program which is process is mark in green on the left side of the window in the line number display.
Program Monitoring Enter variable list into Watch & Recipe Manager
CHAP 16
Sometimes it is necessary to find out what status / value a certain signal / variable has. Occasionally it also required towrite variable values into the PLC to test a function. This function is provided by the Watch and Recipe Manager Important note ! In Watch und Recipe Manager only Global Variabls can be entered and displayed. New variables can only be entered, if you are logged off (Online / Logout)
Program Monitoring
CHAP 16
CHAP 16
All values displayed in the Watch window are send to the Recipe Manager By double clicking onto a Variable, an input window is called up, into which new values can be entered
CHAP 16
Note ! Only the values displayed in blue color are written into the PLC
CHAP 16
Note ! Before the Trace function can be used, it has to be activated in the Target settings
CHAP 16
Monitoring of variables in the Trace window means, that the status / value of variables are monitored and recorded for a certain duration the monitored values are stored into a ring buffer (Trace buffer) If the memory of the ring buffer is full, the oldest values will be overwriten a maximum of 20 Variables can be monitored and recorded at the same time for each variable a maximum of 500 values can be recorded due to the fixed size of the ring buffer in the PLC, it is possible that with a high number of variables or with a very long variables (DWORD), less than 500 values can be recorded
CHAP 16
Trace definitions can be saved onto harddrive a saved Trace configuration can be loaded from the harddrive
Trace Name this name is displayed in the Trace window at the top right position of the Selection list Trigger Variable a boolean or an analog variable can be entered into this field if the status / value of the Trigger Variable is changing, the recording is started and the defined number of changes is displayed before and behind the Trigger point Trigger Position in this field the percentage of values to be displayed before the Trigger point can be entered. (e.g. if a value of 25 is entered, 25 % of the measured values will be displayed before the Trigger point and 75% after he trigger point. Then Trace is stopped) Trigger Level In this field the value of an analog variable can be entered, at which the trigger event occurs Trigger edge positive the trigger is started by the rising edge of a boolean trigger variable, respectively by the change of an analog trigger variable from the current to a lower value negative the trigger is started by the falling edge of a boolean trigger variable, respectively by the change of an analog trigger variable from the current to a higher value both the trigger is started by the falling and the rising edge of a boolean triger variable respectively at the passing from positive to negative or negative to positive none the trigger is not used
CHAP 16
Number of samples in this field the number of samples can be entered, after which a new recording cycle is started and the old values are overwritten by the new values Sample rate (ms) time between two recordings in milliseconds a 0 means : one scan cycle with each PLC Cyle Recording single the entered number of samples is displayed once continuous the sampling is restarted at the end of a samling cycle e.g. if you enter a 35, the first display includes the samples 1 to 35, then the next sample block (36 79) is called up automatically and so on Manual the display of the sample recording must be selected manually in the menu via the function Read Trace Variables all variables to be monitored have to be entered into this field, for a later selection in the Trace window for the fields Var 0 to Var 7 Note ! Entereing a . in the fields for the Trace variables calls up a selection of the available variables Input format : .Var_name
CHAP 16
10
CHAP 16
11
is met, the result is displayed as soon as the number of defined samples have been completed
CHAP 17
2004
This manual is the exclusive property of ROBERT BOSCH GMBH, also in the case of Intellectual Property Right applications. Without their consent it may not be reproduced or given to third parties. Errors and technical modifications reserved.
CHAP 17
CHAP 17
CHAP 17
User specific data structures Monitoring of structures of userspecific data types Status display in the program
CHAP 17
CHAP 18
Nachdruck, Vervielfltigung und bersetzung, auch auszugsweise, nur mit unserer vorherigen schriftlichen Zustimmung und mit Quellenangabe gestattet. Wir bernehmen keine Haftung fr die bereinstimmung des Inhalts mit den jeweils geltenden gesetzlichen Vorschriften. Reproduction, copying, or translation of this publication, wholly or in part, only with our previous written permission and with source credit. We assume no responsibility for agreement of the contents with local laws and regulations Bosch Rexroth AG is exempt from liability, and reserves the right to make changes at any time.
CHAP 18
CHAP 18
CHAP 18
CHAP 18
CHAP 18
CHAP 18
CHAP 18
CHAP 18
CHAP 18
CHAP 18
10
select the directory, into which you want to store the new project
CHAP 18
11
6. Drag the selected Target System with the left mouse button still
pressed onto the Project name and release the left mouse button as soon as you can see a line below the Project name
CHAP 18
12
CHAP 18
13
17. Apply new settings by 16. Enter the IPAddress of the L40 controller
to which you want to make a connection and confirm the input by pressing the Enter key
CHAP 18
14
Note ! By clicking with the right mouse button onto the icon Logic, the communication window can be called up again by selecting Properties
CHAP 18
15
CHAP 18
16
CHAP 18
17
is now integrated into IndraWorks and can be used for further processing
Language translation
CHAP 19
Nachdruck, Vervielfltigung und bersetzung, auch auszugsweise, nur mit unserer vorherigen schriftlichen Zustimmung und mit Quellenangabe gestattet. Wir bernehmen keine Haftung fr die bereinstimmung des Inhalts mit den jeweils geltenden gesetzlichen Vorschriften. Reproduction, copying, or translation of this publication, wholly or in part, only with our previous written permission and with source credit. We assume no responsibility for agreement of the contents with local laws and regulations Bosch Rexroth AG is exempt from liability, and reserves the right to make changes at any time.
Language translation
CHAP 19
1. Select function
Language translation
CHAP 19
Language translation
CHAP 19
Language translation
CHAP 19
OriginalString OriginalString Translation text Translation text OriginalComment OriginalComment Translation text Translation text
Language translation
CHAP 19
Switchover to another language 1. Select Project / Translate into another languages / View translated project
View translated project : Original text is replaced temporarily for display only Translate this project : Original text is replaced permanently and saved into the project
Command overview
CHAP 20
2004
This manual is the exclusive property of ROBERT BOSCH GMBH, also in the case of Intellectual Property Right applications. Without their consent it may not be reproduced or given to third parties. Errors and technical modifications reserved.
Command overview
CHAP 20
Identifier, Keywords
Identifiers (Variable name) Sequence of characters, numbers and underscore (_). Must start with a character or an underscore (_). More than one leading underscor or several underscores in a row are invalid. Identifiers must also not include any spaces. A minimum of 6 characters must be supported by every system. Examples of Identifiers START STOP VALVE_6 VALVE_E_7 _16E8 _Motor
Command overview
CHAP 20
Identifier, Keywords
Keywords
A keyword consist of a sequence of characters without any Spaces. Keywords must not be used for any other purposes e.g. Variable names
Keywords ACTION...END_ACTION ARRAY...OF AT CASE...OF...ELSE...END_CASE CONFIGURATION...END_CONFIGURATION CONSTANT EN ENO EXIT FALSE F_EDGE FOR...TO...BY...END_FOR FUNCTION...END_FUNCTION FUNCTION_BLOCK...END_FUNCTION_BLOCK IF...THEN...ELSIF...ELSE...END_IF INITIAL_STEP...END_STEP PROGRAMM...WITH... PROGRAMM...END_PROGRAMM R_EDGE READ_ONLY READ_WRITE REPEAT...UNTIL...END_REPEAT RESOURCE...ON...END_RESOURCE RETAIN RETURN STEP..END_STEP STRUCT...END_STRUCT TASK TRANSITION...FROM...TO...END_TRANSITION TRUE TYPE...END_TYPE VAR...END_VAR VAR_INPUT...END_VAR VAR_IN_OUT...END_VAR VAR_EXTERNAL...END_VAR VAR_ACCESS...END_VAR VAR_GLOBAL...END_VAR WHILE...DO...END_WHILE WITH Furthermore: Data type names Function names Function block names Operators of the LIST Language Operators of the ST Language
Command overview
CHAP 20
Numerical literals
Integer literals and Real literals Examples
-5 +96 628_26 Integer literals underscores between numbers must be ommitted Real literals Real literals with an Exponent Literal Base 2 Literal Base 8 Literal Base 16 Boolean Zero and One Boolean FALSE and TRUE
-5.0 0.123 12.56 6.2E 4 i.e. 6.2e 4 -2.6E + 3 i.e. -2.6e + 3 12.0E3 i.e. 12.0e3 2#1010_1010 8#156 16#FF 0 1 FALSE TRUE
String-Literals
Sequence of zero or more characters between two single quote characters ()
Example
X $ $$6.00 $$ $ $L bzw. $l $N bzw. $n $P bzw. $p $R bzw. $r Empty string with a length of zero String of the length one with character X String of the length one with a space character String of the length one with a quote character String of the length five with, $6.00 Dollar-Character $ Single quote character Line feed New line New page Carriage return
Command overview
CHAP 20
Examples Date#1996-04-6 D#1996-04-6 D#1996-04-6 TIME_OF_DAY#17 : 19 : 40.12 TOD#17 : 19 : 40.12 DATE_AND_TIME#1996-04-12-17 : 26 : 45.16 Dt#1996-01-12-17 : 26 : 45.16
Boolean Operators
Operator AND Parameter ANY_BIT Comment AND Function Example ST OUT := _S1 AND _S2 LIST LD AND ST OR ANY_BIT OR Function _S1 _S2 OUT
NOT
ANY_BIT
ST OUT := _S1 AND NOT _S2 LIST LD ANDN ST _S1 _S2 OUT
XOR
ANY_BIT
XOR-Function
Command overview
CHAP 20
Arithmetical Operators
Operator InputLIST ST Parameter ADD + ANY_NUM OutputParameter ANY_NUM Comment Addition Example ST Result := Value1 + Value2; LIST LD ADD ST SUB ANY_NUM ANY_NUM Subtraction Value1 Value2 Result
MUL
ANY_NUM
ANY_NUM
Multiplication
DIV
ANY_NUM
ANY_NUM
MOD
ANY_INT
ANY_INT
EXPT
ANY_REAL
Power of
MOVE
ANY_NUM
ANY_NUM
Assignment
ST Result := MOVE( Value1) same as Result := Value1; LIST LD Value1 MOVE Result ST Result same as LD Value1 ST Result
Command overview
CHAP 20
Compare Operators
Operator LIST ST GT > InputParameter ANY_BIT ANY_NUM STRING TIME ANY_DATE OutputParameter BOOL Comment Greater than Example ST X;= A > B; LIST LD GT ST BOOL Greater than or Equal A B X
GE
>=
LE
<=
BOOL
LT
<
BOOL
Less than
EQ
BOOL
Equal
ST X;= A = B; LIST LD EQ ST A B X
NE
<>
BOOL
not equal
Command overview
CHAP 20
Bit manipulation
Function SHL InputParameter IN: ANY_BIT N: ANY_INT IN: ANY_BIT N: ANY_INT IN: ANY_BIT N: ANY_INT IN: ANY_BIT N: ANY_INT OutputParameter ANY_BIT Comment Shift left of IN by NBit Example Value : Word := 2#0000_0000_0001_0101; N_Bit : WORD := 3; Result : WORD; ST Result := SHL (Value, N_Bit); LIST LD SHL ST Value N_Bit Result
SHR
ANY_BIT
ROL
ANY_BIT
before SHL : 0000_0000_0001_0101 after SHL : 0000_0000_1010_1000 ii i h l f hif d i 3 posiitions to the left, zeros are shifted in from the right
ROR
ANY_BIT
Command overview
CHAP 20
Type conversion
Function *_TO_** InputParameter ANY_NUM OutputParameter ANY_NUM Comment Numerical types are converted into each other * Input data type **Output data type Examplee Value_int : INT; Value_Real : REAL; ST Value_real := INT_TO_REAL(Value_int); LIST LD Value_int INT_TO_REAL ST Value_real TRUNC ANY_REAL ANY_INT Digits after the Value comma are truncated Result : REAL := 200.2345; : DINT;
ST Result := TRUNC (Value) LIST LD Value TRUNC ST Result Result = 200 BCD_TO_* ANY_BIT ANY_INT *Data type Data of the group ANY_BIT in BCD-Format is converted into the ANY_INT-Format Value_BCD : BYTE := 2#00010110; Value_INT : INT; ST Value_INT:=BCD_TO_INT (Value_BCD); LIST LD Value_BCD BCD_TO_INT ST Value_INT Value_INT = 16 *_TO_BCD ANY_INT ANY_BIT *Data type Data of the type ANY_INT-Format is converted into BCD-Format Value_BCD : BYTE ; Value_INT : INT := 16; ST Value_BCD:=INT_TO_BCD (Value_INT); LIST LD Value_INT INT_TO_BCD ST Value_BCD Value_BCD = 00010110
Command overview
CHAP 20
Numeric Functions
Function ABS InputParameter ANY_NUM OutputParameter ANY_NUM Comment Convert a number with sign into an absolute value (removes sign) Example ST Result := ABS(Value1); LIST LD ABS ST Value1 Result
SQRT
ANY_REAL
ANY_REAL
Square root
LN
ANY_REAL
ANY_REAL
natural Logarithm
LOG
ANY_REAL
ANY_REAL
Logarithm, Base 10
EXP
ANY_REAL
ANY_REAL
SIN
ANY_REAL
ANY_REAL
COS
ANY_REAL
ANY_REAL
Command overview
CHAP 20
10
Numeric Functions
Function TAN InputParameter ANY_REAL OutputParameter ANY_REAL Comment Tangent function (Radian) Example ST Result := TAN(Value1); LIST LD TAN ST ASIN ANY_REAL ANY_REAL Arcus-Sine function Value1 Result
ACOS
ANY_REAL
ANY_REAL
Arcus-Cosine function
ATAN
ANY_REAL
ANY_REAL
Arcus-Tangent function
Command overview
CHAP 20
11
Selection Function
Function SEL InputParameter G: BOOL IN0: ANY IN1: ANY OutputParameter ANY Comment Binary selection OUT = Value1, if test = False OUT = Value2, if test = True Example Pruef Value1 Value2 OUT : BOOL; : REAL; : REAL; : Real
ST OUT := SEL(test, Value1, Value2) LIST LD SEL ST test Value1, Value2 OUT
MAX
Maximum-Function ST OUT := MAX (Value1, Value2, Value3) OUT = highest value out of a list LIST LD Value1 MAX Value2 MAX Value3 ST OUT Minimum-Function OUT = smallest value out of a list ST OUT := MIN (Value1, Value2, Value3) LIST LD MIN MIN ST Value1 Value2 Value3 OUT
MIN
LIMIT
Limiter
ST OUT := LIMIT (Value_min, Zahl, VaOUT = Value_min, lue_max) if number is smaller than Value_min LIST LD Value_min OUT = Value_max, LIMIT Zahl, Value_max if number is higher ST OUT than Value_max Multiplexer OUT = W1, if select = 0; OUT = W2, if select =1 OUT = W3, if select=2 etc. ST OUT := MUX (select, W1, W2, W3, W4) LIST LD MUX ST select W1, W2, W3, W4 OUT
MUX
ANY
Command overview
CHAP 20
12
String Functions
Function LEN InputParameter STRING OutputParameter INT Comment calculates the number of characters in a string Example ST Lenght_INT := LEN(Text_STR); LIST LD LEN ST Text Lenght_INT
LEFT
STRING
Extracts characters from a string String (Text_STR) starting at the left side of a string, number of characters (Nr_INT) are extracted Extracts characters from a string String (Text_STR) starting at the right side of a string, number of characters (Nr_INT) are extracted Extracts characters from the middle of a string (Text_STR) starting at a certain position (Start_INT) a certain number of characters (Nr_INT) Combines 2 individual strings into one string
RIGHT
STRING
MID
STRING
ST Centr_STR := MID(Text_STR, Start_INT, Nr_INT); LIST LD MID ST Text_STR Start_INT, Nr_INT Centre_STR
CONCAT STRING
STRING
INSERT
STRING
Inserts into an existing string (Org_STR) another string (Ins_STR) starting at a certain position (P_INT)
ST New_STR := INSERT(Org_STR, Ins_STR, P_INT); LIST LD INSERT ST Org_STR Ins_STR, P_INT New_STR
Command overview
CHAP 20
13
String Funktions
Function DELETE InputParameter IN: STRING L, P: ANY_INT OutputParameter STRING Comment Removes from an existing string (Org_STR) starting at a certain position (Pos_INT) a certain number of characters (Nr_INT) Replaces characters in an existing string (O_STR) by a new string (N_STR), starting at a certain position (P_INT), for a number of characters (Nr_INT) Searches in an existing string (Org_STR) for a certain sequence of characters (Search_STR) and returns the start position where the search string was found. If the search string is not foung, the function returns Zero Example ST New_STR := Delete(Org_STR, Pos_INT, Nr_INT); LIST LD DELETE ST Org_STR Pos_INT, Nr_INT New_STR
STRING
ST New:= REPLACE(O_STR, N_STR, P_INT, Nr_INT); LIST LD REPLACE ST O_STR N_STR, P_INT, Nr_INT New
FIND
INT
Command overview
CHAP 20
14
Flankenerkennung
Function blockn R_TRIG F_TRIG InputParameter CLK: BOOL CLK: BOOL OutputParameter Q: BOOL Q: BOOL Comment at the rising edge at CLK set Q TRUE. at the falling edge at CLK set Q TRUE.
Timer
Function block TON InputParameter IN: BOOL PT: TIME OutputParameter Q: BOOL ET: TIME Comment Switch on delay IN PT Q ET : : : : rising edge starts timer element Delay time If time is elapsed set to TRUE actual value of timer
TOF
Switch Off delay IN PT Q ET : : : : rising edge starts timer element Delay time If time is elapsed set to TRUE actual value of timer
TP
Pulse IN PT Q ET : : : : rising edge starts timer element Delay time If time is elapsed set to TRUE actual value of timer
RTC
Real Time Clock IN : PDT : CDT: Q : rising edge, Date + Time is loaded Preset for Date + Time actual Date+ actual Time like EN
Note: If a rising edge is detected at IN, the time is set. Time is running as long as IN is TRUE
Command overview
CHAP 20
15
Counter
Function block CTU InputParameter CU: R_TRIG (BOOL) R: BOOL PV: INT OutputParameter Q: BOOL ET: TIME Comment Count Up, counts from zero to PV. CU : Count pulse (rising edge) PV : Command value for counter R : Reset (CV to 0) Q : if PV is reached, set Q to TRUE CV : actual counter value Count Down, counts from PV down to zero CD : Count pulse (rising edge) PV : Start value for counter LD : Load start value from PV into CV Q : If PV = 0, than set Q to TRUE CV : actual counter value
CTD
CTUD
QU, QD: BOOL Up / Down Counter CV: INT QU : If CV Max. value is reached set QU to TRUE QD : If CV Min. value is reached, set QD to TRUE , Rest like CTU and CTD
Exercises
CHAP 21
Chapter 21 Exercises
2004
This manual is the exclusive property of ROBERT BOSCH GMBH, also in the case of Intellectual Property Right applications. Without their consent it may not be reproduced or given to third parties. Errors and technical modifications reserved.
CHAP 21
192.168.1.11
L40_1
192.168.1.102
PC_2
192.168.1.12
L40_2
192.168.1.103
PC_3
S W I T C
192.168.1.13
L40_1
192.168.1.14
L40_2
192.168.1.15
L40_5
192.168.1.108
PC_8
192.168.1.200
Trainer1
CHAP 21
B IO K DP > Type : 16DI / 16DA ProfibusDP Master 10 I4.0 ... I5.7 Q4.0...Q5.7 Switch box
RILB PB 24 > Type : ILB PB 24 DI16 DO16 12 I60.0 ... I61.7 Q60.0...Q61.7 Robot & Transport slide
RILB PB 24 > Type : ILB PB 24 DI16 DO16 I62.0 ... I63.7 13 Q62.0...Q63.7 Press In Station
CHAP 21
CHAP 21
CHAP 21
Outputs
Signal Markers
Automatic mode manual mode Jog mode Special mode
Exercises Example 1
CHAP 21
Example 2
Exercises Example 3
CHAP 21
Exercises Example 4
CHAP 21
Exercises Example 5
CHAP 21
Exercises Example 6
CHAP 21
10
Exercises
CHAP 21
11
& O >=1
S20 S21
& + = Y7
Exercises
CHAP 21
12
&
&
>=1
Y8
Exercises
CHAP 21
13
& O
S4 S5
&
S16 S19
Transportation Slide
I61.1 Q61.0 Q60.7 I61.2
I60.7
I61.0
Q60.0
I60.0 Q60.3
I62.6
Q62.1
Q62.5 I62.5
CHAP 21
14
Q60.2
CHAP 21
15
Symbol name
301S101B 301S101A 301S201A 301S201B 301S301A 301S301B 301S401A
Robot Rotation Arm at top Robot Rotation Arm at bottom Robot Rotation Arm at right Robot Rotation Arm at left Robot Rotation Arm at front Robot Rotation Arm at rear Robot Gripper closed
Comment
Outputs Address
Q60.0 Q60.1 Q60.2 Q60.3 Q60.4 Q60.5 Q60.6
Symbol name
301Y101B 301Y101A 301Y201B 301Y201A 301Y301A 301Y301B 301Y401A
Move Robot Rotation Arm Up Move Robot Rotation Arm Down Move Robot Rotation Arm to the left Move Robot Rotation Arm to the right Move Robot Arm to the front Move Robot Arm to the back Close Robot Gripper
Comment
Symbol name
401S101B 401S101A 401S101 401S201 400S600
Transportation slide at front Transportation slide at rear Transportation slide occupied at front Transportation slide occupied at rear PressIn ready
Comment
Outputs Address
Q60.7 Q61.0 Q61.1
Symbol name
401Y101B 401Y101A 400Y600
Transportation slide backward Transportation slide forward Enable signal Robot station ready
Comment
CHAP 21
16
Symbol name
501S101B 501S101A 501S201B 501S201A 501S301B 501S301A 501S101 501S201 500S600
Safety gate at top Safety gate at bottom Horizontal unit at front Horizontal unit at rear Press In unit at top Press In unit at bottom Part present at front Part present at rear Robot ready
Comment
Outputs Address
Q62.0 Q62.1 Q62.2 Q62.3 Q62.4 Q62.5 Q62.6
Symbol name
501Y201B 501Y201A 501Y101B 501Y101A 501Y301B 501Y301A
Safety gate up Safety gate down Pusher forward Pusher backward Press In unit up Press In unit down Enable signal Press InStation ready
Comment
500Y600
CHAP 21
17
Manual_Move_Robot >
Base_Move
Work_Move >
CHAP 21
18
Switch assignment Switch box _S7 _S6 _S5 _S4 _S3 _S2 _S1 _S0
Jog Mode
Jog
Door
Start
Jog Work
Jog Base
EStop
Manual Auto
_S15
_S14
_S13
_S12
_S11
_S10
_S9
_S8
Gate Up Down
PressIn Up Down
Robot Up Down
CHAP 21
19
Switch assignment Switch box _S7 _S6 _S5 _S4 _S3 _S2 _S1 _S0
Jog Mode
Jog
Door
Start
Jog Work
Jog Base
EStop
Manual Auto
_S15
_S14
_S13
_S12
_S11
_S10
_S9
_S8
Gate Up Down
PressIn Up Down
Robot Up Down
Callup PLC_PRG
Manual_Move_Stat120
Instances of BaseMoveFB
>
>
Exercise
CHAP 21
20
Exercise
CHAP 21
21
CHAP 21
22
CHAP 21
23
CHAP 21
24
CHAP 21
25
CHAP 21
26
CHAP 21
27