📄 structcannetworkconfig.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>Copley Motion Library: CanNetworkConfig Struct Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.4.4 --><div class="qindex"><a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a></div><h1>CanNetworkConfig Struct Reference</h1><!-- doxytag: class="CanNetworkConfig" --><a href="structCanNetworkConfig-members.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>CANopen <a class="el" href="classNode.html">Node</a> ID and bit rate configuration. <p>The amplifier's CANopen node ID and network bit rate can be configured using the members of this structure. Note that the ID and bit rate are only set on power-up or reset, so after programming a new configuration the amplifier must be reset for the configuration to become active.<p>The CANopen node ID is a 7 bit number in the range 1 to 128. The value 0 is reserved and is not considered a valid node ID. Selecting a node ID of 0 will cause the amplifier to stop communicating over the CANopen network.<p>The node ID is calculated using a combination of any of the following:<ul><li>The CAN address switch on amplifiers which support this feature</li><li>0 to 7 general purpose input pins.</li><li>A programmable offset in the range 0 to 128.</li></ul><p>On startup, the input pins are read first. The inputs that will be used for CAN address selection are the highest numbered pins available. For example, on an amplifier with 12 input pins (0 to 11), if 3 inputs are used for CANopen node ID selection, then the pins used will be 9, 10 and 11. These three pins will result in a base node address between 0 and 7.<p>If the CAN address switch is being used, then the value read from the input pins will be shifted up four bits (multiplied by 16) and the value of the input switch will be added to it.<p>Finally, the programmed offset will be added to the value read from the input pins and address switch. The lowest 7 bits of this sum will be used as the CANopen node ID. If this value results in an ID of zero, the CANopen interface will be disabled.<p>For example, to program an amplifier to ignore input pins and the address switch, and just set a fixed ID of 7, set the number of input pins to zero, turn off the address switch, and set the offset to 7.<p><p>Definition at line <a class="el" href="CML__AmpStruct_8h-source.html#l00933">933</a> of file <a class="el" href="CML__AmpStruct_8h-source.html">CML_AmpStruct.h</a>.<table border="0" cellpadding="0" cellspacing="0"><tr><td></td></tr><tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a0"></a><!-- doxytag: member="CanNetworkConfig::CanNetworkConfig" ref="a0" args="()" --> </td><td class="memItemRight" valign="bottom"><a class="el" href="structCanNetworkConfig.html#a0">CanNetworkConfig</a> ()</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Default constructor. Simply sets all members to zero. <br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="structCanNetworkConfig.html#a1">FromAmpFormat</a> (<a class="el" href="CML__Utils_8h.html#a8">uint16</a> a)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Load the structure from a 16-bit word. <a href="#a1"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="CML__Utils_8h.html#a8">uint16</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="structCanNetworkConfig.html#a2">ToAmpFormat</a> (void)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Encode the contents of the structure into a 16-bit word in the format used by the amplifier. <a href="#a2"></a><br></td></tr><tr><td colspan="2"><br><h2>Public Attributes</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="CML__Utils_8h.html#a6">uint8</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="structCanNetworkConfig.html#o0">numInPins</a></td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Number of general purpose input pins to read on startup for node ID selection. <a href="#o0"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="structCanNetworkConfig.html#o1">useSwitch</a></td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">If true, use the CAN address switch as part of the node ID calculation. <a href="#o1"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="o2"></a><!-- doxytag: member="CanNetworkConfig::offset" ref="o2" args="" --><a class="el" href="CML__Utils_8h.html#a6">uint8</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="structCanNetworkConfig.html#o2">offset</a></td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Offset added to the value read from the input pins & address switch. <br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="o3"></a><!-- doxytag: member="CanNetworkConfig::bitRate" ref="o3" args="" --><a class="el" href="CML__AmpStruct_8h.html#a10">CAN_BIT_RATE</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="structCanNetworkConfig.html#o3">bitRate</a></td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">CANopen network bit rate to use. <br></td></tr></table><hr><h2>Member Function Documentation</h2><a class="anchor" name="a1"></a><!-- doxytag: member="CanNetworkConfig::FromAmpFormat" ref="a1" args="(uint16 a)" --><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">void FromAmpFormat </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="CML__Utils_8h.html#a8">uint16</a> </td> <td class="mdname1" valign="top" nowrap> <em>a</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Load the structure from a 16-bit word. <p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>a</em> </td><td>A 16-bit value encoding the network configuration. See the amplifier documentation for details on the format. </td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>A pointer to an error object, or NULL on success</dd></dl><p>Definition at line <a class="el" href="AmpStruct_8cpp-source.html#l01032">1032</a> of file <a class="el" href="AmpStruct_8cpp-source.html">AmpStruct.cpp</a>. </td> </tr></table><a class="anchor" name="a2"></a><!-- doxytag: member="CanNetworkConfig::ToAmpFormat" ref="a2" args="(void)" --><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"><a class="el" href="CML__Utils_8h.html#a8">uint16</a> ToAmpFormat </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">void </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Encode the contents of the structure into a 16-bit word in the format used by the amplifier. <p>See the amplifier documentation for details on this format. <dl compact><dt><b>Returns:</b></dt><dd>A 16-bit word representing the contents of this structure.</dd></dl><p>Definition at line <a class="el" href="AmpStruct_8cpp-source.html#l01047">1047</a> of file <a class="el" href="AmpStruct_8cpp-source.html">AmpStruct.cpp</a>. </td> </tr></table><hr><h2>Member Data Documentation</h2><a class="anchor" name="o0"></a><!-- doxytag: member="CanNetworkConfig::numInPins" ref="o0" args="" --><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"><a class="el" href="CML__Utils_8h.html#a6">uint8</a> <a class="el" href="structCanNetworkConfig.html#o0">numInPins</a> </td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Number of general purpose input pins to read on startup for node ID selection. <p>This parameter may be set from 0 to 7. <p>Definition at line <a class="el" href="CML__AmpStruct_8h-source.html#l00937">937</a> of file <a class="el" href="CML__AmpStruct_8h-source.html">CML_AmpStruct.h</a>. </td> </tr></table><a class="anchor" name="o1"></a><!-- doxytag: member="CanNetworkConfig::useSwitch" ref="o1" args="" --><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">bool <a class="el" href="structCanNetworkConfig.html#o1">useSwitch</a> </td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>If true, use the CAN address switch as part of the node ID calculation. <p>Note that on amplifiers which do not support this switch this parameter is ignored. <p>Definition at line <a class="el" href="CML__AmpStruct_8h-source.html#l00942">942</a> of file <a class="el" href="CML__AmpStruct_8h-source.html">CML_AmpStruct.h</a>. </td> </tr></table><hr>The documentation for this struct was generated from the following files:<ul><li><a class="el" href="CML__AmpStruct_8h-source.html">CML_AmpStruct.h</a><li><a class="el" href="AmpStruct_8cpp-source.html">AmpStruct.cpp</a></ul><hr><address style="align: right;"><small>Copley Motion Library, Copyright (c) 2002-2003<a href="http://www.copleycontrols.com"><img src="CCC_logo.gif" alt="Copley Controls Corp." align="middle" border=0 ></a></small></address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -