-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmd_tutorial_2LSS.html
More file actions
156 lines (153 loc) · 8.28 KB
/
md_tutorial_2LSS.html
File metadata and controls
156 lines (153 loc) · 8.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
<!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" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>CANopenDemo: CANopen LSS Example</title>
<link rel="icon" href="CANopenNode.png" type="image/x-icon" />
<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>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.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>
<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 id="projectrow">
<td id="projectlogo"><img alt="Logo" src="CANopenNode.png"/></td>
<td id="projectalign">
<div id="projectname">CANopenDemo
</div>
<div id="projectbrief">CANopenNode demo, tutorial and testing</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',false);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<!-- 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">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
</div><!-- top -->
<div id="doc-content">
<div><div class="header">
<div class="headertitle"><div class="title">CANopen LSS Example</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>LSS (Layer settings service) is an extension to CANopen described in CiA DSP 305. The interface is described in CiA DS 309 3.0.0 (ASCII mapping). LSS allows the user to change node ID and bitrate, as well as setting the node ID on an unconfigured node.</p>
<p>LSS uses the the OD Identity register (0x1018) as an unique value to select a node. Therefore the LSS address always consists of four 32 bit values. This also means that LSS relies on this register to actually be unique. (<em>vendorID</em>, <em>productCode</em>, <em>revisionNumber</em> and <em>serialNumber</em> must be configured and unique on each device.)</p>
<p>This example runs with CANopen devices as specified in <a class="elRef" href="CANopenNode/index.html#md_README">tutorial/README.md</a>. demoDevice will be configured, its identity object is {0x0, 0x1, 0x2, 0x3}.</p>
<h1><a class="anchor" id="autotoc_md79"></a>
Typical usage of LSS</h1>
<p>Change the node-ID for a known slave, store the new node ID to eeprom, apply new node ID. The node currently has the node-ID = 4: </p><pre class="fragment">cocomm "help lss"
cocomm "lss_switch_sel 0x00000000 0x00000001 0x00000002 0x00000003"
cocomm "lss_get_node"
cocomm "lss_set_node 10"
cocomm "lss_store"
cocomm "lss_switch_glob 0"
cocomm "4 reset comm"
</pre><p> Note that the node ID change is not done until reset communication/node.</p>
<p>Set demoDevice to unconfigured Node_ID and restart it: </p><pre class="fragment">cocomm "lss_switch_sel 0x00000000 0x00000001 0x00000002 0x00000003"
cocomm "lss_set_node 0xFF"
cocomm "lss_store"
cocomm "lss_switch_glob 0"
cocomm "10 reset node"
# re-run Linux demoDevice
</pre><p> Now demoDevice is in unconfigured Node-ID state and CANopen services except LSS does not work. CANopen LED flicker. Configure it back to Node-ID = 4. Device enters NMT operational immediately: </p><pre class="fragment">cocomm "lss_switch_sel 0x00000000 0x00000001 0x00000002 0x00000003"
cocomm "lss_set_node 4"
cocomm "lss_store"
cocomm "lss_switch_glob 0"
</pre><h1><a class="anchor" id="autotoc_md80"></a>
LSS fastscan</h1>
<p>LSS fastscan searches for an unconfigured node. For this example to work, set demoDevice to unconfigured Node_ID as described above.</p>
<p>Search unconfigured node via LSS fastscan: </p><pre class="fragment">cocomm "_lss_fastscan"
</pre><p> After a while, match is found: </p><pre class="fragment">[1] 0x00000001 0x00000002 0x00000003 0x00000006
</pre><p> Set new node-ID, store it to the eeprom, apply the new node-ID: </p><pre class="fragment">cocomm "lss_set_node 4"
cocomm "lss_store"
cocomm "lss_switch_glob 0"
</pre><p> To increase scanning speed, you can use: </p><pre class="fragment">cocomm "_lss_fastscan 25"
</pre><p> Where 25 is the scan step delay in ms. Be aware that the scan will become unreliable when the delay is set too low.</p>
<h1><a class="anchor" id="autotoc_md81"></a>
Auto enumerate all nodes</h1>
<p>Auto enumerate all unconfigured nodes via LSS fastscan. Enumeration automatically begins at node ID 2 and node ID is automatically stored to the eeprom. Like with _lss_fastscan, an optional parameter can be used to change the default delay time. For this example to work, set demoDevice to unconfigured Node_ID as described above. </p><pre class="fragment">cocomm "lss_allnodes"
</pre><p> After a while, one or more matches are found: </p><pre class="fragment"># Node-ID 2 assigned to: 0x00000000 0x00000001 0x00000002 0x00000003
# Found 1 nodes, search finished.
[1] OK
</pre><p> To get further control over the fastscan process, the lss_allnodes command supports an extended parameter set. </p><pre class="fragment">cocomm "lss_allnodes 25 7 0 2 0x428 1 0 1 0 0 0"
</pre><p> The parameters are as following:</p><ul>
<li>25: scan step delay time in ms</li>
<li>7: enumeration start</li>
<li>0: store node IDs to eeprom; 0 = no, 1 = yes</li>
<li>2: vendor ID scan selector; 0 = fastscan, 2 = match value in next parameter</li>
<li>0x428: vendor ID to match</li>
<li>1: product code scan selector; 0 = fastscan, 1 = ignore, 2 = match value in next parameter</li>
<li>0: product code to match (ignored in this example)</li>
<li>1: software version scan selector; 0 = fastscan, 1 = ignore, 2 = match value in next parameter</li>
<li>0: software version to match (ignored in this example)</li>
<li>0: serial number scan selector; 0 = fastscan, 1 = ignore, 2 = match value in next parameter</li>
<li>0: serial number to match (not used in this example)</li>
</ul>
<p>Note that only unconfigured nodes (those without a valid node ID) will take part in fastscan! </p>
</div></div><!-- contents -->
</div><!-- PageDoc -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0
</small></address>
</div><!-- doc-content -->
</body>
</html>