EXAMPLE 1

Every 10 minutes read the contents of some registers from a ModbusRTU peripheral, the response will be stored in Avior internal registers.

Upon successful completion of each reading, append a line with the current time and the read values in a file that has the current date as its name.

If the reading is not successful, append a line to mark the failure of the operation.

Basically there will be daily files, each containing records every 10 minutes of the values read by the ModbusRTU peripheral.


SCH***0 SCHEDULE AT **:*0






AT#RTUR=1,4,2,3,W,,E10





trigger event occurs at every zero minute (***0).
Then at the minute 00 10 20 30 40 50, every hour.

The first action contains the command that sends to the ModbusRTU peripheral having address 1 a request to read the input register (4) starting from address 2 for 3 positions, the data is rendered as WORD (W) and transferred in 3 corresponding registers of Avior starting from E10.
More details on AT#RTUR command


RTR MODBUS RTU READ






AT#AFILE=S:LOGS/$D14.txt,T,"$D15: $E10 $E11"





trigger event is the completion of a ModbusRTU read.

The first action contains the command that appends to the $D14.txt file in the LOGS folder of the S::unit (SD card) a line containing:
TAG $D14 meaning the current day will be the name of the file
TAG $D15 which is the current time
TAG $E10 or content of register E10
TAG $E11 or content of register E11


RTF MODBUS RTU FAIL






AT#AFILE=S:LOGS/$D14.txt,T,"$D15: ERROR"





trigger event is the failure of a ModbusRTU request.

The first action contains the command that appends to the file $D14.txt in the LOGS folder of the S::unit (SD card) a line containing the current time and the text "ERROR".
The contents of the file will be something like this:
000000: 38 60214
000010: 36 61222
000020: 31 59321
000030: ERROR