HMI DIY-Scada

As explained in prior sections of the website, it is possible to make your own HMI forms with all the benefits of the standard debugger. An example of a very detailed DIY form, is the fishtank project (under the project section). Making your own HMI form is easy and is described in this article. 

 NOTE: When writing your own scada, it is preferable to use the “empty” VBA solution as a basic template. The template contains all functions. Use the below description to get the I/O tags on your DIY form. The communication to the sketch is based on Textbox controls. If you wish, you can program events on the Textbox (do something with color or update other controls… all up to you). Easy learning by doing in VBA. When starting your application, don’t forget to add and set the right parameters for your shortcut: /comport=<used comport> /baudrate=<used baudrate> /monitor=NO. Use NO for the monitor, otherwise the application will paint all tags on your fresh created form and will set the form width automatic.

The same procedure applies for all datatypes. 
First of all, open the standard Visual Studio solution, the Solution explorer and open the Master.vb design form. 

Open the toolbox from the Visual studio View tab (or use the Ctrl_Alt_X key) and place a new TextBox control on the VBA form for the given tag(s). When placed on the form, right click the control and chose “properties” from the pull down menu.  Then give the TextBox control the same name as the tagname known in the sketch.  The next step is different for all datatypes.  Because of the fact that digital inputs can be “masked” and digital outputs can be “forced”, a specific ContextMenuStrip must be connected to the control for all types of data. Below an overview for all different datatypes and matchin ContextMenuStrip names.

Select a textbox control from the toolbox and drag and drop it to the Master form. 

When drag/dropped TextBox control to the form, edit the properties of the Textbox control


Open the properties list of the control, by a right click on the textbox.

Change the name to the tagname (is this case S1) and set the right contextmenustrip for the given datatype. 
In the table below the name of the ContextMenuStrip per I/O type. 

I/O typeContextMenuStrip
DODigOutForce
DIDigInMask
AIAnaInMask
AOAnaOutForce
TTTTMask
DMUltrasonicMask
SOServoForce
DigitalmarkerDigOutForce
AnalogueMarkerAnaOutForce
TEXTmarkerTextForce

Runtime

When running the HMI, you now have all the benefits of the AFSM standard application. With a right click on the control you get all possibilities for controlling your I/O. This is all you have to do. Runtime example of HMI:

Use of the context menus

When a TextBox control is placed on the form as explained in the prior text, the control is fully automatic updated when the value of the tagname/control is changed on the board. It is also possible to right click on the control for masking and forcing I/O. With the context menu it is possible to start database logging and mask a digital input. Every performed action is stored on the board, not on HMI; so when HMI is stopped and started again, the specific conditions for the I/O are the same. Special condition are reset when the board is restarted.
Right clicking on the digital input control presents a context menu for controlling the I/O. It is possible to mask the digital input with “0” or “1” and it is possible to remove the mask again. As you can see, the tagname is placed on top of the context menu (for information). When hovering over the control, the metadata is presented as information as a tooltip.