RexDraw
User guide

REX Controls s.r.o.

Version 2.50.5
2017-09-06
Plzeň (Pilsen), Czech Republic

Contents

Chapter 1
Introduction

RexDraw is a graphical tool designed for a creation of real-time control algorithms with the support of a large function block library of the REX control system [1]. A developer may utilize many function blocks from simple comparators and timers to advanced and specialized blocks designated for analog signal processing and regulation. There are various specialized regulators including PID regulators with automatic tuning of parameters. Any algorithm developed in the RexDraw may be instantly compiled and downloaded into arbitrary target device (Linux IPC, WinPAC, Raspberry Pi etc.). After the algorithm is successfully compiled and downloaded to the target device, it is possible to switch RexDraw to a Watch mode in which all parameters and variables of all function blocks may be inspected or adjusted. A connection may be established locally or over Internet using standard protocol IPv4 or IPv6. A secure connection over SSL protocol is supported.

A detailed documentation for function block library may be opened at any time with the F1 key. The documentation is installed automatically in the default setup configuration and we advise not to uncheck it.

1.1 Starting RexDraw

The RexDraw development tool may be started without any parameters by double-clicking on its icon in a start menu of Windows. A main window of RexDraw consists of four main parts: a main menu (1), a toolbar (2), a working area (3) and a statusbar (4). There may be several files opened in the working area simultaneously. A name of opened and active file is shown in the title of RexDraw main window with an asterisk when there are unsaved modifications.


PIC


Figure 1.1: Main Window of RexDraw

1.2 Working Area

A working area is a main area where windows with opened project files are placed. Files with function block diagram have a file name extension .mdl. A zoom operation i supported in a function block diagram editor. Zoom in/out operations may be performed using a mouse wheel while keeping the Ctrl key pressed, clicking on those commands in the menu or in the toolbar and also by pressing the keys F2 and F3.

1.3 Application Modes

The application provides two modes: a design mode and a watch mode. An algorithm is developed in the design mode by drawing function block diagram on the canvas and by configuring function block parameters. The application may or may not be connected to a target device.

When connected to the target, the application may be switched to the watch mode. In the watch mode, the developed application can’t be modified. Instead, the function block diagram serves as a diagnostic interface to the running algorithm. User may inspect all signals, parameters, trends and detailed diagnostics of the target.

1.4 Main menu

1.4.1 File

The File menu provides commands which are connected with files.

1.4.2 Edit

The Edit menu provides commands which are connected with objects and function blocks.

1.4.3 View

The View menu provides commands and operations with RexDraw windows and working area.

1.4.4 Project

The Project menu provides commands for project compilation, download, activating the Watch mode and watching signals.

1.4.5 Target

The Target menu provides commands and operation for communication with a target device, signal monitoring and detailed on-line diagnostics. Some commands are available only after a connection with a target device is established.

1.4.6 Project

1.4.7 Tools

The Tool menu is a shortcut for launching another tools available within REX.

1.4.8 Settings

Dialogs with global a and diagnostics options are accessible within the Settings menu.

1.4.9 Window

The Window menu offers operations for an arrangement of opened windows.

1.4.10 Help

Chapter 2
Function blocks

All function blocks in the function block library of REX are described in the reference manual [1].

2.1 Using Function Blocks

All function blocks that are available in REX and that may be added into a function block diagram are accessible within a function block library dialog that is shown from menu View/Block Library or by Ctrl+L shortcut. The blocks are categorized into several groups by their intended purpose. A user may search for a specified function block by typing a name or a part of a name. The searching is performed only in a single library if the library is selected. A block is added to the diagram by simple drag and drop operation. Both the symbol of a block and then name of a block may be dragged.


PIC


Figure 2.1: Function block library

2.2 Block Properties

All block properties are modifiable from the properties dialog. The dialog is invoked by the Ctrl+E shortcut, by selecting Edit/Properties from the menu or by double-clicking on the block in design mode. Dimensions of a block on the canvas may be changed with a mouse by first clicking on the block a then dragging any of highlighted corners. A block may be moved by mouse or by keyboard arrows while the block is selected. The block may be rotated using the Ctrl+R shortcut.

Properties that may be modified by a user:


PIC


Figure 2.2: Block Properties

2.3 Common Block Properties

It is possible to modify common block properties by selecting several block at once. Such a multi-selection is performed by selecting arbitrary blocks one-by-one while keeping the Shift key pressed or by selecting an arbitrary area with a mouse while the left mouse button is pressed.

Properties may be edited using the property dialog by pressing Ctrl+E or by selecting Edit/Properties from the menu after arbitrary blocks are selected.

Only parameters that are common to all selected blocks may be edited in such a way. Other properties must be edited manually.

2.4 Connecting Blocks

To build a control algorithm the blocks have to be put onto the drawing canvas of a diagram, their input and outputs interconnected and their parameters adjusted. It is expected that the user is familiar with the Function Block Diagram (FBD) graphical language for programmable logic controllers.

The blocks are connected by so-called connection lines or links. A link has always a single source and one or more destinations. A source may be any block output and a destination is any block input. It is not possible to connect two outputs together. A warning is shown during compilation when a source or destination of a link is not connected.

A links are created using the mouse by clicking on any input or output pin and holding the button pressed while moving towards another pin. A red dashed line is show until the final pin is reached. When the final pin is reached, a green bold line is shown. The line becomes a standard link after the mouse button is released.

A branch may be created by right clicking on any point of an existing link. A link may be deleted by pressing the Delete key when the link is selected. A link may be disconnected from a pin by right clicking on the pin and selecting Break/Disconect line from the context menu.


PIC


Figure 2.3: Connection Between Blocks

2.5 Persistent memory

REX supports permanent storage of function block parameters and some specified function block internal states. Persistent memory performance is target platform specific. If the target platform does not have any supported persistent memory available, the permanent parameters will be stored to the permem.dat file by default (to the same directory as exec.rex is stored - \rex\rexcore on Linux machines or C:\ProgramData\REXControls\REX_<version>\RexCore\).

Persistent memory is internally limited by maximum 2048 bytes per function block (possible problems can come in using long strings).

In order to store the function block parameters, the checkbox Permanent in block properties must be checked - see Fig. 2.2. All function block parameters and some internally selected block states will be stored (excluding arrays). Internally selected block states list:

Default save period is 300 s or the period is inherited from the first hard drive archive if present.

The persistent memory can be reseted or cleaned up using Download Dialog - see Fig. 3.1. Switch Download option in Download Dialog to Expert mode and choose between Reset persistent memory or Cleanup persistent memory. Reset persistent memory will replace entire persistent memory however Cleanup persistent memory will erase just the parameters which are not used any more.

Be aware that the block parameters will be overwritten with the ones stored in persistent memory immediately after swapping executives if the Permanent option is enabled for the function block.

2.6 Function Blocks Reference

A detailed description of a block that is selected is invoked by the F1 key or by selecting the Help from its context menu. A HTML documentation is opened by default. If the HTML documentation is not availabl (it was deselected during installation), RexDraw tries to open a PDF documentation and a user must scroll down to the arbitrary block manually.

Chapter 3
Communication with a Target

A project must be compiled and the resulting binary configuration has to be downloaded into the target device in order to put a control algorithm into operation. Both actions are performed directly from the RexDraw development tool.

3.1 Project Compilation

After an algorithm is designed, it is necessary to validate its structure, device configurations and block interconnections by a process called compilation. The compilation results in a creation of a binary file called binary configuration which may be downloaded into a target device. The binary configuration is a platform/target independent file format with a .rex file name extension. The format of the binary configuration is optimized for fast-processing on a target device and has several consistency check mechanisms.

Warnings and errors may occur during a compilation. All warnings, errors and other various informational messages are print into the compiler console. A warning does not cause a termination of the compile process. But it should be observed carefully as it may probably indicate a problem that may lead into an unexpected behavior of the algorithm. All errors are treated as serious problems and cause a termination of the compiling process and no binary configuration is produced. All errors and warnings are indicated by theirs respective numbers and textual information message.

A compilation is started from the Compiler menu. A project is compiled by selecting Compiler/Compile from the menu, clicking on the icon on the toolbar or using the F5 shortcut.

3.2 Downloading Configuration

A configuration is downloaded into the target device by selecting Compiler/Compile and Download from the menu, clicking on the icon on the toolbar or using the F6 shortcut.

A compilation of a project into a binary configuration is always performed before it is downloaded into the target device to ensure consistency. If an error occurs during the compilation, a compiler window is shown and the download operation is not available. A user must fix all errors indicated by the compiler before he or she may process with the download.


PIC


Figure 3.1: Project Compilation and Download Dialog

3.3 License Activation

Before a binary configuration may be downloaded and activated the target has to be properly licensed. For a permanent target operation a full target license must be obtained from the REX Controls company. A DEMO license is available for experiments and development. A DEMO license may be obtained directly from the RexDraw application while connecting to unlicensed target. A user may also get the DEMO license from the web page of the REX Controls company.

An information dialog about licensing is shown while connecting to an unlicensed target (figure 3.2). A user has the following three options:


PIC


Figure 3.2: Missing License Notification

Get DEMO License: Select this option if you want to obtain a DEMO license directly by filling-in name and email address to which a licensing key is sent (figure 3.3).


PIC


Figure 3.3: DEMO License Dialog

I already have a license: Select this option if you already have a valid license and you want to submit a licensing key into target device (figure 3.4).


PIC


Figure 3.4: Insertion of a Licensing Key

Continue: Select this option if you want to continue without licensing the target. But be aware that most of its functionality is not available in an unlicensed mode.

3.4 Watch mode and Diagnostics

A comprehensive diagnostic tool is now integrated directly into the RexDraw development tool. All the diagnostic functionality that was previously accessible only from the RexView diagnostic tool is now also available from the RexDraw.

Before using the diagnostic tool, a binary configuration must be successfully downloaded into the target device, loaded and started. For information about downloading a binary configuration into the target device see the section 3.2.

A diagnostic tool in RexDraw may be used only when there is an on-line connection established with the target device. The connection is established by clicking on Target/Connect from the menu, clicking on the icon on the toolbar or using the F7 shortcut. The connection may also be established after a binary configuration is downloaded into the target device and a dialog is shown in which a user is asked if the on-line connection with the target should be preserved and the so-called Watch mode should be activated.

A Watch mode is indicated by a gray background of all windows with function block diagrams. It is not possible to add, delete or move function block or connections between blocks in the Watch mode. Instead, a user may inspect signals of all block inputs, outputs and parameters and observe all signal values in real-time with a refresh period that may be adjusted in the settings dialog and which is one second by default. This is called Signal Monitoring.

3.4.1 Monitoring signals

It would be inefficient and bandwidth-consuming if all signals were monitored immediately when the Watch mode is activated. For that reason, only the DISPLAY blocks are monitored automatically. A user has to switch other function blocks into the so-called Monitoring State if signals of a particular block should be monitored.

When a block is in the Monitoring State, all input and output values are displayed at the corresponding pin of the monitored block. A block is added to the Monitoring State by selecting Project/Watch Selection from the menu or using the Ctrl+W shortcut. A block is removed from the Monitoring State by selecting Project/Exclude from Watch from the menu or using the Ctrl+Shift+W shortcut.

The values of parameters are shown in a floating yellow window when a user positions the mouse cursor over a function block. Parameters may also be inspected and adjusted from the on-line block properties dialog that is invoked by pressing Ctrl+E. Be careful when modifying the values of parameters as changes are immediately committed to the target when the OK or Apply button is clicked.

A dialog that allows to transfer all changes to the parameters made in the Watch mode back to the drawing is displayed before disconnecting from the target device. A user may accept or discard changes to all parameters individually. This simplifies an effort to keep a project synchronized with the run-time configuration.

A user should always observe a right part of the status bar where a state of the connection with the target device is indicated. A green color indicates that connection has been successfully established and the data is communicated periodically without any errors. A red color indicates that the connection with the target device has been unexpectedly closed or an error occurred during the data exchange.


PIC


Figure 3.5: Monitoring and Diagnostics in the Watch Mode

3.4.2 Viewing trends

The blocks TRND and TRND are available in REX to monitor signals over a period of time. The TRND allows to save up to 4 signals and the TRNDV allows to save up to 64 signals into the memory of the target device. The samples are stored synchronously during a task execution. This allows to store and observe very fast processes without loosing a single sample.

The diagnostic tool of the RexDraw makes possible to show all the data stored in the memory of the TRND block in the Watch mode. To show a windows with all data signals shown in a graphical trend simply double-click on a TRND block while the RexDraw is in the Watch mode. A data may be zoomed, a scale and a range of both axes may be changed and the data may also be exported do a CSV file from the window.

3.4.3 Viewing System Log

A system log with error, warning and other informational messages with timestamps is present on every target device. A user may display a content of the system log directly from the RexView selecting Target/Show System Log from the menu or by clicking on the icon on the toolbar. A content of the system log is uploaded and shown in a dialog. A user may browse all messages, filter the content or export selected items into a CSV file.

The types and severities of messages that are written to the system may be configured by selecting Target/Configure System Log from the menu. The Safe print flags to the target option must be selected if it is required to store the configuration of the system log permanently on the target device. A last saved configuration is loaded during the next system boot if the option remains unselected.

3.4.4 Diagnostics

A detailed diagnostics tool may be launched by clicking on Target/Diagnostics from the menu or by clicking on the icon on the toolbar. The tool provides all the functionality that was previously available separately in a stand-alone application, the RexView. The integration of the RexView application into the RexDraw brings many advantages such a sharing a single connection with the target device, faster start-up and better user experience. The diagnostic tool window is closed automatically when a user initiates a disconnection from the target device.

Chapter 4
Human-Machine Interface

Another option for signal monitoring is to use any of Human-Machine Interfaces that are available within the REX. A web interface with a human-machine interface may be opened from RexDraw by selecting Target/Web Interface. Please, see the documentation of the HMI block in [1] and [2] where all available options provided by REX are described.


PIC


Figure 4.1: WebWatch – Monitoring Signals Using a Web Interface

Chapter 5
Stand-alone Tools

5.1 RexView

The RexView may be started directly from the RexDraw by clicking on Tools/RexView from the menu or by clicking on the icon on the toolbar.

The RexView provides all the functionality that is also available from the diagnostic tool in the RexDraw in a stand-alone application.

5.2 RexHMI Designer

The RexHMI Designer may be started directly from the RexDraw by clicking on Tools/RexHMI Designer from the menu or by clicking on the icon on the toolbar.

Chapter 6
Supported Operating Systems

All 32-bit and 64-bit Windows 7 and later operating systems are supported by development tools of REX. Windows Vista may also work but no guarantee nor support is provided for this version.

It is also possible to run all development tools on GNU/Linux on a 32-bit or 64-bit x86 platform using Wine from www.winehq.org. We actively test the REX installer for Windows in Wine and we are submitting patches to make everything work smoothly. User should have at least version 2.0 of Wine installed. A corefonts must be installed using the command winetricks corefonts. Nevertheless, we give no guarantee that everything works always as expected in Wine and we provide no support for using REX in Wine.

Only RexView is supported to run on GNU/Linux operating system natively and only the Debian Linux distribution is supported. Other development tools are not supported on Linux yet.

Chapter 7
Keyboard Shortcuts


Keyboard shortcut Function (as presented in the menu)
CTRL+N New File
CTRL+O Open File
CTRL+S Save File
CTRL+P Print
CTRL+SHIFT+S Save as
CTRL+Z Undo
CTRL+Y Redo
CTRL+A Select All
CTRL+X Cut
CTRL+C Copy
CTRL+V Paste
CTRL+R Rotate Block Clockwise
CTRL+SHIFT+R Rotate Block Counterclockwise
CTRL+E Properties
CTRL+M Subsystem Mask
CTRL+U Look under Mask
CTRL+G Create Subsystem
CTRL+L Block Library
F2 Zoom In
F3 Zoom Out
F4 Zoom Default
F1 Help
F5 Compile
F6 Compile and Download
F7 Connect
F8 Disconnect
F9 Activate Watch Mode
CTRL+W Watch Selection
CTRL+SHIFT+W Exclude from Watch

Table 7.1: Keyboard shortcuts in RexDraw

List of Figures

Bibliography

[1]   REX Controls s.r.o.. Function blocks of the REX Control System – reference manual, 2017.

[2]   REX Controls s.r.o.. RexHMI – User manual, 2017.


Documentation reference number: 8614