EXAMPLE

This scenario demonstrates how to configure a robust data logging schedule. Every 10 minutes, the device polls a Modbus RTU peripheral.

  • On Success (RTR): The device appends a formatted data log entry containing a precise timestamp and the newly acquired register values into a text file. The file name is dynamically generated using the current date (e.g., 260624.txt), creating automated daily logs.
  • On Failure (RTF): The device catches the communication timeout or exception and logs a failure record directly into the same daily file, ensuring data continuity and providing a reliable diagnostic audit trail.


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