Getting Started with REXYGEN
User guide

REX Controls s.r.o.

Version 3.0.2
2024-09-07
Plzeň (Pilsen), Czech Republic

Contents

Chapter 1
Introduction

The REXYGEN system is a family of software products for automation projects. You can use it in all fields of automation, robotics, measurements and feedback control.

The runtime core of the REXYGEN system turns your platform into a programmable device which will run your algorithms.

1.1 Features of the REXYGEN system

  • Graphical programming without hand-coding
  • Programming control units on a standard PC or laptop
  • User interface for desktop, tablet and smartphone (HMI)
  • Wide family of supported devices and input-output units
  • Industry-proven control algorithms
  • Easy integration into business IT infrastructure (ERP/BMS)
  • REST API for seamless integration into Industry 4.0 and (I)IoT solutions

1.1.1 Supported platforms

The REXYGEN system is currently supported and tested on the following platforms:

  • Industrial PC with Windows or Linux (including RT_PREEMPT)
  • Weidmüller u-OS PLC (WL2000, M3000, M4000)
  • Unipi PLC (Iris, Patron, Neuron)
  • Raspberry Pi
  • Monarco HAT

However, the REXYGEN system can be operated on any device running the Linux operating system. Guides are also available for older platforms such as WAGO PFC100/200, Unipi v1.1, and Pigeon PLC. However, these platforms are no longer actively tested.

1.2 Structure of the REXYGEN system

image/svg+xml 0 1 2

1.3 Programming in the REXYGEN system

The REXYGEN system offers a graphical development environment for programming the algorithms. You can use standard desktop or laptop PC. You create the algorithms from the so-called function blocks. The library includes countless items (timers, comparators, filters, PID controllers and many more).

rexdraw_programming Exported by REXYGEN Studio Digital inputs Digital outputs U1 U2 Y NY AND U Y EDGE DI1 DI2 DI3 DO1 DO2 DO3 Y MP_MANUAL_START U1 U2 Y NY OR S R1 Q NQ RS U HLD R1 Q et rt TIMER rexdraw_programming

1.4 Main components of the REXYGEN system

1.4.1 REXYGEN Studio – the development environment

REXYGEN Studio is a developer’s tool which runs on a standard PC with Windows. You create the algorithms using the function block library (The IEC 61131-3 standard defines Function Block Diagram (FBD) as one of the PLC programming techniques.) of the REXYGEN system [1]. The library contains simple comparators and timers as well as advanced blocks for signal processing and feedback control (PID controllers etc.). You compile your project on your PC and run it on your platform.

Once running, you can watch your algorithm in real-time. Just select the signals and function blocks of your interest. You can also obtain detailed hierarchical information about the running algorithm and diagnose the runtime core and execution of your algorithm. You can connect via local network or over the Internet.

1.4.2 REXYGEN HMI Designer

The REXYGEN HMI Designer is another developer’s tool intended for designing graphical user interface (or HMI, Human Machine Interface, if you prefer) for your algorithms. The user interface is included in the project and it is copied to your platform along with the algorithm.

1.4.3 REXYGEN Compiler

The REXYGEN Compiler converts your algorithms into binary code of the REXYGEN system. The compiler is almost invisible for the user, it is invoked from the REXYGEN Studio development environment. The compiler detects and reports possible errors in your algorithms.

1.4.4 RexCore

The RexCore (REXYGEN runtime core) service runs on the target device (platform). Once installed, it runs in the background and therefore it is almost invisible for the user. It handles timing and execution of your algorithms and provides various services. The individual tasks are prioritized and executed using preemptive multitasking. The RexCore service is automatically started at system startup.

RexCore further contains an integrated webserver providing user interface (HMI) and REST API. Chapter ?? deals with installing all the necessary modules on the platform.

Chapter 2
Licensing REXYGEN using REXYGEN DWM

The first thing you will need is to get the license. The fastest way is to use the REXYGEN DWM tool. Open your web-browser and input IP address of the platform. You should see the Device is not licensed! message on the bottom of the screen. Please, click on the Licensing.

PIC

The licensing model of the REXYGEN system is quite simple:

  • The development tools are free to use, you can install it on as many computers as you want.
  • The RexCore runtime module always needs a licence to run on your platform. There are DEMO licences available at no cost and there are permanent licences which you can purchase. Each platform needs an individual licence.

2.1 Obtaining a DEMO licence

The DEMO licence is intended for evaluating, testing and educational purposes. Feel free to experiment with the DEMO licence as long as you need. Commercial use of the DEMO licence is not allowed.

When you attempt to run your algorithm on a device that does not have a valid license, you will be presented with options to license the device. If you do not already have a license or a license voucher, you can request a DEMO license.

PIC

Click on Get demo licence and you will be redirected to the registration form. Identify yourself and you’ll receive a DEMO licence key via e-mail. The licence key is called a SiteKey.

PIC

PIC

PIC

Once you have your DEMO licence key (SiteKey), apply it in REXYGEN DWMby selecting Apply Licence Keys and clicking on Apply keys.

PIC

Evaluation version of RexCore (REXYGEN runtime core) is functional for 2 hours. It is possible to run your algorithm on the platform but you cannot store it permanently. The algorithm resides only in the RAM memory therefore it will not run after a restart or power-up. You can use almost all function blocks, see [1]. The RexCore runtime core on the target device is terminated after 2 hours of operation in demo mode without any warning. After a restart, you have another 2 hours for your experiments.

2.2 Obtaining a permanent licence

It is necessary to activate the RexCore runtime module and optional additional modules for permanent operation. This can be done using the licence, which you can obtain at

2.2.1 Activation of the permanent licence

Each device running the RexCore runtime module is identified by the so-called SiteID tag. The purchased licence is associated with the hardware device, i.e. with the SiteID tag.

  1. Open your favorite web-browser on the desktop PC and fill in the IP address of the platform. Once the DWM appears, select Licensing Apply Voucher and enter your licence voucher code.

    PIC

  2. If other licenses are already present, a new window will appear where you can specify what should happen to the old licenses. Use the Overwrite option if the platform is running in DEMO mode. This is the last and irreversible step.

    PIC

  3. The so-called SiteKey licence key is generated from your licence voucher and it is stored in your device, which is shown in the Active License panel. The licence key allows permanent operation of the runtime core. It is highly recommended to check the licence again after a reboot of the device.

    PIC

Chapter 3
Default REXYGEN project on Monarco HAT, Unipi Patron and Unipi Neuron

In order to help you speed up a start with REXYGEN and your platform we have create an example project for most Monarco HAT, Unipi Patron and Unipi Neuron platform models which is already preinstalled on the image with REXYGEN (installation is described in Section ??). The project serves as a basic validation of the installation process and as a starting point for more complex applications. One can control digital output(s) DO, analog output(s) AO, observe the state of digital inputs(s) DI and analog input(s) AI. These general inputs and outputs are present on all platform models. The steps to create and develop a new project from scratch is described in Chapter 4 in detail.

IMPORTANT: If you have valid permanent licence stored on your platform, this project will start automatically once RexCore (REXYGEN runtime core) starts. Otherwise, if you have only a Demo license, you must compile and download the project from the REXYGEN Studio on the platform first. The project can be opened in the REXYGEN Studio using either the procedure described in Section 3.3, or the project can also be found in the Examples library as 0126-02_Unipi_Neuron_Generic for Unipi Neuron, code0127-02_Unipi_Patron_Generic for Unipi Axon/Patron and 0121-09_Monarco_HAT_Demo_Example for Monarco HAT (All examples which are part of the installation are marked by an ExampleID. The most up-to-date examples are available with the latest installation of development tools or at https://www.rexygen.com/example-projects/ ). The process of compiling and running the project is described in Section 4.2.

3.1 Control the platform from HMI

The project contains graphical user interface (so-called Human-Machine-Interface) for easy control and observing of general outputs and inputs. The HMI can be found at URL address http://192.168.1.100:8008/hmi/index.html (replace 192.168.1.100 with the IP address of your platform). You can see how the HMI looks for default project on Unipi Neuron, Unipi Patron and Monarco HAT right below.

PIC

PIC

PIC

3.2 Control the platform through OPC UA

You can use the OPC UA interface to control your platform too. Install any OPC UA Client and connect to the OPC UA Server, which is running right now on your platform. There is the UAExport software used in this tutorial:
https://www.unified-automation.com/downloads/opc-ua-clients.html.
Click on Server in the Menu Add Advanced mode and fill the Configuration Name and the Endpoint URL (replace 192.168.1.100 with the IP address of your platform).

PIC

After confirmation (OK), right-click on the new server name in the Project panel and choose Connect.

PIC

PIC

Congratulations, you are now connected to your platform! You can now set the DO1 to value true for example. Navigate to Address Space panel and select DO1. In Attributes panel search Value Value, double-click on it, check the radio box and hit Enter. The first Digital outputs LED diode on the platform should glow. Detailed tutorial on using OPC UA with REXYGEN is there [2].

PIC

3.3 Loading project from the platform to REXYGEN Studio

After installation of REXYGEN development tools (described in Chapter ??), you can open the REXYGEN Studio on your PC and download algorithm of this default project from your platform.

Select Load Project from Target Device from starting dialog or from File Open Project from Target Device and connect to your platform (replace 192.168.1.100 with the IP address of your platform).

PIC

PIC

Choose the directory where will be the project stored on your PC and hit OK.

PIC

If everything went well, the project algorithm will appear (example image of Unipi Neuron project).

PIC

Chapter 4
Configuration, compilation and execution

The process of creating a control algorithm will be demonstrated on a very simple example with four Boolean variables representing manual switches. In Chapter ??, two of them will be replaced by physical inputs of the platform. A software timer will be used for measuring the time when the variables are true (i.e. the switches are in the ON position). A Boolean signal will indicate that the interval of predefined length has elapsed.

4.1 Creating a new project

The project configuration is created using the REXYGEN Studio program. Each project consists of at least two .mdl files. The first file is the main file of the project, which is used for configuration of tasks, drivers, priorities and timing. The other file(s) contain the individual control algorithms (tasks).

First we’ll create the example 0101-01 from scratch (All examples which are part of the installation are marked by an ExampleID. The most up-to-date examples are available with the latest installation of development tools or at https://www.rexygen.com/example-projects/).

Standard approach:

  1. Run the REXYGEN Studio program. Start with a plain project and select a folder to save the project files in (e.g. D:\GettingStarted).
  2. The folder will contain two important files:
    • myproject_exec.mdl
    • myproject_task.mdl
  3. The myproject_exec.mdl is the project main file. It contains one EXEC block from the EXEC library. The other block is the TASK block from the same library and it is renamed to myproject_task to reference the second file of the project (myproject_task.mdl), which will contain the algorithm (the so-called task).

    PIC

  4. The task is connected to the Level0 output of the EXEC block and therefore its timing is defined by tick and ntick0 parameters of the EXEC block.
  5. The EXEC block (and any other block) can be configured by double-clicking on it. A block parameters and properties dialog appears. The parameters of all blocks of the REXYGEN system are described in the Help (press the F1 key) and in the Block reference manual [1].

    PIC

  6. Note that tick=0.05 and ntick0=2, therefore the task will run each 100 milliseconds (0.05 2 = 0.1s). There is no need to change any parameter at the moment. Close the dialog.
  7. You can delete all the descriptive texts in project files. These have no effect on the functionality and can be considered programmer’s comments.
  8. Open Block Library, choose View/Block Library in the menu or use the PIC icon from the toolbar.
  9. By default, the library is in Tree view mode where the blocks are organized in sublibraries. Their location is always denoted as sublibrary/block, e.g. LOGIC/AND for the logical AND block in the LOGIC sublibrary. Inside a sublibrary, the blocks are ordered in alphabetical order.

    PIC

  10. You can also switch the library to List view mode, where all the blocks are sorted alphabetically, regardless of the sublibrary they belong to.
  11. Locate the following function blocks in the Block Library and drag them to the task file:
    • MATH/CNB – constant of type Boolean. Once dropped, double-click its name and change it to CNB_SWITCH1. Double-click the block and set parameter YCN = off.
    • LOGIC/OR_ – logical OR. Rename it to OR_A.
    • LOGIC/AND_ – logical AND.
    • LOGIC/TIMER_ – a timer block. Set parameter mode = 2: Delayed ON, pt = 5.0.
    • INOUT/Display – a display to show values in real-time.
    • ARC/TRND – real-time recording. Set parameters l = 2000, Title = My timer, leave the default values otherwise.
    • MATH/CNB – constant of type Boolean, change name to CNB_RUN, set parameter YCN = on.

    PIC

  12. Duplicate the CNB_SWITCH1 block with right mouse button dragging. Or simply Copy&Paste the block.
  13. Duplicate the block 2 more times.
  14. Duplicate also the OR_A block. Rename the duplicate to OR_B.

    PIC

  15. Connect the blocks as shown below. To connect the blocks, drag the output arrow of one block to the input arrow of the other block using the left mouse button. The connection will be established when the line goes bold and green. After releasing the mouse button you can recognize a successfully connected line by its style. A full line terminated by a full arrow at the input of the connected block indicates a valid connection. A dashed red line ending with a thin arrow indicates an unconnected line. New branch of an existing line can be created by dragging an existing line with the right mouse button.

    PIC

At this moment the executive configuration myproject_exec.mdl and the corresponding myproject_task.mdl file with the algorithm are ready. The algorithm will be evaluated in the direction of the arrows, starting from the source CNB blocks, passing through the OR_, AND_ and TIMER_ blocks and finishing at the Display and TRND blocks.

Congratulations, your first project is ready for compilation!

4.2 Compiling and running a project

The developed algorithm must be compiled to binary form prior to deploying. Pick Project/Compile from the menu or use the PIC icon from the toolbar. The compiler output is displayed in the Compiler window. If no error is found, the myproject_exec.rex file is created.

PIC

At this moment it is possible to deploy the control algorithm to the target platform. Use Project/Compile and Download in the menu or click the Compile and Download icon PIC for this purpose. A dialog for defining the target device appears upon successful compilation.

PIC

Enter the IP address of your platform in the Target field (If you use the WAGO PFC100/200 and you do not know the IP address of your platform, see Appendix C for details. Once you know it, come back to this point.).

Enter REXYGEN login and password. The default user is admin and there is no password by default. Leave the other elements intact and click Download.

If there is no licence on your platform, you need to get one first. You can get a DEMO licence for free. See Appendix B for details and come back afterwards.

As soon as the download is complete it is possible to switch the REXYGEN Studio application to the so-called Watch mode and watch the control algorithm in real-time – click Watch.

PIC

In the Watch mode, the background of all files goes gray and you cannot move or delete any blocks or connections. Right-click the TIMER_ block and select Watch selection in the menu to watch the inputs and outputs of the timer.

PIC

You can do the same with the OR_ and AND_ blocks (or any other selection).

PIC

Now it is possible to double-click the CNB_SWITCH1 block and change the Boolean variable to YCN = on (tick the checkbox and click OK). Once you do the same with the CNB_SWITCH3 block, the outputs of both OR blocks are on and the Y output of the AND_ block goes on and the TIMER_ starts to count down. Observe the rt output. (Do not get confused by the default 1 second refresh rate of the Watch mode. The algorithm on the target device runs each 100 milliseconds as mentioned earlier.) Once the timer reaches zero, its output Q is set to on and it remains on as long as the U input is on.

You can double-click the TRND block to see the signals in a real-time graph. The red line is the output of the OR_A block, the magenta line is the output of the OR_B block, the green line is the remaining time of the timer and the blue line is the Boolean output of the timer.

PIC

Try turning the CNB blocks off and change the pt parameter of the TIMER_ block. Afterwards turn the CNB blocks on again and observe the signals in the TRND block again. As you can see, you can modify any parameter in real-time, which allows you to fine tune your algorithm.

It is also possible to open a Diagnostics view of the algorithm. Pick Target/Diagnostics from the menu or click the PIC icon and you will see the algorithm in a tree view which allows you to monitor the control algorithm in full detail. You can verify that the sampling rate of your algorithm is indeed 100 milliseconds. You can also adjust parameters of individual function blocks, which has the same effect as modifying them directly in the Block properties dialog.

PIC

PIC

Now you can switch REXYGEN Studio back to the Development mode. You can do so by deactivating the Watch mode (use the PIC icon). You are offered synchronization of the changed parameters with the source files of the project, choose No at this moment.

All changes made while in the Watch mode are not permanently stored in the target device (unless you decide so, see [3]). Upon restarting the RexCore runtime module the algorithm will start with the parameters defined in the project source files, which were valid when compiling and downloading the algorithm to the target device. To apply the changes permanently, you have to transfer the changes to the source files and Compile and download the project one more time which defines new startup values.

4.3 Adding a user interface (HMI)

The next step in developing a control algorithm is its user interface, or HMI, Human-Machine Interface. It allows anyone (even those who are not familiar with the REXYGEN system) to interact with the algorithm. The HMI of the REXYGEN system relies on modern web-based technology and the HMI is therefore accessible via web browser on desktop PC, tablet or smartphone.

In this tutorial, a simple HMI will be created using the so-called WebBuDi technology. It provides very simple indicators and input elements to interact with the control algorithm via a web page (Web Buttons and Displays).

The steps to create the HMI are described below. This is how the HMI will look like in the end:

PIC

  1. In the folder with the project files, create a hmisrc subfolder. Inside this folder, create a file named index.hmi.js and edit it with your favorite text editor. The content should be the following:
    REX.HMI.init = function(){  
     
    //Indicators and virtual switches - group A  
      var switchesA = {  
        column: 1,  
        title: 'Switches - group A',  
        rows: [  
          {type: 'DW', alias: 'switch1', desc: 'Switch 1',  
            cstring: 'myproject_task.CNB_SWITCH1:YCN'},  
          {type: 'DW', alias: 'switch2', desc: 'Switch 2',  
            cstring: 'myproject_task.CNB_SWITCH2:YCN'},  
          {type: 'DR', alias: 'S1orS2', desc: 'S1 OR S2',  
            cstring: 'myproject_task.OR_A:Y'},  
        ]  
      };  
      REX.WebBuDi.addSection(switchesA);  
     
    //Indicators and virtual switches - group A  
      var switchesB = {  
        column: 1,  
        title: 'Switches - group B',  
        rows: [  
          {type: 'DW', alias: 'switch3', desc: 'Switch 3',  
            cstring: 'myproject_task.CNB_SWITCH3:YCN'},  
          {type: 'DW', alias: 'switch4', desc: 'Switch 4',  
            cstring: 'myproject_task.CNB_SWITCH4:YCN'},  
          {type: 'DR', alias: 'S3orS4', desc: 'S3 OR S4',  
            cstring: 'myproject_task.OR_B:Y'},  
        ]  
      };  
      REX.WebBuDi.addSection(switchesB);  
     
    //Timer input  
      var timerInput = {  
        column: 2,  
        title: 'Timer input',  
        rows: [  
          {type: 'DR', alias: 'inputA', desc: 'Group A',  
            cstring: 'myproject_task.AND_:U1'},  
          {type: 'DR', alias: 'inputB', desc: 'Group B',  
            cstring: 'myproject_task.AND_:U2'},  
          {type: 'DR', alias: 'AandB', desc: 'A AND B',  
            cstring: 'myproject_task.AND_:Y'},  
        ]  
      };  
      REX.WebBuDi.addSection(timerInput);  
     
    //Timer settings and status  
      var timer = {  
        column: 2,  
        title: 'Timer',  
        rows: [  
          {type: 'AW', alias: 'interval', desc: 'Timer interval',  
            cstring: 'myproject_task.TIMER_:pt'},  
          {type: 'AR', alias: 'rt', desc: 'Remaining time',  
            cstring: 'myproject_task.TIMER_:rt'},  
          {type: 'DR', alias: 'timerQ', desc: 'Timer output',  
            cstring: 'myproject_task.TIMER_:Q'},  
        ]  
      };  
      REX.WebBuDi.addSection(timer);  
     
      //Add real-time trend  
      REX.HMI.Graph.addTrend({cstring: 'myproject_task.TRND'});  
      REX.HMI.Graph.setMaxBufferSize(200);  
     
      // Change title of the page  
      REX.HMI.setTitle('My timer - HMI example');  
    }

  2. This file will be processed when compiling the project. However, it is necessary to add the EXEC/HMI block into the project main file first.

    PIC

  3. Double-click the HMI block to edit its parameters. Set GenerateWebWatch = off and confirm. WebWatch is another type of HMI, which you do not need at the moment. See [4] for details, it is a very interesting tool for developers and technicians.

    PIC

  4. The HMI is now an integral part of your project. Compile the project again and you will see that the compile log contains more information. The index.html file is generated from the source index.hmi.js file. All the HMI files are generated into the hmi subfolder (HTML, JS and CSS files) and included in the resulting binary myproject_exec.rex file.

    PIC

  5. After you download the project to the target device, you can access the HMI via web browser. Go to menu Target/Web Interface which will open the webpage. Remember the default login credentials: admin with no password.

    PIC

  6. You can toggle the switches and observe the results. The virtual switches are linked to the individual CNB function blocks therefore the effect is the same as toggling the values directly in REXYGEN Studio.
  7. You can also change the timer setting and shorten or lengthen the interval.
  8. See [4] for detailed information about WebBuDi elements and possible customization (colors, backgrounds etc.).
  9. The default URL address is http://192.168.1.100:8008/hmi/index.html (replace 192.168.1.100 with the IP address of your platform).
  10. The default port of the webserver (8008) can be changed in RexCore settings. See [5] for details.

Please note that there is also a program called REXYGEN HMI Designer, which allows you to create graphical user interfaces. Appendix A of this guide shows the steps to create a basic graphical interface. A more complex HMI is shown below solely for inspiration purposes.

PIC

4.4 Ready for interaction with the outer world

Well done! You have created the example 0101-01 from scratch (All examples which are part of the installation are marked by an ExampleID. The most up-to-date examples are available with the latest installation of development tools or at https://www.rexygen.com/example-projects/). You have learned the basic workflow for developing and running your algorithms using the REXYGEN system, which is the same for all platforms. Now it’s time to add the so-called input-output drivers so that the algorithm can interact with sensors, actuators and external data.

Configuring the inputs and outputs of specific target devices based on the example project provided in this chapter is discussed in the I/O Configuration of Target Platforms manual.

Chapter 5
Summary

Congratulations, you have created the example project from scratch! You have learned how to develop, compile and run your algorithms on the platform. The interaction with sensors and actuators is provided via input-output driver of the REXYGEN system, which you have learned to configure and use.

You have achieved quite a lot in a relatively short time, haven’t you? The purpose of this guide was to quickly show you the basic steps and tools for developing a project.

Now it’s time to focus on your own project and keep learning on the go. There are function blocks which are much more powerful than the ones mentioned in this guide, there are many inspiring example projects, there are additional I/O drivers which you can use to expand the scope of your project, there are many ways to exchange data with external systems and devices, etc.

Remember that whenever you have some achievement to share, we will be happy to hear from you. And whenever you encounter any difficulties, we will be happy to help. You can reach us at support@rexygen.com.

Appendix A
Graphical HMI with REXYGEN HMI Designer

Chapter 4 describes the creation of a simple WebBuDi user interface. The REXYGEN development tools also contain the REXYGEN HMI Designer program which is a tool for designing custom graphical visualizations from predefined components (Definition of custom components is also possible but it requires a bit of Javascript coding.). The REXYGEN HMI Designer is based on the well-known open-source vector editor InkscapeTM https://inkscape.org/en/.

In this chapter we’ll develop an alternative HMI for the example 0101-01. Just like in the case of the WebBuDi user interface, the SVG file created with REXYGEN HMI Designer will serve as a source file which will become a part of your REXYGEN project. During compilation of the project the SVG file will be processed and converted to HTML, JS and CSS files.

A.1 Initializing the HMI design

After launching the REXYGEN HMI Designer from Start Menu you will find a clean page. The first thing to do is to initialize the new visualization. The HMI is configured via the REXYGEN HMI extensions. Navigate to Extensions REXYGEN HMI Edit HMI Config in the menu.

PIC

This extension adds a special component which contains general settings of the HMI. Close it with the OK button for now.

PIC

In order to include the HMI during the REXYGEN project compilation, the file name has to end with .hmi.svg. Save the file as e.g. designer.hmi.svg to the hmisrc subfolder of your project. Use the standard File Save as menu.

Note: If you want to replace the WebBuDi interface with the REXYGEN HMI Designer interface just delete the index.hmi.js and save the HMI as index.hmi.svg.

A.2 Adding the first HMI components

Now we will add some displays and inputs. The REXYGEN HMI Designer contains a library of components which you can use to build your HMI. The library is available through Browse Components Library extensions. Navigate to Extensions REXYGEN HMI Browse Components Library (Ctrl+L). It will open the explorer window with several folders. Open the GENERAL folder and drag&drop the Display to the drawing. The display will be used as an indicator of the remaining time in the TIMER function block.

PIC

For configuration of the display settings select the display by mouse click on top of it and use the Edit Component extension from Extensions REXYGEN HMI Edit Component (Ctrl+E). When the configuration dialog is opened you can change the Title to Display_remaining. The Edit Component dialog has two tabs: Data points and Options.

The Data points tab contains three items defining the behavior and animations of the component. Each data point contains an alias, which is in fact a connection to live data from the REXYGEN algorithm.

  • value – The value to display.
  • disable_by – If true the display is disabled and data are no longer updated.
  • hide_by – If true the display is hidden.

The value property contains $T_value. The $T will be later automatically substituted by the Title of the component, resulting in the Display_remaining_value alias. The disable_by and hide_by data points are optional. Leave them blank at the moment.

The Options tab contains several properties which are specific for the Display component. You can find the description of each component and property in [4]. Leave the default values for now and press OK.
Note: Each component is in fact one SVG group with unique content. You can copy the components all over the screen using copy (Ctrl+C) and paste (Ctrl+V) approach.

PIC

Now we will add controls for all the switches (CNB blocks). All of them will be controlled using the PushOnOff components. Add them from the library. Select the first PushOnOff and open the editor dialog Extensions REXYGEN HMI Edit Component (Ctrl+E). Change the title to PushOnOff_SW_1 and select the Options tab. Select the ToggleButton item in the type property list. Close the Edit Component dialog using OK button. Copy-paste the button three times and remember to change the titles to PushOnOff_SW_2, PushOnOff_SW_3, PushOnOff_SW_4).

Note: Throughout the REXYGEN HMI Designer you can use double click in Options tab to open the corresponding configuration dialog (color picker, number input, etc.).

PIC

Now we have four PushOnOff buttons and one Display and we want to link all components with live data from the target device.

A.3 Linking HMI components with the running algorithm

Open the HMI Configuration dialog either using Extensions REXYGEN HMI Edit HMI Config or just unselect all components in the drawing (click outside any component) and press Ctrl+E. The configurator parses all components and creates a list of used Aliases. Each of them should be linked with one signal in the running algorithm. You can either fill in each connection string manually or you can use the Browse function.

PIC

The Browser requires a target device with running algorithm. Make sure the algorithm is running, see Section 4.2. Also the target URL must be set. Press Browse button. The login dialog will be opened. Change Target to 192.168.1.100:8008 (replace 192.168.1.100 with the IP address of your platform). Unless you changed the login credentials, use the default username admin with an empty password. After a successful login the connection tab is expanded with a tree-view of the running algorithm (you have already seen this tree-view in algorithm diagnostics).

PIC

Select Connection String field of the Display_remaining_value item and afterwards browse the tree to the TIMER_ block and double-click the rt parameter. The connection string of the parameter is copied to the Display_remaining_value alias, which is shown in the next figure.

PIC

Once the display is linked we will also link the switches. Just browse the tree to CNB_SWITCH1, select the Connection String field of the PushOnOff_SW_1 alias and double-click the YCN parameter. Repeat this for the remaining connection strings. Afterwards press OK to save the settings and close the dialog.

PIC

The interactive components in REXYGEN HMI Designer are just parts of the drawing. The user can position the components arbitrarily and add as many decorative static components to as needed. We will add some text descriptions to distinguish individual buttons. Use the Text tool (F8), click anywhere in an empty space and start typing. Pick the Select and Transform tool (F1) afterwards and move the texts and buttons.

Note: More information about custom drawing can be found in Inkscape tutorials (See the Help Tutorials Inkscape: Basic)

PIC

A.4 Adding more HMI components

Next we will add more components to control the timer and show the status of the OR and AND blocks. Open the Elements library (Ctrl+L) and add one Input and four Led components. The LEDs will show the status of Boolean values and the Input will be used for changing the default timer interval value.

In the Led components just edit the Title via the Edit Component extension (select the component by single click and press Ctrl+E). The titles should be Led_OR_A, Led_OR_B, Led_AND, and Led_TIMER_OUT respectively. Finally edit the Input component by changing the Title to Input_interval.

The last component we need is a graph showing the time-plot of data from the TRND block. Use the components library (Ctrl+L) and add a TRND component. You can adjust its size to fit the desired position. Edit the component (Ctrl+E) and change the Title to TRND and switch to the Options tab. Double-click the signals property. Add the following labels using the plus (+) button: timer out, rem. time, OR A, OR B. These labels will be shown in the legend of the graph.

PIC

A.5 Additional links to the running algorithm

When all the components are in place we link them to the running algorithm again. Just repeat the procedure described in Section A.3, open the HMI Configuration dialog (Extensions REXYGEN HMI Edit HMI Config) and browse the running algorithm to pair the remaining aliases with corresponding connection strings. The list is shown in the following image.

PIC

A.6 The final steps

Congratulations, your first graphical HMI is almost ready! Add a few rectangles which will visually divide the HMI into individual sections. Use the Squares and rectangles tool (F4), draw the rectangle, pick a color from the palette and send the rectangle to the background using the End key. Do not forget to save the drawing.

PIC

As mentioned earlier, the *.hmi.svg files in the hmisrc folder are automatically processed while the project is compiled in the REXYGEN Studio application. The project main file must contain the HMI block with GenerateRexHMI parameter enabled. This was already covered in Section 4.3 so you should have everything ready.

Once you compile the project again and download it to your platform, the HMI will be accessible via a web browser. Navigate to
http://192.168.1.100:8008/hmi/designer.html (replace 192.168.1.100 with the IP address of your platform). You will see your HMI with live data.

PIC

This tutorial covers only the very basic components. If you want to get more information about additional components, see [4].

Appendix B
Licensing of the REXYGEN system

The licensing model of the REXYGEN system is quite simple:

  • The development tools are free to use, you can install it on as many computers as you want.
  • The RexCore runtime module always needs a licence to run on your platform. There are DEMO licences available at no cost and there are permanent licences which you can purchase. Each separate platform needs an individual licence.

B.1 Obtaining a DEMO licence

The DEMO licence is intended for evaluating, testing and educational purposes. Feel free to experiment with the DEMO licence as long as you need. Commercial use of the DEMO licence is not allowed.

When you try to run your algorithm on a device which does not have a valid licence, you are offered a few options. Unless you already have a licence key or a licence voucher, you’ll need to get a DEMO licence.

PIC

Identify yourself and you’ll receive a DEMO licence key via e-mail. The licence key is called a SiteKey.

PIC

PIC

Once you have your DEMO licence key (SiteKey), apply it.

PIC

PIC

PIC

Once successfully applied, your algorithm will download to your platform.

You can review your licence keys in REXYGEN Studio. Go to menu Target Licensing to list the licence keys and activated modules.

PIC

Evaluation version of RexCore (REXYGEN runtime core) is functional for 2 hours. It is possible to run your algorithm on the platform but you cannot store it permanently. The algorithm resides only in the RAM memory therefore it will not run after a restart or power-up. You can use almost all function blocks, see [1]. The RexCore runtime core on the target device is terminated after 2 hours of operation in demo mode without any warning. After a restart, you have another 2 hours for your experiments.

B.2 Obtaining a permanent licence

It is necessary to activate the RexCore runtime module and optional additional modules for permanent operation. This can be done using the licence, which you can obtain at

B.2.1 Activation of the permanent licence

Each device running the RexCore runtime module is identified by the so-called SiteID tag. The purchased licence must be associated with the hardware device, i.e. with the SiteID tag.

  1. In REXYGEN Studio, connect to the device and go to menu Target Licensing. A dialog pops up and you will see the SiteID and your licences.

    PIC

  2. Delete any DEMO licence keys if present.
  3. Afterwards, click the Apply licence voucher button and enter your licence voucher code.

    PIC

  4. You are asked to confirm the association – this is the last and irreversible step.

    PIC

  5. The so-called SiteKey licence key is generated from your licence voucher and it is stored in your device. The licence key allows permanent operation of the runtime core.

    PIC

  6. To check the licence, make sure the REXYGEN Studio is connected to the device and open the licensing dialog again (Target Licensing). Check that the licence was applied correctly and that the RexCore runtime module no longer runs in demo mode.

    PIC

  7. It is highly recommended to check the licence again after a reboot of the device.

Appendix C
IP address of your WAGO PFC powered by REXYGEN

By default, the Ethernet adapters of your Wago PFC are configured as follows:

  • X1: DHCP client
  • X2: static IP address 169.254.0.100, netmask 255.255.255.0

If there is no DHCP server in your network or you do not know how to find the IP address your platform has been assigned in your network, run a DHCP server on your PC. Afterwards connect your PC with the platform X1 directly using a standard Ethernet cable.

For DHCP server you can use e.g.

As soon as the connection is initialized, your platform will be assigned an IP address and the DHCP server software will list it.

Alternatively you can set a static IP address on your PC (e.g. 169.254.0.5, netmask 255.255.255.0) and use the X2 Ethernet adapter of your platform.

This will allow you to configure network settings to your needs using the web interface of the device, accessible via e.g. http://169.254.0.100/wbm (use the IP address of your device!).

Bibliography

[1]   REX Controls s.r.o.. Function blocks of REXYGEN – reference manual, 2020. .

[2]   REX Controls s.r.o.. OpcUaDrv driver of REXYGEN – user guide, 2020. .

[3]   REX Controls s.r.o.. REXYGEN Studio – User manual, 2020. .

[4]   REX Controls s.r.o.. REXYGEN HMI – User manual, 2020. .

[5]   REX Controls s.r.o.. RexCore – User manual, 2020. .


Documentation reference number: 16710

2024 © REX Controls s.r.o., www.rexygen.com