Home
User Manual
Contents
1. Command C AWIND WS Vevstem224calc exe Fr Arguments Menu string Cald Delete Modify eae Press Add The name you gave to the new tool is now displayed in the list box at the top of the panel General Graphic Editor Text Editors Language Directories Tools l Command Arguments Menu string And in the Tools menu as well Fiil hed bod 22 LogicLab user manual 4 1 4 2 LOGI IM MANAGING PROJECTS This chapter focuses on LogicLab projects A project corresponds to a PLC application and includes all the required elements to run that application on the target device including its source code links to libraries informa tion about the target device and so on The following paragraphs explain how to properly work with projects and their elements CREATING A NEW PROJ ECT To start a new project click New project inthe File menu of the LogicLab main win dow The same command is available in the Main toolbar and if no project is open in LogicLab s welcome page This causes the following dialog box to appear Sew project Project Name Directory C Documents and Settings Default User Desktop Target selection Select the target for a new project Options Case sensitive C You are required to enter the name of the new project in the Name control The string you enter will also be the name of the folder which will contain all the
2. 9 Automatic variables flooo2 the same password applies to all objects 5 2 VARIABLES There are two classes of variables in LogicLab global variables and local variables This paragraph shows you how to add to the project edit and eventually remove both global and local variables 5 2 1 GLOBAL VARIABLES Global variables can be seen and referenced by any module of the project 5 2 1 1 CLASSES OF GLOBAL VARIABLES Global variables are listed in the project tree inthe Global variables folder where they are further classified according to their properties as Automatic variables Mapped vari ables Constants and Retain variables Automatic variables include all the variables that the compiler automatically allocates to an appropriate location in the target device memory Mapped variables on the other way do have an assigned address in the target device logical addressing system which shall be specified by the developer Constants list all the variables which the developer declared as having the CONSTANT attribute so that they cannot be written Retain variables list all the variables which the developer declared as having the RE TAIN attribute so that their values are stored in a persistent memory area of the target device 5 2 1 2 GROUPS OF GLOBAL VARIABLES You can further categorize the set of all global variables by grouping them according to application specific criteria In order to define a new group
3. EE am ff ee User Manual AXEL Revision 5 0 February 2013 LOGIC LAB LogicLab User Manual Revision 5 0 2013 02 12 Published by Axel S r l Via del Cannino 3 21020 Crosio della Valle VA Axel S r l 2010 All Rights Reserved lI LogicLab user manual LOGI LAB Contents 1 Overview 1 1 1 The workspace 1 1 1 1 The output window 2 1 1 2 The status bar 2 1 1 3 The document bar 2 1 1 4 The watch window 3 1 1 5 The library window 3 1 1 6 The workspace window 5 11 2 The source code editors 6 2 Quick start 7 2 1 Setup procedure 7 2 2 Using the IDE 8 2 3 A more complex example 13 3 Using the environment 15 3 1 Layout customization 15 32 Toolbars 15 3 2 1 Showing hiding toolbars 15 3 2 2 Moving toolbars 15 3 3 Docking windows 17 3 3 1 Showing hiding tool windows 17 3 3 2 Moving tool windows 18 3 4 Working with windows 19 3 4 1 The document bar 19 3 4 2 The window menu 20 3 5 Full screen mode 20 3 6 Environment options 21 4 Managing projects 23 4 1 Creating a new project 23 4 2 Uploading the project from the target device 23 4 3 Saving the project 25 4 3 1 Persisting changes to the project 25 4 3 2 Saving to an alternative location 25 4 4 Managing existing projects 26 4 4 1 Opening an existing LogicLab project 26 4 4 2 Editing the project 26 4 4 3 Closing the project 26 Ie LogicLab user manual 1 LOGI I 4 5 4 6 4 7 4 8 4 8 1 4 8 2 4 8 3 5 5 1 s
4. Project rE mm J Project Definitions Ez Resources k 5 so Definitions C TypeDefs S J Structures Fr LData r actual r max x Project ot Project Definitions Ez Resources IE Configuration Modbus objects 4 EEPROM Parameters Pst Status variables 5 Enums BIOS Parameters ER Menu BE 1 0 Mapping Alarms Help r min J Enumerations J SubRanges untzi C Macro Jh Stati 3 Input variables 2 Local variables J Actions Exec Initialize 5 JJ Transitions if NotEnabled Hik NotRunning Tt NotStopped 1t Running amp JJ Functions Wait I Global variables J Automatic variables 2 1 0 variables 9 Onda quadra r period r tau e valueFilt r valueRef L Constants C Retain variables Tasks Timed fa Fast Background fa Main Boot Init aem m E OO t lt 1 1 6 1 PROJECT The Project panel contains a set of folders Program Function blocks Functions each folder contains Program Organization Units briefly POUs see Paragraph 5 1 of the type specified by the folder name Global variables itis further divided in Variables I O Variables Constants and Retain variables Each folder contains global variables of the type specified by the folder name see Paragraph 5 2 Tasks this item lists the system tasks and the programs ass
5. Select the program language You need to restart the program for the change to take effect Seles Tools You can add up to 16 commands to the Tools menu These commands can be associated with any program that will run on your operating system You can also specify arguments for any command that you add to the Tools menu The following procedure shows you how to add a tool to the Tools menu LogicLab user manual 21 LOGIC LAB 1 Type the full path of the executable file of the tool in the Command text box Other wise you can specify the filename by selecting it from Windows Explorer which you open by clicking the Browse button General Graphic Editor Text Editors Language Directories Tools la Command i Arguments Menu string 2 Inthe Arguments text box type the arguments if any to be passed to the execut able command mentioned at step 1 They must be separated by a space 3 Enter in Menu string the name you want to give to the tool you are adding This is the string that will be displayed in the Tools menu 4 Press Add to effectively insert the new command into the suitable menu 5 Press OK to confirm or Cancel to quit For example let us assume that you want to add Windows calculator to the Tools menu Fill the fields of the dialog box as displayed ed General Graphic Editor Text Editors Language Directories Tools l
6. Cut Copy and Paste operations of a single block as well as of a set of blocks Drag and drop All the mentioned functions are accessible through the Edit menu or through the Main toolbar 6 3 9 MODIFYING PROPERTIES OF BLOCKS Click Increment pins inthe Scheme menu or press the Inc pins button in the FBD toolbar to increment the number of input pins of some operators and embedded func tions K m 4 Click Enable EN ENO pins in the Scheme menu or press the EN ENO button in the FBD toolbar to display the enable input and output pins MUK Click Object Instance name in the Scheme menu or press the FBD properties but ton in the FBD toolbar to change the name of an instance of a function block 6 3 10 GETTI NG I NFORMATI ON ON A BLOCK You can always get information on a block that you added to an LD document by selecting it and then performing one of the following operations Click Object gt 0pen source in the Scheme menu or press the View source button in the FBD toolbar to open the source code of a block Click Object properties in the Scheme menu or press the FBD properties button in the FBD toolbar to see properties and input output pins of the selected block 6 3 11 AUTOMATIC ERROR RETRI EVAL The LD editor also automatically displays the location of compiler errors To reach the block where a compiler error occurred double click the corresponding error line in the Output bar Logi
7. EN ENO VAR INPUT VAR OUTPUT EN BOOL 1 ENO BOOL END_VAR END_VAR LogicLab user manual 193 LOGI I See the Modifying properties of blocks section to know how to add these pins to a block When these variables are used the execution of the operations defined by the block are controlled according to the following rules 1 If the value of EN is FALSE when the block is invoked the operations defined by the function body are not executed and the value of ENO is reset to FALSE by the program mable controller system 2 Otherwise the value of ENO is set to TRUE by the programmable controller system and the operations defined by the block body are executed 11 3 4 2 JUMPS Jumps are represented by a Boolean signal line terminated in a double arrowhead The Signal line for a jump condition originates at a Boolean variable or at a Boolean output of a function or function block A transfer of program control to the designated network label occurs when the Boolean value of the signal line is TRUE thus the unconditional jump is a special case of the conditional jump The target of a jump is a network label within the program organization unit within which the jump occurs Symbol Example Explanation TRUE Labels gt Unconditional J ump ka Conditional Jump Label gt ready gt l Example Jump Condition Network 11 3 4 3 CONDITIONAL RETURNS Conditional returns from functions and function blo
8. er bt Sumbel Woe 2 lent INT ENT Alo 3 fh Stali Stati Asio Ma i 000z Ladder Logic x E or press the F8 key Man A E int gt lund INT Aulo Ha teach Auribuie Si yy Symbol be uy fa Welue TE Frc hens 9 1 2 4 ADDING A VARIABLE FROM THE PROJECT TREE In order to add a variable to the Watch window you can select it in the project tree and then either drag and drop it in the Watch window Frock EB Poent A Deihi E EM pepe Pivec 3479 Progam AS Fast EJ Irit S E Main Local variables ilei IbE crema bStati J Furiction blocks Tr Schema isi Functions Global vaiabler 5 37 Atomai vatiabley jdi reeRuiniCouritey J Analog oul 3 BE i FT 10 vaiiables or press the F8 key Project OER Pioect R Detintions E EA pepe Piowet Progam AS Fast EJ I rit E E Main E fl Local variables ile bBEchere Ib Stati J Furiction blocks Or Schema ast 1 Furictions s Global vatiables J domaie variabler di reeRuiniCouritey LQ 4nalag out 3 Vi z 170 vaiiabl OL kl 100 K Watch gt Hin RAA Symbol Wal gee K Waihi gt er AR fi Symbol Wel ner i LogicLab user manual LOGI I 9 1 2 5 ADDING A VARIABLE FROM THE WATCH WINDOW TOOLBAR You can also click on the appropriate item of the Watch window inner toolbar in order to add a variable to it Watch
9. th ey S K ml El HEL i Name Type Address FEER 1 freeRunCounter DINT Auto x Bp dona variables 2 iner INT Auto An Cu Cl flan Tra akki UINT Auto 4 kinilner INT Auto An E Lopp re ree Runt punter DINT 5 period REAL MD1 11 Or eS iner INT E tau REAL MD1 9 Or i li LINT 7 valueFilt REAL WMA Or 8 valueRef REAL MD1 10 Or lni T AE a i Gy Fido projesi Chl Shite pe In e en SURE J Medium penod REAL By Fincher nocia FE REN wall Funchons 7 valuerut REAL LogicLab user manual 85 LOGIC LAB 86 LogicLab user manual LOGI IM 7 COMPILING Compilation consists of taking the PLC source code and automatically translating it into binary code which can be executed by the processor on the target device 7 1 COMPILING THE PROJ ECT Before starting actual compilation make sure that at least one program has been as Signed to a task When this pre condition does not hold compilation aborts with a meaningful error mes sage Output x error P2068 No task defined for the application 0 warnings 1 errors In order to start compilation click the Compile button in the Project toolbar ee _ E a T pit EEE n x ju T HEB oe ee ba le Gia ah fk ae ae eB Alternatively you can choose Compile from the Project menu or press F7 on your key board ik view Project Debug Communication Variables Window Tools d ei
10. DEH ESAERAN ais Su Oaciinscooe z HAN eB eta fa eos So made Sant i eee ee eer a eee a ee eee eee wee ae cee wee a m F 9 2 5 4 VIEWING SAMPLES If you click on the Show samples item in the Oscilloscope toolbar the tool highlights the single values detected during data acquisition Oscillascape x H Aa Egang I b H med div 2000 00 You can click on the same item again in order to go back to the default view mode Oslo x HRS eee KE alee eu LogicLab user manual 113 oe 9 2 5 5 TAKING MEASURES The Oscilloscope includes two measure bars which can be exploited to take some meas ures on the chart in order to show and hide them click on the Show measure bars item in the Oscilloscope toolbar Oscilloscope x ged Ed E kk ED uo amp SE If you want to measure a time interval between two events you just have to move one bar to the point in the graph that corresponds to the first event and the other to the point that corresponds to the second one Daions x BAG Beak lt a aji i E Su sep ence h el cel coe Deed Leave EE jaaha aanihin msde 2000 00 T re chl 12456 14 re ma div 7 J Time diff 12456 14 ms You can use a measure bar also to read the value of all the variables in the Oscilloscope at a particular moment move the bar to the point in the graph which corresponds to the instant you want to observe Oscilloscope HA AXA AA E L a gt T i mefdiv 1000 0
11. Find in project EJ Filters Program Vanables User Types Function blocks Description Function Types Match whole word only Match case Find what Local Al Fiter Ohrt browser Poan ae Begen Fie Furchon ble Standard functione Operates U rT es Hare gt Funalian Piogamr Function backs Funchans I HibeT obit SA ae oe tran Tas aa _ Match whole F_TRIG ThermiMadel lal J FFD TOF C Match case Haid ol Library bi atiieB be ati TusFibet a J MaiiByscaa Vector yo calar Pulse Word od it Yat lipe F_TRIG Word od pre Al Cancel ok I Select one of the values listed in the Location combo box so as to specify a con straint on the location of the objects to be inspected Find in project Find what Location Bisi Filters ect Progra Uzer Types Parameters Funct Aux Sources Function Types Match whole word only Match case The frame named Filters contains 7 checkboxes each of which if ticked enables research of the string among the object it refers to Tick Match whole word only if you want to compare your string to entire word only Tick Match case if you want your search to be case sensitive Press Find to start the search otherwise click Cancel to abandon LogicLab user manual LOGI IM Find in project Filters Program Variables User Types F
12. Object name MainProg PROGRAM PaT yp Code type Cancel Finally you can create a duplicate of the POU in this way 1 Select Duplicate from the contextual menu or the Project menu ER Poea Pick sample Project E a Programs it __ _ Function Edit source Function Program properties E Global w BR gt Auto Duplicate program he FO w Delete program Cons F Fetal Export program to library Tasks Copy name Crypt 2 Enter the name of the new POU and confirm 5 1 3 DELETING POUS Follow this procedure to remove a POU from your project 1 Open the folder in the Project tab of the workspace that contains the object you want to delete by double clicking the folder name LogicLab user manual 35 LOGIC LAB 2 Right click the name of the object you want to delete A context menu appears re ferred to the selected object ER Project Definitions amp PlcE xample Project J Programs 9 Functic Edit source Functic Program properties Global a Tasks Duplicate program Delete program bh Export program to library Copy name Ctrl C 3 Click Delete object in the context menu then press Yes to confirm your choice Delete the selected PLC Object Type Program Mame Main 5 1 4 SOURCE CODE ENCRYPTION You may want to hide the source code of one or more POUS LogicLab lets you encrypt POUs and protect them with a pass
13. 72 LogicLab user manual LOGI I This causes a dialog box to appear which lets you type the label you want to associate with the selected network Network label l E New network label Laber E Ok Cancel ok If you press OK the label is printed in the top left hand corner of the selected network Lahelx 6 4 4 INSERTING AND CONNECTING BLOCKS This paragraph shows you how to build a network Add a block to the blank network by applying one of the following options Click Object gt New in the Scheme menu Press the New block button in the FBD toolbar which causes a dialog box to appear listing all the objects of the project then choose one item from the list If the block is a constant a return statement or a jump statement you can directly press the relevant buttons in the FBD toolbar Drag the selected object to the suitable location For example global variables can be taken from the Workspace window whereas standard operators and embedded func tions can be dragged from the Libraries window whereas local variables can be se lected from the local variables editor Repeat until you have added all the blocks that will make up the network Then connect blocks Click Connection mode inthe Edit menu or press the Connection button in the FBD toolbar or simply press the space bar of your keyboard Click once the source pin then move the mouse pointer to the destination pin the FBD edito
14. ADD d Condition af eee None ID k ms ADD 1 Trigger For ST k 1 After 0 The same procedure applies to all the variables you wish to inspect LogicLab user manual 127 LOGIC Se 9 5 2 4 OPENING A TRIGGER WINDOW FROM AN FBD MODULE Let us assume that you have an FBD module also containing the following instructions XI Tihany Let us also assume that you want to know the values of c D and K just before the ST k Instruction is executed Provided that you can never place a trigger in a block representing a variable such as you must select the first available block preceding the selected variable In the example of the above figure you must move the cursor to network 3 and click the ADD block You can click the Set Remove trigger button in the Debug bar gt In both cases the color of the selected block turns to green a white circle with a number inside appears in the middle of the block and the related trigger window pops up or you can press the F9 key 4 I p salir 128 LogicLab user manual LOGIC When preprocessing FBD source code the compiler translates it into IL instructions The ADD instruction in network 3 is expanded to LD k ADD 1 ST K When you add a trigger to an FBD block you actually place the trigger before the first Statement of its IL equivalent code 9 5 2 5 ADDING A VARIABLE TO A TRIGGER WINDO
15. ES eh Symbol sumi 67 1034 REAL BE Value You shall type or select by browsing the project symbols the name of the variable and its location where it has been declared Add item to watch window E Symbol name sumw2 Browse Location Medium 9 1 3 REMOVING A VARIABLE If you want a variable not to be displayed any more in the Watch window select it by clicking on its name once then press the Del key watch x ek p E Symbol value Type Location me IMPS FALSE BOL global mes IMPS TRUE BOL global Brow global x watch Pea a Symbol value Type Location mm MNF FALSE BOL global mm INP TRUE Bm global 9 1 4 REFRESHMENT OF VALUES 9 1 4 1 NORMAL OPERATI ON Let us consider the following example Main EJ Medium Watch _ _ a led far Value sumlQ2 0 771999 REAL k 32 UINT LogicLab user manual 101 es a ee LAB The watch window manager reads periodically from memory the value of the variables However this action is carried out asynchronously that is it may happen that a higher priority task modifies the value of some of the variables while they are being read Thus at the end of a refreshment process the values displayed in the window may refer to dif ferent execution states of the PLC code 9 1 4 2 TARGET DISCONNECTED If the target device is disconnected the Va ue column contains three dots bho Dhaest PS
16. Integer literals can also be represented in base 2 8 or 16 The base Is in decimal notation For base 16 an extended set of digits consisting of letters A through F is used with the conventional significance of decimal 10 through 15 respectively Based numbers do not contain any leading sign or Boolean data are represented by the keywords FALSE Or TRUE Numerical literal features and examples are shown in the table below Feature description Examples Integer literals 12 0 123 986 Real literals 12 0 0 0 0 4560 1 34E 12 or 1 34e 12 Real literals with exponents 1 0E 6 or 1 0e 6 1 234E6 or 1 234e6 2 11111111 256 decimal 2 11100000 240 decimal 8 377 256 decimal 8 340 240 decimal 16 FF or 16 ff 256 decimal 16 E0 or 16 e0 240 decimal Boolean FALSE and TRUE FALSE TRUE Base 2 literals Base 8 literals Base 16 literals 11 1 4 2 CHARACTER STRING LITERALS A character string literal is a sequence of zero or more characters prefixed and terminated by the single quote character The three character combination of the dollar sign followed by two hexadecimal digits Shall be interpreted as the hexadecimal representation of the eight bit character code Example Explanation va Empty string length zero A String of length one containing the single character A an String of length one containing the space character ae String of length one containing the single quote character 168 LogicLab user man
17. Open gros el Purbe Saban 8 LogicLab user manual 5 LOCGIC Insert the new project name for example PIcExample and choose the destination folder then press OK VPLC1 virtual target has been selected for this project Logi cLab s workspace looks now like in the picture shown at step 2 that is all operators and target variables are shown preprocessing status log has been printed in the output window Project PicE sample Name Directory L PrTraining s Target selection Select the target for a new project VPLCI 1 0 x Options Case sensitive To add a new empty program to the project select New program from the menu Pro ject gt New object yaw BES rw Communkadon Tags Help B Mewa Nempogam i is Heri HERA k New tinction act i New aiiaole i Piger EE Fli taal gi PLU bed properties Al Enle Obect Bimmer Comple Fy Ba brary menager Recompie al Genet redeinbulabl source modue Import object from laa Fea ences Select baget piana Choose the ST language insert the new program name for example Main and press OK It is also possible to assign here the program to one of the available tasks Language IL Name M ain Task Assign to Cancel LogicLab user manual 9 LOGI LAB LogicLab shows now the editor window of the Main program object On the top of the window t
18. Code No code ef Hame Comment Select True if you want this transition to be constantly cleared False if you want the PLC program to keep executing the preceding block Instead if you select Variable the transition will depend on the value of a Boolean vari able Click the corresponding bullet to make the text box to its right available and to specify the name of the variable To this purpose you can also make use of the objects browser that you can invoke by pressing the Browse button shown here below Click OK to confirm or Cancel to quit without applying changes 6 5 6 ASSIGNING CONDITIONAL CODE TO A TRANSITION This paragraph explains how to specify a condition through a piece of code and how to assign it to a transition LogicLab user manual 77 LOGI LAB 6 5 6 1 WRITING THE CODE OF A CONDITION Start by opening an editor following one of these procedures Click Code object gt New transition in the Scheme menu Right click on the name of the SFC POU in the Workspace window then select the New transition command from the context menu that appears In either case LogicLab displays a dialog box similar the one shown in the following pic ture rr al Cancel Languages f IL FED Lo ST SFC Note that you can use any language except SFC to code a condition Select one of the languages and type the name of the new condition in the text box at the bottom of the dialog
19. EzE SH nibalize _ Di Netsiopped From the list shown in the Code N box select the name of the action you want to execute if the step is active You may also choose from the list shown in the Code P Pulse box the name of the action you want to execute each time the step becomes active that is the action is executed only once per step activation regardless of the number of cycles the step remains active Confirm the assignments by pressing OK In the SFC schema action to step assignments are represented by letters on the step block action N by letter N in the top right corner action P by letter P in the bottom right corner 76 LogicLab user manual LOGI IM If later you need to edit the source code of the action you can just double click these letters Alternatively you can double click the name of the action in the Actions folder of the Workspace window 6 5 5 SPECIFYING A CONSTANT A VARIABLE AS THE CONDITION OF A TRANSITION As stated in the relevant section of the language reference a transition condition can be assigned through a constant a variable or a piece of code This paragraph explains how to use the first two means while conditional code is discussed in the next paragraph First of all double click the transition you want to assign a condition to This causes the following dialog box to appear SFC Block properties my x Value iy i True False Cancel i Variable
20. Functions C Global variables El Tasks Fast a Init Add program Task properties 2 Select the program you want the task to execute from the list which shows up and confirm your choice Object browser Programs Filters Hame e uia Symbol location All Library Wars type HIV 44 LogicLab user manual LOGI IM The program has been assigned to the task as you can See in the project tree EA Project amp Definitions j CEO Ee e o o u E PicExample Project E Programs Mair Furiction blocks Functions Global variables Note that you can assign more than a program to a task From the contextual menu you can sort and eventually remove program assignments to tasks El Tasks Y Fast S Slow Remove program Weve eI Move oat 5 3 2 TASK CONFIGURATION Depending on the target device you are interfacing with you may have the chance to configure some of the PLC tasks settings 1 Select the Task configuration item in the contextual menu which pops up if you right click on the name of the task you want to configure Tasks z toe ti A Add program CES Task properties a Task configuration k 2 Inthe Task configuration window you can edit the task execution period Task configuration Set task period Task period ms 10 5 4 DERIVED DATA TYPES The Definitions section o
21. Libtsiy Were typo I Select all Select none Cancel Longo abeste 3 Select the tab of the type of the object s you want to import You can also make Simple queries on the objects in each tab by using Filters However note that only the Name filter actually applies to libraries To use it select a tab then enter the name of the desired object s even using the wildcard if necessary 4 Select the object s you want to import then press the Import object button 5 When you have finished importing objects press indifferently OK or Cancel to close the Library browser 4 8 3 1 UNDOING IMPORT FROM A LIBRARY When you import an object in a LogicLab project you actually make a local copy of that object Therefore you just need to delete the local object in order to undo import LogicLab user manual 31 LOGIC LAB 32 LogicLab user manual 5 1 LOGIC LAB MANAGING PROJECT ELEMENTS This chapter shows you how to deal with the elements which compose a project namely Program Organization Units briefly POUs tasks derived data types and variables PROGRAM ORGANI ZATION UNITS This paragraph shows you how to add new POUs to the project how to edit and eventu ally remove them 5 1 1 CREATING A NEW PROGRAM ORGANI ZATION UNIT 1 Select the New object item in the Project menu aoe Debug Communication Tools Help New object X New program New function block New func
22. This section is a table consisting of a row for each variable you dragged in You can drag into the trigger window only variables local to the module where you placed the relative trigger or global variables or parameters You cannot drag variables declared in another program or function or function block T LogicLab user manual 123 LOGI I 9 5 1 5 REFRESH OF THE VALUES Let us consider the following example a ey Watct Type Address Array Init value Attribute Descriptior UINT Auto No Symt Trigger n 0 at MAIN 5 rn Condition None Trigger For The value of variables is refreshed every time the window manager is triggered that is every time the processor executes the instruction marked by the green arrowhead How ever you can set controls in order to have variables refreshed only when triggers satisfy the more limiting conditions you define Note that the value of the variables in column Symbol is read from memory just before the marked instruction in this case the instruction at line 5 and immediately after the previous instruction the one at line 4 has been performed Thus in the above example the second ST statement has not been executed yet when the new value of a is read from memory and displayed in the trigger window Thus the result of the second ST a is 1 9 5 1 6 TRIGGER WINDOW CONTROLS This paragraph deals with the trigger window controls which allows you to better
23. clive Description Modbus Protocol LogicLab user manual 91 LOGIC 3 Fill in all the protocol specific settings e g the address or the communication timeout that is how long LogicLab must wait for an answer from the target before displaying a communication error message Device Link Manaber Confie va 22 i Curent relecied pioloca Modbus Protocol F blodbus F ModbusTCP Y Pcie Modbus Config 4 14 Communication Device Link Manager Config vB 2 Part COMI ir Current selected protocol Modbus Eaudrale J0 Protocals Active Active Fiama settings MEA Y ModbusTCP Y PCDey i ee ee i marla Deszipion Modbus Probocal Pinlocel Modbus fode i I Description Modbus Protocol Bue Timecu 1000 C Enable remote communication Sener rane Enable modem communcshon Dia number 4 Apply the changes you made to the communication settings Device Link Manager Config v8 2 IK Curent selected protocol Modbus Protocols Active Y Modbus Active W ModbusTCP Y PCDev Description Modbus Protocol Now you can establish communication by clicking Connect in the Communication menu or by pressing the Connect button in the Project toolbar Communication Tools Help mmm f 92 LogicLab user manual E am a ee LAB 8 1 1 SAVING THE LAST USED COMMUNI CATION PORT When you connec
24. follow this procedure Ie LogicLab user manual 37 LOGIC LAB 1 Select Group from the Variables menu note that this menu is available only if the Global variables editor is open Sime Window 3l L Grwp Ihe 1 freeRuntounte el Ingert IL Th 2 Enter the name of the new variable group then click Add Variables groups Group name Cycle Analog out 3 Onda quadra Remove 3 You can now use the variable group in the declaration of new global variables 5 2 1 3 CREATING A NEW GLOBAL VARIABLE Apply the following procedure to declare a new global variable 1 Select New object in the Project menu Debug Communication Variables Window Tools Help a 1000 I C E opy Object New function block om New function KA Fes Duplicate variable New variable ad Delete variable a Come 2 Select New variable from the menu that shows up Debug Communication Yariables Window Tools Help New object New program 1 eS 4 Sg Copy Object New function block d New function T Duplicate variable New variable Automatic y SK anes INT ate variable SE properties REAL SMD SEA ject Browser REAL hin etain 3 Choose the class of the variable you want to declare Automatic variables Mapped variables Constants or Retain variables Debug Communication Variables Window Tools Help New object New program j eS Sai Copy Object New function block
25. 0013 ELSIF aout3 lt 2048 THEN 0014 incr TO INT val0 0015 END_IF 0016 0017 Analog output 0 analog inp 0 analog inp 1 0018 0019 5 Fetal ainp0 ainpl 0020 0021 SFC state logic 0022 0023 fbStatif enab inpl0 run inpll stop inpl2 0 0024 i 0025 0026 SS 0027 Red cursor Blue cursor wa ET LogicLab user manual 149 LOGIC J Not all the ST instructions support triggers For example it is not possible to place a trig ger on a line containing a terminator such aS END_IF END_FOR END_WHILE etc 9 6 2 8 ADDING A VARIABLE TO THE GRAPHIC TRIGGER WINDOW FROM AN ST MODULE In order to get the diagram of a variable plotted you need to add it to the Graphic trig ger window To this purpose select a variable by double clicking it and then drag it into the Variables window that is the lower white box in the pop up window The variable now appears in the Track column 4 id LENT Auto No MAINST 6 i l SSNs tae cag Si The same procedure applies to all the variables you wish to inspect Once the first variable is dropped into a graphic trace the Graphic properties window is automatically shown and allows the user to setup sampling and visualization properties 9 6 2 9 REMOVING A VARIABLE FROM THE GRAPHIC TRIGGER WINDOW If you want to remove a variable from the Graphic trigger window select it by clicking its name once then press the Del
26. 10 1 6 10 1 7 10 1 8 10 1 9 10 1 10 10 1 11 10 2 10 2 1 10 2 2 10 2 3 10 2 4 10 2 5 10 2 6 10 2 7 11 11 1 11 1 1 ILI 11 1 3 11 1 4 11 15 11 1 6 114 11 2 11 2 1 11 2 2 11 2 3 11 3 11 3 1 11352 133 11 3 4 11 4 Debugging with the graphic trigger window LogicLab reference Menus reference File menu Edit menu View menu Project menu Debug menu Communication menu Scheme menu Variables menu Definitions menu Window menu Help menu Toolbars reference Main toolbar FBD toolbar LD toolbar SFC toolbar Project toolbar Network toolbar Debug toolbar Language reference Common elements Basic elements Elementary data types Derived data types Literals Variables Program Organization Units IEC 61131 3 standard functions Instruction List IL Syntax and semantics Standard operators Calling Functions and Function blocks Function Block Diagram FBD Representation of lines and blocks Direction of flow in networks Evaluation of networks Execution control elements Ladder Diagram LD LogicLab user manual LOGI LAB 143 153 153 153 154 154 155 156 156 157 158 158 158 158 159 159 160 161 162 163 164 164 165 165 165 165 166 168 169 172 175 188 188 189 190 191 191 192 192 193 195 E Ie T VII 11 4 1 11 4 2 11 4 3 11 4 4 11 4 5 11 5 11 5 1 115 2 11 6 11 6 1 11 6 2 11 6 3 11 7 a 11 7 2 V
27. 16 8000 out 32768 TO_ DINT Conversion to DINT 32 bit signed integer 1 Any numerical type DINT out TO DINT 10 0 J out 10 out TO_DINT 16 FFFFFFFF out 1 LogicLab user manual Description Number of operands Input data type Output data type Examples Description LOG ee I Number of operands 1 Input data type Output data type Examples Description Number of operands 1 Input data type Output data type Examples Description TO UDINT Conversion to UDINT 32 bit unsigned integer 1 Any numerical type UDINT Out lt TO _UDINT 10 0 J gt our 10 out TO_UDINT 16 FFFFFFFF out 4294967295 TO BYTE Conversion to BYTE 8 bit string Any numerical type BYTE out TO_BYTE 1 out 16 FF out TO _BYTE 164100 15 out 16 00 TO WORD Conversion to WORD 16 bit string Any numerical type WORD out TO_WORD 1000 0 out 16 03E8 out TO_WORD 32768 out 16 8000 TO DWORD Conversion to DWORD 32 bit string Number of operands 1 Input data type Output data type Examples Description Any numerical type DWORD out TO_DWORD 10 0 out 16 0000000A out TO _DWORD 1 out 1LO FFFFFFFF TO_REAL Conversion to REAL 32 bit floating point Number of operands 1 Input data type Output data type Examples Any numerical type REAL out TO_REAL 1000
28. 2 6 5 3 6 5 4 6 5 5 6 5 6 6 5 7 6 5 8 6 6 6 6 1 6 6 2 6 6 3 6 6 4 6 6 5 6 6 6 Fal Tii LOGI I Bookmarks Ladder Diagram LD editor Creating a new LD document Adding Removing networks Labeling networks Inserting contacts Inserting coils Inserting blocks Editing coils and contacts properties Editing networks Modifying properties of blocks Getting information on a block Automatic error retrieval Function Block Diagram FBD editor Creating a new FBD document Adding Removing networks Labeling networks Inserting and connecting blocks Editing networks Modifying properties of blocks Getting information on a block Automatic error retrieval Sequential Function Chart SFC Editor Creating a new SFC document Inserting a new SFC element Connecting SFC elements Assigning an action to a step Specifying a constant a variable as the condition of a transition Assigning conditional code to a transition Specifying the destination of a jump Editing SFC networks Variables editor Opening a variables editor Creating a new variable Editing variables Deleting variables Sorting variables Copying variables Compiling Compiling the project Image file loading LogicLab user manual 67 67 68 68 68 69 70 70 70 71 71 71 71 72 72 72 72 73 74 74 74 74 75 75 75 75 75 17 71 79 79 79 80 81 81 83 84 85 87 87 87 Ie es a ee I 7 2 7
29. 2 ENUMERATED DATA TYPES An enumerated data type declaration specifies that the value of any data element of that type can only be one of the values given in the associated list of identifiers The enumera tion list defines an ordered set of enumerated values starting with the first identifier of the list and ending with the last Enumerated data types can be declared using the following syntax TYPE lt enumerated data type name gt lt enumeration list gt END_TYPE For example consider the following declaration of two enumerated data types Note that when no explicit value is given to an identifier in the enumeration list its value equals the value assigned to the previous identifier augmented by one 166 LogicLab user manual NMa ee Be TYPE enuml vall the value of vall is 0 val2 the value of val2 is 1 val3 the value of val3 is 2 enum2 k 11 1 0 Jy the value of J is i 1 1 l 5 END TYPE Different enumerated data types may use the same identifiers for enumerated values In order to be uniquely identified when used in a particular context enumerated literals may be qualified by a prefix consisting of their associated data type name and the f sign 11 1 3 3 SUBRANGES A subrange declaration specifies that the value of any data element of that type is re stricted between and including the specified upper and lower limits Subranges can be decla
30. 3 di freeRunCounter ui k F 9 1 0 variables 9 Constants J Retain variables ER Tasks 2 Double click the name of the variable you want to edit the global variables editor opens and lets you modify its definition Ty Schema 7 Kknilner INT Auto Analog Ta Stati a ETa J Functions sn Walt J Global variables 3 Automatic variables a Analog out 3 idi freeRunCounter fal 9 1 0 ables F Constants Retan variables H LogicLab user manual 41 LOGIC LAB If you just want to change the name of the variable 1 Open the Variable properties editor from the contextual menu which pops up when right clicking the variable name in the project tree alternatively select the correspondent item in the Project menu 9 Global variables Sy Automatic variables E CI Analog out 3 idi freeRunCounter ul E Og vo ve Variable properties E Const Duplicate variable L Retail Delete variable eel Tasks Esport variable to library Copy name Ctrl C 2 Change the variable name and confirm Object properties Object name Properties Description Type VARIABLE Attribute Normal Mal tupe gt WINNT Address Auto Cancel Finally you can create a duplicate of the variable in this way 1 Select Duplicate variable from the contextual menu or the Project menu C Global variables EJ Automatic variables E O Analog out 3 di freeAunCourter a f a og o y Variabl
31. 4 6 MODIFYING PROPERTIES OF BLOCKS Click Increment pins inthe Scheme menu or press the Inc pins button in the FBD toolbar to increment the number of input pins of some operators and embedded func tions hI LI MOK Click Enable EN ENO pins inthe Scheme menu or press the EN ENO button in the FBD toolbar to display the enable input and output pins MUX E E Click Object gt Instance name inthe Scheme menu or press the FBD properties button in the FBD toolbar to change the name of an instance of a function block 6 4 7 GETTING INFORMATION ON A BLOCK You can always get information on a block that you added to an FBD document by select ing it and then performing one of the following operations Click Object gt Open source in the Scheme menu or press the View source button in the FBD toolbar to open the source code of a block Click Object properties in the Scheme menu or press the FBD properties button in the FBD toolbar to see properties and input output pins of the selected block 6 4 8 AUTOMATIC ERROR RETRIEVAL The FBD editor also automatically displays the location of compiler errors To reach the block where a compiler error occurred double click the corresponding error line in the Output bar 74 LogicLab user manual LOGI LAB 6 5 SEQUENTIAL FUNCTION CHART SFC EDITOR The SFC editor allows you to code and modify POUs using SFC i e Sequential Function Chart one of the EC compliant lang
32. BOOL Any Any Same as selected Input OUT SEL C FALSE INO X INI 5 OUT X MAX Maximum value selection 2 extensible Any numerical type Any numerical type Any numerical type Same as max Input OUT MAX 8 120 1000 OUT 120 MIN Minimum value selection 2 extensible Any numerical type Any numerical type Any numerical type Same as min Input OUT MIN 8 120 1000 OUT 1000 LogicLab user manual LOGI ee I LIMIT Limits Input 0 to be equal or more than Input 1 and equal or less than Input 2 Number of operands 3 Description Input data type Any numerical type Any numerical type Any numerical type Output data type Same as Inputs OUT LIMITC IN y 4 MN 0 MX amp Jy 7 OUT 4 3 Examples OUT LIMIT IN 88 MN 0 MX 5 OUT 5 OUT LIMIT IN 1 MN 0 MX 5 OUT O MUX Description Multiplexer Selects one of N inputs depending on input K Number of operands 3 extensible Input data type type Any numerical type Any numerical Output data type Same as selected Input Examples OUT MUX 0 A B C OUT A Comparison functions Comparison functions can be also used to compare strings if this feature is supported by target device GT Greater than Returns TRUE if Input 0 gt Input 1 otherwise FALSE Number of operands 2 Description Input data type Any but BOOL A
33. Definitions E TypeDets ok UINTE_T El Structures MBS COMPLEX El Enumerations f HYDROCARBON Macro i i NE 2 Type the name of the subrange 50 New Subrange Name Type Min Value Description WATER TEMPE RATURE JE aes Max Value LogicLab user manual m a a ee LAB 3 Select the basic type for the subrange New Subrange Name WATER_TEMPERATURE Type Gy Min Value Max Value o Typa Min ale Objects iker Hare Pie cul Praga Joes Tdi DIKIT riche behi Fl IT neon jadal funelon BL SINT wd UDINT cui HINT aes J SINT nahi _ Lora Verable Leet hopes VY Grae hoes l Gheck oll Check nee D ihrer Fillers Mame p ok Location All Lira all x Verstyoe AN 4 Enter minimum and maximum values of the subrange WATER_TEMPERATURE Min Value 0 Max Value Description ERE 5 Enter a meaningful description optional and confirm the operation New Subrange Name WATER_TEMPERATURE Type INT Lael Min Value o Max Value Descpin LogicLab user manual 51 LOGIC LAB 5 4 4 2 EDITING A SUBRANGE The subranges of the project are listed under the Subranges folder In order to edit a Subrange you just have to double click on its name Project S Sp edi El Project A Definitions E 0 PleEsample Definitions EG B TypeDets UINTET GJ Structures re COM
34. I 9 5 2 8 OPENING A TRIGGER WINDOW FROM AN ST MODULE Let us assume that you have an ST module also containing the following instructions I 000 a h B 003 c SHR a 16 04 1 p d 0005 d e g 0006 f E SHR d 16 04 0007 Let us also assume that you want to know the value of e d and just before the in struction f f SHR d 16 04 is executed To do so move the cursor to line 6 Then you can click the Set Remove trigger button in the Debug toolbar ka In both cases a green arrowhead appears next to the line number and the related trigger window pops up or you can press the F9 key Trigger n 0 at MAINST 6 Condition HR a 16 04 e Trigger SHR d 16 04 Not all the ST instructions support triggers For example it is not possible to place a trig ger on a line containing a terminator such aS END_IF END_FOR END_WHILE etc 9 5 2 9 ADDING A VARIABLE TO A TRIGGER WINDOW FROM AN ST MODULE In order to watch the value of a variable you need to add it to the trigger window To this purpose select a variable by double clicking it and then drag it into the Variables win dow that is the lower white box in the pop up window The variable name now appears in the Symbol column LogicLab user manual 133 LOGI I 9 5 2 9 5 2 Trigger n 0 at MAINST 6 lve ow Condition b SHR a 16 04 None e Trigger For
35. Input 1 are BOOL otherwise bitwise AND Number of operands 2 Description Input data type Any but STRING Any but STRING Output data type Same as Inputs OUT TRUE AND FALSE OUT FALSE Examples OUT 16 1234 AND 16 5678 OUT 16 1230 OR Logical OR if both Input 0 and Input 1 are BOOL otherwise bitwise OR Number of operands 2 Description Input data type Any but STRING Any but STRING Output data type Same as Inputs OUT TRUE OR FALSE OUT FALSE Examples OUT 1671234 OR 16456785 OUT 1675G7C LogicLab user manual 183 LOGIC LAB Description Number of operands Input data type Output data type Examples Description Number of operands Input data type Output data type Examples Selection functions Description Number of operands Input data type Output data type Examples Description Number of operands Input data type Output data type Examples Description Number of operands Input data type Output data type Examples 184 XOR Logical XOR if both Input 0 and Input 1 are BOOL otherwise bitwise XOR 2 Any but STRING Any but STRING Same as Inputs OUT TRUE OR FALSE OUT 16 1234 OR 16 5678 OUT TRUE 16 444C OUT NOT Logical NOT if Input is BOOL otherwise bitwise NOT 1 Any but STRING Same as Inputs OUT NOT FALSE OUT TRUE OUT NOT 16 1234 OUT 16 EDCB SEL Binary selection 3
36. LD FBD or SFC source code editor 1 Press the Watch button in the FBD bar bf aN BO Dt 2 Click on the block representing the variable you wish to be shown in the Watch win dow JES Main r Test Type Address Array Init va 98 LogicLab user manual LOGIC LAB 3 Adialog box appears listing all the currently existing instances of debug windows and asking you which one is to receive the object you Nave just clicked on Debug windows list Symbol to add out Oscilloscope In order to display the variable in the Watch window select Watch then press OK Debug windows list Sembol to add out Debug windows Oscilloscope The variable name value and location are now displayed in a new row of the Watch win dow watch x Si se b Ea Symbol Location me INPZ FALSE BOL global man MFE TRUE BOL global ame OUT FALSE BOL global The same procedure applies to all the variables you wish to inspect Once you have added to the Watch window all the variables you want to observe you Should click on the Se ect Move button in the FBD bar the mouse cursor turns to its original shape LogicLab user manual 99 LOGIC LAB 9 1 2 3 ADDING A VARIABLE FROM A VARIABLES EDITOR In order to add a variable to the Watch window you can select the corresponding record in the variables editor and then either drag and drop it in the Watch window El me Webb
37. SHR d 16 04 3 The same procedure applies to all the variables you wish to inspect 10 REMOVING A VARIABLE FROM THE TRIGGER WINDOW If you want a variable not to be displayed any more in the trigger window select it by clicking its name once then press the Del key L1 USING CONTROLS This paragraph deals with trigger windows controls which allow you to better supervise the working of this debugging tool to get more information on the code under scope The main purpose of trigger window controls is to let you define more limiting conditions so that variables in Variables window are refreshed when the processor reaches the trig ger location and these conditions are satisfied If you do not use controls variables are refreshed every single time the processor reaches the relative trigger Enabling controls When you set a trigger all the elements in the Control window look disabled m Ac Ent 0 Condition e Hone Trigger C For events After As a matter of fact you cannot access any of the controls except the Accumulator dis play until at least one variable is dragged into the Debug window When this happens triggering automatically starts and the Controls window changes as follows er ac cm 381 Condition a None Trigger f For events C After Triggering can be started stopped with the apposite button 134 LogicLab user manual LOGI I Fixing the number of refres
38. VAR Den REAL No D 5 MAR INPUT i Tau REAL Ma 0 B VAR INPUT 2 T REAL Mo D P VARL OUTPUT 0 yt REAL ho i or press the F10 key and choose Oscilloscope from the list of debug windows which pops UP Debug windows list Symbol to add ut Debug windows Watch Oscilloscope LogicLab user manual 107 9 2 2 4 ADDING A VARIABLE FROM THE PROJECT TREE In order to add a variable to the Oscilloscope you can select it in the project tree and then either drag and drop it in the Oscilloscope 9 Function black Tt Schema esa S Functor E wat B E Global varebiler gt Aulomatc vsnebles di FreeAunCounle 9 Anslag oul 3 J 10 wansbles ES Orde guada r penod r baw Eaj iE r valefjel gt Dj Coristani LJ Aelian varisbles aa Tasks Frat or press the pops up Debug windows list Symbol to add valueFilt Pebua Fr Watch Blecillas cope 9 2 3 REMOVING A VARIABLE F10 key and choose Oscilloscope from the list of debug windows which If you want to remove a variable from the Oscilloscope select it by clicking on its name once then press the Del key 9 2 4 VARIABLES SAMPLING 9 2 4 1 NORMAL OPERATION Let us consider the following example is Fast E TusFiter Oselioscone peilod S ll dr Sq aen ridth u au vaio put valg FoF ilb r JE Te EEL aoe i TusFilter K T g
39. Yarabi Varies Select al Select none LogicLab user manual Object list H me T estaga DWORD F tes ege DAR FPE Sr I EiT te 47 eT ow ord SF Bute Tand SE FF G F TRIG F TOF FTON Puze re JF BwetcBir i Word obit TF WoodToByie Tape Function Pura tore Function Hecka Furchon blocks Fiction Function Fura ores Fue tiain Hoka Furi Glee Function blocks Furcton Blow ka Funchan blocks Furclion blocks Furcion Blocks Farior tion ks Function locks m am a ee LAB Bop Pistable reset dormant Bistabie set ciominen Congo a byle from amp bite Como ona Mond From 16 bits Comon a ond for 2 betes C type Hi fe Falling adie 88510 OFF delay timer OM delay bres Pulse ome so R smg ados dete cha Split a Whe nha bits a Sp evn poh Bake spika Mord imho baa bytes Zeja Object list shows all the filtered objects List can be ordered in ascending or discend ing way by clicking on the header of the column So it is possible to order items by Name Type or Description Double clicking on an item allows the user to perform the default associated operation the action is the same of the OK Import object or Open source button actions When item multiselection is allowed Select all and Select none buttons are visible It is possible to select all objects by clicking on Select all button Select none dese lects all objects If at least an item is selec
40. a debugging tool has been started it is not possible to add any trigger window and an error message appears if you attempt to start a new window Once the graphic trigger window is eventually closed trigger windows are enabled again Note that all the trigger windows existing before the starting of a graphic trigger window keep working normally You are simply not allowed to add new ones 9 5 1 2 TRIGGER WINDOW TOOLBAR Trigger window icons are part of the Debug toolbar and are enabled only if LogicLab is in debug mode gt ge aK E Button Description In order to actually start a trigger window select the point of the PLC code where to insert the relative trigger and then press this button Set Remove trigger The same procedure applies to trigger window removal in order to definitely close a debug window click once the instruction block where the trigger was inserted then press this button again This button operates exactly as the above Set Remove trigger except for that it opens a graphic trigger window It can be used likewise Al Graphic trace are also to remove a graphic trigger window Shortcut key pressing Shift F9 is equivalent to clicking on Set Remove trigger button Pressing this key causes all the existing trigger windows and the graphic trigger window to be removed simultaneously Shortcut key pressing Ctril Shift F9 is equivalent to clicking on this button This key opens a dialog listing all the exi
41. accessible to other program organization units except by explicit argument passing via variables which have been declared as inputs or outputs of those units The one exception to this rule is the case of variables which have been declared to be global Such variables are only accessible to a program organization unit via a VAR EXTERNAL declaration The type of a variable declared in a VAR EXTERNAL Must agree with the type declared in the VAR GLOBAL block There is an error if any program organization unit attempts to modify the value of a variable that has been declared with the CONSTANT qualifier a variable declared as VAR GLOBAL CONSTANT in a configuration element or program or ganization unit the containing element is used in a VAR EXTERNAL declaration with out the CONSTANT qualifier of any element contained within the containing element 11 1 5 4 QUALIFIERS Qualifier Description The attribute CONST indicates that the variables within the structuring elements are constants i e they have ee a constant value which cannot be modified once the PLC project has been compiled The attribute RETAIN Indicates that the variables means within the structuring elements are retentive i e they keep their value even after the target device is reset or switched off 11 1 5 5 SINGLE ELEMENT VARIABLES AND ARRAYS A single element variable represents a single data element of either one of the elemen tary types or one of the
42. all Lheshooe Cher lille Harme 3 Localan All Libisiy All are ipe All Create new workspace Name FLCExampleWspl C Open existing workspace Choose other Dele LogicLab user manual 11 LOGIC 12 VPLC1 is a software which emulates a simple programmer controller provided with 13 14 15 16 w w w 12 digital and analog I O It is possible to interact with simulator as explained in Simu Lab manual or briefly in Resources tab Fol rie eae Wi Prii Oke T nk Hike BEQ ih ER amp 0 DREie gt i BE Bea a d peen a E E El SECESECEEECEEEEE HHH j L lal cen Dild iad a Heh EBT niiti mm The status of the VPLC1 I O is available in LogicLab as the Target variables listed In the Library window With LogicLab connect to VPLC1 through the apposite button on the toolbar SEE x Press F7 or select the menu option Project Compile to compile the application Verify that the compilation ends with 0 warning 0 errors otherwise correct the errors and compile again Download the code by means of the appropriate toolbar command Ey bg E x aH PLC is now running on VPLC1 You can see the LogicLab bottom bar indicating Source ok Connected SOURCE OK CONNECTED Open the Watch window through the View menu then select the variable in the text editor with a double click and dra
43. as long as N Non stored null qualifier the step remains active The action is executed only once per p STER step activation regardless of the number of cycles the step remains active If a step has zero associated actions then it is considered as having a WAIT function that is waiting for a successor transition condition to become true 11 6 1 5 JUMPS Direct links flow only downwards Therefore if you want to return to a upper step from a lower one you cannot draw a logical wire from the latter to the former A special type of block exists called Jump which lets you implement such a transition A Jump block is logically equivalent to a step as they have to always be separated by a transition The only effect of a Jump is to activate the step flag of the preceding step and to activate the flag of the step it points to Representation Description Jump JMF logical link to the destination step 11 6 2 TRANSITIONS 11 6 2 1 DEFINITION A transition represents the condition whereby control passes from one or more steps preceding the transition to one or more successor steps along the corresponding directed link The transition is represented by a small grey square across the vertical directed link The direction of evolution following the directed links is from the bottom of the predeces sor step s to the top of the successor step s 11 6 2 2 TRANSITION CONDITION Each transition has an associated transition condit
44. asks you to type the name of the copy Deletes the currently selected object As explained above you need to release the Save project command to definitively erase a document from your project Shows properties and description of the object currently selected in the Workspace Opens the Oject browser which lets you navigate between objects Asks you whether to save unsaved changes then launches the LogicLab compiler Recompiles the project Generates an RSM file Lets you import a LogicLab object from a library Lets you export a LogicLab object to a library Opens the Library manager Opens another menu which lets you create delete macros Lets you change the target Lets you specify the project options LogicLab user manual 155 10 1 5 DEBUG MENU Command Add symbol to watch Insert new item into watch Add symbol to a debug window Insert new item into a debug window Quick watch Run Add Remove breakpoint Remove all breakpoints Breakpoint list Add remove text trigger Add remove graphic trigger Remove all triggers Trigger list Debug mode Live debug mode LOGIC LAB Description Adds a symbol to the Watch window Inserts a new item into the Watch window Adds a symbol to a debug window Inserts a new item into a debug window Opens a dialog with the actual value of the variable Restarts program after a breakpoint is hit Adds removes a breakpo
45. box Then either confirm by pressing OK or quit by clicking Cancel If you press OK LogicLab opens automatically the editor associated with the language you selected in the previous dialog box and you can type the code of the new condition Note that you are not allowed to declare new local variables as the module you are now editing is a component of the original SFC module which is the POU where local variables can be declared The scope of local variables extends to all the actions and transitions making up the SFC diagram 6 5 6 2 ASSIGNING A CONDITION TO A TRANSITION When you have finished writing the code double click the transition you want to assign the new condition to This causes the following dialog box to appear SC Block proper hes Select the name of the condition you want to assign to this step Then confirm by press ing OK If later you need to edit the source code of the condition you can double click the name 78 LogicLab user manual LOGI I of the transition in the Transitions folder of the Workspace window 6 5 7 SPECIFYING THE DESTINATION OF A JUMP To specify the destination step of a jump double click the jump block in the Chart area This causes the dialog box shown below to appear listing the name of all the existing steps Select the destination step then either press OK to confirm or Cancel to quit SFC Jump properties EO X Cancel 6 5 8 EDITING SFC NETWORKS T
46. button in the Debug toolbar This causes the grey raised button containing the network number to turn to green a white circle with a number inside to appear in the middle of the button and the graphic trigger window to pop up MAINLD 1 BHAA R TTR ATP u tre M Note that unlike the other languages supported by LogicLab LD does not allow you to insert a trigger before a single contact or coil as it lets you select only an entire network Thus the variables in the Graphic trigger window will be sampled every time the pro cessor reaches the beginning of the selected network 9 6 2 6 ADDING A VARIABLE TO THE GRAPHIC TRIGGER WINDOW FROM AN LD MODULE In order to watch the diagram of a variable you need to add it to the Graphic trigger window Let us assume that you want to see the plot of the variable b in the LD code represented in the figure below To this purpose press the Watch button in the FBD bar Ql EN Now you can click the item representing the variable you wish to be shown in the Graphic trigger window A dialog box appears listing all the currently existing instances of debug windows and asking you which one is to receive the object you have just clicked The cursor will become as follows In order to plot the curve of variable b select Graphic trace inthe Debug windows col umn then press OK The name of the variable is now printed in the Track column 148 LogicLab user manual M
47. clicking it or by press ing the Open button The name of the library and its absolute pathname are now displayed in a new row at the bottom of the list in the white box Project library list Link c program files HeMoVve Remove all 4 Repeat step 1 2 and 3 for all the libraries you wish to include 5 When you have finished including libraries press either OK to confirm or Cancel to quit 4 8 1 2 REMOVING A LIBRARY The following procedure shows you how to remove an included library from the current project Remember that removing a library does not mean erasing the library itself but the project s reference to it 1 Click Library manager in the Project menu of the LogicLab main window which opens the Library manager dialog box Project library list Name Link basic cz program files thermmadel gAprogram fless SMe Remove all LogicLab user manual 29 LOGI I 2 Select the library you wish to remove by clicking its name once The Remove button is now enabled Project library list Link Add ci program files gAprogram files Remove Remove all UnLink KeLink Click the Remove button which causes the reference to the selected library to disap pear from the Project library list Repeat for all the libraries you wish to remove Alternatively if you want to remove all the libraries you can press the Remove all button When you
48. figure timExe1 11 5 STRUCTURED TEXT ST This section defines the semantics of the ST Structured Text language 11 5 1 EXPRESSIONS An expression is a construct which when evaluated yields a value corresponding to one of the data types listed in the elementary data types table LogicLab does not set any constraint on the maximum length of expressions Expressions are composed of operators and operands 11 5 1 1 OPERANDS An operand can be a literal a variable a function invocation or another expression 11 5 1 2 OPERATORS Open the table of operators to see the list of all the operators supported by ST The evalu ation of an expression consists of applying the operators to the operands in a sequence defined by the operator precedence rules 11 5 1 3 OPERATOR PRECEDENCE RULES Operators have different levels of precedence as specified in the table of operators The operator with highest precedence in an expression is applied first followed by the opera tor of next lower precedence etc until evaluation is complete Operators of equal prec edence are applied as written in the expression from left to right For example if A B C and D are of type INT with values 1 2 3 and 4 respectively then A B C ABS D yields 9 and A B C ABS D yields O When an operator has two operands the leftmost operand is evaluated first For example in the expression SLN A COS TB the expression SIN A is
49. files making up the LogicLab project The pathname in the Directory control indicates the default location of this folder Target selection allows you to specify the target device which will run the project Finally you can make the project case sensitive by activating the related option Note that by default this option is not active in compliance with IEC 61131 3 standard when you choose to create a case sensitive project it will not be standard compliant When you confirm your decision to create a new project and the whole required informa tion has been provided LogicLab completes the operation creating the project directory and all project files then the project is opened The list of devices from which you can select the target for the project you are creating depends on the contents of the catalog of target devices available to LogicLab When the desired target is missing either you have run the wrong setup executable or you have to run a separate setup which is responsible to update the catalog to include the target device In both cases you should contact your hardware supplier for support UPLOADING THE PROJ ECT FROM THE TARGET DEVICE Depending on the target device you are interfacing with you may be able to upload a working LogicLab project from the target itself LogicLab user manual 23 LOGIC In order to upload the project from the target device follow the procedure below 1 Select the item Import proje
50. i 1 DGI AOL al K po F Not all the IL instructions support triggers For example it is not possible to place a trig ger at the beginning of a line containing a JMP statement 9 6 2 2 ADDI NG A VARI ABLE TO THE GRAPHI C TRI GGER WI NDOW FROM AN I L MODULE In order to get the diagram of a variable plotted you need to add it to the graphic trigger window To this purpose select a variable by double clicking it and then drag it into the Variables window The variable now appears in the Track column 4 la UINT Auto N TeS Q UINT Auto MAIN 12 S S HAMS ab x X S S M LD a ADD b ST a LD Se ADD d ST c Cem oY ff J O00000000000000 Eb HHOODODDDODOODOO How Om WN The same procedure applies to all the variables you wish to inspect Once the first variable is dropped into a graphic trace the Graphic properties window is automatically shown and allows the user to setup sampling and visualization properties 144 LogicLab user manual 9 6 2 3 OPENING THE GRAPHIC TRIGGER WINDOW FORM AN FBD MODULE Let us assume that you have an FBD module also containing the following instructions 4 T p Let us also assume that you want to know the values of c d and k just before the ST k instruction is executed Provided that you can never place a trigger in a block representing a variable such as kl you must select the first available block preceding
51. just clicked Symbol to add k Debug windows Watch Oscilloscope Graphic trace In order to plot the curve of variable k select Graphic Trace inthe Debug windows col umn then press OK The name of the variable is now printed in the Track column 146 LogicLab user manual Wa UINT Auto No 0 No 0 MAINFBD 3 0 3 SHA A SAB AAO Sle Crt 100 100 The same procedure applies to all the variables you wish to inspect Once you have added to the Graphic watch window all the variables you want to ob serve you can press the Normal cursor button in order to restore the original cursor N Once the first variable is dropped into a graphic trace the Graphic properties window is automatically shown and allows the user to setup sampling and visualization properties 9 6 2 5 OPENING THE GRAPHIC TRIGGER WINDOW FROM AN LD MODULE Let us assume that you have an LD module also containing the following instructions You can place a trigger on a block such as follows ADO EN ENO In this case the same rules apply as to insert the graphic trigger in an FBD module on a contact 4 LogicLab user manual 147 LOGIC LAB or coil In this case follow the instructions Let us also assume that you want to Know the value of some variables every time the processor reaches network number 1 Click one of the items making up network nr 1 then press the Graphic trace
52. ma 7 F New function s Duplicate variable New variable ees Deke variable a Tis 120 variable Vaio properties REAL MD Bento 2 Object Browser REAL Oh Retain 4 Enter the name of the variable remember that some characters such as V I I and so on cannot be used the variable name must be a valid IEC 61131 3 identifier 38 LogicLab user manual m a a ee LAB Group ee Array hej Attribute AUTO Init values o R Description 5 Specify the type of the variable either by typing it Sew Variable EJ Nae me unt C ce i 2 9 code Attibute mes G a or by selecting it from the list that LogicLab displays when you click on the Browse button New variable x Name Bet ae ee Group ii Array Attibute mas Object browser Function blocks Basic types User Types miners Name Rem Symbol location All Library All Ware type All Cancel 1 OK j Lp 6 Ifyou want to declare an array you can specify its size Size of Variable O Scalar 8 Aray Matrix Dimensions LogicLab user manual 39 LOGIC CAE 7 You may optionally assign the initial value to the variable New variable Name k Tyne UINT ret Group v Ary 0 3 Wel Attribute AUTO Init values 4 0 Description Array value Value Edit Value Type Hexadecimal Binary Octal G Decimal Boolean 8 Finally you ca
53. only when that POU is open for editing where they are further classified according to their class e g aS input or inout variables 9 Function blocks CF ochena E HE Input variables tl i t i2 tF i3 E Output variables tF 01 E l Local variables ud elapsedT FE timRit Ea Stati LogicLab user manual 43 LOGIC LAB In order to create edit and delete local variables you have to open the Program Organi zation Unit for editing and use the local variables editor Pigect 25 Definitions ei ppe Proect Mame THe WAR tim Ai Arey inii TOK Ho 0 9 Progam YAR elapsedT LDIMT Ho T E Fast VAR INPUT Oo ia BO OL No FALE g ie VAR INPUT 1 i BODL No FALE E Medium VAR INPUT 7 44 BODL No FALE aE Function blocks VAR OUTPUT 0 of BOOL No FALE z Hr Ingut wemioiles il iz FISS i A E Dut varinhies FA ol E Lonal verables ad dagsedT TF limni hss i Refer to the corresponding section in this manual for details see Paragraph 6 6 1 2 5 3 TASKS 5 3 1 ASSIGNING A PROGRAM TO A TASK Read the instructions below to know how to make a task execute a program 1 The tasks running on the target device are listed in the Project tab of the Work space window Right click the name of the task you want to execute the program and choose Add program from the contextual menu EP Project Definitions PicE sample Project J Programs Main Function blocks
54. out 1000 0 out TO_REAL 16 8000 out 32768 0 LogicLab user manual 177 es a ee I TO LREAL Description Conversion to LREAL 64 bit floating point Number of operands 1 Input data type Any numerical type Output data type LREAL out TO_LREAL 1000 out 1000 0 Examples out TO_LREAL 1648000 out 32768 0 Numerical functions The availability of the following functions depends on the target device Please refer to your hardware supplier for details Description Number of operands Input data type Output data type Examples Description Number of operands Input data type Output data type Examples Description Number of operands Input data type Output data type Examples Description Number of operands Input data type Output data type Examples 178 ABS Absolute value Computes the absolute value of input 0 1 Any numerical type Same as input OUT ABS 5 OUT 5 OUT ABS 1 618 Jy OUT 1 618 OUT ABS 3 141592 OUT 3 141592 SQRT Square root Computes the square root of input 0 1 LREAL where available REAL otherwise LREAL where available REAL otherwise OUT i SQRT 4 0 OUT 2 0 LN Natural logarithm Computes the logarithm with base e of input 0 1 LREAL where available REAL otherwise LREAL where available REAL otherwise OUT lt IN 2 718281 Jj OUT 1 0 LOG Common log
55. procedures Click Code object gt New action inthe Scheme menu Right click on the name of the SFC POU in the Workspace window A context menu ap pears from which you can select the New Action command LogicLab user manual 75 LOGIC LAB In either case LogicLab displays a dialog box like the one shown below x Cancel Languages f IL i FED i LD ST SFC Select one of the languages and type the name of the new action in the text box at the bottom of the dialog box Then either confirm by pressing OK or quit by clicking Cancel If you press OK LogicLab opens automatically the editor associated with the language you selected in the previous dialog box and you are ready to type the code of the new action Note that you are not allowed to declare new local variables as the module you are now editing is a component of the original SFC module which is the POU where local variables can be declared The scope of local variables extends to all the actions and transitions making up the SFC diagram 6 5 4 2 ASSIGNING AN ACTION TO A STEP When you have finished writing the code double click the step you want to assign the new action to This causes the following dialog box to appear s s n n a s E u sun a na odah gt on ano ons om ou sma ek se ibp E me Bee me n e M O o a O a a eee em a ee em RE b i a e E ee E SFC Action Properties hint No code Co code No code i
56. program organi zation unit cannot cause the invocation of another program organization unit of the same type 172 LogicLab user manual E am a ee LAB 11 1 6 1 FUNCTI ONS I ntroduction For the purposes of programmable controller programming languages a function is de fined as a program organization unit POU which when executed yields exactly one data element which is considered to be the function result Functions contain no internal state information i e invocation of a function with the same arguments input variables VAR_INPUT and in out variables VAR_IN_OUT always yields the same values output variables VAR_OUTPUT in out variables VAR_IN_OUT and function result Declaration syntax The declaration of a function must be performed as follows FUNCTION FunctionName RetDataType VAR_INPUT declaration of input variables see the relevant section END_VAR VAR declaration of local variables see the relevant section END_VAR Function body END_FUNCTION Keyword Description FunctionName Name of the function being declared RetDataType Data type of the value to be returned by the function Specifies the operations to be performed upon the input variables in order to assign values dependent on the function s semantics to a variable with the same name as the function which represents the function result It can be written in any of the languages supported by LogicLab Function body Declaring functions in LogicL
57. project file ppjs file extension the project file itself contains the whole information needed to run the application assuming the receiving developer has an ap propriate target device available including all source code modules so that you need to share only the ppJs file PLC multiple project file ppjx or ppj file extension the project file contains only the links to the source code modules composing the project which are stored as single files in the project directory You need to share the whole directory 26 LogicLab user manual eee I Alternatively you can generate a redistributable source module RSM with the corre sponding item of the Project menu or toolbar mis Help Gh e eA al gl ERE LogicLab notifies you of the name of the RSM file and lets you choose whether to protect the file with a password or not If you choose to protect the file LogicLab asks you to insert the password Generate redistributable source module Protect with password PicExarmple O9082010150726 rsm Get password Password Confirm password e The advantages of the RSM file format are the source code is encoded in binary format thus it cannot be read by third parties which do not use LogicLab making a transfer over the Internet more secure it can be protected with a password which will be required by LogicLab on file opening being a binary file its size is reduced 4 6 PROJECT OPTION
58. sine of input 0 result IS expressed in radians Number of operands 1 Description Input data type LREAL where available REAL otherwise Output data type LREAL where available REAL otherwise OUT ASIN 0 0 y OUT 0 0 Examples OUT z ASIN 1 0 37 OUT PI J 2 3 LogicLab user manual 179 LOGIC LAB Description Number of operands Input data type Output data type Examples Description Number of operands Input data type Output data type Examples Description Number of operands Input data type Output data type Examples Description Number of operands Input data type Output data type Examples Description Number of operands Input data type Output data type Examples 180 ACOS Arc cosine Computes the principal arc cosine of input 0 result is expressed in radians 1 LREAL where available REAL otherwise LREAL where available REAL otherwise OUT ACOS 1 0 OUT 0 0 OUT ACOS 1 0 OUT PI ATAN Arc tangent Computes the principal arc tangent of input 0 result is expressed in radians 1 LREAL where available REAL otherwise LREAL where available REAL otherwise OUT ATAN 0 0 OUT 0 0 OUT ATAN 1 0 OUT PI 4 ADD Arithmetic addition Computes the sum of the two inputs 2 Any numerical type Any numerical type Same as Inputs OUT ADD 20 40 OUT 60 MUL Arithmetic multiplication Multiplies
59. super vise the working of this debugging tool to get more information on the code under scope Trigger window controls act in a well defined way on the behavior of the window regard less for the type of the module either IL or FBD where the related trigger has been inserted All controls except the Accumulator display are not accessible until at least one variable is dragged into the Variables window Window controls are made accessible to users through the grey top half of the debug window Trigger n 0 at MAIN S T Ac Condition None Tigger C For 7 After 124 LogicLab user manual i am es Button Description This control is used to start a triggering session If system Is triggering you can click this button to force stop Otherwise session automatically stops when conditions are reached At this point you can press this button to start another triggering session This control is used to execute a single step trigger It is enabled only when there is no active T Single step triggering session and None is selected Specified execution condition is considered After the single step trigger is done triggering session automatically stops This control adds the Accumulator to the list of variables already dragged into the trigger window A new row is added at the bottom of the table of Ac Accumulator a Start Stop variables containing the string Accumulator in column Symbol the accumulator
60. the byte in memory having the index value as its absolute address Direct representation Description Word starting from the first byte of the 7 SMW4 6 element of datablock 4 in memory MW4 Word starting from byte 4 of memory Example VAR RETAIN CONSTANT XQuote DINT Enabling BOOL FALSE TorqueCurrent AT MW4 32 INT Counters ARRAY 0 9 OF UINT Limits ARRAY 0 3 0 9 END_VAR Variable xQuote is 32 bits long and it is automatically allocated by the LogicLab com piler Variable Enabling Is initialized to FALSE after target reset Variable TorqueCurrent is allocated in the memory area of the target device and it takes 16 bits starting from the first byte of the 33 element of datablock 4 Variable Counters IS an array of 10 independent variables of type unsigned integer 11 1 5 8 DECLARING VARIABLES IN LOGI CLAB Whatever the PLC language you are using LogicLab allows you to disregard the syntax above as it supplies the Local variables editor the Global variables editor and the Param eters editor which provide a friendly interface to declare all kinds of variables 11 1 6 PROGRAM ORGANI ZATION UNITS Program organization units are functions function blocks and programs These program organization units can be delivered by the manufacturer or programmed by the user through the means defined in this part of the standard Program organization units are not recursive that is the invocation of a
61. the programmable controller s input output or memory structure Direct representation of a single element variable is provided by a special symbol formed by the concatenation of the percent sign a location prefix and a size prefix and one or two unsigned integers separated by periods S6location size index index 1 location The location prefix may be one of the following Location prefix Description I Input location Q Output location M Memory location 2 size The size prefix may be one of the following Size prefix Description x Single bit size B Byte 8 bits size W Word 16 bits size D Double word 32 bits size LogicLab user manual 171 LOGI I 3 index index This sequence of unsigned integers separated by dots specifies the actual position of the variable in the area specified by the location prefix Example Direct representation Description Swag Word starting from the first byte of the 7t i l element of memory datablock 4 SrO i First bit of the first byte of the 5 element of input set 0 Note that the absolute position depends on the size of the datablock elements not on the size prefix As a matter of fact smMw4 6 and MD4 6 begin from the same byte in memory but the former points to an area which is 16 bits shorter than the latter For advanced users only if the index consists of one integer only no dots then it loses any reference to datablocks and it points directly to
62. the term power flow The following properties apply to the link elements The state of the left rail shall be considered ON at all times No state is defined for the right rail LogicLab user manual 195 es a ee I A horizontal link element is indicated by a horizontal line A horizontal link element transmits the state of the element on its immediate left to the element on its immedi ate right The vertical link elemen t consists of a vertical line intersecting with one or more hori zontal link elements on each side The state of the vertical link represents the inclusive OR of the on states of the horizontal links on its left side that is the state of the verti cal link is OFF if the states of all the attached horizontal links to its left are OFF ON if the state of o The state of the vertical The state of the vertical left Description Vertical horizontal links 11 4 3 CONTACTS ne or more of the attached horizontal links to its left is ON link is copied to all of the attached horizontal links on its right link is not copied to any of the attached horizontal links on its Symbol link with attached A contact is an element which imparts a state to the horizontal link on its right side which is equal to the Boolean AND of the state of the horizontal link at its left side with an ap propriate function of an associated Boolean input output or memory variable A contact does not mo
63. to Returns TRUE if Input 0 Input 1 otherwise FALSE 2 Any Any BOOL OUT NE TRUE FALSE OUT TRUE OUT NET pipp pluto OUT TRUE LogicLab user manual String functions The availability of the es oe ee LAB following functions depends on the target device Please refer to your hardware supplier for details Description CONCAT Character string concatenation Number of operands 2 Input data type Output data type Examples Description STRING STRING STRING OUT lt CONCAT AB CD J OUT ABCD DELETE Delete L characters of IN beginning at the P th character position Number of operands 3 Input data type Output data type Examples Description Number of operands Input data type Output data type Examples Description STRING UINT UINT STRING OUT DELETE IN ABXYC L 2 P 3 OUT ABC FIND Find the character position of the beginning of the first occurrence of IN2 in IN1 If no occurrence of IN2 is found then OUT 0 2 STRING STRING UINT OUT FIND IN1 ABCBC IN2 BC OUT 2 INSERT Insert IN2 into IN1 after the P th character position Number of operands 3 Input data type Output data type Examples Description Number of operands Input data type Output data type Examples STRING STRING UINT STRING OUT INSERT IN1 AB
64. to an existing PLC object you have two options You can type directly the name of the PLC object You can drag it to a Suitable location For example global variables can be taken from the Workspace window whereas embedded functions can be dragged from the Librar 7es window whereas local variables can be selected from the local variables editor 6 2 4 AUTOMATIC ERROR LOCATION The ST editor also automatically displays the location of compiler errors To know where a compiler error has occurred double click the corresponding error line in the Output bar 6 2 5 BOOKMARKS You can set bookmarks to mark frequently accessed lines in your source file Once a book mark is set you can use a keyboard command to move to it You can remove a bookmark when you no longer need it 6 2 5 1 SETTING A BOOKMARK Move the insertion point to the line where you want to set a bookmark then press Ctri F2 The line is marked in the margin by a light blue circle 028 0029 0030 6 2 5 2 JUMPING TO A BOOKMARK Press F2 repeatedly until you reach the desired line 6 2 5 3 REMOVING A BOOKMARK Move the cursor to anywhere on the line containing the bookmark then press Ctr F2z 6 3 LADDER DIAGRAM LD EDITOR BiginpO Diginp gt LogicLab user manual 67 es a ee I The LD editor allows you to code and modify POUs using LD i e Ladder Diagram one of the IEC compliant languages 6 3 1 CR
65. variable of type DINT the selector and a list of statement groups each group being labeled by one or more integer or ranges of integer values as applicable It specifies that the first group of statements one of whose ranges contains the computed value of the selector is to be executed If the value of the selector does not occur in a range of any case the statement sequence following the keyword ELSE if it occurs in the CASE statement is executed Otherwise none of the statement sequences is executed LogicLab does not set any constraint on the maximum allowed number of selections in CASE statements Syntax Note that square brackets include optional code while braces include repeatable portions of code 1 IF IF expressionl THEN stat list ELSIF expression2 THEN stat list ELSE stat list END_IF 2 CASE CASE expressionl OF inty I p Tot J stat list t ints te inv I stat list ELSE stat list LogicLab user manual 201 LOGI I END CASE intv being either a constant or an interval a or a b Examples IF statement IF d 0 0 THEN nRoots t 0 ELSIF d 0 0 THEN nRoots 1 ad o 7 22 ay 7 ELSE nRoots 2 j xl b SORT d 2 0 a x2 b SORT d 2 0 a END_IF CASE statement CASE tw OF ly a display oven_temp Zs display motor_speed Se display gross_tare Ar Oued display status tw 4 ELSE dis
66. view Project Debug Com FS A New project P A Open project E View project read only Fz Save project 4 Save project As i 4 3 2 SAVING TO AN ALTERNATIVE LOCATION When you do not want to or cannot for example because the file is read only overwrite the project file you may save the modified version of the project to an alternative loca tion by selecting Save project as from the File menu 261 Edit View Project Debug Com E A New project WE rE Open project E View project read only J Fz Save project Save projects k il THTT Pr Cline nmiert LogicLab asks you to select the new destination which must be an empty directory then saves a copy of the project to that location and opens this new project file for editing LogicLab user manual 25 LOGI I 4 4 MANAGING EXISTING PROJECTS 4 4 1 OPENING AN EXISTING LOGICLAB PROJECT To open an existing project click Open project in the File menu of LogicLab s main window or in the Main toolbar or in the Welcome page when no project is open This causes a dialog box to appear which lets you load the directory containing the project and select the relative project file 4 4 2 EDITING THE PROJ ECT In order to modify an element of a project you need first to open that element by double clicking its name which you can find by browsing the tree structure of the project tab of the Workspace bar By
67. window is then shown hidden Mie Edt Yew Proeck Debug Communication Scheme oriebles Window Tools Hep BARA mm RE Se SABRA ss A ie 3 BRS SSR REE amp Ohm of i TkAg Gas B Finest x ie Pec gt Dectniticns E El pepe Pioect 2 Programs 2 FbFlipFlop FFD 3 fbFilier TusF iter Auto 4 foSplit Alte ToBit Auta Z E Funcho block li a FoSplit_o Byte T obit Auto TTi Schema IF Jk Silat 3 Funchonz Global vsneble Sse ise on Ouib dF Penod 10 ms valti i T Bou j j T panii Type Deecrptior Function Dba be valke Function ANCGOSiNe Operator Anhima addition Operator Logcalvotwie AND Funchon Arne Furclion Apelarrgeril Functor Ayctangest at y s _ Opsrater and standad bocka l Tangat variables TE themmmadal 7 LogicLab user manual 17 LOGIC LAB 3 3 2 MOVING TOOL WINDOWS In order to move a tool window click on its name at the top of the window and then drag and drop it to the destination watch x Description rl oD W ii Descrplian 3 YDFlipFiop 7 7 ER fe vs i 8 q men ibFlipFlop ors od 4 4 oj seFite Wach x tian value 8 ic addhon bilvease AND ns Symbol Value T ork srt oY fa value liz cosine i dwsion abonenta basic themmode idal 7 gt You can make the tool window float by double clicking on its name or by pressing the CTRL
68. 0 Time diff 12951 63 ms 2 24167e 006 114 LogicLab user manual oe In the table below the chart you can now read the values of all the variables at that par ticular moment 9 2 5 6 OSCILLOSCOPE SETTINGS You can further customize the appearance of the Oscilloscope by clicking on the Graph properties item in the toolbar AXE su amp W In the window that pops up you can choose whether to display or not the Background grid the Time slide bar andthe Track list Oscilloscope settings Show grid p Sample p Show time bar Horizonte Show tracks list Buffer siz 9 2 6 CHANGING THE POLLING RATE LogicLab periodically sends queries to the target device in order to read the data to be plotted in the Oscilloscope The polling rate can be configured by following this procedure 1 Click on the Graph properties item in the toolbar LogicLab user manual 115 es ee LAB 2 Inthe window that pops up edit the Sampling polling rate Oscilloscope settings Show grid Sample polling rate nal 7 mg Realrate 21 13 Show time bar Horizontal scale 1000 ma div Show tracks list Butter size 140000 samples 3 Confirm your decision Note that the actual rate depends on the performance of the target device in particular on the performance of its communication task You can read the actual rate in the Osci1 loscope settings window Sample polling rate 10 a m Real rate 11 31
69. 1 0 Author John Doe Password 8 4 SIMULATION Depending on the target device you are interfacing with you may be able to simulate the execution of the PLC application with LogicLab s integrated simulation environment SimuLab In order to start the simulation just click on the appropriate item on the Project toolbar File View Project Debug Communication Tools ley fey le Sa em ot ES BY by lg bi he Se Ee Fy fu x Project Er Project oo Definitions Refer to SimuLab s manual to gain information on how to control the simulation 96 LogicLab user manual 9 1 LOGI I DEBUGGING LogicLab provides several debugging tools which help the developer to check whether the application behaves as expected or not All these debugging tools basically allow the developer to watch the value of selected vari ables while the PLC application is running LogicLab debugging tools can be gathered in two classes Asynchronous debuggers They read the values of the variables selected by the devel oper with successive queries issued to the target device Both the manager of the de bugging tool that runs on the PC and potentially the task which is responsible to an swer those queries on the target device run independently from the PLC application Thus there is no guarantee about the values of two distinct variables being sampled in the same moment with respect to the PLC a
70. 23 7 3 8 8 1 8 1 1 8 2 8 2 1 8 2 2 8 3 8 3 1 8 4 sml 9 1 1 9 1 2 9 1 3 9 1 4 9 1 5 9 1 6 9 2 9 2 1 9 2 2 9 2 3 9 2 4 9 2 5 9 2 6 9 2 7 9 3 9 4 9 4 1 9 4 2 9 4 3 9 4 4 9 5 9 5 1 9 5 2 9 6 9 6 1 VI Compiler output Compiler errors Command line compiler Launching the application Setting up the communication Saving the last used communication port On line status Connection status Application status Downloading the application Controlling source code download Simulation Debugging Watch window Opening and closing the watch window Adding items to the watch window Removing a variable Refreshment of values Changing the format of data Working with watch lists Oscilloscope Opening and closing the oscilloscope Adding items to the oscilloscope Removing a variable Variables sampling Controlling data acquisition and display Changing the polling rate Saving and printing the graph Edit and debug mode Live debug SFC animation LD animation FBD animation IL and ST animation Triggers Trigger window Debugging with trigger windows Graphic triggers Graphic trigger window LogicLab user manual 88 88 90 91 91 93 93 93 93 94 94 96 97 97 97 98 101 101 102 103 104 105 106 108 108 109 115 116 117 118 119 119 120 120 120 120 126 137 137 9 6 2 10 10 1 10 1 1 10 1 2 10213 10 1 4 10 1 5
71. 54 es ee I Description Cancels last change made in the document Restores the last change canceled by Undo Removes the selected items from the active document and stores them in a system buffer Copies the selected items to a system buffer Pastes in the active document the contents of the system buffer Deletes the selected item Deletes the whole source code line Opens the Find in project dialog box Lets you set remove and move between bookmarks Allows you to quickly move to a specific line in the source code editor Asks you to type a string and searches for its first instance within the active document from the current location of the cursor Iterates the search previously performed by the Find command Allows you to automatically replace one or all the instances of a string with another string Editing mode which allows you to insert and move blocks Editing mode which allows you to draw logical wires to connect pins Editing mode which allows you to add variables to any debugging tool Description If checked displays the Main toolbar otherwise hides it If checked displays the Status bar otherwise hides It If checked displays the Debug bar otherwise hides it If checked displays the FBD toolbar otherwise hides it If checked displays the LD toolbar otherwise hides It If checked displays the SFC bar otherwise hides it If checked displays the Project bar otherwise hides it If ch
72. A HOT Copy Ctrl C B Main File Edit wiew Project Debug Communication Variables 4 Sy Delete line Crl E cou ey Fr r cS i a By ea AS Fa Find in project panii Z Bookmarks b Go to line This causes the following dialog box to appear Find in project Fnowhat IE Fin Location All ay Filters Program Varnables User Types Function blocks Description Function Types Match whole word only Match case 2 Inthe Find what text box type the name of the object you want to look for Find what Locshon A Fikers F Program Jajca hber a Function biad Mame S Programe Dgestirs SF SiT Bye Funaliare W Friction Blocke TT E tT hord Functions E Function i b of Function Shandard functions TF ateti Function blocks E Mabor ected Te ae n ae Pe PF ea award ire lactis Match cave FUE TREER FFF TAG Function blocks ER gt PF Function blocks ae Check ll Check none TF Pues Function blocks TFA_TAIG Function Mocks AS Funclion blocks Othe Filters SF Function blocks Name i 1 F Function blocks E o HIPS Bint Lonnie Library Word abe Furuchion Hocks Z Wwiond Toby le Funclion Hooks Lha basic Yar toe E LogicLab user manual 61 LOGIC LAB 3 62 Otherwise click the Browse button to the right of the text box and select the name of the object from the list of all the existing items
73. AL flo FALSE 1 WAF Mathitnnna r AGI An FALSE Fad Ap ut rr mar B z E Exec B Global variables PRARunning You can show or hide the Document bar with the menu option of the same name in the menu View gt Toolbars LogicLab user manual 19 LOGIC LAB 3 4 2 THE WINDOW MENU The Window menu is an alternative to the Document bar it lists all the currently open editors and allows to switch between them Civics Tools Hel mi Cascade Tile Arrange icons Close All 2 Stati 3 Exec 4 Global variables 5 Running Moreover this menu supplies a few commands to automate some basic tasks such as closing all windows 3 5 FULL SCREEN MODE In order to ease the coding of your application you may want to switch on the full screen mode In full screen mode the source code editor extends to the whole working area making easier the job of editing the code notably when graphical programming languag es that is LD FBD and SFC are involved Beh kE hr Aubl ME DEEE Schwa i rr eh Hac Fa Bg rar han F cae F niy Fea ay _ i z5 ia a FE ME Ta eee ol im m You can switch on and off the full screen mode with the Full screen option of the menu View or with the corresponding command of the Main toolbar it HED Project Debug Communicatio i Toolbars a 53 2 EE 5 Tool windows k J Ez A a la JE Ful ae
74. ANLDELS Er i p T l i s ma s i pai f i E E i SR ps il J L E 3 Ur Min vake Min value Curie Wdn Redcunsor Efi anit i fallin Taint ESKE The same procedure applies to all the variables you wish to inspect Once you have added to the Graphic watch window all the variables you want to ob serve you can press again the Normal cursor button so as to restore the original shape of the cursor Once the first variable is dropped into a graphic trace the Graphic properties window Is automatically shown and allows the user to setup sampling and visualization properties 9 6 2 7 OPENING THE GRAPHIC TRIGGER WINDOW FROM AN ST MODULE Let us assume that you have an ST module also containing the following instructions 0001 0002 a h Bh 0003 c SHEY a 16 04 1 0004 0005 d e g O006 f SHR d 16 04 1 0007 Let us also assume that you want to know the value of e d and just before the in struction f f SHR d 16 04 is executed To do so move the cursor to line 6 Then click the Graphic trace button in the Debug toolbar A green arrowhead appears next to the line number and the Graphic trigger window pops up E xi al HRuARR EOR a OE 4u Cnt 0 65535 Stop Up down logic on analog output 3 0009 aout3 aout3 incr samples div 500 00 0010 0011 IF aout3 gt 2047 THEN 0012 incr TO INT valO 1
75. C IN2 XY P 2 OUT ABXYC LEFT Leftmost L characters of IN 2 STRING UINT STRING OUT z LEFT IN ASTR L t 3 j OUT VAST LogicLab user manual 187 LOGI I Description LEN String length function Number of operands 1 Input data type Output data type Examples Description STRING UINT OUT LEN ASTRING OUT 7 MID L characters of IN beginning at the P th Number of operands 3 Input data type Output data type Examples Description Number of operands Input data type Output data type Examples Description Number of operands Input data type Output data type Examples STRING UINT UINT STRING OUT MID IN ASTR L 2 P 2 OUT ST REPLACE Replace L characters of IN1 by IN2 starting at the P th character position 4 STRING STRING UINT UINT STRING OUT REPLACH INL ABCDE IN2 X L 2 P 3 3 OUT ABXE RIGHT Rightmost L characters of IN 2 STRING UINT STRING OUT RIGHT IN 7 ASTR L 3 YE OUT STR 4 11 2 INSTRUCTION LIST IL This section defines the semantics of the IL Instruction List language 11 2 1 SYNTAX AND SEMANTICS 11 2 1 1 SYNTAX OF IL INSTRUCTIONS IL code is composed of a sequence of instructions Each instruction begins on a new line and contains an operator with optional modifiers and if necessary for t
76. Cre Glee E au peple Project 9 Programs Ea Fast nit Main 20 LogicLab user manual E am a ee LAB 3 6 ENVIRONMENT OPTI ONS If you click Options in the File menu a multi tab dialog box appears and lets you customize some options of LogicLab General Autosave if the Enable Autosave box is checked LogicLab periodically saves the whole project You can specify the period of execution of this task by entering the number of minutes between two automatic savings in the Autosave interval text box Graphic Editor This panel lets you edit the properties of the LD FBD and SFC source code editors Gere Graphic Editar Text Editors Language Drecloner Tools Fon name Graph Objects Spoon m Network ond color ai Sysh m EH Backgournd rahani colo Tahoma Selection color Tempus Sane ITC Object calor Temunal Text color Selected led colo Tieg Hew Aamar Bakie Ena chi Times New Roman CE Comment coor at Teer bl en eee min PD Jo aeieocboe T Font dimersion w C i T ETE x Libiery Text Editors Language You can change the language of the environment by selecting a new one from the list Shown in this panel After selecting the new language press the Select button and confirm by clicking OK This change will be effective only the next time you start LogicLab General Graphic Editor Text Editors Language Directories Tools Default nae
77. DITI ONS As explained in the SFC language reference a step can be assigned to an action and a transition can be associated with a condition code Actions and conditions can be coded in any of the IEC 61131 3 languages General purpose debugging tools can be used within each action condition as if it was a stand alone POU 9 4 2 LD ANI MATI ON In live debug mode Ladder Diagram schemes are animated by highlighting the contacts and coils whose value is true in the example il and i2 timRit elapeeaT 750 LogicLab user manual 119 LOGI LAB Note that the LD animation manager tests periodically the state of all the elements It may happen that an element remains true for a slot of time too short to be displayed on the video The fact that an element is never highlighted does not imply that its value never becomes true the sampling rate may be too slow 9 4 3 FBD ANIMATION In live debug mode LogicLab displays the values of all the visible variables directly in the graphical source code editor iwz qUare Wave filter ing whith walt Wu wall oyip irs Ai ad ons Wre m A o o ee ee see fe ee Cre ere gee eed eh eh ai a th Filter KON Y toe SEL R DE Co a FALSE Sutra gt ii i Yali aFittjo 1000 Galis Fei This works for both FBD and LD programming language timRit TON pt e elapsedT 750 Note that once again this tool is asynchronous 9 4 4 ILAND S
78. Demag LogicLab user manual 89 oe 7 3 COMMAND LINE COMPILER LogicLab s compiler can be used independently from the IDE in LogicLab s directory you can find an executable file Command line compiler which can be invoked for example in a batch file with a number of options In order to get information about the syntax and the options of this command line tool just launch the executable without parameters LL Ler pr ri Fy PGCE GTE GGUS r Filo gt ie A re Fis conn target F Bs FU VAD ile 0 pud 1 9 HUTE 90 the Flans A ATTE al Unwn lond compi led project dl ppt slrensde conpiled wall compile it ra ord be the project ttreving to connects Grppile the project without connecting Hchuild and download the project Gonerate bradoere in the destination File default Doefault h gt Gontrate the target variable trach Fale fdofauwlt Default occ gt bonerate the global variable track File default Dofault oce 7 Force the commuhicatlon propertias Force the target hoard type Tiueti fo download code without opening the projects Perform download achnowlsdga request Rebuild the project teving to connects Rohuild the peoject without connecting Forforn download without checking For Updated sour e status Append the output to the destination File fall ooly with GI G6 Flagqes Generate eedicteibitablea co
79. EATING A NEW LD DOCUMENT See the Creating and Editing POUs section Paragraphs 5 1 1 and 5 1 2 6 3 2 ADDING REMOVING NETWORKS Every POU coded in LD consists of a sequence of networks A network is defined as a maximal set of interconnected graphic elements The upper and lower bounds of every network are fixed by two straight lines while each network is delimited on the left by a grey raised button containing the network number On each LD network the right and the left power rail are represented according to the LD language indication On the new LD network a horizontal line links the two power rails It is called the power link On this link all the LD elements contacts coils and blocks are to be placed You can perform the following operations on networks To add a new blank network click Network gt New in the Scheme menu or press one of the equivalent buttons in the Network toolbar To assign a label to a selected network give the Network gt Label command from the Scheme menu This enables jumping to the labeled network To display a background grid which helps you to align objects press View grid inthe Network toolbar To add a comment press the Comment button in the FBD toolbar 6 3 3 LABELING NETWORKS You can modify the usual order of execution of networks through a jump statement which transfers the program control to a labeled network To assign a label to a network double click the raised gr
80. Hew object fal 7 2 iig gram Ta De PLE Object properties Alt Enter Example i S12 Object Browser INT Programs ra e Compile MuPi Recompile all Function Generate redistributable source module Note that LogicLab automatically saves all changes to the project before starting the compilation 7 1 1 IMAGE FILE LOADING Before performing the actual compilation the compiler needs to load the image file img file which contains the map of memory of the target device If the target is connected when compilation is started the compiler seeks the image file directly on the target Oth erwise it loads the local copy of the image file from the working folder If the target device is disconnected and there is no local copy of the image file compilation cannot be carried out you are then required to connect to a working target device us LogicLab user manual 87 LOGIC LAB PlcExzanple img error I000l Invalid memory image file Please upload memory image from the target 7 2 COMPILER OUTPUT If the previous step was accomplished the compiler performs the actual compilation then prints a report in the Output bar The last string of the report has the following format m warnings n errors It tells the user the outcome of compilation n gt 0 Condition n 0 m gt 0 n m 0 Description Compiler error s The PLC code contains one or more serious errors which cannot be worked around
81. Horizontal scale 1000 made Buffer size 40000 samples 9 2 7 SAVING AND PRINTING THE GRAPH LogicLab allows you to persist the acquisition either by saving the data to a file or by print ing a view of the data plotted in the Oscilloscope 9 2 7 1 SAVING DATA TO A FILE You can save the samples acquired by the Oscilloscope to a file in order to further analyze the data with other tools 1 You may want to stop acquisition before saving data to a file 2 Click onthe Save tracks data into file inthe Oscilloscope toolbar 3 Choose between the available output file format osc is a simple plain text file con taining time and value of each sample OSCX is an XML file that includes more complete information which can be further analyzed with another tool provided separately from LogicLab Oscilloscope XML files SSC Oscilloscope XML files OSC 3 O cillos Fole files iS H 4 Choose a file name and a destination directory then confirm the operation 116 LogicLab user manual 9 2 7 2 PRINTING THE GRAPH Follow this procedure to print a view of the data plotted in the Oscilloscope 1 Either suspend or stop the acquisition Oscilloscope HEA kee Seo E BOO 2 Move the time slide bar and adjust the zoom in order to include in the view the ele ments you want to print Frb HH ae eae eee sl kf S CEET E midde TI 3 Click on the Print graph item Oscilloscope Heo ESAE
82. I 4 Examples OUT ATAN2 1 0 1 0 OUT 3 4 PI OUT ATAN2 1 0 0 0 OUT PI 2 SI NH Description Hyperbolic sine Computes the hyperbolic sine function of input 0 Number of operands 1 Input data type LREAL where available REAL otherwise Output data type LREAL where available REAL otherwise Examples OUT SINH 0 0 OUT 0 0 LogicLab user manual 181 LOGIC I Description Number of operands Input data type Output data type Examples Description Number of operands Input data type Output data type Examples Description Number of operands Input data type Output data type Examples Description Number of operands Input data type Output data type Examples COSH Hyperbolic cosine Computes the hyperbolic cosine function of input 0 1 LREAL where available REAL otherwise LREAL where available REAL otherwise OUT COSH 0 0 OUT 1 0 TANH Hyperbolic tangent Computes the hyperbolic tangent function of input 0 1 LREAL where available REAL otherwise LREAL where available REAL otherwise OUT TANH 0 0 OUT 0 0 CEI L Rounding up to integer Returns the smallest integer that is greater than or equal to input 0 1 LREAL where available REAL otherwise LREAL where available REAL otherwise OUT CEIL 1 95 OUT 2 0 OUT CHIL 1 29 je OUT lt 1 0 FLOOR Rounding down to integer Re
83. III LOGIC LAB Power rails Link elements and states Contacts Coils Operators functions and function blocks Structured Text ST Expressions Statements in ST Sequential Function Chart SFC Steps Transitions Rules of evolution LogicLab Language Extensions Macros Pointers LogicLab user manual 195 195 196 197 198 198 198 199 204 204 206 207 209 209 210 LOGIC LAB OVERVIEW LogicLab is an 1EC61131 3 Integrated Development Environment supporting the whole range of languages defined in the standard In order to support the user in all the activities involved in the development of an applica tion LogicLab includes textual source code editors for the Instruction List briefly IL and Structured Text briefly ST programming languages see Chapter 6 graphical source code editors for the Ladder Diagram briefly LD Function Block Dia gram briefly FBD and Sequential Function Chart briefly SFC programming lan guages see Chapter 6 a compiler which translates applications written according to the IEC standard directly into machine code avoiding the need for a run time interpreter thus making the pro gram execution as fast as possible see Chapter 7 a communication system which allows the download of the application to the target environment see Chapter 8 arich set of debugging tools ranging from an easy to use watch window to more pow erful tools wh
84. INPUT Or VAR OUTPUT as defined in the keywords section followed in the case of VAR by zero or one occurrence of the qualifiers RETAIN NON_RE TAIN or the qualifier CONSTANT and in the case of VAR INPUT Or VAR OUTPUT by zero or one occurrence of the qualifier RETAIN or NON_RETAIN followed by one or more decla rations separated by semicolons and terminated by the keyword END_VAR A declaration may also specify an initialization for the declared variable when a programmable control ler Supports the declaration by the user of initial values for variables 11 1 5 2 STRUCTURING ELEMENT The declaration of a variable must be performed within the following program structuring element KEYWORD RETAIN CONSTANT Declaration 1 Declaration 2 Declaration N END VAR LogicLab user manual 169 es a ee I 11 1 5 3 KEYWORDS AND SCOPE Keyword Variable usage VAR Internal to organization unit VAR_INPUT Externally supplied Supplied by organization unit to external VAR OUTPUT i entities Supplied by external entities can be modified within organization unit Supplied by configuration via VAR_GLOBAL can be modified within organization unit VAR GLOBAL Global variable declaration VAR IN OUT VAR EXTERNAL The scope range of validity of the declarations contained in structuring elements is local to the program organization unit POU in which the declaration part is contained That Is the declared variables are
85. ModuleName Location 122 LogicLab user manual es ee IM where X Trigger identifier Name of the program function or function block where the trigger was placed Exact location of the trigger within module ModuleName ModuleName If ModuleName is in IL Location has the following format N1 Otherwise if ModuleName is in FBD it becomes N2SBT BID Location where N1 Instruction line number network number N2 BT block type operand function function block etc BID block identifier Controls section This dialog box allows the user to better control the refresh of the trigger window to get more information on the code under scope A detailed description of the function of each control is given in the Trigger window controls section see 9 5 2 11 All controls except Ac the Accumulator display button are not accessible until at least one variable is dragged into the debug window The Variables section This lower section of the Debug window is a table consisting of a row for each variable that you dragged in Each row has four fields the name of the variable its value its type and its location task ModuleName read from memory during the last refresh Trigger n 0 at MAINES Ac Cm 2110 Triggered Condition None Trigger For 1 After 9 5 1 4 TRIGGER WINDOW DRAG AND DROP INFORMATION To watch a variable you need to copy it to the lower section of the Debug window
86. OU where the network is located Graphic languages are used to represent the flow of a conceptual quantity through one or more networks representing a control plan Namely in the case of function block dia grams FBD the Signal flow is typically used analogous to the flow of signals between elements of a signal processing system Signal flow in the FBD language is from the out put right hand side of a function or function block to the input left hand side of the function or function block s so connected 11 3 3 EVALUATION OF NETWORKS 11 3 3 1 ORDER OF EVALUATION OF NETWORKS The order in which networks and their elements are evaluated is not necessarily the same as the order in which they are labeled or displayed When the body of a program organiza tion unit POU consists of one or more networks the results of network evaluation within said body are functionally equivalent to the observance of the following rules 1 No element of a network is evaluated until the states of all of its inputs have been evaluated 2 The evaluation of a network element is not complete until the states of all of its out puts have been evaluated 3 As stated when describing the FBD editor a network number is automatically as signed to every network Within a program organization unit POU networks are evaluated according to the sequence of their number network N is evaluated before network N 1 unless otherwise specified by means of the e
87. OW The Watch window is one of the many debugging tools supplied by LogicLab Among the other debugging tools it is worth mentioning the Oscilloscope see Paragraph 9 2 trig gers and the live debug mode see Paragraph 9 4 Watch r EAN Symbol Value Type Loca mm CNT_1 ENABLE TRUE BOOL PLC FE PROVASTRU STRUTTURA PLC w REALE 0 584264 REAL PLi Inter INT PLC E cnt_o CONTATORE PLC FF CONTATORE PLE mm ENABLE FALSE BOOL PLC mm RESET FALSE BOOL PLC COUNTER 0 UINT PLC FE 1 CONTATORE PLE SE 2 CONTATORE PLC i CONTATORE PLE ll LA 1 1 5 THE LIBRARY WINDOW The Library window contains a set of different panels which fall into the categories ex plained in the following paragraphs You can choose the display mode by clicking the right button of your mouse In the View list mode each element is represented by its name and icon Instead a table appears in the View details mode each row of which is associated with one of the embedded elements The latter mode also displays the Type Operator Function and the description of each element If you right click one of the elements of this panel and you click Object properties from the dialog box then a window appears with further details on the element you selected input and output supported types name of input and output pins etc 1 1 5 1 OPERATORS AND STANDARD BLOCKS Th
88. PLEX E Enumerations HYDROCARBON a SubRanges H h T Eii Macro 5 4 4 3 DELETING A SUBRANGE Follow this procedure to delete a subrange 1 Right click the subrange name and choose Delete from the contextual menu Project pe x Project amp Definitions me mT E c PlcExample Definitions CJ TypeDefs UINTS_T 5 C Structures FE COMPLEX 5 5 Enumerations HYDROCARBON 5 I SubRanges g for Properties 2 Confirm your choice P Delete the selected PLE Object NS Type Subrange Name WATER TEMPERATURE 5 5 BROWSING THE PROJECT Projects may grow huge hence LogicLab provides two tools to search for an object within a project the Object browser andthe Find in project feature 5 5 1 OBJECT BROWSER LogicLab provides a useful tool for browsing the objects of your project the Object browser 52 LogicLab user manual Ober hker Fragrant Doane Function Blades la Furchans Fade Slarcliend lune rer Lite tee val dee LOGIC LAB Hare F Evie obit Bets TF res PE sreD IN TA FFE CresP sEsbeliNMT BH Ta CreePaE rabint C Type Function Hooks Furractiores Funchons Funciare E Lisesr Hors _ Haan igr f F TAIG Function blocks Checeal Checkinone elle Function Hooks D Funchan blocks Pigse Function Hoes Eher litez fF A_TAIG Function blocks Hiir x Ae T AS Function blocks I ir A Furehor blocks Ta T Boo
89. RD PAR MACRO lobyte hibyte END PAR i CODEXST 4 lobyte SHL TO_UINT hibyte 8 END MACRO Whenever the macro name appears in the source code it is replaced along with the ac tual parameter list in case of function like macros with the macro body For example given the definition of the macro MAKEWORD and the following Structured Text code frag ment w MAKEWORD bl b2 the macro pre processor expands it to w bl SHL TO_UINT b2 8 11 7 2 POINTERS Pointers are a special kind of variables which act as a reference to another variable the 1pointed variable The value of a pointer is in fact the address of the pointed variable in order to access the data stored at the address pointed to pointers can be dereferenced Pointer declaration requires the same syntax used in variable declaration where the type name is the type name of the pointed variable preceded by a sign VAR lt pointer name gt lt pointed variable type name gt END_VAR For example the declaration of a pointer to a REAL variable shall be as follows VAR px REAL END_VAR A pointer can be assigned with another pointer or with an address A special operator ADR is available to retrieve the address of a variable px py px and py are pointers to REAL that is vari ables of type REAL px ADR x x 1S a variable of type REAL px x is an alternative notation for ADR The operator is
90. S You can edit some basic properties of the project such as application name and version in the window which pops up after you select the item Options inthe Project menu Project info Code generation Debug Build events Release Version Author Nate The information you enter here is shown in any printed document and may also be down loaded to the target device LogicLab user manual 27 EF am a m I 4 7 SELECTING THE TARGET DEVICE You may need to port a PLC application on a target device which differs from that you originally wrote the code for Follow the instructions below to adapt your LogicLab project to a new target device 1 Click Select target inthe Project menu of the LogicLab main window This causes the following dialog box to appear Select target Available Targets Cancel 2 Select one of the target devices listed in the combo box 3 Click Change to confirm your choice Cancel to abort 4 Ifyou confirm LogicLab displays the following dialog box 5 This operation requires to save the project 7 Continue the operation Press Yes to complete the conversion No to quit If you press Yes LogicLab updates the project to work with the new target It also makes a backup copy of the project file s in a sub directory inside the project directory so that you can roll back the operation by manually i e using Windows Explorer replacing the project file s with t
91. Show lime ber Show tracks ist DJ Bufler roe 40000 samples Tiacks list Valueddiv Oftset Marne Urii TERA BER AE 10 I sco L 2 er Hide Show value Fnat F nat EF Her vi Confirm your settings The graph adapts to reflect the new scale Oscilloscope settings Show ond Barok poling rate ms Realrata 7537 Hofizonial scale 5000 melde Show lime ber Show tracks ist Bifleree 40000 samples 4 Tiacks list VYalieds OF Set Frat FEF Iter yt ia i0 By Pir E Hide Show value 111 LogicLab user manual Oacdiosc oe x HAR RAR fa nj pE SSG Le phessdssesbessslersstios bit pleads fe Peers Perea eye aera wy mevdes SOOO OO L i 1 53905 fa 05 uF act Fest fbeite uf You can also zoom in and out with respect to both the horizontal and the vertical axes Deciioscope x Deciloscope x HEA BANKE 20 mupe Su HARB BRKE ea mupli 6a Finally you may also quickly adapt the scale of the horizontal axis the vertical axis or both to include all the samples by clicking on the corresponding item of the toolbar Deciloscope x Oacdioscone x HH Bea eb eae woe ls 6 HASH Ree fae eos Si oat Pete ete sssles a rn 000 00 Hu eT 112 LogicLab user manual 9 2 5 3 VERTICAL SPLIT When you are watching the evolution of two or more variables you may want to split the respective tracks For this purpose click on the Vertical split item in the Oscillo scope toolbar Deciloscope x
92. T ANIMATION The live debug mode also applies to textual source code editors the ones for IL and ST You can quickly watch the values of a variable by hovering with the mouse over it Wut O01 Analog output 0 analog inp 0 analog inp 1 lt 0018 0019 aoutO ainpl ainpl onen MESE SFC state logic 0022 D023 fhStatit enab inplO run inpll stop inpl 3 D024 025 cht ont 1 D026 0027 29133 Mnman 9 5 TRI GGERS 9 5 1 TRIGGER WINDOW The Trigger window tool allows you to select a set of variables and to have them updated synchronously in a special pop up window 120 LogicLab user manual LOGI I 9 5 1 1 PRE CONDITIONS TO OPEN A TRIGGER WINDOW No need for special compilation LogicLab debugging tools operate at run time Thus unlike other programming languages such as C the compiler does not need to be told whether or not to support trigger windows given a PLC code the compiler s output is unique and there is no distinction between debug and release version Memory availability A trigger window takes a segment in the application code sector having a well defined length Obviously in order to start up a trigger window it is necessary that a sufficient amount of memory is available otherwise an error message appears Incompatibility with graphic trigger windows A graphic trigger window takes the whole free space of the application code sector There fore once such
93. T3 IN1 ED 54 14 1592 ST INSTSSEN2 CAL INST3 LD INST5 OUL ST VRED ED TNSTS ODT2 ST VVALID This method of invocation is equivalent to a CAL with an argument list which contains only one variable with the name of the FB instance Input arguments are passed to output arguments are read from the FB instance through ST LD operations performed on operands taking the following form FBInstanceName IO var where Keyword Description FBInstanceName Name of the instance to be invoked IO var Input or output variable to be written read 11 3 FUNCTI ON BLOCK DI AGRAM FBD This section defines the semantics of the FBD Function Block Diagram language 11 3 1 REPRESENTATION OF LINES AND BLOCKS The graphic language elements are drawn using graphic or semi graphic elements as shown in the table below No storage of data or association with data elements can be associated with the use of connectors hence to avoid ambiguity connectors cannot be given any identifier LogicLab user manual 191 LOGI I Feature Example Lines i Line crossing with connection Blocks with connecting lines and unconnected pins 11 3 2 DI RECTION OF FLOW IN NETWORKS A network is defined as a maximal set of interconnected graphic elements A network label delimited on the right by a colon can be associated with each network or group of networks The scope of a network and its label is local to the program organization unit P
94. W FROM AN FBD MODULE In order to watch the value of a variable you need to add it to the trigger window Let us assume that you want to inspect the value of variable k of the FBD code in the figure below To this purpose press the Watch button in the FBD bar The cursor will become as follows Now you can click the block representing the variable you wish to be shown in the trigger window In the example we are considering click the button block k gt A dialog box appears listing all the currently existing instances of debug windows and asking you which one is to receive the object you have just clicked mW Trigger n 0 at MAINFBD 3 0 3 ripe es Cnt 0 Condition Debug windows list Sette WIE Ue PEGE oR SOs Oe Oo Oe Bee elas Me Sar Scher cen at hore oor Penner Jj rigger Symbol to add k Debug windows Watch Oscilloscope Trigger n 0 at MAINFBD S 0 3 In order to display the variable k in the trigger window select its reference in the Debug windows column then press OK The name of the variable is now printed in the Symbol column LogicLab user manual 129 LOGIC LAB ek Ac Cri 53 Condition Ga None Trigger For events Alter Symbol Value kK 0 The same procedure applies to all the variables you wish to inspect Once you have added to the Graphic watch window all the variables you want to ob serve you can
95. ab Whatever the PLC language you are using LogicLab allows you to disregard the syntax above as it supplies a friendly interface for using functions 11 1 6 2 FUNCTI ON BLOCKS I ntroduction For the purposes of programmable controller programming languages a function block is a program organization unit which when executed yields one or more values Multiple named instances copies of a function block can be created Each instance has an associ ated identifier the instance name and a data structure containing its input output and internal variables All the values of the output variables and the necessary internal vari ables of this data structure persist from one execution of the function block to the next therefore invocation of a function block with the same arguments input variables does not always yield the same output values Only the input and output variables are accessible outside of an instance of a function block i e the function block s internal variables are hidden from the user of the function block In order to execute its operations a function block needs to be invoked by another POU ts LogicLab user manual 173 LOGI I Invocation depends on the specific language of the module calling the function block The scope of an instance of a function block is local to the program organization unit in which it is instantiated Declaration syntax The declaration of a function must be perfor
96. ance name Calls function block er 1 Returns from called program function or function block ee E Evaluates deferred operation 11 2 3 CALLING FUNCTI ONS AND FUNCTI ON BLOCKS 11 2 3 1 CALLING FUNCTI ONS Functions as defined in the relevant section are invoked by placing the function name in the operator field This invocation takes the following form LD 1 MUX 5 Vvar0 ST VRES Note that the first argument is not contained in the input list but the accumulator is used Ow oe as the first argument of the function Additional arguments starting with the 279 quired are given in the operand field separated by commas in the order of their decla ration For example operator Mux in the table above takes 5 operands the first of which is loaded into the accumulator whereas the remaining 4 arguments are orderly reported after the function name 190 LogicLab user manual LOGI I The following rules apply to function invocation 1 Assignments to VAR_INPUT arguments may be empty constants or variables 2 Execution of a function ends upon reaching a RET Instruction or the physical end of the function When this happens the output variable of the function is copied into the accumulator Calling Function Blocks Function blocks as defined in the relevant section can be invoked conditionally and un conditionally via the CAL operator This invocation takes the following form LD A ADD 5 ol ING
97. aneous divergent transition divergent pin Add simultaneous Adds a new pin to the selected simultaneous convergent pin convergent transition Remove simultaneous convergent pin Removes the rightmost pin from the selected simultaneous divergent transition SOU eT TE e e AG fe se gt Increases the distance between the two rightmost pins of the currently selected transition in order to let the SFC subnet linked to the pin on the left contain divergent branches ty Shift pin right ol 162 LogicLab user manual E am ee Button Description Decreases the distance between the two rightmost 1 Shift pin left p pins of the currently selected transition Allows the user to create a new action to be associated with one of the steps When you press New action code this button LogicLab asks you which language you want to use to implement the new action then opens the corresponding editor Allows the user to write the code to be associated with one of the transitions When you press this button LogicLab asks you which language you want to use to implement the new transition then opens the corresponding editor New transition code ti h So ba THE ae Button Command Description 1 Library manager Opens the library manager Asks you whether to save unsaved changes then On he launches the LogicLab compiler Asks you whether to save unsaved changes th
98. ange the name and the logical direction input output Opens the editor by which the selected object was created and displays the relevant source code if the object is a program or a function or a function block this command opens the relevant source code editor View source i i i i if the object is a variable or a parameter then this command opens the corresponding variable editor if the object is a standard function or an operator this command opens nothing 10 2 3 LD TOOLBAR TH APE OO 6 0 0 Activates the parallel insertion mode All contacts Insert parallel inserted in this mode will be inserted in parallel with the actually selected contacts Activates the series insertion mode All contacts inserted in this mode will be inserted on the HF Insert series right of the currently selected contact block If a connection is selected the new contact will be placed in the middle of the connection segment ki E Insertion of a new contact according to the selected mode series or parallel Insert negated Insertion of a new negative contact according to contact the selected mode series or parallel Insert rising Insertion of a new rising edge contact according to edge contact the selected mode serial or parallel Mm Insert falling Insertion of a new falling edge contact according edge contact to the selected mode serial or parallel i Insertion of a new coil attached to the right power Ins
99. ariable Standard coil symbols are shown in the following table Name Coil Negated coil SET latch coil RESET unlatch coil Positive transition sensing coil Negative transition sensing coil The state of the left link Is copied to the associated Boolean variable The inverse of the state of the left link is copied to the associated Boolean variable that is if the state of the left link is OFF then the state of the associated variable is ON and vice versa The associated Boolean variable Is set to the ON state when the left link is in the ON state and remains set until reset by a RESET coil The associated Boolean variable Is reset to the OFF state when the left link is in the ON state and remains reset until set by a SET coll The state of the associated Boolean variable is ON from one evaluation of this element to the next when a transition of the left link from OFF to ON is sensed The state of the associated Boolean variable is ON from one evaluation of this element to the next when a transition of the left link from ON to OFF is sensed LogicLab user manual 197 LOGI I 11 4 5 OPERATORS FUNCTIONS AND FUNCTION BLOCKS The representation of functions and function blocks in the LD language is similar to the one used for FBD At least one Boolean input and one Boolean output shall be shown on each block to allow for power flow through the block as shown in the following
100. arithm Computes the logarithm with base 10 of input 0 1 LREAL where available REAL otherwise LREAL where available REAL otherwise OUT lt TOG 100 0 J2 OUT 2 0 LogicLab user manual LOG I EXP ES Natural exponential Computes the exponential function of Description input 0 Number of operands 1 Input data type LREAL where available REAL otherwise Output data type LREAL where available REAL otherwise Examples OUT s EXP 1 0 J OUT 2 718281 SIN E Sine Computes the sine function of input 0 expressed in Description radians Number of operands 1 Input data type LREAL where available REAL otherwise Output data type LREAL where available REAL otherwise QUT SIN 0 0 J7 OUT 0 0 Examples OUT z SIN 2 5 3 141592 J OUT 1 0 7 cos EF Cosine Computes the cosine function of input 0 expressed Description in radians Number of operands 1 Input data type LREAL where available REAL otherwise Output data type LREAL where available REAL otherwise OUT COS 0 0 Jy OUT 1 0 Examples OUT COS 3 141592 OUT 1 0 TAN Tangent Computes the tangent function of input 0 expressed in radians Number of operands 1 Description Input data type LREAL where available REAL otherwise Output data type LREAL where available REAL otherwise OUT TAN 0 0 f OUT 0 0 Examples OUT TAN 3 141592 7 4 0 J OUT 1 0 ASIN Arc sine Computes the principal arc
101. art SFC elements to structure the internal organization of a PLC program organization unit POU written in one of the languages defined in this standard for the purpose of performing sequential control functions The definitions in this section are derived from IEC 848 with the changes necessary to convert the representations from a documentation standard to a set of execution control elements for a PLC program organization unit Since SFC elements require storage of state information the only program organization units which can be structured using these elements are function blocks and programs If any part of a program organization unit is partitioned into SFC elements the entire program organization unit is so partitioned If no SFC partitioning is given for a program organization unit the entire program organization unit is considered to be a single action which executes under the control of the invoking entity SFC elements The SFC elements provide a means of partitioning a PLC program organization unit into a set of steps and transitions interconnected by directed links Associated with each step is a set of actions and with each transition is associated a transition condition 11 6 1 STEPS 11 6 1 1 DEFINITION A step represents a situation where the behavior of a program organization unit POU with respect to its inputs and outputs follows a set of rules defined by the associated ac tions of the step A step is either active
102. bug Communication scheme Ed ene Tools at DE amoo PEE Ar we BE AEE The toolbar shows up in the new position LogicLab user manual 15 LOGIC LAB Ta File Edit view Project Debug Communication scheme tameg SEn Tools 2i BaH SiS he Ba th EN 288 of 0 ER AE 0 FE EH eee 4 50 TEE ears a i CS You can change the shape of the toolbar from horizontal to vertical either by pressing the Shift key or by moving the toolbar next to the vertical border of any window Watch Water Description A Description a Symb M st gt gt v ipFlop F_D 4 eee LS moO OP Ee RU s e OS Se O O RE ER ot a gee eM 4 Byes q Ej HI 7 amp wS ma a R BENE Slt OC SS FT Ra r fk CM me A 0 RE ic E O SP we Se E Z ll ES Oe 2 Peet eee R es Se n i a 3 N ian i BB ee dt 1 inap 8 HR 8 me 4 et er RR VER ie eee lh ee ee zal ae Set FoF Fog C a z E a a e Description Absolute value Description Arccosine me Absolute value abla me hi od dikine You can also make the toolbar float either by pressing the CTRL key or by moving the toolbar away from any window border Communication Schame Variaolas Window Took Hel Communication Echame Yariaolas Window Toob Help SMS 2A Res ean B FAM SEGS e HE AS ail Bib TA Fe wet PT KE a B iy Fast my Fast Name 1 Tepe Address Array Init va
103. by the compiler Emission of warning s The PLC code contains one or more minor errors which the compiler automatically spotted and worked around However you are informed that the PLC program may act ina different way from what you expected you are encouraged to get rid of these warnings by editing and re compiling the application until no warning messages are emitted PLC code entirely correct compilation accomplished You should always work with O warnings O errors 7 2 1 COMPILER ERRORS When your application contains one or more errors some useful information is printed in the Output window for each of those errors Dita x Generating unresolved FI conpleled Lode size lir 1 FEvtel Free code space 7FPFROh 511 KETE Data Spate LOO00h 64 Etel Fres data space FFF 63 BEyte Bit data space Oh O Rete Free bot date space Uh O Eyre faten dais space Nh l KE be Free riten data space Oh 1 KBytes WALH 2 wsoniung 51404 pele expression L Fatninge O errcre d h Buld Fron ceases L Debug 4 As you can see the information includes the name of the Program Organization Unit affected by the error the number of the source code line which procured the error whether it is a fatal error error or one that the compiler could work around warn ing the error code the error description LogicLab user manual LOGIC LAB Refer to the appropriate sec
104. c Export to library button Delete objects Function Allows you to delete an object Select the object you want to delete then press the IE Delete object button Multi selection Multi selection is allowed for this mode Select all and Select none buttons are visible 5 5 1 3 USING OBJ ECT BROWSER FOR IMPORT Object browser is also used to support objects importation in the project from a desired external library Select Import object from library inthe Project menu then choose the desired library Project Debug Communication Tools Help New object d d PLC Object properties AteErter JF Object Browser ft Compie EF I T a Racompik al FR Ganarete redistributable source module Imoort obrect from ibrar MB brear manager fiacroa F Select target Ootione LogicLab user manual 59 es a ee I Available objects In this mode you can list objects of these types Programs Function blocks Functions Variables User types These items can be checked or unchecked in Objects filter section to show or to hide the objects of the chosen type in the list Other types of objects Operators Standard functions Local variables Basic types can not be imported so they are unchecked and disabled Available operations Caneel mpart abet Selectal Select nore Import objects is the only operation supported in this mode It is possible to import s
105. cLab user manual 71 LOGI I 6 4 FUNCTION BLOCK DIAGRAM FBD EDITOR The FBD editor allows you to code and modify POUs using FBD i e Function Block Dia gram one of the EC compliant languages 6 4 1 CREATING A NEW FBD DOCUMENT See the Creating and editing POUs section Paragraphs 5 1 1 and 5 1 2 6 4 2 ADDING REMOVING NETWORKS Every POU coded in FBD consists of a sequence of networks A network is defined as a maximal set of interconnected graphic elements The upper and lower bounds of every network are fixed by two straight lines while each network is delimited on the left by a grey raised button containing the network number You can perform the following operations on networks 6 4 3 To add a new blank network click Network gt New in the Scheme menu or press one of the equivalent buttons in the Network toolbar To assign a label to a selected network give the Network gt Label command from the Scheme menu This enables jumping to the labeled network To display a background grid which helps you to align objects press View grid inthe Network toolbar To add a comment press the Comment button in the FBD toolbar LABELING NETWORKS You can modify the usual order of execution of networks through a jump statement which transfers the program control to a labeled network To assign a label to a network double click the raised grey button on the left that bears the network number E NY
106. cessor reaches the beginning of the selected network 9 5 2 7 ADDING A VARIABLE TO A TRIGGER WINDOW FROM AN LD MODULE In order to watch the value of a variable you need to add it to the trigger window Let us assume that you want to inspect the value of variable b in the LD code represented in the figure below To this purpose press the Watch button in the FBD bar The cursor will become as follows LogicLab user manual 131 LOGIC LAB Now you can click the item representing the variable you wish to be shown in the trigger window A dialog box appears listing all the currently existing instances of debug windows and asking you which one is to receive the object you have just clicked Trigger n 0 at MAINLD 1 2 oe AG Cnt Condition Tige Symbol to add b Debug windows Watch Oscilloscope Trigger n 0 at MAINLDH1 In order to display variable B in the trigger window select its reference in the Debug win dow column then press OK The name of the variable is now printed in the Symbol column Trigger n 0 at MAINLD 1 T Ac Condition None Trigger For The same procedure applies to all the variables you wish to inspect Once you have added to the Graphic watch window all the variables you want to ob serve you can press the Normal cursor button so as to restore the original shape of the cursor 132 LogicLab user manual LOGI
107. cks are implemented using a RETURN construction as shown in the table below Program execution is transferred back to the invoking entity when the Boolean input is TRUE and continues in the normal fashion when the Boolean input is FALSE 194 LogicLab user manual E am a ee LAB Unconditional returns are provided by the physical end of the function or function block Symbol Example Explanation x lt RET gt Conditional Return RET Example Return Condition Network ready ae 11 4 LADDER DIAGRAM LD This section defines the semantics of the LD Ladder Diagram language 11 4 1 POWER RAILS The LD network is delimited on the left side by a vertical line known as the left power rail and on the right side by a vertical line known as the right power rail The right power rail may be explicit in the LogicLab implementation and it is always shown The two power rails are always connected with an horizontal line named signal link All LD elements should be placed and connected to the signal link Description Symbol Left power rail with attached horizontal link Right power rail with attached horizontal link Power rails connected by the Signal link 11 4 2 LINK ELEMENTS AND STATES Link elements may be horizontal or vertical The state of the link elements shall be de noted on or OFF corresponding to the literal Boolean values 1 or 0 respectively The term link state shall be synonymous with
108. ct from target in the menu File Edit view Project Debug Communication ey New project A Open project Import project from target Y iew project read only yi tall 2 Select the target device you are connecting to from the list shown inthe Target list window 3 Set up the communication refer to Setting up the communication section for details Target list verify Connection Communication settings Upload Sources Cancel 4 You may optionally test the connection with the target device Target list Modbus 1 1000 M4 COM 1 9600 E 8 1 H Verify Connection p communication settings LogicLab tries to open the connection and reports the test result Connection verified The connection with the target is available 24 LogicLab user manual LOGIC LAB 5 Confirm the operation Target list SiaxProcomm 0 1000 T TCPIP 10 0 0 222 12001 5000 Verify Connection Communication settings Upload Sources i Cancel When the application upload completes successfully the project is open for editing 4 3 SAVING THE PROJ ECT 4 3 1 PERSISTING CHANGES TO THE PROJECT When you make any change to the project for example you add a new Program Organi zation Unit you are required to save the project in order to persist that change To save the project you can select the corresponding item of the menu File or the Main toolbar wiley Edit
109. cted to the double horizontal line are active and the transition condition d associated to the common transition iS TRUE LogicLab user manual LOGI LAB Examples Invalid scheme Equivalent allowed scheme Note Expected behavior an evolution takes place from S30 to S33 if a Is FALSE and d IS TRUE The scheme in the leftmost column IS invalid because conditions d and TRUE are directly linked Expected behavior an evolution takes place from S32 to 31 ifc is FALSE and d IS TRUE The scheme in the leftmost column IS invalid because direct links flow only downwards Upward transitions can be performed via jump blocks 11 7 LOGI CLAB LANGUAGE EXTENSIONS LogicLab features a few extensions to the IEC 61131 3 standard in order to further enrich the language and to adapt to different coding styles 11 7 1 MACROS LogicLab implements macros in the same way a C programming language pre processor does Macros can be defined using the following syntax MACRO lt macro name gt PAR _ MACRO lt parameter list gt END PAR lt macro body gt END MACRO Note that the parameter list may eventually be empty thus distinguishing between ob ject like macros which do not take parameters and function like macros which do take parameters gt Ie LogicLab user manual 209 LOGI I A concrete example of macro definition is the following which takes two bytes and com poses a 16 bit word MACRO MAKEWO
110. ctive or push OK to apply your changes and to close the options tab User defined condition If you define a condition by using this control the sampling process does not start until that condition is satisfied Note that unlike trigger windows once data acquisition begins Samples are taken every time the window manager is triggered regardless of the user condition being still true or not After you enter a condition the control displays its simplified expression Condition AGT 100 Ga 9 6 2 DEBUGGING WITH THE GRAPHIC TRIGGER WINDOW The graphic trigger window tool allows you to select a set of variables and to have them Sampled synchronously and their curve displayed in a special pop up window 9 6 2 1 OPENING THE GRAPHIC TRIGGER WINDOW FROM AN IL MODULE Let us assume that you have an IL module also containing the following instructions WUD 002 ID a 0003 ADD b 004 oT a 005 OO06 ID c Ooo ADD d 008 ar E 009 010 ID k 0011 ADD 1 012 ST H Amts LogicLab user manual 143 Let us also assume that you want to know the value of b qa and k just before the ST k Instruction is executed To do so move the cursor to line 12 UU 0010 EH K 0011 ADD 1 0012 ST H TAN TA Then click the Graphic trace button in the Debug toolbar al A green arrowhead appears next to the line number and the graphic trigger window pops UP F ID a BOOT iD E ST a ip e OOF ADD d SI c p010 ID k
111. derived data types An array is a collection of data elements of the same data type in order to access a single element of the array a subscript or index enclosed in square brackets has to be used Subscripts can be either integer literals or single element variables To easily represent data matrices arrays can be multi dimensional in this case a com posite subscript is required one index per dimension separated by commas The maxi mum number of dimensions allowed in the definition of an array is three 170 LogicLab user manual E am ee LAB 11 1 5 6 DECLARATION SYNTAX Variables must be declared within structuring elements using the following syntax VarNamel Typenamel InitialVall VarName2 AT Location2 Typename2 InitialVal2 1 VarName3 ARRAY 0 N OF Typename3 where Keyword Description Variable identifier consisting of a string of VarNameX alohanumeric characters of length 1 or more It is used for symbolic representation of variables Data type of the variable selected from elementary T x rail data types ee ee the variable assumes after reset of the LocationXx See the next paragraph Index of the last element the array having length N 1 N 11 1 5 7 LOCATION Variables can be represented symbolically i e accessed through their identifier or alter natively in a manner which directly represents the association of the data element with physical or logical locations in
112. dify the value of the associated Boolean variable Standard contact symbols are given in the following table Name Normally open contact Normally closed contact Positive transition sensing contact 196 Symbol 1H The state of the left link is copied to the right link if the state of the associated Boolean variable is ON Otherwise the state of the right link is OFF The state of the left link is copied to the right link if the state of the associated Boolean variable is OFF Otherwise the state of the right 1 1 link is OFF The state of the right link is ON from one evaluation of this element to the next when a transition of the associated variable from OFF to ON is sensed at the same time that the state of the left link is ON The state of the right link shall be OFF at all other times LogicLab user manual Name Negative transition sensing contact 11 4 4 COILS es ee ee I The state of the right link is ON from one evaluation of this element to the next when a transition of the associated Symbol variable from ON to OFF is sensed nh at the same time that the state of the left link is ON The state of the right link shall be OFF at all other times A coil copies the state of the link on its left side to the link on its right side without modi fication and stores an appropriate function of the state or transition of the left link into the associated Boolean v
113. double clicking the name of the object you want to modify you open an editor consist ent with the object type for example when you double click the name of a project POU the appropriate source code editor is shown if you double click the name of a global vari able the variable editor is shown Note that LogicLab prevents you from applying changes to elements of a project when at least one of the following conditions holds You cannot modify any object of the project if you are in debug mode You cannot edit an object of an included library whereas you can modify an object that you imported from a library The project is opened in read only mode view project 4 4 3 CLOSING THE PROJ ECT 4 5 You can terminate the working session either by explicitly closing the project or by exiting LogicLab In both cases when there are changes not yet persisted to file LogicLab asks you to choose between saving and discarding them Ly Save current project 7 To close the project select the item Close project from the File menu LogicLab shows the Welcome page so that you can rapidly start a new working session DISTRIBUTING PROJECTS When you need to share a project with another developer you can send him her either a copy of the project file s or a redistributable source module RSM generated by Logi cLab In the former case the number of files you have to share depends on the format of the project file PLC single
114. e IL code that sets the condition Trigger condition LD a GT 100 Once you have finished writing the condition code click the OK button to install it or press the Esc button to cancel The collection of samples will not start until the Start graphic trace acquisition button is pressed and the user defined condition is true A simplified expression of the condition now appears in the control Condition AGT 100 CJ To modify it press again the relevant button E The text window appears containing the text you originally wrote which you can now edit To completely remove a user defined condition press again on the above mentioned but ton delete the whole IL code in the text window then click OK After the execution of the condition code the accumulator must be of type Boolean TRUE or FALSE otherwise a compiler error occurs Only global variables and dragged in variables can be used in the condition code Namely all variables local to the module where the trigger was originally inserted are out of scope if they have not been dragged into the Debug window Also no new variables can be de clared in the condition window Setting the scale of axes x axis When acquisition is completed LogicLab plots the curve of the dragged in variables ad justing the x axis so that all the data fit in the the Chart window If you want to apply a different scale open the General tab of the Graph properties dialog box type a
115. e LogicLab prints its output messages This window contains four tabs Build Find in project Debug and Resources Cutout P x Preprocessing Global shared completed Preprocessing Menu completed Preprocessing basic completed Preprocessing thermmodel completed Reading symbol file L Applicazioni IEC IEC symeoeml completed Reading target symbol file L Applicazioni IEC IEC syt euml completed 0 warnings 0 errors iF Buld j Findin ptoject 4 Debug Resources Build The Build panel displays the output of the following activities opening a project compiling a project downloading code to a target Find in project This panel shows the result of the Find in project activity Debug The Debug panel displays information about advanced debugging activities for example breakpoints Resources The Resources panel displays messages related to the specific target device LogicLab is interfacing with 1 1 2 THE STATUS BAR The Status bar displays the state of the application at its left border and an animated control reporting the state of communication at its right border Ready EDIT MODE CONNECTED A 1 1 3 THE DOCUMENT BAR The Document bar lists all the documents currently open for editing in LogicLab F fee P r Fast El Main Ep Global variables 2 LogicLab user manual E am a ee LAB 1 1 4 THE WATCH WIND
116. e controller system 174 LogicLab user manual es a ee Declaration syntax The declaration of a program must be performed as follows PROGRAM lt program name gt Declaration of variables see the relevant section Program body END_PROGRAM Keyword Description Program Name Name of the program being declared Specifies the operations to be performed to get the Program body intended signal processing It can be written in any of the languages supported by LogicLab Writing programs in LogicLab Whatever the PLC language you are using LogicLab allows you to disregard the syntax above as it supplies a friendly interface for writing programs 11 1 7 IEC 61131 3 STANDARD FUNCTIONS This paragraph is a reference of all IEC 61131 3 standard functions available in LogicLab along with a few others which may be considered as LogicLab s exstensions to the stand ard These functions are common to the whole set of programming languages and can there fore be used in any Programmable Organization Unit POU A function specified in this paragraph to be extensible Ext is allowed to have a variable number of inputs Type conversion functions According to the IEC 61131 3 standard type conversion functions shall have the form _ TO_ where is the type of the input variable and the type of the output variable for example INT_TO_REAL LogicLab provides a more convenient set of overloaded type con
117. e dragged in variables so that the diagram of each variable is drawn in a separate band It is used to fill in the graph window all the values Show all values sampled for the selected variables in the current recordset Zooming in is an operation that makes the curves in the Chart area appear larger on the screen so that greater detail may be viewed Zooming out is an operation that makes the curves appear smaller on the screen so that it may be viewed in its entirety Horizontal zoom acts only on the horizontal axis This control is used to horizontally center record Horizontal show set samples So first sample will be placed on the all left margin and last will be placed on the right margin of the graphic window Split variables Horizontal Zoom In and Zoom Out Vertical Zoom acts only on the vertical axis This control is used to vertically center record set Samples So max value sample will be placed near top margin and low value sample will be placed on the bottom margin of the graphic window Pushing this button causes a tabs dialog box to appear which allows you to set general user Graphic trigger options affecting the action of the graphic trigger window properties window Since the options you can set are quite numerous they are dealt with in a section apart Click here to access this section Push this button to print both the Chart area and F Print chart the Variables window I Save chart Press th
118. e properties gt C Const Duplicate variable FO Retai Delete yanable X ti Tasks Esport variable to library Copy name Ctrl C 2 Enter the name of the new variable and confirm 42 LogicLab user manual E am a ee LAB 5 2 1 5 DELETI NG A GLOBAL VARI ABLE Follow this procedure to remove a global variable from your project 1 Open the folder in the Project tab of the workspace that contains the variable you want to delete a a Global variables ER Automatic variables E C Analog out 3 di freeAunCourter ui ki ui kp E 40 variables F Constants Retain variables i Tasks 2 Right click the name of the variable you want to delete A context menu appears re ferred to the selected variable E Global variables 3 Automatic variables EF J Analog out 3 di freeRunCounter lui ki al EY o a C 1 0 var Variable properties Consta Duplicate variable a Retain Delete variable E Tasks k Export variable to library Ea Kupy name Chrl C 3 Click Delete variable in the context menu then press Yes to confirm you choice sy Delete the selected PLC Object Type Variable Name kp 5 2 2 LOCAL VARIABLES Local variables are declared within a POU either program or function or function block the module itself being the only project element which can refer to and access them Local variables are listed in the project tree under the POU which declares them
119. e selected network Object gt Lets you assign a name to an instance of a function block Instance name that you have previously selected by clicking it once Opens the editor by which the selected object was created and displays the relevant source code if the object is a program or a function or a function block Object gt this command opens its source code Open source if the object is a variable or a parameter this command opens the corresponding variable editor if the object is a standard function or an operator this command opens nothing If checked enables autoconnection that is automatic creation Auto connect of a logical wire linking the pins of two blocks when they are brought close Delete invalid Removes all invalid connections represented by a red line in connection the active scheme By default some operators like ADD MUL etc have two input pins however you may occasionally need to perform such Increment pins operations on more than two operands This command allows you to add as many input pins as to reach the required number of operands Decrement pins Undoes the Increment pins command Adds the enable in enable out pins to the selected block The code implementing the selected block will be executed only when the enable in signal is true The enable out Signal simply repeats the value of enable in allowing you either to enable or to disable a set of blocks in cascade Shows some pr
120. e variables select them in the editor you may use the CTRL or the SHIFT keys to select multiple elements a l Name Type Address 1 freeRunCounter DINT Auta ACL NG 5k UINT Auto EB iner INT Auto 7 kinilner iNT Auto Te globe Be eae en T 7 9 period REAL MOA 10 tau REAL MD 11 valueFilt REAL MVA 8 19 bulimi Dew Mba AN LogicLab user manual 83 LOGIC Then click on the De ete record in the Project toolbar i mx Init value Attribute Notice that you cannot delete the RESULT of an IEC61131 3 FUNCTION JIS ad Class pr Name Type 1 RESULT ff Undefined 6 6 5 SORTING VARIABLES You can sort the variables in the editor by clicking on the column header of the field you want to use as the sorting criterion 5 Name Type At z4 Name Type At ER FEAL oy fu av ifreeRuntCounter DINT Auto 1 valueFilt 3 valueRef REAL WMI SE eid pan 7 period REAL a MI ey INS INT Auto f 5 period REAL So full a klnilner INT Auto gt ie 7 valueFilt REAL Mi 7 jiner INT Auto a valueRet REAL off A freeRunCounter DINT Auto 84 LogicLab user manual LOGIC LAB 6 6 6 COPYING VARIABLES The variables editor allows you to quickly copy and paste elements You can either use keyboard shortcuts or the Edit menu to access these features Wey Project Debug Communication variables Window Tools Hep
121. ecked displays the Network toolbar otherwise hides it If checked displays the Document bar otherwise hides it If checked displays the Force I 0 bar otherwise hides it If checked displays the Workspace also called Project window otherwise hides it If checked displays the Libraries window otherwise hides it LogicLab user manual Command Output Async Graphic window Watch window Full screen Grid 10 1 4 PROJECT MENU Command New object Copy object Paste object Duplicate object Delete object PLC object properties Object browser Compile Recompile all Generate redistributable source module Import object from library Export object to library Library manager Macros Select target Options EF am ee I Description If checked displays the Output window otherwise hides it If checked displays the Oscilloscope window otherwise hides it If checked displays the Watch window otherwise hides it Expands the currently active document window to full screen Press Esc to restore the normal appearance of the LogicLab interface If checked displays a dotted grid in a graphical source code editor background Description Opens another menu which lets you create a new POU or declare a new global variable Copies the object currently selected in the Workspace Pastes the previously copied object Duplicates the object currently selected in the Workspace and
122. elected objects by clicking on Import objects button or by double clicking on one of the objects in the list Multi selection Multi selection is allowed for this mode Select all and Select none buttons are visible 5 5 1 4 USING OBJ ECT BROWSER FOR OBJ ECT SELECTION Object browser dialog is useful for many operations that requires the selection of a single PLC object So Object browser can be used to select the program to add to a task to se lect the type of a variable to select an item to find in the project etc Available objects Available objects are strictly dependent on the context for example in the program as Signment to a task operation the only available objects are programs objects It is possible that not all available objects are selected by default Available operations cawd o o In this mode it is possible to select a single object by double clicking on the list or by click ing on the OK button then the dialog is automatically closed Multi selection Multi selection is not allowed for this mode Select all and Select none buttons are not visible 60 LogicLab user manual LOGIC LAB 5 5 2 SEARCHING WITH THE FIND IN PROJ ECT COMMAND The Find in project command retrieves all the instances of a specified character string in the project Follow the procedure to use it correctly 1 Click Find in project inthe Edit menu or in the Main toolbar File Edit View Project Debug Communication GE
123. en Recompile all launches the LogicLab compiler to recompile the whole project Connect to the LogicLab tries to establish a connection to the target target LogicLab checks if any changes have been applied since last compilation and compiles the project if this is the case Then it sends the target the compiled code l Code download New macro Defines a new macro Opens the object browser which lets you navigate a Br OWser between objects PLC Obj Shows properties and description of the object properties currently selected in the Workspace e E Adds a new row to the table in the currently active editor if PLC editor to the table of local variables if parameters editor to the table of parameters etc KA PAI BES rocord Deletes the variable in the selected row of the currently active table E BER Insert record Generate T redistributable Creates an RSM file of the project source module LogicLab user manual 163 LOGIC LAB 10 2 6 NETWORK TOOLBAR fin Fee er Button Command Description Adds a blank network at the top of the active LD Insert Top FBD document Adds a blank network at the bottom of the active LD FBD document Adds a blank network after the selected network in the active LD FBD document Adds a blank network before the selected network in the active LD FBD document If checked displays a dotted grid in the LD FBD editor background Insert B
124. er because of the context so cannot be browsed LogicLab user manual 53 LOGIC LAB User can also click Check all button to select all available objects at one time or can click Check none button to deselect all objects at one time Other filters Uther liters Here Location Obay All Vers inpe al Selected objects can be also filtered by name symbol location specific library and var type Filters are all additive and are immediately applied after setting Function Set of legal values Use Applies to Ubect hker Programe 3 Function Bloods a Furctons Variables E User toes Name Filters objects on the base of their name All the strings of characters Type a string to display the specific object whose name matches the string Use the wildcard if you want to display all the objects whose name contains the string in the Name text box Type if you want to disable this filter Press Enter when edit box is focused or click on the OK button near the edit box to apply the filter All object types T panter T brTodite Funcion TT iTos ord Firestone Slsrirlend finere _ Lineal a able _ Fade fiom Check all Check pore Other llei Home Ae Lacalan All Librai AI Ware ive ll Carca 54 Geren Edet al Select ane LogicLab user manual E am ee LAB Symbol location Filters objects on the base of their location All Pr
125. er you can suspend the acquisition by clicking on Pause acquisition Declines ope x HAR H RE SKET ere a SE LogicLab user manual 109 oe The curve freezes while the process of data acquisition is still running in background until you click on Restart acquisition Oscilloscope x HAN ASA RAD p g oo ma di 1936 84 In order to stop the acquisition you may click on Stop acquisition 0 scilloscope x HHA BAAR AHA ge 6H ms div 1935 84 In this case when you click on Restart acquisition the evolution of the value of the variable is plotted from scratch 9 2 5 2 SETTING THE SCALE OF THE AXES When you open the Oscilloscope LogicLab applies a default scale to the axes However if you want to set a different scale you may follow this procedure 1 Open the graph properties by clicking on the corresponding item in the toolbar Oslos oe x NEA eee a0 mpg Su 110 LogicLab user manual m am a ee LAB Set the scale of the horizontal axis which is common to all the tracks 2 Dsciloscope setings Show gid amok polling rate fo Aealrata 2010 Show Ime ber Hoizonal scak jaod madd Show tracks ist Butler rre 40000 samples Tiacke list Vahevds Oflset Hide Show value ea Fast FEF Hes ao 20 244 T26 O E 3 For each variable you may specify a distinct scale for the vertical axis Oscilloscope setings Show grid Samgk poling rate ms Realraa 2295 Hoizonlal scale HET reed
126. ert coil Pas Insert contact IS LogicLab user manual 161 LOGI LAB Button Command Description Insert negated Insertion of a new negative coil attached to the coil right power rail AAE Insert set Insertion of a new set coil attached to the right contact power rail 2 Insertion of a new reset coil attached to the right Insert reset coil i power rail Insert rising Insert positive transition sensing coil to the right edge contact power rail Insert falling Insert negative transition sensing coil to the right edge contact power rail 10 2 4 SFC TOOLBAR te RAPP BEEF An S ee e a Button Command Description Inserts a new step into the currently open SFC NEN SEED document Adds a new transition to the currently open SFC Add transition document Adds a new jump block to the currently open SFC Add jump document Adds a new pin to the selected divergent Add divergent pin transition Remove divergent Removes the rightmost pin from the selected pin divergent transition Add convergent Adds a new pin to the selected convergent pin transition Remove convergent Removes the rightmost pin from the selected pin convergent transition Add simultaneous Adds a new pin to the selected simultaneous divergent pin divergent transition Remove Removes the rightmost pin from the selected simultaneous ae Simult
127. es i 51 2 5 1 3 5 1 4 5 2 Syl 5 22 5 3 5 3 1 5 3 2 5 4 54 1 52 5 4 3 5 4 4 se Bel BB 5 6 6 1 6 1 1 6 1 2 6 1 3 6 1 4 6 2 6 2 1 6 2 2 6 2 3 6 2 4 Distributing projects Project options Selecting the target device Working with libraries The library manager Exporting to a library I mporting from a library or another source Managing project elements Program Organization Units Creating a new Program Organization Unit Editing POUs Deleting POUs Source code encryption Variables Global variables Local variables Tasks Assigning a program to a task Task configuration Derived data types Typedefs Structures Enumerations Subranges Browsing the project object browser Searching with the Find in project command Working with LogicLab extensions Editing the source code Instruction List IL editor Editing functions Reference to PLC objects Automatic error location Bookmarks Structured Text ST Editor Creating and editing ST objects Editing functions Reference to PLC objects Automatic error location LogicLab user manual 26 27 28 28 28 30 31 33 33 33 34 35 36 37 37 43 44 44 45 45 45 47 49 50 52 52 61 63 65 65 65 65 65 66 66 66 66 67 67 6 2 5 6 3 631 6 3 2 633 6 3 4 6 3 5 6 3 6 6 3 7 6 3 8 6 3 9 6 3 10 6 3 11 6 4 6 4 1 6 4 2 6 4 3 6 4 4 6 4 5 6 4 6 6 4 7 6 4 8 6 5 6 5 1 6 5
128. evaluated first followed by cos B followed by evaluation of the product Functions are invoked as elements of expressions consisting of the function name fol lowed by a parenthesized list of arguments as defined in the relevant section 198 LogicLab user manual es ee LAB 11 5 1 4 OPERATORS OF THE ST LANGUAGE Operation Symbol Precedence Parenthesization lt expression gt HIGHEST Function evaluation lt fname gt lt arglist gt Negation Complement NOT Exponentiation Multiply Divide Modulo MOD Add Subtract i Comparison A 5 2S SS Equality Inequality lt gt Boolean AND AND Boolean Exclusive OR XOR Boolean OR O LOWEST 11 5 2 STATEMENTS IN ST All statements comply with the following rules they are terminated by semicolons unlike IL a carriage return or new line character is treated the same as a space char acter LogicLab does not set any constraint on the maximum length of statements ST statements can be divided into classes according to their semantics 11 5 2 1 ASSIGNMENTS Semantics The assignment statement replaces the current value of a single or multi element variable by the result of evaluating an expression The assignment statement is alSo used to assign the value to be returned by a function by placing the function name to the left of an assignment operator in the body of the function declaration The value returned by the function is the result of the
129. ew amesa Debug Communication Tools Help i A E P Mew object II Project El Projec E PLC Object properties AlteEnter ei Recompile all ial EE Ep Generate redistributable source module Import object from library Available objects In this mode you can list objects of these types Programs Function Blocks Functions Variables User types These items can be checked or unchecked in Objects filter section to show or to hide the objects of the chosen type in the list Other types of objects Operators Standard functions Local variables Basic types can not be browsed in this context so they are unchecked and disabled Available operations O Cares Expertto ibrar Dektecbecte Opancowce Setectal Selectrone 58 LogicLab user manual LOGIC LAB Allowed operations in this mode are Open source default operation for double click on an item Opens the editor by which the selected object was created AUSSI and displays the relevant source code If the object is a program or a function or a function block this button opens the relevant source code editor Use If the object is a variable then this button opens the variable editor Select the object whose editor you want to open then click on the Open source button Export to library Function To export an object to a library Select the objects you want to export then press the a
130. ey button on the left which bears the network number This causes a dialog box to appear where you can type the label you want to associate with the selected network Network label New network label Laber E Ok If you press OK the label is printed in the top left hand corner of the selected network Labels 68 LogicLab user manual E am a ee LAB 6 3 4 INSERTING CONTACTS To insert new contacts on the network apply one of the following options Select a contact a block or a connection Select the insertion mode between serial or parallel using the button on the LD toolbar or the Scheme menu Insert the appropriate contact using the button on the LD toolbar the Scheme gt 0bject gt New or the pop up menu option For serial insertion the new contact will be inserted on the right side of the selected contact block or in the middle of the selected connection depending on the element selected before the insertion For parallel insertions several contacts blocks can be selected before performing the insertion The new contact will be inserted at the endpoints of the selection block 0001 Step 1 Step 2fa Drag a boolean variable to the desired place over a connection For example global variables can be taken from the Workspace window whereas local variables can be se lected from the local variables editor The dialog box shown below will appear request ing to define whether the variable sh
131. f the Workspace window lets you define derived data types 5 4 1 TYPEDEFS The following paragraphs show you how to manage typedefs LogicLab user manual 45 LOGIC LAB 5 4 1 1 CREATING A NEW TYPEDEF In order to define a new typedef follow this procedure 1 Right click the TypeDefs folder and choose New TypeDef from the contextual menu Definitions Froject B 2 PIcE sample Detinitions Met oo E Structure hal Hew TypeDet Fa Enumeral c SubR anges 9 Macro DE 2 Type the name of the typedef New Typedef Name UINTE T Er Init Value Description 3 Select the type you are defining an alias for Mew Typedef Name UINTS_T Type Lan Aray FE Init Value hal UIHTE T Object browser Elbjects titer Y Hame Devito Pr rigid itz Operation Kr BOOL Functor Blocks BYTE firich enoa hector ll CUNT pad sti sha it 7 Loreal anshi ra 2 PAT User ips T Basic pes t L REAL F Si SINT Check al l roset et STRING hed LICHT Other Albers uil LMT Name fu z nn HEER e WOAD Locaho A if you want to define an alias for an array type you shall choose the array size 46 LogicLab user manual Type Basic ner Basic tyes Basic bynes Basic types Basic types Basic types Basic tpoes Basic ioes Basic types Basic types Basir tanes LOGIC LAB 4 Enter a meaningful descri
132. ft parenthesis modifier indicates that evaluation of the operator must be de ferred until a right parenthesis operator is encountered The form of a parenthesized sequence of instructions is shown below referred to the instruction accumulator accumulator AND SMX1 3 OR MX1 4 The modifier c indicates that the associated instruction can be performed only if the value of the currently evaluated result is Boolean 1 or Boolean 0 if the operator is com bined with the Nn modifier 11 2 2 STANDARD OPERATORS Standard operators with their allowed modifiers and operands are as listed below Supported operand Operator types Acc type Semantics Op type LD Any Any Sets the accumulator equal to operand ST Any Any Stores the accumulator into operand location LogicLab user manual 189 LOGIC LAB Operator AND OR XOR NOT ADD SUB MUL DIV MOD GT GE EQ NE LE LT JMP CAL REL Supported operand types Acc_type Semantics Op_type aa BOOL BOOL Sets operand to TRUE If accumulator IS TRUE a BOOL BOOL Sets operand to FALSE If accumulator IS TRUE Any but o Any but Logical or bitwise AND Ar oe ay ut Logical or bitwise OR Any but oa Any but Logical or bitwise XOR Any but REAL Logical or bitwise NOT Addition Subtraction Multiplication Division Modulo division Comparison Comparison Comparison Comparison Comparison Comparison Jumps to label oc N FBinst
133. ful description and confirm the operation New Structure Name COMPLEX Description Complex number 5 4 2 2 EDITING A STRUCTURE The structures of the project are listed under the Structures folder In order to edit a structure for example to define its fields you have to double click on its name Project fay Project Definitions o PicExample Definitions Re i REAL No A SAN ee ee UINTE T a i Structures Array Init Value 5 4 2 3 DELETING A STRUCTURE Follow this procedure to delete a structure 1 Right click the structure name and choose Delete from the contextual menu Project T Definitions E gt PlcE sample Definitions El TypeD efs UINTS_T SE 9 Structures TJ Enumerations Properties SubRanget Macro 2 Confirm your choice e Delete the selected PLO Object 7 E gt Type Structure Mame COMPLEX 48 LogicLab user manual LOGIC LAB 5 4 3 ENUMERATI ONS The following paragraphs show you how to manage enumerations 5 4 3 1 CREATI NG A NEW ENUMERATI ON Follow this procedure to create a new enumeration 1 Right click the Enumerations folder and choose New enumeration from the contex tual menu EA EF Project amp Definitions E Definitions EF xo PlcExample Definitions C TypeDefs UINTS_T a amp Structures a COMPLEX La New Enumeration New Enumeration Lat New Enumeration fa Enumerations C SubRan
134. g and drop it into the Watch window The Watch window should display the value of the Counter variable which should increment continuously LogicLab user manual 2 3 M am aj ee LAB Address Arar Inita lue Attrib You are at the end of this very simple but complete edit compile download debug work ing session with LogicLab Further steps you should take in order to acquire a deeper knowledge of the tool include the use of the other languages function amp function blocks global variables libraries real time debugging and so on Refer to the following sections of this manual to obtain the necessary information A MORE COMPLEX EXAMPLE In the SampleProjects Sample subdirectory of your LogicLab installation you can find a more complex VPLC1 example which offers an overview of IEC 61131 3 languages To open the project use the File Open project menu option and open VPLC1Sample ppjs or select it from Example projects list in the welcome page LogicLab user manual 13 LOGIC LAB 14 LogicLab user manual es a ee LAB 3 USING THE ENVIRONMENT This chapter shows you how to deal with the many UI elements LogicLab is composed of in order to let you set up the IDE in the way which best suits to your specific development process 3 1 LAYOUT CUSTOMI ZATION The layout of LogicLab s workspace can be freely customized in order to suit your needs LogicLab takes care to save the layout configuration on app
135. ges Ca Macro 2 Type the name of the enumeration New Enumeration Name HYDROCARBON Description 3 Enter a meaningful description and confirm the operation New Enumeration Name Description 5 4 3 2 EDITING AN ENUMERATION The enumerations of the project are listed under the Enumerations folder In order to edit an enumeration for example to define its values you have to double click on its name Poeg x Le WY oF TEk DER Project amp Definitions B ot PleExample Definitions J TypeDets UINTET S J Structures FE COMPLEX E Enumeration HYDROCARBON SubR anges Macro Init value LogicLab user manual 49 LOGIC LAB 5 4 3 3 DELETING AN ENUMERATION Follow this procedure to delete an enumeration 1 Right click the enumeration name and choose Delete from the contextual menu 2 Confirm your choice 5 4 4 SUBRANGES The following paragraphs show you how to manage subranges EE Project amp Definitions a Se ee ee a E 0 PleExample Definitions El TypeDets UINTET El ca Structures MS COMPLEX El Enumeration ORE p SubRanges Properties J Macro Delete the selected PLC Object Type Enumeration Name HYDROCARBON 5 4 4 1 CREATING A NEW SUBRANGE Follow this procedure to create a new subrange 1 Right click the Subranges folder and choose New Subrange from the contextual menu A Pioject amp Definitions E 2 PleExarnple
136. h If you want the values to be refreshed the first time the window is triggered select None and press the single step button otherwise set the counter to I and select For If you want the values to be refreshed the first X times the window is triggered set the counter to X and select For If you want the values to be refreshed after Y times the window is triggered set the coun ter to Y and select After Triggers and conditions settings become the actual settings when the triggering is re Started Watching the accumulator As stated in the Refresh of values section see 9 5 1 5 when you insert a trigger on an instruction line you establish that the variables in the relative debugging window will be updated every time the processor reaches that location before the instruction itself is ex ecuted In some cases for example when a trigger is placed before a ST statement it can be useful to know the value of the accumulator This allows you to forecast the outcome of the instruction that will be executed after all the variables in the trigger window have been updated To add the accumulator to the trigger window click on the Accumulator display button Defining a condition This control enables users to set a condition on the occurrences of a trigger By default this condition is set to TRUE and the values in the debug window are refreshed every time the window manager is triggered If you want to put a restriction on the ref
137. h along the horizontal axis The lower section of the Oscilloscope is a table consisting of a row for each variable 9 2 1 OPENING AND CLOSING THE OSCILLOSCOPE To open the Oscilloscope click on the Async button of the Main toolbar EJERE E To close the Oscilloscope click on the Async button again Ba aia E Alternatively you can click on the Close button in the top right corner of the Oscillo scope window LogicLab user manual 105 LOGIC In both cases closing the Oscilloscope means simply hiding it not resetting it As a mat ter of fact if you open again the Oscilloscope after closing it you will see that plotting of the curve of all the variables you added to it starts again 9 2 2 ADDING ITEMS TO THE OSCI LLOSCOPE In order to plot the evolution of the value of a variable you need to add it to the Oscil loscope Note that unlike trigger windows and the Graphic trigger window you can add to the Oscilloscope all the variables of the project regardless of where they were declared 9 2 2 1 ADDI NG A VARI ABLE FROM A TEXTUAL SOURCE CODE EDITOR Follow this procedure to add a variable to the Oscilloscope from a textual that is IL or ST source code editor select a variable by double clicking on it and then drag it into the Oscilloscope window Er ecu 0001 0002 ID sunig2 j noo AUDI 1072 aand ST sun lO 0005 1006 ID Sunt noo ADD wiz 0008 ST uni MIE noid ID k Lim Min value He
138. have finished removing libraries press either OK to confirm or Cancel not to apply changes 4 8 2 EXPORTING TO A LIBRARY You may export an object from the currently open project to a library in order to make that object available to other projects The following procedure shows you how to export objects to a library 1 2 4 5 Look for the object you want to export by browsing the tree structure of the project tab of the Workspace bar then click once the name of the object Click Export object to library in the Project menu This causes the following dialog box to appear Espot bo brat Code ermcmpiion Enter the destination library by specifying the location of its p file You can do this by typing the full pathname in the white text box Clicking the Browse button in order to open an explorer dialog box which allows you to browse your disk and the network You may optionally choose to encrypt the source code of the POU you are exporting in order to protect your intellectual property Click OK to confirm the operation otherwise press Cancel to quit If at Step 3 of this procedure you enter the name of a non existing p file LogicLab creates the file thus establishing a new library 4 8 2 1 UNDOING EXPORT TO A LIBRARY So far it is not possible to undo export to a library The only possibility to remove an ob ject is to create another library containing all the objects of
139. he SFC editor is endowed with functions common to most graphic applications running on a Windows platform namely Selection of a block Selection of a set of blocks by pressing Ctr left button Cut Copy and Paste operations of a single block as well as of a set of blocks Drag and drop Some of these functions are accessible through the Edit menu or through the Main tool bar 6 6 VARIABLES EDITOR LogicLab includes a graphical editor for both global and local variables that supplies a user friendly interface for declaring and editing variables the tool takes care of the trans lation of the contents of these editors into syntactically correct IEC 61131 3 source code As an example consider the contents of the Global variables editor represented in the following figure Mame Type Address Group Array Init value Attribute I gA BOIL Auto No TRUE 10 gB REAL Auto 0 4 SCO 11 gt REAL WMO 20 No 1 0 LogicLab user manual 79 E am a ee I The corresponding source code will look like this VAR_GLOBAL gA BOOL TRUE gB ARRAY 0 4 OF REAL gC AT MD60 20 REAL 1 0 END_VAR VAR_GLOBAL CONSTANT gD INT 74 END_VAR 6 6 1 OPENING A VARI ABLES EDITOR 6 6 1 1 OPENI NG THE GLOBAL VARI ABLES EDITOR In order to open the Global variables editor double click on Global variables in the project tree Project x fe Project Definitions El peple Project J Programs ES Funct
140. he backup copy 4 8 WORKING WITH LIBRARIES Libraries are a powerful tool for sharing objects between LogicLab projects Libraries are usually stored in dedicated source file whose extension is p 4 8 1 THE LIBRARY MANAGER Project library list Remove Remove all mt ai ReLIAt Close The library manager lists all the libraries currently included in a LogicLab project It also allows you to include or remove libraries T 28 LogicLab user manual LOGI LAB To access the library manager click Library manager in the Project menu 4 8 1 1 INCLUDING A LIBRARY The following procedure shows you how to include a library in a LogicLab project which results in all the library s objects becoming available to the current project Including a library means that a reference to the library s p file is added to the cur rent project and that a local copy of the library is made Note that you cannot edit the elements of an included library unlike imported objects If you want to copy or move a project which includes one or more libraries make sure that references to those libraries are still valid in the new location 1 Click Library manager in the Project menu which opens the Library manager dialog box 2 Press the Add button which causes an explorer dialog box to appear to let you select the p file of the library you want to open 3 When you have found the p file open it either by double
141. he particular op eration one or more operands separated by commas Operands can be any of the data representations for literals and for variables The instruction can be preceded by an identifying label followed by a colon Empty lines can be inserted between instructions Example 188 LogicLab user manual E am a ee LAB Let us parse a small piece of code START LD 41X1 Push button ANDN MX5 4 Not inhibited ST SOXZ Fan out The elements making up each instruction are classified as follows Operator Label modifier Comment ANDN SMX5 4 Not inhibited Fan out Semantics of I L instructions Accumulator By accumulator a register is meant containing the value of the currently evaluated re Sult Operators Unless otherwise specified the semantics of the operators is accumulator accumulator OP operand That is the value of the accumulator is replaced by the result yielded by operation OP applied to the current value of the accumulator itself with respect to the operand For instance the instruction AND Ix1 is interpreted as accumulator accumulator AND IX1 and the instruction GT 1w10 will have the Boolean result TRUE if the current value of the accumulator is greater than the value of input word 10 and the Boolean result FALSE otherwise accumulator accumulator GT IW10 Modifiers The modifier n indicates bitwise negation of the operand The le
142. he programmable controller programming languages specified by IEC 61131 3 standard Note the definition and editing of the most part of the common elements variables structured elements function blocks definitions etc are managed by LogicLab through specific edi tors forms and tables LogicLab does not allow to edit directly the source code related to the above mentioned common elements The following paragraphs are meant as a language specification To correctly manage common elements refer to the LogicLab user guide 11 1 1 BASIC ELEMENTS 11 1 1 1 CHARACTER SET Textual documents and textual elements of graphic languages are written by using the Standard ASCII character set 11 1 1 2 COMMENTS User comments are delimited at the beginning and end by the special character combina tions and respectively Comments are permitted anywhere in the program and they have no syntactic or semantic significance in any of the languages defined in this standard The use of nested comments e g NESTED is treated as an error 11 1 2 ELEMENTARY DATA TYPES A number of elementary i e pre defined data types are made available by LogicLab all compliant with IEC 61131 3 standard The elementary data types keyword for each data type number of bits per data element and range of values for each elementary data type are described in the following table Keyword Datatype Bits _ Range BOOL Oto 1 SINT Sh
143. he same reason the duration of a step activity can never be considered to be zero Testing of the successor transition condition s of an active step shall not be performed until the effects of the step activation have propagated throughout the program organization unit in which the step is declared LogicLab user manual 207 LOGI I Sequence evolution table This table defines the syntax and semantics of the allowed combinations of steps and transitions Example 208 Rule Normal transition An evolution from step 33 to step S4 takes place if and only if step 3 is in the active state and the transition condition c IS TRUE Divergent transition An evolution takes place from s5 to s6 if and only if s5 is active and the transition condition e iS TRUE or from s5 to s8 only if S5 is active and f Is TRUE and e IS FALSE Convergent transition An evolution takes place from s7 to S10 only if S7 Is active and the transition condition h is TRUE or from s9 to S10 only if S9 is active and j is TRUE Simultaneous divergent transition An evolution takes place from s11 to S12 14 only if S11 is active and the transition condition b associated to the common transition IS TRUE After the simultaneous activation of S12 14 etc the evolution of each sequence proceeds independently Simultaneous convergent transition An evolution takes place from S13 S15 to S16 only if all steps above and conne
144. here is the local variables editor The variables editor allows to add remove copy and paste variable definitions Name Type Address Array Init value Attribute Description The textual source code editor is placed in the bottom part of the window 6 Insert a new local variable by pressing the Insert record button in the Project toolbar Alternatively you can use the Insert option of the Variables menu 7 Edit the name for example Counter and the type of the variable A double click in the type field opens the type selection dialog Choose the INT data type 8 Implement a simple counter in ST language as shown below ie Main Hame Type Address Array inii value Attrib ute Description _ 1 counter INT Auto Ho i A i aadi gaga imple counter Dona counter counter 1 9 In order to be executed the program Main has to be assigned to a task In the Workspace window right click on the Slow task and select the Add program option The Object browser window pops up C Function blocks lt C Functions m Global variables E Tasks Task properties 10 LogicLab user manual E am ee LAB 10 Select the Main program and click OK The picture below shows the Workspace win dow after the successful completion of the operation Programs Dpanatcre _ Fuinchor Bloke reii Shariclerd furecticins Panales C bees aabbe User toes Basin types F rk
145. herwise an error message appears LogicLab user manual 137 LOGIC 9 6 1 2 GRAPHIC TRIGGER WINDOW INTERFACE Setting a graphic trigger causes a pop up window to appear which is called Interface window This is the main interface for accessing the debugging functions that the graphic trigger window makes available It consists of several elements as shown below 4 lt Caption bar at Ey z FY x VEN o S H eS Eg bl Cnt 0 lt Controls bar lt Chart area eT eee nn eae _ Track Min value Max value vidiv Red cursor Blue cursor Note Variables window The caption bar The Caption bar at the top of the pop up window shows information on the location of the trigger which causes the variables listed in the Variables window to be sampled The text in the caption has the following format ModuleName Location Where Name of program function or function block where the trigger was ModuleName placed Exact location of the trigger within module ModuleName If ModuleName IS INIL ST Location has the format N1 Otherwise if ModuleName is in FBD LD it becomes Location NZSBIre BID N1 instruction line number N2 network number BT block type operand function function block etc BID block identifier The Controls bar This dialog box allows you to better control the working of the graphic trigger window A detailed description of the function of each control is given in the Gra
146. ich allows the sampling of fast changing data directly on the target envi ronment ensuring the information is accurate and reliable See Chapter 9 THE WORKSPACE The figure below shows a view of LogicLab s workspace including many of its more com monly used components Workspace Source code aidan dilo Document bar Watch window t ed Poisi e Gorn ahere kabes Aaa Took rep nee SE HSG S BADER Bh UBErs ER Pill ca FF_O Tus ar BET oe BaeT oe e Ladder logic hSchemsd i inpll auti boSehees ol i Dpedewn logis an she eut moukS incor IF mt3 2047 THEA ire TO_LIRT pall ELSIF saut 2048 THEA ince TOIT velo EHD_IF iE dneleg cutpot snalog 3 saut sinpi sinpi iE SFC mtata logic rd res irra ii hisa Alin taris tresRuncouner 2 incr 3 mid 3 4 vaie H Ends quadra T pu Ends qusdra reprocseeing alobal shared completed A Ti rider A Fraproosrsirg Ham completed rs ae parean Fraprozarrirg baric complet Fraprozessirg blerheojsl completed Fiii AL Reedarg eymbol fils CL sA pplicecioni ECES 2ys xml comp lated F Peedi target spabol file L gt Appliocsziomi IED IET sav VER eo pL ts 0 warnings 0 SPPpcrs Output window Library window Status bar LogicLab user manual 1 LOGI I The following paragraphs give an overview of these elements 1 1 1 THE OUTPUT WINDOW The Output window is the place wher
147. igned to each task see Paragraph 5 3 1 1 6 2 DEFINITIONS The Definitions panel contains the definitions of all user defined data types such as structures or enumerated types 1 1 6 3 RESOURCES The contents of the Resources panel depends on the target device LogicLab is interfacing with it may include configuration elements schemas wizards and so on LogicLab user manual 5 eee I 1 1 7 THE SOURCE CODE EDITORS The LogicLab programming environment includes a set of editors to manage edit and print source files written in any of the 5 programming languages defined by the IEC 61131 3 standard see Chapter 6 Name i E ine y Ades Aray INSU HoatErebled he 7 Auta Ha Hateinnice d Suto Ho T at aa OB htEnaiiad ciesa 1 inpl inpli 1 TET He o1 te Tpedown logic on anaita output I i would amuk incr IF amut p hi THER incr TO_IHTi vald i ELSIF sats d 204 0 THER ino vr TS DATE yall Yi sk 7 me E e e e e a a a a S Ln e ee eS eg es a EHD IF SER pam ia dnsleg catput f anslog inp 0 enal af odinis rf The definition of both global and local variables is supported by specific spreadsheet like editors HEME The Address Group ana Initvalue AMA ute Desert 7 rtp Art I t e Ince INT Alta Analog outa Ho J 3 period REAL SEDII Gnda quadra Ho 0 4 al UBF IL REAL SMA Onda guada MO 0 5 au REAL KOTO Onde guada Mo I E valug
148. ileiz Hire WF EiT te AW EiT oord TF Hule Tehi Te Briel wond JFF TRIG Fo TF Pulse H TANG Ae FEER Utami Slsrrlernd hiii _ bob wa wl 1E _ Fals IE fr hesk nene Home Lacslcin Fm Hiap limma m as msan me m mm mmm m CE a EEA ie Esper iira Function Set of legal values Use Applies to Object hter _ Programs Functian Blac Funchans Lh arable E Lbser ne Check all Dither lileiz Home Lacslen G Libesiy LANI Al Vare ine a Constant Cancel Relan 56 TF TOF TEHN Word aBil Deme fB Vars Type Select al Type Functions Furtar Fureton Honka Furelans Function blocks Function Blocks Function blocks Funchan block Function Desks Function books Function blocks Furchon blocks Function Hoes Furcion blocs Select none _ _sm Filters global variables and system variables also known as firmware variables according to their type All Normal Constant Retain All Shows all the global and system variables Normal Shows normal global variables only Constant Shows constants only Retain Shows retain variables only Variables Doane Slartlerd fine lid Lineal tes allie _ Feb i uioes _Eheck none ata Hes Yarabi Yarables Varwble War ables Varlatles Ware bless Variables Yarables War ba Dee Varia thes Venable variables Variables
149. ing of a row for each variable that you dragged in Each row has several fields as shown in the picture below T ak im Min value Max value uidiv Red cursor Blue cursor Note Field Description Track Name of the variable Um Unit of measurement Min value Minimum value in the record set Max value Maximum value in the record set LogicLab user manual 139 LOGI I Field Description Cur value Current value of the variable How many engineering units are represented by a unit V div of the y axis i e the space between two ticks on the vertical axis Bie Gursor Value of the variable at the intersection with the line identified by the blue cursor Value of the variable at the intersection with the line identified by the red cursor Value of the variable at the intersection with the line identified by the horizontal cursor Red cursor Horz cursor Note that you can drag into the graphic trigger window only variables local to the module where you placed the relative trigger or global variables or parameters You cannot drag variables declared in another program or function or function block 9 6 1 4 SAMPLING OF VARIABLES Let us consider the following example The value of the variables is sampled every time the window manager is triggered that is every time the processor executes the instruction marked by the green arrowhead How ever you can set controls in order to have variable
150. int Removes all the active breakpoints Lists all the active breakpoints Adds removes a text trigger Adds removes a graphic trigger Removes all the active triggers Lists all the active triggers Switches the debug mode on Switches the live debug mode on 10 1 6 COMMUNICATION MENU Command Download code Connect Settings Upload IMG file Start Stop watch value 156 Description LogicLab checks if any changes have been applied since last compilation and compiles the project if this is the case Then it sends the target the compiled code LogicLab tries to establish a connection to the target Lets you set the properties of the connection to the target If the target device is connected lets you upload the img file Freezes resumes refreshment of the Watch window LogicLab user manual es a ee LAB 10 1 7 SCHEME MENU Command Description Network gt New gt Top Adds a blank network at the top of the active LD FBD document Network gt New gt Adds a blank network at the bottom of the active LD FBD Bottom document Network gt New gt Adds a blank network before the selected network in the Before active LD FBD document Network gt New gt Adds a blank network after the selected network in the active After LD FBD document Assigns a label to the selected network so that it can be MECN OG REEE indicated as the target of a jump instruction Object gt New Lets you insert a new object into th
151. ion blacks Fe Functions Fs Global aT is Fy Tasks Proeck Project 2 D ehriliois jami Type Addr a E ppc Pope freeR unCounter BINT Auto Progiane intr INT Aude EF CJ Function blocks period REAL ENID By Functions valueFilt REAL Sa MUN coo a ee a ES a ul m ETS En REAL WME T 170 vaiabies valusR et REAL SMC Cann Lei RIT iulu a eal Ratan tabh kinil rier INT Sulu 6 6 1 2 OPENING A LOCAL VARIABLES EDITOR To open a local variables editor just open the Program Organization Unit the variables you want to edit are local to Project x E peple Project i Programs Ba Fast Init E Meditm H Function blocks E Functions El Global variables 80 LogicLab user manual E am a ee LAB Project X B Man EB Proect R Derili Type ihe E 1 fhSchema Schema Aulo a A pepe Pioject Progiante 2 jent IHT Aude Te Fast 3 fa Siati Stali Auta EJ inii 5 Lah F hegit LHL i Function blocks ete i Latter logic 7 Functions noo FSL F eig A Sschenat al anp0 a Global variable a005 auti fbSchens ol 6 6 2 CREATING A NEW VARI ABLE In order to create a new variable you may click on the Insert record item in the Pro ject toolbar asui Init value Attribute 0 TRUE 1 0 T4 CONSTANT Alternatively you may access the Variables menu and choose Insert sabes Window Tools Help lnsert Automatic 2 aa Window Too
152. ion which is the result of the evaluation of a single Boolean expression A transition condition which is always true is represented by the keyword TRUE whereas a transition condition always false is symbolized by the keyword FALSE A transition condition can be associated with a transition by one of the following means Representation Description TRUE By placing the appropriate Boolean constant TRUE x FALSE adjacent to the vertical directed link 206 LogicLab user manual E am a ee I Representation Description One By declaring a Boolean variable whose value H determines whether or not the transition is cleared By writing a piece of code in any of the languages FrogName Supported by LogicLab except for SFC The result of the evaluation of such a code determines the transition condition The scope of a transition name is local to the program organization unit POU in which the transition is located 11 6 3 RULES OF EVOLUTION Introduction The initial situation of a SFC network is characterized by the initial step which is in the active state upon initialization of the program or function block containing the network Evolutions of the active states of steps take place along the directed links when caused by the clearing of one or more transitions A transition is enabled when all the preceding steps connected to the corresponding tran sition symbol by directed links are active The clearing of a transiti
153. is button to save the chart Trigger counter Vertical show all Crt 25 100 This read only control displays two numbers with the following format x y x Indicates how many times the debug window manager has been triggered since the graphic trigger was installed Y represents the number of samples the graphic window has to collect before stopping data acquisition and drawing the curves Trigger state This read only control shows you the state of the Debug window It can assume the fol lowing values LogicLab user manual 141 es ee I No sample s taken as the trigger has not occurred during the Ready current task execution Sample s collected as the trigger has occurred during the Triggered current task execution The trigger counter indicates that a number of samples has been collected satisfying the user request or memory constraints thus the acquisition process is stopped Communication with target interrupted the state of the trigger window cannot be determined 9 6 1 6 GRAPHIC TRIGGER WINDOW OPTIONS In order to open the options tab you must click the Properties button in the Controls bar When you do this the following dialog box appears General Syncronous oscilloscope settings 1 Show grid Fz Horizontal scale 500 samples div Showtime bar v Buffer size 65535 samples max 65535 Show tracks list v Condition a Tracks list Unit Value div Offset Hide 1 E Cont
154. is panel lists basic language elements such as operators and functions defined by the IEC 61131 3 standard Ix A65 Function Absolute value kgl acos Function Arccosine ADD Operator Arithmetic addiction SND Operator Logical bitwise AND lt ASIN Function Arcsine Function Archangent Target variables thermmodel LogicLab user manual 3 LOGI LAB 1 1 5 2 TARGET VARIABLES This panel lists all the system variables also called target variables which are the inter face between firmware and PLC application code i Jad InPo INT Soho 1 DEB ANALOG BDIGITAL EN incremental position i Ad Nuci INT Soh 12 DEB ANALOG DIGITAL EN DSP cycles without position increment di Ad PeSp CINT YoMo 10 DEB ANALOG DIGITAL EM calculated speed i ad Seof IMT oh DEB ANALOG DIGITAL EN sine channel offset di Ad_viPo CINT oO Z DEB ANALOG DIGITAL EN virtual position di Ad iPolni SMV 216 DEB ANALOG DTGITAL EM 4 Operator and aaa blocks 4 Target variables thermmodel 1 1 5 3 TARGET BLOCKS This panel lists all the system functions and function blocks available on the specific target device Linea x Hame Type Creseriptian A ga yc Magirteol ono Furictior Checks messages fiom angle aks iil S ab icelnterchioneP k Firda enhe hie erd of an Aberpalated sir Ji aP ediren noe Fipicticiri Asets an ntenpolahed single aes mn F Shep Finer Bs tar coment bask inthe alec FF s
155. key 9 6 2 10 USING CONTROLS This paragraph deals with graphic trigger window controls which allow you to better Supervise the working of this debugging tool so as to get more information on the code under scope Enabling controls When you set a trigger all the elements in the Control bar are enabled You can start data acquisition by clicking the Start graphic trace acquisition button If you defined a user condition which is currently false data acquisition does not start even though you press the apposite button Ld On the contrary once the condition becomes true data acquisition starts and continues until the Start graphic trace acquisition button is released regardless for the con dition being or not still true if you release the Start graphic trace acquisition button before all the required Samples have been acquired the acquisition process stops and all the collected data get lost 150 LogicLab user manual LOGI LAB Defining a condition This control enables users to set a condition on when to start acquisition By default this condition is set to true and acquisition begins as soon as you press the Enable Disable acquisition button From that moment on the value of the variables in the Debug win dow is sampled every time the trigger occurs In order to specify a condition open the Condition tab of the Options dialog box then press the relevant button A text window pops up where you can write th
156. key or by moving the tool window away from the main window borders Symbol i Symbol A tool window can be resized by clicking and dragging on its border until the desired size is reached X watch x X Watch x A ey eb lo li A cer Ph r ia le Symbol Value Type Location gt l gt 18 LogicLab user manual LOGIC LAB 3 4 WORKING WITH WINDOWS LogicLab allows to open many source code editors so that the workspace could get rather messy You can easily navigate between these windows through the Document bar and the Win dow menu BRED 1 Hop FUR F Cacade nis ee 4 4 by e 7 dange boone e m S F tae E Fat mE EE Ever By Gbbalvaiables Running Glass F Harme Type TER Intvalue Abu te re S 7 var MOTE nabl ed AIL Ma FALBE Transition result er zsa 2 Ivar Motu ninte g HOOL Mo FALBE Transition resuli cea 3 WaR MOE Topp ed AIL Mo FALBE Transition resul TE Saa RAR n DINT Mo i s Running 5 VAR Running BOOL Mo FALBE Transition resul B AR_INPUT 0 ena AOL Mo FALBE IE yaR_INPUT 1 nun AOL Mo FALBE iiaii e si as oT M 3 4 1 THE DOCUMENT BAR The Document bar allows to switch between all the currently open editors simply by click ing on the corresponding name H at j hati FE Ep Soba variables qf gunring 7 Class i F Hame Tepe i Init val ue th bute kan MotEnabled OL sss FASE z VAR Blot Run ring
157. l JE Figams T TBool Logit Programs Ceiriad Progra a _Cest_ BOO Programs a 1P ii Localan Libtaiy All Yapiga All Cancel Esport to Eben Delle objecti Open ace Saec al Select none This tool is context dependent this implies that the kind of objects that can be selected and that the available operations on the objects in the different context are not the same Object browser can be opened in these three main ways Browser mode Import object mode Select object mode User interaction with Object browser is mainly the same for all the three modes and is described in the next paragraph 5 5 1 1 COMMON CHARACTERISTICS AND USAGE OF OBJ ECT BROWSER This section describes the features and the usage of the Object browser that are com mon to every mode in which Object browser can be used Objects filter Obyects Fiber G Fragiame Operators IF Functor Blocks af Furcos E ET TE Waitiebles Local vaias Jre lyper _ Bare lipe lthectal Cheek none This is the main filter of the Object browser User can check one of the available ena bled object items In this example Programs Function Blocks Functions are selected so objects of this type are shown in the object list Variables and User types objects can be selected by user but objects of that type are not currently shown in the object list Operators Standard functions Local variables and Basic types cannot be checked by us
158. lication exit in order to persist your preferences between different working sessions 3 2 TOOLBARS 3 2 1 SHOWING HIDING TOOLBARS In details in order to show or hide a toolbar open the View gt Toolbars menu and select the desired toolbar for example the Function Block Diagram bar Edt W Fod Debug _ Communication scheme variables window Tods Help ig iM Man toolbar AS Bo E ii Tool windows j x lau A ar El Full screen Chil Debug bar Chiba z g Te a aE 5 FBD bar Em Gnd FED bap ect ol ee Likes Billets M Mare popie Frajact SFL bat Chis i J Piogiame Page bal Crh 2 FlipFlop ce Mr Fact sa J Filte EE irit Mehua Cri EL E Main x Document bar Crh s W JJ Function blocks 3 tesplit_o hy Scheme TIE T Slali EJ Funetore Global venables The toolbar is then shown hidden EE Fic Edt Wea Project Dabog communication Scheme Yariablas Window Tool ee e FL Hia aG maap ehr a S a O Iet are E i EH A z i BS FE el Project Is a Fact EH Project FE Defies ead Hame Type Add omre i opie 00 Hise 70 Riaz a Programs 2 foFlpFlap FFD Auto ae Si a oriiter TusF liter Auta aa 4 Ep ByteT Oot Auto 2 D Funcion bloke 3 Msp BytET OB Auto 6 9 Finches z 6 J Global vanables lo 3 2 2 MOVING TOOLBARS You can move a toolbar by clicking on its left border and then dragging and dropping it to the destination i File Edit view Project De
159. ll Closes all open documents Arrange Icons 10 1 11 HELP MENU Command Description Index Lists all the Help keywords and opens the related topic Context sensitive help Opens the topic related to the Context currently active window About Information on producers and version 158 LogicLab user manual ee a ee ee I 10 2 TOOLBARS REFERENCE In the following tables you can see the list of all LogicLab s toolbars The buttons making up each toolbar are always the same whatever the currently active document However some of them may produce no effect if there is no logical relation to the active document 10 2 1 MAIN TOOLBAR Button Command Description ig New project Creates a new project a Open project Opens an existing project Saves all documents in the currently open windows including the project file Note that since all modifications to a LogicLab project are first applied in memory only you need to release the Save project command to make them permanent Save project Undo Cancels last change made in the document Redo Restores the last change canceled by Undo ml FE Removes the selected items from the active document and stores them in a system buffer Copy Copies the selected items to a system buffer Pastes in the active document the contents of the Paste system buffer Asks you to type a string and searches for its first Find Instance within the active document from the curre
160. lly active Each SFC network or its textual equivalent has exactly one initial step An initial step can be drawn graphically with double lines for the borders as shown below For system initialization the default initial state is FALSE for ordinary steps and TRUE for initial steps LogicLab cannot compile an SFC network not containing exactly one initial step Representation Description Init Initial step graphical representation with direct links 11 6 1 3 ACTIONS An action can be a collection of instructions in the IL language a collection of networks in the FBD language a collection of rungs in the LD language acollection of statements in the ST language a sequential function chart SFC organized as defined in this section Zero or more actions can be associated with each step Actions are declared via one of the textual structuring elements listed in the following table Structuring element Description STEP StepName Step body Step textual form END_STEP INITIAL STEP StepName Step body Initial step textual form END_STEP Such a structuring element exists in the Isc file for every step having at least one associ ate action LogicLab user manual 205 LOGI I 11 6 1 4 ACTION QUALIFIERS The time when an action associated to a step is executed depends on its action qualifier LogicLab implements the following action qualifiers Qualifier Meaning The action is executed
161. ls p a Delete 1 0 variable Lat Insert A ri fe Delte RE nai S e p Name RE Retan 1 freeRureg __ 1 fhSchema amp Stk ES 7 ait 6 6 3 EDITING VARIABLES Follow this procedure to edit the declaration of a variable in a variables editor all the fol lowing steps are optional and you will typically skip most of them when editing a variable 1 Edit the name of the variable by entering the new name in the corresponding cell Auto BOOL REAL MDBO 20 2 Change the variable type either by editing the type name in the corresponding cell or by clicking on the button in that cell and select the desired type from the list that pops up ee LON DTe e e a a t ib m we i LogicLab user manual 81 LOGIC Se Object browser Function blocks Basic types User Types Filters Name x Symbol location All Library All Wars type Al Cancel 3 Edit the address of the variable by clicking on the button in the corresponding cell and entering the required information in the window that shows up Note that in the case of global variables this operation may change the position of the variable in the project tree g g BOOL Auto AORO Automatic address Size C Bit Bute E bit G Word 16 bit Double word 22 bit Data black Index he W 4 In the case of global variables you can assign the variable to a group by selecti
162. lue mn Atl k _ Mame e Tipe Address Array Ital ue Atl TE it E Pulse Puto To um oh Use m PUSE E T o Mo Ao THF IF op FFO Auto ho 0 EA THF ipFiop FFO Auto ho 0 3 writer TusFilter Auto ho i d Filter Tus iter Auto No D 4 Wp ByteT ORT Auto ho 0 A o4 Hpt ByteT ON Auto ho 0 ra Hapit AyteT OE Auto No o 3 bsSplt_o AyteT OE Auto ho D n EET ERE a ae me si kr an sir a WO er ae a ST Pulse i inp aah ot a ler TOLUINT _ _ psilad Bend 16 LogicLab user manual LOGIC 3 3 DOCKING WINDOWS 3 3 1 SHOWING HIDING TOOL WINDOWS The View gt Too windows menu allows you to show or hide a tool window for example the Output window a ee y Bap Tobar Aoa BR MERKS E E Tk D ER Tod windows fe YWeolkspece Chiles TET E Fuleceen Cmi CubL See A rs Eu Project RER Cilk Cil T E Project i Definitions E El ppe Pioect 9 Progen FF_O gt BI Fast 3 raFiter TUSFiiter Auto inil z iai 4 HEPI EyteT oR Auto 5 Dy Funchen blocks 15 tepit o ByteToat Auto iii Ocheme i Ta Sigi J Funchons H E Globa varobles Sqieie aie ae cule T H El Tasks Fated 70 me walt E a THAT A Preprocessing Module TARGET conpleted Preprocessing Hodule MAIN completed Preprocessing basic completed Freprocereing thernnodel conpleted D varnings 0 errors Hf Euid Fincin orjac j Debug Shaw or bide the Cutput bet The tool
163. med as follows FUNCTION BLOCK FunctionBlockName VAR_INPUT declaration of input variables see the relevant section END VAR VAR OUTPUT declaration of output variables END VAR VAR EXTERNAL declaration of external variables END V R VAR declaration of local variables END VAR Function block body END FUNCTION BLOCK Keyword FunctionBlockName VAR EXTERNAL END V R Function block body Description Name of the function block being declared note name of the template not of its instances A function block can access global variables only if they are listed in a VAR EXTERNAL Structuring element Variables passed to the FB via a VAR_ EXTERNAL construct can be modified from within the FB Specifies the operations to be performed upon the input variables in order to assign values to the output variables dependent on the function block s semantics and on the value of the internal variables It can be written in any of the languages supported by LogicLab Declaring functions in LogicLab Whatever the PLC language you are using LogicLab allows you to disregard the syntax above as it supplies a friendly interface for using function blocks 11 1 6 3 PROGRAMS Introduction A program is defined in IEC 61131 1 as a logical assembly of all the programming lan guage elements and constructs necessary for the intended signal processing required for the control of a machine or process by a programmabl
164. most recent evaluation of such an assignment Syntax An assignment statement consists of a variable reference on the left hand side followed by the assignment operator followed by the expression to be evaluated For in stance the statement A B would be used to replace the single data value of variable A by the current value of vari able B if both were of type INT LogicLab user manual 199 LOGI I Examples a b assignment PCV PCV 1 3 assignment G gt SINt X assignment with function invocation FUNCTION SIMPLE_FUN REAL variables declaration function body SIMPLE FUN a b c END_FUNCTION assigning the output value to a function 11 5 2 2 FUNCTION AND FUNCTION BLOCK STATEMENTS Semantics Functions are invoked as elements of expressions consisting of the function name fol lowed by a parenthesized list of arguments Each argument can be a literal a variable or an arbitrarily complex expression Function blocks are invoked by a statement consisting of the name of the function block instance followed by a parenthesized list of arguments Both invocation with formal ar gument list and with assignment of arguments are supported RETURN function and function block control statements consist of the mechanisms for invoking function blocks and for returning control to the invoking entity before the phys ical end of a function or function block The RETURN statement p
165. n add a brief description and then confirm the operation Sew variable EJ Name Te un LJ Group Array 0 3 ER Attribute Init values ced Description Proportional aind S If you create a new mapped variable you are required to specify the address of the vari able during its definition In order to do so you may do one of the following actions Click on the button to open the editor of the address then enter the desired value 10 variable declaration Dala lype UDIHT all Data block Supindas HH Location ID data block Eass addi Siz Use venables ZMOT 15 Orhei data blocks Description 40 LogicLab user manual LOGIC Yariable address AHtomahic address Size Location Bit 0 Input Bute 8 bit Output Word 16 bit G Memory Double word 32 bit Data block Index BEN K Select from the list that LogicLab shows you the memory area you want to use the tool automatically chooses the address of the first free memory location of that area VO vatiable declaration m Mame Dala lype REAL r FAN Group size No ERS Data block i Fa Subindar 2 Location Basa addi Siza Uned Deponphor 5 2 1 4 EDITING A GLOBAL VARIABLE To edit the definition of an existing global variable 1 Open the folder in the Project tab of the workspace that contains the variable you want to edit egm Global variable EJ Automatic variables be Analog out
166. n the toolbar HINT Choose the format and confirm your choice Yalue format Format G Signed Float 0 Exadecimal Float format Number of decimal 9 1 6 WORKING WITH WATCH LISTS You can store to file the set of all the items in the Watch window in order to easily restore the status of this debugging tools in a successive working session Follow this procedure to save a watch list 1 Click on the corresponding item in the Watch window toolbar Watch A sh RX E Symbol Value Type sd 138 UINT amp sumlQ2 349 656 REAL vIO2 0 007 REAL amp sumyW2 2005 02 REAL VW2 0 034 REAL 2 Enter the file name and choose its destination in the file system Select watch list file Sevein SoflParePic EN Daku hip A ecenl Documeris Derkkop Fly Documents Fly Comipuler File name welch Hi Mabok Save Bo hepe wabah list fle vz LogicLab user manual 103 LOGIC LAB In order to load a watch list follow this procedure 1 Click on the corresponding item in the Watch window toolbar Watch Ey se Symbol Value Type 2 Browse the file system and select the watch list file Select watch list file Lookin SofiPareFilc EET i e My Recent Documents B erkka Aly Documents Fely Computer File name walch uz My Newark Files of type Watchlist lie ade The set of symbols in the watch list is added to the Watch windo
167. nda Fi reelt ne ilem rio a debug wind Shilt F10 MEE egen an Fit g Adderemowe led Ingge FY El Addtremove gephic bigger Shilo ek Hemose ell bigger ChleShel Fo E Trigger list Cit Debug mode eG Livecetupmad ooo LRU 1 Upedawn 008 118 LogicLab user manual LOGI I 9 4 1 SFC ANIMATION As explained in the relevant section of the language reference an SFC POU ts structured in a set of steps each of which is either active or inactive at any given moment Once started up this SFC specific debugging tool animates the SFC documents by highlighting the active steps Animation OFF S soriwiel a am Animation ON TRUE some T ctrl D own In the left column a portion of an SFC network is shown diagram animation being off In the right column the same portion of network is displayed when the live debug mode is active The picture in the right column shows that steps S1 and S3 are currently active whereas Init S2 and S4 are inactive Note that the SFC animation manager tests periodically the state of all steps the user not being allowed to edit the sampling period Therefore it may happen that a step remains active for a slot of time too short to be displayed on the video The fact that a step is never highlighted does not imply that its action is not executed it may simply mean that the sampling rate is too slow to detect the execution 9 4 1 1 DEBUGGI NG ACTIONS AND CON
168. ng it from the list which opens when you click on the corresponding cell This operation will change the position of the variable in the project tree bo mlk es e 9 gA BOOL Auto I aL 27 TF FE mD60 20 _ 12 9D INT Auto Analog aut 3 aes Onda quadra Cycle 5 Choose whether a variable is an array or not if it is edit the size of the variable ht Dee e L ie BOL Auto No TRUE toe a i i a 82 LogicLab user manual LOGI IM Size of ariable O Scalar Aray 2 Matrix Dimensions 22 Cancel 6 Edit the initial values of the variable click on the button in the corresponding cell and enter the values in the window that pops up Array value Var eat Value Type oC o a Hexadecimal es OY i Octal Decimal Boolean 7 Assign an attribute to the variable for example CONSTANT Or RETAIN by selecting it from the list which opens when you click on the corresponding cell io BESES SEES oo eee oe to Na TRUE CONSTANT Wi Cycle 0 1 0 1 RETAIN h WDE 20 to Mo F4 8 Type a description for the variable in the corresponding cell Note that in the case of global variables this operation may change the position of the variable in the project tree Tod mM Mm k FT Dk ae 9 Save the project to persist the changes you made to the declaration of the variable 6 6 4 DELETING VARIABLES In order to delete one or mor
169. nnection or block then click Object gt New in the Scheme menu Select a contact connection or block then press the New block button in the FBD toolbar which causes a dialog box to appear listing all the objects of the project then choose one item from the list If the block is a constant a return statement or a jump statement you can directly press the relevant buttons in the FBD toolbar Drag the selected object from the Workspace window the Libraries window or the local variables editor over the desired connection The two upper pins will be connected to the power link The EN ENO pins should be acti vated before the insertion EDITING COILS AND CONTACTS PROPERTIES The type of a contact normal negated or a coil normal negated set reset can be changed by one of the following operations Double click on the element contact or coil Select the element and then press the Enter key Select the element activate the pop up menu with the right mouse button then select Properties An apposite dialog box will appear Select the desired element type from the list presented and then press OK 70 LogicLab user manual LOGI I 6 3 8 EDITING NETWORKS The LD editor is endowed with functions common to most graphic applications running on a Windows platform namely Selection of a block Selection of a set of blocks by pressing Shift Right button and by drawing a frame including the blocks to select
170. nt location of the cursor Find naxt Iterates the search previously performed by the Find command Find in project Opens the Find in project dialog box Displays a dialog box which lets you set printing Print options and print the document in the currently active window Shows a picture on your video that reproduces Print preview faithfully what you get if you print the document in the currently active window If pressed displays the Workspace also called AO PACE Project window otherwise hides it If pressed displays the Output window otherwise hides it If pressed displays the Libraries window otherwise hides it Output a E fo e E Bo Be B e lee 2 5 Library LogicLab user manual 159 LOGI LAB Button Command Watch sync Force I 0 PLC run time monitor a aHa Full screen 10 2 2 FBD TOOLBAR E7 ey E Button Command Move Insert Connection Watch New block Constant Return B EEG Comment EJ Inc pins h Dec pins 160 EG O Da H 1 PER Description If checked displays the Watch window otherwise hides it If checked displays the Oscilloscope window otherwise hides it If pressed displays the Force I 0 window otherwise hides it If checked displays the PLC run time window otherwise hides it Expands the currently active document window to full screen Press Esc or release the Full sc
171. number in the horizontal scale edit box then confirm by clicking Apply T LogicLab user manual 151 es a ee I y axis You can change the scale of the plot of each variable through the Tracks list tab of the Graph properties dialog box Otherwise if you do not need to specify exactly a scale you can use the Zoom In and Zoom Out controls 9 6 2 11 CLOSING THE GRAPHIC TRIGGER WINDOW AND REMOVING THE TRIGGER At the end of a debug session with the graphic trigger window you can choose between the following options Closing the Graphic trigger window Removing the trigger Removing all the triggers Closing the graphic trigger window If you have finished plotting the diagram of a set of variables by means of the Graphic trigger window you may want to close the Debug window without removing the trigger If you click the button in the top right hand corner you just hide the Interface window while the window manager and the relative trigger keep working As a matter of fact if later you want to restore the Graphic trigger window that you previously hid open the Trigger list window select the record having type G click the Open button The Interface window appears with the trigger counter properly updated as if it had never been closed Removing the trigger If you choose this option you completely remove the code both of the window manager and of its trigger To this purpose o
172. ny but BOOL Output data type BOOL OUT GI 0 20 OUT FALSE Examples OUT t GIT 010007 pluto OUT TRUE GE Greater than or equal to Returns TRUE if Input 0 gt Input 1 otherwise FALSE Number of operands 2 Description Input data type Any but BOOL Any but BOOL Output data type BOOL QUT GE 20 20 OUT TRUE Examples OUT GE pippo pluto OUT FALSE LogicLab user manual 185 LOGI I Description Number of operands Input data type Output data type Examples Description Number of operands Input data type Output data type Examples Description Number of operands Input data type Output data type Examples Description Number of operands Input data type Output data type Examples 186 EQ Equal to Returns TRUE if Input 0 Input 1 otherwise FALSE 2 Any Any BOOL OUT EQ TRUE FALSE OUT FALSE OUT EQ pippo pluto OUT FALSE LT Less than Returns TRUE if Input 0 lt Input 1 otherwise FALSE 2 Any but BOOL Any but BOOL BOOL OUT lt iit 0 20 ye FF OUT TRUE OUT LT pipo pluto J OUT TRUE LE Less than or equal to Returns TRUE if Input 0 lt Input 1 otherwise FALSE 2 Any but BOOL Any but BOOL BOOL OUT LE 20 20 s OUT TRUE OUT LET pipo pluto F OUT TRUE Not equal
173. ode download ay Connect Settings ar i a When you stop developing the application you can enable source code download again by checking the same menu item eee Tools Help s 2 H Source code download ay Connect Settings are TU s TE When you disconnect from the target device LogicLab checks if the application currently executing on the target and the source code available on board match alerting you if they do not Source code not up to date A The application currently executing on the target device and the source code file downloaded to the target device do not match Disconnect anyway 8 3 1 2 PROTECTI NG THE SOURCE CODE WITH A PASSWORD You may want to protect the source code downloaded to the target device with a pass word so that LogicLab will not open the uploaded project unless the correct password is entered Open the Project options window Project gt Options menu and set the pass word Project info Code generation Debug Build events Project PLC sample max 10 chars Version 16 SSS s r 1 0 author fJommDoe LL O Note p a Enable Password Password eeesesee ssid LogicLab user manual 95 LOGIC LAB You may opt to disable the password instead Project info Code generation Debug Build events Project PLC sample max 10 chars Version 1 6 example
174. oject Target Library Aux Sources All Disables this filter Project Objects declared in the LogicLab project Function Set of legal values Target Firmware objects Use Library Objects contained in a library In this case use simultaneously also the Library filter described below Aux sources Shows aux sources only Applies to All objects types Dibeecl hker Programs Function Blacks a Functions Lat Vy arable E ser type ata Hes Yarabi verile Venable War ables Varlatles Ware bless talabla Yar ables War a bles Varig thes E lar rl arc li E liorz i LALAH bal die _ Fadel sod Check al Check none i mm m i i Other lileiz e a Localan Te Librai l vasiyga All Wr npl rings nod Up npls Ya abes variables Varlables Variables Waar sa dees Function Set of legal values Use Applies to cz 7 Select core Edel al Library Completes the specification of a query on objects contained in libraries The value of this control is relevant only if the Symbol location filter is set to Library All librarynamel librarynamez2 All Shows objects contained in whatever library LibrarynameN Shows only the objects contained in the library named librarynameN All objects types LogicLab user manual 55 LOGIC LAB Ubeti her Programe Function Blac ja Furelans Lat aah Leer toes SER Other l
175. om gt Ate 9 3 EDIT AND DEBUG MODE While both the Watch window and the Oscilloscope do not make use of the source code all the other debuggers do thus LogicLab requires the developer to switch on the debug mode where changes to the source code are inhibited before s he can access those debugging tools To switch on and off the debug mode you can click on the corresponding item in the De bug toolbar SE LogicLab user manual 117 LOGIC LAB 9 4 Alternatively you can choose Debug mode from the Project menu fom Communication variables Window Tools Help o Add spiel bo walch Fa Add samba bo a debug irda Fig reels new ilem into a debug windo Shit F10 Quick watch sembe F11 1 Pu F a Pe a Fr k 0 P The status bar shows whether the debug mode is active or not CONNECTED _ DEBUG MODE Note that you cannot enter the debug mode if the connection status differs from Con nected LIVE DEBUG LogicLab can display meaningful animation of the current and changing state of execution over time of a Program Organization Unit POU coded in any IEC 61131 3 programming language To switch on and off the live debug mode you may click on the corresponding item in the Debug toolbar or choose Live debug mode from the Project menu EEE conmunicaticn Variables Window Tools Help a Add pyro bo waich FE Add spre bo a debug A
176. on occurs when the transition is enabled and when the associated transition condition is true The clearing of a transition causes the deactivation or resetting of all the immediately preceding steps connected to the corresponding transition symbol by directed links fol lowed by the activation of all the immediately following steps The alternation Step Transition and Transition Step is always maintained in SFC element connections that is two steps are never directly linked they are always separated by a transition two transitions are never directly linked they are always separated by a step When the clearing of a transition leads to the activation of several steps at the same time the sequences to which these steps belong are called simultaneous sequences After their Simultaneous activation the evolution of each of these sequences becomes independent In order to emphasize the special nature of such constructs the divergence and conver gence of simultaneous sequences is indicated by a double horizontal line The clearing time of a transition may theoretically be considered as short as one may wish but it can never be zero In practice the clearing time will be imposed by the PLC implementation several transitions which can be cleared simultaneously will be cleared Simultaneously within the timing constraints of the particular PLC implementation and the priority constraints defined in the sequence evolution table For t
177. operties of the selected block Fnable EN ENO pins if the object is a function or a function block displays a Object properties table with the input and output variables if the object is a variable or a parameter opens a dialog box which lets you change the name and the logical direction input output LogicLab user manual 157 LOGIC LAB 10 1 8 VARIABLES MENU Command Description Adds a new row to the table in the currently active editor if Insert PLC editor to the table of local variables if parameters editor to the table of parameters etc Deletes the variable in the selected row of the currently active Delete Pahl G Opens a dialog box which lets you create and delete groups of roup variables 10 1 9 DEFINITIONS MENU Command Description Insert Enum Creates a new enumerated data type Insert gt Structure Creates a new structured data type Insert gt Subrange Creates a new subrange data type Insert gt Typedef Creates a new typedef data type 10 1 10 WINDOW MENU Command Description Displaces all open documents in cascade so that they rese completely overlap except for the caption The PLC editors area is split into frames having the same Tile dimensions depending on the number of currently open documents Each frame is automatically assigned to one of such documents Displaces the icons of the minimized documents in the bottom left hand corner of the PLC editors area Close a
178. or inactive At any given moment the state of the program organization unit is defined by the set of active steps and the values of its internal and output variables A step is represented graphically by a block containing a step name in the form of an iden tifier The directed link s into the step can be represented graphically by a vertical line attached to the top of the step The directed link s out of the step can be represented by a vertical line attached to the bottom of the step Representation Description StepName Step graphical representation with direct links LogicLab does not set any constraint on the maximum number of steps per SFC Step flag The step flag active or inactive state of a step can be represented by the logic value of a Boolean variable xxx x where xxx is the step name This Boolean variable has the value TRUE when the corresponding step is active and FALSE when it is inactive The scope of step names and step flags is local to the program organization unit where the steps ap pear 204 LogicLab user manual es a ee LAB Representation Description Step flag step Name_x TRUE when Step Name x is active FALSE otherwise Users cannot assign a value directly to a step state 11 6 1 2 INITIAL STEP The initial state of the program organization unit is represented by the initial values of its internal and output variables and by its set of initial steps i e the steps which are initia
179. ortinteger 8 128 to 127 USINT Unsigned short integer 8 0 to 255 INT 32768 to 32767 LogicLab user manual 165 LOGIC LAB Keyword Datatype Bits _ Range UINT 0 to 65536 DINT 23 to 2 1 UDINT 0 to 27 BYTE Bit string of length8 8 WORD Bit string of length 16 16 DWORD Bit string of length 32 32 REAL Realnumber 32 3 40E 38 to 3 40E 38 STRING String of characters Note the actual implementation of the BOOL data type depends on the processor of the target device e g it is 1 bit long for devices that have a bit addressable area 11 1 3 DERIVED DATA TYPES Derived data types can be declared using the TYPE END_TYPE construct These derived data types can then be used in variable declarations in addition to the elementary data types Both single element variables and elements of a multi element variable which are de clared to be of derived data types can be used anywhere that a variable of its parent type can be used 11 1 3 1 TYPEDEFS The purpose of typedefs is to assign alternative names to existing types No difference between a typedef and its parent type exists apart from the name Typedefs can be declared using the following syntax TYPE lt enumerated data type name gt lt parent type name gt END TYPE For example consider the following declaration mapping the name LONGWORD to the IEC 61131 3 standard type DWORD TYPE Longword DWORD END_TYPE 11 1 3
180. ottom Insert After Insert Before View grid If checked enables auto connection that is Auto connect automatic creation of a logical wire linking the pins of two blocks when they are brought close oe iE ra a 18 10 2 7 DEBUG TOOLBAR oe ERB OR bh lh a gK Button Command Description Debug mode Switch on off the Debug mode Live debug mode Switch on off the Live debug mode Set Remove Sets removes a trigger at the current source code trigger line Sets removes a graphic trigger at the current Graphic trigger aurce code line Remove all triggers Removes all triggers Trigger list Lists all triggers Set breakpoints Sets a breakpoint at the current source code line Remove all breakpoints Removes all breakpoints Restarts program execution after a breakpoint is Run hit Breakpoint list Lists all breakpoints Change current Changes the current function block instance live instance debug mode a a fa lo e e E Eao 164 LogicLab user manual es ee I 11 LANGUAGE REFERENCE All LogicLab languages are IEC 61131 3 standard compliant Common elements Instruction list IL Function block diagram FBD Ladder diagram LD Structured text ST Sequential Function Chart SFC Moreover LogicLab implements some extensions Pointers Macros 11 1 COMMON ELEMENTS By common elements textual and graphic elements are means which are common to all t
181. ou want to edit by double clicking the folder name EJ Project FE Definitions fl Project fa Definitions FIcE sample Project E PicExarmple Project ey Prag pes 9 Furiction blocks Main FE Functions Function blocks H Global variables J Functions H eel Tasks Global variables eel Tasks 2 Double click the name of the object you want to edit The relative editor opens and lets you modify the source code of the POU E Project A Definitions PicExample Project H Project l Definitions y PlcE xample Project INT Aut Ej Programs 9 Programs F Ma J Function blocks Function blocks Functions 59 Functions H C Global variables 9 Global variables cH 4 Tasks El Tasks amp simple counter counter counter You may want to change the name of the POU 1 Openthe Object properties editor from the contextual menu which pops up when right clicking the POU name in the project tree alternatively select the correspond ent item in the Project menu 34 LogicLab user manual LOGIC LAB El Project 9 Definitions Progetto PlcExample Programs m 4 Function Edit source ER Funzioni Program properties he E Global ve E Autor Duplicate program Ey 170 Delete program J Cons J Export program to library IJ Retai HE Tasks f i T Copp name Ctrl C Crypt 2 Change the object name and confirm Object properties
182. ou can move the cursor to the line if the module is in IL or ST or click the block if the module is in FBD or LD where you placed the trigger Now press the Set Remove trigger button in the Debug toolbar Removing all the triggers Alternatively you can remove all the existing triggers at once regardless for which re cords are selected by clicking on the Remove all button Trigger list Type Module T MAIMFED 9 6 GRAPHIC TRIGGERS 9 6 1 GRAPHIC TRIGGER WINDOW The graphic trigger window tool allows you to select a set of variables and to have them Sampled synchronously and to have their curve displayed in a special pop up window Sampling of the dragged in variables occurs every time the processor reaches the position i e the instruction if IL ST or the block if FBD LD where you placed the trigger 9 6 1 1 PRE CONDI TIONS TO OPEN A GRAPHIC TRIGGER WINDOW No need for special compilation All the LogicLab debugging tools operate at run time Thus unlike other programming languages such as C the compiler does not need to be told whether or not to support trigger windows given a PLC code the compiler s output is unique and there is no dis tinction between debug and release version Memory availability A graphic trigger window takes all the free memory space in the application code sector Obviously in order to start up a trigger window it is necessary that a sufficient amount of memory is available ot
183. ould be inserted as a contact coil or variable like FBD schemes Choose the appropriate contact type Contacts inserted with drag and drop will always be inserted in series LB ob jesck Ey pe x Object tips LO Object f Yerable LD objec of Nome i Nemas Conact Negative 7 Positive icc Set Asset wWanahle hope E ALt Cancel LogicLab user manual 69 LOGI LAB 6 3 5 6 3 6 6 3 7 INSERTING COILS To insert new coils on the network apply one of the following options Press one of the coil buttons in the LD toolbar The new coil will be inserted and linked to the right power rail If other coils are already present in the network the new coil will be added in parallel with the previous ones Out Out Step Ste ps 7 Drag a boolean variable on the network For example global variables can be taken from the Workspace window whereas local variables can be selected from the local vari ables editor A dialog box will appear requesting to indicate whether the variable should be inserted as a contact coil or variable Choose the appropriate coil type INSERTING BLOCKS Operators functions and function blocks can be inserted into an LD network in the follow ing modes On the power link as contacts and coils Outside the power link to do so follow the indications as for the FBD blocks To insert blocks on the network apply one of the following options Select a contact co
184. pen the Trigger list window select the record having type G click the Remove button Alternatively you can move the cursor to the line if the module is in IL or click the block if the module is in FBD where you placed the trigger Now press the Graphic trace button in the Debug toolbar Removing all the triggers Alternatively you can remove all the existing triggers at once regardless for which re cords are selected by clicking on the Remove all triggers button 152 LogicLab user manual E am ee I 10 LOGI CLAB REFERENCE 10 1 MENUS REFERENCE In the following tables you can see the list of all LogicLab s commands However since LogicLab has a multi document interface MDI you may find some disabled commands or even some unavailable menus depending on what kind of document is currently active 10 1 1 FILE MENU Command New project Open project View project Save project Save project As Close project New text file Open file Save Close Options Print Print preview Print project Printer setup seP CCEN Cs Exit Description Lets you create a new LogicLab project Lets you open an existing LogicLab project Opens an existing LogicLab project in read only mode Same as Save all but it saves also the ppJ file Note that Since all modifications to a LogicLab project are first applied in memory only you need to release the Save project command to make them permanent Asks
185. phic trigger window controls section see 9 6 1 5 The Chart area The Chart area includes six items 1 Plot area containing the actual plot of the curve of the dragged in variables 138 LogicLab user manual oe 2 Samples to acquire number of samples to be collected by the graphic trigger window manager 3 Horizontal cursor cursor identifying a horizontal line The value of each variable at the intersection with this line is reported in the column horz cursor 4 Blue cursor cursor identifying a vertical line The value of each variable at the inter section with this line is reported in the column left cursor 5 Red cursor same as blue cursor 6 Scroll bar if the scale of the x axis is too large to display all the samples in the Plot area the scroll bar allows you to slide back and forth along the horizontal axis The Variables window This lower section of the Debug window is a table consisting of a row for each variable that you have dragged in Every row has several fields which are described in detail in the Drag and drop information section 9 6 1 3 GRAPHIC TRIGGER WINDOW DRAG AND DROP INFORMATION To watch a variable you need to copy it to the lower section of the Debug window x Si HAR EB AARB ARO sf ea Cnt 0 TTT TCT _ _ _ _V6oCcGe ee EE Track Min value Max value widiy Red cursor Blue cursor Note P Variables window This lower section of the Debug window is a table consist
186. play 0 tw error 1 END CASE 11 5 2 4 ITERATI ON STATEMENTS Semantics Iteration statements specify that the group of associated statements are executed repeat edly The FOR statement is used if the number of iterations can be determined in advance otherwise the WHILE Or REPEAT constructs are used FOR the FoR statement indicates that a statement sequence is repeatedly executed up to the END FOR keyword while a progression of values is assigned to the FOR loop control variable The control variable initial value and final value are expressions of the same integer type e g SINT INT Or DINT and cannot be altered by any of the repeated statements The FoR statement increments the control variable up or down from an initial value to a final value in increments determined by the value of an ex pression this value defaults to 1 The test for the termination condition is made at the beginning of each iteration so that the statement sequence is not executed if the initial value exceeds the final value WHILE the WHILE statement causes the sequence of statements up to the END_WHILE keyword to be executed repeatedly until the associated Boolean expression is false If the expression is initially false then the group of statements is not executed at all 202 LogicLab user manual LOGI I REPEAT the REPEAT statement causes the sequence of statements up to the UNTIL keyword to be executed repeatedly and at leas
187. pplication execution one or more cycles may have occurred for the same reason the evolution of the value of a single variable is not reliable especially when it changes fast Synchronous debuggers They require the definition of a trigger in the PLC code They refresh simultaneously all the variables they have been assigned every time the proces sor reaches the trigger as no further instruction can be executed until the value of all the variables is refreshed As a result synchronous debuggers obviate the limitations affecting asynchronous ones This chapter shows you how to debug your application using both asynchronous and syn chronous tools WATCH WINDOW The Watch window allows you to monitor the current values of a set of variables Being an asynchronous tool the Watch window does not guarantee synchronization of values Therefore when reading the values of the variables in the Watch window be aware of the possibility that they may refer to different execution cycles of the corresponding task The Watch window contains an item for each variable that you added to it The informa tion shown in the Watch window includes the name of the variable its value its type and its location in the PLC application Symbol Valle Type Location incr 50 INT Slows Main eee fOScherma i TRUE BODL Slows Main m OPulse enable FALSE BOL Fast Fast NCK cr TAIT inik Tif 9 1 1 OPENING AND CLOSING THE WATCH WINDOW To open the Wa
188. press the normal cursor button so as to let the cursor take back its original Shape amp 9 5 2 6 OPENING A TRIGGER WINDOW FROM AN LD MODULE Let us assume that you have an LD module also containing the following instructions You can place a trigger on a block such as follows ADD EN ENO 130 LogicLab user manual E am a ee LAB In this case the same rules apply as to insert a trigger in an FBD module on a contact 4 or a Coll In this case follow the SE instructions Let us also assume that you want to know the value of some variables every time the processor reaches network number 1 First you must click one of the items making up network number 1 Now you can click the Set Remove trigger button in the Debug bar Bi Alternatively you can press the F9 key In both cases the grey raised button containing the network number turns to green and a white circle with the number of the trigger inside appears in the middle of the button while the related trigger window pops up Trigger n 1 at MAINLD 1 CL 4 Cnt 0 Condition Trigger n 0 at MAINLD 2 0 3 Cnt 0 Condition ntn taraet comnleted 2 ihlare I ASIN KaArne larl EYP Unlike the other languages supported by LogicLab LD does not allow you to insert a trigger into a single contact or coil as it lets you select only an entire network Thus the variables in the trigger window will be refreshed every time the pro
189. ps show you how to create run and debug a simple LogicLab PLC pro gram The program will be written in the ST language and will be executed directly on your machine A virtual target VPLC1 has been installed by the setup procedure VPLC1 emulates a simple programmable controller provided with digital and analog 1 0 1 Launch LogicLab from the Start menu d Axel PC Tools o SimuLab i Uninstall LogicLab 2 2 When LogicLab is started for the first time not all windows and toolbars are shown You can customize LogicLab s workspace through the View menu Brae fe ve Peet Dig Coreen visies Tes Hein BSG SRB Ae DMO ole F E oe ee rd I I TT i ESSEN eh he oa nd 7 2am S t d a x Bee d _ oe E mo en tiers E Fasor VPLC1 Configuration SSS Ss Es eel ge Imi UT pce Loc ae TF eer birh y LP eee Herw tz Herr Be um ihi Ti suck co pipet 7 1 a oe Citar pages Dan HE Fre OS EL Bote Tee scape Preerocemuing Edel HI araber Fruen ler Shasderd coer bebe Preemie Pet oop kbod i gafaelaege E BPS il uh co Pape 7 Dea Pe 3 In order to create a new project select the item New project from the menu File Edt Siew Project Debug Communication Sandow Tongs i inh S Ir gti l amp n Onen polet ERR Fn View project read any Oo Welcome E Welcome to Maw tout il LogicLab Oc fila Oohione Print Cre A Fit oneview F M
190. ption optional and confirm the operation Mew Typedef Name DINT aT Tope USINT Init Value Description S bit unsigned integer 5 4 1 2 EDITING A TYPEDEF The typedefs of the project are listed under the TypeDefs folder In order to edit a typedef you just have to double click on its name Project E Peet Definitions E oO PicE xample Definitions a TypeDets 5 4 1 3 DELETING A TYPEDEF To delete a typedef follow this procedure 1 Right click the typedef name and choose Delete from the contextual menu fea Project 5 Definitions e PicE sample Definitions El TypeDef S i Structures Properties Enumeratio Sub anges Maca Delete 2 Confirm your choice Sy Delete the selected PLC Object k a j Type Typedef Name UINTS_T cre ace 5 4 2 STRUCTURES The following paragraphs show you how to manage structures 5 4 2 1 CREATING A NEW STRUCTURE Follow this procedure to create a new structure 1 Right click the Structures folder and choose New structure from the contextual menu LogicLab user manual 47 LOGIC LAB aa EB Project F Definitions ons o PicExample Definitions E Ca TypeD efs ie UINTET onm Ca Enur La New Structure ig New Structure faj T New Structure f T CJ SubA ES Mag CSC C s CSsSS 2 Type the name of the structure New Structure 3 Enter a meaning
191. r draws a logical wire from the former to the latter If you want to connect two blocks having a one to one correspondence of pins you can enable the autoconnection mode by clicking Autoconnect in the Scheme menu or by pressing the Autoconnect button in the Network toolbar Then take the two blocks drag them close to each other so as to let the corresponding pins coincide The FBD edi tor automatically draws the logical wires Step 1 Step 2 Step 3 oe MU Block Block MUX MUX WectorByScalar E YectorByScalar _ 1 Vector By Scalar a1 wi 10 a1 wi i0 al wi az we li a2 we l4 az we a3 wo 12 az we Iz as ws ad ud l3 m wg b B 3 a ue b If you delete a block its connections are not removed automatically but they become in valid and they are redrawn red Click Delete invalid connection in the Scheme menu or type Ctrl B on your keyboard LogicLab user manual 73 LOGI I 6 4 5 EDITING NETWORKS The FBD editor is endowed with functions common to most graphic applications running on a Windows platform namely Selection of a block Selection of a set of blocks by pressing Shift left button and by drawing a frame including the blocks to select Cut Copy and Paste operations of a single block as well as of a set of blocks Drag and drop All the mentioned functions are accessible through the Edit menu or through the Main toolbar 6
192. red using the following syntax TYPE lt subrange name gt lt parent type name gt lt lower limit gt lt upper limit gt END TYPE For a concrete example consider the following declaration TYPE int U co TOO INE 0 6100 2 END TYPE 11 1 3 4 STRUCTURES A STRUCT declaration specifies that data elements of that type shall contain sub elements of specified types which can be accessed by the specified names Structures can be declared using the following syntax TYPE lt structured type name gt STRUCT lt declaration of stucture elements gt END STRUCT END TYPE For example consider the following declaration TYPE Sstructurel STRUCT eleml USINT elem2 USINT elem3 INT LogicLab user manual 167 LOGI I elem3 REAL END_STRUCT END TYPE 11 1 4 LITERALS 11 1 4 1 NUMERIC LI TERALS External representation of data in the various programmable controller programming lan guages consists of numeric literals There are two classes of numeric literals integer literals and real literals A numeric literal is defined as a decimal number or a based number Decimal literals are represented in conventional decimal notation Real literals are dis tinguished by the presence of a decimal point An exponent indicates the integer power of ten by which the preceding number needs to be multiplied to obtain the represented value Decimal literals and their exponents can contain a preceding sign or
193. reen button to restore the normal appearance of the LogicLab interface Description Editing mode which allows you to insert and move blocks Editing mode which allows you to draw logical wires to connect pins Editing mode which allows you to add variables to any debugging tool Lets you insert a new block into the selected network Adds a constant to the selected network Adds a conditional return block to the selected network Adds a conditional jump block to the selected network Adds a comment to the selected network By default some operators like ADD MUL etc have two input pins however you may occasionally need to perform such operations on more than two operands This command allows you to add as many input pins as to reach the required number of operands Undoes the Inc pins command LogicLab user manual E am ee Button Description Adds the enable in enable out pins to the selected block The code implementing the selected block will be executed only when the 4 EN ENO enable in signal is true The enable out signal Simply repeats the value of enable in allowing you either to enable or to disable a cascade of blocks Shows some properties of the selected block if the object is a function or a function block displays a table with the input and output a FBD properties variables if the object is a variable or a parameter opens a dialog box which lets you ch
194. rer REAL SMOT10 Onda quacha Ma q T Klnlncr INT Auto Analog outs Hd 40 CONSTANT 6 LogicLab user manual LOGIC LAB 2 QUICK START This chapter is a step by step tutorial that introduces you to the use of the LogicLab de velopment environment You will be guided through all the tasks you need to accomplish in order to run and moni tor a simple PLC application The examples in this chapter refer to a virtual target VPLC1 which ts installed along with LogicLab during the setup procedure 2 1 SETUP PROCEDURE In order to install LogicLab follow this simple procedure 1 Close all the applications running on the system 2 Run LogicLab s setup executable file and follow the instructions shown in the setup wizard E Setup AvelLogicl ab 2 6 0 9 Welcome to the Axel LogicLab 2 0 0 9 Setup Wizard This wil retell dee PC Toar Loge Lab 28 0 9 on your Computer nis recommended Kat wou dose all ohe aplicacions before conlinung Click H est to continue of Cancel bo ei Setup The setup procedure adds the following Start menu Axel PC Tools dk Logiclab 2 TP logictsb2 of SimuLab i gt Uninstall LogicLab 2 The LogicLab s folder in the file system has the following structure a Axel PC Tools gt di Catalog gt di Common 4 LogicLab2p0 di Docs gt di templates gt di SampleProjects gt SimuLab LogicLab user manual 7 LOGIC LAB 2 2 USING THE IDE The following ste
195. reshment mechanism you can specify a condi tion by clicking on the apposite button When you do so a text window pops up where you can write the IL code that sets the condition Trigger condition LD 4 GT 100 Once you have finished writing the condition code click the OK button to install it or press the Esc button to cancel If you choose to install it the values in the debug window are refreshed every time the window manager is triggered and the user defined condition is true A simplified expression of the condition now appears in the control Condition AGT 100 i LogicLab user manual 135 LOGI I To modify it press again the above mentioned button The text window appears containing the text you originally wrote which you can now edit To completely remove a user defined condition delete the whole IL code in the text win dow then click OK After the execution of the condition code the accumulator must be of type Boolean TRUE or FALSE otherwise a compiler error occurs Only global variables and dragged in variables can be used in the condition code Namely all variables local to the module where the trigger was originally inserted are out of scope if they have not been dragged into the debug window No new variables can be declared in the condition window 9 5 2 12 CLOSING A TRIGGER WINDOW AND REMOVING A TRIGGER This web page deals with what you can do when you finish a debug se
196. rget interrupted the state of the trigger window cannot be determined User defined condition Condition If you define a condition by using this control the values in the Debug window are re freshed every time the window manager is triggered and the user defined condition is true After you have entered a condition the control displays its simplified expression Condition AGT 100 C Counters None Trigger C For O After These controls allow the user to define conditions on the trigger counter The trigger window can be in one of the following three states None no counter has been started up thus no condition has been specified upon the trigger For assuming that you gave the counter limit the value N the window manager adds 1 to the current value of the counter and refreshes the value of its variables each time the debug window is triggered However when the counter equals n the window stops refreshing the values and it changes to the Stop state After assuming that you gave the counter limit the value N the window manager re sets the counter and adds I to its current value each time it is triggered The window remains in the Ready state and does not update the value of its variables until the counter reaches N 9 5 2 DEBUGGING WITH TRIGGER WINDOWS 9 5 2 1 INTRODUCTION The trigger window tool allows the user to select a set of variables and to have their val ues displayed and updated synch
197. rol Control Description Tick this control to display a grid in the Chart area Show grid background Show time The scroll bar at the bottom of the Chart area is bar available as long as this box is checked The Variables window is shown as long as this box Show tracks is checked otherwise the Chart area extends to the aar bottom of the graphic trigger window Values Control Description MONZON EE Number of samples per unit of the x axis By unit of the scale Fo anA x axis the space is meant between two vertical lines of the background grid 142 LogicLab user manual EF am a ee I Control Description Number of samples to acquire When you open the option tab after having dragged in all the variables you want to watch you can read a default number in this field representing the maximum number of samples you can collect for each variable You can therefore type a number which is less or equal to the default one Buffer size Tracks This tab allows you to define some graphic properties of the plot of each variable To select a variable click its name in the Track list column Control Description Unit of measurement printed in the table of the u Variables window A value per unit of the y axis By unit of the y axis is Value div meant the space between two horizontal lines of the background grid Hide Check this flag to hide selected track on the graph Push Apply to make your changes effe
198. ronously in a pop up window Unlike the Watch window trigger windows refresh simultaneously all the variables they contain every time they are triggered 126 LogicLab user manual LOGI LAB 9 5 2 2 OPENING A TRIGGER WINDOW FROM AN IL MODULE Let us assume that you have an IL module also containing the following instructions JUUL 000Z ID a 003 ADD b 0004 ST a 005 Ode ID c 007 ADD d 008 ST c 0009 010 ID k 0011 ADD 1 012 ST H Amts Let us also assume that you want to know the value of b d and k just before the ST k Instruction is executed To do so move the cursor to line 12 UU 0010 ID k 001i ADD 1 012 ST H ANd Then you can click the Set Remove trigger button in the Debug toolbar gt or you can press the F9 key In both cases a green arrowhead appears next to the line number and the related trigger window pops up Not all the IL instructions support triggers For example it is not possible to place a trig ger at the beginning of a line containing a JMP statement 9 5 2 3 ADDING A VARIABLE TO A TRIGGER WINDOW FROM AN IL MODULE In order to watch the value of a variable you need to add it to the trigger window To this purpose select a variable by double clicking it and then drag it into the Variables win dow that is the lower white box in the pop up window The variable s name now appears in the Symbol column TS inka ADD Trigger n 0 at MAIN 1 Ayna Ic i T Ac Crit IDE
199. rovides early exit from a function or a function block e g as the result of the evaluation of an IF statement Syntax 1 Function dst_var function_name argl arg2 argN 2 Function block with formal argument list instance_name var ini t argl var_in2 arg2 7 var_inN argN 3 Function block with assignment of arguments instance name var inl argl instance name var inN argN instance_name 4 Function and function block control statement RETURN Examples CMD_TMR IN 1X5 PT 300 200 LogicLab user manual es ee LAB FB invocation with formal argument list IN IX 5 PT 300 CMD_TMR FB invocation with assignment of arguments a CMD_TMR Q FB output usage RETURN early exit from function or function block 11 5 2 3 SELECTION STATEMENTS Semantics Selection statements include the IF and CASE statements A selection statement selects one or a group of its component statements for execution based on a specified condi tion IF the IF statement specifies that a group of statements is to be executed only if the associated Boolean expression evaluates to the value TRUE If the condition is false then either no statement is to be executed or the statement group following the ELSE keyword or the ELSIF keyword if its associated Boolean condition is true is executed CASE the CASE statement consists of an expression which evaluates to a
200. s sampled when triggers also satisfy further limiting conditions that you define The value of the variables in the column Track is read from memory just before the marked instruction and immediately after the previous instruction 9 6 1 5 GRAPHIC TRIGGER WINDOW CONTROLS This paragraph deals with controls of the Graphic trigger window Controls allow you to specify in detail when LogicLab is supposed to sample the variables added to the Vari ables window Graphic trigger window controls act in a well defined way on the behavior of the window regardless for the type of the module IL ST FBD or LD where the related trigger has been inserted Window controls are made accessible to users through the Controls bar of the debug window When you push this button down you let acquisition start Now if acquisition is running rol oe and you release this button you stop the sample collection process and you reset all the data you have acquired so far The two cursors red cursor blue cursor may be i Fnable Disable seen and moved along their axis as long as this cursors button is pressed Release this button if you want to hide simultaneously all the cursors This control is used to put in evidence the exact a Show samples point in which the variables are triggered at each sample 140 LogicLab user manual E am a ee Button Description When pressed this control splits the y axis into as many segments as th
201. s value in column Value Type is not specified and Location is set to global as shown in the following figure display Watct Type Address Array Init value Attribute Descriptior Auto No 0 Symk Trigger n 0 at MAIN 5 Ac Crt 1089 Condition 8 None Trigger For Value 1 ACCUMULATOR 2 In order to remove the accumulator from the table click its name in Symbol column and press the Del key This control can be very useful if a trigger was inserted before a ST statement because it allows you to know what value is being written in the destination variable during the current execution of the task You can get the same result by moving the trigger to an instruction following the one marked by the green arrowhead Trigger counter Crit 26 This read only control counts how many times the debug window manager has been trig gered since the window was installed The window manager automatically resets this counter every time a new triggering ses sion is started LogicLab user manual 125 LOGI LAB Trigger state This read only control shows the user the state of the Debug window It can assume the following values The trigger has not occurred during the current task execution Triggered The trigger has occurred during the current task execution System is not triggering Triggering has not been started yet or it has been stopped by user or an halt condition has been reached Communication with ta
202. ssion with a trigger window You can choose between the following options Closing the trigger window Removing the trigger Removing all the triggers Notice that the actions listed above produce very different results Closing the trigger window If you have finished watching a set of variables by means of a trigger window you may want to close the Debug window without removing the trigger If you click the button in the top right hand corner you just hide the interface window while the window manager and the relative trigger keep working Trigger n 0 at MAINFED 1 0 4 T Ac Triggered Condition None Trigger For As a matter of fact if later you want to resume debugging with a trigger window that you previously hid you just need to open the Trigger list window to select the record referred to that trigger window and to click the Open button Trigger list Type Module T MAINFBD Remove all tl 136 LogicLab user manual E am a ee LAB The interface window appears with value of variables and trigger counter updated as if it had not been closed Removing a trigger If you choose this option you completely remove the code both of the window manager and of its trigger To this purpose just open the Trigger list window select the record referred to the trigger window you want to eliminate and click the Remove button Trigger list Type Module T MAIMFBD Alternatively y
203. sting 5 Trigger list trigger windows Shortcut key pressing CtrI I is equivalent to clicking on this button Remove all triggers LogicLab user manual 121 LOGI LAB Trigger lis TEE Type Module Line Open G System T AMS Remove T Fast 14 T rit Remove all T Slow Each record refers to a trigger window either graphic or textual The following table ex plains the meaning of each field Field Description T trigger window Type a G graphic trigger window Name of the program function or function block where Modute the trigger is placed If the module is a function block this field contains its name not the name of its instance where you actually put the trigger For the textual languages IL ST indicates the line in Line which the trigger is placed For the other languages the value is always 1 9 5 1 3 TRIGGER WINDOW INTERFACE Setting a trigger causes a pop up window to appear which is called Interface window this is the interface to access the debugging functions that the trigger window makes available It consists of three elements as shown below Trigger n 0 at MAIN 3 its Cnt Condition Trigger Caption bar The Caption bar of the pop up window shows information on the location of the trigger which causes the refresh of the Variables window when reached by the processor The text in the Caption bar has the following format Trigger n X at
204. t 9 3 ytt valu Qaim op f n U Tsu Hir value Ref gt Int ani 79 i Binar counter on outputs to 16 i tbs plit_0 vol 229 TO_USINT BytaTort ainps byte MENE oul f ano I outt4 amaf e 2 108 SOR BKB KEE a LogicLab user manual oe The Oscilloscope manager periodically reads from memory the value of the variables However this action is carried out asynchronously that is it may happen that a higher priority task modifies the value of some of the variables while they are being read Thus at the end of a sampling process data associated with the same value of the x axis may actually refer to different execution states of the PLC code 9 2 4 2 TARGET DISCONNECTED If the target device is disconnected the curves of the dragged in variables get frozen until communication is restored 9 2 5 CONTROLLING DATA ACQUISITION AND DISPLAY The Oscilloscope includes a toolbar with several commands which can be used to control the acquisition process and the way data are displayed This paragraph focuses on these commands Note that all the commands in the toolbar are disabled if no variable has been added to the Oscilloscope 9 2 5 1 STARTING AND STOPPING DATA ACQUISITION When you add a variable to the Oscilloscope data acquisition begins immediately Oecdioscone x HH BHABHA i m He Ss Sd Ee Um Min wshie Mace vake widiy Fed cursor Howev
205. t once until the associated Boolean condition is true EXIT the EXIT statement is used to terminate iterations before the termination condi tion is satisfied When the EXIT statement is located within nested iterative constructs exit Is from the innermost loop in which the EXIT is located that is control passes to the next statement after the first loop terminator END_FOR END_WHILE or END_RE PEAT following the EXIT statement Note the WHILE and REPEAT statements cannot be used to achieve interprocess synchronization for example as a wait loop with an externally determined termination condition The SFC elements defined must be used for this purpose Syntax Note that square brackets include optional code while braces include repeatable portions of code 1 FOR FOR control var init val TO end val Stat list END FOR 2 WHILE WHILE expression DO stat list END WHILE 3 REPEAT REPEAT stat list UNTIL expression END REPEAT Examples FOR statement J 101 FOR 1 1 TO 100 BY 2 DO IF arrvals i 57 THEN Js i EXIT END_IF END_FOR WHILE statement ae de WHILE jJ lt 100 AND arrvals i lt gt 57 DO j 5 J 2 END_WHILE REPEAT statement Jas aL REPEAT j 5 j 2 UNTIL j 101 AND arrvals i 57 LogicLab user manual BY increm val DO 203 LOGI I END REPEAT 11 6 SEQUENTIAL FUNCTION CHART SFC This section defines Sequential Function Ch
206. t to target devices using a serial port COM port you usually use the same port for all devices many modern PCs have only one COM port You may save the last used COM port and let LogicLab use that port to override the project settings this feature proves especially useful when you share projects with other developers which may use a different COM port to connect to the target device In order to save your COM port settings enable the Use last port option in File gt 0p tions menu General Graphic Editor Test Editors Lang Save options Autosave 1 Interval min Output wordouy EMS Mincho A Consolas Font ize Courier Courier New ag O S Communication Perr eee ee 8 2 ON LINE STATUS 8 2 1 CONNECTION STATUS The state of communication is shown in a small box next to the right border of the Status bar If you have not yet attempted to connect to the target the state of communication is set to Not connected NOT CONNECTED When you try to connect to the target device the state of communication becomes one of the following Error the communication cannot be established You should check both the physical link and the communication settings Connected the communication has been established CONNECTED 8 2 2 APPLICATION STATUS Next to the communication status there is another small box which gives information about the status of the application currently exec
207. target device only if the latter is connected to the PC where LogicLab is running See the related section for details To download the application click on the related button in the Project toolbar Alternatively you can choose Download code from the Project menu or press the F5 key eee Tools Help Download code h F5 Connect Settings Upload IMG file LogicLab checks whether the project has unsaved changes If this is the case it automati cally starts the compilation of the application The binary code is eventually sent to the target device which then undergoes automatic reset at the end of transmission Now the code you sent is actually executed by the processor on the target device 8 3 1 CONTROLLING SOURCE CODE DOWNLOAD Whether the source code of the application is downloaded along with the binary code or not depends on the target device you are interfacing with some devices host the appli cation source code in their storage in order to allow the developer to upload the project in a later moment If this is the case you can control some aspects of the source code download process as explained in the following paragraphs 94 LogicLab user manual LOGIC LAB 8 3 1 1 SUSPENDI NG SOURCE CODE DOWNLOAD In order to speed up the development cycle you may want to disable source code down load uncheck the Source code download item in the Communication menu eee Tools Help rr Source c
208. tch window click on the Watch button of the Main toolbar DIAS ALS E To close the Watch window click on the Watch button again LogicLab user manual 97 LOGI I Alternatively you can click on the Close button in the top right corner of the Watch win dow Symbol In both cases closing the Watch window means simply hiding it not resetting it As a matter of fact if you close the Watch window and then open it again you will see that it still contains all the variables you added to it 9 1 2 ADDING ITEMS TO THE WATCH WINDOW To watch a variable you need to add it to the watch list Note that unlike trigger windows and the Graphic trigger window you can add to the Watch window all the variables of the project regardless of where they were declared 9 1 2 1 ADDING A VARIABLE FROM A TEXTUAL SOURCE CODE EDITOR Follow this procedure to add a variable to the Watch window from a textual that is IL or ST source code editor select a variable by double clicking on it and then drag it into the watch window Ea GT es Co a ap eee mill 154697 Er Medium Sie li LI suniy ADD yhd ET sting be ADO 1 k The same procedure applies to all the variables you wish to inspect 9 1 2 2 ADDING A VARIABLE FROM A GRAPHICAL SOURCE CODE EDITOR Follow this procedure to add a variable to the Watch window from a graphical that is
209. ted on the list operation buttons are enabled F j BET od jhe j Pr oy ord pEsleT card it FEO eo TRIG usTOF iF ror c Poe A TANG u oByI ft r oil p hl fl ae i tr fis ice oBir Firestone ta Pas eS Wnchon Heck FOr bira ain Fire lor FLUINCHIME Tams Hone Tune hain Horka Feirer Glock s Fumo blocks uren Herck Furshon Hol Furlong blora Furci oleck gt Forlorn block Frets he meet decimate Poteae tet commen Conon a bybe thom bits Damn ose a Fann rom 16 Dils A C T oS ong Tom U Wps Mes ia Falnioedas efecto OFF delay timer DA delay hoes Pulte ENE eto Ring edo debechai Boka byte rno bet Bpk aripi into bite Spika ahd pho baa bee LogicLab user manual 57 LOGI I Resize Window can be resized the cursor changes along the border of the dialog and allows the user to resize window When reopened Object browser dialog takes the same size and position of the previous usage Close dialog You have two options for closing the Object browser Press the button near the right end border of the caption bar i a E Press the Cancel 0K button below the filter box 5 5 1 2 USING OBJ ECT BROWSER AS A BROWSER To use Object browser in this way click on Object browser in the Project menu This causes the Object browser dialog box to appear which lets you navigate between the objects of the currently open project File Vi
210. the current one except the one you wish to delete 30 LogicLab user manual es ee LAB 4 8 3 IMPORTING FROM A LIBRARY OR ANOTHER SOURCE You can import an object from a library in order to use it in the current project When you import an object from a library the local copy of the object loses its reference to the Original library and it belongs exclusively to the current project Therefore you can edit imported objects unlike objects of included libraries There are two ways of getting a POU from a library The following procedure shows you how to import objects from a library 1 Click Import object from library inthe Project menu This causes an explorer dialog box to appear which lets you select the p file of the library you want to open 2 When you have found the p file open it either by double clicking it or by pressing the Open button The dialog box of the library explorer appears in foreground Each tab in the dialog box contains a list of objects of a type consistent with the tab s title Dhect her _ Frograms Function Blacks Eller ere lurelicric Hare TF EwreTceit TF F_TRIG Funchor blocks Furetion blocks Function blocks Funchans arable FUE Furejian Hocks Funchon docks Function Hocks Fanchon Hozka Funchan Hocks L Live ts alle _ Fave ees Checkal Checknene ee TOR Other lileir Ham t Localan TF cect abi TF WorcToByte Function blockz Funcion blocks
211. the selected variable In the example of the above figure you must move the cursor to network 3 and click the ADD block Now click the Graphic trace button in the Debug toolbar Ea This causes the colour of the selected block to turn to green a white circle with the trig ger ID number inside to appear in the middle of the block and the related trigger window to pop up UINT Auto No UINT Auto No MAINFBD 3 0 3 LogicLab user manual 145 LOGI I When preprocessing the FBD source code compiler translates it into IL instructions The ADD instruction in network 3 is expanded to LD k ADD 1 ST K When you add a trigger to an FBD block you actually place the trigger before the first statement of its IL equivalent code 9 6 2 4 ADDING A VARIABLE TO THE GRAPHIC TRIGGER WINDOW FROM AN FBD MODULE In order to watch the diagram of a variable you need to add it to the trigger window Let us assume that you want to see the plot of the variable k of the FBD code in the figure below To this purpose press the Watch button in the FBD bar The cursor will become as follows Now you can click the block representing the variable you wish to be shown in the graphic trigger window In the example we are considering click the button block gt A dialog box appears listing all the currently existing instances of debug windows and asking you which one is to receive the object you have
212. the two inputs 2 Any numerical type Any numerical type Same as Inputs GUT MUL 10 10 J OUT 100 SUB Arithmetic subtraction Subtracts input 1 from input 0 2 Any numerical type Any numerical type Same as Inputs OUT t SUB 10 3 J7 OUT 7 LogicLab user manual LOGICLAB DIV Description Arithmetic division Divides input 0 by input 1 Number of operands 2 Input data type Any numerical type Any numerical type Output data type Same as Inputs Examples OUT DIV 20 2 OUT 10 MOD Description Module Computes input 0 module input 1 Number of operands 2 Input data type Any numerical type Any numerical type Output data type Same as Inputs Examples OUT MOD 10 3 OUT 1 POW Description Exponentiation Raises Base to the power Expo Number of operands 2 LREAL where available REAL otherwise Input data type LREAL where available REAL otherwise Output data type LREAL where available REAL otherwise OUT POW 2 0 3 0 Je OUT 8 0 Examples OUT POW 1 0 5 0 OUT 1 0 ATAN2 Arc tangent with 2 parameters Computes the principal arc tangent of Y X result is expressed in radians Number of operands 2 LREAL where available REAL otherwise LREAL where available REAL otherwise Description Input data type Output data type LREAL where available REAL otherwise OUT ATAN2Z 0 0 140 OUT 0 0 OUT lt ATANZ 1 0 1 0 jz OUT P
213. tion New variable gt rera 2 Specify what kind of POU you want to create by clicking one of the items in the sub menu which pops up 3 Select the language you will use to implement the POU Asolo m Agsignto o eane o Lenea Enter the name of the new module Language OIL OFBD OLD ST SFC Name Mar 4 Confirm the operation by clicking on the OK button Alternatively you can create a new POU of a specific type program function block or function by right clicking on the correspondent item of the project tree EA Project amp Definitions EE PlcExample Project EH Programs Main E Function blocks i a CJ Global vanacies i Automatic variables J 10 variables E Constants I Retain variables Tasks LogicLab user manual 33 E am a ee I 5 1 1 1 ASSIGNING A PROGRAM TO A TASK AT CREATION TI ME When creating a new program LogicLab gives you the chance to assign that program to a task at the same time select the task you want the program to be assigned to from the list shown in the Task section of the New program window 5 1 2 EDITING POUS All the POUs of the project are listed in the Programs Function blocks and Functions folders in the Project tab of the Workspace bar The following procedure shows you how to edit the source code of an existing POU 1 Open the folder in the Project tab of the workspace that contains the object y
214. tion for the compiler error reference If you double click the error message in the Output bar LogicLab opens the source code and highlights the line containing the error Fiert ER Project amp Cention 5 EJ AcEsanple Project 1 n 7 Programe E Main E MpFriogiam 1 Function blacks Jy Functions J Globa variables ea Tarks Address ul Ar ho Dum Generating unrme o v l conpleted Code sige ck i 0 EBEyte Pree code space 7FFENh i 511 KByte Data space 10000h t 64 BBytes Free date Spec FFFGR l 63 EBytej Eit data specs fh i 0 Heated Pree bit data psce th EBytej Eliten data space Oh i KByte Free riten data pacs Oh I Beyted l w F warnings l srrors Buld Phdr poeci 4 Dehug You can then solve the problem and re compile Finet FE Project ME Dental B FE FiEsanpe Pioget 1 In Programe FEY Mair E MyProgiam J Function blacks LE Functions 1 Globa vabler eal Tarks F Fad S R Slow Ta Hem EF imil E Generating progran Halil Generating Unresolved conpleted Code sine d h i 1 KE he Free code space 7TFFCOhn i 511 EByte Data space TOO i 64 KByte Free data spac FFF bb i 62 KBytes Fit data spac ih I O BAyk Free bit data space Oh i KByte Fiten data spaces Oh i Byte Pree Titen data spact fk I 0 EByte fo varnings Oo srrors Address Aub Type LAPIT Ha se Buld i Prdivpegent
215. turns the largest integer that is less than or equal to input 0 1 LREAL where available REAL otherwise LREAL where available REAL otherwise OUT s FLOOR 1 95 Jy OUT 1 0 OUT e 12 2 4 F FLOOR OUT function provided as extension to the IEC 61131 3 standard Bit string functions Description Number of operands Input data type Output data type Examples 182 SHL Input 0 left shifted of Input 1 bits zero filled on the right 2 Any numerical type Any numerical type Same as Input 0 OUT SHL IN 16 1000CAFE 16 CAFEOO0O T6 2 3 OUT LogicLab user manual EF am a ee ee I SHR a Input 0 right shifted of Input 1 bits zero filled on the Description loft Number of operands 2 Input data type Any numerical type Any numerical type Output data type Same as Input 0 OUT SHR IN 16 1000CAFE 24 Examples OUT 16 00000010 ROL Description Input 0 left shifted of Input 1 bits circular Number of operands 2 Input data type Any numerical type Any numerical type Output data type Same as Input 0 OUT ROL IN 16 1000CAFE 4 Examples OUT 16 000CAFE1 ROR Description Input 0 right shifted of Input 1 bits circular Number of operands 2 Input data type Any numerical type Any numerical type Output data type Same as Input 0 OUT ROR IN 16 1000CAFE 16 Examples OUT 1L6 CAFE1000 AND Logical AND if both Input 0 and
216. uages 6 5 1 CREATING A NEW SFC DOCUMENT See the creating and editing POUs section Paragraphs 5 1 1 and 5 1 2 6 5 2 INSERTING A NEW SFC ELEMENT You can apply indifferently one of the following procedures Click Object gt New in the Scheme menu then select the type of the new element action transition or jump Press the New step Add Transition or Add Jump button in the SFC toolbar In either case the mouse pointer changes to Ry for steps i R for jumps for transitions 6 5 3 CONNECTING SFC ELEMENTS Follow this procedure to connect SFC blocks Click Connection mode in the Edit menu or press the Connection button in the FBD toolbar or simply press the space bar on your keyboard Click once the source pin then move the mouse pointer to the destination pin the SFC editor draws a logical wire from the former to the latter Alternatively you can enable the autoconnection mode by clicking Autoconnect in the Scheme menu or by pressing the Autoconnect button in the Network toolbar Then take the two blocks and drag them close to each other so as to let the respective pins coin cide which makes the SFC editor draw automatically the logical wire 6 5 4 ASSIGNING AN ACTION TO A STEP This paragraph explains how to implement an action and how to assign it to a step 6 5 4 1 WRITING THE CODE OF AN ACTION To start implementing an action you need to open an editor Do it by applying one of the following
217. ual es a ee ee Example Explanation mae String of length one containing the double quote character SRSL String of length two containing CR and LF characters SOA String of length one containing the LF character Two character combinations beginning with the dollar sign shall be interpreted as shown in the following table when they occur in character strings Combination Interpretation when printed SS Dollar sign S Single quote SL Or 1 Line feed SN Or Sn Newline SP or Sp Form feed page SR Or x Carriage return ST or t Tab 11 1 5 VARIABLES 11 1 5 1 FOREWORD Variables provide a means of identifying data objects whose contents may change e g data associated with the inputs outputs or memory of the programmable controller A variable must be declared to be one of the elementary types Variables can be represent ed symbolically or alternatively in a manner which directly represents the association of the data element with physical or logical locations in the programmable controller s input output or memory structure Each program organization unit POU i e each program function or function block contains at its beginning at least one declaration part consisting of one or more structur ing elements which specify the types and if necessary the physical or logical location of the variables used in the organization unit This declaration part has the textual form of one of the keywords VAR VAR
218. unction blacks Description Function Types Match whole word only Match case The results will be printed in the Find in project tab of the Output window J Glebal varsles Ee Tasks ei Buld 1 Findin project Debug f 5 6 WORKING WITH LOGICLAB EXTENSIONS LogicLab s Workspace window may include a section whose contents completely depend on the target device the IDE is interfacing with the Resources panel If the Resources panel is visible you can access some additional features related to the target device configuration elements schemas wizards and so on le ad ll AA El Project Definitions a a E so CheckSFC Definitions I TypeDiets Structures 7 EF rer aka Information about these features may be found in a separate document refer to your hardware supplier for details LogicLab user manual 63 LOGIC LAB 64 LogicLab user manual LOGI IM 6 EDITING THE SOURCE CODE PLC editors LogicLab includes five source code editors which support the whole range of IEC 61131 3 programming languages Instruction List IL Structured Text ST Ladder Diagram LD Function Block Diagram FBD and Sequential Function Chart SFC Moreover LogicLab includes a grid like editor to Support the user in the definition of vari ables This chapter focuses on all these editors 6 1 INSTRUCTION LIST IL EDITOR LD a
219. urce Fale are Cate fennel ive LogicLab user manual 8 8 1 E am a ee LAB LAUNCHI NG THE APPLI CATI ON In order to download and debug the application you have to establish a connection with the target device This chapter focuses on the operations required to connect to the tar get and to download the application while the wide range of LogicLab s debugging tools deserves a separate chapter see Chapter 9 SETTING UP THE COMMUNICATION In order to establish the connection with the target device make sure the physical link is up all the cables are plugged in the network is properly configured and so on Follow this procedure to set up and establish the connection to the target device 1 Click Settings in the Communication menu of the LogicLab main window This causes the following dialog box to appear Device Link Manager Config v8 22 Curent selected protocol PODey Protocols Active OH Modbus Y ModbusTCP y PCDev Active Properties Activate Description PCE mul Protocol The elements in the list of communication protocols you can select from depend on the setup executable s you have run on your PC refer to your hardware provider if a protocol you expect to appear in the list is missing 2 Choose the appropriate protocol and make it the active protocol Device Link Manager Config v8 72 Ea Curent selected protocol PODey Protocols Active Y ModbusTCP UB PCDeyv
220. used to dereference a pointer hence to access the pointed variable px ADR x px 3 141592 the approximate value of pi is assigned to x pn ADR n n pn 1 n is incremented by 1 Beware that careless use of pointers is potentially dangerous indeed pointers can point to any arbitrary location which can cause undesirable effects 210 LogicLab user manual
221. uting on the target device When the connection status is Connected the application status takes on one of the fol lowing values No code no application is executing on the target device LogicLab user manual 93 es a ee I 8 3 Diff code the application currently executing on the target device is not the same as the one currently open in the IDE moreover no debug information consistent with the running application is available thus the values shown in the watch window or in the oscilloscope are not reliable and the debug mode cannot be activated Diff code Symbols OK the application currently executing on the target device is not the same as the one currently open in the IDE however some debug information consistent with the running application is available for example because that applica tion has been previously downloaded to the target device from the same PC the values shown in the watch window or in the oscilloscope are reliable but the debug mode still cannot be activated Source OK the application currently executing on the target device is the same as the one currently open in the IDE the debug mode can be activated SOURCE OK DOWNLOADI NG THE APPLICATION A compiled PLC application must be downloaded to the target device in order to have the processor execute it This paragraph shows you how to send a PLC code to a target device Note that LogicLab can download the code to the
222. version functions relieving the developer to specify the input variable type TO BOOL Description Conversion to BOOL boolean Number of operands 1 Input data type Any numerical type Output data type BOOL out TO _BOOL 0 out FALSE Examples out TO_BOOL 1 out TRUE out TO _BOOL 1000 out TRUE LogicLab user manual 175 es a ee I Description Number of operands Input data type Output data type Examples Description Number of operands Input data type Output data type Examples Description Number of operands Input data type Output data type Examples Description Number of operands Input data type Output data type Examples Description Number of operands Input data type Output data type Examples 176 TO_ SINT Conversion to SINT 8 bit signed integer 1 Any numerical type SINT out TO_SINT 1 J out 1 out TO_SINT 16 100 Jz out 0 TO USINT Conversion to USINT 8 bit unsigned integer 1 Any numerical type USINT Out lt TO_USINT 1 3 out 255 out TO USINT 16 100 out 0 TO_INT Conversion to INT 16 bit signed integer 1 Any numerical type INT out lt TO_INT 1000 0 J 1 our L000 out TO_INT 16 8000 J out 32768 TO_UINT Conversion to UINT 16 bit unsigned integer 1 Any numerical type UINT out TO_UINT 1000 0 J out 1000 out TO_UINT
223. w Watch amp sumlO2 361 375 REAL vIQ2 0 007 REAL amp sumy 2062 08 REAL VW2Z 0 034 REAL 9 2 OSCILLOSCOPE The Oscilloscope allows you to plot the evolution of the values of a set of variables Be ing an asynchronous tool the Oscilloscope cannot guarantee synchronization of samples Opening the Oscilloscope causes a new window to appear next to the right hand border of the LogicLab frame This is the interface for accessing the debugging functions that the Oscilloscope makes available The Oscilloscope consists of three elements as shown in the following picture 104 LogicLab user manual Oariioscooe x HH Aaah AYE e e E 3 iPro ee Perera revere FRR pares Fareed al A ere l be dee Iced be bbe eee made 2000 00 Track Lari Miri value ax wale i Fast Fast fbFilber u oe set Feat Pooler y The toolbar allows you to better control the Oscilloscope A detailed description of the function of each control is given later in this chapter The Chart area includes several items Plot area containing the curve of the variables Vertical cursors cursors identifying two distinct vertical lines The values of each vari able at the intersection with these lines are reported in the corresponding columns Scroll bar if the scale of the x axis is too large to display all the samples in the Plot area the scroll bar allows you to slide back and fort
224. watch ze P Symbol valie Troe aum FEAL k LINT 9 1 4 3 OBJ ECT NOT FOUND If the PLC code changes and LogicLab cannot retrieve the memory location of an object in the Watch window then the Value column contains three dots Main E Medium Watch D001 et et be 0002 LD sumIQ2 0003 ADD vI0 Symbol 0004 ST sumIQ2 sumlQ2 1 134 REAL 1005 k 7 UINT 0006 LD sumW2 0007 ADD vil2 0008 ST sun 2 0009 0010 0011 LD k 0012 ADD 1 0013 ST k 0014 x If you try to add to the Watch window a symbol which has not been allocated LogicLab gives the following error message man EJ Mediumi i iach EDER ee A ooo2 Lo sunI0 Sa er Anos ADD TIO Sorbo valie Type 0004 ST sum Qi sumy 5 19498 REAL ooos OOO LD Sund 3 poor 40D vz 000g ST sund FINE 1 J le A k symbol nok Found Can t adda watch tam E H H Uli LIE GE 9 1 5 CHANGING THE FORMAT OF DATA When you add a variable to the Watch window LogicLab automatically recognizes its type unsigned integer signed integer floating point hexadecimal and displays its value consistently Also if the variable is floating point LogicLab assigns it a default number of decimal figures However you may need the variable to be printed in a different format 102 LogicLab user manual M a a ee LAB To impose another format than the one assigned by LogicLab press the Format value button i
225. word To encrypt a POU perform the following steps 1 Right click the POU name in the project tree and choose Crypt from the contextual menu EA Project Definitions PIGE sample Project E Sy Programs Bw e Function Edit source rancon Eff Pogam crt E E Global w E Auto Duplicate program LI 120 i Delete program J Cons i ig Feta Export program to library _ oF ta Tasks Copy name Ctrl C he T 2 Enter the password twice to avoid any problem which may arise from typos and confirm the operation Get password Password i FER Confirm password al OK Cancel K 36 LogicLab user manual E am a LAB To decrypt a POU right click the POU name in the project tree and choose Decrypt from the contextual menu El Project E Definitions a El PicE sample Project E Sy Programs Function Edit source Function Program properties Global ve E Autor Duplicate program z elete program Ly lO Delete prog J Cons J Retai Export program to library H fee Tasks Copy name Ctrl C LogicLab prompt you to enter the password You can choose to encrypt all the unencrypted POUs at once EB Project amp Definitions NM E 1 counter PicExarnple Project y E Sy Programe New object E Main Import object from library Function block Functions Crypt all objects 4 E CJ Global variable Decrypt all objects
226. xecution control elements 11 3 3 2 COMBINATION OF ELEMENTS Elements of the FBD language must be interconnected by signal flow lines Outputs of blocks shall not be connected together In particular the wired oR construct of the LD language is not allowed as an explicit Boolean or block is required 192 LogicLab user manual E am a ee LAB Feedback A feedback path is said to exist in a network when the output of a function or function block is used as the input to a function or function block which precedes it in the network the associated variable is called a feedback variable Feedback paths can be utilized subject to the following rules 1 Feedback variables must be initialized and the initial value is used during the first evaluation of the network Look the Global variables editor the Local variables editor or the Parameters editor to know how to initialize the respective item 2 Once the element with a feedback variable as output has been evaluated the new value of the feedback variable is used until the next evaluation of the element For instance the Boolean variable RUN is the feedback variable in the example shown below Explicit loop ready 3 AND JR run stat gt HEE start SEM I mplicit loop 11 3 4 EXECUTI ON CONTROL ELEMENTS 11 3 4 1 EN ENO SIGNALS Additional Boolean EN Enable input and ENO Enable Out characterize LogicLab blocks according to the declarations
227. y SlatinteipMone Fimtan Sjal sqintepolsterd unge sxe mos Sf yc lallnephon Fk Function Slats an inteipolated ndeas mov F eT acolo Fct Venhes il thie lagat al an interno ated Za 22allnteipetaro Function Waits Wali hoe of af intarpolatad i E Al kf Coe sto and dardad bocke 1 Totget valisbiee Target blocks s Batic a e 1 1 5 4 INCLUDED LI BRARY PANELS The panels described in the preceding paragraphs are usually always available in the Li brary window However other panels may be added to this window one for each library included in the current LogicLab project For example the picture above was taken from a LogicLab project having two included libraries basic pll and thermmodel pll see also Paragraph 4 7 Mame Type Description o f BitToByte Function Compose a byte From amp bits TF BitToWord Function Compose a word From 16 bits TF BybeT obit Function block Split a byte into bits J ByteToWord Function Compose a word From 2 bytes Function block Falling edge detector Function block F REEN and standard blocks STEEL WEEE basic 4 thermmodel 4 LogicLab user manual E am ee LAB 1 1 6 THE WORKSPACE WINDOW The Workspace window consists of three distinct panels as shown in the following picture Project x iz Project o Definitions Resources E IEC Project 5 Programs FE Fast Init Main 5 Function blocks tH Schema
228. yboard command to move to it You can remove a bookmark when you no longer need it 6 1 4 1 SETTING A BOOKMARK Move the insertion point to the line where you want to set a bookmark then press Ctri F2 The line is marked in the margin by a light blue circle 028 00290 030 6 1 4 2 JUMPING TO A BOOKMARK Press F2 repeatedly until you reach the desired line 6 1 4 3 REMOVING A BOOKMARK Move the cursor to anywhere on the line containing the bookmark then press Ctr F2 6 2 STRUCTURED TEXT ST EDITOR IqDW sysIq sysIq addIqgSq addIqSq SHR IqDW 16 04 3 000 IdDW sysId sysId addIdSq addIdSq SHR IdDW 16 04 IF a gt b THEN a Cc n a b c 01 z i The ST editor allows you to code and modify POUs using ST i e Structured Text one of the IEC compliant languages 0002 0003 0005 0006 0012 6 2 1 CREATING AND EDITING ST OBJECTS See the Creating and Editing POUs section Paragraphs 5 1 1 and 5 1 2 6 2 2 EDITING FUNCTIONS The ST editor is endowed with functions common to most editors running on a Windows platform namely Text selection Cut Copy and Paste operations Find and Replace functions Drag and drop of selected text Many of these functions are accessible through the Edit menu or through the Main tool bar 66 LogicLab user manual es a ee LAB 6 2 3 REFERENCE TO PLC OBJECTS If you need to add to your ST code a reference
229. yelaq MUL ayelaq ST IqDW SHE 16204 ADD addIq5q ST addIq5q LD syvsld HUL sysId ST Td DW SHE 16204 ADD addIdSq ST addIdSq The IL editor allows you to code and modify POUs using IL i e Instruction List one of the EC compliant languages 6 1 1 EDITING FUNCTIONS The IL editor is endowed with functions common to most editors running on a Windows platform namely Text selection Cut Copy and Paste operations Find and Replace functions Drag and drop of selected text Many of these functions are accessible through the Edit menu or through the Main tool bar 6 1 2 REFERENCE TO PLC OBJECTS If you need to add to your IL code a reference to an existing PLC object you have two options You can type directly the name of the PLC object You can drag it to a suitable location For example global variables can be taken from the Workspace window whereas standard operators and embedded functions can be dragged from the Libraries window whereas local variables can be selected from the local variables editor 6 1 3 AUTOMATIC ERROR LOCATION The IL editor also automatically displays the location of compiler errors To know where a compiler error occurred double click the corresponding error line in the Output bar T LogicLab user manual 65 es a ee I 6 1 4 BOOKMARKS You can set bookmarks to mark frequently accessed lines in your source file Once a book mark is set you can use a ke
230. you to specify a new project name and a new location and saves there a copy of all the files of the project Asks you whether you want to keep unsaved changes then closes the active project Opens a blank new generic text file Opens an existing file whatever its extension The file is displayed in the text editor Anyway if you open a project file you actually open the LogicLab project it refers to Lets you save the document in the currently active window Closes the document in the currently active window Opens the Programming environment options dialog box Displays a dialog box which lets you set printing options and print the document in the currently active window Shows a picture on your video that reproduces faithfully what you get if you print the document in the currently active window Prints all the documents making up the project Opens the Printer setup dialog box Lists a set of ppj file of recently opened LogicLab projects Click one of them if you want to open the relevant project Closes LogicLab LogicLab user manual 153 10 1 2 EDIT MENU Command Undo Redo Cut Copy Paste Delete Delete line Find in project Bookmarks Go to line Find Find next Replace Insert Move mode Connection mode Watch mode 10 1 3 VIEW MENU Command Main Toolbar Status bar Debug bar FBD bar LD bar SFC Dar Project bar Network Document bar Force I O bar Workspace Library 1
231. z value The same procedure applies to all the variables you wish to inspect 9 2 2 2 ADDI NG A VARI ABLE FROM A GRAPHI CAL SOURCE CODE EDITOR Follow this procedure to add a variable to the Oscilloscope from a graphical that is LD FBD or SFC source code editor 1 Press the Watch button in the FBD bar bi gt 2 Click on the block representing the variable you wish to be shown in the Oscilloscope 106 LogicLab user manual E am a ee LAB 3 A dialog box appears listing all the currently existing instances of debug windows and asking you which one is to receive the object you have just clicked on Debug windows list Symbol to add valueFilt I Debug windows Watch Oscilloscope Select Oscilloscope the press 0K The name of the variable is now displayed in the Track column The same procedure applies to all the variables you wish to inspect Once you have added to the Oscilloscope all the variables you want to observe you should click on the Select Move button in the FBD bar the mouse cursor turns to its original shape 9 2 2 3 ADDI NG A VARI ABLE FROM A VARI ABLES EDITOR In order to add a variable to the Oscilloscope you can select the corresponding record in the variables editor and then either drag and drop it in the Oscilloscope MIE Fast E TuFitet Osciloscoape Class Ei Mame Type ATAY Init wal 1 VAR umi REAL hlo D 2 VAR yini REAL hin D 3
Download Pdf Manuals
Related Search
Related Contents
Skater S 非常業務兼用遠隔操作器 型名 RM Sony 4-141-609-11 (1) MP3 Player User Manual TS 4000, TS 5000, TPS 2700, TPS 4000, TPS 5000 Sondar 2000 Ultrasonic Level Meter Manual PPMC-2111取扱説明書(日本語版) - 産業機器TOP Optimus STS 830 User's Manual Manual de usuario Manuel d`usager User`s guide Balanza solo peso LXL Series Hydraulic Slide Gate Operators 第1号 - 大樹町 Copyright © All rights reserved.
Failed to retrieve file