Visual ServoingFrom the FBL elements, the engineer can, for instance, build visual programs that controome equipment in a factory that is running the process These processestrolled in real-timeisual languages have been extensively studied in the literature(Mohamed, 2000, Burnett1995, Shu 1988, Pressman 1997) As mentioned earlier, computer programs are usuallwritten using textual languages, but indomain-specific environmentsdone in a visual way, as in LabVIEW(Rahman, 1995) Lab VIEW isL go back to 1988(Karaila, 1989)andardized language as IEC 61131-6 languagethe late 1980s the firsdone for FBL The first target was to replaa textual programming language because graphical documentation was already at that timehe customer's requirements, FBLuccessfully taken into ua few programs that were written in textual formatOne of the most important design goalsdesign both thed FBL for extensibility This means that developers could easily extend the visualnguage by addinggraphical symbols to it Such new symbols, for example, maypresent new types in this strongly typed language
In fact, in FBL, users can add newwerful and efficient Thenotifications are done(Debbie, 1995) Developersnvironment that allows extensions andthird party tools Further, new symbol classes or categories can also be added to FBL Thisrequires modificprogrammingmaintenance costs As a drawing a commercial solution was a good waygineering efficiencyto sharehas usedal CADprogram, which can be AutoCADO Copyright 2009 Alor Brics CAD Copyright 20012009 Menhirs NV Both can be used for that purposefocus our own work on the application domain insteadical editor issuesn goals and principlesDevelopers had the following goals in the developmFBL and the programminBasic producttion and a tool for customer projectsBoth Fbl andgramming environment must be flexible anxtendfrom thening thatMaintaining the language should be feasible, and adding new types and functionsEasy to use, because typical users have minimal programming skillsEasy to reuse written applications, because customer projects are very similarThird party tools and products should be easy to be integrated with the preL can be used to program basic agineers can implement different kind of applications with FBL As the am
Model Based Software Production utilized by visualstructure which is derived from the template is the same in each program instance Inprograms that contain data structuresfunctions Templates are built by first defining paranthat can later be usedrfacete an instance from the template Templates further contain formulas,which the parameters are used, Evaluation of the formulas is automatic In some cases, theify the program structure, as in conditional compiling, as a resultFormulas are used in FBL templates for evaluating mathematical expressions and forlanguage statement Thenguageis a simplwithout real prograsy editing and understanding, the mini-languagempact and fit in one line FBL language is generative and each template isto other modules and ports in the systerParameters are model specificOur engineering tools and FBIe main elements in a dsm environment
FBL editorused for model building aneEngineering tools are for managing templates andry project But theation betythe measurements likinge is different as the unit depends on physical measurement Thebe set in programming phase ge with a unit The alarm limits of theprogram has input with an address and a ranitial values The basic analomeasurement template is the model that solves this problem a template contains the modebe parameterized and the instance is varied by these parameters One measurementtemplatbe usedthese different measurements ifemplate The nexto make firstthat willlAfter that, templating can start by the following stepsembers, these are parameters for a visual template,Define needed formulas, these use parameters defined abcSave a template, andCreate an instance and test it (modify parameter values)fic dialoshown in Figure 6Parameters work like a placeholder and follow the same syntax rules as Python variablesept that theyreceded by s enclosedParameterdentifiers are case sensitiAfter this, the user can defineparated field that will store thermula as shown in Figurealuation phase the formula is evaluated and theresult is placed in the actuala, n trld thThe engineer can already see the current value thate Formula evaluation is automatic and it helpsthe engineer to always see evaluated values
Visual Servoing分 Create DesignFormuaMPLATE)TEMPLATET-EXAMFLEHighlightHH LIMIT 95tLL LIMITadefines first desiomplete parameter useParameter identifier: \S(MYPARAMETER)Parameter value: Example textpoint, comment attributeFormula field: Test \S(MYPARAMETERTest Example textAfter step thmplate saving, the engineer can create a new FBL progragure 8 Usually new instancesterface Tg always needs multiple instances becatong formula that willnique identifier or overlapping address definition
The Fbual temiplemented by mini-language that needs minimalprogramming It can be extended when needed but the current functionality has beenTemplate directives/functions are listed below Some of them are domain specificematical formulasfunction-formula(conditional part, works like snippet)reference(syntax for parameter, referenceselect formulaprefix formula (special string handling with prefix
Model Based Software Production Utilized by visual Templatesm續Fig 7 Step 2: Formulas are defined in each needed locationMathematical formulas are evaluatedding to standard evaluation order most of theasic calculations are implthe libraare replaced and formula evaluation result is in the valuefield
value fusually a symbol's attribute value butFunction formulaike a snippet Ordinarily, theseate into larger programming modtlate The " codt is fixed but theelements belonto the functirmula It can be turned on or off by a conditional statement If the result is true, part of the
Visual SeD日母、 R,B,B Bi& Es P: P+ e∥⊙m%自中了E甲‖,日日如可回國召,””既5三、M4D MNModd A Rout/Fig 8 Step 3: Testing template with new values Modified design parameter values arecluded, otherwise not Function formula does not minimize the use of repeatedode it is for selecting features In FBL editor function formulas are usually marked withThe following Figfunction-formula definition for selected elements and Figurelect formula can be used as 'switch case or 'if
then else statement foanother value by given value This is a kind of enumeration based transformationPrefix formula is used to minimize entering the full reference name In automaticprefix or suffix This abstraction removes/hides programming details from the usteshown in Figure 6, the user must first define design parameters that can be usedvariables in formulas Mandatory parameters areTAG(instance identifier)PACKAGE (logical name for download target) andUNIT, HH (highhigh alarm limit), H(high alarm limitk at properties of the symbol and add then formula tocalculate a ne
Model Based Software Production utilized by visualg 9
Symbols are selected &r active Function formula defined for selected elements(lowerInction blockconnectie日高守爭母、。‖和數和羣聽作7⊙回船圖中了甲A中量過talue l back to the diagram
Visual ServoingIn the template creation process, the user has to save a diagram as a template into templateIn the last step, it is good to test the template so that it works correcall neededate at least two instaoverlapping identifiers (global names like moduleTesting is possible in a virtual environment There are symbols for each actuator to createaction feedback The user can have a motor that will start from the start command andfeedback will generate motor running status In theaction feedbackmodel larger functionalityFor this purpose Metso has implemented a visual template34Before metsg typical for modeling FButions This first generation model is static and is based on more copying existing FBLdiagram The main pito replace tokens in the typical with realual template to other solutions visual templateimmediately evaluated
For instance, it is faster to modify and test Before the final teneeded: specialized instancepiling and loading into ruLittle Languages(Deursen, 1998)visual templatin small language, butway to create specialized instances was taking more time An oldertypicalained replacement tokens Each parameterized valrontained a token, Thpecialized instance This was always needed to test the typical The replacement token wasnsformation or calculation Thus, it was limited to direct replacements not support anyost andpossible to modify any value The replacement didn be parameterized and it will evaluate Fupdating FBL One important difference to other template teclis that the FBLinstance contains all template functions and due to this fadParatdthough the FBL is edited to differ from theplate Typicaldid not offer all the functionality thatented now with theMass production of FBL programs is the key productivity for terproductivity by saving time and improving甲pmity with standardProductivity is measured in many placesProject departmentual meValue Added Reseller(VAR)partners, specific process area: 100 templatIn general, over 90 percent of programs made from a template (project library makesfrom each projectExcel or sheet as main parameter input method (data and implementationeparated; engineering tools can separate data from implementation)
Model Based Software Production utilized by visuallicability to domain and product family princiry good Existinturned into a template by a few steps Template programmingfunction into existing FBL diagram Template programming is interactive and the uIn other template based languages, a template ised and needs rendgeneration thatcreate an instance frolplate This requires extra maintenance Inur domain, instances contain all template formulas This is a benefit for us even it can behat it keeps all matching parameter valueched This flexibility gives the freedomnal template and updafterwards for all needed instancesThe instance of the template can inherit values from another instance by a reference formulaThis reduces the amount of parameters that thechildren The purpose of the feature is to reduce parameter amount and automate parameteron, Asprimary loop, but the same text is also used in its own history collection definition loop Init is easy to make reffrom a history loop to a primary loop An enghange text in the primary loop and it is automatically propagated into the history loophaint sneer does not have to enter text anymore An additionalpositive effect comes to maintenance
It is better to split functionality into its own featuresand bind needed parameters together by referencing Fmetaprogramming support makes visual templating a practical reuse technologyEnd customers are becomingtemplate and implementationd later Or inexpert defines automation functionality at the factory in the start-up phaseEasy to make modifications and take those into use just by changing or updating theEven through the temck to do withty and metaprogramming There is the needach thistechnique The conversion tool will neetransftypiTime will show the life cycle of the templates There have already been cases that the projectfirst done with templates and delivered without the formulas This kind of downgradingmetimes needed to support old installed systems4RductioSupport for softwarbe hard to utilizematiill require processcontinuousnd knowledgeTraditional software reuse can be implemented by components and libraries In the similarway FBL contains build-in functions that are Function Blocks These are documentedusedplement application programFor effective appliIt isarder because they do not usuallyextra documentatioto any hierarchical structure likeFunction Blocks are in the libraries The system
Model Based Software Production Utiliz
ed by visual Templates5ub domains are integrated into FBL, the use of FBL is growing Our customers willgineers They will come to the FBL training Theyoonsible for maintenance andprocess design They usually dMost of the timegoes into environment training and main principles of the automatlanguage itself is not so much used,few programs are made during the training thalata flow programming languages Undicate thefindings as developers have experienced such as, The data flow semanticsof visualderstand andDesign principles of the language are briefly summarized nextThere will be an artifact in the system that can bemeaningful concrete functionill be very direct mapping from the eq IO card symbol to a program physical IO cardSymbols are for creatingnication to transfer signal data One symbol thatcontains an output and can be connected by line to another symbol input to representtaflowData-floganized so that inputs will be on the left and outputs on the righthere will be immediate visual feedback during testing programAll of the above willabination that merges algorithm andreteness, directness, explicitness and immediate visual feedbackare listed in( Burnett, 19994 Basic symbolFunction block language contains thousands of symbols The following is a categorized listAdministration part symbol fong purpose of the diagram,External reference symbol for transferring data outside module,Local data symbol for allocating memory for temporary signal datPortor definingfor externalFunction block symbol for making signal operation/handling /caldBasic symbols are just for data(memory location) and function block synhwith numbersthat are executing algorithms Language is not making a memory location orprograming is dlate program and customer logo The program itself is drawn inside the frameof the administration symbol defines There are different sizes available and the programd to multiple pages Signal connections between the pageseferenceFunctional administration symbol defines execution interval and logical location in theystem This symbol is used to define a new module
Visual Servoingport can be either an interface or a direct access port Interface portis a suffix for theglobal name that must be unique inystem(factory level) Port is an acry location with thelogy an external data point It containsIn the pre is a reference to thing to thetransferredvaluesLocal data point is inside the module and is needed only to store values between functioncalculation function blocksFunction blocks in Figure 1 encapsulate actual subprograms Encapsulation protectsion
Function block alwafor each function block symbol All function blocks are sorted andtedorderlock contains inputs, outputs and parameters Inputsecution and parameters are used for the calculation and after execution outputs are set InIding blocks to define their own programFig 1 Two function block symbols with the am symbol's parameter dialog
Model Based Software Production utilized by visualCommon function blocks are pid for controlling, logical and or functionalgorithm and calculations Basic system function blocks are copy (ccox), selam2), binary measurement(bm) and device specificnction blocks are for enthalpy calculation went and steam flow calculation ( stfl;omIDeYTuuLFig 2 FBL control loop prograFigure 2 shows an example FbL programbols a and d are standard(yo) symbols Symbols C 1-3 contain texts and other ofty and alarmarametepriority and alarm group) for the controlfunctions Operators in thelook after the process status from the monitors
The process iseasured and run by the programs but people are still making decisions and performingactions (pushing buttons) to control the process Symbol C3 is for alarm functions Finallythe area for the actual control program All other symbols representing function blocksand connections are in the same program as the other symbols are building their ownontrol the processThe graphical layout is to be read from left to right: inputs are on the left and outputsthe right Figure 2 represents a typicm in size and functionalfunctional entity, Thediagram areconnected by lines, while connections outside one diagraconstructed using symbolshat contain reference ngure 1 symbol BFigure 2 shows one Function Block Diagram that can be used to generate multiple textualfrom a one-page program to several pages long: each filedividual program In additiones that are connected by lines in a FBL program are
Visual Sestored in each file Program modules are distributed in different places in the system TheProcess Control Server(PCS) runs I/Os and control programs, Operator Server (OPS)andProcessor (ALP), in turmple, Inhange displand look at different parts of the process and manipulate control parameters from themonitor windows)field bus controller, It will load needed parameters into the Iata fromternal device to the system using communication protocol is loaded into the CPU unit thatbols for creating a connection can be divided into two major grorO-symbol to connect a physical field device I/O card makes analog/digitalansformation to an electrical signalDifferent kind of I/O-symbolsailable, they represent 1/O-card It contains parameterske I/O-address, filtering and othercontains address for accessing data through software protocol
The physical connection c(MODBUS) Protocol addressing is register-based (address format examples ' reg 1001'or ' dw0) Signal data-floway as with I/O-connection Theinterface module is executed by the driver and the actual data is connected with the externalta point to transfer the data from the driver to the applTheg from I/O-card conneco the field deviccts signal flow electricallyFrom the 1/o-card the signal is pid digitally and field bus transfers data between theI/o-card and CPU unit This is physical distribution and the signal route is illustrated inace and alarm handling,operator statind alarmText data forThese application programs listed abovennected byfunction blocks arconnected The connections are fixed and thecan give one connection name that createsother needed connections as external data points This redgranythe corresponding function block symbol they areeferring Reference is done by using the same names in the symbols
Model Based Software Production Utilized by visualMeasurement on the fieldConnection to lo20mA electric sianalCPU rurtrolsN[0Fig 3 1yO-signal data flow from the measuring device to the controlling CPU
6 Connections and networksThe connection networks can be very simple point-to-point connections or verynetworks The network structurork participants In other words, the connection target is the named memoryPoint-to-point connection, where output is conneMultiple connections, where lines can be connewith a connection dot thatwill join underlying lines and creates a connectin
Visual ServoingConnection references, where lines can be connected with symbols that containsFig 4 Connection network examplesAfter thn run through the connection algorithm that finds theThisa very simplified explanation for the whole underlying system that contaipecific rules for connection solving27 Strong typingtrongly typed and simplethe basic and nHaving todifficult for the user or programmer to distinguish the different types based on colortley,2001)
Further, the benefits of using colors are diminished when printing therograms using a black and white printer; onlylor defines the type of signaldata Basic types are with color in the following wayGreen(ana): indicates two values, value(float)andBlack(bin): indicates a true/false bit(bit O) and fault bits(bits 1-15)Brown(binev): indicates bin and time staBlue(intl ): indicates long integer and fault bitsdicates short integer and fault bitellow(float): indicates plain real number(float)all other types(less used misc typesNote that the above are scalar types/array \ other multi--dimensional types are drawnby a thicker line but with the same color as the element type of the vector/ tabl
Model Based Software Production utilized by visual5Thedraw the connection line freely by routing the line and then the programConnection linesand if they are connected there is a connection dot in crossingonnect signals together In addition, there are special data types for themunication The function blocksalso based on types that are composed asstructuresAt metsodeveloped our own meta-language for defining all the needed structuresplex structures such as function blocks are defined with thislanguage This metainformation is available from the type database This can be used tobuild function block symbols with default layout Default layout is to place inputs on the leftside of symbol, parameters in the middle and outputs on the right3 Template mechanism of Function Block Languageels that reflect real physical devices orneeded functionality a motor fois modeled as a function block named mtr The same model can be used for all baand pumps Similar way valve model is a function block named mgv(magnetic valve) Inthis way, function blocks are created to solve basic prolin the domain: theblock is the name of the focused object Function Block can be parameterized and connecteatput values FBL also contains elements that are for user interface and alarm handlingModeling hid3
2 Meta template mechanismur solution is to use visual templates for efficient programming( Karaila Systa, 2007)usedm Instanc plate willtrol The mototain aused toplication hapresentation role and actual parameter data is in the database Transformation attachestemplate and the result is the implementation This mechanism works in theav as inhe web applications The Excel integration gives an effective way to modify existing data inpossible to export data intoThese facts are behind the optimal combination of FBL and framework toprogrammingTemplates are used for example in C++ programming languin web applicationsCnsidered 'type-safe The FBL template engine differs frorplate engines because the FBLlate is evaluated immediately in design time canded at compile-time FBL templatebe parameterizeddatabase interfacehis kind ofple is also used in web applications, Mannguages that are used in web programming like Java or Python hayine These kinds of weers use primary data from the database and producinterface as shown in Figure 5 This makes effective separation between the business dataand presenData can be easily maintained and present
Visual ServoingL templates have parameters in the database and the FBL templaterogramming, peoplStandard Tibrary (STL) Web basedcheck the end result in thusing STL, compilinglate In the Fbl, template functions are evaluated immediately and transformation isParameteoduces documentsExample TesExample Test 25 Principle of web template engineStatic metaprogramming(template metaprogrammingiques in general are used toenable the customization of programs at compilation time For instance, comprogram for different platformswith such techniques like usingowever, also be rather challenging E-g debugging is typically difficult due to the lack ofproper tools
This, in turn, challenges the testing of static meta-progreof template codes at compile-gnificance in larger projects but is typically insignificant in smaller ones In additiefficiency, template meta-programming techniques supportand facilitate codeminimization and maintenance This is because the programnand implementing general, perhaps architecture-level structures FBL templates are used todefine a common program structure for a family of application program instances Thetemplates are further used to create these instances whichcalledol loops in thebe usedinstancesp to 100 in practice Each instance has its own identifier and parameter set The program