There are two different VBA executables available in Visual Studio. See also the article about the VBA-debug app for more information.

 (for the following information knowledge of Visual studio is needed)

The two executables are different in the way of communication with the board; e.g. one for communication directly by a communication port (serial communication) and the other is communicating with IP sockets. I’m planning to make just one general app for both (otherwise it is a lot of -extra- work to maintain the software). So in my own interest it is best to make a mixed form, supporting both protocols. Remark: the sketch contains the same functionality for both communicatiion protocols; serial. Serial comunication is also used for the IP shields (WiFi). The WiFi shield handles the communication via IP with the VB app and serial communication is handled with the board like the direct serial communication as for example, serial bleutooth, hard wired serial to USB or serial/radio to USB. The ESP-07 shield for use with IP and serial communication is also programmed in Visual Studio like a normal Arduino board (in this way the MEGA 2560 is not used for communication with the internet and cycle times can be hold a short as possible).

At the moment there are two sets of parameters to start and control the applications (some knowledge of VBA and file structure of Visual studio is needed).

Steps to make a working shortcut for execution of the VBA application:

  • First you have to make a short cut of the executable generated by Visual Studio. Be aware that you can generate an executable with or whitout VBA debug code in Visual studio (release/debug version). Find the executable in the folder “…\my-project\ArduinoScada\bin\Release” or “…\my-project\ArduinoScada\bin\Debug”
  • Make a short cut of the executable and add the following parameters in case of the Serial version:
    …/my-executable.exe /comport=com5 /baudrate=9600 /monitor=YES (or NO)
    where comport is the comport of the serial connection of the board, baudrate is the communication speed (must be the same in both sketch as VBA program) and monitor is een key for painting the known tags (with information) on the VBA screen. Sometimes you don’t want to make use of the default painting of the tags on the screen and use the application for DIY scada forms (see also the next articles), in that case the key has to be omitted or has the value NO.
  • Make a short cut of the executable and add the following parameter in case of the IoT version:
    …/my-executable.exe /IP= /port=80
    where IP is the IP number of the Wifi shield and port is the port number of the IP connection. The used IP number used by the shield, can be obtained by e.g. examening your home router (connected users). The used Wifi shield is default connected with DHCP (ok, a dedicated IP number is also possible; but not used by me). Future purpose is to extend this set with also the monitor parameter.