Read RMS voltage Register!
00980C7E
0.5939
Actual voltage!
237.5762
Read RMS current Register!
0002AEE6
0.0104
Actual current!
0.0873
Read status Register!
007FC3BC
Read RMS voltage Register!
009805E8
0.5938
Actual voltage!
237.5360
Read RMS current Register!
0002AF74
0.0104
Actual current!
0.0874
Read status Register!
007FC2D6
Read RMS voltage Register!
0097F7F8
0.5936
Actual voltage!
237.4509 ---------------------------> (i need this value)
Read RMS current Register!
0002ACE0
0.0104
Actual current!
0.0870 ------------------------> (i need this value)
Read status Register!
00920089
how do i write a c++ program to get the values?
as this text file kept updating, i need to always get the newest value (which values are insert at the bottom) will it affect the updating of the text file?
Read the whole file line by line until you find line "Actual voltage!" then read and analyze the next line (it will contain voltage value). The same story is with the current.
PS to read line use getline(inputStream, inputString);
Well, technically you don't have to read the entire file, you just have to start reading somewhere before the information you want is found.
If we can assume the worst size values for the floating point numbers, we can say that we need to seek to somewhere around 150-160 bytes (characters) before the end of the file, and start reading lines from there.
When you encounter a line that reads "Actual voltage!" then you know that the very next line will contain the voltage value you want, and likewise for the lines that start with "Actual current!". Once you get both of those, you are done.