0300037EN

Download as pdf or txt
Download as pdf or txt
You are on page 1of 70

1tool BASIC course - Exercise book Ver.3.

1 1 / 70
INDEX:
Exercise 1 - Thermostat ...................................................................................................................................................................... 3
Exercise 2 – Thermostat (only exercise) ............................................................................................................................................. 5
Exercise 2 – Uploading the application into the pCO.......................................................................................................................... 7
Exercise 3 – Setpoint modifiable ......................................................................................................................................................... 9
Exercise 4 – Setpoint ‘lateral’- Fixed Offset and Differential constant ............................................................................................. 11
Exercise 5 - Heating device ............................................................................................................................................................... 13
Exercise 6 - New mask and Key function .......................................................................................................................................... 15
Exercise 7 –Loop of masks ................................................................................................................................................................ 17
Exercise 8 –Enable devices................................................................................................................................................................ 19
Exercise 9 –Customizing field text (e.g. 0/1>>>OFF/ON) .................................................................................................................. 21
Exercise 10 – Virtual Key ................................................................................................................................................................... 23
Exercise 11 – Block Execution Order ................................................................................................................................................. 25
Exercise 12 – Unit status by keyboard .............................................................................................................................................. 27
Exercise 13 – Unit status by Digital Input (switch) ............................................................................................................................ 31
Exercise 14 –Cooling and Heating Valve ........................................................................................................................................... 33
Exercise 15 – Alarms management – Creating the alarm status variables ....................................................................................... 35
Exercise 16 –Alarms management – Builtin alarm management ..................................................................................................... 37
Exercise 17 – Alarms management – Alarm key ............................................................................................................................... 39
Exercise 18 – pLAN - Introduction..................................................................................................................................................... 41
Exercise 19 – pLAN - Shared terminal ............................................................................................................................................... 43
Exercise 20 – pLAN - Sending variable among pCO (Link) ................................................................................................................. 45
Exercise 21 – pLAN - Solving problem of conflict .............................................................................................................................. 47
Exercise 22 – pLAN - Miscellaneous .................................................................................................................................................. 51
Exercise 23 – BMS - Introduction ...................................................................................................................................................... 53
Exercise 24 – BMS – Port config. and Variables selection................................................................................................................. 55
Exercise 25 – BMS - Miscellaneous ................................................................................................................................................... 59
Exercise 26 – Working with blocks and Library ................................................................................................................................. 61
Exercise 27 – Creating a new Macroblocks-block ............................................................................................................................. 62
Exercise 28 – Working with Modules ................................................................................................................................................ 63
Exercise 29 – Default Values ............................................................................................................................................................. 64
Exercise 30 – Images ......................................................................................................................................................................... 65
Exercise 31 – TextFont and ImageText ............................................................................................................................................. 66
Exercise 32 – Language support and Translations ............................................................................................................................ 67
Exercise 33 – Commissioning Tool .................................................................................................................................................... 68
Exercise 34 – Miscellaneous ............................................................................................................................................................. 69
Appendix_A_HowToConfigurePlan................................................................................................................................................... 70

NOTE:
The odd-numbered pages contain the description of the exercise.
The even-numbered pages contain the solution of the exercises
1tool BASIC course - Exercise book Ver.3.1 2 / 70
Exercise 1 - Thermostat

Target Overview of the editors


Application life cycle
How to manage a simple thermostat / stage

What’s new How to create new Solution/New project


How to customize the layout of the environment (hot to dock windows to the
border or one over the other, how to hide or re-open the windows, how to
export/import the layout)
Overview of Solution Explorer

Strategy Editor:
Programming languages: FBD – Function Block Diagram (blocks) and ST -
Structured Text (textual): in all exercises will be used FB.
Library view: Atoms library(very simple blocks) & Macroblocks library (more
complex/specific blocks)
How to place blocks (Drag & Drop from the LibraryView)
New blocks: Ain_Conf, GrdCmp, Dout (Atoms library)
How to create CONSTANT
How to create VARIABLES
Datatype of values/variables in FBD: Boolean, Integer, Analog
How to connect object (‘autorouting’)

Mask Editor
Concept of ‘MASK’ (display page, screen page)
How to place TEXT and FIELD (variables)
How to compile
Simulator
How to Start/Stop simulation
How to Simulate physical input/outputs
How to show the values of the variables using Watch windows
How to open a StrategyPage (ReadOnly)
How to show instant value of Input/Output of the blocks
How to go back in Editing
pCO manager
How to connect pCO to PC (RS485 to USB converter)
How to configure the communication between pCO and PC
How to upload the application into the pCO
Backup
How to create the backup of the application

Description Create a very basic application managing a simple thermostat.


Specifications 1) Read the Room temperature from the probe connected to the Analog Input n.1
(terminal ‘B1’, NTC sensor)
2) Compare the Room temperature with a fixed setpoint and hysteresis of 20.0 and
1.0 °C respectively. This define the cooling status.
3) Write (drive) the Digital Output (relay) n.1 according to the Cooling status
4) Show in the mask the value of the Room temperature and Cooling status

1tool BASIC course - Exercise book Ver.3.1 3 / 70


Exercise
solution

1tool BASIC course - Exercise book Ver.3.1 4 / 70


Exercise 2 – Thermostat (only exercise)

Target This exercise is like the n.1.


The only difference is that the correspondent video show only how to develop the
project, without information regarding the tool, etc.

What’s new See Exercise 1

Description See Exercise 1


Specifications

1tool BASIC course - Exercise book Ver.3.1 5 / 70


Exercise See Exercise 1
solution

1tool BASIC course - Exercise book Ver.3.1 6 / 70


Exercise 2 – Uploading the application into the pCO

Target How to connect the PC to pCO.


How to upload the application into the PCO

What’s new pCO manager


How to connect pCO to PC (USB/RS485 converter, 3 ways plugin or RJ11 phone
cable)
How to configure the communication between pCO and PC
How to upload the application into the pCO

Description Upload the application into the PCO


Specifications

1tool BASIC course - Exercise book Ver.3.1 7 / 70


Exercise During normal operation…
solution
2) Disconnect terminal (if used)

3) Connect PC to device using the


USB/RS485 converter.
NOTE1: The picture shows the converter with RJ11
(phone cable) connector code CVSTDUTLF0, but you can
use the model with 3ways plugin connector code
CVSTDUMOR0)
To upload SW...: NOTE2: Some models of pCO have the USB port. In this
case you can connect pCO to PC without the USB/RS485
1) Compile the project successfully, converter.
then click the ‘pCO Manager’ button

6) Click button “Connect” in the toolbar

5) Set the pCO address

4) Set the PortNumber of


your converter
7) Select the folder where
application files are saved

8)Select files to be
uploaded to the device

9) Upload and Check


progress

1tool BASIC course - Exercise book Ver.3.1 8 / 70


Exercise 3 – Setpoint modifiable

Target How to convert a CONSTANT value into a PARAMETER the user can modify

What’s new “T-permanent” memory type


Default value for variable in “T-permanent” memory type
.DEV file (Default Value)
Field direction INPUT/OUTPUT, Field limits.

Description Convert a CONSTANT setpoint (20.0) PARAMETER called “Setpoint”.


Specifications Default 20.0, limits 18/25°C.

1tool BASIC course - Exercise book Ver.3.1 9 / 70


Exercise
solution

1tool BASIC course - Exercise book Ver.3.1 10 / 70


Exercise 4 – Setpoint ‘lateral’- Fixed Offset and
Differential constant

Target To know some new blocks.


To create a little more complex strategy.
To learn how to convert the ‘Requirement Specification” written by the customer into
blocks.

What’s new Add, Sub, Mul, Div blocks


How to use two times the output of a block.

Description Convert the current operating chart…


Specifications

…to the following:

Offset and Differential are CONSTANT (3.0 and 1.0 respectively)

1tool BASIC course - Exercise book Ver.3.1 11 / 70


Exercise
solution

Since the GrdCmp block needs the central value of the stage and the half of the
width, you have to calculate them.

NOTE: Div block performs the ‘integer’ division (e.g. 14:5=2, remainder 4 is lost)

A typical mistake is divide the differential by “2.0” instead of “2” (block 050-Div). It
is a mistake since in the FBD-Strategy editor the Analog values are Integer values
where the editor shows the “.” before the last figure, therefore “2.0” = “20”.

1tool BASIC course - Exercise book Ver.3.1 12 / 70


Exercise 5 - Heating device

Target To make practice with current knowledge and learn some new functions.

What’s new Strategy editor: Not block


How to change the path of the connection (manual routing)
Create a new variable changing the name of an existing variable in the Strategy page
How to disconnect-reconnect a Connection

Description Add the management of an ON-OFF heating stage, according to the following
Specifications operating chart.
Add in the mask a Text and Field for the Heating.

Now make sense the previous exercise (lateral setpoint): changing only one
operating parameter (the Setpoint) both stages moves accordingly.

Offset and Differential are CONSTANT (4.0 and 2.0 respectively)

Note that the Heating stage is ‘Reversed’ (Cooling is ‘Direct’). Since the only block we
know that manages a stage is the GrdCmp and it manages a ‘Direct’ stage, it is
necessary to reverse it using the Not block (there are other better blocks in the
library managing stages, but in this exercise we prefer to use the GrdCmp block).

1tool BASIC course - Exercise book Ver.3.1 13 / 70


Exercise
solution

Note:
since the new stage is at the other side of the Setpoint, the Add and Sub must be
reversed (block number 040/070 and 130/140)

Note:
• It is evident that the strategy regarding the heating is similar to the one
regarding the cooling, therefore it is recommended to duplicate the existing
strategy and then make all the necessary modifications.
• The new variable “Heating” must be ‘after’ the Not block (i.e. ‘before’ the Dout
block) because the meaning of the Heating variable should be “Status of the
heating relay”. Since the status of the relay is defined by the variable connected
to the Dout block/Val pin, the Heating variable must be connected to it.

1tool BASIC course - Exercise book Ver.3.1 14 / 70


Exercise 6 - New mask and Key function

Target To create a basic structure of the user interface (masks)


How to create a new mask.
How to define the function of the keys of the keypad.

What’s new Mask Editor: How to create a new mask


Mask Editor: How to change the mask name
Mask Editor: How to define the function of the keys of the keypad
Mask Editor: Goto_mask statement

Description Create a new mask specific for the operating parameters (currently only Setpoint).
Specifications Use meaningful names for mask names.
Move all object regarding the Setpoint (Texts and Field) into the new mask.
Use the ESC key to show the mask regarding RoomTemp/Cooling/Heating and the
PRG key to show the new mask regarding Setpoint.

1tool BASIC course - Exercise book Ver.3.1 15 / 70


Exercise
solution

Note:
• Press CTRL+SPACE to open the list of Statements/Collectors
• Remember to click the background of the Worksheet grid (in order to select the
Global level) before to write code in the Key Function Editor.
• To change the mask name:
o click the mask
o open the Property window
o Insert new name in the ObjectName property

1tool BASIC course - Exercise book Ver.3.1 16 / 70


Exercise 7 –Loop of masks

Target To create a more complete structure of user interface (masks)

What’s new Mask Editor: How to create a loop (group) of masks


Mask Editor: How to move a mask (same or different loop)
Mask Editor: How to change move between mask of the same loop
Mask Editor: Goto_loop statement

Description Create two news masks specific for the cooling and heating devices. Place them
Specifications together (same group) with MainMask.

Use UP/DOWN key to enter in the previous/next mask.


Replace Goto_mask(…) with Goto_loop(…).

1tool BASIC course - Exercise book Ver.3.1 17 / 70


Exercise
solution

Mask content

Note:
• Drag the small icon in at the left of the mask (see red circle) in order to move the
mask in another position (same loop or different loop)

1tool BASIC course - Exercise book Ver.3.1 18 / 70


Exercise 8 –Enable devices

Target To know some new items of the languages through a typical need of an application:
enable masks and devices.

What’s new Mask Editor: How to create a new Key combination (e.g. ESC+PRG)
Mask Editor: EnableOn property
Strategy Editor: And block
(all): How to create a new variable from the Variable List

Description Create a new Configuration mask where is possible to modify two new variables
Specifications (En_Cooling, En_Heating) defining the ‘enable’ of the cooling/heating mask/device.
Enable the Cooling/Heating mask/relays according to the variables.
Enter in the Configuration mask/loop using the Key combination ESC+PRG

‘Enable’ a mask means allow to user to enter in it.


‘Enable’ a relay means that the relay can switch ON also according to the status of
the ‘enable’ variable.

1tool BASIC course - Exercise book Ver.3.1 19 / 70


Exercise Create a New Key combination
solution

Create a Configuration Mask & Loop.


Create two new variables En_Cooling En_Heating (Boolean, T-Permanent memory)
Enter in the Loop_Configuration using the new Key combination and the Goto_loop()
statement

Enable the Cooling/Heating masks using the EnableOn property (Mask level)

Enable the Cooling/Heating devices using the And block (Atom library)

1tool BASIC course - Exercise book Ver.3.1 20 / 70


Exercise 9 –Customizing field text (e.g. 0/1>>>OFF/ON)

Target How to show in a FIELD a text instead of the value of the variable.
(e.g. ‘OFF’/’ON’, ‘NO’/’YES’, ‘DISABLED’/’ENABLED’, …)

What’s new Mask Editor: ResourceUsedOnBool property


Mask Editor: GLOBAL/MASK/FIELD level

Description Show in all Boolean field a meaningful text instead of the numbers ‘0’ and ‘1’
Specifications ‘OFF’/’ON’ in the Cooling/Heating masks
‘NO’/’YES’ in the Configuration mask
‘DIS’/’EN’ in the Enable cooling FIELD of the Configuration mask.

1tool BASIC course - Exercise book Ver.3.1 21 / 70


Exercise The property that allows to set the resource (Text, Image, ImageText) to show
solution instead the value of the variable is the ResouceUsedOnBool property.

1. Click the background of the grid in order to select the GLOBAL level
2. Assign to the ResourceUsedOnBool the texts ‘OFF’/’ON’

3. Click the mask Configuration in order to select the MASK level


4. Assign to the ResourceUsedOnBool the texts ‘NO’/’YES’

5. Click the field in order to select the FIELD level


6. Assign to the ResourceUsedOnBool the texts ‘DIS’/’EN’
7. Give a name to the SpecialField

IMPORTANT!
• The properties and KeyFunction defined at GLOBAL level is used
in all field of all masks
• The properties and KeyFunction defined at MASK level is used
in all field that mask.
• The properties and KeyFunction defined at FIELD level is used
only in that mask.in all field of all masks
FIELD level overrides MASK level, and MASK level overrides the GLOBAL level.

1tool BASIC course - Exercise book Ver.3.1 22 / 70


Exercise 10 – Virtual Key

Target How to execute a KFE statement (e.g. Goto_loop) by the application instead of
pressing a physical key.

What’s new Strategy Editor: Move_BX and Delay atom-blocks


Strategy Editor: Block execution order
New object: System Variable (KEY_PRESSED)
Mask Editor: How to create a new Virtual key

Description Show the main mask after 60s of inactivity of the keyboard.
Specifications

Goto
main mask

Time

60s

1tool BASIC course - Exercise book Ver.3.1 23 / 70


Exercise How to manage a virtual key:
solution
1. Manage the variable that assumes the value 1 when the virtual key has to be
‘pressed’

En_VK_GotoMainMask 1
0
Time

60s

2. Create a new key name and link it to the variable


(Unused Keycode: 137-179, 200-254)

3. Defines the function of the new virtual key

Note:
• A System Variable is a variable where the Name, Meaning, DataType,
MemoryType are pre-defined.
The most used System Variable are the ones regarding the Real Time Clock
(CURRENT_HOUR, CURRENT_MINUTE, etc) and regarding protocols
(COM_PROTOCOL_BMS, COM_BAUDRATE_BMS, etc)

• For this strategy is very important the execution order of the block defined by the
number above the block (‘010’, ‘020’, ‘030’): the Move_BX block must be last of
the group. For further details see next exercise.

1tool BASIC course - Exercise book Ver.3.1 24 / 70


Exercise 11 – Block Execution Order
Target Give more details regarding the Page and Block Execution Order

What’s new How to set the Block Execution Order manually


How to set the Block Execution Order automatically
How to create a new Strategy page
How to set the Page Execution Order

Description Set the ideal Block Execution Order.


Specifications

The “execution order” is used also by textual languages. In this case the execution
order of the lines is intuitive: from TOP to BOTTOM.

Example 1 ☺ Example 2 ☺ Example 3 Example 4


A=1 B=5 C=A+B PRINT C
B=5 A=1 A=1 C=A+B
C=A+B C=A+B B=5 A=1
PRINT C PRINT C PRINT C B=5
GOTO beginning GOTO beginning GOTO beginning GOTO beginning

Example 1 and 2 are perfectly equivalent. Doesn’t matter if ‘B’ is initialized before ‘A’,
the important is that when they are used (C=A+B) they already have the correct
value.
Example 3: the code is not ideal. The program prints “0” and then “6” because in the
first program cycle the variable “C” doesn’t have yet the correct value.
Example 4 is even worse than Example 3. The program prints “0”“0”“6” because the
PRINT statement takes two program cycles before to use the correct value of “C”.
NOTE: You can notice that in some strategies the execution order is equivalent, in
others is not critical (it might work but with worse performance), in other is critical,
that is the program doesn’t work (like the exercise).
It is strongly recommended to take care of the Block Execution order
after place down and connect the blocks!

1tool BASIC course - Exercise book Ver.3.1 25 / 70


Exercise Double click the block or use the Calculate block execution order to change the
solution number (see slide)

General rule: if the block “A” uses a value defined by the block “B”, then “B” should
be calculated after “A” (number of “B” higher than number of “A”)

In the following snippet of code the Sub block shoud be executed after Add/Div

CORRECT WRONG

1tool BASIC course - Exercise book Ver.3.1 26 / 70


Exercise 12 – Unit status by keyboard
Target Make practice with the Key Function Editor

What’s new Mask Editor: IF statement (one or more conditions)


System Variable: KEY_COUNTER
Simulator: Breakpoints in the Key Function Editor

Description Manage the ‘unit status’. It changes pressing the ESC+UP keys.
Specifications Enable the cooling/heating devices according to the units status.

Create a new variables named “UNIT_STATUS” (Boolean, T-permanent memory)


representing the status of the unit.
UNIT_STATUS=0 units OFF all devices forced OFF
UNIT_STATUS=1 units ON devices can be switched ON according to other
conditions (temperature and device enable)

Draft code:
Key ESC+UP
IF UNIT_STATUS = 0 THEN
UNIT_STATUS = 1
IF UNIT_STATUS = 1 THEN
UNIT_STATUS = 0

1tool BASIC course - Exercise book Ver.3.1 27 / 70


Exercise 1. Create the Variable “UNIT_STATUS”
solution Another way to create a variable is right-click the VariableList > Add menu

2. Create a New Key combination ESC+UP as described in the Exercise 8 - EnableOn

3. Define the function ESC_UP of the key at GLOBAL level (so the status od the unit
will change regardless the FIELD and MASK wher is the cursor)

A first draft solution is the following code:


1) if (UserVarList.Unit_Status == 0)
2) {
3) UserVarList.Unit_Status = 1;
4) }
5) if (UserVarList.Unit_Status == 1)
6) {
7) UserVarList.Unit_Status = 0;
8) }
UserVarList is a Collector containing all the User Variables. It is optional. Write it
or press CTRL+SPACE an select it from the list.
This code can’t work! If Unit_Status is 0 then the condition at LINE1 is TRUE so
LINE3 is executed and so Unit_Status become 1. But now also the condition at
LINE5 is TRUE so LINE7 is executed and so Unit_Status become 0 back!!!
Note: ELSE statement is not supported.
There are 2 known solutions involving only the Key Function Editor.

Solution 1: (recommended)
Create a new support user variable (e.g. New_Unit_Status)
if (UserVarList.Unit_Status == 0)
{
UserVarList.New_Unit_Status = 1;
}
if (UserVarList.Unit_Status == 1)
{
UserVarList.New_Unit_Status = 0;
}
UserVarList.Unit_Status = UserVarList.New_Unit_Status;

Solution 2:
Create a new support user variable (e.g. flag)
Flag = 0;
if (UserVarList.Unit_Status == 0)
{
UserVarList.Unit_Status = 1;
Flag = 1;
}
if (UserVarList.Unit_Status == 1 && Flag == 0)
{
UserVarList.Unit_Status = 0;
}

1tool BASIC course - Exercise book Ver.3.1 28 / 70


(This page has been intentionally left empty)

1tool BASIC course - Exercise book Ver.3.1 29 / 70


The Solution 1 is good but not perfect, because if the user hold down the button
after one second the autorepeat starts. To avoid the continuous ON OFF ON OFF
of the Unit_Status is possible to use the KEY_PRESSED system variable (for further
details see its manual manual)
if (UserVarList.Unit_Status == 0 && SysVarList.KEY_COUNTER == 1)
{
UserVarList.New_Unit_Status = 1;
}
if (UserVarList.Unit_Status == 1 && SysVarList.KEY_COUNTER == 1)
{
UserVarList.New_Unit_Status = 0;
}
if (SysVarList.KEY_COUNTER == 1)
{
UserVarList.Unit_Status = UserVarList.New_Unit_Status;
}
SysVarList is a Collector containing all the System Variables. It is optional. Write
it or press CTRL+SPACE an select it from the list.

4. Enable the Cooling/Heating devices


This part is similar to Exercise 8 – EnableOn: just add another And block or use
an And_3 macroblock.

or

1tool BASIC course - Exercise book Ver.3.1 30 / 70


Exercise 13 – Unit status by Digital Input (switch)
Target To make more practice of the Strategy Editor. How to read the status of a switch.

What’s new Strategy Editor: Din atom, And_4 macroblock

Description Use the Digital Input (switch) n.1 as remote Unit Status.
Specifications Contact OPEN units OFF all devices forced OFF
Contact CLOSED units ON devices can be switched ON according to other
conditions (temperature, device enable, Unit Status by keyboard)

Note: read very carefully the Specifications here above!

This is the only new block you have to use:

1tool BASIC course - Exercise book Ver.3.1 31 / 70


Exercise
solution

Now there are 4 conditions that enable the devices (the screenshot shows only the
program regarding the Heating device)

The Not block is very important. Without it the Digital Input n.1 with have the
opposite effect than expected: when the contact is CLOSED (Val=0) the Heating
device is forced OFF while the specification require “Contact CLOSED units ON
devices can be switched ON according to other conditions (temperature, device
enable, Unit Status by keyboard)”

Here below a better solution: the General_Unit_Status variable takes care of ‘all units
status’: by keyboard and by digital input. In case the application has to manage also
the unit status by BMS, scheduler, … it is sufficient to add those condition to the
And(120). It is not necessary to modity the rest of the program (like And_3(320))

1tool BASIC course - Exercise book Ver.3.1 32 / 70


Exercise 14 –Cooling and Heating Valve
Target To make more practice with the Strategy Editor.
More details regarding the features of the FIELD.

What’s new Strategy Editor: Conv, Aout, Limit_Low, Sel_I blocks


Mask Editor: What happen if the FIELD has not enough figures
Mask Editor: What happen if the FIELD is unsigned and the value is negative

Description Add the management of a Cooling and Heating valve according to the operating
Specifications graph here below. Drive the Analog Outputs n.1 and 2 respectively.
Show the opening value of the valves in the Cooling and Heating mask. The values
must be expressed in percentage (neither 0/1000 nor 0/10)

Basically only 2 new block are required for this exercise:


Conv: converts a value in a user defined range into a fixed range 0/1000.
Aout: drives an Analog Output. Requires a value in the range 0/1000 corresponding
to 0/10VDC.

1tool BASIC course - Exercise book Ver.3.1 33 / 70


Exercise
Solution

Important:
• If the value need more figures than the ones defined in the FIELD format then
the display shows the less significant figures
Example: Value= 1234, Field format=”iii” the display shows “234”
Example: Value= -1234, Field format=”-iii” the display shows “-234”

• If the value is negative but the FIELD format is unsigned then the display shows a
‘random’ value (random for the end user)
Example: Value= -33, Field format=”aaa.a” the display shows “550.3”
The value comes from: 2^16+(-33)=65536+(-33)=65503,
…since the FIELD is ‘Analog’ the display shows “6550.3”,
…since the FIELD has only 4 figures the display shows “550.3”

Always take care of FIELD format!

1tool BASIC course - Exercise book Ver.3.1 34 / 70


Exercise 15 – Alarms management – Creating the alarm
status variables
Target Introduction to alarm management
To make more practice with the Strategy Editor.
To know some new blocks.

What’s new Strategy Editor: GE, GT, LE, LT, NE, EQ (atom), Hyst_Dir_Set2Diff,
Hyst_Dir_OnOff , Hyst_Rev_Set2Diff, Hyst_Rev_OnOff, Delay_On
macroblocks.

Description Step1: Create two variables representing the High/Low temperature alarm status.
Specifications Alarm condition not active variable = 0
Alarm condition active variable = 1

The only new blocks are the comparison blocks here below. All blocks works in the
same way: the output is 1 when the comparison of the 1st and the 2nd input is TRUE.

Step2: Add a differential of 1.0°C to the limits.

The only new blocks are the ‘hysteresis’ blocks here below

Step3: Add a delay to the alarm status.


The only new blocks are the ‘hysteresis’ blocks here below

Step4: Take care of the Units Status .

1tool BASIC course - Exercise book Ver.3.1 35 / 70


Exercise Step1:
solution

Step2:

Step3:

Step4:

Important:
Take care of the Block Execution Order!

1tool BASIC course - Exercise book Ver.3.1 36 / 70


Exercise 16 –Alarms management – Builtin alarm
management
Target To show how works the Built-in standard management of alarms.

What’s new System Variables: MANUAL_BUZZER_EN/_ON/_OFF


System Variables: BUZZER, GLOBAL_ALARM, RESET_BUZZER, RESET_ALARMS
Mask Editor: Alarm mask (and its AlarmsStatus and AlarmMemory property)
Strategy Editor: LED block

Description Create a new loop containing an AlarmMask for each alarm.


Specifications Test in Simulator the 4 System Variables and the 4 alarm variables (AL_*, mAL*).
Light Alarm LED and a relay according to the status of the alarms.

1tool BASIC course - Exercise book Ver.3.1 37 / 70


Exercise
Solution

It is not mandatory to drive a DOUT and LED, but it is recommended!


You can chose the variable to use to drive DOUT and LED.

1tool BASIC course - Exercise book Ver.3.1 38 / 70


Exercise 17 – Alarms management – Alarm key
Target Make an example of use of the Alarm key
Make practice with the Key Function Editor.

What’s new Nothing!

Description Define the KFE code of the ALARM key in order to manage the 3 conditions shown in
Specifications the following slide.

It is recommended to create a mask to show when there are no alarms: the user
wants a feedback when he press a key!

1tool BASIC course - Exercise book Ver.3.1 39 / 70


Exercise
solution

1tool BASIC course - Exercise book Ver.3.1 40 / 70


Exercise 18 – pLAN - Introduction
Target Make an introduction of the pLAN (pCO Local Area Network)
Overview of connectivity.

What’s new List of devices supporting pLAN protocol.


Functions provided by the pLAN protocol.

See slide for more details.

Description (This is not an exercise)


Specifications

1tool BASIC course - Exercise book Ver.3.1 41 / 70


Exercise (This is not an exercise)
solution See slide and video tutorial for more details.

1tool BASIC course - Exercise book Ver.3.1 42 / 70


Exercise 19 – pLAN - Shared terminal
Target Create a simple pLAN
Configure the pLAN address and Configure the terminal PRivate or SHared

What’s new Network Editor: How to choose pLAN devices.


System Variables: PLAN_ADDRESS, PLAN_KEY_SWITCH.

Description Create a pLAN composed by two pCO running the COURSE project and one SHARED
Specifications terminal. pLAN addresses are respectively 1-2-32.

Show the pLAN address in the main mask.


Use ESC+DOWN to switch between pCO.

1tool BASIC course - Exercise book Ver.3.1 43 / 70


Exercise Create a new Network page
solution Insert n.2 PCO1E controller and n.1 PGD1 terminal. Set address 1-2-32 respectively

Show the PLAN_ADDRESS system variable in the main mask.

Create the new key combination ESC+DOWN

To use the ESC+DOWN key combination to switch (connect) the terminal to the next
pCO, you have to assign to the system variable PLAN_KEY_SWITCH the code of
the key/s you want to use.

1tool BASIC course - Exercise book Ver.3.1 44 / 70


Exercise 20 – pLAN - Sending variable among pCO (Link)
Target How to send variables among pCO (i.e. How to create a link).

What’s new Network Editor: pLAN link table


How to create a link (unidirectional and bidirectional)

Description Send the value of Room_Temp of unit address 1 to Room_Temp of unit address 2.
Specifications This allows to install only one temperature probe.

1tool BASIC course - Exercise book Ver.3.1 45 / 70


Exercise Open the pLAN link table and create a link between 1-Room_Temp and 2-
solution Room_Temp

Only link n.1 is necessary for this exercise.


Link n.2 is just an example of use of a Bidirectional link: the compiler automatically
creates another link with Source and Target inverted.

The solution of this exercise is very simple, but there is an issue. See next exercise.

1tool BASIC course - Exercise book Ver.3.1 46 / 70


Exercise 21 – pLAN - Solving problem of conflict
Target Solve the problem of the conflict between Strategy and pLAN regarding the value of
room temperature in unit 2.

What’s new Strategy Editor: Jump_Start, Jump_End block

Description See Target.


Specifications

The figure below shows the part of the program involved in the issue.

1tool BASIC course - Exercise book Ver.3.1 47 / 70


Exercise Since in the unit 2 runs the same project of unit 1 (“COURSE”), there are 2 functions
solution that give a value to the Room_Temp variable:
• The pLAN: everytime the value of Room_Temp of unit 1 changes it is sent to
unit 2 and written into Room_Temp.
This is correct. This is what we expect.

• The Ain_Conf block: every program cycle the block ‘reads’ the analog input
n.1 (that it is not connected) and write the correspondent value into the
variable Room_Temp.
This is wrong. Unit 2 has not the probe connected. This block is not
necessary.

There are several solutions:


1. Delete the Ain_Conf block in the unit 2.
This solution required to have different projects running in the two units.
In this exercise-project there would be only one block less!

2. Place a Sel_I block between the Ain_Conf block and the variable
Room_Temp in order to select the value coming from the Ain_Conf or the
pLAN according to the pLAN address.
The project can be the same in the two units.

3. Exclude the Ain_Conf block from program cycle when the program runs in
the unit 2.
The project can be the same in the two units.
This is the solution you have to implement in the exercise.
This is the solution used in all Carel Standard application!

Please see the video tutorial for more details.

IMPORTANT!: The issue discussed in this exercise is not present for all variables sent
between pCO, it depends on the specifics strategy!

1tool BASIC course - Exercise book Ver.3.1 48 / 70


(This page has been intentionally left empty)

1tool BASIC course - Exercise book Ver.3.1 49 / 70


The figure below shows the program flow we need in the the pCOs

pLAN ADDRESS 1 (Disable=1) pLAN ADDRESS 2 (Disable=0)

EQ EQ

Jump_Start Jump_Start

Ain_Conf Ain_Conf

Jump_End Jump_End

GrdCmp GrdCmp

Dout Dout

1tool BASIC course - Exercise book Ver.3.1 50 / 70


Exercise 22 – pLAN - Miscellaneous
Target Manage pLAN alarm (unit offline)
Purpose of a Group in pLAN.
Type of architecture where the pCO and Terminal can be use
Where are the binary files.

What’s new See ‘Target”

Description (This is not an exercise)


Specifications See slide and video tutorial for more details.

1tool BASIC course - Exercise book Ver.3.1 51 / 70


Exercise (This is not an exercise)
solution See slide and video tutorial for more details.

1tool BASIC course - Exercise book Ver.3.1 52 / 70


Exercise 23 – BMS - Introduction
Target To do an introduction of connectivity regarding the BMS (Communication with a
generic supervisory system)

What’s new Type of serial card supported


Type of protocols supported
Type of BMS networks

Description (This is not an exercise)


Specifications See slide and video tutorial for more details.

1tool BASIC course - Exercise book Ver.3.1 53 / 70


Exercise (This is not an exercise)
solution See slide and video tutorial for more details.

1tool BASIC course - Exercise book Ver.3.1 54 / 70


Exercise 24 – BMS – Port config. and Variables selection
Target How to exchange variables with a generic BMS system.

What’s new System Variables: COM_BAUDRATE_BMS, COM_PROTOCOL_BMS


Strategy Editor: RAIN, RAOUT, RDIN, RDOUT, RIIN, RIOUT blocks.
Mask Editor: ResourceUsedOnInt property
Tools:DTEST Carel Protocol test tool DTEST32.EXE

Description The project has to exchange the following variables in Carel Slave and Modbus Slave
Specifications protocol through the BMS port.
Create a new mask in the Configuration loop where to set the address of the pCO in
the network, the communication speed and the communication protocol.

Variables to exchange:

DataType Index VariableName IN OUT


A 1 Room_Temp
A 2 Setpoint
D 1 Cooling
D 2 Heating
D 3 Unit_Status
D 4 mAL_HT
D 5 mAL_LT

1tool BASIC course - Exercise book Ver.3.1 55 / 70


Exercise 1) Address in the network (system variable BMS_ADDRESS (I,T) )
solution

Place a FIELD with the BMS_ADDRESS system variable

2) Communication speed (system variable COM_BAUDRATE_BMS (I,X) )

Place a FIELD with a new support user variable BAUDRATE variable(I, T, range 0-4).
You can’t use COM_BAUDRATE_BMS because it is in X-RAM memory.

3) Communication protocol (system variable COM_PROTOCOL_BMS (I,X) )

Place a FIELD with a new support user variable PROTOCOL variable(I, T, range 1-4).
You can’t use COM_PROTOCOL_BMS because it is in X-RAM memory.

1tool BASIC course - Exercise book Ver.3.1 56 / 70


(This page has been intentionally left empty)

1tool BASIC course - Exercise book Ver.3.1 57 / 70


4) Select variables. 2 alternatives:

• Blocks.
Example:

• BMS flag (Variable property)


Example:

This property will create at compile time an hidden strategy page containing blocks
like the ones shown in the first alternative. For this reason in order to avoid conflict
you should not use both alternatives.

1tool BASIC course - Exercise book Ver.3.1 58 / 70


Exercise 25 – BMS - Miscellaneous
Target How to test communication in CAREL and MODBUS slave protocol
How to communicate in Modbus Slave Protocol
How to communicate in other protocols (overview)

What’s new How to communicate in Modbus Slave Protocol


How to communicate in LON, Bacnet, Konnex, … Protocol (overview)
System Variables: BMS_EXTENSION
Tools:MODSCAN Modbus Protocol test tool
Carel To Modbus type/index crosstable

Description (This is not an exercise)


Specifications See slide and video tutorial for more details.

1tool BASIC course - Exercise book Ver.3.1 59 / 70


Exercise
solution (This is not an exercise)
See slide and video tutorial for more details.

DTEST: tool developed by CAREL suitable to test CAREL SLAVE LOCAL protocol.
Download it from KSA.

Crosstable CAREL <> MODBUS

MODSCAN: tool developed by third parties suitable to test MODBUS SLAVE protocol.
Search it on the internet.

How to manage other protocols:

1tool BASIC course - Exercise book Ver.3.1 60 / 70


Exercise 26 – Working with blocks and Library
Target Introduction to Blocks and Libraries

What’s new Overview of type of Blocks and Libraries


Behaviour of compiler in case of unconnected pin
Default value of pin.

Description (This is not an exercise)


Specifications See slide and video tutorial for more details.

1tool BASIC course - Exercise book Ver.3.1 61 / 70


Exercise 27 – Creating a new Macroblocks-block
Target How to create a ‘macroblock’ block
Features of libraries (System Library, User Library, Project Library)

What’s new How to create a new project “Module/Macroblock” type


‘Block pin’ property
Default value of pin
Shape Editor
Depedencies
Where to find new version of libraries (KSA)

Description (This is not an exercise)


Specifications See slide and video tutorial for more details.

1tool BASIC course - Exercise book Ver.3.1 62 / 70


Exercise 28 – Working with Modules
Target How to use a ‘module’ block

What’s new Module insertion mode: Linked, Imported, Strategy only


How to edit module mask
Compatibility between module/project terminal/languages
MaskDefaultPosition property
Label of module

Description (This is not an exercise)


Specifications See slide and video tutorial for more details.

1tool BASIC course - Exercise book Ver.3.1 63 / 70


Exercise 29 – Default Values
Target How to use images

What’s new How to define default values


How to install default values
Why to install default values

Description (This is not an exercise)


Specifications See slide and video tutorial for more details.

1tool BASIC course - Exercise book Ver.3.1 64 / 70


Exercise 30 – Images
Target How to use images

What’s new How to add an image to the project


How to place an image into a mask
How to make the ‘reverse’ effect (overlap TEXT and IMAGE)
How to create a dynamic image

Description (This is not an exercise)


Specifications See slide and video tutorial for more details.

1tool BASIC course - Exercise book Ver.3.1 65 / 70


Exercise 31 – TextFont and ImageText
Target Introduce some properties dedicated to languages

What’s new How to set the set of characters (TextFont property)


How to show ‘chinese text’ (ImageText object)
How to show text in double height (RowZoom property)

Description (This is not an exercise)


Specifications See slide and video tutorial for more details.

1tool BASIC course - Exercise book Ver.3.1 66 / 70


Exercise 32 – Language support and Translations
Target How to translate the text in other languages
How to select the language to show

What’s new How to add/clone a language


How to select the language to show at editing time (MaskEditor)
How to select the language to show at run time (pCO). LANGUAGE and
LANGUAGE_KEY_SWITCH System Variables
How to translate text one-by-one or using EXCEL

Description (This is not an exercise)


Specifications See slide and video tutorial for more details.

1tool BASIC course - Exercise book Ver.3.1 67 / 70


Exercise 33 – Commissioning Tool
Target Introduction to the Commissioning Tool

What’s new Configuration of the Commissioning Tool


How to select variables to use
How to read and write variables
How to force the value of a physical input/ouput
How to force a variable according to a trend (Stimulus files)
Commissioning Logs and Trends
Event monitoring
Device configuration: how to read/wrote values from/to pCO/disk
Alarm reset
How to organize variable in Categories
How to create a new Profile

Description (This is not an exercise)


Specifications See slide and video tutorial for more details.

1tool BASIC course - Exercise book Ver.3.1 68 / 70


Exercise 34 – Miscellaneous
Target Miscellaneous topics

What’s new Time management: system variables CURRENT_HOUR, NEW_HOUR, SET_HOUR


How to delete unused objects (Variables, SpecField, Resources).
To reduce compilation time: Compile target only
Project documentation: Menu File/Create solution documentation
Application development GuideLines (slide)
Content of FLASH memory: BOOT, BIOS, IUP, BLB/BIN, DEV (slide)
Other languages: ST-StructuredText
Next steps (slide)
Starter kit (slide)
Standard application, Project template (slide)
Quick look to a standard application: Chiller Core FLCORMCH0E
1tool support service: [email protected] (slide)

Description (This is not an exercise)


Specifications See slide and video tutorial for more details.

1tool BASIC course - Exercise book Ver.3.1 69 / 70


Appendix_A_HowToConfigurePlan
Target How to set the address of the pCO and Terminal
How to configure the terminal as PRivate or SHared

What’s new How to set the address of the pGD terminal using system mask
How to set the address of the pCO using system mask
How to set the address of the pCO using bush button and 2 digit display
How to show the diagnostic mask (NetStat)

Description (This is not an exercise)


Specifications See slide and video tutorial for more details.

1tool BASIC course - Exercise book Ver.3.1 70 / 70

You might also like