summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSudhakarKuma2021-05-07 11:25:48 +0530
committerSudhakarKuma2021-05-07 11:25:48 +0530
commitec097df32b76c22341896d2ab33319fb97af2f89 (patch)
treee0d302c3b14fd0478c60e8d01ff5b02d6f8ecd7c
parente944b6344096ab08d1d20d97d2fc838061cd49e7 (diff)
downloadFLOSS-Arduino-Book-ec097df32b76c22341896d2ab33319fb97af2f89.tar.gz
FLOSS-Arduino-Book-ec097df32b76c22341896d2ab33319fb97af2f89.tar.bz2
FLOSS-Arduino-Book-ec097df32b76c22341896d2ab33319fb97af2f89.zip
update Modbus chapter
-rw-r--r--bibliography.bib56
-rw-r--r--floss-arduino.OpenModelicad4
-rw-r--r--floss-arduino.ard2
-rw-r--r--floss-arduino.aux239
-rw-r--r--floss-arduino.bbl28
-rw-r--r--floss-arduino.blg60
-rw-r--r--floss-arduino.cod8
-rw-r--r--floss-arduino.fdb_latexmk78
-rw-r--r--floss-arduino.fls40
-rw-r--r--floss-arduino.juliad4
-rw-r--r--floss-arduino.lof22
-rw-r--r--floss-arduino.log169
-rw-r--r--floss-arduino.lot12
-rw-r--r--floss-arduino.pdfbin30212624 -> 31639716 bytes
-rw-r--r--floss-arduino.pyd4
-rw-r--r--floss-arduino.synctex.gzbin2913670 -> 2864201 bytes
-rw-r--r--floss-arduino.thm19
-rw-r--r--floss-arduino.toc25
-rw-r--r--indent.log25
-rw-r--r--user-code/modbus/figures/active-power-output-setup.jpgbin351924 -> 970986 bytes
-rw-r--r--user-code/modbus/figures/active-power-output.pngbin92783 -> 6070 bytes
-rw-r--r--user-code/modbus/figures/current-output-setup.jpgbin369988 -> 852771 bytes
-rw-r--r--user-code/modbus/figures/current-output.pngbin92428 -> 5616 bytes
-rw-r--r--user-code/modbus/figures/voltage-output-setup.jpgbin356309 -> 964103 bytes
-rw-r--r--user-code/modbus/figures/voltage-output.pngbin97782 -> 5506 bytes
-rw-r--r--user-code/modbus/modbus.tex1177
26 files changed, 1100 insertions, 872 deletions
diff --git a/bibliography.bib b/bibliography.bib
index a061587..58eca65 100644
--- a/bibliography.bib
+++ b/bibliography.bib
@@ -241,3 +241,59 @@ OPTannote = {}
}
+@Misc{modbus,
+OPTkey = {},
+author = {},
+title = {Modbus},
+howpublished = {https://modbus.org/},
+OPTmonth = {},
+year = {},
+note = {Seen on 6 May 2021},
+OPTannote = {}
+}
+
+
+@Misc{simplymodbus,
+OPTkey = {},
+author = {},
+title = {Simply Modbus},
+howpublished = {https://simplymodbus.ca/},
+OPTmonth = {},
+year = {},
+note = {Seen on 6 May 2021},
+OPTannote = {}
+}
+
+@INPROCEEDINGS{modbus-paper,
+author = {Shukla, Paavni and Singh, Sonal and Joshi, Tanmayee and Kumar, Sudhakar and Kelkar, Samrudha and Das, Manas R. and Moudgalya, Kannan M.},
+booktitle = {2017 6th International Conference on Computer Applications In Electrical Engineering-Recent Advances (CERA)},
+title = {Design and development of a MODBUS automation system for industrial applications},
+year = {2017},
+volume = {},
+number = {},
+pages = {515-520},
+doi={10.1109/CERA.2017.8343383}
+}
+
+@Misc{online-crc,
+OPTkey = {},
+author = {},
+title = {Online CRC},
+howpublished = {https://www.lammertbies.nl/comm/info/crc-calculation},
+year = {},
+note = {Seen on 2 May 2021},
+OPTannote = {}
+}
+
+@Misc{ieee-754-conv,
+OPTkey = {},
+author = {},
+title = {Floating Point Converter},
+howpublished = {https://www.h-schmidt.net/FloatConverter/IEEE754.html},
+year = {},
+note = {Seen on 6 May 2021},
+OPTannote = {}
+}
+
+
+
diff --git a/floss-arduino.OpenModelicad b/floss-arduino.OpenModelicad
index 7feb663..6222cba 100644
--- a/floss-arduino.OpenModelicad
+++ b/floss-arduino.OpenModelicad
@@ -24,7 +24,3 @@
\contentsline {section}{\numberline {10.{1}}Rotating the DC motor}{228}%
\contentsline {section}{\numberline {10.{2}}Rotating the DC motor in both directions}{229}%
\contentsline {section}{\numberline {10.{3}}Rotating the DC motor in both directions in a loop}{229}%
-\addvspace {10pt}
-\contentsline {section}{\numberline {11.{1}}Code for Single Phase Current Output}{248}%
-\contentsline {section}{\numberline {11.{2}}Code for Single Phase Voltage Output}{248}%
-\contentsline {section}{\numberline {11.{3}}Code for Single Phase Active Power Output}{249}%
diff --git a/floss-arduino.ard b/floss-arduino.ard
index fffb40c..01547e6 100644
--- a/floss-arduino.ard
+++ b/floss-arduino.ard
@@ -25,4 +25,4 @@
\contentsline {section}{\numberline {10.{2}}Rotating the DC motor in both directions}{208}%
\contentsline {section}{\numberline {10.{3}}Rotating the DC motor in both directions in a loop}{209}%
\addvspace {10pt}
-\contentsline {section}{\numberline {11.{1}}First 10 lines of the firmware for Modbus Energy Meter experiment}{243}%
+\contentsline {section}{\numberline {11.{1}}First 10 lines of the firmware for Modbus Energy Meter experiment}{245}%
diff --git a/floss-arduino.aux b/floss-arduino.aux
index 9cb57eb..d4f5fc8 100644
--- a/floss-arduino.aux
+++ b/floss-arduino.aux
@@ -1448,157 +1448,109 @@
\@writefile{OpenModelicad}{\contentsline {section}{\numberline {10.{3}}Rotating the DC motor in both directions in a loop}{229}\protected@file@percent }
\newlabel{OpenModelica:dcmotor-loop}{{10.{3}}{229}}
\@writefile{lol}{\contentsline {lstlisting}{/home/fossee/Desktop/floss-scilab-arduino/user-code/dcmotor/OpenModelica/dcmotor\textendash loop.mo}{229}\protected@file@percent }
+\citation{modbus}
+\citation{simplymodbus}
\@writefile{toc}{\contentsline {chapter}{\numberline {11}Implementation of Modbus Protocol}{231}\protected@file@percent }
\@writefile{lof}{\addvspace {10\p@ }}
\@writefile{lot}{\addvspace {10\p@ }}
\newlabel{modbus}{{11}{231}}
\@writefile{toc}{\contentsline {section}{\numberline {11.1}Preliminaries}{231}\protected@file@percent }
-\newlabel{fig:mod-block}{{\caption@xref {fig:mod-block}{ on input line 72}}{232}}
+\citation{simplymodbus}
\@writefile{lof}{\contentsline {figure}{\numberline {11.1}{\ignorespaces Block diagram representation of the Protocol\relax }}{232}\protected@file@percent }
+\newlabel{mod-block}{{11.1}{232}}
\@writefile{lof}{\contentsline {figure}{\numberline {11.2}{\ignorespaces Master-Slave Query-Response Cycle\relax }}{232}\protected@file@percent }
-\newlabel{fig:mod-master-slave}{{11.2}{232}}
+\newlabel{mod-master-slave}{{11.2}{232}}
+\@writefile{lot}{\contentsline {table}{\numberline {11.1}{\ignorespaces Pins available on RS485 and their usage\relax }}{233}\protected@file@percent }
+\newlabel{tab:rs-485-pins}{{11.1}{233}}
\@writefile{lof}{\contentsline {figure}{\numberline {11.3}{\ignorespaces Pins in RS485 module\relax }}{233}\protected@file@percent }
-\newlabel{fig:rs-485}{{11.3}{233}}
-\@writefile{lot}{\contentsline {table}{\numberline {11.1}{\ignorespaces Interpretation of a request packet\relax }}{234}\protected@file@percent }
-\newlabel{tab:request-packet}{{11.1}{234}}
-\@writefile{lot}{\contentsline {table}{\numberline {11.2}{\ignorespaces Interpretation of a response packet\relax }}{234}\protected@file@percent }
-\newlabel{tab:response-packet}{{11.2}{234}}
-\@writefile{lot}{\contentsline {table}{\numberline {11.3}{\ignorespaces Hexadecimal to Decimal\relax }}{235}\protected@file@percent }
-\newlabel{tab:ieee-decimal}{{11.3}{235}}
-\@writefile{lot}{\contentsline {table}{\numberline {11.4}{\ignorespaces Single and Double Precision Representation\relax }}{235}\protected@file@percent }
-\newlabel{tab:single-precision}{{11.4}{235}}
-\@writefile{toc}{\contentsline {section}{\numberline {11.2}Objective}{236}\protected@file@percent }
-\@writefile{toc}{\contentsline {section}{\numberline {11.3}Energy Meter set up for Modbus protocol with Arduino Uno}{236}\protected@file@percent }
-\@writefile{lof}{\contentsline {figure}{\numberline {11.4}{\ignorespaces MODBUS Set Up for Energy Meter\relax }}{237}\protected@file@percent }
-\newlabel{fig:full-set-up}{{11.4}{237}}
-\@writefile{toc}{\contentsline {section}{\numberline {11.4}Software}{237}\protected@file@percent }
-\@writefile{lof}{\contentsline {figure}{\numberline {11.5}{\ignorespaces Block Diagram for Energy Meter Setup\relax }}{238}\protected@file@percent }
-\newlabel{fig:block-diagram}{{11.5}{238}}
-\@writefile{toc}{\contentsline {section}{\numberline {11.5}Output}{238}\protected@file@percent }
-\@writefile{lof}{\contentsline {figure}{\numberline {11.6}{\ignorespaces Flowchart of Arduino firmware\relax }}{239}\protected@file@percent }
-\newlabel{fig:modbus-firmware}{{11.6}{239}}
-\@writefile{lof}{\contentsline {figure}{\numberline {11.7}{\ignorespaces Flow Chart of the Modbus Energy Meter Implementation\relax }}{240}\protected@file@percent }
-\newlabel{fig:flow-chart}{{11.7}{240}}
-\@writefile{toc}{\contentsline {section}{\numberline {11.6}Reading Parameters from Xcos}{240}\protected@file@percent }
-\@writefile{lof}{\contentsline {figure}{\numberline {11.8}{\ignorespaces Single Phase Current Output on Scilab Console\relax }}{241}\protected@file@percent }
-\newlabel{fig:current-console}{{11.8}{241}}
-\@writefile{lof}{\contentsline {figure}{\numberline {11.9}{\ignorespaces Single Phase Current Output on Energy Meter\relax }}{241}\protected@file@percent }
-\newlabel{fig:current-meter}{{11.9}{241}}
-\@writefile{lof}{\contentsline {figure}{\numberline {11.10}{\ignorespaces Single Phase Voltage Output on Scilab Console\relax }}{242}\protected@file@percent }
-\newlabel{fig:voltage-console}{{11.10}{242}}
-\@writefile{lof}{\contentsline {figure}{\numberline {11.11}{\ignorespaces Single Phase Voltage Output on Energy Meter\relax }}{242}\protected@file@percent }
-\newlabel{fig:voltage-meter}{{11.11}{242}}
-\@writefile{lof}{\contentsline {figure}{\numberline {11.12}{\ignorespaces Single Phase Voltage Output on Scilab Console\relax }}{243}\protected@file@percent }
-\newlabel{fig:power-console}{{11.12}{243}}
-\@writefile{lof}{\contentsline {figure}{\numberline {11.13}{\ignorespaces Single Phase Voltage Output on Energy Meter\relax }}{243}\protected@file@percent }
-\newlabel{fig:power-meter}{{11.13}{243}}
-\@writefile{toc}{\contentsline {section}{\numberline {11.7}Code}{243}\protected@file@percent }
-\@writefile{toc}{\contentsline {subsection}{\numberline {11.7.1}Arduino Code}{243}\protected@file@percent }
-\newlabel{sec:firmware-modbus}{{11.7.1}{243}}
+\newlabel{rs-485}{{11.3}{233}}
+\@writefile{toc}{\contentsline {subsection}{\numberline {11.1.1}Energy meter}{233}\protected@file@percent }
+\newlabel{sec:energy-meter}{{11.1.1}{233}}
+\@writefile{lot}{\contentsline {table}{\numberline {11.2}{\ignorespaces Operations supported by Modbus RTU\relax }}{234}\protected@file@percent }
+\newlabel{tab:modbus-fun-codes}{{11.2}{234}}
+\@writefile{lot}{\contentsline {table}{\numberline {11.3}{\ignorespaces Individual parameter address in EM6400\relax }}{234}\protected@file@percent }
+\newlabel{tab:params-addr}{{11.3}{234}}
+\citation{online-crc}
+\@writefile{lot}{\contentsline {table}{\numberline {11.4}{\ignorespaces A request packet to access V1 in EM6400\relax }}{235}\protected@file@percent }
+\newlabel{tab:params-rq}{{11.4}{235}}
+\@writefile{toc}{\contentsline {paragraph}{Note:}{235}\protected@file@percent }
+\@writefile{lot}{\contentsline {table}{\numberline {11.5}{\ignorespaces A response packet to access V1 in EM6400\relax }}{236}\protected@file@percent }
+\newlabel{tab:params-rp}{{11.5}{236}}
+\@writefile{toc}{\contentsline {subsection}{\numberline {11.1.2}Endianness}{236}\protected@file@percent }
+\citation{ieee-754-conv}
+\@writefile{lot}{\contentsline {table}{\numberline {11.6}{\ignorespaces Memory storage of a four-byte integer in little-endian and big-endian\relax }}{237}\protected@file@percent }
+\newlabel{tab:memory-storage}{{11.6}{237}}
+\citation{modbus-paper}
+\@writefile{toc}{\contentsline {section}{\numberline {11.2}Objective}{238}\protected@file@percent }
+\@writefile{toc}{\contentsline {section}{\numberline {11.3}Manifestation of Modbus protocol with Arduino Uno\ and energy meter}{238}\protected@file@percent }
+\@writefile{lof}{\contentsline {figure}{\numberline {11.4}{\ignorespaces Block diagram for reading the parameters in energy meter\relax }}{239}\protected@file@percent }
+\newlabel{fig:block-diagram}{{11.4}{239}}
+\@writefile{lof}{\contentsline {figure}{\numberline {11.5}{\ignorespaces Experimental set up for reading energy meter\relax }}{239}\protected@file@percent }
+\newlabel{fig:full-set-up}{{11.5}{239}}
+\@writefile{toc}{\contentsline {subsection}{\numberline {11.3.1}Software}{240}\protected@file@percent }
+\@writefile{lof}{\contentsline {figure}{\numberline {11.6}{\ignorespaces Flowchart of Arduino firmware\relax }}{241}\protected@file@percent }
+\newlabel{fig:modbus-firmware}{{11.6}{241}}
+\@writefile{toc}{\contentsline {subsection}{\numberline {11.3.2}Output in the Scilab Console}{241}\protected@file@percent }
+\@writefile{lof}{\contentsline {figure}{\numberline {11.7}{\ignorespaces Flowchart of the steps happening in Scilab code\relax }}{242}\protected@file@percent }
+\newlabel{fig:flow-chart}{{11.7}{242}}
+\@writefile{lof}{\contentsline {figure}{\numberline {11.8}{\ignorespaces Single phase current output on Scilab Console\relax }}{242}\protected@file@percent }
+\newlabel{fig:current-console}{{11.8}{242}}
+\@writefile{lof}{\contentsline {figure}{\numberline {11.9}{\ignorespaces Single phase current output in energy meter\relax }}{243}\protected@file@percent }
+\newlabel{fig:current-meter}{{11.9}{243}}
+\@writefile{lof}{\contentsline {figure}{\numberline {11.10}{\ignorespaces Single phase voltage output on Scilab Console\relax }}{243}\protected@file@percent }
+\newlabel{fig:voltage-console}{{11.10}{243}}
+\@writefile{lof}{\contentsline {figure}{\numberline {11.11}{\ignorespaces Single phase voltage output in energy meter\relax }}{244}\protected@file@percent }
+\newlabel{fig:voltage-meter}{{11.11}{244}}
+\@writefile{lof}{\contentsline {figure}{\numberline {11.12}{\ignorespaces Single phase active power output on Scilab Console\relax }}{244}\protected@file@percent }
+\newlabel{fig:power-console}{{11.12}{244}}
+\@writefile{toc}{\contentsline {section}{\numberline {11.4}Accessing the electrical parameters from Scilab}{244}\protected@file@percent }
+\@writefile{toc}{\contentsline {subsection}{\numberline {11.4.1}Accessing the electrical parameters}{244}\protected@file@percent }
+\@writefile{lof}{\contentsline {figure}{\numberline {11.13}{\ignorespaces Single phase active power output in energy meter\relax }}{245}\protected@file@percent }
+\newlabel{fig:power-meter}{{11.13}{245}}
+\@writefile{toc}{\contentsline {subsection}{\numberline {11.4.2}Arduino Firmware}{245}\protected@file@percent }
+\newlabel{sec:firmware-modbus}{{11.4.2}{245}}
\@writefile{ard}{\addvspace {10pt}}
-\@writefile{thm}{\contentsline {ardmass}{{Arduino Code}{11.{1}}{}}{243}\protected@file@percent }
-\@writefile{ard}{\contentsline {section}{\numberline {11.{1}}First 10 lines of the firmware for Modbus Energy Meter experiment}{243}\protected@file@percent }
-\newlabel{146@xvr}{{}{243}}
-\newlabel{146@vr}{{}{243}}
-\newlabel{ard:firmware-modbus}{{11.{1}}{243}}
-\@writefile{lol}{\contentsline {lstlisting}{/home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/arduino/send\textunderscore packet.ino}{243}\protected@file@percent }
-\@writefile{lof}{\contentsline {figure}{\numberline {11.14}{\ignorespaces Xcos diagram to read Energy Meter values}}{244}\protected@file@percent }
-\newlabel{145@xvr}{{}{244}}
-\newlabel{145@vr}{{}{244}}
-\newlabel{fig:mod-read}{{11.14}{244}}
-\@writefile{lot}{\contentsline {table}{\numberline {11.5}{\ignorespaces Xcos parameters to read Energy Meter\relax }}{244}\protected@file@percent }
-\newlabel{tab:mod-xcos-read}{{11.5}{244}}
-\@writefile{toc}{\contentsline {subsection}{\numberline {11.7.2}Scilab Code}{245}\protected@file@percent }
-\newlabel{sec:modbus-scilab-code}{{11.7.2}{245}}
+\@writefile{thm}{\contentsline {ardmass}{{Arduino Code}{11.{1}}{}}{245}\protected@file@percent }
+\@writefile{ard}{\contentsline {section}{\numberline {11.{1}}First 10 lines of the firmware for Modbus Energy Meter experiment}{245}\protected@file@percent }
+\newlabel{144@xvr}{{}{245}}
+\newlabel{144@vr}{{}{245}}
+\newlabel{ard:firmware-modbus}{{11.{1}}{245}}
+\@writefile{lol}{\contentsline {lstlisting}{/home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/arduino/send\textunderscore packet.ino}{245}\protected@file@percent }
+\@writefile{toc}{\contentsline {subsection}{\numberline {11.4.3}Scilab Code}{246}\protected@file@percent }
+\newlabel{sec:modbus-scilab-code}{{11.4.3}{246}}
\@writefile{cod}{\addvspace {10pt}}
-\@writefile{thm}{\contentsline {codemass}{{Scilab Code}{11.{1}}{}}{245}\protected@file@percent }
-\@writefile{cod}{\contentsline {section}{\numberline {11.{1}}First 10 lines of the function for scifunc block}{245}\protected@file@percent }
-\newlabel{147@xvr}{{}{245}}
-\newlabel{147@vr}{{}{245}}
-\newlabel{sci:current-modbus}{{11.{1}}{245}}
-\@writefile{lol}{\contentsline {lstlisting}{/home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/scilab/read\textunderscore val.sce}{245}\protected@file@percent }
-\@writefile{thm}{\contentsline {codemass}{{Scilab Code}{11.{2}}{}}{245}\protected@file@percent }
-\@writefile{cod}{\contentsline {section}{\numberline {11.{2}}First 10 lines of the code for Single Phase Current Output}{245}\protected@file@percent }
-\newlabel{148@xvr}{{}{245}}
-\newlabel{148@vr}{{}{245}}
-\newlabel{sci:current-modbus}{{11.{2}}{245}}
-\@writefile{lol}{\contentsline {lstlisting}{/home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/scilab/read\textunderscore current.sci}{245}\protected@file@percent }
-\@writefile{thm}{\contentsline {codemass}{{Scilab Code}{11.{3}}{}}{245}\protected@file@percent }
-\@writefile{cod}{\contentsline {section}{\numberline {11.{3}}First 10 lines of the code for Single Phase Voltage Output}{245}\protected@file@percent }
-\newlabel{149@xvr}{{}{245}}
-\newlabel{149@vr}{{}{245}}
-\newlabel{sci:voltage-modbus}{{11.{3}}{245}}
-\@writefile{lol}{\contentsline {lstlisting}{/home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/scilab/read\textunderscore voltage.sci}{245}\protected@file@percent }
-\@writefile{thm}{\contentsline {codemass}{{Scilab Code}{11.{4}}{}}{246}\protected@file@percent }
-\@writefile{cod}{\contentsline {section}{\numberline {11.{4}}First 10 lines of the code for Single Phase Active Power Output}{246}\protected@file@percent }
-\newlabel{150@xvr}{{}{246}}
-\newlabel{150@vr}{{}{246}}
-\newlabel{sci:modbus-power}{{11.{4}}{246}}
-\@writefile{lol}{\contentsline {lstlisting}{/home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/scilab/read\textunderscore active\textunderscore power.sci}{246}\protected@file@percent }
-\@writefile{toc}{\contentsline {subsection}{\numberline {11.7.3}Python Code}{246}\protected@file@percent }
-\newlabel{sec:modbus-python-code}{{11.7.3}{246}}
-\@writefile{pyd}{\addvspace {10pt}}
-\@writefile{thm}{\contentsline {pymass}{{Python Code}{11.{1}}{}}{246}\protected@file@percent }
-\@writefile{pyd}{\contentsline {section}{\numberline {11.{1}}Code for Single Phase Current Output}{246}\protected@file@percent }
-\newlabel{151@xvr}{{}{246}}
-\newlabel{151@vr}{{}{246}}
-\newlabel{py:current-modbus}{{11.{1}}{246}}
-\@writefile{lol}{\contentsline {lstlisting}{/home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/python/read\textunderscore current.py}{246}\protected@file@percent }
-\@writefile{thm}{\contentsline {pymass}{{Python Code}{11.{2}}{}}{246}\protected@file@percent }
-\@writefile{pyd}{\contentsline {section}{\numberline {11.{2}}Code for Single Phase Voltage Output}{246}\protected@file@percent }
-\newlabel{152@xvr}{{}{246}}
-\newlabel{152@vr}{{}{246}}
-\newlabel{py:voltage-modbus}{{11.{2}}{246}}
-\@writefile{lol}{\contentsline {lstlisting}{/home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/python/read\textunderscore voltage.py}{246}\protected@file@percent }
-\@writefile{thm}{\contentsline {pymass}{{Python Code}{11.{3}}{}}{247}\protected@file@percent }
-\@writefile{pyd}{\contentsline {section}{\numberline {11.{3}}Code for Single Phase Active Power Output}{247}\protected@file@percent }
-\newlabel{153@xvr}{{}{247}}
-\newlabel{153@vr}{{}{247}}
-\newlabel{py:modbus-power}{{11.{3}}{247}}
-\@writefile{lol}{\contentsline {lstlisting}{/home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/python/read\textunderscore active\textunderscore power.py}{247}\protected@file@percent }
-\@writefile{toc}{\contentsline {subsection}{\numberline {11.7.4}Julia Code}{247}\protected@file@percent }
-\newlabel{sec:modbus-julia-code}{{11.7.4}{247}}
-\@writefile{juliad}{\addvspace {10pt}}
-\@writefile{thm}{\contentsline {juliamass}{{Julia Code}{11.{1}}{}}{247}\protected@file@percent }
-\@writefile{juliad}{\contentsline {section}{\numberline {11.{1}}Code for Single Phase Current Output}{247}\protected@file@percent }
-\newlabel{154@xvr}{{}{247}}
-\newlabel{154@vr}{{}{247}}
-\newlabel{julia:current-modbus}{{11.{1}}{247}}
-\@writefile{lol}{\contentsline {lstlisting}{/home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/julia/readCurrent.jl}{247}\protected@file@percent }
-\@writefile{thm}{\contentsline {juliamass}{{Julia Code}{11.{2}}{}}{247}\protected@file@percent }
-\@writefile{juliad}{\contentsline {section}{\numberline {11.{2}}Code for Single Phase Voltage Output}{247}\protected@file@percent }
-\newlabel{155@xvr}{{}{247}}
-\newlabel{155@vr}{{}{247}}
-\newlabel{julia:voltage-modbus}{{11.{2}}{247}}
-\@writefile{lol}{\contentsline {lstlisting}{/home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/julia/readVoltage.jl}{247}\protected@file@percent }
-\@writefile{thm}{\contentsline {juliamass}{{Julia Code}{11.{3}}{}}{248}\protected@file@percent }
-\@writefile{juliad}{\contentsline {section}{\numberline {11.{3}}First 10 lines of the code for Single Phase Active Power Output}{248}\protected@file@percent }
-\newlabel{156@xvr}{{}{248}}
-\newlabel{156@vr}{{}{248}}
-\newlabel{julia:modbus-power}{{11.{3}}{248}}
-\@writefile{lol}{\contentsline {lstlisting}{/home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/julia/readPower.jl}{248}\protected@file@percent }
-\@writefile{toc}{\contentsline {subsection}{\numberline {11.7.5}OpenModelica Code}{248}\protected@file@percent }
-\newlabel{sec:modbus-OpenModelica-code}{{11.7.5}{248}}
-\@writefile{OpenModelicad}{\addvspace {10pt}}
-\@writefile{thm}{\contentsline {OpenModelicamass}{{OpenModelica Code}{11.{1}}{}}{248}\protected@file@percent }
-\@writefile{OpenModelicad}{\contentsline {section}{\numberline {11.{1}}Code for Single Phase Current Output}{248}\protected@file@percent }
-\newlabel{157@xvr}{{}{248}}
-\newlabel{157@vr}{{}{248}}
-\newlabel{OpenModelica:current-modbus}{{11.{1}}{248}}
-\@writefile{lol}{\contentsline {lstlisting}{/home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/OpenModelica/readCurrent.mo}{248}\protected@file@percent }
-\@writefile{thm}{\contentsline {OpenModelicamass}{{OpenModelica Code}{11.{2}}{}}{248}\protected@file@percent }
-\@writefile{OpenModelicad}{\contentsline {section}{\numberline {11.{2}}Code for Single Phase Voltage Output}{248}\protected@file@percent }
-\newlabel{158@xvr}{{}{248}}
-\newlabel{158@vr}{{}{248}}
-\newlabel{OpenModelica:voltage-modbus}{{11.{2}}{248}}
-\@writefile{lol}{\contentsline {lstlisting}{/home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/OpenModelica/readVoltage.mo}{248}\protected@file@percent }
+\@writefile{thm}{\contentsline {codemass}{{Scilab Code}{11.{1}}{}}{246}\protected@file@percent }
+\@writefile{cod}{\contentsline {section}{\numberline {11.{1}}First 10 lines of the function for scifunc block}{246}\protected@file@percent }
+\newlabel{145@xvr}{{}{246}}
+\newlabel{145@vr}{{}{246}}
+\newlabel{sci:current-modbus}{{11.{1}}{246}}
+\@writefile{lol}{\contentsline {lstlisting}{/home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/scilab/read\textunderscore val.sce}{246}\protected@file@percent }
+\@writefile{thm}{\contentsline {codemass}{{Scilab Code}{11.{2}}{}}{246}\protected@file@percent }
+\@writefile{cod}{\contentsline {section}{\numberline {11.{2}}First 10 lines of the code for Single Phase Current Output}{246}\protected@file@percent }
+\newlabel{146@xvr}{{}{246}}
+\newlabel{146@vr}{{}{246}}
+\newlabel{sci:current-modbus}{{11.{2}}{246}}
+\@writefile{lol}{\contentsline {lstlisting}{/home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/scilab/read\textunderscore current.sci}{246}\protected@file@percent }
+\@writefile{thm}{\contentsline {codemass}{{Scilab Code}{11.{3}}{}}{246}\protected@file@percent }
+\@writefile{cod}{\contentsline {section}{\numberline {11.{3}}First 10 lines of the code for Single Phase Voltage Output}{246}\protected@file@percent }
+\newlabel{147@xvr}{{}{246}}
+\newlabel{147@vr}{{}{246}}
+\newlabel{sci:voltage-modbus}{{11.{3}}{246}}
+\@writefile{lol}{\contentsline {lstlisting}{/home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/scilab/read\textunderscore voltage.sci}{246}\protected@file@percent }
+\@writefile{thm}{\contentsline {codemass}{{Scilab Code}{11.{4}}{}}{247}\protected@file@percent }
+\@writefile{cod}{\contentsline {section}{\numberline {11.{4}}First 10 lines of the code for Single Phase Active Power Output}{247}\protected@file@percent }
+\newlabel{148@xvr}{{}{247}}
+\newlabel{148@vr}{{}{247}}
+\newlabel{sci:modbus-power}{{11.{4}}{247}}
+\@writefile{lol}{\contentsline {lstlisting}{/home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/scilab/read\textunderscore active\textunderscore power.sci}{247}\protected@file@percent }
+\@writefile{toc}{\contentsline {section}{\numberline {11.5}Reading Parameters from Xcos}{247}\protected@file@percent }
\bibdata{bibliography.bib}
-\@writefile{thm}{\contentsline {OpenModelicamass}{{OpenModelica Code}{11.{3}}{}}{249}\protected@file@percent }
-\@writefile{OpenModelicad}{\contentsline {section}{\numberline {11.{3}}Code for Single Phase Active Power Output}{249}\protected@file@percent }
-\newlabel{159@xvr}{{}{249}}
-\newlabel{159@vr}{{}{249}}
-\newlabel{OpenModelica:modbus-power}{{11.{3}}{249}}
-\@writefile{lol}{\contentsline {lstlisting}{/home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/OpenModelica/readPower.mo}{249}\protected@file@percent }
+\@writefile{lof}{\contentsline {figure}{\numberline {11.14}{\ignorespaces Xcos diagram to read Energy Meter values}}{248}\protected@file@percent }
+\newlabel{150@xvr}{{}{248}}
+\newlabel{150@vr}{{}{248}}
+\newlabel{fig:mod-read}{{11.14}{248}}
+\@writefile{lot}{\contentsline {table}{\numberline {11.7}{\ignorespaces Xcos parameters to read Energy Meter\relax }}{248}\protected@file@percent }
+\newlabel{tab:mod-xcos-read}{{11.7}{248}}
\bibcite{CNES-Scilab}{1}
\bibcite{scilab-arduino}{2}
\bibcite{oshw-ref}{3}
@@ -1613,7 +1565,7 @@
\bibcite{scilab-ref}{12}
\bibcite{scilab-interop}{13}
\bibcite{xcos-ref}{14}
-\@writefile{toc}{\contentsline {chapter}{\numberline {References}}{251}\protected@file@percent }
+\@writefile{toc}{\contentsline {chapter}{\numberline {References}}{249}\protected@file@percent }
\bibcite{python-ref}{15}
\bibcite{pySerial}{16}
\bibcite{julia-ref}{17}
@@ -1622,3 +1574,8 @@
\bibcite{therm-wiki}{20}
\bibcite{arduino-pwm}{21}
\bibcite{servo-lib}{22}
+\bibcite{modbus}{23}
+\bibcite{simplymodbus}{24}
+\bibcite{online-crc}{25}
+\bibcite{ieee-754-conv}{26}
+\bibcite{modbus-paper}{27}
diff --git a/floss-arduino.bbl b/floss-arduino.bbl
index 93fe139..f2f29c5 100644
--- a/floss-arduino.bbl
+++ b/floss-arduino.bbl
@@ -116,4 +116,32 @@ Servo.
\newblock https://www.arduino.cc/reference/en/libraries/servo/.
\newblock Seen on 6 May 2021.
+\bibitem{modbus}
+Modbus.
+\newblock https://modbus.org/.
+\newblock Seen on 6 May 2021.
+
+\bibitem{simplymodbus}
+Simply modbus.
+\newblock https://simplymodbus.ca/.
+\newblock Seen on 6 May 2021.
+
+\bibitem{online-crc}
+Online crc.
+\newblock https://www.lammertbies.nl/comm/info/crc-calculation.
+\newblock Seen on 2 May 2021.
+
+\bibitem{ieee-754-conv}
+Floating point converter.
+\newblock https://www.h-schmidt.net/FloatConverter/IEEE754.html.
+\newblock Seen on 6 May 2021.
+
+\bibitem{modbus-paper}
+Paavni Shukla, Sonal Singh, Tanmayee Joshi, Sudhakar Kumar, Samrudha Kelkar,
+ Manas~R. Das, and Kannan~M. Moudgalya.
+\newblock Design and development of a modbus automation system for industrial
+ applications.
+\newblock In {\em 2017 6th International Conference on Computer Applications In
+ Electrical Engineering-Recent Advances (CERA)}, pages 515--520, 2017.
+
\end{thebibliography}
diff --git a/floss-arduino.blg b/floss-arduino.blg
index c09e50f..b01c807 100644
--- a/floss-arduino.blg
+++ b/floss-arduino.blg
@@ -3,44 +3,44 @@ Capacity: max_strings=200000, hash_size=200000, hash_prime=170003
The top-level auxiliary file: floss-arduino.aux
The style file: unsrt.bst
Database file #1: bibliography.bib
-You've used 22 entries,
+You've used 27 entries,
1791 wiz_defined-function locations,
- 523 strings with 5400 characters,
-and the built_in function-call counts, 2495 in all, are:
-= -- 226
-> -- 31
-< -- 0
-+ -- 25
-- -- 3
-* -- 2
-:= -- 283
-add.period$ -- 69
-call.type$ -- 22
-change.case$ -- 22
+ 541 strings with 5987 characters,
+and the built_in function-call counts, 3344 in all, are:
+= -- 299
+> -- 58
+< -- 1
++ -- 37
+- -- 10
+* -- 29
+:= -- 384
+add.period$ -- 84
+call.type$ -- 27
+change.case$ -- 27
chr.to.int$ -- 0
-cite$ -- 22
-duplicate$ -- 110
-empty$ -- 397
-format.name$ -- 3
-if$ -- 648
+cite$ -- 27
+duplicate$ -- 151
+empty$ -- 507
+format.name$ -- 10
+if$ -- 864
int.to.chr$ -- 0
-int.to.str$ -- 22
-missing$ -- 0
-newline$ -- 116
-num.names$ -- 3
-pop$ -- 173
+int.to.str$ -- 27
+missing$ -- 1
+newline$ -- 141
+num.names$ -- 4
+pop$ -- 211
preamble$ -- 1
purify$ -- 0
quote$ -- 0
-skip$ -- 62
+skip$ -- 90
stack$ -- 0
-substring$ -- 0
-swap$ -- 22
-text.length$ -- 0
+substring$ -- 28
+swap$ -- 37
+text.length$ -- 1
text.prefix$ -- 0
top$ -- 0
type$ -- 0
warning$ -- 0
-while$ -- 3
-width$ -- 24
-write$ -- 206
+while$ -- 6
+width$ -- 29
+write$ -- 253
diff --git a/floss-arduino.cod b/floss-arduino.cod
index caed2f6..69dc3ee 100644
--- a/floss-arduino.cod
+++ b/floss-arduino.cod
@@ -28,7 +28,7 @@
\contentsline {section}{\numberline {10.{2}}Rotating the DC motor in both directions}{212}%
\contentsline {section}{\numberline {10.{3}}Rotating the DC motor in both directions in a loop}{213}%
\addvspace {10pt}
-\contentsline {section}{\numberline {11.{1}}First 10 lines of the function for scifunc block}{245}%
-\contentsline {section}{\numberline {11.{2}}First 10 lines of the code for Single Phase Current Output}{245}%
-\contentsline {section}{\numberline {11.{3}}First 10 lines of the code for Single Phase Voltage Output}{245}%
-\contentsline {section}{\numberline {11.{4}}First 10 lines of the code for Single Phase Active Power Output}{246}%
+\contentsline {section}{\numberline {11.{1}}First 10 lines of the function for scifunc block}{246}%
+\contentsline {section}{\numberline {11.{2}}First 10 lines of the code for Single Phase Current Output}{246}%
+\contentsline {section}{\numberline {11.{3}}First 10 lines of the code for Single Phase Voltage Output}{246}%
+\contentsline {section}{\numberline {11.{4}}First 10 lines of the code for Single Phase Active Power Output}{247}%
diff --git a/floss-arduino.fdb_latexmk b/floss-arduino.fdb_latexmk
index e298618..6c8511e 100644
--- a/floss-arduino.fdb_latexmk
+++ b/floss-arduino.fdb_latexmk
@@ -1,19 +1,19 @@
# Fdb version 3
-["bibtex floss-arduino"] 1620334492 "floss-arduino.aux" "floss-arduino.bbl" "floss-arduino" 1620334524
+["bibtex floss-arduino"] 1620366889 "floss-arduino.aux" "floss-arduino.bbl" "floss-arduino" 1620366899
"/usr/share/texlive/texmf-dist/bibtex/bst/base/unsrt.bst" 1292289607 18030 1376b4b231b50c66211e47e42eda2875 ""
- "bibliography.bib" 1620297358 4761 0402e8ce734c33f2ba70b0c39108c686 ""
- "floss-arduino.aux" 1620334502 144737 8ed26129489772ae9122ac6a6c14d097 "pdflatex"
+ "bibliography.bib" 1620360874 6033 5c578caf30ff299b5c4be1fd8f5a94e9 ""
+ "floss-arduino.aux" 1620366899 140812 4e72b0e7b0ca5e8c70040b333d1802ad "pdflatex"
(generated)
- "floss-arduino.blg"
"floss-arduino.bbl"
-["makeindex floss-arduino.idx"] 1620332789 "floss-arduino.idx" "floss-arduino.ind" "floss-arduino" 1620334524
- "floss-arduino.idx" 1620334502 187 271460d41130469c03967b41a1ffca73 "pdflatex"
+ "floss-arduino.blg"
+["makeindex floss-arduino.idx"] 1620359774 "floss-arduino.idx" "floss-arduino.ind" "floss-arduino" 1620366899
+ "floss-arduino.idx" 1620366899 187 271460d41130469c03967b41a1ffca73 "pdflatex"
(generated)
"floss-arduino.ilg"
"floss-arduino.ind"
-["pdflatex"] 1620334492 "/home/fossee/Desktop/floss-scilab-arduino/floss-arduino.tex" "/home/fossee/Desktop/floss-scilab-arduino/floss-arduino.pdf" "floss-arduino" 1620334524
+["pdflatex"] 1620366889 "/home/fossee/Desktop/floss-scilab-arduino/floss-arduino.tex" "/home/fossee/Desktop/floss-scilab-arduino/floss-arduino.pdf" "floss-arduino" 1620366899
"/etc/texmf/web2c/texmf.cnf" 1602253014 475 c0e671620eb5563b2130f56340a5fde8 ""
- "/home/fossee/Desktop/floss-scilab-arduino/floss-arduino.aux" 1620334502 144737 8ed26129489772ae9122ac6a6c14d097 ""
+ "/home/fossee/Desktop/floss-scilab-arduino/floss-arduino.aux" 1620366899 140812 4e72b0e7b0ca5e8c70040b333d1802ad ""
"/home/fossee/Desktop/floss-scilab-arduino/floss-arduino.tex" 1620092361 4558 98aa7ac618326a3037ae9c9d0000888c ""
"/usr/share/texlive/texmf-dist/fonts/enc/dvips/base/8r.enc" 1165713224 4850 80dc9bab7f31fb78a000ccfed0e27cab ""
"/usr/share/texlive/texmf-dist/fonts/map/fontname/texfonts.map" 1577235249 3524 cb3e574dea2d1052e39280babc910dc8 ""
@@ -59,7 +59,6 @@
"/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmsy9.tfm" 1136768653 1116 25a7bf822c58caf309a702ef79f4afbb ""
"/usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmex10.pfb" 1248133631 30251 6afa5cb1d0204815a708a080681d4674 ""
"/usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi10.pfb" 1248133631 36299 5f9df58c2139e7edcf37c8fca4bd384d ""
- "/usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi8.pfb" 1248133631 35469 70d41d2b9ea31d5d813066df7c99281c ""
"/usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb" 1248133631 35752 024fb6c41858982481f6968b5fc26508 ""
"/usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr8.pfb" 1248133631 32726 0a1aea6fcd6468ee2cf64d891f5c43c8 ""
"/usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr9.pfb" 1248133631 33993 9b89b85fd2d9df0482bd47194d1d3bf3 ""
@@ -138,18 +137,18 @@
"/usr/share/texmf/web2c/texmf.cnf" 1581979058 38841 ce3692aa899bb693b90b87eaa5d4d84e ""
"/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map" 1604540077 4770781 1ed1abab22da9c3e2cc82e4db562318b ""
"/var/lib/texmf/web2c/pdftex/pdflatex.fmt" 1604540101 8258883 e8330f8aa4fe7c6cdcf08bf0b72237fd ""
- "floss-arduino.OpenModelicad" 1620334502 2294 4fa91358fe5bb1cb15ee6e0c22fac6db "pdflatex"
- "floss-arduino.ard" 1620334502 2072 6885a0166db1200009787c70ab2523ff "pdflatex"
- "floss-arduino.aux" 1620334502 144737 8ed26129489772ae9122ac6a6c14d097 "pdflatex"
- "floss-arduino.bbl" 1620334492 3047 ba4e591b17c796db08fc30ce671afa1c "bibtex floss-arduino"
- "floss-arduino.cod" 1620334502 2496 46fb6bfc9496fa05923cf8e1d3fb964a "pdflatex"
- "floss-arduino.ind" 1620332790 228 4d97f37315d1c5c2aed255c006f8f995 "makeindex floss-arduino.idx"
- "floss-arduino.juliad" 1620334502 2328 b1229d9ccd1a788994c8d467556be6b2 "pdflatex"
- "floss-arduino.lof" 1620334502 13818 57334c65ea550910e6b14a929154587f "pdflatex"
- "floss-arduino.lot" 1620334502 3596 fe4dc0dcc019779ce4aa5a865f14c385 "pdflatex"
- "floss-arduino.pyd" 1620334502 2323 685f6919c0fe1091d0b54d4a9958bd70 "pdflatex"
+ "floss-arduino.OpenModelicad" 1620366899 2007 122374c83f8eb320dc9222fddd39887c "pdflatex"
+ "floss-arduino.ard" 1620366899 2072 9ec637ffc737cc45defb5686f73a41cd "pdflatex"
+ "floss-arduino.aux" 1620366899 140812 4e72b0e7b0ca5e8c70040b333d1802ad "pdflatex"
+ "floss-arduino.bbl" 1620366889 3901 c5bc746ef483aa341e15b8d6803ebeb4 "bibtex floss-arduino"
+ "floss-arduino.cod" 1620366899 2496 b1eebdbd10557c6848d1bfd645da9170 "pdflatex"
+ "floss-arduino.ind" 1620359774 228 4d97f37315d1c5c2aed255c006f8f995 "makeindex floss-arduino.idx"
+ "floss-arduino.juliad" 1620366899 2019 13f8f52cb5a8dd07b589ace89cca333c "pdflatex"
+ "floss-arduino.lof" 1620366899 13857 7527da3746289e32f8f3d1ce6f0daed9 "pdflatex"
+ "floss-arduino.lot" 1620366899 3864 26df7ca2157f4a06e94c3ee0635d4232 "pdflatex"
+ "floss-arduino.pyd" 1620366899 2036 abfb7ba113aec331f90b3d7e611d8ff2 "pdflatex"
"floss-arduino.tex" 1620092361 4558 98aa7ac618326a3037ae9c9d0000888c ""
- "floss-arduino.toc" 1620334502 16031 6c8044a736569a599f508ecfff23f9bb "pdflatex"
+ "floss-arduino.toc" 1620366899 16179 3a860529d695f1329843481f4ac37e3b "pdflatex"
"suppl/acr.tex" 1615963613 1926 fd6481c4666ee0d60331b7d4cc24b645 ""
"suppl/intro.tex" 1615963613 3437 b09628cf9e20fe17fa65b37a5997653c ""
"suppl/styles.tex" 1615963613 8143 aa3280f0b59c8631fe8ec44895c9e871 ""
@@ -247,31 +246,22 @@
"user-code/led/scilab/led-blue-red.sce" 1619654755 534 9ed44e179f5f8f2d1833438c6e950670 ""
"user-code/led/scilab/led-blue.sce" 1619654435 264 54ed7e9095e17363e0ce5fb00cade1d1 ""
"user-code/led/scilab/led-green-blink.sce" 1619654799 484 6075a3408ac416b1a08b9812441b114f ""
- "user-code/modbus/OpenModelica/readCurrent.mo" 1615963614 415 303989413cadae961b297f9b27e7fea0 ""
- "user-code/modbus/OpenModelica/readPower.mo" 1615963614 435 3f5615fb24b7ddbe58cdd8e1bef132ae ""
- "user-code/modbus/OpenModelica/readVoltage.mo" 1615963614 415 6e1ebbf05cf22f407c8164397a270067 ""
"user-code/modbus/arduino/send_packet.ino" 1615963614 8116 cf6c7187b76c359b0e96b2d6ab867417 ""
"user-code/modbus/figures/Full-Set-Up.png" 1615963614 1614647 0b0a3133138b7b5e4362f127b21dbbca ""
- "user-code/modbus/figures/active-power-output-setup.jpg" 1615963614 351924 8d58dbf5aedf8ea47c4a10461e296b85 ""
- "user-code/modbus/figures/active-power-output.png" 1615963614 92783 8431c4797fbf7c49379c3ed7f6b79786 ""
+ "user-code/modbus/figures/active-power-output-setup.jpg" 1620364402 970986 3c5dcb7d7a8cc8c4506feed7894ca347 ""
+ "user-code/modbus/figures/active-power-output.png" 1620364605 6070 e338cbd838bd2ffe7cb999dccd6c8af4 ""
"user-code/modbus/figures/arduino_code_flowchart.png" 1615963614 30551 d5d6d0068508ecc437e64b129d03adeb ""
"user-code/modbus/figures/block-diagram.PNG" 1615963614 12984 34da68fad73a956dd18a72f2742c01c8 ""
- "user-code/modbus/figures/current-output-setup.jpg" 1615963614 369988 8c01314dd3a203470668991b37705c64 ""
- "user-code/modbus/figures/current-output.png" 1615963614 92428 a524bc830f420d11fc05150dbcb96771 ""
+ "user-code/modbus/figures/current-output-setup.jpg" 1620364431 852771 a15f31abba4a1197ad1aabfc7084a9ac ""
+ "user-code/modbus/figures/current-output.png" 1620364623 5616 8e6b1ab6c0719055cc81fd1f0ab7e6b6 ""
"user-code/modbus/figures/fig1.png" 1615963614 7589 f96d8da2f8a9b651e6a2b84ff0fcd2b5 ""
"user-code/modbus/figures/fig2.png" 1615963614 8357 df83830062ead3aba95548cffc6e5fc2 ""
"user-code/modbus/figures/fig3.png" 1615963614 64436 45a719b4c6c25010861af86e20af0675 ""
"user-code/modbus/figures/flowchart.png" 1615963614 24159 a806f9f56a4606c9f0640bb0eb7e36ff ""
"user-code/modbus/figures/read_value_xcos.png" 1615963614 51074 2267729983ef5dcb788a3f74130a179a ""
- "user-code/modbus/figures/voltage-output-setup.jpg" 1615963614 356309 088966238545406bc7a8c1db7b2ac12a ""
- "user-code/modbus/figures/voltage-output.png" 1615963614 97782 6f9b9d94d93e8617e82070422fee492c ""
- "user-code/modbus/julia/readCurrent.jl" 1615963614 419 d37bba6d385680f69e39aeeeee270cc2 ""
- "user-code/modbus/julia/readPower.jl" 1615963614 408 5fe8daf1c8116370b28ad3bd3f32aab4 ""
- "user-code/modbus/julia/readVoltage.jl" 1615963614 418 4e26e56e234bd7df4a03ade0f2866654 ""
- "user-code/modbus/modbus.tex" 1615963614 26444 f692bc7fe93f42a0d30c23af786065fe ""
- "user-code/modbus/python/read_active_power.py" 1615963614 1107 5c75379ec91b5b117fc94be55100a639 ""
- "user-code/modbus/python/read_current.py" 1615963614 1102 c628a8be5444f9b5ffbb348dff567336 ""
- "user-code/modbus/python/read_voltage.py" 1618777541 1102 cf711c7b2bc93043409419eb1ae2169b ""
+ "user-code/modbus/figures/voltage-output-setup.jpg" 1620364476 964103 77691bdec7885f306d9af858aa024c6b ""
+ "user-code/modbus/figures/voltage-output.png" 1620364640 5506 102a213a2a607379d826356f732ad44e ""
+ "user-code/modbus/modbus.tex" 1620366869 39037 54204783c2646b0de526c3fbc6cfa195 ""
"user-code/modbus/scilab/read_active_power.sci" 1615963614 1072 ec17d07cbbf336756ed22d5469b68e25 ""
"user-code/modbus/scilab/read_current.sci" 1615963614 1090 97c84be93c41f56ed4617dfe2ffaf5bb ""
"user-code/modbus/scilab/read_val.sce" 1615963614 1474 89f368fad786acfa64c8f7eab2d6c14a ""
@@ -394,17 +384,17 @@
"user-code/thermistor/thermistor.tex" 1620094206 41317 2326a2c871f17f79a710f7c64b8a31e5 ""
(generated)
"floss-arduino.aux"
- "floss-arduino.pdf"
"floss-arduino.juliad"
- "/home/fossee/Desktop/floss-scilab-arduino/floss-arduino.pdf"
- "/home/fossee/Desktop/floss-scilab-arduino/floss-arduino.log"
"floss-arduino.cod"
- "floss-arduino.OpenModelicad"
"floss-arduino.thm"
- "floss-arduino.idx"
- "floss-arduino.pyd"
"floss-arduino.log"
- "floss-arduino.toc"
"floss-arduino.lof"
- "floss-arduino.ard"
+ "floss-arduino.pdf"
+ "/home/fossee/Desktop/floss-scilab-arduino/floss-arduino.pdf"
+ "floss-arduino.pyd"
+ "floss-arduino.idx"
"floss-arduino.lot"
+ "floss-arduino.ard"
+ "floss-arduino.toc"
+ "floss-arduino.OpenModelicad"
+ "/home/fossee/Desktop/floss-scilab-arduino/floss-arduino.log"
diff --git a/floss-arduino.fls b/floss-arduino.fls
index fdbafe4..02c42e0 100644
--- a/floss-arduino.fls
+++ b/floss-arduino.fls
@@ -1223,12 +1223,12 @@ INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/fig2.pn
INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/fig3.png
INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/fig3.png
INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/fig3.png
-INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/Full-Set-Up.png
-INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/Full-Set-Up.png
-INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/Full-Set-Up.png
INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/block-diagram.PNG
INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/block-diagram.PNG
INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/block-diagram.PNG
+INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/Full-Set-Up.png
+INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/Full-Set-Up.png
+INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/Full-Set-Up.png
INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/arduino_code_flowchart.png
INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/arduino_code_flowchart.png
INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/arduino_code_flowchart.png
@@ -1253,9 +1253,6 @@ INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/active-
INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/active-power-output-setup.jpg
INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/active-power-output-setup.jpg
INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/active-power-output-setup.jpg
-INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/read_value_xcos.png
-INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/read_value_xcos.png
-INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/read_value_xcos.png
INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/arduino/send_packet.ino
INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/arduino/send_packet.ino
INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/arduino/send_packet.ino
@@ -1271,33 +1268,9 @@ INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/scilab/read_vol
INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/scilab/read_active_power.sci
INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/scilab/read_active_power.sci
INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/scilab/read_active_power.sci
-INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/python/read_current.py
-INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/python/read_current.py
-INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/python/read_current.py
-INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/python/read_voltage.py
-INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/python/read_voltage.py
-INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/python/read_voltage.py
-INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/python/read_active_power.py
-INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/python/read_active_power.py
-INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/python/read_active_power.py
-INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/julia/readCurrent.jl
-INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/julia/readCurrent.jl
-INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/julia/readCurrent.jl
-INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/julia/readVoltage.jl
-INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/julia/readVoltage.jl
-INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/julia/readVoltage.jl
-INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/julia/readPower.jl
-INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/julia/readPower.jl
-INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/julia/readPower.jl
-INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/OpenModelica/readCurrent.mo
-INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/OpenModelica/readCurrent.mo
-INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/OpenModelica/readCurrent.mo
-INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/OpenModelica/readVoltage.mo
-INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/OpenModelica/readVoltage.mo
-INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/OpenModelica/readVoltage.mo
-INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/OpenModelica/readPower.mo
-INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/OpenModelica/readPower.mo
-INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/OpenModelica/readPower.mo
+INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/read_value_xcos.png
+INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/read_value_xcos.png
+INPUT /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/read_value_xcos.png
INPUT /home/fossee/Desktop/floss-scilab-arduino/floss-arduino.bbl
INPUT /home/fossee/Desktop/floss-scilab-arduino/floss-arduino.bbl
OUTPUT /home/fossee/Desktop/floss-scilab-arduino/floss-arduino.thm
@@ -1307,7 +1280,6 @@ INPUT /usr/share/texmf/fonts/enc/dvips/cm-super/cm-super-ts1.enc
INPUT /usr/share/texlive/texmf-dist/fonts/enc/dvips/base/8r.enc
INPUT /usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmex10.pfb
INPUT /usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi10.pfb
-INPUT /usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi8.pfb
INPUT /usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb
INPUT /usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr8.pfb
INPUT /usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr9.pfb
diff --git a/floss-arduino.juliad b/floss-arduino.juliad
index 525a485..c2eabd8 100644
--- a/floss-arduino.juliad
+++ b/floss-arduino.juliad
@@ -24,7 +24,3 @@
\contentsline {section}{\numberline {10.{1}}Rotating the DC motor}{224}%
\contentsline {section}{\numberline {10.{2}}Rotating the DC motor in both directions}{225}%
\contentsline {section}{\numberline {10.{3}}Rotating the DC motor in both directions in a loop}{225}%
-\addvspace {10pt}
-\contentsline {section}{\numberline {11.{1}}Code for Single Phase Current Output}{247}%
-\contentsline {section}{\numberline {11.{2}}Code for Single Phase Voltage Output}{247}%
-\contentsline {section}{\numberline {11.{3}}First 10 lines of the code for Single Phase Active Power Output}{248}%
diff --git a/floss-arduino.lof b/floss-arduino.lof
index 23666c2..4453115 100644
--- a/floss-arduino.lof
+++ b/floss-arduino.lof
@@ -122,14 +122,14 @@
\contentsline {figure}{\numberline {11.1}{\ignorespaces Block diagram representation of the Protocol\relax }}{232}%
\contentsline {figure}{\numberline {11.2}{\ignorespaces Master-Slave Query-Response Cycle\relax }}{232}%
\contentsline {figure}{\numberline {11.3}{\ignorespaces Pins in RS485 module\relax }}{233}%
-\contentsline {figure}{\numberline {11.4}{\ignorespaces MODBUS Set Up for Energy Meter\relax }}{237}%
-\contentsline {figure}{\numberline {11.5}{\ignorespaces Block Diagram for Energy Meter Setup\relax }}{238}%
-\contentsline {figure}{\numberline {11.6}{\ignorespaces Flowchart of Arduino firmware\relax }}{239}%
-\contentsline {figure}{\numberline {11.7}{\ignorespaces Flow Chart of the Modbus Energy Meter Implementation\relax }}{240}%
-\contentsline {figure}{\numberline {11.8}{\ignorespaces Single Phase Current Output on Scilab Console\relax }}{241}%
-\contentsline {figure}{\numberline {11.9}{\ignorespaces Single Phase Current Output on Energy Meter\relax }}{241}%
-\contentsline {figure}{\numberline {11.10}{\ignorespaces Single Phase Voltage Output on Scilab Console\relax }}{242}%
-\contentsline {figure}{\numberline {11.11}{\ignorespaces Single Phase Voltage Output on Energy Meter\relax }}{242}%
-\contentsline {figure}{\numberline {11.12}{\ignorespaces Single Phase Voltage Output on Scilab Console\relax }}{243}%
-\contentsline {figure}{\numberline {11.13}{\ignorespaces Single Phase Voltage Output on Energy Meter\relax }}{243}%
-\contentsline {figure}{\numberline {11.14}{\ignorespaces Xcos diagram to read Energy Meter values}}{244}%
+\contentsline {figure}{\numberline {11.4}{\ignorespaces Block diagram for reading the parameters in energy meter\relax }}{239}%
+\contentsline {figure}{\numberline {11.5}{\ignorespaces Experimental set up for reading energy meter\relax }}{239}%
+\contentsline {figure}{\numberline {11.6}{\ignorespaces Flowchart of Arduino firmware\relax }}{241}%
+\contentsline {figure}{\numberline {11.7}{\ignorespaces Flowchart of the steps happening in Scilab code\relax }}{242}%
+\contentsline {figure}{\numberline {11.8}{\ignorespaces Single phase current output on Scilab Console\relax }}{242}%
+\contentsline {figure}{\numberline {11.9}{\ignorespaces Single phase current output in energy meter\relax }}{243}%
+\contentsline {figure}{\numberline {11.10}{\ignorespaces Single phase voltage output on Scilab Console\relax }}{243}%
+\contentsline {figure}{\numberline {11.11}{\ignorespaces Single phase voltage output in energy meter\relax }}{244}%
+\contentsline {figure}{\numberline {11.12}{\ignorespaces Single phase active power output on Scilab Console\relax }}{244}%
+\contentsline {figure}{\numberline {11.13}{\ignorespaces Single phase active power output in energy meter\relax }}{245}%
+\contentsline {figure}{\numberline {11.14}{\ignorespaces Xcos diagram to read Energy Meter values}}{248}%
diff --git a/floss-arduino.log b/floss-arduino.log
index 2cd4a37..88d3383 100644
--- a/floss-arduino.log
+++ b/floss-arduino.log
@@ -1,4 +1,4 @@
-This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=pdflatex 2020.11.5) 7 MAY 2021 02:24
+This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=pdflatex 2020.11.5) 7 MAY 2021 11:24
entering extended mode
restricted \write18 enabled.
file:line:error style messages enabled.
@@ -473,7 +473,7 @@ Overfull \hbox (74.6947pt too wide) detected at line 9
{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] [2] [3] [4] [5]
-Overfull \hbox (42.2769pt too wide) detected at line 221
+Overfull \hbox (42.2769pt too wide) detected at line 222
\T1/cmr/bx/n/10.95 References
[]
@@ -510,30 +510,30 @@ Overfull \hbox (4.98741pt too wide) in paragraph at lines 91--91
\tf@cod=\write9
\openout9 = `floss-arduino.cod'.
- [16] (/home/fossee/Desktop/floss-scilab-arduino/floss-arduino.pyd [17
-
-])
+ [16] (/home/fossee/Desktop/floss-scilab-arduino/floss-arduino.pyd)
\tf@pyd=\write10
\openout10 = `floss-arduino.pyd'.
- [18] (/home/fossee/Desktop/floss-scilab-arduino/floss-arduino.juliad)
+ [17
+
+] [18
+
+] (/home/fossee/Desktop/floss-scilab-arduino/floss-arduino.juliad)
\tf@juliad=\write11
\openout11 = `floss-arduino.juliad'.
- [19
+ [19] [20
-] [20] (/home/fossee/Desktop/floss-scilab-arduino/floss-arduino.OpenModelicad)
+] (/home/fossee/Desktop/floss-scilab-arduino/floss-arduino.OpenModelicad)
\tf@OpenModelicad=\write12
\openout12 = `floss-arduino.OpenModelicad'.
- (/home/fossee/Desktop/floss-scilab-arduino/suppl/acr.tex [21
+ (/home/fossee/Desktop/floss-scilab-arduino/suppl/acr.tex [21] [22
-] [22])
+])
Underfull \vbox (badness 10000) has occurred while \output is active []
- [23
-
-] [24] (/home/fossee/Desktop/floss-scilab-arduino/suppl/intro.tex
+ [23] [24] (/home/fossee/Desktop/floss-scilab-arduino/suppl/intro.tex
Chapter 1.
LaTeX Warning: Command \textregistered invalid in math mode on input line 22.
@@ -1426,97 +1426,117 @@ Chapter 11.
</home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/fig1.png, id=1034, 672.5125pt x 224.84pt>
File: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/fig1.png Graphic file (type png)
<use /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/fig1.png>
-Package pdftex.def Info: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/fig1.png used on input line 71.
+Package pdftex.def Info: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/fig1.png used on input line 79.
(pdftex.def) Requested size: 357.73405pt x 119.60033pt.
</home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/fig2.png, id=1035, 360.34625pt x 375.4025pt>
File: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/fig2.png Graphic file (type png)
<use /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/fig2.png>
-Package pdftex.def Info: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/fig2.png used on input line 79.
+Package pdftex.def Info: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/fig2.png used on input line 87.
(pdftex.def) Requested size: 178.86702pt x 186.33748pt.
-</home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/fig3.png, id=1036, 481.04718pt x 214.55156pt>
+ [232 </home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/fig1.png (PNG copy)> </home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/fig2.png (PNG copy)>]
+</home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/fig3.png, id=1039, 481.04718pt x 214.55156pt>
File: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/fig3.png Graphic file (type png)
<use /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/fig3.png>
-Package pdftex.def Info: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/fig3.png used on input line 106.
+Package pdftex.def Info: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/fig3.png used on input line 135.
(pdftex.def) Requested size: 357.73405pt x 159.55464pt.
- [232 </home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/fig1.png (PNG copy)> </home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/fig2.png (PNG copy)>] [233 </home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/fig3.png (PNG copy)>] [234] [235]
-</home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/Full-Set-Up.png, id=1051, 722.7pt x 542.025pt>
-File: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/Full-Set-Up.png Graphic file (type png)
-<use /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/Full-Set-Up.png>
-Package pdftex.def Info: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/Full-Set-Up.png used on input line 300.
-(pdftex.def) Requested size: 258.36281pt x 193.77246pt.
- [236]
-</home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/block-diagram.PNG, id=1055, 398.23781pt x 255.95625pt>
+ [233 </home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/fig3.png (PNG copy)>] [234] [235] [236] [237]
+</home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/block-diagram.PNG, id=1056, 398.23781pt x 255.95625pt>
File: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/block-diagram.PNG Graphic file (type png)
<use /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/block-diagram.PNG>
-Package pdftex.def Info: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/block-diagram.PNG used on input line 329.
+Package pdftex.def Info: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/block-diagram.PNG used on input line 473.
(pdftex.def) Requested size: 258.36281pt x 166.06104pt.
-</home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/arduino_code_flowchart.png, id=1056, 327.2225pt x 480.79625pt>
+</home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/Full-Set-Up.png, id=1057, 722.7pt x 542.025pt>
+File: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/Full-Set-Up.png Graphic file (type png)
+<use /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/Full-Set-Up.png>
+Package pdftex.def Info: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/Full-Set-Up.png used on input line 480.
+(pdftex.def) Requested size: 258.36281pt x 193.77246pt.
+
+Overfull \hbox (5.94992pt too wide) in paragraph at lines 485--485
+[]\T1/cmr/bx/n/14.4 Manifestation of Mod-bus pro-to-col with Ar-duino Uno
+ []
+
+[238]
+Overfull \hbox (29.91699pt too wide) has occurred while \output is active
+\T1/cmr/bx/n/10.95 11.3. Manifestation of Modbus protocol with Arduino Uno and energy meter \T1/cmr/m/n/10.95 239
+ []
+
+[239 </home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/block-diagram.PNG> </home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/Full-Set-Up.png>]
+</home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/arduino_code_flowchart.png, id=1066, 327.2225pt x 480.79625pt>
File: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/arduino_code_flowchart.png Graphic file (type png)
<use /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/arduino_code_flowchart.png>
-Package pdftex.def Info: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/arduino_code_flowchart.png used on input line 348.
+Package pdftex.def Info: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/arduino_code_flowchart.png used on input line 526.
(pdftex.def) Requested size: 258.36281pt x 379.61945pt.
- [237 </home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/Full-Set-Up.png>]
-</home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/flowchart.png, id=1061, 482.55281pt x 362.10281pt>
+</home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/flowchart.png, id=1067, 482.55281pt x 362.10281pt>
File: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/flowchart.png Graphic file (type png)
<use /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/flowchart.png>
-Package pdftex.def Info: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/flowchart.png used on input line 376.
+Package pdftex.def Info: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/flowchart.png used on input line 553.
(pdftex.def) Requested size: 357.73405pt x 268.44914pt.
-</home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/current-output.png, id=1062, 1028.34187pt x 578.16pt>
+ [240]
+</home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/current-output.png, id=1071, 490.83376pt x 170.13562pt>
File: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/current-output.png Graphic file (type png)
<use /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/current-output.png>
-Package pdftex.def Info: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/current-output.png used on input line 393.
-(pdftex.def) Requested size: 397.48499pt x 223.4789pt.
-</home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/current-output-setup.jpg, id=1063, 2509.375pt x 1411.2725pt>
+Package pdftex.def Info: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/current-output.png used on input line 574.
+(pdftex.def) Requested size: 397.48499pt x 137.78313pt.
+
+Overfull \hbox (29.91699pt too wide) has occurred while \output is active
+\T1/cmr/bx/n/10.95 11.3. Manifestation of Modbus protocol with Arduino Uno and energy meter \T1/cmr/m/n/10.95 241
+ []
+
+[241 </home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/arduino_code_flowchart.png>]
+</home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/current-output-setup.jpg, id=1077, 277.035pt x 248.127pt>
File: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/current-output-setup.jpg Graphic file (type jpg)
<use /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/current-output-setup.jpg>
-Package pdftex.def Info: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/current-output-setup.jpg used on input line 400.
-(pdftex.def) Requested size: 258.36281pt x 145.29163pt.
-</home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/voltage-output.png, id=1064, 1028.34187pt x 578.16pt>
+Package pdftex.def Info: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/current-output-setup.jpg used on input line 581.
+(pdftex.def) Requested size: 258.36281pt x 231.40312pt.
+</home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/voltage-output.png, id=1078, 487.8225pt x 155.07938pt>
File: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/voltage-output.png Graphic file (type png)
<use /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/voltage-output.png>
-Package pdftex.def Info: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/voltage-output.png used on input line 412.
-(pdftex.def) Requested size: 397.48499pt x 223.4789pt.
-</home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/voltage-output-setup.jpg, id=1065, 2509.375pt x 1411.2725pt>
+Package pdftex.def Info: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/voltage-output.png used on input line 593.
+(pdftex.def) Requested size: 397.48499pt x 126.36134pt.
+ [242 </home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/flowchart.png (PNG copy)> </home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/current-output.png>]
+</home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/voltage-output-setup.jpg, id=1082, 261.1356pt x 269.808pt>
File: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/voltage-output-setup.jpg Graphic file (type jpg)
<use /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/voltage-output-setup.jpg>
-Package pdftex.def Info: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/voltage-output-setup.jpg used on input line 419.
-(pdftex.def) Requested size: 258.36281pt x 145.29163pt.
-</home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/active-power-output.png, id=1066, 1028.34187pt x 578.16pt>
+Package pdftex.def Info: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/voltage-output-setup.jpg used on input line 600.
+(pdftex.def) Requested size: 258.36281pt x 266.95018pt.
+</home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/active-power-output.png, id=1083, 492.33937pt x 185.94469pt>
File: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/active-power-output.png Graphic file (type png)
<use /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/active-power-output.png>
-Package pdftex.def Info: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/active-power-output.png used on input line 429.
-(pdftex.def) Requested size: 397.48499pt x 223.4789pt.
- [238 </home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/block-diagram.PNG>]
-</home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/active-power-output-setup.jpg, id=1071, 2509.375pt x 1411.2725pt>
+Package pdftex.def Info: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/active-power-output.png used on input line 610.
+(pdftex.def) Requested size: 397.48499pt x 150.12634pt.
+</home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/active-power-output-setup.jpg, id=1084, 306.9066pt x 264.99pt>
File: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/active-power-output-setup.jpg Graphic file (type jpg)
<use /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/active-power-output-setup.jpg>
-Package pdftex.def Info: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/active-power-output-setup.jpg used on input line 436.
-(pdftex.def) Requested size: 258.36281pt x 145.29163pt.
+Package pdftex.def Info: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/active-power-output-setup.jpg used on input line 617.
+(pdftex.def) Requested size: 258.36281pt x 223.0955pt.
Underfull \vbox (badness 10000) has occurred while \output is active []
- [239 </home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/arduino_code_flowchart.png>]
-</home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/read_value_xcos.png, id=1076, 635.37375pt x 455.7025pt>
+
+Overfull \hbox (29.91699pt too wide) has occurred while \output is active
+\T1/cmr/bx/n/10.95 11.3. Manifestation of Modbus protocol with Arduino Uno and energy meter \T1/cmr/m/n/10.95 243
+ []
+
+[243 </home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/current-output-setup.jpg> </home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/voltage-output.png>]
+Overfull \vbox (18.36249pt too high) has occurred while \output is active []
+
+ [244 </home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/voltage-output-setup.jpg> </home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/active-power-output.png>] (/home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/arduino/send_packet.ino [245 </home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/active-power-output-setup.jpg>]) (/home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/scilab/read_val.sce) (/home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/scilab/read_current.sci) (/home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/scilab/read_voltage.sci [246]) (/home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/scilab/read_active_power.sci)
+</home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/read_value_xcos.png, id=1097, 635.37375pt x 455.7025pt>
File: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/read_value_xcos.png Graphic file (type png)
<use /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/read_value_xcos.png>
-Package pdftex.def Info: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/read_value_xcos.png used on input line 463.
+Package pdftex.def Info: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/read_value_xcos.png used on input line 708.
(pdftex.def) Requested size: 258.36281pt x 185.30946pt.
-Underfull \hbox (badness 1259) in paragraph at lines 466--466
+Underfull \hbox (badness 1259) in paragraph at lines 711--711
[]\T1/cmr/m/n/10.95 Figure 11.14: |Xcos di-a-gram to read En-ergy Me-ter val-ues. This is what
[]
-Overfull \hbox (16.70493pt too wide) in paragraph at lines 479--491
+Overfull \hbox (16.70493pt too wide) in paragraph at lines 724--736
[][]
[]
-[240 </home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/flowchart.png (PNG copy)>] [241 </home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/current-output.png (PNG copy)> </home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/current-output-setup.jpg>]
-Underfull \vbox (badness 10000) has occurred while \output is active []
-
- [242 </home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/voltage-output.png (PNG copy)> </home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/voltage-output-setup.jpg>] (/home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/arduino/send_packet.ino [243 </home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/active-power-output.png (PNG copy)> </home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/active-power-output-setup.jpg>] [244 </home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/read_value_xcos.png>]) (/home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/scilab/read_val.sce) (/home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/scilab/read_current.sci) (/home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/scilab/read_voltage.sci [245]) (/home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/scilab/read_active_power.sci) (/home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/python/read_current.py) (/home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/python/read_voltage.py [246]) (/home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/python/read_active_power.py) (/home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/julia/readCurrent.jl) (/home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/julia/readVoltage.jl [247]) (/home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/julia/readPower.jl) (/home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/OpenModelica/readCurrent.mo) (/home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/OpenModelica/readVoltage.mo [248]) (/home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/OpenModelica/readPower.mo)) (/home/fossee/Desktop/floss-scilab-arduino/floss-arduino.bbl [249] [250
-
-]
+[247]) (/home/fossee/Desktop/floss-scilab-arduino/floss-arduino.bbl [248 </home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/figures/read_value_xcos.png>]
Underfull \hbox (badness 10000) in paragraph at lines 4--9
[]\T1/cmr/m/n/10.95 T. Mar-tin. Use of scilab for space mis-sion anal-y-sis.
[]
@@ -1541,7 +1561,9 @@ Overfull \hbox (15.39987pt too wide) in paragraph at lines 49--53
[]\T1/cmr/m/n/10.95 Candy sort-ing ma-chine. http://beta.ivc.no/wiki/index.php/Skittles_M%26M%27s
[]
-[251]
+[249
+
+]
Underfull \hbox (badness 1577) in paragraph at lines 95--98
[]\T1/cmr/m/n/10.95 Juliaio/serialports.jl: Se-ri-al-port io streams in ju-lia backed by py-se-rial.
[]
@@ -1551,28 +1573,33 @@ Overfull \hbox (34.60225pt too wide) in paragraph at lines 110--113
[]\T1/cmr/m/n/10.95 Secrets of ar-duino pwm. https://www.arduino.cc/en/Tutorial/SecretsOfArduinoPWM.
[]
+
+Underfull \hbox (badness 10000) in paragraph at lines 135--138
+[]\T1/cmr/m/n/10.95 Floating point con-verter. https://www.h-
+ []
+
)
\tf@thm=\write13
\openout13 = `floss-arduino.thm'.
- [252] (/home/fossee/Desktop/floss-scilab-arduino/floss-arduino.aux)
+ [250] (/home/fossee/Desktop/floss-scilab-arduino/floss-arduino.aux)
LaTeX Warning: There were multiply-defined labels.
)
Here is how much of TeX's memory you used:
- 9937 strings out of 481239
- 230394 string characters out of 5920377
+ 9847 strings out of 481239
+ 227180 string characters out of 5920377
735688 words of memory out of 5000000
- 24298 multiletter control sequences out of 15000+600000
+ 24232 multiletter control sequences out of 15000+600000
554670 words of font info for 69 fonts, out of 8000000 for 9000
1143 hyphenation exceptions out of 8191
- 50i,11n,53p,405b,1777s stack positions out of 5000i,500n,10000p,200000b,80000s
-{/usr/share/texmf/fonts/enc/dvips/cm-super/cm-super-t1.enc}{/usr/share/texmf/fonts/enc/dvips/cm-super/cm-super-ts1.enc}{/usr/share/texlive/texmf-dist/fonts/enc/dvips/base/8r.enc}</usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmex10.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi10.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi8.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr8.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr9.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy10.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy6.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy8.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy9.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/bera/fvmr8a.pfb></usr/share/texmf/fonts/type1/public/cm-super/sfbx0900.pfb></usr/share/texmf/fonts/type1/public/cm-super/sfbx1095.pfb></usr/share/texmf/fonts/type1/public/cm-super/sfbx1200.pfb></usr/share/texmf/fonts/type1/public/cm-super/sfbx1440.pfb></usr/share/texmf/fonts/type1/public/cm-super/sfbx2074.pfb></usr/share/texmf/fonts/type1/public/cm-super/sfbx2488.pfb></usr/share/texmf/fonts/type1/public/cm-super/sfrm0600.pfb></usr/share/texmf/fonts/type1/public/cm-super/sfrm0800.pfb></usr/share/texmf/fonts/type1/public/cm-super/sfrm0900.pfb></usr/share/texmf/fonts/type1/public/cm-super/sfrm1000.pfb></usr/share/texmf/fonts/type1/public/cm-super/sfrm1095.pfb></usr/share/texmf/fonts/type1/public/cm-super/sfsi1095.pfb></usr/share/texmf/fonts/type1/public/cm-super/sfss1095.pfb></usr/share/texmf/fonts/type1/public/cm-super/sfti1095.pfb>
-Output written on /home/fossee/Desktop/floss-scilab-arduino/floss-arduino.pdf (276 pages, 30212624 bytes).
+ 50i,10n,53p,405b,1758s stack positions out of 5000i,500n,10000p,200000b,80000s
+{/usr/share/texmf/fonts/enc/dvips/cm-super/cm-super-t1.enc}{/usr/share/texmf/fonts/enc/dvips/cm-super/cm-super-ts1.enc}{/usr/share/texlive/texmf-dist/fonts/enc/dvips/base/8r.enc}</usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmex10.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi10.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr8.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr9.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy10.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy6.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy8.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy9.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/bera/fvmr8a.pfb></usr/share/texmf/fonts/type1/public/cm-super/sfbx0900.pfb></usr/share/texmf/fonts/type1/public/cm-super/sfbx1095.pfb></usr/share/texmf/fonts/type1/public/cm-super/sfbx1200.pfb></usr/share/texmf/fonts/type1/public/cm-super/sfbx1440.pfb></usr/share/texmf/fonts/type1/public/cm-super/sfbx2074.pfb></usr/share/texmf/fonts/type1/public/cm-super/sfbx2488.pfb></usr/share/texmf/fonts/type1/public/cm-super/sfrm0600.pfb></usr/share/texmf/fonts/type1/public/cm-super/sfrm0800.pfb></usr/share/texmf/fonts/type1/public/cm-super/sfrm0900.pfb></usr/share/texmf/fonts/type1/public/cm-super/sfrm1000.pfb></usr/share/texmf/fonts/type1/public/cm-super/sfrm1095.pfb></usr/share/texmf/fonts/type1/public/cm-super/sfsi1095.pfb></usr/share/texmf/fonts/type1/public/cm-super/sfss1095.pfb></usr/share/texmf/fonts/type1/public/cm-super/sfti1095.pfb>
+Output written on /home/fossee/Desktop/floss-scilab-arduino/floss-arduino.pdf (274 pages, 31639716 bytes).
PDF statistics:
- 1215 PDF objects out of 1440 (max. 8388607)
- 707 compressed objects within 8 object streams
+ 1204 PDF objects out of 1440 (max. 8388607)
+ 700 compressed objects within 7 object streams
0 named destinations out of 1000 (max. 500000)
601 words of extra memory for PDF output out of 10000 (max. 10000000)
diff --git a/floss-arduino.lot b/floss-arduino.lot
index 22cf771..6f668e7 100644
--- a/floss-arduino.lot
+++ b/floss-arduino.lot
@@ -32,8 +32,10 @@
\contentsline {table}{\numberline {10.3}{\ignorespaces Xcos parameters to drive the DC motor in forward and reverse directions\relax }}{215}%
\contentsline {table}{\numberline {10.4}{\ignorespaces Xcos parameters to drive the DC motor in a loop\relax }}{217}%
\addvspace {10\p@ }
-\contentsline {table}{\numberline {11.1}{\ignorespaces Interpretation of a request packet\relax }}{234}%
-\contentsline {table}{\numberline {11.2}{\ignorespaces Interpretation of a response packet\relax }}{234}%
-\contentsline {table}{\numberline {11.3}{\ignorespaces Hexadecimal to Decimal\relax }}{235}%
-\contentsline {table}{\numberline {11.4}{\ignorespaces Single and Double Precision Representation\relax }}{235}%
-\contentsline {table}{\numberline {11.5}{\ignorespaces Xcos parameters to read Energy Meter\relax }}{244}%
+\contentsline {table}{\numberline {11.1}{\ignorespaces Pins available on RS485 and their usage\relax }}{233}%
+\contentsline {table}{\numberline {11.2}{\ignorespaces Operations supported by Modbus RTU\relax }}{234}%
+\contentsline {table}{\numberline {11.3}{\ignorespaces Individual parameter address in EM6400\relax }}{234}%
+\contentsline {table}{\numberline {11.4}{\ignorespaces A request packet to access V1 in EM6400\relax }}{235}%
+\contentsline {table}{\numberline {11.5}{\ignorespaces A response packet to access V1 in EM6400\relax }}{236}%
+\contentsline {table}{\numberline {11.6}{\ignorespaces Memory storage of a four-byte integer in little-endian and big-endian\relax }}{237}%
+\contentsline {table}{\numberline {11.7}{\ignorespaces Xcos parameters to read Energy Meter\relax }}{248}%
diff --git a/floss-arduino.pdf b/floss-arduino.pdf
index 062d8ea..57c4fb5 100644
--- a/floss-arduino.pdf
+++ b/floss-arduino.pdf
Binary files differ
diff --git a/floss-arduino.pyd b/floss-arduino.pyd
index da399a5..91d959e 100644
--- a/floss-arduino.pyd
+++ b/floss-arduino.pyd
@@ -25,7 +25,3 @@
\contentsline {section}{\numberline {10.{1}}Rotating the DC motor}{219}%
\contentsline {section}{\numberline {10.{2}}Rotating the DC motor in both directions}{220}%
\contentsline {section}{\numberline {10.{3}}Rotating the DC motor in both directions in a loop}{221}%
-\addvspace {10pt}
-\contentsline {section}{\numberline {11.{1}}Code for Single Phase Current Output}{246}%
-\contentsline {section}{\numberline {11.{2}}Code for Single Phase Voltage Output}{246}%
-\contentsline {section}{\numberline {11.{3}}Code for Single Phase Active Power Output}{247}%
diff --git a/floss-arduino.synctex.gz b/floss-arduino.synctex.gz
index e26215b..36f25bf 100644
--- a/floss-arduino.synctex.gz
+++ b/floss-arduino.synctex.gz
Binary files differ
diff --git a/floss-arduino.thm b/floss-arduino.thm
index 47ad490..80b956d 100644
--- a/floss-arduino.thm
+++ b/floss-arduino.thm
@@ -109,17 +109,8 @@
\contentsline {OpenModelicamass}{{OpenModelica Code}{10.{1}}{}}{228}%
\contentsline {OpenModelicamass}{{OpenModelica Code}{10.{2}}{}}{229}%
\contentsline {OpenModelicamass}{{OpenModelica Code}{10.{3}}{}}{229}%
-\contentsline {ardmass}{{Arduino Code}{11.{1}}{}}{243}%
-\contentsline {codemass}{{Scilab Code}{11.{1}}{}}{245}%
-\contentsline {codemass}{{Scilab Code}{11.{2}}{}}{245}%
-\contentsline {codemass}{{Scilab Code}{11.{3}}{}}{245}%
-\contentsline {codemass}{{Scilab Code}{11.{4}}{}}{246}%
-\contentsline {pymass}{{Python Code}{11.{1}}{}}{246}%
-\contentsline {pymass}{{Python Code}{11.{2}}{}}{246}%
-\contentsline {pymass}{{Python Code}{11.{3}}{}}{247}%
-\contentsline {juliamass}{{Julia Code}{11.{1}}{}}{247}%
-\contentsline {juliamass}{{Julia Code}{11.{2}}{}}{247}%
-\contentsline {juliamass}{{Julia Code}{11.{3}}{}}{248}%
-\contentsline {OpenModelicamass}{{OpenModelica Code}{11.{1}}{}}{248}%
-\contentsline {OpenModelicamass}{{OpenModelica Code}{11.{2}}{}}{248}%
-\contentsline {OpenModelicamass}{{OpenModelica Code}{11.{3}}{}}{249}%
+\contentsline {ardmass}{{Arduino Code}{11.{1}}{}}{245}%
+\contentsline {codemass}{{Scilab Code}{11.{1}}{}}{246}%
+\contentsline {codemass}{{Scilab Code}{11.{2}}{}}{246}%
+\contentsline {codemass}{{Scilab Code}{11.{3}}{}}{246}%
+\contentsline {codemass}{{Scilab Code}{11.{4}}{}}{247}%
diff --git a/floss-arduino.toc b/floss-arduino.toc
index f19e854..aee6c77 100644
--- a/floss-arduino.toc
+++ b/floss-arduino.toc
@@ -207,15 +207,16 @@
\contentsline {subsection}{\numberline {10.7.2}OpenModelica Code}{228}%
\contentsline {chapter}{\numberline {11}Implementation of Modbus Protocol}{231}%
\contentsline {section}{\numberline {11.1}Preliminaries}{231}%
-\contentsline {section}{\numberline {11.2}Objective}{236}%
-\contentsline {section}{\numberline {11.3}Energy Meter set up for Modbus protocol with Arduino Uno}{236}%
-\contentsline {section}{\numberline {11.4}Software}{237}%
-\contentsline {section}{\numberline {11.5}Output}{238}%
-\contentsline {section}{\numberline {11.6}Reading Parameters from Xcos}{240}%
-\contentsline {section}{\numberline {11.7}Code}{243}%
-\contentsline {subsection}{\numberline {11.7.1}Arduino Code}{243}%
-\contentsline {subsection}{\numberline {11.7.2}Scilab Code}{245}%
-\contentsline {subsection}{\numberline {11.7.3}Python Code}{246}%
-\contentsline {subsection}{\numberline {11.7.4}Julia Code}{247}%
-\contentsline {subsection}{\numberline {11.7.5}OpenModelica Code}{248}%
-\contentsline {chapter}{\numberline {References}}{251}%
+\contentsline {subsection}{\numberline {11.1.1}Energy meter}{233}%
+\contentsline {paragraph}{Note:}{235}%
+\contentsline {subsection}{\numberline {11.1.2}Endianness}{236}%
+\contentsline {section}{\numberline {11.2}Objective}{238}%
+\contentsline {section}{\numberline {11.3}Manifestation of Modbus protocol with Arduino Uno\ and energy meter}{238}%
+\contentsline {subsection}{\numberline {11.3.1}Software}{240}%
+\contentsline {subsection}{\numberline {11.3.2}Output in the Scilab Console}{241}%
+\contentsline {section}{\numberline {11.4}Accessing the electrical parameters from Scilab}{244}%
+\contentsline {subsection}{\numberline {11.4.1}Accessing the electrical parameters}{244}%
+\contentsline {subsection}{\numberline {11.4.2}Arduino Firmware}{245}%
+\contentsline {subsection}{\numberline {11.4.3}Scilab Code}{246}%
+\contentsline {section}{\numberline {11.5}Reading Parameters from Xcos}{247}%
+\contentsline {chapter}{\numberline {References}}{249}%
diff --git a/indent.log b/indent.log
new file mode 100644
index 0000000..8e53a97
--- /dev/null
+++ b/indent.log
@@ -0,0 +1,25 @@
+INFO: latexindent version 3.7.1, 2019-09-07, a script to indent .tex files
+ latexindent lives here: /usr/share/texlive/texmf-dist/scripts/latexindent/
+ Fri May 7 10:32:23 2021
+ Filename: /home/fossee/Desktop/floss-scilab-arduino/user-code/modbus/__latexindent_temp.tex
+INFO: Processing switches:
+ -y|--yaml: YAML settings specified via command line
+ -c|--cruft: cruft directory
+INFO: Directory for backup files and /home/fossee/Desktop/floss-scilab-arduino/indent.log: /home/fossee/Desktop/floss-scilab-arduino/
+INFO: YAML settings read: defaultSettings.yaml
+ Reading defaultSettings.yaml from /usr/share/texlive/texmf-dist/scripts/latexindent/defaultSettings.yaml
+INFO: YAML settings read: indentconfig.yaml or .indentconfig.yaml
+ Home directory is /home/fossee (didn't find either indentconfig.yaml or .indentconfig.yaml)
+ To specify user settings you would put indentconfig.yaml here: /home/fossee/indentconfig.yaml
+ Alternatively, you can use the hidden file .indentconfig.yaml as: /home/fossee/.indentconfig.yaml
+INFO: YAML settings read: -y switch
+ Updating masterSettings with defaultIndent:
+INFO: Phase 1: searching for objects
+INFO: Phase 2: finding surrounding indentation
+INFO: Phase 3: indenting objects
+INFO: Phase 4: final indentation check
+INFO: Output routine:
+ Not outputting to file; see -w and -o switches for more options.
+ --------------
+INFO: Please direct all communication/issues to:
+ https://github.com/cmhughes/latexindent.pl
diff --git a/user-code/modbus/figures/active-power-output-setup.jpg b/user-code/modbus/figures/active-power-output-setup.jpg
index 7298918..75f7abc 100644
--- a/user-code/modbus/figures/active-power-output-setup.jpg
+++ b/user-code/modbus/figures/active-power-output-setup.jpg
Binary files differ
diff --git a/user-code/modbus/figures/active-power-output.png b/user-code/modbus/figures/active-power-output.png
index 79b306a..6eb883e 100644
--- a/user-code/modbus/figures/active-power-output.png
+++ b/user-code/modbus/figures/active-power-output.png
Binary files differ
diff --git a/user-code/modbus/figures/current-output-setup.jpg b/user-code/modbus/figures/current-output-setup.jpg
index 3d33c0c..e82cecc 100644
--- a/user-code/modbus/figures/current-output-setup.jpg
+++ b/user-code/modbus/figures/current-output-setup.jpg
Binary files differ
diff --git a/user-code/modbus/figures/current-output.png b/user-code/modbus/figures/current-output.png
index 63181d7..2ecf942 100644
--- a/user-code/modbus/figures/current-output.png
+++ b/user-code/modbus/figures/current-output.png
Binary files differ
diff --git a/user-code/modbus/figures/voltage-output-setup.jpg b/user-code/modbus/figures/voltage-output-setup.jpg
index 368f2a5..0ba5e97 100644
--- a/user-code/modbus/figures/voltage-output-setup.jpg
+++ b/user-code/modbus/figures/voltage-output-setup.jpg
Binary files differ
diff --git a/user-code/modbus/figures/voltage-output.png b/user-code/modbus/figures/voltage-output.png
index 66dd6c1..701f2be 100644
--- a/user-code/modbus/figures/voltage-output.png
+++ b/user-code/modbus/figures/voltage-output.png
Binary files differ
diff --git a/user-code/modbus/modbus.tex b/user-code/modbus/modbus.tex
index d9cc8a5..352b217 100644
--- a/user-code/modbus/modbus.tex
+++ b/user-code/modbus/modbus.tex
@@ -5,22 +5,22 @@
\newcommand{\LocMODfig}{\Origin/user-code/modbus/figures}
\newcommand{\LocMODscicode}{\Origin/user-code/modbus/scilab}
\newcommand{\LocMODscibrief}[1]{{\tt \seqsplit{%
-Origin/user-code/modbus/scilab}}, see \fnrefp{fn:file-loc}}
+ Origin/user-code/modbus/scilab}}, see \fnrefp{fn:file-loc}}
\newcommand{\LocMODardcode}{\Origin/user-code/modbus/arduino}
\newcommand{\LocMODardbrief}[1]{{\tt \seqsplit{%
-Origin/user-code/modbus/arduino}}, see \fnrefp{fn:file-loc}}
+ Origin/user-code/modbus/arduino}}, see \fnrefp{fn:file-loc}}
%%%%%%%%%%%%python starts
\newcommand{\LocMODpycode}{\Origin/user-code/modbus/python}
\newcommand{\LocMODpybrief}[1]{{\tt \seqsplit{%
-Origin/user-code/modbus/python}}, see \fnrefp{fn:file-loc}}
+ Origin/user-code/modbus/python}}, see \fnrefp{fn:file-loc}}
%%%%%%%%%%%%python ends
%%%%julia starts
\newcommand{\LocMODjuliacode}{\Origin/user-code/modbus/julia}
\newcommand{\LocMODjuliabrief}[1]{{\tt \seqsplit{%
-Origin/user-code/modbus/julia}}, see \fnrefp{fn:file-loc}}
+ Origin/user-code/modbus/julia}}, see \fnrefp{fn:file-loc}}
%%%%julia ends
@@ -29,56 +29,64 @@ Origin/user-code/modbus/julia}}, see \fnrefp{fn:file-loc}}
\newcommand{\LocMODOpenModelicacode}{\Origin/user-code/modbus/OpenModelica}
\newcommand{\LocMODOpenModelicabrief}[1]{{\tt \seqsplit{%
-Origin/user-code/modbus/OpenModelica}}, see \fnrefp{fn:file-loc}}
+ Origin/user-code/modbus/OpenModelica}}, see \fnrefp{fn:file-loc}}
%%%%OpenModelica ends
-In this chapter we will learn one of the advanced applications that
-can be built using Scilab-Arduino toolbox. Beginners might want to
+In this chapter, we will learn one of the advanced applications that
+can be built using the Scilab-Arduino toolbox, presented in
+\secref{sec:sci-ard-toolbox}. Recall \scilab, by default,
+does not have the capability to connect to
+Arduino. All such add-on functionalities are added to \scilab\ using
+toolboxes. Beginners might want to
skip this chapter in the first reading. This experiment enables
-interfacing Modbus based devices with Scilab-Arduino toolbox. This
+interfacing Modbus-based devices with the Scilab-Arduino toolbox. This
functionality has a wide number of applications in the industrial
sector.
+
\section{Preliminaries}
Modbus is an open serial communication protocol developed and
-published by Modicon in 1979. Because of ease of deployment and
+published by Modicon in 1979 \cite{modbus}. Because of ease of deployment and
maintenance, it finds wide applications in industries. The Modbus
protocol provides a means to transmit information over serial lines
-between several electronic devices in order to control and monitor
+between several electronic devices to control and monitor
them. The controlling device requests for reading or writing
-information and is known as the Modbus Master/Client. On the other
-hand, the device or devices supplying the information are called
-Modbus Slaves/Server. All the slaves/servers have a unique id and
-address. Typically, there is one Master and maximum 247 Slaves.
+information and is known as the Modbus master/client. On the other
+hand, the device supplying the information is called
+Modbus slave/server. All the slaves/servers have a unique id and
+address. Typically, there is one master, and a maximum of 247 slaves \cite{simplymodbus}.
+\figref{mod-block} shows a representation of Modbus protocol. 
During the communications on a Modbus network, the protocol determines
how the controller gets to know its device address, recognizes the
message provided and decides the action to be taken and accordingly
-extracts data and information contained in the message. The data is
-sent as a series of zeros and ones, i.e. bits wherein zeros are sent
-as positive voltages and ones as negative.
+extracts data and information contained in the message. A typical structure
+of the communication protcol is shown in \figref{mod-master-slave}. The data is
+sent as a series of zeros and ones, \ie\ bits wherein zeros are sent
+as positive voltages and ones as negative.
Different versions of Modbus protocol exist on serial lines, namely
-Modbus RTU, ASCII and TCP. The Energy Meter used in this experiment
+Modbus RTU, ASCII, and TCP \cite{simplymodbus}.
+The energy meter used in this experiment
supports Modbus RTU protocol. In Modbus RTU, the data is coded in
binary and requires only one communication byte. This is ideal for use
over RS232 or RS485 networks at baud rates between 1200 and 115K.
\begin{figure}
-\centering
-%\subfloat[Block diagram representation of the Protocol]{
-\includegraphics[width=\hgfig]{\LocMODfig/fig1.png}
-\label{fig:mod-block}
-\caption{Block diagram representation of the Protocol}
+ \centering
+ %\subfloat[Block diagram representation of the Protocol]{
+ \includegraphics[width=\hgfig]{\LocMODfig/fig1.png}
+ \caption{Block diagram representation of the Protocol}
+ \label{mod-block}
\end{figure}
\begin{figure}
-\centering
-\includegraphics[width=\smfig]{\LocMODfig/fig2.png}
-\caption{Master-Slave Query-Response Cycle}
-\label{fig:mod-master-slave}
+ \centering
+ \includegraphics[width=\smfig]{\LocMODfig/fig2.png}
+ \caption{Master-Slave Query-Response Cycle}
+ \label{mod-master-slave}
\end{figure}
The RS485 is one of the most widely used bus standards for industrial
@@ -86,12 +94,33 @@ applications. It uses differential communication lines to communicate
over long distances and requires a dedicated pair of signal lines, say
A and B, to exchange information. Here, the voltage on one line equals
to the inverse of the voltage on the other line. In other words, the
-output is,
-1, if A-B\textgreater200mV, and 0, if B-A\textgreater200mV.
+output is 1, if A - B \textgreater $\;$ 200mV, and 0, if B - A \textgreater $\;$
+200mV. \figref{rs-485} shows the pins available
+on a typical RS485 module. As shown in \figref{rs-485}, there are four pins on each side
+of the module. \tabref{tab:rs-485-pins} summarizes the usage of these pins.
+
+\begin{table}
+ \centering
+ \caption{Pins available on RS485 and their usage}
+ \label{tab:rs-485-pins}
+ \begin{tabular}{lc}\hline
+ Pin name & Usage \\ \hline
+ Vcc & 5V \\
+ B & Inverting receiver input \\
+ A & Non-inverting receiver input \\
+ GND & Ground (0V) \\
+ RO & Receiver output \\
+ RE & Receiver enable \\
+ DE & Data enable \\
+ DI & Data input \\
+ \hline
+ \end{tabular}
+\end{table}
+
%\begin{center}
%\framebox(175,30){%
- % \parbox{170\unitlength}{R0 outputs 1, if A-B\textgreater200mV\\ R0 outputs 0, if B-A\textgreater200mV}%
+% \parbox{170\unitlength}{R0 outputs 1, if A-B\textgreater200mV\\ R0 outputs 0, if B-A\textgreater200mV}%
%}
%\end{center}
@@ -102,350 +131,566 @@ output is,
\begin{figure}
-\centering
-\includegraphics[width=\hgfig]{\LocMODfig/fig3.png}
-\caption{Pins in RS485 module}
-\label{fig:rs-485}
+ \centering
+ \includegraphics[width=\hgfig]{\LocMODfig/fig3.png}
+ \caption{Pins in RS485 module}
+ \label{rs-485}
\end{figure}
-Energy Meter is a device that measures amount of electricity consumed
-by the load. We are using Energy Meter EM6400, which is a
-multifunction digital power meter by Schneider Electric India. It
+\subsection{Energy meter}
+\label{sec:energy-meter}
+An energy meter is a device that measures the amount of electricity consumed
+by the load. This book makes use of the EM6400 series energy meter. It is a
+multifunction digital power meter by Schneider Electric. It
reads various parameters such as phase voltage, current, active power,
-reactive power, power factor etc. Before using the meter, one has to
+reactive power, power factor, etc. Before using the meter, one has to
program system configuration, PT, CT ratios, communication parameters
-through front panel keys. EM6400 supports Modbus for communication.
-
-Multiple operations can be performed with devices supporting
-Modbus. Every operation has its own fixed function code (coil
-status-01, input status-02, holding registers-03, input registers-04,
-etc.), which is independent of devices. All the parameter values are
-stored in the holding registers. Different holding registers hold
-values of different parameters. Individual parameter addresses can be
-found in user manual for EM6400.
-For example,
-\begin{center}
-\begin{tabular}{ll}
-Current (phase 1): & 3929 \\
-Voltage (phase 1): & 3927 \\
-Active power (phase 1): & 3919
-\end{tabular}
-\end{center}
-
-The size of each Modbus register is 16 bits and all EM6400 readings
-are 32 bits. So, each reading occupies two consecutive Modbus
-registers. Values in every register are in little endian format (1st
-register contains LSB and next register contains MSB). In our case,
-Energy Meter is a slave and slave addresses can be set between 1 and
-247.
-
-A request to read holding registers has to be sent in a specified
-format. An example of a request packet is as follows. Suppose that
-the request is 01 03 0F56 0002 270F. Its meaning is explained in
-\tabref{tab:request-packet}.
+through front panel keys. The reason behind using this energy meter is
+the fact that it supports the Modbus protocol for communication.
+
+Multiple operations can be performed with devices supporting Modbus.
+Every operation has its own fixed function code (coil status - 01,
+input status - 02, holding registers - 03, input registers - 04, etc.),
+which is independent of devices. The function code tells the slave which
+table to access and whether to read from or write to the table.  
+All the parameter values are stored in the output holding registers.
+Different holding registers hold the values of different parameters.
+\tabref{tab:modbus-fun-codes} summarizes the various operations which
+Modbus RTU supports. One can locate the addresses of individual parameters
+in the user manual for EM6400. \tabref{tab:params-addr} provides the addresses
+for three individual parameters, which will be accessed in this chapter.
+
+
\begin{table}
-\centering
-\caption{Interpretation of a request packet}
-\label{tab:request-packet}
-\begin{tabular}{lp{10cm}}
-01 & Slave address \\
-03 & Function code to read holding registers \\
-0F56 & Data Address of the first requested register (address for
-voltage phase1 to neutral) and
-(0F56 hex = 3927, +40001 offset = 43928) \\
-0002 & Total number of registers requested for read \\
-270F & CRC (Cyclic Redundancy Check) for error checking (LSB first) \\
-\end{tabular}
+ \centering
+ \caption{Operations supported by Modbus RTU}
+ \label{tab:modbus-fun-codes}
+ \begin{tabular}{llc}\hline
+ Function Code & Action & Table Name \\ \hline
+ 01 (01 hex) & Read & Discrete Output Coils \\
+ 05 (05 hex) & Write single & Discrete Output Coil \\
+ 15 (0F hex) & Write multiple & Discrete Output Coils \\
+ 02 (02 hex) & Read & Discrete Input Contacts \\
+ 04 (04 hex) & Read & Analog Input Registers \\
+ 03 (03 hex) & Read & Analog Output Holding Registers \\
+ 06 (06 hex) & Write single & Analog Output Holding Register \\
+ 16 (10 hex) & Write multiple & Analog Output Holding Registers \\
+ \hline
+ \end{tabular}
\end{table}
-The response packet corresponding the above request packet
-is given as 01 03 04 2921 4373 D2B0. Its meaning is explained in
-\tabref{tab:response-packet}.
+
+
\begin{table}
-\centering
-\caption{Interpretation of a response packet}
-\label{tab:response-packet}.
-\begin{tabular}{ll}
-01 & Slave address \\
-03 & Function code to read holding registers \\
-04 & Total number of bytes read \\
-2921 & Data in 1st requested register \\
-4373 & Data in 2st requested register \\
-D2B0 & CRC for error checking (LSB first)
-\end{tabular}
+ \centering
+ \caption{Individual parameter address in EM6400}
+ \label{tab:params-addr}
+ \begin{tabular}{llc}\hline
+ Parameter & Description & Address \\ \hline
+ V1 & Voltage phase 1 to neutral & 3927 \\
+ A1 & Current, phase 1 & 3929 \\
+ W1 & Active power, phase 1 & 3919 \\
+ \hline
+ \end{tabular}
\end{table}
-Values in required registers are 43732921 in hex (since obtained
-values are being read in little endian format) which is 243.16 when
-converted to floating point using IEEE 754 norms. Obtained value is a
-voltage (phase1 to neutral) which is 243.16 Volts.
+% \begin{center}
+% \begin{tabular}{ll}
+% Current (phase 1): & 3929 \\
+% Voltage (phase 1): & 3927 \\
+% Active power (phase 1): & 3919
+% \end{tabular}
+% \end{center}
+
+% Values in every register are in little endian format (1st
+% register contains LSB and next register contains MSB). In our case,
+% energy meter is a slave.
+% As discussed before, slave addresses can be set between 1 and 247.
+
+In Modbus protcol, the master needs to send a request packet (referred as RQ hereafter)
+to the slave to read any of the slave's parameters. When the
+slave receives an RQ, it needs to come up with a response packet
+(referred as RP hereafter), which contains the value requested
+by the master. In other words, an RQ is a message from the
+master to a slave and an RP is a message from the slave back to the
+master. We will first explain the structure of an RQ, followed by an example.
+An RQ consists of following fields:
+\begin{enumerate}
+ \item Slave id: The first byte of every Modbus message is a slave id.
+ The master specifies the id of the slave to which the request message
+ is addressed. Slaves must specify their own id in every
+ response message (RP).
+ \item Function code: The second byte of every Modbus message is a
+ function code. This code determines the type of operation to be
+ performed by the slave. \tabref{tab:modbus-fun-codes} enlists the various
+ function codes.
+ \item Address of the register: After the above two bytes, RQ specifies the
+ data address of the first register requested.
+ \item Number of registers: This field denotes the total number of
+ registers requested.
+ \item CRC bytes: The last two bytes of every Modbus message are CRC
+ bytes. CRC stands for Cyclic Redundancy check. It is added to the
+ end of every Modbus message for error detection.
+ Every byte in the message is used to calculate the CRC.
+ The receiving device also calculates the CRC and compares it to the
+ CRC from the sending device. If even one bit in the message is
+ received incorrectly, the CRCs will be different and an error will result.
+
+ \paragraph{Note:} There are some online tools \cite{online-crc} by which one can calculate
+ the CRC bytes. However, one should note that the calculated CRC bytes
+ should be mentioned in little-endian format, which means that
+ the first register contains the least significant bit (LSB) and the
+ next register contains the most significant bit (MSB).
+\end{enumerate}
+
+Let us say, we want to access V1 (Voltage phase 1 to neutral) in the
+energy meter. From \tabref{tab:params-addr}, it may be noted that the address of V1 is
+3927. The size of each Modbus register is 16 bits and all EM6400 readings
+are of 32 bits. So, each reading occupies two consecutive Modbus
+registers. Thus, we need to access two consective holding registers
+(starting from 3926) to get V1. \tabref{tab:params-rq} summarizes the
+values for the various fields in an RQ.
+\begin{table}
+ \centering
+ \caption{A request packet to access V1 in EM6400}
+ \label{tab:params-rq}
+ \begin{tabular}{lc}\hline
+ Field of the RQ & Value for reading V1 \\ \hline
+ Slave id & 01 \\
+ Function code & 03 \\
+ Address of the register & 3926 (hex value = 0F56) \\
+ Number of registers & 02 \\
+ CRC bytes & 270F \\
+ \hline
+ \end{tabular}
+\end{table}
+Now, we explain the structure of an RP, followed by an example.
+An RP consists of following fields:
+\begin{enumerate}
+ \item Slave id: In an RP, the slaves must specify their own id.
+ \item Function code: Like the RQ, the second byte of RP is the function code.
+ This code determines the type of operation to be
+ performed by the slave. \tabref{tab:modbus-fun-codes} enlists the various
+ function codes.
+ \item Number of data bytes to follow: It refers to the total number of bytes
+ read. As our RQ has 2 registers each of two bytes, we expect a total of 4 bytes.
+ \item Data in the first requested register: It refers to the data stored
+ in the first register.
+ \item Data in the second requested register: It refers to the data stored
+ in the second register.
+ \item CRC bytes: As stated earlier, the last two bytes of every Modbus message are CRC
+ bytes. Like RQ, the receiving device also calculates the CRC and compares it to the
+ CRC from the sending device.
+\end{enumerate}
+% An example of a request packet is as follows. Suppose that
+% the request is 01 03 0F56 0002 270F. Its meaning is explained in
+% \tabref{tab:request-packet}.
+% \begin{table}
+% \centering
+% \caption{Interpretation of a request packet}
+% \label{tab:request-packet}
+% \begin{tabular}{lp{10cm}}
+% 01 & Slave address \\
+% 03 & Function code to read holding registers \\
+% 0F56 & Data Address of the first requested register (address for
+% voltage phase1 to neutral) and
+% (0F56 hex = 3927, +40001 offset = 43928) \\
+% 0002 & Total number of registers requested for read \\
+% 270F & CRC (Cyclic Redundancy Check) for error checking (LSB first) \\
+% \end{tabular}
+% \end{table}
+Let us consider the RP, which we have received as a response to the RQ mentioned
+in \tabref{tab:params-rq}. \tabref{tab:params-rp} summarizes the values for the
+various fields in this RP.
+\begin{table}
+ \centering
+ \caption{A response packet to access V1 in EM6400}
+ \label{tab:params-rp}
+ \begin{tabular}{lc}\hline
+ Field of the RP & Value for reading V1 \\ \hline
+ Slave id & 01 \\
+ Function code & 03 \\
+ Number of data bytes to follow & 04 \\
+ Data in the first requested register & 2921 \\
+ Data in the second requested register & 4373 \\
+ CRC bytes & D2B0 \\
+ \hline
+ \end{tabular}
+\end{table}
+% The response packet corresponding the above request packet
+% is given as 01 03 04 2921 4373 D2B0. Its meaning is explained in
+% \tabref{tab:response-packet}.
+% \begin{table}
+% \centering
+% \caption{Interpretation of a response packet}
+% \label{tab:response-packet}.
+% \begin{tabular}{ll}
+% 01 & Slave address \\
+% 03 & Function code to read holding registers \\
+% 04 & Total number of bytes read \\
+% 2921 & Data in 1st requested register \\
+% 4373 & Data in 2st requested register \\
+% D2B0 & CRC for error checking (LSB first)
+% \end{tabular}
+% \end{table}
+In this RP, we consider the data in the two requested registers to be 43732921
+in hexadecimal. The reason behind keeping the data in the second requested register
+as the MSB is that the obtained values are being read in little-endian format.
+After converting this value to floating point using the
+IEEE Standard for Floating-Point Arithmetic (IEEE 754), we obtain the
+value as 243.16. Thus, the value of V1 (Voltage phase 1 to neutral) in the
+energy meter is found to be 243.16 Volts.
+
+\subsection{Endianness}
Most of the numeric values to be stored in the computer are more than
one byte long. Thus, there arises a question of how to store the
multibyte values on the computer machines where each byte has its own
-address i.e. which byte gets stored at the ''first'' (lower) memory
+address \ie\ which byte gets stored at the ``first'' (lower) memory
location and which bytes follow in higher memory locations. For
-example, if a two byte integer 0x5E5F is stored on disk by one machine
-with the 0x5E (high byte or MSB) stored at the lower memory address
-and the 0x5F (low byte or LSB) stored at a higher memory address, but
-a different machine reads that integer by picking 0x5F for the high
-byte and the 0x5E for the low byte, giving 0x5F5E, thus resulting into
-an disagreement on the value of the integer between the two
-machines. However, there is no so called ''right'' ordering to store
-the bytes in the case of multibyte quantities. Hardware is built to
-store the bytes in a particular fashion and as long as compatible
+example, let us picture this. A two-byte integer 0x5E5F is stored on the
+disk by one machine with the 0x5E (MSB) stored at the lower
+memory address and the 0x5F (LSB) stored at a higher memory address.
+But there is a different machine which reads this integer by
+picking 0x5F for the MSB and 0x5E for the LSB, giving 0x5F5E.
+Hence, it results into a disagreement on the value of the integer
+between the two machines. However, there is no so called ``right''
+ordering to store the bytes in the case of multibyte quantities.
+Hardware is built to store the bytes in a particular fashion and as long as compatible
hardware reads the bytes in the same fashion, things are
-fine. Following are the two major types of byte ordering:
-
-\begin{description}
-\item [Little Endian:]
-If the hardware is designed so that the lowest or the least
-significant byte (LSB) of a multibyte integer is stored ''first'', at
-the lowest memory address, then the hardware is said to be Little
-Endian. In this format, the ''little'' end of the integer gets stored
-first and the next bytes get stored in higher (increasing) memory
-locations.
-\item [Big Endian:]
-Here, the hardware is designed so that the highest or the most
-significant byte (MSB) of a multibyte integer is stored ''first'', at
-the lowest memory address. Thus, the ''big'' end of the integer gets
-stored first and accordingly the next bytes get stored in higher
-(increasing) memory locations.
-\end{description}
-For example, let us take a four byte integer 0x436B84A3. Quite
-obvious, the ''little'' end byte, LSB is 0x84A3, and the ''big'' end
-byte, MSB is 0x436B; taking into consideration that the Read Holding
-Registers are 16 bits each. Thus the aforesaid memory storage patterns
-for the integer would be \tabref{tab:ieee-decimal}.
+fine. Following are the two major types of storing the bytes:
+\begin{enumerate}
+ \item Little Endian:
+ If the hardware is designed so that the LSB of a multibyte integer is stored ``first''at the lowest memory address, then the hardware is said to be little-endian. In this format, the ''little'' end of the integer gets stored
+ first and the next bytes are stored in higher (increasing) memory
+ locations.
+ \item Big Endian:
+ Here, the hardware is designed so that the MSB of a multibyte integer is stored ``first''at the lowest memory address. Thus, the ``big'' end of the integer gets
+ stored first and accordingly the next bytes get stored in higher
+ (increasing) memory locations.
+\end{enumerate}
+For example, let us take a four-byte integer 0x436B84A3. Considering
+that the read holding registers in Modbus protocol are 16-bits each, the
+LSB (or the little end) of this integer is 0x84A3, and the MSB (or the big end)
+of this integer is 0x436B. Then, the memory storage patterns
+for the integer would be as that shown in \tabref{tab:memory-storage}.
\begin{table}
-\centering
-\caption{Hexadecimal to Decimal}
-\label{tab:ieee-decimal}
-\begin{tabular}{ |p{3cm}|p{3cm}|p{3cm}|p{3cm}|}
-
-\hline
-\multicolumn{4}{|c|}{Four Bytes Integer Reading from Meter} \\
-\hline
-
- Memory Address & Memory Address & Little Endian & Big Endian \\ \hline
- 3900 & 8A43 & MSB & LSB \\
- 3901 & 436B & LSB & MSB \\ \hline
- \end{tabular}
+ \centering
+ \caption{Memory storage of a four-byte integer in little-endian and big-endian}
+ \label{tab:memory-storage}
+ \begin{tabular}{lllc}\hline
+ Memory Address & Byte & Little-endian & Big-endian \\ \hline
+ 3900 & 8A43 & MSB & LSB \\
+ 3901 & 436B & LSB & MSB \\
+ \hline
+ \end{tabular}
\end{table}
-
-In order to represent the Hexadecimal values of the Read Holding
-Registers into user friendly decimal (floating point) values, we
-follow IEEE 754 Standard. Most common standards for representing
+% \begin{table}
+% \centering
+% \caption{Hexadecimal to Decimal}
+% \label{tab:ieee-decimal}
+% \begin{tabular}{ |p{3cm}|p{3cm}|p{3cm}|p{3cm}|}
+
+% \hline
+% \multicolumn{4}{|c|}{Four Bytes Integer Reading from Meter} \\
+% \hline
+
+% Memory Address & Memory Address & Little-endian & Big-endian \\ \hline
+% 3900 & 8A43 & MSB & LSB \\
+% 3901 & 436B & LSB & MSB \\ \hline
+% \end{tabular}
+% \end{table}
+
+% \begin{table}
+% \centering
+% \caption{Single and Double Precision Representation}
+% \label{tab:single-precision}
+% \begin{tabular}{|l|l|l|l|}
+% \hline
+% Single & Sign (1 bit) & Exponent (8 bit) & Mantissa (23 bit) \\ \hline
+% Double & Sign (1 bit) & Exponent (11 bit) & Mantissa (52 bit) \\ \hline
+% \end{tabular}
+% \end{table}
+
+
+To represent the hexadecimal values of the read holding
+registers into user friendly decimal (floating point) values, we
+follow IEEE 754 standard. Most common standards for representing
floating point numbers are:
\begin{enumerate}
-\item Single Precision: Used for 32 bits. Out of those 32 bits, one
- bit represents the sign bit, 8 bits for exponent and the remaining
- 23 bits for mantissa, as depicted in \tabref{tab:single-precision}.
-
-\begin{table}
-\centering
-\caption{Single and Double Precision Representation}
-\label{tab:single-precision}
-\begin{tabular}{|l|l|l|l|}
-\hline
-Single & Sign (1 bit) & Exponent (8 bit) & Mantissa (23 bit) \\ \hline
-Double & Sign (1 bit) & Exponent (11 bit) & Mantissa (52 bit) \\ \hline
-\end{tabular}
-\end{table}
-\item Double Precision: Used for 64 bits. Out of those 32 bits, one bit represents the sign bit, 8 bits for exponent and the remaining 23 bits for mantissa, as depicted in \tabref{tab:single-precision}.
+ \item Single precision: In this standard, 32 bits are used to represent floating-point number.
+ Out of these 32 bits, one bit is for the sign bit, 8 bits for exponent and the remaining
+ 23 bits for mantissa.
+ \item Double precision: Here, 64 bits are used to represent floating-point number.
+ Out of these 64 bits, one bit represents the sign bit, 11 bits for exponent and the
+ remaining 52 bits for mantissa. As the name indicates, this standard is used where precision matters more.
\end{enumerate}
-Finally, the decimal value is given by,
-Decimal Value = $( - 1) * \text{sign} * 2^{exponent}* \text{Mantissa}$.
-Hence, for 32 bit values, the sign is stored in bit 32. The exponent
-can be calculated from bits 24-31 by subtracting 127. The mantissa is
-stored in bits 1-23. An invisible leading bit (i.e. it is not actually
-stored) with value 1.0 is placed in front, then bit 23 has a value of
-1/2, bit 22 has value 1/4 etc. As a result, the mantissa has a value
-between 1.0 and 2. At last, the decimal value is calculated using the
-above mentioned equation. Though there are several online converters
-available as IEEE 754 Converter, a function has been formulated in
-Scilab for this conversion here.
+% Decimal Value = $( - 1) * \text{sign} * 2^{exponent}* \text{Mantissa}$.
+% Hence, for 32 bit values, the sign is stored in bit 32. The exponent
+% can be calculated from bits 24-31 by subtracting 127. The mantissa is
+% stored in bits 1-23. An invisible leading bit (i.e. it is not actually
+% stored) with value 1.0 is placed in front, then bit 23 has a value of
+% 1/2, bit 22 has value 1/4 etc. As a result, the mantissa has a value
+% between 1.0 and 2. At last, the decimal value is calculated using the
+% above mentioned equation.
+There are several online converters \cite{ieee-754-conv} which peform the
+IEEE 754 floating point conversion. In this chapter, a function has been formulated in
+Scilab for this conversion.
\section{Objective}
The objective of this experiment is to make the user acquainted with
-the use of Modbus protocol through Arduino Uno. It gives an insight on
-how to acquire readings from the Energy Meter and interpret them
-accordingly. As mentioned earlier, an Energy Meter is a device that
-gives us different electrical parameters including voltage, current,
+the use of Modbus protocol through the Scilab-Arduino toolbox \cite{modbus-paper}.
+It gives an insight on how to acquire readings from the energy meter and
+interpret them accordingly. As explained in \secref{sec:energy-meter},
+an energy meter is a device that gives us different electrical parameters including voltage, current,
and power, consumed by a device. Here, we aim to obtain these values
-using Scilab and Arduino Uno. For data transmission, we have used
-RS485 Module.
+using Scilab-Arduino toolbox. For data transmission, we have used an
+RS485 module.
-Scilab is used for giving the required parameters to Arduino Uno. For
-example, the user will tell the required Slave Address to be accessed
+Scilab is used for giving the required parameters to \arduino. For
+example, the user will tell the required slave address to be accessed
and the number of registers to be read from or written to. Here,
-Arduino Uno acts as a master and Energy Meter as a slave. Therefore,
+\arduino\ acts as a master and energy meter as a slave. Therefore,
referring to a particular slave address will refer to the registers
-that hold the desired electrical parameters (Current, Voltage, Power
-etc.), which we want from the Energy Meter (Slave).
+that hold the desired electrical parameters (current, voltage, power
+etc.), which we want to read from the energy meter.
-This Arduino Uno is then connected to the Energy Meter via a MAX485
-chip which facilitates long distance communication. The information
-packet is sent to the Arduino Uno, which in turn sends it to the
-Energy Meter. The Energy Meter then accesses the values in the
+In this experiment, \arduino\ is connected to the energy meter via
+an RS485 module which facilitates long distance communication.
+\scilab\ sends the RQ to the \arduino\, which in turn sends it to the
+energy meter. The energy meter then accesses the values in the
required addresses in its memory and transfers them back. This again,
-is in the form of another packet. Data which is in Little Endian hex
-format is obtained from this and is converted to floating point number
-using IEEE 754.
+is in the form of another packet called RP. In this packet, the data is stored in
+little-endian hexadecimal format. Thus, we make use of IEEE 754 to obtain the
+decimal value from this data.
+
+
\begin{figure}
-\centering
-\includegraphics[width=\lgfig]{\LocMODfig/Full-Set-Up.png}
-\caption{MODBUS Set Up for Energy Meter}
-\label{fig:full-set-up}
+ \centering
+ \includegraphics[width=\lgfig]{\LocMODfig/block-diagram.PNG}
+ \caption{Block diagram for reading the parameters in energy meter}
+ \label{fig:block-diagram}
\end{figure}
-\section{Energy Meter set up for Modbus protocol with Arduino Uno}
-\begin{enumerate}
-\item As we know, Arduino Uno has one serial port. It communicates on
- the digital pins 0 and 1 as well as on the computer via USB. Since
- we want serial communication which shouldn't be disturbed by the USB
- port and the Serial Monitor, we use the Software Serial
- library. Using this library we can assign any digital pins as RX and
- TX and use for serial communication. Pin 10 (used as RX) and Pin
- 11(used as TX) is connected to RO (Receive Out) and DI (Data In)
- pins of MAX485 module respectively.
-\item DE (Data Enable) and RE (Receive Enable) pins of RS 485 are
- shorted and connected to digital pin 3 of Arduino Uno. This serves
- as Control Pin which will control when to receive and transmit
- serially.
-\item Vcc and GND of the MAX485 module are connected to Vcc and GND of
- Arduino.
-\item A and B pins of MAX485 are connected to A (Pin 7) and B (Pin 14)
- pins of the Energy Meter (meant for RS485 communication).
-\item A $120k\Omega$ termination resistance is connected in between
- pins A and B to avoid reflection losses in transmission line.
-\end{enumerate}
-
\begin{figure}
-\centering
-\includegraphics[width=\lgfig]{\LocMODfig/block-diagram.PNG}
-\caption{Block Diagram for Energy Meter Setup}
-\label{fig:block-diagram}
+ \centering
+ \includegraphics[width=\lgfig]{\LocMODfig/Full-Set-Up.png}
+ \caption{Experimental set up for reading energy meter}
+ \label{fig:full-set-up}
\end{figure}
-\section{Software}
+\section{Manifestation of Modbus protocol with \arduino\ and energy meter}
+In this section, we discuss the setup which we follow for configuring
+\arduino\ as Modbus master and energy meter as the slave.
+The block diagram is being shown in \figref{fig:block-diagram} ,
+whereas \figref{fig:full-set-up} presents the
+actual setup. Following steps discuss the various connections of this setup:
+\begin{enumerate}
+ \item We know that \arduino\ has only one serial port. It communicates on
+ the digital pins 0 and 1 as well as on the computer via USB. Since
+ we want a serial communication which shouldn't be disturbed by the USB
+ port and the Serial Monitor, we use the Software Serial
+ library. Using this library we can assign any digital pins as RX and
+ TX and use it for serial communication. In this experiment, pin 10 (used as RX) and pin
+ 11 (used as TX) is connected to RO (Receive Out) and DI (Data In)
+ pins of RS485 module respectively.
+ \item DE (Data Enable) and RE (Receive Enable) pins of RS 485 are
+ shorted and connected to digital pin 3 of the \arduino\ board.
+ This serves as a control pin which will control when to receive and transmit
+ serially.
+ \item Vcc and GND of the RS485 module are connected to Vcc and GND of
+ the \arduino\ board.
+ \item A and B pins of RS485 module are connected to A (Pin 7) and B (Pin 14)
+ pins of the energy meter. These two pins of the energy meter are meant for RS485 communication.
+ \item A $120k\Omega$ termination resistor is connected in between
+ pins A and B to avoid reflection losses in transmission line.
+\end{enumerate}
-Software for the demonstration comprises two parts:
+\subsection{Software}
+Apart from the Scilab-Arduino toolbox, the software for the
+manifestation of Modbus protocol comprises two parts:
\begin{enumerate}
-\item Arduino Uno firmware code: This code is written to communicate
- with Scilab (using serial interface), and with MAX485 chip (using
- Software Serial interface). Control logic to enable receive and
- transmit modes of MAX485 chip is also present in Arduino Uno
- firmware code.The overall implementation is being described in
- \figref {fig:modbus-firmware}.
+\item Firmware for \arduino: This code is written to communicate
+with Scilab (using serial interface), and with RS485 module (using
+Software Serial interface). Control logic to enable receive and
+transmit modes of MAX485 chip is also present in this firmware.
+The overall implementation of this firmware is demonstrated in
+\figref{fig:modbus-firmware}.
\begin{figure}
-\centering
-\includegraphics[width=\lgfig]{\LocMODfig/arduino_code_flowchart.png}
-\caption{Flowchart of Arduino firmware}
-\label{fig:modbus-firmware}
+ \centering
+ \includegraphics[width=\lgfig]{\LocMODfig/arduino_code_flowchart.png}
+ \caption{Flowchart of Arduino firmware}
+ \label{fig:modbus-firmware}
\end{figure}
-\item Scilab code: This code requests Energy Meter readings by sending
- request packet to Arduino Uno from Scilab. Then it waits till
- requested packet is available from Arduino Uno. After receiving the
- packet, it extracts data from the packet and converts it into IEEE
- 754 floating point format. The overall implementation is being
- described below:
+\item Scilab code: This code requests for the paramenters in energy meter
+by sending a RQ to \arduino\ from Scilab. Then it waits till
+a RP is available from the \arduino. After receiving the RP, it extracts
+the data from this packet and converts it into IEEE
+754 floating point format. The overall implementation is being
+described below:
\begin {enumerate}
-\item Frame request packet to be sent to slave in ASCII coded decimal
- format
-\item Send the packet serially to Arduino Uno board (Arduino Uno sends
- this packet to Energy Meter via RS 485 module)
-\item Read the response packet available on Arduino Uno board (sent by
- Energy meter to Arduino via RS 485)
-\item Extract holding register contents from received packet
-\item Convert 32 bit register contents which are in little endian
- format to floating point number using ieeesingle2num function
-\item Display the value of electrical parameter read(i.e. voltage,
- current or power)
+\item Frame a RQ to be sent to the energy meter (slave) in ASCII coded decimal
+format.
+\item Send the RQ serially to \arduino.
+\item Let \arduino\ send the RQ to the energy meter via RS485 module
+\item Let the energy meter send the RP to \arduino\ via RS485 module
+\item Read the RP available on \arduino\
+\item Extract the data stored in holding registers from the RP
+\item Assuming this data to be stored in little-endian format,
+convert this data in floating point values using IEEE 754 standard.
+\item Display the value in the \scilab\ Console.
\end{enumerate}
-
+This implementation is also being shown in \figref{fig:flow-chart}.
\begin{figure}
-\centering
-\includegraphics[width=\hgfig]{\LocMODfig/flowchart.png}
-\caption{Flow Chart of the Modbus Energy Meter Implementation}
-\label{fig:flow-chart}
+ \centering
+ \includegraphics[width=\hgfig]{\LocMODfig/flowchart.png}
+ \caption{Flowchart of the steps happening in Scilab code}
+ \label{fig:flow-chart}
\end{figure}
\end{enumerate}
-\section{Output}
-
+\subsection{Output in the Scilab Console}
+In this section, we present the results. In this experiment, the three parameters:
+voltage, current, and active power in the energy meter have been accessed and displayed
+on the Scilab console. For each of these three parameters, we present two image: one showing
+the reading being shown in the energy meter and the another showing the
+value being read in the Scilab Console.
\begin{enumerate}
-\item Single phase current output: \figref{fig:current-console} and
- \figref{fig:current-meter} show Scilab code output of current in
- Amperes and corresponding snapshot of Energy Meter display with a
- single load rated 60W-230V.
+ \item Single phase current output: \figref{fig:current-console} and
+ \figref{fig:current-meter} show Scilab code output of current in
+ Amperes and corresponding snapshot of energy meter display with a
+ single load rated 60W-230V.
+
+ \begin{figure}
+ \centering
+ \includegraphics[width=\linewidth]{\LocMODfig/current-output.png}
+ \caption{Single phase current output on Scilab Console}
+ \label{fig:current-console}
+ \end{figure}
+
+ \begin{figure}
+ \centering
+ \includegraphics[width=\lgfig]{\LocMODfig/current-output-setup.jpg}
+ \caption{Single phase current output in energy meter}
+ \label{fig:current-meter}
+ \end{figure}
+
+ \item Single phase voltage output: \figref{fig:voltage-console} and
+ \figref{fig:voltage-meter} show Scilab code output of voltage in
+ Volts and corresponding snapshot of energy meter display with a
+ single load rated 60W-230V.
+
+ \begin{figure}
+ \centering
+ \includegraphics[width=\linewidth]{\LocMODfig/voltage-output.png}
+ \caption{Single phase voltage output on Scilab Console}
+ \label{fig:voltage-console}
+ \end{figure}
+
+ \begin{figure}
+ \centering
+ \includegraphics[width=\lgfig]{\LocMODfig/voltage-output-setup.jpg}
+ \caption{Single phase voltage output in energy meter}
+ \label{fig:voltage-meter}
+ \end{figure}
+
+ \item Single phase active power output: \figref{fig:power-console} and \figref{fig:power-meter} show Scilab code output of active power
+ in Watts and corresponding snapshot of energy meter display with a
+ single load rated 60W-230V.
+ \begin{figure}
+ \centering
+ \includegraphics[width=\linewidth]{\LocMODfig/active-power-output.png}
+ \caption{Single phase active power output on Scilab Console}
+ \label{fig:power-console}
+ \end{figure}
+
+ \begin{figure}
+ \centering
+ \includegraphics[width=\lgfig]{\LocMODfig/active-power-output-setup.jpg}
+ \caption{Single phase active power output in energy meter}
+ \label{fig:power-meter}
+ \end{figure}
+
+\end{enumerate}
-\begin{figure}
-\centering
-\includegraphics[width=\linewidth]{\LocMODfig/current-output.png}
-\caption{Single Phase Current Output on Scilab Console}
-\label{fig:current-console}
-\end{figure}
-\begin{figure}
-\centering
-\includegraphics[width=\lgfig]{\LocMODfig/current-output-setup.jpg}
-\caption{Single Phase Current Output on Energy Meter}
-\label{fig:current-meter}
-\end{figure}
+% In output, user could see the requested energy parameter on Scilab
+% console. For demonstration we have taken single phase current, single
+% phase voltage and single phase active power reading. We can always
+% verify the Scilab output with the value being displayed on the Energy
+% Meter display screen.
-\item Single phase voltage output: \figref{fig:voltage-console} and
- \figref{fig:voltage-meter} show Scilab code output of voltage in
- Volts and corresponding snapshot of Energy Meter display with a
- single load rated 60W-230V.
-\begin{figure}
-\centering
-\includegraphics[width=\linewidth]{\LocMODfig/voltage-output.png}
-\caption{Single Phase Voltage Output on Scilab Console}
-\label{fig:voltage-console}
-\end{figure}
+\section{Accessing the electrical parameters from Scilab}
+\subsection{Accessing the electrical parameters}
+In this section, we will show how to access the three parameters (voltage, current, and active power)
+in the energy meter. As dicussed above, we will send a RQ from Scilab to \arduino. In lieu of this,
+\arduino\ will provide us with a RP, which can be decoded to extract the
+desired parameter. The reader should go through the instructions given in
+\secref{sec:sci-start} before getting started.
-\begin{figure}
-\centering
-\includegraphics[width=\lgfig]{\LocMODfig/voltage-output-setup.jpg}
-\caption{Single Phase Voltage Output on Energy Meter}
-\label{fig:voltage-meter}
-\end{figure}
+\subsection{Arduino Firmware}
+\label{sec:firmware-modbus}
+\addtocontents{ard}{\protect\addvspace{\codclr}}
-\item Single phase active power outputs are shown in
- \figref{fig:power-console} and \figref{fig:power-meter}.
+\begin{ardcode}
+ \acaption{First 10 lines of the firmware for Modbus Energy Meter
+ experiment}
+ {First 10 lines of the firmware for Modbus. Available at
+ \LocMODardbrief{send\_packet.ino}.}
+ \label{ard:firmware-modbus}
+ \lstinputlisting[firstline=1,lastline=10]
+ {\LocMODardcode/send_packet.ino}
+\end{ardcode}
-\begin{figure}
-\centering
-\includegraphics[width=\linewidth]{\LocMODfig/active-power-output.png}
-\caption{Single Phase Voltage Output on Scilab Console}
-\label{fig:power-console}
-\end{figure}
+\subsection{Scilab Code}
+\label{sec:modbus-scilab-code}
+\addtocontents{cod}{\protect\addvspace{\codclr}}
-\begin{figure}
-\centering
-\includegraphics[width=\lgfig]{\LocMODfig/active-power-output-setup.jpg}
-\caption{Single Phase Voltage Output on Energy Meter}
-\label{fig:power-meter}
-\end{figure}
+\begin{scicode}
+ \ccaption{First 10 lines of the function for scifunc block}
+ {First 10 lines of the Scifunc block function. Available at
+ \LocMODscibrief{read\_val.sci}.}
+ \label{sci:current-modbus}
+ \lstinputlisting[firstline=1,lastline=10]
+ {\LocMODscicode/read_val.sce}
+\end{scicode}
-\end{enumerate}
+\begin{scicode}
+ \ccaption{First 10 lines of the code for Single Phase Current Output}
+ {First 10 lines of the code for Single Phase Current Output.
+ Available at \LocMODscibrief{read\_current.sci}.}
+ \label{sci:current-modbus}
+ \lstinputlisting[firstline=1,lastline=10]
+ {\LocMODscicode/read_current.sci}
+\end{scicode}
+\begin{scicode}
+ \ccaption{First 10 lines of the code for Single Phase Voltage Output}
+ {First 10 lines of the code for Single Phase Voltage Output.
+ Available at \LocMODscibrief{read\_voltage.sci}.}
+ \label{sci:voltage-modbus}
+ \lstinputlisting[firstline=1,lastline=10]
+ {\LocMODscicode/read_voltage.sci}
+\end{scicode}
-In output, user could see the requested energy parameter on Scilab
-console. For demonstration we have taken single phase current, single
-phase voltage and single phase active power reading. We can always
-verify the Scilab output with the value being displayed on the Energy
-Meter display screen.
+\begin{scicode}
+ \ccaption{First 10 lines of the code for Single Phase Active Power
+ Output}{First 10 lines of the code for Single Phase Active Power
+ Output. Available at
+ \LocMODscibrief{read\_active\_power.sci}.}
+ \label{sci:modbus-power}
+ \lstinputlisting[firstline=1,lastline=10]
+ {\LocMODscicode/read_active_power.sci}
+\end{scicode}
\section{Reading Parameters from Xcos}
In this section we will carry out the same experiments discussed in
@@ -453,42 +698,42 @@ the previous sections but through Xcos. One should go through
\secref{sec:xcos-start} before continuing.
\begin{enumerate}
-\item The Xcos diagram for performing the read values for single phase
- current, single phase voltage and single phase power operation is as
- shown in \figref{fig:mod-read}. The location of the xcos file is
- mentioned in the caption of the figure.
-
-\begin{figure}
- \centering
- \includegraphics[width=\lgfig]{\LocMODfig/read_value_xcos.png}
- \caption[Xcos diagram to read Energy Meter values]{Xcos diagram to
- read Energy Meter values. This is what one sees when {\tt
- \LocMODscibrief/read\_value\_xcos.zcos} is invoked.}
- \label{fig:mod-read}
- \end{figure}
-The parameters of the blocks can be changed by right clicking on the
-block and choosing {\tt Block Parameters}. One can also double click
-on the block. The values for each block is tabulated in
-\tabref{tab:mod-xcos-read}. All other parameters are to be left
-unchanged.
-
-\begin{table}
- \centering
- \caption{Xcos parameters to read Energy Meter}
- \label{tab:mod-xcos-read}
- \begin{tabular}{llc} \hline
- Name of the block & Parameter name & Value \\ \hline
- CONST\_m & Address byte for voltage & 86 \\
- & Address byte for current & 88 \\
- & Address byte for power & 78\\ \hline
- SELF\_SWITCH & Signal Routing & on/off \\ \hline
- BIGSOM\_f & Scalar vector addition/subtraction Summation & [1;1;1] \\ \hline
- scifunc\_block\_m & Block for user\-defined function & read\_value.sci \\ \hline
- AFFICH\_m & Block inherits(1) or not (0) & 0 \\ \hline
- CLOCK\_c & Period & 0.1 \\
- & Initialisation Time & 0 \\ \hline
- \end{tabular}
- \end{table}
+ \item The Xcos diagram for performing the read values for single phase
+ current, single phase voltage and single phase power operation is as
+ shown in \figref{fig:mod-read}. The location of the xcos file is
+ mentioned in the caption of the figure.
+
+ \begin{figure}
+ \centering
+ \includegraphics[width=\lgfig]{\LocMODfig/read_value_xcos.png}
+ \caption[Xcos diagram to read Energy Meter values]{Xcos diagram to
+ read Energy Meter values. This is what one sees when {\tt
+ \LocMODscibrief/read\_value\_xcos.zcos} is invoked.}
+ \label{fig:mod-read}
+ \end{figure}
+ The parameters of the blocks can be changed by right clicking on the
+ block and choosing {\tt Block Parameters}. One can also double click
+ on the block. The values for each block is tabulated in
+ \tabref{tab:mod-xcos-read}. All other parameters are to be left
+ unchanged.
+
+ \begin{table}
+ \centering
+ \caption{Xcos parameters to read Energy Meter}
+ \label{tab:mod-xcos-read}
+ \begin{tabular}{llc} \hline
+ Name of the block & Parameter name & Value \\ \hline
+ CONST\_m & Address byte for voltage & 86 \\
+ & Address byte for current & 88 \\
+ & Address byte for power & 78 \\ \hline
+ SELF\_SWITCH & Signal Routing & on/off \\ \hline
+ BIGSOM\_f & Scalar vector addition/subtraction Summation & [1;1;1] \\ \hline
+ scifunc\_block\_m & Block for user\-defined function & read\_value.sci \\ \hline
+ AFFICH\_m & Block inherits(1) or not (0) & 0 \\ \hline
+ CLOCK\_c & Period & 0.1 \\
+ & Initialisation Time & 0 \\ \hline
+ \end{tabular}
+ \end{table}
\end{enumerate}
After we send the query using Modbus protocol from Scilab (using
@@ -509,154 +754,100 @@ for analyzing data.
The functionalities performed by scilab code have also been implemetned in
python and julia and OpenModelica.
-\section{Code}
-\subsection{Arduino Code}
-\label{sec:firmware-modbus}
-\addtocontents{ard}{\protect\addvspace{\codclr}}
-
-\begin{ardcode}
-\acaption{First 10 lines of the firmware for Modbus Energy Meter
- experiment}
-{First 10 lines of the firmware for Modbus. Available at
- \LocMODardbrief{send\_packet.ino}.}
-\label{ard:firmware-modbus}
-\lstinputlisting[firstline=1,lastline=10]
-{\LocMODardcode/send_packet.ino}
-\end{ardcode}
-
-\subsection{Scilab Code}
-\label{sec:modbus-scilab-code}
-\addtocontents{cod}{\protect\addvspace{\codclr}}
-
-\begin{scicode}
-\ccaption{First 10 lines of the function for scifunc block}
-{First 10 lines of the Scifunc block function. Available at
- \LocMODscibrief{read\_val.sci}.}
-\label{sci:current-modbus}
-\lstinputlisting[firstline=1,lastline=10]
-{\LocMODscicode/read_val.sce}
-\end{scicode}
-
-\begin{scicode}
-\ccaption{First 10 lines of the code for Single Phase Current Output}
-{First 10 lines of the code for Single Phase Current Output.
- Available at \LocMODscibrief{read\_current.sci}.}
-\label{sci:current-modbus}
-\lstinputlisting[firstline=1,lastline=10]
-{\LocMODscicode/read_current.sci}
-\end{scicode}
-\begin{scicode}
-\ccaption{First 10 lines of the code for Single Phase Voltage Output}
-{First 10 lines of the code for Single Phase Voltage Output.
- Available at \LocMODscibrief{read\_voltage.sci}.}
-\label{sci:voltage-modbus}
-\lstinputlisting[firstline=1,lastline=10]
-{\LocMODscicode/read_voltage.sci}
-\end{scicode}
-
-\begin{scicode}
-\ccaption{First 10 lines of the code for Single Phase Active Power
- Output}{First 10 lines of the code for Single Phase Active Power
- Output. Available at
- \LocMODscibrief{read\_active\_power.sci}.}
-\label{sci:modbus-power}
-\lstinputlisting[firstline=1,lastline=10]
-{\LocMODscicode/read_active_power.sci}
-\end{scicode}
-\subsection{Python Code}
-\label{sec:modbus-python-code}
-\addtocontents{pyd}{\protect\addvspace{\codclr}}
-
-\begin{pycode}
-\pcaption{Code for Single Phase Current Output}
-{Code for Single Phase Current Output.
- Available at \LocMODpybrief{read\_current.py}.}
-\label{py:current-modbus}
-\lstinputlisting[firstline=1,lastline=10]
-{\LocMODpycode/read_current.py}
-\end{pycode}
-
-\begin{pycode}
-\pcaption{Code for Single Phase Voltage Output}
-{Code for Single Phase Voltage Output.
- Available at \LocMODpybrief{read\_voltage.py}.}
-\label{py:voltage-modbus}
-\lstinputlisting[firstline=1,lastline=10]
-{\LocMODpycode/read_voltage.py}
-\end{pycode}
-
-\begin{pycode}
-\pcaption{Code for Single Phase Active Power
- Output}{Code for Single Phase Active Power
- Output. Available at
- \LocMODpybrief{read\_active\_power.py}.}
-\label{py:modbus-power}
-\lstinputlisting[firstline=1,lastline=10]
-{\LocMODpycode/read_active_power.py}
-\end{pycode}
-
-\subsection{Julia Code}
-\label{sec:modbus-julia-code}
-\addtocontents{juliad}{\protect\addvspace{\codclr}}
-
-\begin{juliacode}
-\jcaption{Code for Single Phase Current Output}
-{Code for Single Phase Current Output.
- Available at \LocMODjuliabrief{readCurrent.jl}.}
-\label{julia:current-modbus}
-\lstinputlisting[firstline=1,lastline=10]
-{\LocMODjuliacode/readCurrent.jl}
-\end{juliacode}
-
-\begin{juliacode}
-\jcaption{Code for Single Phase Voltage Output}
-{Code for Single Phase Voltage Output.
- Available at \LocMODjuliabrief{readVoltage.jl}.}
-\label{julia:voltage-modbus}
-\lstinputlisting[firstline=1,lastline=10]
-{\LocMODjuliacode/readVoltage.jl}
-\end{juliacode}
-
-\begin{juliacode}
-\jcaption{First 10 lines of the code for Single Phase Active Power
- Output}{First 10 lines of the code for Single Phase Active Power
- Output. Available at
- \LocMODjuliabrief{readPower.jl}.}
-\label{julia:modbus-power}
-\lstinputlisting[firstline=1,lastline=10]
-{\LocMODjuliacode/readPower.jl}
-\end{juliacode}
-
-\subsection{OpenModelica Code}
-\label{sec:modbus-OpenModelica-code}
-\addtocontents{OpenModelicad}{\protect\addvspace{\codclr}}
-
-\begin{OpenModelicacode}
-\mcaption{Code for Single Phase Current Output}
-{Code for Single Phase Current Output.
- Available at \LocMODOpenModelicabrief{readCurrent.mo}.}
-\label{OpenModelica:current-modbus}
-\lstinputlisting[firstline=1,lastline=10]
-{\LocMODOpenModelicacode/readCurrent.mo}
-\end{OpenModelicacode}
-
-\begin{OpenModelicacode}
-\mcaption{Code for Single Phase Voltage Output}
-{Code for Single Phase Voltage Output.
- Available at \LocMODOpenModelicabrief{readVoltage.mo}.}
-\label{OpenModelica:voltage-modbus}
-\lstinputlisting[firstline=1,lastline=10]
-{\LocMODOpenModelicacode/readVoltage.mo}
-\end{OpenModelicacode}
-
-\begin{OpenModelicacode}
-\mcaption{Code for Single Phase Active Power
- Output}{Code for Single Phase Active Power
- Output. Available at
- \LocMODOpenModelicabrief{readPower.mo}.}
-\label{OpenModelica:modbus-power}
-\lstinputlisting[firstline=1,lastline=10]
-{\LocMODOpenModelicacode/readPower.mo}
-\end{OpenModelicacode}
+% \subsection{Python Code}
+% \label{sec:modbus-python-code}
+% \addtocontents{pyd}{\protect\addvspace{\codclr}}
+
+% \begin{pycode}
+% \pcaption{Code for Single Phase Current Output}
+% {Code for Single Phase Current Output.
+% Available at \LocMODpybrief{read\_current.py}.}
+% \label{py:current-modbus}
+% \lstinputlisting[firstline=1,lastline=10]
+% {\LocMODpycode/read_current.py}
+% \end{pycode}
+
+% \begin{pycode}
+% \pcaption{Code for Single Phase Voltage Output}
+% {Code for Single Phase Voltage Output.
+% Available at \LocMODpybrief{read\_voltage.py}.}
+% \label{py:voltage-modbus}
+% \lstinputlisting[firstline=1,lastline=10]
+% {\LocMODpycode/read_voltage.py}
+% \end{pycode}
+
+% \begin{pycode}
+% \pcaption{Code for Single Phase Active Power
+% Output}{Code for Single Phase Active Power
+% Output. Available at
+% \LocMODpybrief{read\_active\_power.py}.}
+% \label{py:modbus-power}
+% \lstinputlisting[firstline=1,lastline=10]
+% {\LocMODpycode/read_active_power.py}
+% \end{pycode}
+
+% \subsection{Julia Code}
+% \label{sec:modbus-julia-code}
+% \addtocontents{juliad}{\protect\addvspace{\codclr}}
+
+% \begin{juliacode}
+% \jcaption{Code for Single Phase Current Output}
+% {Code for Single Phase Current Output.
+% Available at \LocMODjuliabrief{readCurrent.jl}.}
+% \label{julia:current-modbus}
+% \lstinputlisting[firstline=1,lastline=10]
+% {\LocMODjuliacode/readCurrent.jl}
+% \end{juliacode}
+
+% \begin{juliacode}
+% \jcaption{Code for Single Phase Voltage Output}
+% {Code for Single Phase Voltage Output.
+% Available at \LocMODjuliabrief{readVoltage.jl}.}
+% \label{julia:voltage-modbus}
+% \lstinputlisting[firstline=1,lastline=10]
+% {\LocMODjuliacode/readVoltage.jl}
+% \end{juliacode}
+
+% \begin{juliacode}
+% \jcaption{First 10 lines of the code for Single Phase Active Power
+% Output}{First 10 lines of the code for Single Phase Active Power
+% Output. Available at
+% \LocMODjuliabrief{readPower.jl}.}
+% \label{julia:modbus-power}
+% \lstinputlisting[firstline=1,lastline=10]
+% {\LocMODjuliacode/readPower.jl}
+% \end{juliacode}
+
+% \subsection{OpenModelica Code}
+% \label{sec:modbus-OpenModelica-code}
+% \addtocontents{OpenModelicad}{\protect\addvspace{\codclr}}
+
+% \begin{OpenModelicacode}
+% \mcaption{Code for Single Phase Current Output}
+% {Code for Single Phase Current Output.
+% Available at \LocMODOpenModelicabrief{readCurrent.mo}.}
+% \label{OpenModelica:current-modbus}
+% \lstinputlisting[firstline=1,lastline=10]
+% {\LocMODOpenModelicacode/readCurrent.mo}
+% \end{OpenModelicacode}
+
+% \begin{OpenModelicacode}
+% \mcaption{Code for Single Phase Voltage Output}
+% {Code for Single Phase Voltage Output.
+% Available at \LocMODOpenModelicabrief{readVoltage.mo}.}
+% \label{OpenModelica:voltage-modbus}
+% \lstinputlisting[firstline=1,lastline=10]
+% {\LocMODOpenModelicacode/readVoltage.mo}
+% \end{OpenModelicacode}
+
+% \begin{OpenModelicacode}
+% \mcaption{Code for Single Phase Active Power
+% Output}{Code for Single Phase Active Power
+% Output. Available at
+% \LocMODOpenModelicabrief{readPower.mo}.}
+% \label{OpenModelica:modbus-power}
+% \lstinputlisting[firstline=1,lastline=10]
+% {\LocMODOpenModelicacode/readPower.mo}
+% \end{OpenModelicacode}