~ 41 ~
NOVATEK-ELECTRO
EM-486
1) Create a text file (with the extension
".txt"
) and program text.
2) Place the file in the folder
"TASKS"
.
3) Put the prepared folder on the memory microSD card, formatted in FAT or FAT32.
4) Put the memory card in the EM-486.
3.1 Example 1
This example describes a program that in the event of fault of the OM-310 will turn on the 1st relay on EM-486. In the
text 3
– MODBUS ID of the device is OM-310; 240 is the register address which is monitored for the accident
.
# enabling relay 1 depending on bit 0 of register 240 of device 3
!META
#5
th
version of Protocol
* PROTOCOLVERSION 5
# program run will be fulfilled every 3 seconds
* UPDATE 3
# in case of error of the parameter reading, it will be read again 2 times
* PARAMRETRIES 2
# limit of response waiting for MODBUS query is 1000 msec = 1 sec
* PARAMTIMEOUT 1000
# after each query the delay is added, equal to the response waiting time,
# so the other clients can perform their queries
* PARAMLOADRATIO 50
!DEVICES
#
ЕМ
-486 can read and record no less than 120 registers per one query
# note the second character * - it is MODBUS ID of the EM-486 device
* * WRHANY 120 120
#
ОМ
-310 has MODBUS ID equal to 3 and allows reading 4 registers per one query,
# but to record only one register per one query
* 3 WRHSINGLE 4
!PARAMS
# during each updating, it is required to read the storage register with address 240,
# from the device with MODBUS ID equal to 3
# UINT16
–
means that the 16-
bit value and unsigned one (it can’t be l
ess than 0)
0 3 UINT16 H 240
!VARS
# copy zero bit of the register 240
# now in the variable the parameter value is 240.0
0 PARAMBIT P0 0
!CONDS
# variable V0 is compared with 1, condition is met, if V0 = 1
0 VAREQVAL V0 1
# condition is met, if the previous condition is not fulfilled and vice versa
1 NOT C0
!ACTS
# enable the first relay, the second unit is the number of the relay
0 RELAYON 1 1
# disable the first relay
1 RELAYOFF 1 1
!REACTS
#
if С0 condition is fulfilled (if 240.0 = 1), then hold the
relay 1 enabled
* C0 REPEAT A0
#
if С1 condition is fulfilled (if 240.0 is not equal to 1), then the relay 1 is disabled
* C1 REPEAT A1
# END
–
comment at the end of the file for correct reading
3.2 Example 2
In this example, the program controls the hysteresis value on the second channel of the TR-101 device, depending on
the temperature on the sensor of the first input of EM-486. In the text 16
– MODBUS ID of the device is TR-101; 47 is the
address of register for the hysteresis of the second channel
ТР-101.
The program uses registers in the field of current user settings 5500-5749. Registers 5500 and 5501 are reserved for
the values respectively of the lower and upper temperature limits and the registers 5502 and 5503 are for the hysteresis
value to be set in TR-101 if achieving the temperature respectively the lower or upper limits. These registers are read-