AMR_T800/Devices/Libraries/Systems/CANopenSocket/docs/md_doc_traceUsage.html

129 lines
6.6 KiB
HTML
Executable File

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>CANopenNode: Trace usage</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>
<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">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function() { init_search(); });
/* @license-end */
</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="projectalign" style="padding-left: 0.5em;">
<div id="projectname">CANopenNode
</div>
</td>
<td> <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>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
</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">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('md_doc_traceUsage.html',''); initResizable(); });
/* @license-end */
</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="PageDoc"><div class="header">
<div class="headertitle">
<div class="title">Trace usage </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>CANopenNode includes optional trace functionality (non-standard). It monitors choosen variables from Object Dictionary. On change of state of variable it makes a record with timestamp into circular buffer. String with points can later be read via SDO.</p>
<p>Trace is disabled by default. It can be enabled using Object Dictionary editor. Include also <em><a class="el" href="CO__trace_8h.html" title="CANopen trace object for recording variables over time.">CO_trace.h</a>/.c</em> into project, compile and run.</p>
<p>Here is en example of monitoring variable, connected with buttons (OD_readInput8Bit, index 0x6000, subindex 0x01). It was tested on PIC32:</p>
<div class="fragment"><div class="line"># Enable trace first:</div>
<div class="line">./canopencomm 0x30 w 0x2400 0 u8 1</div>
<div class="line"> </div>
<div class="line"># Press and hold the button on Explorer16 and execute SDO read command:</div>
<div class="line">./canopencomm 0x30 r 0x6000 1 u8</div>
<div class="line">[1] 0x08</div>
<div class="line"># It displays same value, as was transmitted via PDO and visible on candump.</div>
<div class="line"> </div>
<div class="line"># Now get the complete history for that buttons with timestamp for each change</div>
<div class="line"># and store it as a text to the file:</div>
<div class="line">./canopencomm 0x30 r 0x2401 5 vs &gt; plot1.csv</div>
<div class="line">cat plot1.csv</div>
</div><!-- fragment --><p>If large data blocks are transmitted via CAN bus, then more efficient SDO block transfer can be enabled with command <code>./canopencomm set sdo_block 1</code></p>
<p>For more info on using trace functionality see CANopenNode/example/IO.html file. There is also a description of all Object Dictionary variables.</p>
<p>Trace functionality can also be configured on CANopenSocket directly. In that case CANopenSocket must first receive PDO data from remote node(s) and store it to the local Object Dictionary variable. CANopenSocket's trace then monitors that variable. Text buffer is then read with the similar command as above. But local SDO data access from CANopenSocket itself doesn't occupy CAN bus, so large data is transfered realy fast. Besides that, Linux machine has much more RAM to store the monitored data. Except timestamp is less accurate. </p>
</div></div><!-- contents -->
</div><!-- PageDoc -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">Generated on Thu Dec 24 2020 14:30:50 for CANopenNode by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.17 </li>
</ul>
</div>
</body>
</html>