It is possible to communicate with more than 1 serial line from the 2560 board to other devices, so why not communicate to a second device for sending and receiving commands for supervisory control and data acquisition of the board (scada)? A serial RS232line could make serial communication, a serial to USB (radio) connection or for example a Bluetoothconnection. The standard sketch, supports functions for communication. Via the extra serial line the board is able to receive and send commands from another device. The "other" device is always the master and the Arduino board acts as a slave capable of executing all commands to control or influence the main loop of the finite state machine. Some examples of probable HMI's are a terminal program (simple) or a Visual Studio program. The only thing to do on the HMI master, is sending commands and process the received data from the board. No extra programming is needed on the board! It is only necessary to set a variable in the sketch (boolean UseHMISerial=true; or false when you decide not using the extra serial line). You also have to program the setup of the serial line (this is not necessary when TX1/RX1 is used; this is standard). 



In the following chapters, all available commands are described. In general there are commands for fetching, setting, polling[1] and getting meta[2] data.

 

Command

Description

@SDI

Single request Digital Information

@SAI

Single request Analogue Information

@FDO

Force Digital Output

@FAO

Force Analogue Output

@RTA

Return To Automatic

@PDI

Poll Digital Information

@PAI

Poll Analogue Information

@CAN

CANcel polling

@RDC

Request Digital Changes

@GMI

Get Meta Information

@MDI

Mask Digital Input

@MAI

Mask Analogue Input

@RMM

ReMove Mask

@FSM

Present the active FSM state

@FMT

Force marker text

@FSO

Force Server Output

@WTD

Watchdog message

@PMT

Poll Marker Text

@MTC

request Marker Text Change

@THM

set Time on the board

@CLT

request Cycle Time

@RAM

request free RAM on board

@TIM

request board Time

Above the APC220 RF set. Ideal for a serial connection between the board and a PC. Some shields for the MEGA2560 are standard equipped for this RF set. The PC side communicates via the USB connector block. The set is able to communicate over a sight distance of 1000m. I've tested this set over a distance of 500m and still worked with the AFSM.

 

[1] Fetching data with a certain frequency is called polling.

[2] Metadata is "data about data". Metadata assists in resource discovery by "allowing resources to be found by relevant criteria, identifying resources, bringing similar resources together, distinguishing dissimilar resources, and giving location information."