FAST.TRACK-01 (EN)

Page 1

FAST.TRACK-01 english edition

The POWER-KI Magazine The soul of things the Software

Software is Design

Italian Design in Software

SPA

Sofware Plastic Architecture the original paradigm implemented by POWER-KI

Native Cloud

Applications with distributed user interfaces

HABS

Heuristic Automatic Bars Store

Installation

Where to find distributions and which one to install

To begin

Calculator V3: the exercises of the PWK-01-BASIC library

ASSEMBLY and Package POWER-KI APPs.

Ciao (01,02)

Two step-by-step examples

Warehouse Manager

A multi-user warehouse.

PLC Connector

Siemens PLC S7 Client and Server

Gallery

Application images

OCTOBER 2021


FAST.TRACK is a publication of XPLAB s.a.s. which owns all the rights and is protected by copyright © 2021 XPLAB s.a.s. All rights reserved. Only full articles can be reproduced, without images, provided that they bear the following wording: © 2021 XPLAB s.a.s. with kind permission. Otherwise no other part of this document may be photocopied, reproduced, translated into another language, stored on any medium, transmitted, without the written consent of XPLAB. POWER KI ® is a registered trademark of XPLAB s.a.s. The POWER-KI ® © programming language is an original creation of C.A. Perani


In 2010 the first commercial application was created with POWERKI (PWK), it was a component of a software destined for a nuclear power plant, but the development work had begun five years earlier and continued without interruptions, generating successive versions, more and more reliable and performing. With version 10 called “Glue” we have reached a much awaited turning point, that is the possibility for developers, using WRAP technology, to extend PWK with independently developed libraries. The current version 11 called “Veloce” further improves both the development environment and performance. The validity of the project is amply demonstrated by the applications developed, most of which in the field of industrial automation, management of machinery or factories, all of which are highly complex. But the possibilities of use are much wider and range from IOT (Internet of Things), to the decision-making and processes management, to eCommerce and Web, to finance and insurance. However, I must admit that taken from the development activities we neglected those of communication and documentation. We mistakenly believed that the applications and innovative concepts implemented would speak for us. After all, if something works well, moreover indoors in a factory, nobody notices it. Even from the point of view of documentation we are a bit lacking; the book “POWER-KI: a programming language - Preludio” date 2012 while maintaining its validity, at least as a reference to the language, is more useful to those who PWK already know, rather than to those who approach it for the first time . My hope is that the great advantages that using PWK brings, will be known by the largest number of developers and companies. To try to make it possible, among other initiatives, this publication “FAST.TRACK”. So not a manual but a magazine in which to find specific technical references, use cases, examples, reflections. As they say in these parts “Hic Rhodus, hic saltus” .. we try. CAP

xplab - research in automation - brescia - italy

FAST.TRACK-01

3


It was 1987 and not only the term Software was not well known but also its meaning for most was incomprehensible. Having to write a document in which I illustrated the project of a software I coined the definition of:

“soul of things” after such a long time I think I can say that I was right. The software with its partner the hardware, is everywhere, in phones, in cars, in vacuum cleaners, in refrigerators ... its pervasiveness is destined to increase as well as its influence on our lives. To understand its economic relevance, it is sufficient to examine the world ranking of the main companies that sees software companies or in any case linked to it, in the leading positions. The software determines how things should behave, but it is not born with them, it must first be thought, for the moment mainly by humans, and then transformed through a Programming Language (PL) into instructions, code that the hardware, the physical layer, will be able to perform. The mediating element, the programming language, binds the possibilities, but also conditions the expressive and creative abilities of the human. In other words, the PLs are not all the same, but not only for the technical possibilities to which they give access, but also for how they form the Programmer’s ability to imagine and implement an application solution. 4

FAST.TRACK-01

The quality, innovation, economic impact of software applications depends on the PL used, which therefore we must recognize as a strategic infrastructural element. From these considerations POWER-KI (PWK) was born for countless unique and original aspects. Thanks to PWK and its ecosystem, the Programmer has at his disposal a series of tools for the development of Intelligent Applications (IA), which, by exploiting all the available information, also obtained autonomously, offer effective services in a simple way. www.power-ki.com


The advantages for IT companies deriving from the use of PWK are many, in particular: • significant reduction in development and maintenance times; • reduction of training times; • possibility to cover wider market segments. The application areas of POWER-KI are by: • IOT (Internet of Things); • supervision and control of industrial machines and plants; • the management of production and decision-making processes; • to the financial and insurance sector; • to the Web and eCommerce.

Whenever a new PWK application is created, there is an effect of novelty and change due not only to the technical possibilities that the language makes available, but also to the different way of approaching problems by analysts and programmers. However, the most rewarding aspect remains the satisfaction of end users, who are always surprised by the completeness and ease of use of the applications. (CAP)

xplab - research in automation - brescia - italy

FAST.TRACK-01

5


Software is Design “Software is Design” is one of the concepts that inspired and guided the development of POWER KI (PWK). A software application is the result of a series of steps equivalent to those required to create a tangible product: • its purpose and function must be defined, resulting from a request by a client or an invention; • define the features, appearance if necessary, interactions with other elements of the environment and/or operating system; • choosing the technologies and techniques to be used; • planned realization; • determine the test and validation activities; • planned distribution and maintenance. The development, with the “Agile” method, is a rebound between the 6

FAST.TRACK-01

various steps that lead by successive approximations to the final result. Creating software remains an artisan activity that requires in addition to technical skills, creativity and vision and in which aesthetics plays a role: evident in the user interfaces, always present in the system architecture. This in summary, from which it emerges that the “coding”, despite being the phase that leads to production, is only a part of a job, which can be extremely complex. Historically, computer programs have been created to do things without caring too much about how. Design referred to software, also means taking care of the how, the methods of interaction and the functions provided; making windows with sharp or round edges, with flat or gradient backgrounds is graphic. Design www.power-ki.com


is making programs that provide their services in a simple, effective and immediate way. Obtaining simplicity requires critical vision, that is, questioning the things that have always been done like this, a lot of work, attention to detail and the right tools. Examples of Non Design are numerous, starting with Operating Systems: option panels, each of which requires an investigation on search engines to understand how they work, commands with a list of kilometric options and so on. Another example of NON Design is counter-intuitively that of Icons; there are programs that have hundreds of them, often not dissimilar to each other, hieroglyphs that force you to decipher. The advantage of the icons is all of the software manufacturer who in this way reduces the burden of internationali-

zation of its product. Icons are fine when they are direct in the representation or belong to a known communication system; associating them with an immediately readable text is a good thing but it is often forgotten. Recent studies (Nature 8-April-21) have found that most people tend to solve problems in an additive way, that is, adding elements even when selective elimination could lead to a simpler and more convenient solution. In programming, the additive mode is prevalent and leads to software stratification. From a cognitive point of view it seems less demanding, but it often transfers a more complex system to users.

xplab - research in automation - brescia - italy

FAST.TRACK-01

7


In computer languages, object-oriented programming is the emblem of stratification. The concept of objects in itself is useful but often leads to the definition of application meta-languages that ​​ are difficult to manage and require further training for programmers.

te use such as Python and Swift and Go. The paradigm of objects finds its main representative in Java (whose rigidity in this sense is proverbial) for years now the most used programming language for non-web applications. In this regard, it is necessary to mention Java-

An example for all is the technology developed by “Talligent”, a company established in 1992 by Apple, Hewlett-Packard and IBM; it was an extremely ambitious Object FrameWork that collapsed due to its complexity. Absorbed by IBM’s Talligent, some of the technology was used in VisualAge C ++ and those who used it lived for years afraid of receiving requests for changes from users.

script which with HTML5 and PHP in the background is the undisputed protagonist of online pages. Although there are no studies in this regard, the influence of the programming language on the programmer’s way of thinking is in our opinion quite evident. If the language implements a strong paradigm, objects, functions, lists, this will be the lens through which the programmer will look at the problem to be solved and which will therefore be adequate or limiting depending on the case.

Programming languages ​​ are the technical aspect that not only conditions but also guides the development and design of applications. In recent years we have seen contradictory situations: on the one hand languages ​​that have evolved by adding complicating elements (C ++, C #) and on the other hand the spread of languages ​​of simpler and more immedia8

FAST.TRACK-01

Although for almost all languages it ​​ is possible to write the code with common text editors, normally the development environments IDE (Integrated Developing Environment) are used. They are tools that support more than one lanwww.power-ki.com


guage and that in addition to editing also cover all the remaining steps necessary to arrive at the executable application. Many of these IDEs are examples of NON Design and as a consequence require a long training of the users. With POWER-KI we have tried to follow the path of Design, with a profound reinterpretation of the elements at stake, starting from the concept of Programming Language to arrive at WorkBench (development environment), Debug and distribution with the aim of providing to the Programmer, who from here on we will call Designer, the ideal tool for creating Intelligent Applications (AI). POWER-KI implements the Software Plastic Architecture (SPA) a completely new paradigm which, together with the Native Cloud for GUI (Graphic User Interface), allows to create innovative and in many cases surprising solutions. A simple and effective syntax, a development environment complete with assisted editor, test and debug tools and more automation tools for code generation such as Wiz and Tools. All with a learning curve that allows for the rapid production of quality applications. The Designer has few constraints, he can look at the theme to be developed with his eyes and decide point by point the type of implementation: for objects, lists, functions. The built-in libraries offer immediate use services: database management, KnowLedge base for unstructured data, industrial communication protocols, image acquisition (OpenCv) and much more. If the need arises to integrate existing technologies not included in the LIBs or to create proprietary ones, POWER-KI can be extended with the WRAP technology, which allows to embed external

DLLs in a quasi-native mode, opening the possibility of using PWK as a sort of connective tissue between different technologies (the code name of version 10, which first incorporated this technology was GLUE - glue). WEB technologies have also been revisited. The WorkBench allows you to create WUI (Web User Interfaces) based on HTML5, CSS and javascript. An entire website can be incorporated into a single WUI. Furthermore, these tools allow the creation of hybrid solutions with great simplicity. There is also an ecosystem of PWK applications which we will discuss in the next issues of this magazine; in particular PWK-ES Enterprise Server for managing Cloud applications and PWK-ISP for debugging and “hot” modification of applications. With POWER-KI we have tried to make everything easier, from installation that takes a few minutes, to the creation, validation and distribution of applications. As far as we know, POWER-KI is the first (commercial) programming language made in Italy, written in English but designed in Italian, an example of Italian Design in Software.

xplab - research in automation - brescia - italy

FAST.TRACK-01

9


Testo ©

Software Plastic Architecture (SPA) is the technology that allows the creation of self-evolving software. Implemented by POWER-KI it is completely original and does not find matches in other PLs. The PWK program is contained in a branched tree structure that becomes a Knowledge Base (KB) accessible by the program itself during its execution, through the library functions. PWK therefore overcomes the traditional dualism of programming languages, that is code-data, in fact all the code elements, data, flow elements are reachable (Reflexivity), modifiable and even if new ones can be added (Self-Modifying). The type of data, which in PWK are called ATTRIBUTES, is defined each time by their content (Typeless), this simplifies the programmer’s work. For communica10

FAST.TRACK-01

tions with other systems. applications or hardware devices, objects such as BUFFERS are used that take care of the conversions. Multi-Threading, or the simultaneous execution of multiple code flows (THREAD), is present in the foundation of PWK. All elements and libraries are designed to prevent overlapping operations that could give rise to inconsistencies. For more complex cases, there are explicit synchronization functions such as semaphores (SMF) and doors (DOOR). In common programming languages, the code is usually not editable and is shared by all the flows that execute it. In PWK instead, as we have said, it is modifiable and usually has a characteristic that we call Persistence, that is: when the executable elements (EXO, MTHD) are invoked, a pair is created and it is this that www.power-ki.com


SOFTWARE PLASTIC ARCHITECTURE (SPA)

is executed. To give an example, if two THREADs require the execution of the same method (MTHD), each will be assigned a copy that will have an independent life until its (automatic) destruction at the end of the execution; any modification of a copy during its execution will not be reflected in the other. With PWK, thanks to the SPA, it was possible to create applications such as PWK-ISP which allows debugging and modification of applications in production, code elements such as KB3 which allows the sharing of knowledge base on the network, and a whole series of Tools and Wiz for automation of application generation.

xplab - research in automation - brescia - italy

FAST.TRACK-01

11


Native Cloud The GUI user interfaces of POWERKI have an uncommon feature: they are in fact separated from the application that generated and manages them; it is what we call Native Cloud (NC). This translates into the possibility of physically separating the display system, user interaction, from the execution system. From the application point of view it is possible to create programs installed on servers, reachable via local network or internet, with Client interfaces distributed on the users’ PCs that have the same appearance and reactivity as the local ones. Another area is that of embedded systems, that is “incorporated”, which without interface devices in this way can be equipped with them.

the result, not having to take into account the particularities of the various browsers, is always consistent. Furthermore, since the connection between Client and Server is persistent and bidirectional, the reactivity is superior and since the communications are encrypted, the security is also greater. From the design point of view, NC technology does not limit the creativity of the designer in any way, on the contrary it offers new opportunities and ideas.

The advantages of the Client Server architecture (under which the NC falls) are known: you modify the Server application without having to worry about the Clients, data consistency and integrity, backup and restore. Compared to web technologies, In industrial environments, PC life the POWER-KI NC has numerous advan- is not easy: dust, power surges and other tages, in fact implementation is faster and factors shorten their life, and when this 12

FAST.TRACK-01

www.power-ki.com


happens often even production stops. For these reasons, there is a strong push towards solutions that are manageable by corporate Data Centers. On the other hand, development is more complex.

With NC by POWER-KI and with the solutions of its ecosystem such as PWK-ES Enterprise Server, everything is simple again and on the Clients it is sufficient to install the PWK_GUI distribution.

xplab - research in automation - brescia - italy

FAST.TRACK-01

13


HABS Heuristic Automatic Bars Store HABS is a very illuminating example of what and how an Intelligent Application (IA) made with POWER-KI is. It is a software for the Control and Supervision of a warehouse of brass billets for the extrusion of profiles that are used as semi-finished products mainly in fittings and taps. The warehouse has the function of stowing the billets (brass cylinders 10m long and about 300mm in diameter) co-

dling. The hardware consists of a series of Siemens PLCs connected in profinet. In addition to the problems relating to the automatic operation of the system, it was necessary to take into account the fact that the Operators can carry out manual movements. Each billet has specific characteristics such as alloy and analysis that are not visually recognizable, it is therefore essential that the system is able to keep track of each movement, regardless of the agent. From this need an original dual software architecture was born, i.e. on the one hand a heuristic executor identifies and executes the movements, on the other an independent observer translates Plant Scheme the signals coming from the sensors into ming from the casting into vertical stacks, identified actions that it displays in the and then picking up according to the re- user interfaces and if these actions have quest (by alloy, by analysis, by size, etc.) involved moving material, updates the which must be cut and sent for extrusion. database so that it is always consistent Five overhead cranes take care of the han- with the state of the plant. 14

FAST.TRACK-01

www.power-ki.com


Real Cases Users who use HABS are different by location and job: • Casting operators: assign the characteristics of the billets and have the option to manually choose the storage destination; • Operators at the sawing station: indicate the number and type of billets to be picked up; • the Department Manager: view stocks, define strategies for automatic operations; • the Laboratory Manager: make changes to the data; • Maintenance Workers: check the status of the system; • other Users: view and obtain information and reports. Interface pages were then inserted into the application in which a real-time 3D representation of the system is given that users can explore but which differ in

functionality according to the type of user / location they are intended for. The implementation with Native Cloud technology made it possible to install the application on a company server and, directly or through the PWK-ES Enterprise Server of the POWER-KI ecosystem, distribute these interfaces to the various Users. One of the peculiar features of this application is the role of the PLC, in fact usually the control and handling tasks of the system are delegated to it and the simple man/machine interface tasks to the PC. In the case of HABS, things are very different, in fact the PLC safely performs atomic operations that are scheduled and commanded by the Control and Supervision software, that is HABS. The scheduling is made on the basis of a heuristic simulation of the various possibilities which, based on the requests, the state of the system and the com-

xplab - research in automation - brescia - italy

FAST.TRACK-01

15


mitments of the users (wagons, holds, roller ways) determines the optimal solution. The Observer was implemented using a particular data structure called StackEvents and from its analysis is able to understand what is happening. HABS is integrated into the IT structure of the company, data and application tables update a company database, vice versa any changes made to it (with other systems), are detected and immediately reflected on the representation that HABS gives.

16

FAST.TRACK-01

www.power-ki.com


Native Cloud Architecture

NOTE. This application replaced the previous one created by XPLAB in 2007 with XPOLYPLUS® (XPLAB technology for real time SCADA). The reasons for this replacement were the need to have a system that can be integrated in a 4.0 logic, into the Company’s IT infrastructure and to provide access to the application also to figures other than plant management operators. XPOLYPLUS technology, while providing reliability and

performance characteristics, that the years have amply confirmed, was however limited in its interconnection capabilities. With POWER-KI it was possible to create an application that has preserved and enhanced the functions already present in the previous version, adds new ones, significantly extends the connection possibilities and is open to future system expansions.

xplab - research in automation - brescia - italy

FAST.TRACK-01

17


How to install POWER-KI

There are three distributions of POWER- the DOWNLOAD link, open the page on KI: the GitHub platform that contains links to the most recent distributions. Once the DEVELOPER edition (DEV) chosen distribution has been downloaeverything necessary for running, deve- ded, the installation can be carried out by loping, testing and debugging applica- confirming the various screens; tions; the second is from the Microsoft WinEXECUTOR (EXC) for running local applications and/or con- dows 11 Store (search for “POWER KI”); in this case, once the installation is connecting to NC applications; firmed, the store app will take care of the GUI Client download and installation. These versions Clent for connection to NC applications. may not be the latest due to the time required for certification procedures. Downloading and installing POWER-KI In both cases, the Operating Syis an operation that takes a few minutes. stem will require manual confirmation There are two options available: from the user. All distributions are digitalthe first is to access the website www. ly signed by “XPLAB sas di C.A.Perani”. POWER-KI.com and from this, by pressing 18

FAST.TRACK-01

www.power-ki.com


Instructions

Depending on the distribution on the desk-top, the following links will be created:

xplab - research in automation - brescia - italy

FAST.TRACK-01

19


• The link to the Workbench opens the development environment, the first time you will be asked to search for a license file. The 00-00-00-00-00-00. lic license file for non-commercial use is included in the distribution; • The “Core Manual” and “Gui Manual” links refer to two manuals in “.odt ” format (Open Document Text) which contain the documentation relating to the functions of the system LIBs and to the elements of the GUI; • The “ES Local” link starts the search on the local network for connections with PWK-ES Enterprise Server servers, if there are more than one the user is given the possibility to choose, otherwise, or after the choice, the login page is opened; • The “PWK Cloud” link allows you to connect to the POWER-KI cloud server from which you can access a series of services (accepts as ID and PSW “guest”); • The link “Calculator V3” opens the relevant program. All installations create four directories on disk “C:”: C:\PWK-PRG for POWER-KI programs; in the subdirectory “C: \ PWK-PRG \ XAPP” the DEV and EXC distributions copy demonstrative applications (such as Calcolatrice V3); C:\PWK-TMP for temporary files; C:\PWK-EXG for data exchange (e.g. downloaded from the GUI); C:\Program Files(x86)\XPLAB\POWER-KI

is the directory where POWER-KI executables are installed.

20

FAST.TRACK-01

www.power-ki.com


xplab - research in automation - brescia - italy

FAST.TRACK-01

21


1. calculation insertion area; 2. result, if there is not enough space, it is moved to the side; 3. historical calculations and results; 4. defined parameters; 5. saving the formula in the current library; 6. button to select libraries page; 7. library formulas;

To begin : Calcolatrice v3 Clcolatrice V3 (CV3) is a POWERKI APP included in the DEVELOPER and EXECUTOR distributions. CV3 obviously allows you to perform mathematical calculations, just click, type the calculation and press enter. However, compared to the normal calculators that the operating system provides you, it has a series of features that greatly extend the possibilities of use. You can use parentheses in calculations; for each execution the formula and the result are retained in the log, in a retentive way, that is at the next reopening of the program, if you have not explicitly deleted them you will find them again. You can create parametric formulas, just type the § symbol followed by 22

FAST.TRACK-01

APP

the name of the parameter; you can save formulas in libraries that can be easily transferred to other users. But perhaps the most important feature is the fact that CV3 supports POWER-KI functions and libraries, in practice this allows you to write micro programs that are not limited to the numerical range. In the example we give on the next page, the formula searches for all the files that satisfy the criterion defined by the §files variable (in this case all those of the current directory that have the extension .pwk) saves their names in the file defined by the variable by the variable §OutFile (list.txt) and displays them in the CV3 output. www.power-ki.com


There are two Libs already included: DEFAULT with various examples and PWK-01-BASIC which allows, step by step, to approach the programming of the POWER-KI CODE. We therefore advise those interested in learning POWER-KI to start with

these examples and use CV3 as a playground. Furthermore, the program itself can be opened with the WorkBench and studied in every aspect. NOTE. The app includes the manual ..

Below the steps required to load formulas from a library.

xplab - research in automation - brescia - italy

FAST.TRACK-01

23


ASSEMBLY e Package POWER-KI applications can be of two types: • single ASSEMBLY (.pka); • PACKAGE (.pwk). ASSEMBLY is a unit of executable code. If the application you want to create does not require a graphical interface and no other resources are required for its execution (eg system utilities, PWK shared libraries), then the single ASSEMBLY may be sufficient.

• • • • •

one or more ASSEMBLIES; the interface elements (GUI, WUI); resources (e.g. graphic elements); any WRAP DLLs; and everything else the programmer decides. In the Packages the ASSEMBLY Main is declared, that is the one to execute when the application is launched. The Package is described by a Manifesto which is manageable by specific functions. Both ASSEMBLY and PACKAGE can be run from the command line and may accept execution parameters.

PACKAGES are the best solution for more complex applications, in fact The ASSEMBLY, GUI and WUI are they can incorporate most or all of the re- ITEM of a KnowLedge Bases having type sources necessary for their operation: and attributes, organized as a forest, each 24

FAST.TRACK-01

www.power-ki.com


POWER-KI of which branches into sub-ITEMs in turn with type and attributes. The ASSEMBLY contains the ITEMs of the language, the GUI and the WUI, those specific to the interfaces.

The WorkBench is the development environment that provides everything needed to create and test ASSEMBLY and Packages.

xplab - research in automation - brescia - italy

FAST.TRACK-01

25


Ciao - 01 (ASSEMBLY)

TUTORIAL

Ciao-01 is an App consisting of a single ASSEMBLY that can be created with a few simple steps: 1. double click on the icon; 2. accept the terms of the license; 3. from the menu press [EDITOR]; 4. enter the name of the App or select it if it has already been created; 5. from the EDITOR page open the VAR pwk; 6. from the page of the VAR pwk open the VAR Executor; 7. assign to the CONS_OS attribute “yes” to indicate that an operating system console must be opened or used, and to CONS_OS_PARENT “suspend” to 8. open the EXO Main (which is created ensure that if the program is invoked by default) enter the nome attribute; from the command line, control of the enter the code shown in the figure; console is passed for the time of its 9. save and run the App from an operaexecution to the App; ting system window. 26

FAST.TRACK-01

www.power-ki.com


In the CODE at point 8, two system functions stdout are used to write to the console and stdinp to wait for a text entered by the user, which is assigned to the nome attribute and then inserted in the response phrase. The remaining code, if you have done the exercises with the Calculator, should be clear to you. This APP is available from: https://github.com/POWER-KI/POWER-KI/tree/master/TUTORIAL xplab - research in automation - brescia - italy

FAST.TRACK-01

27


Ciao - 02 (Package)

In this second example we illustrate Ciao-02 an App in the form of a Package. From an operational point of view it is not very different from Ciao-01, in fact like that, it waits for the user to type a text and returns it inserted in a sentence. The difference is that the interaction with the user takes place through a graphical interface. NOTE. Since this is an example already packaged, many of the steps described below have been reported to illustrate how the application was carried out. 28

FAST.TRACK-01

TUTORIAL

Starting from the PWK Menu (1) with the [Package] (PKG) button we opened the operating system window (2) and entered the name of the App Ciao-02.pwk (select if it already exists). Initially, the PKG tree contains the sections: ASSEMBLY, UserInterface, Resources. We have added the resources for the GUI: a right click on the section opens the menu from which with ADD you can access the PWK-PRG\RES directory (supplied with the distribution), from which the background for the page and for the button can be selected; both have been given the symbolic name to be used in www.power-ki.com


ITEM IMAGE. On UserInterface, with a right click, the NewGui option was chosen from the menu; in the open panel at the bottom of the page, the file name (GMAIN.pki) and the symbolic name (GMAIN) have been entered; and with the confirmation we moved to the GUI editor (4), where first the new GUI was created and saved. At the beginning the only element present in the tree on the left was the ITEM pag of the FORM type to which the labels (LABEL), the text element (TEXTBOX), and the button (BUTTON) have been added, chosen among those present in the central column.

By passing with the [LIVE] key to the display of the page (5) the various elements have been sized, positioned and the texts have been added to the button (SEND) and to a label (Chi Sei? - Who Are You?). The ITEM SIGNAL has been added to the button, which associates the “click” text with the mouse click on it and which will be used in the ASSEMBLY. NOTE. In LIVE it is not possible to add or delete ITEMs.

xplab - research in automation - brescia - italy

FAST.TRACK-01

29


Two ITEMs were included in the ASSEMBLY: GUI-type GMAIN and the EXO MAIN. When the ITEM GUI was dragged from the central column into the tree on the left, a page appeared that allowed it to be associated with the package GUI. In ITEM (5) the CASE C_click was added to the (MTHD) trig method, which is created by default, in the SWTCH _SIGNAL_, which intercepts the GUI signal and: • assigns to the variable °n what is entered by the user in the TEXTBOX name • it displays it in the LABEL out preceded by “CIAO”. after which it cycles every 200 milliseconds waiting for runflg to be 0, when In MAIN (6) an ITEM WHILE has this happens and for this to happen the been inserted, which in the PRE section user must close the page (line 42), the (performed only at the beginning) assigns program terminates. the value 1 to the runflg attribute and sends the GUI display command: In (7) you can see the program in execuGUI_SND(_PTR_@\GMAIN,£SHOW) tion. 30

FAST.TRACK-01

www.power-ki.com


This APP is available from: https://github.com/POWER-KI/POWER-KI/tree/master/TUTORIAL xplab - research in automation - brescia - italy

FAST.TRACK-01

31


Warehouse Manager This App is a generic container and object manager that can be used e.g. to manage a small warehouse, a bookshop, a pantry, etc. Made with NC technology, it is possible to use it locally (1) or by servers with interfaces distributed over the network. From Menu (2) you can access the application pages.

Container Management (4) It allows you to define containers and associate their content, which can be an object or another container. Research (5) Searching for Objects is facilitated by filters. For the objects found it is possible to increase or decrease the quantities.

Object Definition (3) Each Object can be characterized by 5 Documentation (6) Types (freely definable). The page has fil- You can print the labels to be placed on ters to facilitate the search for what has the containers and the list of contents. already been entered. 32

FAST.TRACK-01

www.power-ki.com


DEMO

The App is freely downloadable from https://github.com/POWER-KI/ POWER-KI/tree/master/DEMO. With the WorkBench it can be viewed and edited. From a technical point of view it is an interesting software not only because it implements the NC but also because the information is stored in a KB1 knowledge base. xplab - research in automation - brescia - italy

Download the manual

FAST.TRACK-01

33


Plc Connector PLCs (Programmable Logic Controllers) are electronic devices that have replaced switches and relays in plant engineering for years. The PLC has allowed the transition from wired logic to programmable logic and in the perspective of industry 4.0 it is increasingly necessary to integrate them with higher level systems such as Supervisors (SCADA) and MES (Manufactory Execution System) systems, for this reason they are now all equipped with network ports.

34

FAST.TRACK-01

SNAP7CONN-01.pwk included in the DEV and EXC distributions is a support software that allows you to connect as a client to Siemens S7 PLCs and also to create a virtual PLC (server). In Client mode, you can create retentive mappings of data to be read and written. The PLC areas accessible are: • Data Block (non-optimized DBs), • input, • output, • merker, • counters, • timer. www.power-ki.com


DEMO

Data can be defined with Siemens types and numeric types displayed in decimal, hexadecimal or binary. In Server mode you can define the DBs that other Clients or PLCs will be able to read. The contents of the DBs can be examined as a block of hexadecimal or ASCII values, individual values can ​​ be represented by type.

xplab - research in automation - brescia - italy

Download the manual

FAST.TRACK-01

35


Brass Extrusion Press

Billett warehouse

Extrusion Press

Gallery 36

FAST.TRACK-01

www.power-ki.com


Oven heating

HABS

xplab - research in automation - brescia - italy

FAST.TRACK-01

37


XPLAB is open to collaborations with companies, software houses, machine and plant manufacturers but also with research institutions, universities, technical institutes, high schools and also with teachers, researchers and students. If you want to propose an idea, a project, a collaboration or want to do an internship or prepare a degree thesis with the collaboration / tutoring of XPLAB, write to:

fast.track@xplab.net

...

In the next issue

POWER-KI Basic elements The structure of language and its elements WorkBench The development environment: editing, testing, debugging, deploy The LIB Basic Libraries Overview WRAP The technology that allows you to extend and customize POWER-KI My friend Arduino Read analog signals from an Arduino device ...

38

FAST.TRACK-01

www.power-ki.com


POWER-KI

Programming language

Intelligent Applications

Applications designed to be effective and easy to use

SPA

Software Plastic Architecture

Architecture implemented by PWK

NC

Native Cloud

Distributed user interfaces

PWK IA

PWK application programmer

Designer GUI

Graphic User Interface

Graphical User Interfaces

WUI

Web User Interface

Interfaces created with web technologies

HABS

Heuristic Automatic Bars Store

Heuristic Supervisor (PWK application)

PLC

Programmable Logic Controller

Programmable logic controller

Supervisory Control A Data Acquisition

Supervision, control and data acquisition software for machines and plants

Manufactory Execution System

Production management software

DB

Data Base

Data management software in tables

KB

KnowLedge Base

Data management software in structures

PL

Programming Language

POWER-KI, Java, python, basic etc.

WIZ

Wiz

APPs that automate code generation

DEV

Developer

POWER-KI edition for developing / running applications

EXC

Executor

POWER-KI edition required for running applications.

APP

Application

Application software

SCADA MES

The “POWER-KI Jedi” cover photo was made by CUBEPHOTOPRODUCTION for XPLAB


the programming language for Intelligent Applications

www.power-ki.com

www.xplab.net

2021 © xplab - research in automation - brescia - italy


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.