In this third and last article of this series we will add two libraries in our Lazarus project and the event handling.
The compiled project can be found at TrustFm website.
We are going to use the synaser library (part of synapse) for the serial communication and the PlotPanel in order to plot our real time graph.
For synaser we are going to add only the "synaser.pas" file into our project.
For the PlotPanel we need to add the "plotpanel.pas" file into our project.
More informations for synaser can be found here and for PlotPanel here
We have seen in this article how to hack fiscally our multimeter.
Now we have to start building our software in order to parse the 14 byte hexadecimal string into something more human.
The knowledge of bitwise operations is highly recommended and specially the masking technique (bitwise AND).
It is now time to start !
From the FS9721-LP3 documentation we clearly see that we get as response from the device a 14 byte code.
Each byte of this code has this structure NNNNXXXX where NNNN is the number of the segment of the table.
The reported table below has 14 segments (seg1-14).
The XXXX part reveals which bits of the NNNN segment are active (1 = true) or not (0= false).
We immediately understand that a correct code should be 1X 2X 3X 4X 5X 6X 7X 8X 9X AX BX CX DX EX since all the segment columns of the table should be filled.
Time for an example. If the first byte of the 14-byte code is 17 (in hex) means that we are talking about the segment 1 (which is correct) and the settings for this first segment are 7 (in hex) or 0111 in binary.
From the table we discover that RS232,AUTO and DC should be on and AC off.
MASTECH MS8229 is a 5 in 1 multimeter with excellent value for money rate.
By reading this post we have found that the IC used by this multimeter was the : FS9721-LP3.
This chip has RS232 output capabilities. The data-sheet can be downloaded from here : FS9721-LP3
The idea here is , starting from the IC documentation, to hack this multimeter, extract the data via RS232 and with the help of a dedicated software to be capable to do data logging.
This will be a hardware to software approach.
The pages 13 and 14 of the data sheet describe the transmission protocol.
Based on these two pages we will produce later our software application.
In the page 15 we can clearly see how we must hack our multimeter in order to output our serial data.