Weather station with ModBus over RS-485
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

515 lines
31 KiB

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>modbus-arduino: ModbusSerial Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
$(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="modbus.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">modbus-arduino
&#160;<span id="projectnumber">1.0.0</span>
</div>
<div id="projectbrief">Modbus library for Arduino</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('classModbusSerial.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="classModbusSerial-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">ModbusSerial Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p><a class="el" href="classModbus.html" title="Modbus base class. ">Modbus</a> over serial line Class.
<a href="classModbusSerial.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="ModbusSerial_8h_source.html">ModbusSerial.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for ModbusSerial:</div>
<div class="dyncontent">
<div class="center"><img src="classModbusSerial__inherit__graph.png" border="0" usemap="#ModbusSerial_inherit__map" alt="Inheritance graph"/></div>
<map name="ModbusSerial_inherit__map" id="ModbusSerial_inherit__map">
<area shape="rect" id="node2" href="classModbus.html" title="Modbus base class. " alt="" coords="21,5,111,259"/>
</map>
</div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:aefa9a7f9a910a311bfcd5110a6a8ab71"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModbusSerial.html#aefa9a7f9a910a311bfcd5110a6a8ab71">config</a> (HardwareSerial *port, long baud, byte parity=MB_PARITY_EVEN, int txenPin=-1)</td></tr>
<tr class="memdesc:aefa9a7f9a910a311bfcd5110a6a8ab71"><td class="mdescLeft">&#160;</td><td class="mdescRight">Connect an <a class="el" href="classModbusSerial.html" title="Modbus over serial line Class. ">ModbusSerial</a> object to a hardware serial port. <a href="#aefa9a7f9a910a311bfcd5110a6a8ab71">More...</a><br /></td></tr>
<tr class="separator:aefa9a7f9a910a311bfcd5110a6a8ab71"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abbe69850e5deb5c35c6a2075a372350c"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModbusSerial.html#abbe69850e5deb5c35c6a2075a372350c">config</a> (SoftwareSerial *port, long baud, int txenPin=-1)</td></tr>
<tr class="memdesc:abbe69850e5deb5c35c6a2075a372350c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Connect an <a class="el" href="classModbusSerial.html" title="Modbus over serial line Class. ">ModbusSerial</a> object to a software serial port. <a href="#abbe69850e5deb5c35c6a2075a372350c">More...</a><br /></td></tr>
<tr class="separator:abbe69850e5deb5c35c6a2075a372350c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a82286ed2d9415c624d9b557fe871d8a0"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModbusSerial.html#a82286ed2d9415c624d9b557fe871d8a0">config</a> (Serial_ *port, long baud, byte parity=MB_PARITY_EVEN, int txenPin=-1)</td></tr>
<tr class="memdesc:a82286ed2d9415c624d9b557fe871d8a0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Connect an <a class="el" href="classModbusSerial.html" title="Modbus over serial line Class. ">ModbusSerial</a> object to a hardware serial port Variant in the case of an ATMEGA32U4 (Leonardo). <a href="#a82286ed2d9415c624d9b557fe871d8a0">More...</a><br /></td></tr>
<tr class="separator:a82286ed2d9415c624d9b557fe871d8a0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adefaff8d3e8f4cfc1d90c9b52d880262"><td class="memItemLeft" align="right" valign="top">byte&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModbusSerial.html#adefaff8d3e8f4cfc1d90c9b52d880262">getSlaveId</a> ()</td></tr>
<tr class="memdesc:adefaff8d3e8f4cfc1d90c9b52d880262"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return slave identifier. <a href="#adefaff8d3e8f4cfc1d90c9b52d880262">More...</a><br /></td></tr>
<tr class="separator:adefaff8d3e8f4cfc1d90c9b52d880262"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:add48c6a2b436e600865e0cf63ed0aafc"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModbusSerial.html#add48c6a2b436e600865e0cf63ed0aafc">ModbusSerial</a> ()</td></tr>
<tr class="memdesc:add48c6a2b436e600865e0cf63ed0aafc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default constructor. <a href="#add48c6a2b436e600865e0cf63ed0aafc">More...</a><br /></td></tr>
<tr class="separator:add48c6a2b436e600865e0cf63ed0aafc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2b727d4d516177e698db6e49729624d8"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModbusSerial.html#a2b727d4d516177e698db6e49729624d8">setSlaveId</a> (byte slaveId)</td></tr>
<tr class="memdesc:a2b727d4d516177e698db6e49729624d8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Change the value of slave identifier. <a href="#a2b727d4d516177e698db6e49729624d8">More...</a><br /></td></tr>
<tr class="separator:a2b727d4d516177e698db6e49729624d8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad47e2b6a70d42a106a1a55a515e2f33a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModbusSerial.html#ad47e2b6a70d42a106a1a55a515e2f33a">task</a> ()</td></tr>
<tr class="memdesc:ad47e2b6a70d42a106a1a55a515e2f33a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Task that performs all operations on MODBUS. <a href="#ad47e2b6a70d42a106a1a55a515e2f33a">More...</a><br /></td></tr>
<tr class="separator:ad47e2b6a70d42a106a1a55a515e2f33a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classModbus"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classModbus')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classModbus.html">Modbus</a></td></tr>
<tr class="memitem:af10a81e46f971daa4ce429d39776378b inherit pub_methods_classModbus"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModbus.html#af10a81e46f971daa4ce429d39776378b">addCoil</a> (word offset, bool value=false)</td></tr>
<tr class="memdesc:af10a81e46f971daa4ce429d39776378b inherit pub_methods_classModbus"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add a coil. <a href="#af10a81e46f971daa4ce429d39776378b">More...</a><br /></td></tr>
<tr class="separator:af10a81e46f971daa4ce429d39776378b inherit pub_methods_classModbus"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a73797fbd9af758aedc198ccd8f4585fb inherit pub_methods_classModbus"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModbus.html#a73797fbd9af758aedc198ccd8f4585fb">addHreg</a> (word offset, word value=0)</td></tr>
<tr class="memdesc:a73797fbd9af758aedc198ccd8f4585fb inherit pub_methods_classModbus"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add a holding register to the list. <a href="#a73797fbd9af758aedc198ccd8f4585fb">More...</a><br /></td></tr>
<tr class="separator:a73797fbd9af758aedc198ccd8f4585fb inherit pub_methods_classModbus"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab052ca5452b76bdb85235e898623cedc inherit pub_methods_classModbus"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModbus.html#ab052ca5452b76bdb85235e898623cedc">addIreg</a> (word offset, word value=0)</td></tr>
<tr class="memdesc:ab052ca5452b76bdb85235e898623cedc inherit pub_methods_classModbus"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add a input register. <a href="#ab052ca5452b76bdb85235e898623cedc">More...</a><br /></td></tr>
<tr class="separator:ab052ca5452b76bdb85235e898623cedc inherit pub_methods_classModbus"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abead971752bc7b2a54cb508ad8a8a2c4 inherit pub_methods_classModbus"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModbus.html#abead971752bc7b2a54cb508ad8a8a2c4">addIsts</a> (word offset, bool value=false)</td></tr>
<tr class="memdesc:abead971752bc7b2a54cb508ad8a8a2c4 inherit pub_methods_classModbus"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add a discrete input. <a href="#abead971752bc7b2a54cb508ad8a8a2c4">More...</a><br /></td></tr>
<tr class="separator:abead971752bc7b2a54cb508ad8a8a2c4 inherit pub_methods_classModbus"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6b5ed2b967d4c43b578d21f562abc007 inherit pub_methods_classModbus"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModbus.html#a6b5ed2b967d4c43b578d21f562abc007">Coil</a> (word offset, bool value)</td></tr>
<tr class="memdesc:a6b5ed2b967d4c43b578d21f562abc007 inherit pub_methods_classModbus"><td class="mdescLeft">&#160;</td><td class="mdescRight">Change the value of a coil This value will be returned when bus read, the master can also modify it. <a href="#a6b5ed2b967d4c43b578d21f562abc007">More...</a><br /></td></tr>
<tr class="separator:a6b5ed2b967d4c43b578d21f562abc007 inherit pub_methods_classModbus"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a208bb15086e008f05f2fa72398551d04 inherit pub_methods_classModbus"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModbus.html#a208bb15086e008f05f2fa72398551d04">Coil</a> (word offset)</td></tr>
<tr class="memdesc:a208bb15086e008f05f2fa72398551d04 inherit pub_methods_classModbus"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the value of a coil. <a href="#a208bb15086e008f05f2fa72398551d04">More...</a><br /></td></tr>
<tr class="separator:a208bb15086e008f05f2fa72398551d04 inherit pub_methods_classModbus"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af13802f39b91279bd55538749bb76409 inherit pub_methods_classModbus"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModbus.html#af13802f39b91279bd55538749bb76409">Hreg</a> (word offset, word value)</td></tr>
<tr class="memdesc:af13802f39b91279bd55538749bb76409 inherit pub_methods_classModbus"><td class="mdescLeft">&#160;</td><td class="mdescRight">Change the value of a holding register This value will be returned when bus read, the master can also modify it. <a href="#af13802f39b91279bd55538749bb76409">More...</a><br /></td></tr>
<tr class="separator:af13802f39b91279bd55538749bb76409 inherit pub_methods_classModbus"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa6b32867beace3ce557ea61183497607 inherit pub_methods_classModbus"><td class="memItemLeft" align="right" valign="top">word&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModbus.html#aa6b32867beace3ce557ea61183497607">Hreg</a> (word offset)</td></tr>
<tr class="memdesc:aa6b32867beace3ce557ea61183497607 inherit pub_methods_classModbus"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the value of a holding register. <a href="#aa6b32867beace3ce557ea61183497607">More...</a><br /></td></tr>
<tr class="separator:aa6b32867beace3ce557ea61183497607 inherit pub_methods_classModbus"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac9be098d4bff9081105b6202922b1134 inherit pub_methods_classModbus"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModbus.html#ac9be098d4bff9081105b6202922b1134">Ireg</a> (word offset, word value)</td></tr>
<tr class="memdesc:ac9be098d4bff9081105b6202922b1134 inherit pub_methods_classModbus"><td class="mdescLeft">&#160;</td><td class="mdescRight">Change the value of an input register This value will be returned when bus read. <a href="#ac9be098d4bff9081105b6202922b1134">More...</a><br /></td></tr>
<tr class="separator:ac9be098d4bff9081105b6202922b1134 inherit pub_methods_classModbus"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abef420732eca033c08c131df73623521 inherit pub_methods_classModbus"><td class="memItemLeft" align="right" valign="top">word&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModbus.html#abef420732eca033c08c131df73623521">Ireg</a> (word offset)</td></tr>
<tr class="memdesc:abef420732eca033c08c131df73623521 inherit pub_methods_classModbus"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the value of an input register. <a href="#abef420732eca033c08c131df73623521">More...</a><br /></td></tr>
<tr class="separator:abef420732eca033c08c131df73623521 inherit pub_methods_classModbus"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a493b0fc75ea3ba076f7c9a25e491bcbe inherit pub_methods_classModbus"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModbus.html#a493b0fc75ea3ba076f7c9a25e491bcbe">Ists</a> (word offset, bool value)</td></tr>
<tr class="memdesc:a493b0fc75ea3ba076f7c9a25e491bcbe inherit pub_methods_classModbus"><td class="mdescLeft">&#160;</td><td class="mdescRight">Change the value of a discrete input This value will be returned when bus read,. <a href="#a493b0fc75ea3ba076f7c9a25e491bcbe">More...</a><br /></td></tr>
<tr class="separator:a493b0fc75ea3ba076f7c9a25e491bcbe inherit pub_methods_classModbus"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a833a76980e46be4995d2ca4ce5d2e51b inherit pub_methods_classModbus"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModbus.html#a833a76980e46be4995d2ca4ce5d2e51b">Ists</a> (word offset)</td></tr>
<tr class="memdesc:a833a76980e46be4995d2ca4ce5d2e51b inherit pub_methods_classModbus"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the value of a discrete input. <a href="#a833a76980e46be4995d2ca4ce5d2e51b">More...</a><br /></td></tr>
<tr class="separator:a833a76980e46be4995d2ca4ce5d2e51b inherit pub_methods_classModbus"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a101809cdd4734537bab58dc315a840b4 inherit pub_methods_classModbus"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModbus.html#a101809cdd4734537bab58dc315a840b4">Modbus</a> ()</td></tr>
<tr class="memdesc:a101809cdd4734537bab58dc315a840b4 inherit pub_methods_classModbus"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default constructor. <a href="#a101809cdd4734537bab58dc315a840b4">More...</a><br /></td></tr>
<tr class="separator:a101809cdd4734537bab58dc315a840b4 inherit pub_methods_classModbus"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:a3fb991a7b8d0d9766889e2cad7fca115"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModbusSerial.html#a3fb991a7b8d0d9766889e2cad7fca115">receive</a> (byte *frame)</td></tr>
<tr class="separator:a3fb991a7b8d0d9766889e2cad7fca115"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae7b2f3574d102b26a1de084cb345b6cc"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModbusSerial.html#ae7b2f3574d102b26a1de084cb345b6cc">send</a> (byte *frame)</td></tr>
<tr class="separator:ae7b2f3574d102b26a1de084cb345b6cc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a69850777f84662664dd17e137250e3b0"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classModbusSerial.html#a69850777f84662664dd17e137250e3b0">sendPDU</a> (byte *pduframe)</td></tr>
<tr class="separator:a69850777f84662664dd17e137250e3b0"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p><a class="el" href="classModbus.html" title="Modbus base class. ">Modbus</a> over serial line Class. </p>
<p>Definition at line <a class="el" href="ModbusSerial_8h_source.html#l00054">54</a> of file <a class="el" href="ModbusSerial_8h_source.html">ModbusSerial.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="add48c6a2b436e600865e0cf63ed0aafc"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">ModbusSerial::ModbusSerial </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Default constructor. </p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="aefa9a7f9a910a311bfcd5110a6a8ab71"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool ModbusSerial::config </td>
<td>(</td>
<td class="paramtype">HardwareSerial *&#160;</td>
<td class="paramname"><em>port</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">long&#160;</td>
<td class="paramname"><em>baud</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">byte&#160;</td>
<td class="paramname"><em>parity</em> = <code>MB_PARITY_EVEN</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>txenPin</em> = <code>-1</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Connect an <a class="el" href="classModbusSerial.html" title="Modbus over serial line Class. ">ModbusSerial</a> object to a hardware serial port. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">port</td><td>pointer on serial port to use, &amp;Serial most of the time, or &amp;Serial1, &amp;Serial2 ... if available </td></tr>
<tr><td class="paramname">baud</td><td>baudrate </td></tr>
<tr><td class="paramname">parity</td><td>parity </td></tr>
<tr><td class="paramname">txenPin</td><td>if an RS485 circuit is used, this corresponds to the pin number connected to the transmit enable (DE) and receive disable (/RE) pin. -1 if not used. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true, false if error occured </dd></dl>
</div>
</div>
<a class="anchor" id="abbe69850e5deb5c35c6a2075a372350c"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool ModbusSerial::config </td>
<td>(</td>
<td class="paramtype">SoftwareSerial *&#160;</td>
<td class="paramname"><em>port</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">long&#160;</td>
<td class="paramname"><em>baud</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>txenPin</em> = <code>-1</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Connect an <a class="el" href="classModbusSerial.html" title="Modbus over serial line Class. ">ModbusSerial</a> object to a software serial port. </p>
<dl class="section warning"><dt>Warning</dt><dd>The SoftwareSerial use 8N1 format, this does not respect the MODBUS RTU specifications (2 stop bits if no parity)... </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">port</td><td>pointer on serial port to use </td></tr>
<tr><td class="paramname">baud</td><td>baudrate </td></tr>
<tr><td class="paramname">txenPin</td><td>if an RS485 circuit is used, this corresponds to the pin number connected to the transmit enable (DE) and receive disable (/RE) pin. -1 if not used. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true, false if error occured </dd></dl>
</div>
</div>
<a class="anchor" id="a82286ed2d9415c624d9b557fe871d8a0"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool ModbusSerial::config </td>
<td>(</td>
<td class="paramtype">Serial_ *&#160;</td>
<td class="paramname"><em>port</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">long&#160;</td>
<td class="paramname"><em>baud</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">byte&#160;</td>
<td class="paramname"><em>parity</em> = <code>MB_PARITY_EVEN</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>txenPin</em> = <code>-1</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Connect an <a class="el" href="classModbusSerial.html" title="Modbus over serial line Class. ">ModbusSerial</a> object to a hardware serial port Variant in the case of an ATMEGA32U4 (Leonardo). </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">port</td><td>pointer on serial port to use, &amp;Serial most of the time, or &amp;Serial1, &amp;Serial2 ... if available </td></tr>
<tr><td class="paramname">baud</td><td>baudrate </td></tr>
<tr><td class="paramname">parity</td><td>parity </td></tr>
<tr><td class="paramname">txenPin</td><td>if an RS485 circuit is used, this corresponds to the pin number connected to the transmit enable (DE) and receive disable (/RE) pin. -1 if not used. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true, false if error occured </dd></dl>
</div>
</div>
<a class="anchor" id="adefaff8d3e8f4cfc1d90c9b52d880262"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">byte ModbusSerial::getSlaveId </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Return slave identifier. </p>
</div>
</div>
<a class="anchor" id="a3fb991a7b8d0d9766889e2cad7fca115"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool ModbusSerial::receive </td>
<td>(</td>
<td class="paramtype">byte *&#160;</td>
<td class="paramname"><em>frame</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="ae7b2f3574d102b26a1de084cb345b6cc"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool ModbusSerial::send </td>
<td>(</td>
<td class="paramtype">byte *&#160;</td>
<td class="paramname"><em>frame</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="a69850777f84662664dd17e137250e3b0"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool ModbusSerial::sendPDU </td>
<td>(</td>
<td class="paramtype">byte *&#160;</td>
<td class="paramname"><em>pduframe</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="a2b727d4d516177e698db6e49729624d8"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool ModbusSerial::setSlaveId </td>
<td>(</td>
<td class="paramtype">byte&#160;</td>
<td class="paramname"><em>slaveId</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Change the value of slave identifier. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">slaveId</td><td>identifier 1-247 </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true, false if error occured </dd></dl>
</div>
</div>
<a class="anchor" id="ad47e2b6a70d42a106a1a55a515e2f33a"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void ModbusSerial::task </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Task that performs all operations on MODBUS. </p>
<p>Call once inside loop(), all magic here ! </p>
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="classModbusSerial.html">ModbusSerial</a></li>
<li class="footer">Generated on Fri Jan 19 2018 01:17:49 for modbus-arduino by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
</ul>
</div>
</body>
</html>