📄 cml__io_8h-source.html
字号:
<a name="l00277"></a><a class="code" href="structIOModuleSettings.html#o4">00277</a> <span class="comment"></span> <span class="keywordtype">bool</span> <a class="code" href="structIOModuleSettings.html#o4">useStandardDinPDO</a>;<a name="l00278"></a>00278 <span class="comment"></span><a name="l00279"></a>00279 <span class="comment"> /// Use the standard digital output PDO object. If true (default) then</span><a name="l00280"></a>00280 <span class="comment"> /// a standard PDO object will be configured to transmit updated settings</span><a name="l00281"></a>00281 <span class="comment"> /// for the first 64 digital output pins when any of them are changed.</span><a name="l00282"></a>00282 <span class="comment"> /// If false, no such PDO will be configured.</span><a name="l00283"></a><a class="code" href="structIOModuleSettings.html#o5">00283</a> <span class="comment"></span> <span class="keywordtype">bool</span> <a class="code" href="structIOModuleSettings.html#o5">useStandardDoutPDO</a>;<a name="l00284"></a>00284 <span class="comment"></span><a name="l00285"></a>00285 <span class="comment"> /// Use the standard analog input PDO objects. If true (default) then </span><a name="l00286"></a>00286 <span class="comment"> /// up to three standard PDO objects will be configured to read the </span><a name="l00287"></a>00287 <span class="comment"> /// first 12 16-bit analog input pins when they generate events.</span><a name="l00288"></a>00288 <span class="comment"> /// If false, then these PDOs will not be configured.</span><a name="l00289"></a><a class="code" href="structIOModuleSettings.html#o6">00289</a> <span class="comment"></span> <span class="keywordtype">bool</span> <a class="code" href="structIOModuleSettings.html#o6">useStandardAinPDO</a>;<a name="l00290"></a>00290 <span class="comment"></span><a name="l00291"></a>00291 <span class="comment"> /// Use the standard analog output PDO objects. If true (default) then </span><a name="l00292"></a>00292 <span class="comment"> /// up to three standard PDO objects will be configured to transmit the</span><a name="l00293"></a>00293 <span class="comment"> /// analog output data for up to 12 16-bit analog outputs.</span><a name="l00294"></a>00294 <span class="comment"> /// If false, then these PDOs will not be configured.</span><a name="l00295"></a><a class="code" href="structIOModuleSettings.html#o7">00295</a> <span class="comment"></span> <span class="keywordtype">bool</span> <a class="code" href="structIOModuleSettings.html#o7">useStandardAoutPDO</a>;<a name="l00296"></a>00296 <a name="l00297"></a><a class="code" href="structIOModuleSettings.html#a0">00297</a> <a class="code" href="structIOModuleSettings.html#a0">IOModuleSettings</a>( <span class="keywordtype">void</span> )<a name="l00298"></a>00298 {<a name="l00299"></a>00299 <a class="code" href="structIOModuleSettings.html#o0">heartbeatPeriod</a> = 0;<a name="l00300"></a>00300 <a class="code" href="structIOModuleSettings.html#o1">heartbeatTimeout</a> = 100;<a name="l00301"></a>00301 <a class="code" href="structIOModuleSettings.html#o2">guardTime</a> = 0;<a name="l00302"></a>00302 <a class="code" href="structIOModuleSettings.html#o3">lifeFactor</a> = 3;<a name="l00303"></a>00303 <a class="code" href="structIOModuleSettings.html#o4">useStandardDinPDO</a> = <span class="keyword">true</span>;<a name="l00304"></a>00304 <a class="code" href="structIOModuleSettings.html#o5">useStandardDoutPDO</a> = <span class="keyword">true</span>;<a name="l00305"></a>00305 <a class="code" href="structIOModuleSettings.html#o6">useStandardAinPDO</a> = <span class="keyword">true</span>;<a name="l00306"></a>00306 <a class="code" href="structIOModuleSettings.html#o7">useStandardAoutPDO</a> = <span class="keyword">true</span>;<a name="l00307"></a>00307 }<a name="l00308"></a>00308 };<a name="l00309"></a>00309 <a name="l00310"></a>00310 <span class="comment">/***************************************************************************/</span><span class="comment"></span><a name="l00311"></a>00311 <span class="comment">/**</span><a name="l00312"></a>00312 <span class="comment"> Standard CANopen I/O module. This class represents and I/O module device</span><a name="l00313"></a>00313 <span class="comment"> conforming to the DS401 CANopen specification. The class may be extended</span><a name="l00314"></a>00314 <span class="comment"> to provide additional manufacturer specific features.</span><a name="l00315"></a>00315 <span class="comment"></span><a name="l00316"></a>00316 <span class="comment"> Note that the CANopen standard defines a very large number of parameters that</span><a name="l00317"></a>00317 <span class="comment"> may be used with a standard I/O module. Of these, only a small subset are </span><a name="l00318"></a>00318 <span class="comment"> requred by the spec. In practice, it seems that most of the major manufacturers</span><a name="l00319"></a>00319 <span class="comment"> of CANopen I/O modules only implement the minimum required by the spec. The </span><a name="l00320"></a>00320 <span class="comment"> result is that many of the optional functions have not been tested with real </span><a name="l00321"></a>00321 <span class="comment"> hardware due to the lack of availability. Please contact Copley Controls if</span><a name="l00322"></a>00322 <span class="comment"> you believe that you have found a problem with any of these functions.</span><a name="l00323"></a>00323 <span class="comment"></span><a name="l00324"></a>00324 <span class="comment"> For the typical I/O module, you can expect the following functionality to be</span><a name="l00325"></a>00325 <span class="comment"> supported based on the type of I/O the module supports:</span><a name="l00326"></a>00326 <span class="comment"></span><a name="l00327"></a>00327 <span class="comment"> Digital Inputs: Reading the inputs via PDO or SDO in groups of 8 should be </span><a name="l00328"></a>00328 <span class="comment"> supported. Other features are optional.</span><a name="l00329"></a>00329 <span class="comment"></span><a name="l00330"></a>00330 <span class="comment"> Digital Outputs: Writing to the outputs via PDO or SDO in groups of 8 should</span><a name="l00331"></a>00331 <span class="comment"> be supported. Other features are optional.</span><a name="l00332"></a>00332 <span class="comment"></span><a name="l00333"></a>00333 <span class="comment"> Analog Inputs: Reading 16-bit analog inputs via PDO or SDO is normally supported. </span><a name="l00334"></a>00334 <span class="comment"> Other input sizes and features are optional.</span><a name="l00335"></a>00335 <span class="comment"></span><a name="l00336"></a>00336 <span class="comment"> Analog Outputs: Writing 16-bit analog outputs via PDO or SDO is normally supported. </span><a name="l00337"></a>00337 <span class="comment"> Other output sizes and features are optional.</span><a name="l00338"></a>00338 <span class="comment"> */</span><a name="l00339"></a>00339 <span class="comment">/***************************************************************************/</span><a name="l00340"></a><a class="code" href="classIOModule.html">00340</a> <span class="keyword">class </span><a class="code" href="classIOModule.html">IOModule</a>: <span class="keyword">public</span> <a class="code" href="classNode.html">Node</a><a name="l00341"></a>00341 {<a name="l00342"></a>00342 <span class="keyword">public</span>:<a name="l00343"></a>00343 <a class="code" href="classIOModule.html#a0">IOModule</a>( <span class="keywordtype">void</span> );<a name="l00344"></a>00344 <a class="code" href="classIOModule.html#a0">IOModule</a>( <a class="code" href="classCanOpen.html">CanOpen</a> &<a class="code" href="classReceiver.html#p0">co</a>, <a class="code" href="CML__Utils_8h.html#a7">int16</a> nodeID );<a name="l00345"></a>00345 <a class="code" href="classIOModule.html#a0">IOModule</a>( <a class="code" href="classCanOpen.html">CanOpen</a> &co, <a class="code" href="CML__Utils_8h.html#a7">int16</a> nodeID, <a class="code" href="structIOModuleSettings.html">IOModuleSettings</a> &settings );<a name="l00346"></a>00346 <span class="keyword">virtual</span> <a class="code" href="classIOModule.html#a3">~IOModule</a>();<a name="l00347"></a>00347 <a name="l00348"></a>00348 <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classError.html">Error</a> *<a class="code" href="classIOModule.html#a4">Init</a>( <a class="code" href="classCanOpen.html">CanOpen</a> &co, <a class="code" href="CML__Utils_8h.html#a7">int16</a> nodeID );<a name="l00349"></a>00349 <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classError.html">Error</a> *<a class="code" href="classIOModule.html#a4">Init</a>( <a class="code" href="classCanOpen.html">CanOpen</a> &co, <a class="code" href="CML__Utils_8h.html#a7">int16</a> nodeID, <a class="code" href="structIOModuleSettings.html">IOModuleSettings</a> &settings );<a name="l00350"></a>00350 <a name="l00351"></a>00351 <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classError.html">Error</a> *<a class="code" href="classIOModule.html#a6">WaitIOEvent</a>( <a class="code" href="CML__IO_8h.html#a92">IOMODULE_EVENTS</a> event, <a class="code" href="CML__Utils_8h.html#a9">int32</a> timeout=-1 );<a name="l00352"></a>00352 <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classError.html">Error</a> *<a class="code" href="classIOModule.html#a6">WaitIOEvent</a>( <a class="code" href="classEvent.html">Event</a> &e, <a class="code" href="CML__Utils_8h.html#a9">int32</a> timeout, <a class="code" href="CML__IO_8h.html#a92">IOMODULE_EVENTS</a> &match );<a name="l00353"></a>00353 <a name="l00354"></a>00354 <span class="comment">/***************************************************************************/</span><span class="comment"></span><a name="l00355"></a>00355 <span class="comment"> /** \name Digital input control</span><a name="l00356"></a>00356 <span class="comment"></span><a name="l00357"></a>00357 <span class="comment"> If the module contains digital inputs, these methods may be used to configure</span><a name="l00358"></a>00358 <span class="comment"> and read those inputs. The inputs may be read and controlled individually, </span><a name="l00359"></a>00359 <span class="comment"> or in groups of 8, 16 or 32 inputs.</span><a name="l00360"></a>00360 <span class="comment"></span><a name="l00361"></a>00361 <span class="comment"> All I/O modules should support access to digital inputs in groups of 8. </span><a name="l00362"></a>00362 <span class="comment"> Support for individual access or different groupings is optional under the </span><a name="l00363"></a>00363 <span class="comment"> spec. If a particular device does not support such groupings, an attempt </span><a name="l00364"></a>00364 <span class="comment"> to use them should return an error code.</span><a name="l00365"></a>00365 <span class="comment"></span><a name="l00366"></a>00366 <span class="comment"> Each input pin or group of pins is assigned an ID number used to access it.</span><a name="l00367"></a>00367 <span class="comment"> When single inputs are accessed, these ID numbers range from 0 (the first input)</span><a name="l00368"></a>00368 <span class="comment"> to N-1 (the last input), where N is the total number of input pins available</span><a name="l00369"></a>00369 <span class="comment"> on the module.</span><a name="l00370"></a>00370 <span class="comment"></span><a name="l00371"></a>00371 <span class="comment"> When groups of inputs are accessed as a unit, the group is assigned a number.</span>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -