The communication between the MEGA2560 and HMI (Scada) on the PC is communicating via Wifi. To keep full capacity for the AFSM on the MEGA board, the communication is pratically the same as the version with serial connection; TTL/USB, blue tooth or e.g. the APC220. The hardware serial connection of the MEGA is connected to an ESP8266 (separate card or on board the MEGA). The ESP is taking care of the network communication.
- The ESP8266 is now connected at the TX3/RX3 hardware serial port of the MEGA board, at a baudrate of 115200.
- The queue mechanism in VBA for resending lost message can be turned on/off. In some situations, messages can be lost occasionally (like trending). In such a case you can turn of the VBA message queue. It is done by an extra command line parameter: "C:\.....\FirstProject.exe" /ipadress="192.168.178.178" /port=1500 /que=ON (or OFF).
- The ESP8266 is receiving and sending the "@" messages for communication between the board and VBA. When it is not a "@" message, the ESP messages and information is printed at the serial monitor from the MEGA board. At the startup of the ESP, all messages, like network scan, IP-address and server messages, are now printed for debug purposes.
- Build in watchdog for monitoring communication with the PC (LED13 is blinking in a frequency of 500mS, at the off period there is a little blink indicating the communication is working).
The software is tested on a MEGA2560 with an onboard Wifi and a MEGA2560 with a separate ESP8266. See also the picture below.
The next upgrades are implemented per Aug 27, 2018.
- The reading of ultrasonic HC-SR04 (standard ultra sonic device) is now programmed in the sketch itself. The NewPing library is not longer used.
- Performance issue: Message @CHM, Cancel HMI Messages is now part of the standard. When closing the debugger form (trigger "closing" in VBA), the message is send to the board and all poll and report messages are cancelled. Not yet implemented on the raspberry pi platform.
- Possible to subscribe to the AFSM newsletter. Newsletters will be send by mail when there is important news or new/updated downloads (probably once per 3 months). Subscribe at the home page! Your e-mail adress will not be used for other purposes and will not be copied to others.
Reading on the internet about embedded systems, the arduino boards are popular because of the easy way of programming. The embedded software engineers are not enthusiastic about the use of Arduino boards, stronger; some of them are just negative about the Arduino boards. Yes, an Arduino board can be programmed without any knowledge of registers, irq’s and that sort of stuff. For embedded software engineers, this is the main reason to not use an Arduino board for embedded systems.
But then again, is it necessary to know exactly how the processor is working? It was a challenge to make the FSM the way it is at the moment and it’s now possible to create stable controls with the arduino as central processor. Knowledge of the processor hardware is not needed, just concentrate on the functionality of the control you are building instead of worrying about stacks, heaps, irq’s and registers. As written on the home page, the FSM can be used for making a complex stable finite state machine with possibilities to debug the control by presenting the I/O and (active) states on your PC. In my opinion debugging the functionality of a control is just another sort of debugging mostly mentioned by embedded programmers.
Ok, I don’t care how the hardware is working in detail. What counts is the free and stable software for development of the software (everything is made in Visual studio 2017) and the hardware is relative cheap. Ah… just call it an arduino system, everybody happy. If you have another opinion, please let me know. Just curious.
Raspberry PI 3b
The development of the debug application for the PC (Windows 10) is paused for a while. The actual version is stable, there are some improvements possible but they can be categorized as the remaining "10%". Probable extra development is taking lots of time.
But... now i have received my first Raspberry PI version 3b. Goals for the coming period is making the same sort of debug application for the Arduino MEGA on the Raspberry, based on the AFSM as described in the website (sketch interface). The Raspberry is programmed in Phyton. I used Tkinter for making the GUI. At the moment the most basic components are working; When connecting a AFSM sketch to the Raspberry, the GUI is automatically filled with the known tags present/known on the Arduino board. Tags are dynamically updated on the form. The possible states are presented in a text widget, where an active state has a green background and yellow caracters. States are also updated. Masking and forcing is like the VBA app possible by message or by a click on the process value (see the example). I used a monitor for presenting and programming the application; goal was a simple SCA (not DA yet), so i've ordered a HMI screen the size of the raspberry...