Unipro3 Manual
Unipro3 Manual
Unipro3 Manual
SOFTWARE MANUAL
CODE 114UP3E334
Important notice
This Instruction Manual should be read carefully before use, and all warnings should be observed; the Manual should
then be kept for future reference.
Summary
1 GENERAL INFORMATION ........................................................................................................... 8
1.1 About UNI-PRO 3 ............................................................................................................... 8
1.2 System requirements ............................................................................................................ 9
1.2.1 Hardware Requirements ................................................................................................... 9
1.2.2 Software Requirements .................................................................................................... 9
1.3 Developing projects with UNI-PRO .................................................................................. 10
1.4 Your first UNI-PRO program ............................................................................................ 12
2 BASIC OPERATIONS ................................................................................................................... 17
2.1 Creating a new project ....................................................................................................... 17
2.2 Saving and loading an existing project .............................................................................. 17
2.3 Entities: definition and use................................................................................................. 18
2.3.1 Name of the entity .......................................................................................................... 18
2.3.2 Entering entities ............................................................................................................. 19
2.3.3 Moving entities .............................................................................................................. 19
2.3.4 Removing entities .......................................................................................................... 19
2.3.5 Cutting, copying and pasting entities ............................................................................. 19
2.4 Using control sheets ........................................................................................................... 19
2.5 Joining control entities ....................................................................................................... 21
2.5.1 Name of the input and output terminals of the entities .................................................. 22
2.5.2 Names to the external links ............................................................................................ 23
2.6 Using array entities ............................................................................................................ 24
2.6.1 Compatibility and link ................................................................................................... 25
2.7 Type CJ_CHAR for string management ............................................................................ 26
2.8 Using CodeEditor ............................................................................................................... 27
2.8.1 Algorithm with array inputs/outputs .............................................................................. 30
2.8.2 Array Inputs and array output ........................................................................................ 31
2.8.3 Change the order of input terminals of the algorithms .................................................. 32
2.8.4 Use of global algorithms ................................................................................................ 32
2.9 Creating libraries ................................................................................................................ 33
2.10 Creating EIML pages ......................................................................................................... 34
2.11 Simulating EIML pages ..................................................................................................... 35
2.12 Selecting hardware ............................................................................................................. 37
2.12.1 ModbusMaster network ............................................................................................. 39
2.12.2 BACnet MS/TP configuration ................................................................................... 39
2.12.3 Configurazione BACnet IP ........................................................................................ 40
2.13 Connection to physical terminals ....................................................................................... 44
2.13.1 Digital Inputs.............................................................................................................. 44
2.13.2 Digital Outputs ........................................................................................................... 45
2.13.3 Analog Inputs ............................................................................................................. 46
2.13.4 Analog Outputs .......................................................................................................... 47
2.13.5 Clocks......................................................................................................................... 48
2.13.6 Leds ............................................................................................................................ 48
2.13.7 Buttons ....................................................................................................................... 49
2.13.8 Command In ............................................................................................................... 50
2.13.9 Command Out ............................................................................................................ 51
2.13.10 Buzzers ....................................................................................................................... 52
2.14 Compiling the program ...................................................................................................... 53
2.14.1 Using the cache .......................................................................................................... 55
2.14.2 Compiling with browser V-Color 3 ........................................................................... 55
2.15 Downloading the program ................................................................................................. 56
2.15.1 Download e programmazione USB ........................................................................... 56
2.15.2 Download with browser V-Color 3 ............................................................................ 57
2.16 Use of the Debugger .......................................................................................................... 58
2.16.1 Present value in debug ............................................................................................... 64
3 BASIC ELEMENTS ....................................................................................................................... 65
3.1 Data types ........................................................................................................................... 65
3.1.1 Simple data types ........................................................................................................... 65
CJ_VOID ............................................................................................................................... 66
CJ_LED and CJ_BUZZ ......................................................................................................... 66
CJ_DATE ............................................................................................................................... 66
CJ_TIME ................................................................................................................................ 66
CJ_DATETIME ..................................................................................................................... 66
3.1.2 Structured data types ...................................................................................................... 67
CJ_ANALOG......................................................................................................................... 67
CJ_CMD ................................................................................................................................ 67
CJ_BTN ................................................................................................................................. 67
CJ_DATE_STRUCT ............................................................................................................. 68
CJ_TIME_STRUCT .............................................................................................................. 68
CJ_DATE_TIME_STRUCT.................................................................................................. 69
3.2 Type compatibility table .................................................................................................... 70
3.3 Firmware library functions to be used in the algorithms ................................................... 71
3.3.1 CJ_DATETIME StructToDateTime(CJ_DATETIME_STRUCT rtc) .......................... 71
3.3.2 CJ_DATE StructToDate (CJ_DATE_STRUCT date) ................................................... 71
3.3.3 CJ_TIME StructToTime (CJ_TIME_STRUCT time) ................................................... 71
3.3.4 CJ_DATETIME_STRUCT DateTimeToStruct(CJ_DATETIME Value) ..................... 71
3.3.5 CJ_DATE_STRUCT DateToStruct (CJ_DATE Value) ................................................ 71
3.3.6 CJ_TIME_STRUCT TimeToStruct (CJ_TIME Value) ................................................. 71
3.3.7 CJ_BYTE CJ_GetSeconds(CJ_DATETIME dt) ........................................................... 71
3.3.8 CJ_BYTE CJ_GetMinutes(CJ_DATETIME dt) ........................................................... 71
3.3.9 CJ_BYTE CJ_GetHours(CJ_DATETIME dt) ............................................................... 71
3.3.10 CJ_BYTE CJ_GetDay(CJ_DATETIME dt) .............................................................. 71
3.3.11 CJ_BYTE CJ_GetWeekDay(CJ_DATETIME dt)..................................................... 72
3.3.12 CJ_BYTE CJ_GetMonth(CJ_DATETIME dt) .......................................................... 72
3.3.13 CJ_BYTE CJ_GetYear(CJ_DATETIME dt) ............................................................. 72
3.3.14 CJ_TIME CJ_GetTime(CJ_DATETIME dt) ............................................................. 72
3.3.15 CJ_DATE CJ_GetDate(CJ_DATETIME dt) ............................................................. 72
3.3.16 CJ_BIT CJ_GetSecondTic (void) e CJ_BIT CJ_GetMinuteTic (void) ................... 72
3.3.17 CJ_BIT CJ_FlagWrite (CJ_WORD i, CJ_BIT val) - CJ_BIT CJ_FlagRead
(CJ_WORD i) ............................................................................................................................ 72
3.3.18 CJ_SHORT CJ_WriteVarExpo(CJ_WORD add, CJ_LONG value) ......................... 73
3.3.19 CJ_LONG CJ_ReadVarExpo(CJ_WORD add)......................................................... 73
3.3.20 CJ_WORD CJ_MaxMainTime(void) ........................................................................ 73
3.3.21 CJ_WORD CJ_MinMainTime(void)......................................................................... 73
3.3.22 CJ_WORD CJ_RunMainTime(void)......................................................................... 73
3.3.23 CJ_BYTE CJ_MaxInterruptTime(void) .................................................................... 74
3.3.24 CJ_BYTE CJ_MinInterruptTime(void) ..................................................................... 74
3.3.25 CJ_BYTE CJ_RunInterruptTime(void) ..................................................................... 74
3.3.26 CJ_BYTE CJ_ModbusAskQueue(void) .................................................................... 74
3.3.27 CJ_BYTE CJ_SendCommand (CJ_BYTE channel, CJ_BYTE node, CJ_BYTE
command, CJ_SHORT par1) ..................................................................................................... 74
3.3.28 CJ_BIT CJ_IsFirstMain(void) ................................................................................... 74
3.3.29 CJ_BIT CJ_Stack_Error_Read(void) ........................................................................ 74
3.3.30 CJ_BIT CJ_Math_Error_Read(void) ......................................................................... 74
3.3.31 CJ_BIT CJ_DivByZero_Error_Read(void) ............................................................... 74
3.3.32 CJ_BIT CJ_Overflow_Error_Read(void) .................................................................. 74
3.3.33 CJ_BIT CJ_Underflow_Error_Read(void) ................................................................ 74
3.3.34 CJ_BIT CJ_NaN_Error_Read(void) .......................................................................... 75
3.3.35 void CJ_DivByZero_Error_Write(void) .................................................................... 75
3.3.36 void CJ_Overflow_Error_Write(void)....................................................................... 75
3.3.37 void CJ_Underflow_Error_Write(void) ..................................................................... 75
3.3.38 void CJ_NaN_Error_Write(void) .............................................................................. 75
3.3.39 void CJ_Math_Error_Reset(void) .............................................................................. 75
3.3.40 void CJ_DivByZero_Error_Reset(void) .................................................................... 75
3.3.41 void CJ_Overflow_Error_Reset(void) ....................................................................... 75
3.3.42 void CJ_Underflow_Error_Reset(void) .......................................................................... 75
3.3.43 void CJ_NaN_Error_Reset(void) .................................................................................... 75
3.3.44 CJ_WORD CJ_SemaphoreRead(CJ_WORD i).............................................................. 75
3.3.45 CJ_BYTE CJ_SemaphoreWrite(CJ_WORD i, CJ_WORD value) ................................ 75
3.4 Control components ........................................................................................................... 76
3.4.1 Software ......................................................................................................................... 76
Algorithm ....................................................................................................................... 76
Global Algorithm .......................................................................................................... 77
Subsheet .......................................................................................................................... 77
Fix ................................................................................................................................... 78
Par ................................................................................................................................... 79
Pers ................................................................................................................................. 81
Var ................................................................................................................................... 83
Timer .............................................................................................................................. 84
Command In ................................................................................................................... 86
Command Out ................................................................................................................ 87
3.4.2 Hardware ........................................................................................................................ 87
Digital Input ..................................................................................................................... 88
Digital Ouput .................................................................................................................. 89
Analog Input .................................................................................................................. 90
Analog Output ................................................................................................................ 91
Button .............................................................................................................................. 92
Led ................................................................................................................................... 93
Buzzer ............................................................................................................................ 94
Clock ............................................................................................................................... 95
3.4.3 Libraries ......................................................................................................................... 96
3.4.4 Used libraries documentation......................................................................................... 96
3.5 Elements in EIML pages .................................................................................................... 97
3.5.1 Toolbar ........................................................................................................................... 97
3.5.2 Embedding an element in an EIML page....................................................................... 97
3.5.3 Page properties ............................................................................................................... 97
3.5.4 Multilanguage pages .................................................................................................... 100
3.5.5 Color pages .................................................................................................................. 100
3.5.6 Element properties ....................................................................................................... 102
Text ............................................................................................................................. 103
Variable ...................................................................................................................... 105
Strings ......................................................................................................................... 108
Icons ......................................................................................................................... 110
Combo ....................................................................................................................... 112
Table ........................................................................................................................ 114
Line ........................................................................................................................... 119
Rectangle ................................................................................................................. 119
4 ADVANCED OPERATIONS ...................................................................................................... 120
4.1 Commands ....................................................................................................................... 120
4.2 Navigating through the pages .......................................................................................... 123
4.3 Password-protected information ...................................................................................... 124
4.4 Defining execution tasks .................................................................................................. 125
4.5 Setting the program's execution order.............................................................................. 125
4.5.1 Calls List ...................................................................................................................... 127
4.5.2 Execution order during the calls list added .................................................................. 129
4.6 Sorting internal variables ................................................................................................. 130
4.6.1 Modbus and CANopen Documentation ....................................................................... 132
4.7 Conditioned Visibility ...................................................................................................... 133
4.7.1 Firmware function void CJ_SetCondVisBit(word idx, bool value) .......................... 133
4.7.2 Example ....................................................................................................................... 134
4.8 Semaphores ...................................................................................................................... 136
4.9 Sorting EIML elements .................................................................................................... 137
4.10 Project settings ................................................................................................................. 138
4.10.1 Version Info ............................................................................................................. 138
4.10.2 Project ...................................................................................................................... 139
4.10.3 Historian ................................................................................................................... 140
4.10.4 Project defines .......................................................................................................... 141
4.10.5 Structs....................................................................................................................... 141
4.10.6 Options ..................................................................................................................... 142
4.10.7 Project Change Log .................................................................................................. 143
4.11 EIML Backgrounds .......................................................................................................... 143
4.12 Environment configuration .............................................................................................. 145
4.13 Exporting / Importing....................................................................................................... 151
4.14 Project backup .................................................................................................................. 152
4.15 Product programming tool (Download Manager) ............................................................ 153
4.16 VTP Maker ....................................................................................................................... 155
4.17 Parameters Manager & VTPEditor .................................................................................. 158
4.18 Expansions and remote terminals configuration .............................................................. 161
4.18.1 Intrabus Master ........................................................................................................ 161
4.18.2 CAN master.............................................................................................................. 162
4.19 Modbus Master Entities Link ........................................................................................... 163
4.20 “Delete and save links” function and LinkFixer .............................................................. 164
4.21 CAN Config ..................................................................................................................... 166
4.22 EIML Translator .............................................................................................................. 170
4.23 Configuration MP-Bus Belimo protocol .......................................................................... 171
4.24 Compatibility control for browser V-Color 3 .................................................................. 172
4.25 Precautions in project development ................................................................................. 173
4.26 “Run-time” variables........................................................................................................ 173
4.27 Palette of the 256 colors of UNI-PRO ............................................................................. 175
5 WHAT’S NEW IN VERSION 3.5.0.0 ......................................................................................... 180
5.1 New features .................................................................................................................... 180
1 GENERAL INFORMATION
1.1 About UNI-PRO 3
UNI-PRO 3 (hereinafter also called UNI-PRO) for Windows® is an integrated development
environment for C-Pro programmable controllers that enables you to customize and manage
complex system control projects.
It enables you to set up ––in an easy and user-friendly way–– a modular range of hardware that you
can use to make the controller, as well as to define all functional and control features of the system.
The development environment is composed of a series of integrated and interacting tools that enable
you to perform the following operations:
creating and managing objects and control algorithms
creating and managing user interfaces
setting up controller networks
choosing the hardware, compiling, verifying and downloading the code
debugging controller operation
assisted management of controller's user parameters (not yet available)
creating and changing object libraries and managing the corresponding versions
generating project documents automatically (not yet available)
1.2 System requirements
1.2.1 Hardware Requirements
Below are the minimum system requirements to run UNI-PRO:
Important note: Administrative privileges are required to install, run and uninstall UNI-Pro
software.
Is requested a PDF viewer, for example Acrobat Reader v6.0 or higher, to the correct view of the
help pages and the Hardware/Software documentation (it is included in the UNI-PRO installation
CD-ROM under the folder [CDROM]:\Acrobat Reader).
IMPORTANT: The default screen setup used by UNI-PRO is 96 DPI (Dot Per Inch). The change of
this setup applies a resizing to the position and dimension of user interface elements. Therefore
some windows may not correctly displayed. So is recommended to use UNI-PRO with 96 DPI
setup.
1.3 Developing projects with UNI-PRO
Through the UNI-PRO development environment you can create and manage distributed control
projects, no matter how large they may be.
UNI-PRO is not only a tool to develop controller code, but also a useful design tool to build and
organize your own know-how. In fact, you can use it during the analysis stage to quickly decide
which is the best solution to control a certain system, or to examine a control solution customized to
meet customer's requests. The possibility of creating object libraries enables you to build your own
collection of objects that you can reuse in several projects, thus protecting the Company's internal
knowledge and minimizing development time.
In many cases, the method applied to develop a project is fundamental. With UNI-PRO, you can
proceed according to either the top-down approach (i.e. defining the system layout first and then
implementing the details) or the bottom-up approach (i.e. starting from the machine's basic, low-
level elements and then building more and more complex blocks, one brick at a time, until you
reach the final goal).
The project development cycle is divided into several steps. In the first one, graphic objects
representing the main control components are entered in a worksheet. After customizing the
properties of these objects, they are easily joined to create the controller's "logical" structure.
During this step, the pages that make up the product's user interface will be developed as well.
The second step includes the connection with the "physical" part of the selected controller, i.e. with
the inputs, outputs, and internal hardware resources.
In the following step, the graphical part of the program is compiled, including the corresponding
algorithms and user interface pages.
In the final step, the code is downloaded and, finally, the program is run to check its operation and
make any necessary changes.
The use of UNI-PRO to develop a project should follow an iterative and incremental approach,
according to the following diagram:
REQUIREMENTS ANALYSIS
ORGANIZING CONTROL
SUBSHEETS AND USER
INTERFACE
IMPLEMENTING ALGORITHMS
AND PAGES
FUNCTIONAL TESTS
PRODUCT TESTS
PRODUCT RELEASE
1.4 Your first UNI-PRO program
Below is an easy program to help you familiarize with the UNI-PRO development environment.
The program uses a Digital In and a Digital Out that will be joined together. The effect we want to
achieve is that when the digital input switches, the corresponding digital output switches too. In
addition, we will also be creating an EIML page in which the digital output is linked to a combo
object with two texts, so that a different message is displayed according to output state.
To create a new project, we can either choose File / New Project from the menu or click the Create
a new project icon in the toolbar. The window called "New UNI-PRO Project" will appear. Enter
the name "Sample1" in the Project Name box and click Create.
First of all, we need a digital type input and an output that corresponds to a relay. From the
Hardware palette, we select a Digital In and click anywhere on the worksheet: the digital input icon
with the default name DIGITALIN1 will appear. We can use the mouse to drag it to the desired
position.
Following a similar procedure, we can position a Digital Out as well.
Once both entities have been added to the main worksheet of the application, we will need to join
them. To do so, we place the mouse pointer over the digital input's output until it changes size. We
click and notice that an arrow is drawn from the digital input's output pin to the pointer. We place
the pointer over the digital output's input pin until it changes size and then click.
If we have followed all the steps in this procedure correctly, both entities should now be linked by
an arrow.
To save the project, choose File / Save Project from the menu, or click the corresponding icon in
the toolbar.
We will now discuss how to create the graphical interface: choose File / New / New EIML Page
(240x128) from the main menu. A blank page will appear, corresponding to a 240x128 pixel LCD
graphic display. From the palette of the page, we select the Combo icon, then we click on the blank
page and drag it while holding the left mouse button down until we obtain a rectangle:
Once we have created it, we can move it to the desired position. If we wish to change its size, we
just need to open the properties window (right click on the rectangle and select Properties) and set
Left, Top, Width and Height as required. Otherwise, we can graphically resize the object by placing
the mouse pointer at the ends of the element.
In addition, from the properties window, we will link the Var property to the DigitalOut variable, as
shown in the figure below:
In this way we have created a join between the DigitalOut variable and the Combo1 graphic
element that represents it.
Finally, we will set Align to CENTER, Font to 8x16 and we will check the Refresh property.
Now, we will right-click with the mouse on the rectangle and select the Combo Wizard. We will
leave the Type property set to Text and type "Please Switch-On" in the Name window, then we will
press Add. In this way, this text will remain linked to the value 0 of the DigitalOut variable (contact
open). We will now repeat the operation but this time we will link the text "Hello World!" to the
value 1 (contact closed).
Now let's try and launch the compilation by selecting Project / Compile from the menu or clicking
the corresponding key in the toolbar.
If we had not selected the hardware on which the project will be run yet, the Hardware Expert will
appear.
After reading the introduction, we will click Next to go on to the following screen that shows a list
of all available controllers on the left, a brief hardware description in the center, and a preview on
the right.
We will select the most suitable controller (e.g. C-pro 3 Mega Built-In) and click Next.
The third wizard step will show the serial port configurations (let’s leave them out at present).
The fourth wizard step will show the available expansions complete with a brief description on the
right, and will give us the possibility of joining them to the selected CAN bus. We won't add any
expansions and we will just click Next (for a more detailed description, please refer to section
Selecting hardware).
In the fifth step, we will be able to join a display (we will select the Control-Panel with 240x128
LCD graphic display).
The last step of the Hardware Expert summarizes the selected configuration. By clicking End we
will close the Wizard and we will automatically go to a window where we can check the joins
between the entities and the physical terminals.
In our case, we will need to join the DigitalIn and the DigitalOut in our project to the chosen digital
input and digital output, respectively.
We will select DIGITALIN from the list on the left and the physical terminal we wish to join it to
from the center list, for example the first one (for a more detailed description of physical terminals,
please refer to the hardware's documentation); by clicking Join, the selected items will be removed
and a new row will be generated in the list on the right, describing the join that has just been made.
On closing this window, the system will automatically request us to join the DigitalOut as well. To
join the DIGITALOUT, we will proceed in the same way as we did before.
Once we have correctly joined all entities in the Hardware section, the project compilation will start
(the result of compilation will be displayed in the output window).
If the connection with the board is successfully established, after a few seconds the progress bar
begins to expand and once downloading is complete, a box will appear indicating the successful
outcome of the operation.
Otherwise an error message will appear; in this case we reattempt the operation after having
verified some conditions:
1. The serial port selected in the environment options (which can be activated from the
Tools/Settings menu) must be the one where we want to perform the download from.
2. The serial cable must be connected both to the computer and to the controller
Having terminated the download operations, your first program should have been loaded in the
CproPlus_S0: if you now close the contact where the DigitalIn has been connected, the relay
corresponding to the DigitalOut should trigger and the words “Hello World!” should appear on the
graphic viewer.
2 BASIC OPERATIONS
In this chapter we will discuss the basic operations that allow you to develop a project using the
UNI-PRO development environment. The user will be guided through all the operations required to
develop a project (creation, algorithms implementation, compilation and download to the
controller).
When you create a new project, it is highly advisable to enter its name, a unique project number, the
author's name, the creation date (the current date appears by default) and a brief description of the
project. Each project can be identified by a project number, a version and a revision. To create the
project, press the Create key or the Cancel key to cancel.
All project options may also be changed at a later time by choosing the Project/Properties menu or
clicking the corresponding icon in the toolbar .
To load a project you had saved to disk earlier, do one of the following:
A window will be displayed where we can select the file to which we had saved our project.
A fast method to find and open a project we had just saved is to use the Recently Opened Projects
list, which will show a list of projects opened recently sorted by date. To use this function, choose
File/Recently Opened Projects from the menu and click on the desired project.
In addition, each one of them has specific properties that characterize its behavior and that will be
discussed in detail in chapter 3.
Examples of entities are variables, digital inputs (DI), digital outputs (DO), algorithms, libraries,
etc.
The names of entities, algorithms, categories, inputs, outputs, etc.. must not exceed 80
characters.
The compiler used to compile the project is case-sensitive type, then a name of two different
entity CAN’T differ only in capital/lowercase letters. Eg. Two entities with associate names
requestFans and RequestFANS will generate an error while the compilation.
The names of entities must be C-like, then must not contain special characters like: spaces,
commas, dots, apostrophes, accents, quotes and mathematical signs (+,-,*,/).
The names of entities are case-sensitive
These three rules are advices to use while the develop to not encountering any errors in the end of
the project while the compilation phase.
you may add an empty subsheet by selecting the icon in the Software Palette and then
insert the different entities in it
or you may automatically move certain entities from the active sheet to a subsheet by
selecting the entities you wish to group and then choosing Library/Generate SubSheet, from
the menu or clicking on the icon in the toolbar.
In order to join the entities found in a subsheet to external entities, you will need to export the input
and output pins of the involved entities (see section 2.5).
2.5 Joining control entities
To set up a project, you need to insert entities in the sheets and join them together according to the
logical layout that establishes the controller's behavior.
Joining entities means to link each output to the respective inputs of other entities according to
certain simple rules discussed below:
a maximum of one output pin may be joined to each input pin
the data type associated with the input pin has to be compatible with the data type associated
with the output pin to which you intend to join it
if the entities are in the same sheet, you can join them by means of an arrow: place your
mouse pointer over the output pin of the entity you want to join until it is highlighted; by
clicking your mouse button and moving the mouse, an arrow will be drawn between the
selected output and the pointer. If you want to draw a link composed of several broken lines,
just click at the point where you want to break the arrow and go on moving the mouse in a
different direction, towards the input pin. When you place your mouse pointer over the input
pin, it will be highlighted: click to complete the link. Now, if the input had not been linked
before and if the input and output types are compatible, an arrow will be drawn to confirm
that both entities have been joined. If you want to cancel this operation at any time, just
right-click once with your mouse.
if the entities are placed in different sheets, you may decide to export the inputs/outputs.
Each subsheet has the possibility of exporting certain input or output pins of the entities
contained in it. To do so, place your mouse pointer over the pin you wish to export, then
right-click and choose Export IO from the pop-up menu. The exported pin will change color
(it will become blue by default) and will appear outside the subsheet. Let's say you want to
join a Digital Input to a Var contained in a subsheet: first thing, you need to export the
variable's input pin. Then you can link the Digital Input's output pin to the pin exported from
the subsheet.
or you can link inputs and outputs (even if placed in different sheets) without needing to
make arrow connections, but just using the external links. To specify an external link you
need to perform the following steps in order: click the button in the Software palette,
select the output you wish to join, and select the input. If during the link you keep pressed
button CTRL, the output terminal the link comes from is stored in order to make easier
connecting another input, without loosing the original output and to avoid searching it. Once
you have finished joining the entities, you can display the link you have just created by
choosing Show links… from the pop-up menu of the input or output.
This function is very useful if links are particularly tangled or high in number, but it makes the
project less readable.
To unjoin two entities, you can proceed in two different ways according to the type of link:
if the entities are joined by an arrow, select the arrow and remove it by clicking Del or
choosing Edit/Delete from the menu.
if the entities were joined using an external link, you will have to display the Show Links…
window, then select the link and remove it by clicking on the appropriate key.
Link Out
The output terminals are designed as follows: . Double-click on the terminal will
immediately open the Links window.
Drop-down menu
Property: link properties
Show Links: window with the connected links
Link In
The input terminals are designed as follows: , the colored box shows the
name of the entity to which they are connected; in this case "calc_enableShutter”. Double-click on
the terminal will return the selection to the connected entity.
Drop-down menu:
Show Entity: select the entity connected
Entity Property: open the properties of the entity connected
Show Links: open the links window
Delete Link: delete the selected link
2.6 Using array entities
“ARRAY” is a data structure containing N numerical information of the same type. N arrays of N
dimension are possible. The propriety “array” is available only when the data types are:
CJ_VOID, CJ_BIT, CJ_BYTE, CJ_S_BYTE, CJ_SHORT, CJ_WORD, CJ_DWORD, CJ_LONG.
Array is a modifiable propriety only for the following entities:
⋅ PAR - Parameters
⋅ FIX - Constants
⋅ PERS - Persistent
⋅ VAR - Variables
⋅ Inputs and outputs of the algorithms.
When the data type are different from the over reported data, the array is not modifiable, but fixed
(read-only) with value 1. For any other entities different of PAR – FIX – PERS – VAR the
propriety array is not available.
Array property is a numeric type that has 100 as maximum value and 1 as minimum value (mono-
dimensional entity) : when array data value is greater than 1, the property value becomes a string to
match array index with the correct array value. The syntax are following:
0=value[0], …, array-1=value[array-1]
Opening the window property , this string is also helpful to show quickly each position of the array
values index ,.
All “value” properties, as for example min, max, precision, will limit each array numeric value : if
the value property has min=1, max=10 and precision=1, all the array values will have min=1 and
max=10 and will be represented with one decimal places.
As the “mono-dimensional” entities also for the “array entities” it’s possible to set default values,
too. Clicking on button near the value property, the following window for editing the default
values will be proposed:
Clicking on Ok button, the edited values will be accepted and automatically set up the value
property like showed in the picture.
Clicking on Cancel button, the edited values are not accepted and will be maintained the previous
values.
To set the single characters default value, click on the button that appears when you selected the
value property, appears a window similar to the array values manage one:
Once the fields are set up click OK and the “Value” will be updated.
2.8 Using CodeEditor
CodeEditor is a graphic tool that allows you to specify the behavior of each algorithm. To open it,
either double-click on the algorithm or choose Show from the pop-up menu.
An algorithm is characterized by a series of inputs, a single output and a code that describes its
behavior.
CodeEditor is divided into several sections so that you can easily set and change all these
characteristics: on the left side of the CodeEditor window there are two tables that summarize the
properties of the inputs and the output; at the top of the window there is the algorithm category and
at the center the built-in editor.
The input table shows their type and number; three properties are specified for each input:
EName, or external name, which allows you to identify the input inside the sheet
IName, or internal name, i.e. the name used in the code; it can be easily entered by double-
clicking on the row
Dim specify the size of an input or the output (Min 1, Max 100). If input/output is a
mono-dimensional entity the property value is set to one. When the input/output is an
array entity Dim property is the number of the array element. Dim is a modifiable
propriety only for the following input/output of data type: CJ_VOID, CJ_BIT,
CJ_BYTE, CJ_S_BYTE, CJ_SHORT, CJ_WORD, CJ_DWORD, CJ_LONG, for
each other data type entities Dim property is set to the value 1.
Type, i.e. the data type to be processed
If you want to add a new input without exiting CodeEditor, just press the Add button; the following
window will be displayed:
where you can enter the new input's name, size and type.
If you select an input and press the Modify button, a similar window will be displayed where you
can change the selected input's names and type; finally, by pressing the Remove button, you can
remove the selected input from the algorithm.
The “Modify output” table allows to display and modify the algorithm's output. Naturally, the
algorithm's output have to be only one. All outputs have the same rules of the input : also an output
can have Dim property . Dim output data dimension can be modified between 1 and 100 only for :
CJ_VOID, CJ_BIT, CJ_BYTE, CJ_S_BYTE, CJ_SHORT, CJ_WORD, CJ_DWORD, CJ_LONG.
At the top of the window there is the algorithm category. The concept of category is very similar to
the concept of class in object-programming, and it allows you to use the same executable code for
all the algorithms belonging to the same category, thus optimizing resources. Two algorithms of the
same category must necessarily have the same number and type of inputs and output and the same
code (see section Optimizations).
Press the Change category…, the following window will be displayed:
code autocompletion
importing code prepared using a different editor from a file
exporting the code to a file
printing the code
making searches using find & replace
cutting, copying, and pasting code portions
using bookmarks
The code autocompletion function is extremely helpful for developers, as it allows them to
complete the syntax of predefined structures or functions without needing to check the
documentation every time.
In the case of structures, the autocompletion window will pop-up when the dot that comes before
the structure's field name is typed.
For example, if you are defining an analog input Probe (data type: CJ_ANALOG) and you want to
use the value field inside the algorithm but don't remember the right syntax, you may type “Probe.”
in the code and wait for the autocompletion window to pop-up, as shown in the following figure:
If you press the Ctrl and Space keys at the same time, a new window will appear showing useful
code editing information, such as:
functions and constant factors of the different drivers that may be used in the algorithms
the global algorithm defined in the project (prototype)
C language keywords
data types that may be used
the names of the inputs in the algorithm
project defines
When entering the code, it is highly advisable to follow certain important rules:
remember to always return a value using the C syntax keyword return (or the compiler will
give you a Warning)
you cannot use static variables (i.e. assign the attribute static to a variable)
it is advisable to use the types included in the UNI-PRO system, as described under section
3.1
refer to the structured types if, for example, you have structure-type inputs (such as
CJ_ANALOG)
be careful when using loops and avoid heavy computational loads or, even worse, infinite
loops!
The algorithm code may be defined at any time, provided that it is done prior to compiling.
Array inputs
Having two CJ_BYTE array inputs, both bigger in value than 1, now we have to return the
algorithm to the sum of the values contained in the position pos of both the arrays inputs.
In this example the two inputs have the same array size, but they could have different size.
Both of the two inputs can contain five numeric information. For the access in every cell of the
array use the following C syntax :
nameVar [ index ]
index is the access index to the array, it start always from 0; therefore the first array element is at
the index 0, and the last array element is at the index Dim-1.
For the code optimization use a “for cycle” to access at all the array indexes , without specify for
each index the necessary operation.
The variable output of the Algorithm called output, differently from the algorithms with mono-
dimensional output, is directly used in the code. Array output is used as it was an input parameter
passed as reference (using the rules of the computer programming); the modification and the access
to the output are directly make on the same output and not on a copy of the temporary variable.
Attention to write the keyword return in the following way: “return; “. As told before it is not
involved in the elaboration, but it has to be reported in it : if not the compiler will give you a
Warning during the project compilation.
Note: Currently this function cannot be used if there are exported algorithm inputs.
To call correctly a global algorithm you can search it in the project or look for it easily with the list
of the functions through buttons Ctrl+Space in the items GLOBAL function.
2.9 Creating libraries
The possibility of storing a series of objects in library format allows you to build up your own
collection of objects which you can reuse in other projects. This enables significant development
time savings and, at the same time, ensures that the know-how is maintained inside the company.
To create a new library, select the chosen element (an algorithm or a subsheet) and then do one of
the following:
right-click with your mouse and choose New library from the pop-up menu.
choose Library/New library from the menu
To create a new library, you need to specify certain characteristics that can be divided into four
sections: General Library Data, Options, Additional Data, and Type.
In the General Library Data section, you can specify the library's name, the Group and the sub-
folder Category of the library. Each library must belong to a group and must be associated to one
sub-folder Category. Not is allowed create libraries without Group or Category.
The Single Instance property (if selected) adds to the library the particularity to being able to be
used once in the project in which it be added. This function is useful when you create libraries
which the multiple presence in the project can create problems in the program working; for example
if in the library are contained algorithms with static variables, or functions to call firmware drivers
of the application.
In the Additional Data section you can specify all the options available to customize each individual
library; in fact, you can link it to an icon, and enter a version number, the author's name, the
creation/revision date and a brief description.
In the Type section you can choose the library's type: a Template is a group of reusable entities that
can be browsed, i.e. once you have added it to a project you can double click its icon to display and
change its contents; conversely, a Library is a group of entities that cannot be opened or changed
and, therefore, once you have created it, you cannot display its contents.
Once you have finished entering all data, click Create to confirm. If a library with the same name
does not exist yet, the new library will be immediately added to the tree view libraries with the
chosen icon, otherwise the system will require a confirmation before overwriting.
If you place your mouse pointer over the new library in the toolbar, you will be able to display
certain information about it, such as name, version, latest revision date, description, and type.
To add it to a new project, drag & drop the library from the tree view to the sheet.
EIML pages may contain texts, variables, icons, combos, tables, lines, and rectangles, all of which
will be described in section 3.4.
The pages are created following a WYSIWYG approach (What You See Is What You Get). This
means that the positions occupied, the font sizes, and the static properties such as alignment or text
are displayed exactly as they have been set. To display dynamic-type properties such as flashing or
cursor movement, you will need to switch to EIML page simulation.
2.11 Simulating EIML pages
While designing the graphical interface it can be very useful to simulate the actual behavior of the
pages you are creating, to check that they are being correctly implemented. UNI-PRO has a built-in
tool that allows you to display the output of a graphical interface page as if it were being executed
in the chosen display. To enable this tool, go to the page you wish to simulate and choose
Project/EIML Simulator from the menu or click the icon in the toolbar. Below is an example
of a simulation of a 240x140 pixel graphic page:
The simulator allows you to check that all elements inside the page are properly displayed (texts,
variables, icons, tables, etc.), that all actions have been correctly implemented (moving through
fields, editing and sending commands), and that the pages can be properly browsed.
On the left of the simulator window, there is an Open file button: press it to load an EIML page
saved in binary format. Instead, by pressing the Open Page List button, you can load a group of
pages saved as files to check for proper browsing through them. When the simulator is launched
from within the UNI-PRO, the list of pages contained in the current project is loaded and the page
being edited is proposed as first page.
By pressing View ParamsDrv you can display and change certain simulation parameters, included
in the firmware as well, that affect the way pages are displayed.
For example, you can decide which characters should be used as time and date separators, whether
years should be displayed as two-digit or four-digit values, and set data format.
By pressing the View Vars button, you can display a list of the variables used in the pages and, if
needed, change their value during simulation.
A row is added for each variable required by the page, which summarizes the main properties and
can also be used to change their values.
The Save Image and Copy to clipboard buttons are respectively used to save the current display to a
bitmap file or copy it to the system clipboard so that you can Paste it into another application.
The About button displays a window showing the simulator's version.
The remaining buttons, ESC, ENTER, UP, DOWN, LEFT and RIGHT, simulate the behavior of
the corresponding keys found on the user interfaces, thus allowing you to perform operations such
as moving the cursor (UP and DOWN), editing a value (ENTER, UP, DOWN, ENTER or ESC), or
browsing through the pages (ENTER on an element to which a page load command is linked, ESC
to return to the previous page).
2.12 Selecting hardware
A project developed using UNI-PRO may be executed on the family of controllers compatible with
this development environment. That's why you should choose on which ones you wish to execute
the project. In order to allow developers to work more freely, the controller may be chosen either at
the beginning of the design phase to build the project around the controller, or at the time of
compilation, depending on the resources used.
To select the hardware, launch the Hardware Expert Wizard by choosing Project/Hardware Expert
from the menu or clicking the icon. The Wizard will start with a presentation window.
Click Next to go to the second step where all controller types are listed.
When you select a controller, a brief description of the resources available in it will appear in the
center of the screen and a preview of the controller on the right. The controllers can be different for
the local Bus, which can be IntraBus or CAN (Controlled Area Network). In the Hw type section is
requested the selection of the used hardware type, generic or special (S-Type)
Click on the appropriate controller and then click Next.
The third wizard step is divided in two sections: the first one allows to enable the CAN channels
there are in the controller, in order to adapt it to the network where the project is; the second one
allows to select, for each available UART, the protocol to use (e.g. None, ModbusSlave, etc.).
On the left side there is a list with all the ModbusMaster profiles available; to add other profiles it is
required to create the configuration driver. With the key and it is possible to add or delete
the profiles there are in the network to realize. When the network are done it is required to set all
the modbus addresses. Click Close to continue.
On the left side there is a list of all available expansions which, depending on the controller, may be
connected to the Internal Can or the External Can.
The frame and buttons for the CAN bus will be available if the controller has this feature and if they
have been enabled in the previous configuration step.
If you want to add an expansion, just select it and click the button of the CAN communication
bus by which you want to link it: a new row will appear.
Once you have selected all the expansions to be added, click Next to proceed.
It is now possible to set the parameters that define the local or remote CAN network, as its physical
address, the fact that the controller manages as master the CAN network, all the physical addresses
of the others network elements:
Note. If the controller have to manage expansions is important to flag the Master controller field.
The fourth step provides a list of all possible user interfaces with a brief description of each one on
the right. To add a user interface to the selected bus, proceed just as you would to add an expansion.
In the last step, the wizard summarizes the configuration selected including controller type, serial
port configurations, expansions and interfaces linked to each corresponding communication bus.
To terminate the Wizard, click End. To cancel all changes made, click Cancel.
2.13 Connection to physical terminals
Since the entities used in the UNI-PRO are a logical representation unrelated to the controller type,
prior to compiling you will need to specify the connections between the logical resources used in
the project and the physical resources available in the selected controller.
That's why all entity types representing a controller I/O (Digital Inputs, Digital Outputs, Analog
Inputs, Analog Outputs, Clocks, LEDs, Buttons, Command Out, Command In and Buzzer) need to
be joined to the local or remote physical I/O by means of the Join Tools.
Prior to discussing each individual Join Tool, we would like to point out the Check Joins function:
it automatically checks all joins and, if needed, opens up the required windows to join those entities
that have not been assigned yet.
The window is divided into three lists: Digital Inputs, Pins Available and Joins Present.
The first list contains the project entities that have not been linked to a hardware resource yet.
The second list shows the physical digital inputs that are still available, with the following
characteristics:
The window is divided into three lists: Digital Outputs, Pins Available and Joins Present. The first
list contains the project entities that have not been linked to a hardware resource yet.
The second list shows the physical digital outputs that are still available, with the following
characteristics:
Finally, the third list contains the digital outputs and physical resources that have already been
joined.
To join an entity and a resource, select the output from the Digital Output table and the physical
resource from the Pins Available table and click the Join button. Both the entity and the hardware
terminal will disappear from the list and a new row will be created in the "Joins Present" table.
Conversely, to remove a join just select the row that represents it in the Joins Present table and then
click Unjoin: the table row will be eliminated and the logical terminal will be restored to the first
table and the physical resource to the second. To confirm the link just make click OK else to clear
the operations click Cancel
The window is divided into three lists: Analog Inputs, Pins Available and Joins Present.
The first list contains the project entities that have not been linked to a hardware resource yet.
The second list shows the physical analog inputs that are still available, with the following
characteristics:
Finally, the third list contains the analog inputs and physical resources that have already been
joined.
To join an entity and a resource, select an input from the Analog Input table and a physical resource
with a compatible sensor type from the Pins Available table, then click the Join button. Both the
entity and the hardware terminal will disappear from the list and a new row will be created in the
"Joins Present" table.
Conversely, to remove a join just select the row that represents it in the Joins Present table and then
click Unjoin: the table row will be eliminated and the logical terminal will be restored to the first
table and the physical resource to the second. To confirm the link just make click OK else to clear
the operations click Cancel
The window is divided into three lists: Analog Outputs, Pins Available and Joins Present.
The first list contains the project entities that have not been linked to a hardware resource yet.
The second list shows the physical analog outputs that are still available, with the following
characteristics:
Finally, the third list contains the analog outputs and physical resources that have already been
joined.
To join an entity and a resource, select an output from the Analog Output table and the physical
resource from the Pins Available table and then click the Join button. Both the entity and the
hardware terminal will disappear from the list and a new row will be created in the "Joins Present"
table.
Conversely, to remove a join just select the row that represents it in the Joins Present table and then
click Unjoin: the table row will be eliminated and the logical terminal will be restored to the first
table and the physical resource to the second. To confirm the link just make click OK else to clear
the operations click Cancel
2.13.5 Clocks
The clock joining wizard will start automatically during the Check Join function if there are still
Clocks that have not been joined yet; you can also start it manually by choosing Project/Join
Tools/Clocks from the menu.
The window is divided into three lists: Clocks, Node Available and Joins Present.
The first list contains the project entities that have not been linked to a hardware resource yet.
The second list shows the physical clocks that are still available, with the following characteristics:
Finally, the third list contains the analog outputs and physical resources that have already been
joined.
To join an entity and a resource, select an RTC from the Clocks table and a physical resource from
the Node Available table, and then click the Join button. Both the entity and the hardware terminal
will disappear from the list and a new row will be created in the "Joins Present" table.
Conversely, to remove a join just select the row that represents it in the Joins Present table and then
click Unjoin: the table row will be eliminated and the logical terminal will be restored to the first
table and the physical resource to the second. To confirm the link just make click OK else to clear
the operations click Cancel
2.13.6 Leds
The LED joining wizard will start automatically during the Check Join function if there is at least
one LED that has not been joined yet; you can also start it manually by choosing Project/Join
Tools/LEDs from the menu.
The window is divided into three lists: LEDs, Port Available and Joins Present.
The first list contains the project entities that have not been linked to a hardware resource yet.
The second list shows the physical LEDs that are still available, with the following characteristics:
Finally, the third list contains the links already made between LED entities and physical resources.
To join an entity and a resource, select a LED from the first table and a physical resource from the
Port Available table, and then click the Join button. Both the entity and the hardware terminal will
disappear from the list and a new row will be created in the "Joins Present" table.
Conversely, to remove a join just select the row that represents it in the Joins Present table and then
click Unjoin: the table row will be eliminated and the logical terminal will be restored to the first
table and the physical resource to the second. To confirm the link just make click OK else to clear
the operations click Cancel
2.13.7 Buttons
The button joining wizard will start automatically during the Check Join function if there is at least
one button that has not been joined yet; you can also start it manually by choosing Project/Join
Tools/Buttons from the menu.
The window is divided into three lists: Buttons, Port Available and Joins Present.
The first list contains the project entities that have not been linked to a hardware resource yet.
The second list shows the buttons that are still available, with the following characteristics:
Finally, the third list contains the buttons and physical resources that have already been joined.
To join an entity and a resource, select a button from the first table and a physical resource from the
Port Available table, and then click the Join button. Both the entity and the hardware terminal will
disappear from the list and a new row will be created in the "Joins Present" table.
Conversely, to remove a join just select the row that represents it in the Joins Present table and then
click Unjoin: the table row will be eliminated and the logical terminal will be restored to the first
table and the physical resource to the second. To confirm the link just make click OK else to clear
the operations click Cancel
2.13.8 Command In
The Command In joining wizard will start automatically during the Check Join function if there is
at least one Command In that has not been joined yet; you can also start it manually by choosing
Project/Join Tools/Command In from the menu.
The window is divided into three lists: Command In, Node Available, and Joins Present.
The first list contains the project entities that have not yet been linked to a node from which to
receive the command.
The second list contains all controllers (including expansions) that were added to the project using
the Hardware Expert wizard, from which you may choose to receive the selected command. Each
element in this table has the following characteristics:
Finally, the third list contains the Command Ins and controllers that have already been associated.
To make a join, select a Command In from the first table, then select the node from which you wish
to receive the command among those in the Node Available table and click the Join button. The
selected Command In will disappear from the entity list and a new row will be created in the Joins
Present table.
Conversely, to remove an association just select the row that represents it in the Joins Present table
and then click Unjoin: the table row will be eliminated and the Command In will reappear. To
confirm the link just make click OK else to clear the operations click Cancel
Finally, the third list contains the Command Outs and controllers that have already been associated.
To make a join, select a Command Out from the first table, then select the node to which you wish
to send the command among those in the Node Available table and click the Join button. The
selected Command Out will disappear from the entity list and a new row will be created in the Joins
Present table.
Conversely, to remove an association, just select the row that represents it in the Joins Present table
and then click Unjoin: the table row will be eliminated and the Command Out will reappear. To
confirm the link just make click OK else to clear the operations click Cancel
2.13.10 Buzzers
The buzzer joining wizard will start automatically during the Check Join function if there is at least
one buzzer that has not been joined yet; you can also start it manually by choosing Project/Join
Tools/Buzzers from the menu.
The window is divided into three lists: Buzzers, Port Available , and Joins Present.
The first list contains the project entities that have not been linked to a hardware resource yet.
The second list shows the buzzers that are still available, with the following characteristics:
Finally, the third list contains the buzzers and physical resources that have already been joined.
To join an entity and a resource, select a buzzer from the first table and a physical resource from the
Port Available table, and then click the Join button. Both the entity and the hardware terminal will
disappear from the list and a new row will be created in the "Joins Present" table.
Conversely, to remove a join just select the row that represents it in the Joins Present table and then
click Unjoin: the table row will be eliminated and the logical terminal will be restored to the first
table and the physical resource to the second. To confirm the link just make click OK else to clear
the operations click Cancel
If the project had not been saved yet, you will be prompted to specify a file name to save it to. Then,
the project is analyzed and the source files are created, which will be compiled and linked to
generate the executable file that will be downloaded to the controller through the Download
function. Finally, the available resources are calculated: the amount of FLASH and RAM memory
still unused.
While source files are being compiled, a window is displayed in the foreground with a progress bar
showing the completed process percentage and an Abort button, to interrupt the process.
In addition, a window that progressively displays the result of compilation appears at the bottom of
the environment. If the compiling process ends successfully, the object files are linked, the
executable file to be subsequently downloaded is generated, and a report showing all FLASH and
RAM resources still available is displayed.
If compilation does not end successfully, each detected error will cause a row to be displayed.
Each error row offers many pieces of information that can be interpreted as follows:
Double-click on the row corresponding to the error you wish to correct; the CodeEditor of the
algorithm in which the error was detected will open automatically and the cursor will be placed in
the relevant line.
For example, if the net of the project TestProject is made of a controller C-Pro 3 Micro Basic and a
browser V-Color 3 320x240, the result of the compiling will be the following:
Object file of the controller:
- TestProject.ucjb
- TestProject.ucje
Object file of the browser:
- TestProject_Browser.ucjb
- TestProject_Browser.ucje
2.15 Downloading the program
Once you have finished compiling, the executable code can be downloaded into the microcontroller.
Before starting the download, check that the hardware is properly connected to the serial port and
ready for programming (see the hardware manual). To start the program download, choose the
Project/Download menu or the icon located on the toolbar. The following window will
appear:
If the connection with the board is successfully established, after a few seconds the progress bar
begins to expand and once downloading is complete, a box will appear indicating the successful
outcome of the operation.
Otherwise an error message will appear; in this case reattempt the operation after having verified
certain conditions:
The serial port selected in the environment options (which can be activated from the
Tools/Settings menu) must be that for which we wish to perform the download
the serial cable must be connected both to the computer and to the controller
If the bar does not progress and an error message appears, check the connections, try to reset the
controller again and restart downloading.
To change download options, see section Environment configuration.
To the end of the downlaod it is possible to repeat the procedure for the following devices.
2.16 Use of the Debugger
The debugger allows you to check the function of a program under execution by the controller. The
debugger can be activated by a "reset" (for example right after the download of the program) or
"live" (without stopping the application). The latter operation is very useful during testing and fine-
tuning the machine control.
Using the debugger, the status of all internal (variables, timers, and parameters) and external (inputs
and outputs) entities can be monitored directly from the graphic entity used for development. The
parameter values and the statuses can be modified, as well as simulating analogical and digital
inputs, interrupting the program via conditional breakpoints, performing the jump to execution
operations for a specific calculation, or restarting from the initial condition. Entire debug sessions
can be performed while investigating malfunctions or simply to accelerate the functional test phase
for any adjustments made.
To activate the debug mode, the program must be compiled only after the Debugger protocol has
been selected on one of the controllers free serial ports. Or enabling the Enable DEBUGGERr
Option on the BUS ENABELD section: This operation is performed in the Hardware Expert during
the serial port protocol configuration phase (see the figure below).
In base al tipo di
controllore selezionato
It is also necessary to configure the serial COM port of the PC to be used to communicate with the
controller, using the following page that can be accessed from the Tools/Settings/Debugger menu:
Finally, once the PC port is connected to the port of the controller via an RS232 or RS485
connection, everything is ready for a debug session to begin. To activate it, select Debug/Start
Debugger from the menu, or the icon located on the tool bar.
The program will connect to the controller and perform the controls per design. If the check has
positive results, the Debugger started! message will appear in the output window.
At this point the values of the program entity can be viewed simply by running the mouse pointer
over the variables and waiting for the yellow prompt window to appear.
This window will only remain active fore a few seconds, to view it again you must move the mouse.
If you want to view the value of a specific entity, you can enter the Watch window using the special
menu (right key of mouse) and select Add Watch, or use the icon located on the tool bar. A
watch window will appear on top of the status window:
Up to 4 variables can be added to the Watch window. To remove them, remove each one
individually using the special menu (right mouse key) and selecting Remove Watch, or using the
icon located on the tool bar. All of the variables in the watch window can be removed at the
same time by selecting Debug/Remove All Watch from the menu.
When controlling congruency between the project on PC and that on the controller, the following
information is compared:
o Project number
o Project version
o Vendor ID
o UNI-PRO software version
o Compile date
o Number of entities in the project
o Number of tasks in the project
From these, 1, 6 and 7 must coincide otherwise the debugger will not start. When diagnosed, the
others result in a warning message but allow the debug session to be activated.
To exit from the debug phase, select Debug/Stop Debugger from the menu, or the icon located
on the tool bar.
To stop program execution, select Debug/Break from the menu, or the icon located on the tool
bar. The program stops while executing an entity, and the index for the entity is indicated in the
status bar: This corresponds to the task required for calculation, as listed in the
Call List:
In the sample shown, program execution
stopped at the calculation of the
DIGITALOUT1entity, corresponding to
task number 4.
Alternatively, the program can be restarted in a continuative manner using the Debug/Run
command or the icon located on the tool bar. In this case, the program will continue execution
starting from the point where it was stopped.
If you want to restart the program from the beginning, it is necessary to perform a controller reset
using the Debug/Reset command or the icon located on the tool bar. Thereafter it can be
restarted with the Run command. The reset operation zeroes all of the internal variables,
timers/counters, in exactly the same manner as a reset after a power outage.
It is possible to set the value of the entity selected, both when the program is running and when it is
not, using the Debug/Set Value or the icon located on the tool bar. A window will appear
where a new value can be set and to confirm it in writing.
The values of the analogical and digital input values can also be set. In this case, the input, once set,
will move into the "Input Simulation" mode and will not accept any values that are sent from the
controller's conversion driver. This situation will be maintained until you exit the debugger mode.
When a breakpoint is set, a window will appear on top of the status window:
Up to 4 breakpoint conditions can be set, which will appear in this window. The Condition, Value,
and Enable properties can be modified in this window. To remove a breakpoint, remove each one
individually using the special menu (right mouse key) and selecting Remove Breakpoint, or using
the icon located on the tool bar. All of the breakpoints can be removed at the same time by
selecting Debug/Remove All Breakpoints from the menu.
A conditional breakpoint can also be set for the occurrence of a specific event, such as the press of a
button or the arrival of a command. In this case, the Value field assumes the following meaning:
Value = 0 No event
Value = 1 Button pressed or command intercepted
NOTE: In the event that the output of an algorithm or a library has more than one branch, such as
the previous example of library LE_1, the development system will perform the intermediate
calculation for this output. Consequently, during the debug phase a breakpoint can be set for this ;or
it can be viewed using the mouse or in the watch window, exactly as if it were a "hidden" variable.
However, it is not possible to perform a Set Value on it.
2.16.1 Present value in debug
While debugging a project, under the calculated entity, the present value that the entity assumes
during the operating cycle appears. This makes the entire sequence of the values that change while
running the program visible at all times.
The colour of the label can be changed with the DEBUG value, using the Settings window, in the
Debugger tab.
3 BASIC ELEMENTS
3.1 Data types
The data types allowed in the development environment may be divided into two categories:
simple
structured.
The former are composed of a single value that can be directly used in the algorithms for processing
purposes, while the latter are composed of several fields because they contain several pieces of
information. For example, data type CJ_ANALOG contains two pieces of information: sensor
value and sensor error code.
CJ_VOID, a newly created data type introduced by the UNI-PRO development system, belongs to
the simple data category.
Minus
Data type Repr. Min. Max. Corr. ANSI C
sign
CJ_BIT NO 1 bit 0 1
All operations allowed by the ANSI C language may be performed on the above data types.
The new data types (CJ_VOID, CJ_LED, CJ_BUZZ, CJ_DATE, CJ_TIME, CJ_DATETIME)
created by the UNI-PRO environment need to be discussed individually.
CJ_VOID
The CJ_VOID data type is an innovative concept created by the UNI-PRO development
environment that allows dramatic development time savings while at the same time providing a
high level of flexibility.
Thanks to this new concept, you can define the data type of a generic object (such as a Var or the
inputs of an algorithm) just by joining it to an object whose data type has already been set.
For example, if you add a variable to a project, it will be set to CJ_VOID by default. By joining this
variable to a digital input (defined as CJ_BIT by default), the data type of the variable will be
automatically set to CJ_BIT.
CJ_DATE
The CJ_DATE data type has been implemented to perform operations on dates; it represents the
number of seconds elapsed since midnight, 1 January, 2000, and it can represent dates up to the year
2068. Using this data type may prove useful, for instance, if you want to control operations based
on certain fixed dates.
If you decide to use this data type in an algorithm, you might find it easier to use the
CJ_DATE_STRUCT structure.
CJ_TIME
The CJ_TIME data type has been implemented to perform operations on times; for instance, it can
prove particularly useful to manage different controller time ranges and in multiple other cases. It
represents the number of seconds elapsed since the beginning of the day (00.00) and it can be easily
converted into the structure CJ_TIME_STRUCT through the conversion function especially
provided.
CJ_DATETIME
The CJ_DATETIME data type has been implemented for all those cases where you may need to
process times and dates together; it represents the number of seconds elapsed since midnight, 1
January, 2000, and it can represent dates up to the year 2068.
This data type may be used directly in the algorithms; otherwise, you can convert it into the
structure CJ_DATETIME_STRUCT through the library functions (see the section on
CJ_DATETIME_STRUCT), which should make your work easier.
3.1.2 Structured data types
Structured data types capable of holding multiple pieces of information have been implemented in
the UNI-PRO development environment. They are actually C structures composed of n fields, that
may be accessed using the usual C syntax:
structure.fieldname
CJ_ANALOG
The CJ_ANALOG data type represents the state of an analog input. The structure is composed of
two fields:
Error a byte type representing an error code. If this field equals zero, there are no sensor
errors; otherwise, it will take the following values:
• 1 : short-circuited sensor.
• 2 : open or missing sensor.
Value, a short data type representing the value read by the sensor
Some defines of project can be associated to the value field (using the algorithms) in order to
manipulate the type of data CJ_ANALOG:
CJ_AI_DISABLED: value who define the sensor disabling status. Setting Value at this value, the
sensor results to be disabled and the EIML pages visualization becomes dots “…”.It is useful if
want to condition the sensor action to a possible enabling parameter.
CJ_CMD
The CJ_CMD data type is a structure associated with the arrival of a command. It is composed of
the following fields:
Valid a boolean data type representing that a command has been notified. If this property is
TRUE, it means that the command has been received and the desired action can therefore be
carried out; otherwise, no command has been received.
Node a byte type indicating the logical node of the controller that sent the command.
Param a short type representing the parameter of the command.
CJ_BTN
The CJ_BTN data type is a structure associated with an action performed on a button: pressing,
holding down or releasing.
It is composed of the following fields:
Valid a boolean data type representing that an action has been performed on the button (i.e.
it has been pressed, released, or held down). If it is TRUE, it means that the action indicated
in the Btn object has been notified, otherwise the action has not taken place.
Node a byte data type indicating the logical node where the action on the button has been
verified
Param a short data type indicating the number of seconds the button has been held down.
CJ_DATE_STRUCT
The CJ_DATE_STRUCT data type can prove very useful to perform operations on dates. Starting
from the unstructured data type CJ_DATE, you can fill in the CJ_DATE_STRUCT structure with
the help of the conversion function provided to that end.
It is composed of the following fields:
where Value parameter is a date encoded with second starting from midnight of the year 2000.
To convert the structure back to CJ_DATE type use the StructToDate() function, that has the
following C syntax:
CJ_TIME_STRUCT
The CJ_TIME_STRUCT data type can prove very useful to perform operations on times, for
example to manage different time ranges. Starting from the unstructured data type CJ_TIME, you
can fill in the CJ_TIME_STRUCT structure with the help of the conversion function provided to
that end.
It is composed of the following fields:
where Value parameter is a time encoded with second starting from the midnight of the same day.
To convert the structure back to CJ_TIME type use the StructToTime() function, that has the
following C syntax:
CJ_TIME StructToTime(CJ_TIME_STRUCT time);
CJ_DATE_TIME_STRUCT
The CJ_DATETIME_STRUCT data type is used to convert the CJ_DATETIME data type (which
represents a date/time coded in seconds) into a more user-friendly format.
This structure is usually filled in by the conversion function DateTimeToStruct() that has the
following C syntax:
where Value parameter is a date-time encoded with second starting from midnight of the year 2000.
Here is a brief description of its fields:
To convert the structure back to a CJ_DATETIME data type, use the StructToDateTime function
that has the following C syntax:
CJ_DATETIME
CJ_ANALOG
CJ_DWORD
CJ_S_BYTE
CJ_SHORT
CJ_WORD
CJ_LONG
CJ_CHAR
CJ_DATE
CJ_BYTE
CJ_BUZZ
CJ_TIME
CJ_VOID
CJ_CMD
CJ_LED
CJ_BTN
CJ_BIT
CJ_VOID X X X X X X X X X X X X X X X X
CJ_BIT X X X X X X X X X X
CJ_BYTE
X X X X X X
CJ_CHAR
CJ_S_BYTE X X X X X X
CJ_LED X X X X X X X X
CJ_BUZZ X X
CJ_WORD X X X X
CJ_SHORT X X X X
CJ_ANALOG X X
CJ_DWORD X X
CJ_LONG X X X X X
CJ_DATE X X X X X
CJ_TIME X X X X X
CJ_DATETIME X X X X X
CJ_CMD X X
CJ_BTN X X
This data type compatibility check is carried out only at the time when the link is made. Therefore,
if you make any changes to the type of inputs or outputs after that, they won't be noticed and could
consequently lead to inconsistencies in the operation of the program.
Two entity with array property greater than one are compatible one another only for the two
following conditions:
3. if both the entities has the same array size (same array property value)
4. if the entities are of the same data type, with the exception :
a. when start entity data type is CJ_BIT and linked entity data type is CJ_S_BYTE
b. when start entity data type is CJ_BIT and linked entity data type is CJ_BYTE
In all other cases, entities are incompatible.
3.3 Firmware library functions to be used in the algorithms
3.3.1 CJ_DATETIME StructToDateTime(CJ_DATETIME_STRUCT rtc)
This function converts a data structure CJ_DATETIME_STRUCT rtc to a number that is encoded
with second starting from midnight of the year 2000, that is a CJ_DATETIME type.
CJ_FlagWrite (10, 1)
set the status of tenth semaphore as busy, therefore the resources managed from this semaphore will
be accessible only by the entity that have set the status.
A busy semaphore can is freed only from the same entity that have set its status.
Function call:
CJ_FlagWrite (10, 0)
set the status of tenth semaphore as free, therefore the resources is free and usable.
The status of a semaphore is controllable using the follow function:
that avails to ask the status of the i-th semaphore. It returns ‘1’ if semaphore is busy, otherwise it
returns ‘0’. If the semaphore is busy isn’t possible to use the controlled resources until the resources
will be freed.
3.4.1 Software
The Software section groups all the objects that allow you to define the machine's "behavior".
The most important element is, no doubt, the algorithm, which allows you to process input data as
required with the purpose of returning an output value. This section also discusses Subsheets, Fixs,
Pars, Pers, Vars, Timers, Command Ins and Command Outs.
Algorithm
Generic algorithms are the basic elements in a project, because they allow you to define functions
using the C language. Each algorithm corresponds to a C function and that's why it can have a
variable number of inputs with different data types, but only one output. Each algorithm belongs to
a category. This concept is similar to the concept of class in object-programming, and it is useful to
optimize resources, because you won't need to duplicate the code of an algorithm if you use it
several times.
When you add an algorithm to a project, the environment will immediately prompt you to define its
category which will, in turn, automatically set its name. By default, it has a CJ_VOID output and no
inputs. You can add the required number of inputs by choosing Add Input from the pop-up menu.
At the beginning, their data type will be CJ_VOID and, once they are linked, they will be
automatically set to the right data type.
Global Algorithm
A global algorithm is a special algorithm it is possible to use in the code of the other algorithms; it
is as a project function that can be joined in other parts of the code. The advantage coming from the
use global algorithms is the fact they can be used from any other algorithm in the project; it means
they can be used more times without writing code again, or without adding new ones. To add a
global algorithm one can select the flag “Global Algorithm” in the CodeEditor or selecting the same
option inserting a new algorithm.
A global algorithm must respect some rules:
• the name of the category must be in “C” format
• a global algorithm must not be a category algorithm; in other words it is not possible to have
global which category is already used
• the terminals of the global algorithms must not be joined
• a global algorithm can be transformed in a generic one
• a global algorithm can be transformed in a global one on condition that it respects the
previous rules.
all the global algorithms used in the project can be found through the prompt “Find” or the
CodeEditor through the functions list (Ctrl+Space).
Subsheet
Subsheet objects allow you to logically group a series of entities, thus dividing the project into
functional blocks.
Subsheets may contain all types of entities, including subsheets themselves, which allows you to
organize your project into a multi-level structure. To join entities contained in the same subsheet,
the usual procedure may be applied. To join internal and external entities, you will need to export
the relevant inputs/outputs. Exported inputs/outputs will be displayed in a different color (black by
default).
You may either add an empty subsheet to a project or select which entities to group first and then
use the Create Subsheet command.
Subsheets are the basis for creating templates and libraries (see chapter Creating Libraries).
Fix
In most projects, it is necessary to define constants; you can do this using the Fixs. They represent a
flash memory area where you can define a constant value (thus without affecting the amount of
RAM memory taken up by the project) that can be used in your project.
For each project the maximum use number of FIX is 1023.
Fix objects have the following properties:
Par
Par objects represent the parameters of the application software that allow you to change the
machine's behavior during its operation. Parameters are stored in the E2 memory, so that all set
values are maintained even after the machine is switched off and back on; through parameters you
can save and keep congruent the values in the memory.
For each project the maximum use number of PAR is 2047.
They have the following properties:
Pers
Pers objects represent all the states that are persistent, i.e. all those values that you may want to
maintain, even after the machine has been reset (for example, compressor run-time or lighting
status). Pers objects store status, working hours, ecc …
For each project the maximum use number of PERS is 1535.
They have the following properties:
Timer
Timers are counters that are automatically increased/decreased by the system, under a time base.
They have inputs on which we can act to reset and load the value and to enable or cancel the count,
and one output that gives back the value of the counter. The only input always present is the reset
one, while the enable, clear and reload inputs can be activated trough the context menu:
If the Enable input equals zero, timer count will stop, while if it equals 1, timer count will be
enabled. The Reset input senses the transition from 0 to 1 to reload timer count. The Clear input
realizes the transition from 0 to 1 to delete the current countdown. Connecting a parameter to the
reload input means loading the timer count with the parameter value, instead of a default value
(look at Max property).
You may conveniently set its properties to decide how often this counter should be changed and
whether it should be increased or decreased.
Using these objects you can provide compressor short-cycle protection or timed lighting.
For each project the maximum use number of TIMER is 255.
Command In
The UNI-PRO environment allows you to specify generic, user-definable commands that will
trigger certain actions. Command In objects indicate the reception of these commands and trigger
whatever action may be linked to them. All objects of this type have an output that returns the
parameter value of the command received and the node that sent it.
For each project the maximum use number of COMMAND IN is 255.
They have the following properties:
3.4.2 Hardware
The hardware section includes all those entities that represent a physical I/O. The number and type
of hardware entities needed in a project will depend on the type of controller and the number of
connected expansions. Therefore, you can proceed in two different ways: add all the required
entities to the project and then choose the most suitable hardware accordingly, or choose the
hardware on which you have decided to develop your project first, and then add the required
entities.
This category includes:
Digital Inputs
Digital Outputs
Analog Inputs
Analog Outputs
Buttons
LEDs
Buzzers
Clocks
Each entity in this section has to be joined to a physical resource (I/O, rtc, LED, etc.) by means of
the Join Tools.
To each of these categories the maximum use number of entities for each project is 255.
Digital Input
Digital Input objects represent the digital inputs on the controller or the expansions, if any, and have
the following properties:
Digital Ouput
Digital Out objects represent a digital output on the controller or the expansions, if any, and have
the following properties:
To add a Digital Output to a sheet, proceed as you would to add a Digital Input.
Analog Input
Analog Input objects are the abstract representation of any type of analog terminal. In fact, they can
represent a physical input of the following types: NTC, PTC, 0-5 Volt, 0-10 Volt, 0-20 mA,
4-20mA, PT1000, TEMPERATURE, HUMIDITY. This means that this type of element may be
used to read a probe or a generic temperature, pressure, or position sensor.
An Analog Input is characterized by a CJ_ANALOG output pin and the following properties:
To read the state of an analog input added to a project, just join its output pin to the input of an Algo
or a Var. As discussed earlier, CJ_ANALOG is a structured data type that contains several pieces
of information: an Error field that indicates a possible error, and a Value field that shows its value.
Note. The sensor type 0-10 Volt and 0-5 Volt probe not detect the presence of broken or not
connected probe, compared with the correct measurement of the value 0.
Analog Output
Analog outputs are the logical representation of a current analog output (0-20 mA) or a voltage
analog output (0-10 V). These object types have a CJ_WORD input pin that expresses a percentage
that can take values ranging from 0 to 100.00, and has the following properties:
Button
Button elements represent an action on a button, because a button can generate the following
events:
press
hold down
release
That's why there may be up to three different Button objects referring to the same button, each one
of which will capture a different event.
To choose the event you wish to analyze, set the Cmd property.
Led
LED objects are the logical representation of the LEDs found on the controller you are
programming or on the expansions connected to it. This object type has a CJ_LED input pin and its
value range is 0-3. By conveniently setting this value, you can change the behavior of the selected
LED as follows:
0 : off
1 : on
2 : slow frequency flash
3 : fast frequency flash
(Refer to section Data types).
LEDs can be used to notify to the user with information that you want to make always visible, such
as a compressor status or a door open condition.
These objects have the following properties:
Buzzer
Buzzer objects are extremely useful in all those situations that require an audible alarm to be
sounded. For example, it could prove very convenient to enable a buzzer to warn about a potentially
hazardous condition or in an emergency situation.
To do so, just add a Buzzer object to your project and join it to an algorithm having a CJ_BUZZ
output.
Depending on the buzzer's input value, its state will be set to the following modes:
0 : off
1 : on
2 : slow frequency beep
3 : fast frequency beep
(Refer to section Data types).
Clock
Clock objects are the logical representation of the Real Time Clocks built in the controllers and
expansions.
Through these objects you may get the current date and time, thus permitting all those operations
that are somehow linked to the clock. For example, you may wish to program different controller
behaviors depending on the time range in which it is operating.
Clock objects return a CJ_DATETIME value that you can easily convert into the
CJ_DATETIME_STRUCT structure, to perform more complex operations (please refer to section
Data types - CJ_DATETIME_STRUCT).
Top Sets the position where the element will be drawn, relative
to the top edge of the sheet.
Category It is set to Clock and cannot be changed.
Description Text-type description field where you can type in your
own notes.
Height Vertical size in pixels of the icon that represents the entity.
To change it, you can either use the properties table or
graphically resize the entity using your mouse pointer.
Left Sets the position where the element will be drawn, relative
to the left edge of the sheet.
Name Unique name that identifies the element inside a project.
Rics Field to insert useful information to VTP driver generation
required for the communication with EVCO supervision
software R.I.C.S. and EVCO parameters management
software Params Manager.
Type Indicates data type, which for Clock objects is obviously
set to CJ_DATETIME and cannot be changed.
Width Horizontal size in pixels of the icon that represents the
entity. To change it, you can either use the properties table
or graphically resize the entity using your mouse pointer.
3.4.3 Libraries
The tree view libraries collects all the environment and users libraries with a structure that allows to
organize the collection at most in two levels. The first level is the group's library, while the second
level is the category, in the categories are listed the libraries.
Libraries
of Counters Categories
Groups of Standard
category
group
Categories
of System
group
Standard and System groups are the two default groups of the UNI-PRO libraries, you can add other
groups and extends it with new categories creating new libraries.
3.5.1 Toolbar
The EIML toolbar lists the elements that you can add to the page: Texts, Variables, Icons, Strings,
Combos, Tables, Lines, Rectangles.
The first position in the toolbar is occupied by an icon representing an arrow, which allows you to
select, resize and act on the elements found in the page.
To add a new element (text, variable, icon, etc.), select the desired element in the toolbar and draw
the area where you wish to place it.
Navigation bar It sets the showing of the navigation bar at the bottom of
(only color pages) the page, with these values:
- NO: Never visible
- ALWAYS: Always vivible
- ON TOUCH: Disappearing
3.5.4 Multilanguage pages
If the Multilanguage property for the EIML page is selected, this page can be created in several
languages; thanks to this features one has not to add a new page (having the same Id) for each
language one wants to use.
This features also allows being quicker in creating and in maintaining projects with user interfaces
in several languages. A multilanguage page is shown as follows:
At the top of the page there is the list of the languages for which a text (at least) has been inserted;
at the bottom, in addition to the information about the occupation of the page, there is the possibility
to set the page preview for the language one has chosen.
If you modify the language, it will be possible to show the visual effect of the inserted texts, to
verify if some text has not been inserted (or it is longer than the allowed space).
Example: if for the text “Hello” one has inserted the Italian translation “Ciao”, modifying the
language the following page will be shown as preview:
The palette of the UNI-PRO 3 colors is made of 256 not modificable colors.
3.5.6 Element properties
Each EIML element has certain properties that allow you to specify its display format and behavior.
To display and change the properties of an element, just select it, right-click and choose
"Properties" from the pop-up menu, or double-click the element itself.
A window listing all the properties of the selected element will be displayed.
If the page is multilanguage the Text property of the elements Text , text in COMBO and text
in the charts is set and shown in a different way.
To set the text in the desired languages click the button in the Property window of the element;
on afterwards a further window (where to digit the strings) is shown.
Text
The text element allows you to add descriptions, activate commands, and enable page browsing.
As described under section Basic Operations, the text element has certain properties that allow you
to graphically position it in the page ((Left, Top, Width and Height), while the remaining properties
describe its "behavior".
Color (only color pages) Color used for the text background
Align Permissible values are LEFT, CENTER, and RIGHT
which indicate left, center or right alignment
respectively.
Fontsize Describes the font size used to write text. For example,
if you use an 8x8 font size, a character will be 8 pixels
high and 8 pixels wide.
On releasing the key, a text element set to the default values will be drawn.
Now, to enter the text you wish to display, open the properties window (for example by double-
clicking the text element) and change the Text property as required. After that, you may go on
setting the remaining properties (Fontsize, Align, etc.) and the element will be displayed with a new
look:
If the page is multilanguage, to modify the Text property it is necessary to use the editing window
of the multilanguage strings.
Variable
Variable objects allow you to display and, if required, set the values of internal states, inputs,
outputs, etc.
To add a variable to a page, proceed just as you would to add a text.
The variable element may be linked to a project variable: to do this, select the Var property (set to
<NONE> by default) and click the button that appears. A window will open, where you can select
one of the project entities whose value you wish to display.
Below we will discuss the properties of variables.
Color (only color pages) Color used for the background of the variable.
Fontsize Describes the font size used to write text. For example,
if you use an 8x8 font size, a character will be 8 pixels
high and 8 pixels wide.
Font Color (only color Color used for the text font
pages)
Mode A variable may be displayed in four different modes.
NORMAL
NEGATIVE (only black and white pages)
NORMAL-BLINKING
NEGATIVE-BLINKING (only black and white
pages)
If the state is NORMAL, the variable will be displayed
in black on a white background; conversely,
NEGATIVE will display a white variable on a black
background.
If you select the "blinking" modes, the variable will also
blink in the respective modes.
Align Allows you to align the variable to the left (LEFT), at
the center (CENTER) or to the right (RIGHT).
Edit Activate this property to enable variable editing mode
and change the associated value (editing a variable
requires the focusindex property to be set to a value
different from zero).
Refresh If the Refresh property is enabled, the variable will be
continuously requested; otherwise, it will be refreshed
slowly so as to avoid overloading communication
between controllers.
Strings
String objects allow to show and set the string values, or the CJ_CHAR entities
The association of the String elements in the EIML pages to the CJ_CHAR entities is possible in
the same way of the Variables, using the tool Entity List (look at Variables).
Through the tool Entity list it is possible to set the first characters of the string from which the
showing of the same will start; to do that it is enough to select from the list the desired position of
the elements array CJ_CHAR.
The focusIndex of the element String always makes reference to the position of the first editable
characters; the other ones can be selected using the keys of the user interface.
On afterwards the properties of the String elements:
Name Univocal name identifying the element in the project.
Left Offset in pixel from the left hand side of the page
Top Offset in pixel from the top of the page
Width Width of the element
Height Height in pixel of the element
Focusindex Specifying property focusindex it is possible to set with
the cursor the order in the selection. The allowed range
is from 0 to 255. In particular, setting to this property
value 0, the element will never be selected from the
cursor (otherwise the value will indicate the number of
moves of the cursor after which it will be selected; for
the experts in Windows this is the same concept of
TabIndex of the controls).
Var This property allows to join a project entity (for
example Var, Par, Pers, Fix) on condition it is a
CJ_CHAR one.
Selecting the property and clicking the button, a box
will open; the box allows selecting one of the project
entities which value you want to be displayed.
Chars It represents the number of characters the string is made
of.
ViewChars It sets the number of characters that will be displayed
from the character at the beginning of the string.
Color (only color pages) Color used for the background of the string.
Fontsize The fontsize sets the size of the font the text will be
written. For example, using 8x8, a character will be
eight pixel high and eight pixel wide.
In the color pages the icons are shown using the color palette UNI-PRO; then if the bitmap to load
is not made of the 256 colors of the palette, it will be necessary to wait some seconds the image is
converted. The shown icon could be different from the original.
Note(*). When the Var property is set, the Mode is aligned with that property, whatever is the
Mode property.
Combo
Combo objects are an innovative way to represent the information contents of an entity. Through
these objects you may link a text or an icon to each value taken by an entity, thus providing a
flexible and user-friendly way of displaying the entity's content.
Unlike variables, combo objects lack the following properties: Mode, Decimals and HideDecimals.
In addition, only CJ_BIT or CJ_BYTE type entities can be joined to them.
The distinctive feature of Combo objects is the Combo Wizard, which allows you to display and
edit the elements you wish to link to the values of the entities.
We will now add a Combo object to our page and open the properties window:
To join a Combo to an entity, select the Var property (set to <NONE> by default), then click the
button that will appear to the right and select the desired variable from the Entity List.
Right-click on the Combo element and choose Combo Wizard from the pop-up menu. The
following window will appear:
To link texts or icons to the values of the joined entity, select the type of object you want to add
from the drop-down menu (Text/Icon) and assign a name to it, then click Add. The elements will be
added to the list below in the order they were entered. The first element will be displayed when the
linked entity takes value zero, the second when it takes value one, and so on.
To change the sequence, select the element you wish to move and press the Move Up or Move
Down button as required.
Once you have added all the elements, you may proceed to their configuration: to display the
properties of an element, select it from the list and press Properties. To find out the meaning, refer
to the properties of Texts and Icons.
If the page is multilanguage to modify the Text property of the text elements it is necessary to use
the multilanguage editing strings window. In this case the preview can be shown only through the
EIML Simulator.
To see an example on how to use Combo objects, refer to the Icon sample included in the Samples
folder.
Table
Tables are an additional innovative object type designed to help you develop graphical interfaces
and characterized by being scrollable.
Therefore, using tables you will be able to display large amounts of data without needing to load
more than one page.
If we add a table to a page, we will be able to display its properties:
Borders Colors (only color Colors of the lines of the edges of the table.
pages)
To add objects to a table, use the Table Wizard Extended (right-click the element and then choose
Table Wizard Extended).
For each column you may set column title, width, header and alignment selecting Column Property,
or to change the column position with Move Column Left and Move Column Right.
If the page is multilanguage to modify the Text property of the text elements it is necessary to use
the multilanguage editing strings window. In this case the preview can be shown only through the
EIML Simulator.
To insert the required elements to each column it is necessary to select it from the list on the bottom
and use your mouse to drag it to the desired position in column:
Using the positioning buttons on the right-bottom size it is possible to move the selected item into
the table: to move it among rows and columns you have to click the corresponding arrows, instead
to delete it you have to click on the X in the middle. To change the properties of an element, select
it and select Property from the contextual menu, or double-click on the focused element.
From the contextual menu (right-click on the selected item) it is possible to copy it or view its
properties, for example it is possible to link a variable or a combo to a project entity. If you have
added a Combo to the list, after setting its properties you will need to show the Combo Wizard to
choose which elements you wish to link to it.
Some of these operations may be realized by key shortcuts. The following table summarizes the
actions associated to the key shortcuts:
Key Action
Ctrl+Up, Ctrl+Down, Ctrl+Left, Ctrl+Right Move the selected item into the table.
Ctrl+C, Ctrl+Ins Copy the selected item.
Ctrl+X Cut the selected item.
Ctrl+V, Shift+Ins Paste the selected item.
Canc Delete the selected item.
Enter, F11 Show the properties of the selected item.
Insert into the column a text, a variable, a
Ctrl+1, Ctrl+2, Ctrl+3, Ctrl+4
combo or an icon respectively.
Line
To make an EIML page more graphically attractive, you may also add lines to it by pressing .
A line has the following properties:
Rectangle
To make an EIML page more graphically attractive, you may also add rectangles to it by pressing
. A rectangle has the following properties:
By convention, values are reserved as follows: from 1 to 50 for system commands (pink), from 51
to 150 for environment commands (violet) and from 151 to 250 for project commands (yellow).
The structure of a command is composed of three fields:
COMMAND: indicates the numeric value of the command. A name is linked to each
command, which is pre-set for system commands, valid for all projects for environment
commands (51 to 150), and project-specific for project commands (151 to 250).
PARAMETER: is a 16-bit value linked to the command. Depending on the command, it
may be seen as a single field or as the combination of several fields.
NODE: is the value of the network element sending (or receiving) the command. This value
is assigned by means of the corresponding join window.
To send a command from an EIML page, place the cursor over an element (text or icon) that has a
Command property different from zero and press ENTER.
A command embedded in a sheet will be activated when the trigger input goes from zero to one.
For example, let us suppose that the controller has the following password set-up page:
If the display, which starts from an authorization level equal to 0, requests a Level=2 page, the
controller will prompt the user to enter a password.
If the password entered is 1111, the user will be prompted to enter it again because the new level (1)
is still lower than the requested one (2). If the password entered is 3333, the requested page will be
sent to the user, who will have free access to all pages having a level equal to or lower than 3.
If no keys are pressed on the keypad during a pre-set period of time (system parameter, default 60
seconds), the authorization level will be reset.
4.4 Defining execution tasks
All calculation operations defined through links of entities can be executed in three different tasks.
Usually the greater part of operations are executed in the Main Task. Where it is necessary to
calculate some critical operations it they can be executed in the high priority tasks Timed100ms,
which execute under interrupts every 100 ms.
To notice that these last two tasks must be used only when it is absolutely necessary and their
overload can introduce execution errors.
In this case, we want output Y to be calculated by the algorithm using input Y_1 (which represents
the previous output) before the input is updated! To assign a specific order to the execution of this
part of the program, we need to set the right sequence to the values of the Order property of all the
involved variables. In the example above, the right operation will be ensured if the Order property
of Y is higher than (or equal to) that of X, but lower than that of Y_1. Therefore, a possible
combination is:
Order X = 0
Order Y = 1
Order Y_1 = 2
This means that, when executing the program, variable X will be calculated first, then Y and finally
Y_1.
The entities affecting the program's execution order are all those that have the property Order, i.e.:
Alg., Var, Par, Pers, DigitalOut, AnalogOut, LED, Buzzer, and CommandOut.
Operating on the property Offset on a subsheet, it is possible to move the execution order for all the
entities it contains.
The OFFSET properties under the Sheet and libraries can be displayed.
Or
2) From Settings
4.5.1 Calls List
To view the ordered list with which portions of the program are calculated, the Tools / Calls List
menu can be activated. As can be observed in the window below
The calls are subdivided into three sections (one per task) and will be displayed in the order in
which they will be executed. By double clicking on any of these rows, the entity will be searched in
the project and viewed.
From the contextual menu (right-click on the selected item) it is possible to view and modify the
selected entity properties. Modifying Order property it’s possible change the tasks execution order
and re-calculate “on fly” the new program's execution order by clicking on Refresh or by the
contextual menu.
Selecting Filter By Sheet and the interested Sheet is possible to view only the entities of a particular
sheet to have a most accurate view of that you want to control .
To select the desired sheet you can select it from the combo also clicking on the row’s table that is
referred at this one.
Anyway is possible to return at the general view selecting Show All Entities and clicking on Refresh
button or selecting Show All Entities from the contextual menu.
Using Save button you can save the selected table into an HTML file document.
4.5.2 Execution order during the calls list added
When the Calls List is active you can see the execution order under that calculated entity; that is if
and when it is used. It is helpful for understanding the correct main cycle of the program.
In this case it is immediate understood that the variable is calculated right after the algorithm.
4.6 Sorting internal variables
In order to access the controller's internal variables through one of the available communication
protocols, you need to define which variables you want to "export" (i.e. make visible outside) and
sort them according to a criterion capable of maintaining the same sorting order even in the event
that changes are subsequently made to the program.
To decide which variables to export and define their sorting order, you may use the following
window (choose Tools/Export Entities… from the menu to open it):
On the left side there is a list of all project variables, while on the right side there are two additional
lists that can be selected by clicking the corresponding tabs: Digital Vars and Register Vars. To
make search easier, use the combo found at the top left corner of the window to filter the list by
type.
To add a variable to the list, select it from the list on the left and use your mouse to drag it to the
desired position in the list on the right.
As a result of this operation, the name of the variable will disappear from the list on the left and will
appear in the list on the right, at the position indicated in the ID column.
Using this drag and drop method you can move the elements to the list of exported variables or
bring them back to the list of variables that have not been exported yet.
The column BMS indicates if the exported entity is used (X) or not in the BMS protocol. To export,
select the entities and press F3; to unselect the exportation from the BMS select and press F4.
As alternative it is possible to use the contextual menu.
Using the contextual menu it is also possible to select and move a block
of entities from a position to another one, without making the exportation
again. Once the entities have been selected, choose “Select” from the
contextual menu, to open it again from the new position, then “Move
Here”. In this way the entitied will be placed in the new position.
Depending on the list, only certain types of variables may be exported, as summarized in the tables
below:
Digital Vars
Entity Data type
Digital In
Digital Out
Par only CJ_BIT
Pers only CJ_BIT
Var only CJ_BIT
Fixs only CJ_BIT
Register Vars
Entity Data type
Analog In CJ_ANALOG: only the value
Analog Out
Clock
Timer
Par All
Pers All
Var All
Fixs All
NOTE: 32-bit data types (CJ_LONG, CJ_DWORD, CJ_DATETIME, CJ_DATE and CJ_TIME)
take up two rows in the Register Vars list: the low 16 bits are in the first row and the high 16 bits in
the second one.
If in the Settings option “Export Packed CJ_CHAR” is selected, the types CJ_CHAR are exported
in Modbus by groups (made of two elements) for each register.
In the alphanumeric 4x20 display and in the graphic 240x128 display all the entities hide for
conditioned visibility will be substitute with some points “….” and will not be editable.
In the 7-segment display the hide entities will be excluded from the visualization.
A function call as CJ_SetCondVisBit(idx, 1) made the entity at the idx address always hide.
A function call as CJ_SetCondVisBit(idx, 0) made the entity at the idx address always visible.
4.7.2 Example
With a simple example let’s show the steps to follow to correctly use the conditioned visibility. Will
suppose to want to condition the visibility of two variables, StatusA and StautsB with a CJ_BIT
parameter P001.
As first step are required to select the condvisible property of both entities.
Now it’s possible to write the algorithm to rule if display or hide the two variables. In the example
we want to:
⋅ with P001=0: the StatusA is visible (with ON value), and the StatusB is hide
⋅ with P001=1: the StatusA is hide, and the StatusB is visible (with ON value)
Same result we have as re-write the algorithm as a condition for the function value parameter:
The user interface effect on 4x20 (V-View) or on 240x128 (V-Graph) are the following:
The 7-segments display user interface effect are the following, the row with the StatusA or StatusB
hidden will not be displayed in the table:
This window lists the names of the various graphic objects embedded in the page, in the order in
which they will be processed when the page is displayed on a user interface. Select one or more
objects and drag them with the mouse to change the order in which they will appear. Otherwise, you
may use the Move Up and Move Down buttons to move the element up or down the list.
A very helpful utility function is the AutoSort function, that sorts the elements automatically
depending on on their position in the page. They will be sorted starting from the element positioned
on the top left side of the page and finishing with the element on the bottom right side.
4.10 Project settings
In addition to general data, such as name, author, creation date, project and version number, each
project contains a certain number of settings that characterize the way it operates, such as serial
protocols, availability of an Event Historian, and “defines” used in algorithms. To access these
settings, choose Project/Property… from the menu or click and open the project properties
window.
In the window there is the user’s Vendor ID that is read-only, instead the modifiable information are
the following:
Project Variation: Project variation. When two projects are equals but they are
different for the EIML pages language or for the hardware
could not be necessary singularize they with different number
or version. It could be useful singularize they only with a
variation so the projects target data will be the same.
All the values shown in read only modality are obtained from the selected hardware and are
required for its identification during the program download.
The protection through password is necessary to protect the application in order to download
it only in particolar hardwares that have been previously programmed with the same
password.
To program one or more hardwares in order that they accept application softwares only with
that password, it is necessary to make two programmations at least, following this
procedure:
• First programmation. Set Enable Protection=NO and digit the Password you
want. Compile and make the download in the controller.
• Second and following programmatins. Set Enable Protection=SI and digit the
Password you want. Compile and make the download in the controller. From this
moment the controller will accept to be programmed only with application
softwares containing that password (in the example, 56).
To make the controller free of the protection and make always the download, keep not
selected (Enable Protection=NO).
4.10.3 Historian
In the Historian window, you can enable and configure the event&alarm recording functions
available in certain UNI-PRO controllers.
Enabling this function will cause the Historian Library to be linked to the controller's functions. If
you do not wish to implement the event logging function, leave the Enable Historian check box
unchecked.
If you do check it, then you will need to set the maximum number of events to be recorded in the
memory in the Events Number field. The Event Historian queue is FIFO (First In First Out). For
example, if you enter 30, the 30 most recent events will be stored in the controller's memory, and
when that number is exceeded the oldest events will be overwritten.
Enabling the “Enable History Value” property is possible also store a value associated to the event
of historical.
The following information is stored in the Event Historian:
To add an event to the historian, use the HistoryWriteEvent system library, to read an event from
the historian use the HistoryReadEvent library (refer to document UNI-PRO: Standard Libraries).
4.10.4 Project defines
The project defines window allows you to define constants and assign values to them so that you
can use them several times in the algorithms that make up your project.
To add a define, type a unique name in the left box under the list and press Add. Doing so will cause
the define to be added to the list. If you wish to assign a certain value to it, type it in the right box
under the list.
To change a define, select it from the list, change it as required, and then press Replace to confirm.
To delete it, press Delete.
4.10.5 Structs
In the window about the project structs, it is possible to decide the structures, in order to use them
many times in the project into the algorithms. Each Struct must have an univocal name.
In the box on the right there is the “C” version of the structure.
Action “Export”, allows creating a file with all the structures that have been created for the project.
Action “Import”, allows importing a file containing others exported structures (through action
“Export”) from another project. Possible structures having an existing name will not be imported.
Action “+” and “Modify” allow respectively to add and modify the structs, operating on the
following window.
In the window it is possible to modify the name of the Struct, replace, add and cancel some
structure fields. It is necessary each field ha san univocal name in the structure.
4.10.6 Options
Using the optimization window located in the project options, it is possible to define some
parameters to optimize the program execution. Only expert users are advised to modify these
options.
Loops Number : Using this configuration it is possible to specify the number of actions
calculated in a group. For very large projects, by increasing this
number it is possible to speed up the main program.
Watchdog time on Watchdog time (*) for the projects compiled in Release (without
Release: Debugger protocol)
Watchdog time on Watchdog time (*) for the project compiled in Debug (with Debugger
Debug: protocol)
Optimizations Level: Optimization level of the compiler.
Force upload Forces the rewriting of the parameters in E2 during the initial
parameters : execution after downloading.
Clear Cache: It cancels the compiling cache of the projects
E2 Copy : The flag Enable E2 Copy allows you to enable or inhibit the copying
of the configuration and application parameters to E2 memory using
system commands.
(*) Watchdog time = time required for the algorithms to complete the execution of the code; when
the time elapses, the controller makes a hardware reset. This is a safety system to avoid endless
loops or very long elaborations which would jeopardize the proper operation of the controller.
Clicking with the right mouse button on the window it is possible to view the corresponding menu
that, in addition to the classic Cut/Copy/Paste actions, allows:
printing of the Change Log's contents
adding, in the current cursor position, a new note (a few rows with headings containing the
date, and the current project version are also added).
Default COM port : Serial port used for downloading operations. If the connected
controllers are c-pro 3 micrio/kilo the COM porti s
automatically recognized and the value you have set is ignored
Reset Driver Parameters: It forces the restoring of the parameters about the driver of the
controller after the download of the application software.
Full download : Forces the full downloading of the entire executable file. To
speed up the downloading options, it is possible to unselect this
option and, after having correctly deleted the flash memory
present in the microcontroller, proceed to download only the
flash memory used.
Background download: Allows to operate on the project during the download phase.
Show Report After Download: Ifi t is selected, after each download in the controllers c-pro 3
micro/kilo a report file will be shown.
Language: It modifies the language of the development environment. It is
necessary to run UNI-PRO again to apply the modification.
Default projects directory : Default directory prompted for saving project files.
Backup directory : Directory used to backup the project files (refer to the Project
backup paragraph).
Auto increment revision when By activating this option, each time that backup operations are
backup project’s files : performed on project files, the revision number will
automatically increased, otherwise the user will have to
perform this operation.
Ask confirm when delete Activates or deactivates the request to confirm the erasing of
elements : entities and the EIML components.
Preferred zoom : Allows the specification of the zoom to be applied upon
loading the project. Afterwards the zoom level can be changed
easily using the shortcut menu located in the toolbar.
Check EIML link : Checks that all the elements which can be linked with the
entities present in the graphic interface section are properly
connected. Check this during the graphic interface simulation
phase.
Sort EIML Page for ID: When enabled, it causes the EIML pages to be sorted according
to the Id properties; otherwise they will be displayed in
alphabetical order.
Export Packed CJ_CHAR: If it is enabled, the Modbus exportation of the string type (tipo
CJ_CHAR) is done by groups (made of 2 Byte for each
register).
View Entity Offset: If enabled, allow to display the offset property below the entity.
Path Compiler_1: Specify the complete path where are located the source codes
of Compiler_1 for projects compilation.
Enable cache: It enables the use of the compiling Cache.
Clear projects cache: It cancels all the Cache of the projects.
The Graphics screen contains the Sheets, Arrows and Items sections, which options will next be
fully described:
Sheets background color : Defines the background color of the project sheets.
Sheets Default font : Defines the font for all components existing in the
project sheets.
Array Segment thickness : Modifies the thickness of the lines connected with the
array entity (entities with the array property set greater
than one)
Draw Arrow Segment 90°: If enabled, it forces the use of 90° segments on arrows
drawing
Segment color and Using these options it is possible to modify the color of
Arrows color : the arrows. For both options it is necessary to specify
the color to be used if the path is to be calculated during
the main task or every 100 ms (refer to the Defining the
execution task paragraph).
Preview : Preview window where examples of arrows settings are
viewed.
Label selected font : Defines the font to be applied to the entities selected.
Label selected color : Defines the background color of the text for the entities
selected.
Label normal color : Defines the background color of the text for entities not
selected.
Inputs color : Defines the color to be attributed to the inputs of the
entities.
Outputs color : Defines the color to be attributed to the output of the
entities.
I/O exported color : Defines the color to be attributed to the inputs/outputs
of the entities exported in the subsheets which they
contain.
View I/O Labels: Show/Hide the label with the name of the clamp for the
sheet, algorithm, library,…
The VTP Maker screen contains the configuration options used by VTP Maker tool to create VTP
driver file required to communicate with EVCO software.
Options are the following:
The Debugger screen contains the configuration options used to debug tool, for example that
required to the comunication.
Options are the following:
COM Port : Serial port used to the comunication with the controller
during debug operation. If the controller has only the
programmino port and not the debugging one, this
property must coincide withe the COM port you have
selected for the download. If the connected controllers
are c-pro 3 micro/kilo the COM por twill automatically
be recognized and the value you have set will be
ignored.
Reset device before start: Reset the controller at each start of the debugger
Show Extended If selected allow to show more extended info on the
Informations : state bar application, as task index where program break
for a breakpoint setting
Debug Value Label Color: Color of the debugger values under the entity
Forced Value Label Color of the forced values by debugger (for Analog
Color: Input and Digital Input)
Download Manager allows both the programmation of the controllers (download), and the writing
and extraction of the firmware, in binary format, there is in the connected controller (upload).
The program is made of one window divided by the following four sections:
- Select product: selection of the controller to program or from which it is destre to extract the
firmware (this must coincide with the connected controller);
- Action: select the action it is desired, or download (programming the device) or upload
(extracting the firmware from the device);
- Connection: selection of the serial port where the device is connected; if the controller is
c-pro 3 micro/kilo the recognizing of the COM port is automatic and the value you have set
is ignored.
- Binary File: in case of download it is possible to decide if using an existing firmware or
specify the file to download; in case of upload it is possible to define the file name where to
save the firmware read form the device.
Before beginning the download/upload phase it is necessary to verify the device to program is
correctly connected to the serial port selected in the section Connctions.
In case of controllers c-pro 3 micro/kilo the files downloaded in the controller or to extract from the
controller are always two: the application binary file (.ucjb) and the binary file of the EIML page
(.ucje). In any case it is necessary to specify, in the program, only the application binary file (.ucjb);
The Download Manager will also download the other file (in case of download) or extract (in case
of upload). The file of the EIML pages has always the same name as that of the application (it just
changes the extension).
At last, to start the download press button Download; press button Upload if the selected action is
that of writing of the formware. In the lower part of the window it is possible to read the status of
the process, in particular it is shown the elapsed time (Elapsed Time), the esteemed time (Time To
End) and the download percentage (in the progression bar).
In case the download/upload does not happen correctly, verify the connection with the device, the
adopted configurations and try again the operation.
4.16 VTP Maker
The development environment has a tool that automatically generate the drivers file for the
communication with supervision software R.I.C.S. and with parameters management software
Params Manager. It’s required that the interested entities will be exported on Modbus protocol
using the Export Entities activable from Tools/Export Entities menu.
Select the Tools / VTP Maker menu.
Before beginning the creation of VTP file driver, make sure that are correctly set the options for the
automatic maker from Settings / VTP Maker menu.
In the next window you can select three other functionality:
Click button Next > to show a window with the path and the name where VTP driver file will be
saved.
If Parameters Manager is installed, the generated VTP file is also copied in the directory of the
Parameters Manager drivers. If the driver file is already present, it will be asked the user to make a
copy or a manual comparison between the new and the existing one, in order that possible
modifications of the driver in use are not overwritten.
Last showed window, less than errors during file generation, is that one indicated the successfully
creation of VTP file driver.
At any time it is possible to click button < Back to modify your selection. Click button Close to
finish the VTP Make wizard.
4.17 Parameters Manager & VTPEditor
In order that the UNI-PRO can work properly with Parameters Manager, it is necessary that
UNI-PRO finds the program installed; please note that even the installing file of Parameters
Manager is present in the CD-ROM of UNI-PRO, Parameters Manager is not automatically
installed when installing UNI-PRO but must be installed separately.
Selecting VTP Property, it is possible to gain access the tool VTP Editor.
The editor window about the properties of an entity in the VTP is divided in two sections: Edit and
Language.
In the section Language it is possible to insert the description of the entity (in its default value or
specified in various languages).
4.18 Expansions and remote terminals configuration
To realize the application software we can use expansions to increase the I/O, specific drivers for
expansions valves and remote terminals. All this elements can be managed by the main controller,
defining, in the project, the links to configuration parameters or to internal status with copies in the
applicative project, trough appropriate tools. According to the chosen local bus (Intrabus or CAN)
we can call the relative configuration tool.
In the left-hand side of the window there are all the project variables, while in the right-hand side
there are, for each configurable element in the network, two lists (selectable trough the relatives
Tab): the list of the configurations to force as Send and the one of the configurations to read as
Receive. To make easier the research, operating on the combo in the top left corner it is possible to
filter the list according to the type.
To connect a parameter or project variable to a parameter or variable on the network you have to
select it in the left list and drag it with the mouse in the desired position of the right list.
4.18.2 CAN master
In case the local Bus is CAN, the controller is master for that Bus only if the relative configuration
parameter is enabled (look at Hardware Expert - 6 - Network CAN). Some controllers can manage
up to two CAN channels (internal and extaernal). Trough the Tools/CAN master… menu and chosen
the relative channel one activates the following configuration window:
In the left-hand side there are all the project variables, while in the right-hand side there are, for
each element present in the network, two lists (selectable trough the relative Tab): the list of the
configurations to force as Send and the one of the configurations to read as Receive. To make easier
the research, operating on the combo in the top left corner it is possible to filter the list according to
the type.
To connect a parameter or project variable to a parameter or variable on the network you have to
select it in the left list and drag it with the mouse in the desired position of the right list.
4.19 Modbus Master Entities Link
The project entities, status and controls for the Modbus network can be sent or received using this
tool to allow to the master controller the correctly communicate with the connected devices.
Trough the Tools/Modbus Master… menu we can activate the following configuration window:
In the left-hand side of the window there are all the project variables, while in the right-hand side
there are, for each configurable element in the network, two lists (selectable trough the relatives
Tab): the list of the configurations to force as Send and the one of the configurations to read as
Receive. To make easier the research, operating on the combo in the top left corner it is possible to
filter the list according to the type.
To connect a parameter or project variable to a parameter or variable on the network you have to
select it in the left list and drag it with the mouse in the desired position of the right list.
Priority column refers to the masterRefresh property of the entities connected.
4.20 “Delete and save links” function and LinkFixer
This function can be used to remove the entities selected and to save the connections, introducing
the variables which “secure” the connections (of the deleted entity) with other entities in the project.
Click…
Click Yes ….
The entity calc_enableShutter has been removed and three variables were created (one for each
input and output terminal) which are connected to the entity to which calc_enableShutter was
connected. In this way the inputs/outputs have been “Secured” and can be elaborated and reused.
To fix the I/O of the deleted entities are created “Link Fixer” special entities. This object allow to
memorize the links and they are simplified; if connect the free input or output to other entity the
Link Fixer will be automatically deleted and the link will be automatically connected to the new
entity.
A)
Linking of calc_enableShutter_O_out with
the new entity “otherEntity”
B)
Linking of calc_enableShutter_unitON to
the “enable” input of the algorithm
“calc_forceDown”
A)
Semplification of the Link Fixer
calc_enableShutter_O_out; entity
“otherEntity” will be automatically
connected to the clamps connected with
the Link fixer that will be removed
B)
Semplification of the Link Fixer
calc_enableShutter_unitOn; input “enable”
of the algorithm will be automatically
connected to the entity connected with the
Link Fixer that will be removed
4.21 CAN Config
CAN Config is a tool that allows the programming of the CANbus parameters of the controllers, of
the expansions and of the user interfaces belonging to the c-pro 3.
To use CAN Config no particular hardware is required but the interface EVIF20TUXI, also required
for the programming of the devices.
PC Virtual COM
(USB)
Previous versions of UNI-PRO did not allow the use of CAN Config if the utility Debugger was
activated. From version 3.3 this problem has been solved and the two things can work.
Just pay attention: if it is wanted to use CAN Config with old applications compiled with previous
versions to the 3.3 and with the use of Debugger activated, it is necessary these are compiled with
the new version of UNI-PRO (from ver. 3.3); on afterwards make the download into the controller
again.
Choosing menu Tools/CANconfig, the following window is displayed:
Settings
Prompts panel
Status message
Settings
COM Port: serial port where the interface EVIF20TUXI is connected; if the connected
controller is c-pro 3 micro/kilo (or directly to the USB port without using the interface
EVIF20TUXI), the COM port is automatically recognized and this setting is ignored.
Show advanced parameters: when selected, bit timing parameters are shown and can be
set (they are shown in the grid as Advanced Parameters)
COM port initialization: when selected, an initialization of the serial port will be done (the
first time the program joins to the controller using the COM Port, to make sure the
communication with the controller does not belong to an unknows status the first time there
is the connection). If the controller remains connected to the serial port, this will provoke its
reset.
Prompts
Connect: it starts the communication with the controller. Since that moment it is possible to
show and modify the CANbus communication parameters.
Disconnect: it stops the communication with the controller
Save Map: it saves the values there are in the grids in a file (map; Main Parameters,
Network, Advanced Parameters)
Load Map: it reads a “map” file and writes the loaded values in the controller
Apply: it sends the controller the prompt to make valid the parameters that have been
modified.
To modify the parameters when the connection is active, it is enough to write the values in the grid.
The program refreshes the values every second and provides an immediate feedback (on condition
the writing has succesfully been completed). To make valid the values just written and in order that
the controller starts again the CAN communication using the new parameters, it is necessary to
press prompt APPLY. If after the validation of the parameters some of these are overwritten by the
application (for example using the libraries belonging to the group System/CAN 1st) the incongruity
is underlined in red.
To save and load maps it is necessary the communication is active; no modification is allowed when
offline.
Values in grey if the communication is not active. Values in red in case of communication error.
Values underlined in red where the written values are different from
the read ones. The control is done after the validation of the
modifications through prompt APPLY.
4.22 EIML Translator
From the menu Tools->EIML Translator one can access to a tool that allows to complete easily the
multilanguage strings of the EIML pages. A list of all the inserted texts is shown; this tool also
allows to insert the respective translations in the desired languages.
The first column indicates the name of the EIML elements, the second one shows the maximum
showing size the element has in the page and on afterwards there are the translations in the
languages supported by the EIML language.
If an element has an empty text, this will be underlined in green.
If a text is longer than the maximum number of characters that can be shown by the EIML element
of the page, it is underlined in red.
Open File It opens a CSV multilanguage file previously saved through the
language exportation of the project (it is also possible to open
files belonging to other projects)
Save File It saves a CSV multilanguage file with all the elements there are
in the multilanguage charts
Import in Project It tries to import the elements in the running project; if an error
occours during the importation an alert is shown and it is saved
into a Log file (in the directory of the project)
4.23 Configuration MP-Bus Belimo protocol
To the MP-Bus port can be connected the Belimo’s devices that manage correctly the commands
MP_Get_SeriesNo, MP_Set_MP_Address (that allow the configuration of the network) and
MP_Set_Relative (that allows to drive the position of the actuator).
If you want to connect a probe (or a relay) to the actuator, the device must also manage the
commands MP_AD_Convert (that allows to read the probe value) and/or MP_Get_Forced_Control
(that allows to read the relay status).
The controllers that support the MP-Bus communication protocol allow realizing a network made of
8 (at most) actuators Belimo. Each node must be configured; the configuration can be done through
a template MPBus_SerialDeviceN for each device. To monitor the status of each device one has to
use the libraries MPBus_GetStatusDeviceN. To monitor the global status of the MP-Bus network
one has to use libraries MPBus_TxCounter e MPBus_RxCounter.
All the libraries mentioned are related in the system libraries of the development environment
UNI-PRO.
Each device connected to the MP-Bus network is used as an analog output, which signal moves
from 0.00% and 100.00%; it must be inserted in the project an Analog Output having property
“actuator“ Belimo for each device. Using the Join Tool these Analog Output must be connected to
the dedicated pins.
Each device Belimo offers the reading of a probe or, as alternative, of a relay status. If one wants to
monitor the value read by the probe, one has to insert in the project an Analog Input, to be
connected in the joining tool to the dedicated pins. The probes can be configured as Pt 1000, NTC,
0-10 V. The relay status works as a Digital Input, to be connected to the relative pin.
For each device Belimo it is possible to read one probe value or, as alternative, one relay status.
Please note that if one wants to use two actuators Belimo and they are configured using the libraries
MPBus_SerialDevice1 and MPBus_SerialDevice3, the two Analog Output must be connected to
pin 1 and pin 3 Belimo. In the same way, possible analog/digital inputs must be connected to the
pins representing the first and the third node of the MP-Bus network.
CJ_WORD CJ_MaxMainTime(void)
CJ_WORD CJ_MinMainTime(void)
CJ_WORD CJ_RunMainTime(void)
The main cycle time depends on many factors, like the processor of controller used, the program
dimension, the use of serial communication protocols, the presence of expansions and remote user
interfaces, fixed and floating points calculations, … the measure of this time may give an indication
about the program performances about the controller magnitudes. Anyway a time who exceeds
1000ms (one second) can be excessive for the execution of some program parts. Is recommended to
keep an average value under 500ms.
CJ_BYTE CJ_MaxInterruptTime(void)
CJ_BYTE CJ_MinInterruptTime(void)
CJ_BYTE CJ_RunInterruptTime(void)
The interrupt cycle time depends on many factors, like the processor of controller used, the program
dimension, the use of serial communication protocols, the presence of expansions and remote user
interfaces, fixed and floating points calculations, …the measure of this time may give an indication
about the program performances about the controller magnitudes. Anyway a time who exceeds 5ms
can be excessive for the execution of some program parts. Is recommended to keep an average
value under 3ms.
Page 177
UNI-PRO 3 SOFTWARE MANUAL
Page 178
UNI-PRO 3 SOFTWARE MANUAL
Page 179
UNI-PRO 3 SOFTWARE MANUAL
Added edit and showing of CJ_TIME, CJ_DATE and CJ_DATE_TIME in the 7-segments display
for controllers C-Pro 3 Micro/Kilo.
Added controller C-Pro 3 Color 320x240 and browser V-Color 3 320x240 pixel touch with 256
colors.
Modified the compiling and download processes to integrate the controller V-Color 3.
Extended the functionality F10 (Check Links) to show also the exportations of the entities in
communication protocols (CAN, MODBUS,…)
Page 180
UNI-PRO 3 SOFTWARE MANUAL
This publication is the exclusive property of Evco. Evco forbids any form of reproduction and publication, unless specially authorised by Evco itself.
Evco declines any responsibility regarding characteristics, technical data or any mistakes contained in this publication or consequential from usage of
the same. Evco cannot be held responsible for any damages caused by non-compliance with warnings. Evco reserves the right to make any changes
without previous notice and at any time, without prejudice to essential characteristics of functionality and safety.
Page 181
HEADQUARTERS
Evco
Via Mezzaterra 6, 32036 Sedico Belluno ITALY
Tel. +39 0437-852468
Fax +39 0437-83648
info@evco.it
www.evco.it
OVERSEAS OFFICES
Control France
155 Rue Roger Salengro, 92370 Chaville Paris FRANCE
Tel. 0033-1-41159740
Fax 0033-1-41159739
control.france@wanadoo.fr
Evco Latina
Larrea, 390 San Isidoro, 1609 Buenos Aires ARGENTINA
Tel. 0054-11-47351031
Fax 0054-11-47351031
evcolatina@anykasrl.com.ar
Evco Pacific
59 Premier Drive Campbellfield, 3061, Victoria Melbourne, AUSTRALIA
Tel. 0061-3-9357-0788
Fax 0061-3-9357-7638
everycontrol@pacific.com.au
Evco Russia
111141 Russia Moscow 2-oy Proezd Perova Polya 9
Tel. 007-495-3055884
Fax 007-495-3055884
info@evco.ru