The example shows a way to make the embedded code reusable and platform independent. HART is used for the communication and the Windows terminal as display.
The following shows how the code from the example application is further realized.
The outputs and inputs are made via a console. Behind this is access to the Windows terminal. The applied methods are defined in the CVConsole class.
For example, the function Init looks like this.
The realization here still looks relatively abstract for the most part, but it already accesses certain functions of the console API. A look at the ClearSteadyDisplay() function shows how further refinements are being made.
This function 'paints' the background and the border of the white display area and is not quite as trivial as the two higher levels. But the function is self-contained and therefore easier to understand.
The integration of the HART protocol communication software is designed similarly to the integration of the console. The basis here is the HartTools DLL together with the header file BaHartDrv76.h. The class with the access functions is declared as follows.
The functions of this class then access the interface of the DLL.
I think it would go beyond the scope to go into more detail here. This example will be available in HartTools 7.6 (Developer) in the summer (this Year, by the way). Then you are welcome to inspect and test it in detail.
Incidentally, the HartTools themselves proved to be very useful in the development of this example. In addition to a real device, I used the slave integrated into the FrameAlyst to run tests.