Novatek-electro RS-485 Operating Manual page 36

Interface controller
Table of Contents

Advertisement

<act ref> - reference to the action of format An, where n is the index of the action.
Table C.8 – Types of responses
<cond ref> ACT <act ref>
<cond ref> REPEAT <act ref>
Example:
!REACTS
* C0 ACT A0
* C1 REPEAT A1
3. Examples of programs
Below there are examples of finished programs, each consists of a single task file. To run the sample on the
EM-481 it is necessary:
1) Create a text file (with the extension ".txt") with program text.
2) Put the file in the folder "TASKS".
3) Put the prepared folder to the memory microSD card, formatted in FAT or FAT32.
4) Put the memory card in the EM-481.
3.1. Example 1
This example describes a program that in the event of fault of the device will send SMS with warning. In the
text 3 – MODBUS ID of the device is OM-310; 240 – is the register address which is monitored for the fault.
#enabling relay 1 depending on bit 0 of register 240 of device 3
!META
th
#8
version of Protocol
*PROTOCOLVERSION 8
#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
#ЕМ-481 can read and record no less than 120 registers per one query
#note the second character * - it is MODBUS ID of the EM-481 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 less 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
EM-481
36
-
Perform once. If the condition occurred, but did not occur in the previous
update, the action will be performed once
Perform each time. Regardless of the previous state, the action will be
executed. The action will be executed even, if the state conditions are not
defined in this update due to reading errors, but this condition has already
happened earlier
-
NOVATEK-ELECTRO

Advertisement

Table of Contents
loading

This manual is also suitable for:

Em-481

Table of Contents