You are on page 1of 19

SGH Technology

Controller i Greenhouse - small controller v 3.1


Using the configurator

The controller of the series "iGreenhouse - small controller v3.1" has advanced features, and for their
full use it is necessary to make the appropriate settings using the settings utility. The configuration
utility must be installed from the installation package file, which you can download from the
repository at https://www.iteplica.ru/downloads.php. The file is named Config_xxx.zip (always
choose the highest numbered file).

After starting the application, you will see the main window, as shown in the figure below:

The purpose of the elements on this screen:

Hardware ID1, Hardware ID2, Hardware ID3 - unique numbers of controller identifiers. To read
them, you need to connect to the controller via a mini-USB cable and click the [Read from PLC
hardware ID number] button.

[Apply license] - button for entering a license. The controller comes with an activated license, but if
the firmware is replaced, the license is lost. Each controller in the delivery set has a unique serial
number that must be entered in this window to reactivate the license. After pressing the [Apply
license] button, it is necessary to restart the controller by pressing the Reset button or reconnecting
the general power supply. After that, the license will be activated.

SGH Technology, https://www.iteplica.ru support e-mail: support@iteplica.ru Page 1


SGH Technology
Controller i Greenhouse - small controller v 3.1
The next tabs are UART1 and UART2. They are the same, and therefore we will only consider one
of them. The appearance after switching the bookmark will be as shown in the figure below:

The purpose of the elements on this screen:

Modbus master option - when activated, the program switches the corresponding
UART1 or UART2 to the modbus RTU network master mode.

Modbus slave option - when activated, the program switches the corresponding
UART1 or UART2 to the slave mode of the modbus RTU network.

Option Not use - when activated, the program deactivates the corresponding UART1
or UART2.

Speed setting - here you can select the speed of data exchange in the form of a drop-
down list. The following values are supported:
9600,19200,38400,57600,115200,187500,256000,500000 kbps.

Parity setting - here you can select parity values. The following values are supported:
Odd, Even, None.

[Write to PLC] - writing the configuration of the corresponding UART1 or UART2 to


the controller. It should be noted here that if you changed the UART mode, for example,

SGH Technology, https://www.iteplica.ru support e-mail: support@iteplica.ru Page 2


SGH Technology
Controller i Greenhouse - small controller v 3.1
from slave mode to master mode, then you will need to restart the controller by pressing
the Reset button or reconnecting the general power supply.

[Upload from PLC] - reading the current configuration from the controller. After
pressing this button, the program will fully read the configuration of the corresponding
UART1 or UART2 and, according to the settings, will change the appearance of the tab.

Important! When the controller is shipped or immediately after a software update, UART1 is
configured as a slave with address 1 and baud rate 115200, no parity, 8 bits, 1 stop bit. UART2 is
configured as slave with address 2 and baud rate 115200, no parity, 8 bits, 1 stop bit. That is, you
can immediately use the ports of data exchange without any configuration.

In the wizard mode, you will be shown a window as in the picture below:

Purpose of controls:

[Add slave] - used to add and configure a data request by the master.

[Modify slave] - used to modify and customize an existing data request by the master. To edit, you
need to select the required line and click on this button. A dialog will open that will contain all the
data for editing.

[Delete slave] - used to delete a data request by the master.

SGH Technology, https://www.iteplica.ru support e-mail: support@iteplica.ru Page 3


SGH Technology
Controller i Greenhouse - small controller v 3.1
A table with the following headers is also visible:

Slot - number of the data request.

Address - the address of the slave for which this master's request is addressed.

Num word - the number of words or bits in the master request.

Address slave - the address of a word or bit in the slave address space, from which the master starts
reading or writing.

Address master - the address of a word or bit in the master's address space, from which the master
starts reading or writing.

Function - modbus RTU function. Supports writing or reading bits from the M0-M3072 area, writing
or reading words from the D0-D8000 area. In the case of using a device other than our controller,
respectively, you can work with 3072 bits of coils and 8000 storage registers.

Timeout [ms] - time during which the master will wait for a response from the slave. The time is
considered by the controller from the beginning of the request, that is, the timeout takes into
account the duration of the request itself.

To start configuring in master mode, you need to activate the Modbus master control by simply
right-clicking on the control. You will also be shown a configuration table. To add a master request,
click on the Add slave button, and you will see the following pop-up window:

Purpose of controls:
Slave number – slave number in the configuration.Changes
automatically.
Slave modbus address - slave address in the modbus RTU
network.
Function type - modbus RTU function type. Can take values:
Read coils, Read holding register, Write multiply register,
Write coils.
Word / Coil number to read / write –slave part - number of
registers or binary values to read from the slave or write to
the slave.
Slave address point start read / write - address in the memory
area of registers or binary values for reading or writing. The
address belongs to the slave.
Master address to place Word / Coil fro slave - address in the
memory area of registers or binary values for reading or writing.
The address belongs to the master.
Timeout [ms] - time to wait for a response from the slave. At this time, the query itself is also
included.
SGH Technology, https://www.iteplica.ru support e-mail: support@iteplica.ru Page 4
SGH Technology
Controller i Greenhouse - small controller v 3.1
This picture shows the following configuration - slave address 3, 100 registers will be read from it,
starting from address 0 and placed in the master register block with offset 0 and with a timeout of
100ms.

All addresses are double checked to avoid loading incorrect values into the controller. And so there
are limits for values:

The slave address cannot be more than 248.


The number of registers when writing cannot be more than 123, and when reading, not more
than 125. The number of binary values (coils) cannot exceed 255.
The address in the register block of the slave or master cannot be more than 7999. The address in
the block of coils (binary values) cannot be more than 3071.
The timeout cannot be more than 65535 msec.

Now we will consider several configuration options:

Slave with address 4, read coils, number 250, start reading


from address 800 in the slave, write the data to the master's
block of mergers from address 900, wait for a response
from the slave within 250 ms.

Slave with address 5, read storage registers, number 75, start


reading from address 10 in the slave, write data to the
master register block from address 90, wait for a response
from the slave within 100 ms.

SGH Technology, https://www.iteplica.ru support e-mail: support@iteplica.ru Page 5


SGH Technology
Controller i Greenhouse - small controller v 3.1

Slave with address 9, write storage registers into it, number


122, start writing from address 600 in the slave, read data
from the master's register block from address 500, wait for a
response from the slave within 75 ms.

Slave with address 79, write binary data (coils) into it, the
number of 200, start writing from address 50 in the slave,
read the data from the master's register block from address
25, wait for a response from the slave within 400 ms.

SGH Technology, https://www.iteplica.ru support e-mail: support@iteplica.ru Page 6


SGH Technology
Controller i Greenhouse - small controller v 3.1
When you select the slave mode, you will be shown the following window:

Speed and parity are set here in the same way as in the master mode.

The only difference is that in the MB address field, you can set the slave address in the modbus RTU
network for the corresponding UART1 or UART2 port. To activate the slave mode after loading the
configuration into the controller memory, it is necessary to restart the controller using the Reset
button or by reconnecting the main power supply.

In this controller, holding registers with addresses 0-8000 correspond to general-purpose registers of
the D0-D8000 controller, the general-purpose marker area of the M0-M3071 controller corresponds
to coils 0-3071. All of these areas support both reading and writing of values. Also, these data areas
in the controller are permanently stored in an independent RAM memory, supported by a battery
backup. Access to the system values area D8000 - D8125 and M8000-M8255 is not supported.

SGH Technology, https://www.iteplica.ru support e-mail: support@iteplica.ru Page 7


SGH Technology
Controller i Greenhouse - small controller v 3.1
The next tab is the section for configuring the 1-wire network slaves. General view is shown in the
figure below.

Purpose of controls:

1-wire master - designed to activate the 1-wire network master mode. Not use - designed to
deactivate the 1-wire network master mode.

[Write to PLC] - button for activating the configuration writing mode into the controller's non-
volatile memory. If you enable the wizard mode, then to activate you will need to restart the
controller by pressing the Reset button or reconnecting the main power supply.

[Upload from PLC] - button for receiving the current configuration from the controller's non-volatile
memory.

SGH Technology, https://www.iteplica.ru support e-mail: support@iteplica.ru Page 8


SGH Technology
Controller i Greenhouse - small controller v 3.1
After activating the 1-wire network master mode, the configuration table will be shown as in the
figure below.

Purpose of controls:

[Add slave] - button for adding a new 1-wire network sensor.

[Modify slave] - button for editing 1-wire network sensor data.

[Search slave] - button for activating the search mode for connected sensors of 1-wire network.
Finding sensors is currently the fastest and most accurate way to prepare a configuration.

To start configuring in master mode, you need to activate the 1-wire master control by simply right-
clicking (right mouse button) of the mouse in the control. You will also be shown a configuration
table. Further, by clicking on the [Add slave] button, you activate the data entry window, which is
shown in the figure below.

SGH Technology, https://www.iteplica.ru support e-mail: support@iteplica.ru Page 9


SGH Technology
Controller i Greenhouse - small controller v 3.1
Here you can manually enter the 8-byte address of the sensor and the address in the controller
memory, where the data will be written in case of a successful temperature reading. Format records
of sensor addresses - hexadecimal, controller memory address - decimal. By clicking on the [Add /
modify] button you save the address you entered in the configuration table. Here, as well as for the
modbus RTU wizard, the values can be edited directly in the table. To do this, make a double quick
LMB click (left mouse button) on the cell that you are going to edit. The data in the cell will be
highlighted in blue, and you can delete old values and enter new ones. Press Enter to confirm the
entry of new data.

The [Modify slave] button is intended for manual data editing. To edit you need to highlight the
required line and click on this button. A dialog will open that will contain all the data for editing.
Picture below:

The [Search slave] button is designed to activate the 1-wire network sensors search mode. After
clicking it, the sensor search window will be activated, which is shown below:

The purpose of the controls of this window:

Number sensor on the bus - the number of sensors determined by the search algorithm.

Start address for automatic slave addition in the main - starting address for automatically increasing
the address of data recording from sensors. The memory area of the registers D0-D8000 is used as a
SGH Technology, https://www.iteplica.ru support e-mail: support@iteplica.ru Page 10
SGH Technology
Controller i Greenhouse - small controller v 3.1
memory area. We strongly recommend using only even values here, for example 100, 102, 1040,
etc.

[Start search] - button for starting the sensor search algorithm.

[Replace all in the table] - the button for deleting the old sensor configuration and writing the newly
found sensors to the configuration.

[Add new in the table] - adding found sensors to an existing configuration.

Important! To carry out the correct search operation, you must activate the wizard mode in
advance. Otherwise, the search algorithm will give you all zero values and show that one sensor was
found. This error situation is shown in the figure below:

Correct activation of the mode is performed by selecting the 1-wire master option using the LMB of
the mouse. After that, press the [Write to PLC] button. Upon completion of the download, for
activation, you must restart the controller by pressing the Reset button or reconnecting the main
power supply. The result of a correctly conducted search is shown in the picture below. Here the
addresses of 2 temperature sensors are correctly defined.

SGH Technology, https://www.iteplica.ru support e-mail: support@iteplica.ru Page 11


SGH Technology
Controller i Greenhouse - small controller v 3.1

By clicking on the [Replace all in the table] button you can clear the current configuration and use
only those sensors that you found using the search procedure.

By clicking on the [Add new in the table] button you can add the found sensors to your existing
configuration.

Clicking the [Close] button closes the window without any configuration

The figure below shows a window with a configuration of 2 sensors, which were added as a result of
the sensor search procedure

SGH Technology, https://www.iteplica.ru support e-mail: support@iteplica.ru Page 12


SGH Technology
Controller i Greenhouse - small controller v 3.1
Here columns Byte 0 –Byte 7 contain the bytes of the address of the sensors in hexadecimal
representation, column Dxxxx is the address in the wizard area, where ready-made temperature data
will be written in case of a successful exchange. Here for sensor 1 the address of record 2 (in the
register area it is D0002), for sensor 2 - the address of record 4 (in the register area D0004). The
maximum number of sensors on a given bus is 128 pcs.

Further, after completing the sensor search procedure, it is necessary to write the configuration to the
controller. To do this, click the [Write to PLC] button. The program will show the operation
confirmation window as shown below.

After pressing the [OK] button, the configuration is written to the controller. Upon completion of
the download, for activation, you must restart the controller by pressing the Reset button or
reconnecting the main power supply.

The next tab is the page for diagnostics of the UART1 and UART2 communication blocks. General
view is shown in the figure below:

Diagnostics works when the communication unit is configured to act as a modbus RTU master and
has at least a minimal operating configuration. To read the status, press the corresponding button -
SGH Technology, https://www.iteplica.ru support e-mail: support@iteplica.ru Page 13
SGH Technology
Controller i Greenhouse - small controller v 3.1
for the UART1 data exchange module - [Read modbus buffer 1], for the UART2 data exchange
module - [Read modbus buffer 2].

The picture below shows an example of how the diagnostic unit works - UART1 is configured as a
master with 8 exchange slots, UART2 works as a slave. At the same time, no slave answers.

The figure below shows the diagnostic module window with 8 slaves running

SGH Technology, https://www.iteplica.ru support e-mail: support@iteplica.ru Page 14


SGH Technology
Controller i Greenhouse - small controller v 3.1
The next tab is the module for diagnostics of the 1-wire data exchange unit.

To read the status, the communication block must be active and have at least a minimum sensor
configuration. The appearance after opening the tab is shown in the figure.

To read the state of the data exchange block, press the [Read 1-wire buffer] button. After reading the
data from the controller, you will be shown it
state.

SGH Technology, https://www.iteplica.ru support e-mail: support@iteplica.ru Page 15


SGH Technology
Controller i Greenhouse - small controller v 3.1

In case of a successful exchange for 2 sensors, the following picture will be shown:

If there is no response from the sensors, you will be shown the following picture:

SGH Technology, https://www.iteplica.ru support e-mail: support@iteplica.ru Page 16


SGH Technology
Controller i Greenhouse - small controller v 3.1
Here 15 is a circular error counter that counts from 0 to 31.

The next bookmark is a converter for converting floating point numbers. The fact is that if it is
necessary to set a constant for a controller, we use a number in hexadecimal format as a floating
point number, but with a display in the IEEE754 standard. To convert a floating point number to the
IEEE754 standard and back, enter the number into the window and click on the [To IEEE] button.
Below is an example of converting 23.5 to 41BC0000 in the IEEE754 standard and vice versa.

The default decimal separator is point, but you can also use a comma.

[To IEEE] button converts from floating point format, [To float] button converts to floating point
format. Below is an example of use - in this case, a block for comparing sensor data taking into
account the dead zone.

SGH Technology, https://www.iteplica.ru support e-mail: support@iteplica.ru Page 17


SGH Technology
Controller i Greenhouse - small controller v 3.1
General view and purpose of the board pins:

SGH Technology, https://www.iteplica.ru support e-mail: support@iteplica.ru Page 18


SGH Technology
Controller i Greenhouse - small controller v 3.1
The following is the pin assignment:

Y0 PA7
Y1 PB0
Y2 PB1
Y3 PB11
Y4 PA0
Y5 PA4
Y6 PA5
Y7 PA6

X0 PA15
X1 PB3
X2 PB4
X3 PB5
X4 PB9
X5 PB8
X6 PB7
X7 PB6
UART1 RX -PA10 TX -PA9
DE(RS485) -PA8

UART2 RX -PA3 TX -PA2


DE(RS485) -PA1

Onewire BUS - PB10


Mandatory pullup resistor 4k7 on Vcc
PC13 - enable output channels. The active level is low.

You can find firmware updates, as well as additional materials on our support forum for this product
- https://iteplica.ru/forum/viewforum.php?f=7

https://sudonull.com/post/10562-Blue-pill-blue-tablet-STM32F103-as-a-PLC

SGH Technology, https://www.iteplica.ru support e-mail: support@iteplica.ru Page 19

You might also like