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). 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. |
|
|
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: |
|
|
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". |