Difference between revisions of "EtherCAT:EC ASSOCIATE PDO TO SYS DIO/zh-hans"

From SoftMC-Wiki
Jump to: navigation, search
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Languages}}
+
{{Languages|EtherCAT:EC_ASSOCIATE_PDO_TO_SYS_DIO}}
{{Template:EtherCAT-Function
 
  
|描述=
+
== 描述 ==
This subroutine associates between System digital IOs to an EtherCAT slave IOs.<br/>
+
该子程序将系统数字IO与EtherCAT从站IO相关联。<br/>
This allows the user to handle the slave's digital IOs by using the following syntax:<br/>
+
这允许用户使用以下语法处理从站的数字IO:<br/>
 
?Sys.din[<first system digital input bit>][<Range>]<br/>
 
?Sys.din[<first system digital input bit>][<Range>]<br/>
 
Sys.dout[<first system digital output bit>][<Range>] = <value>
 
Sys.dout[<first system digital output bit>][<Range>] = <value>
 
<br/><br/>
 
<br/><br/>
 
{{Note/Important|
 
{{Note/Important|
It is up to the user to assign system IOs carefully, and make sure that the same system IO isn't mapped
+
由用户仔细分配系统IO,并确保没有映射相同的系统IO
to more than one IO (of a motion drive or an IO module).
+
到多个IO(运动驱动器或IO模块)。
  
Behavior is UNDEFINED if this rule is broken !!!}}
+
如果此规则被破坏,行为是未定义的 !!!}}
  
{{Note/Important|This subroutine must be invoked before the EtherCAT master is started. Refer to [[:Category:EtherCAT:ECAT_GENERAL_GUIDE|EtherCAT General Guide]] and [[:Category:EtherCAT:EC SETUP|Setup EtherCAT]] for more information}}
+
{{Note/Important|在启动EtherCAT主站之前,必须调用此子程序。参考[[:Category:EtherCAT:ECAT_GENERAL_GUIDE|EtherCAT General Guide]][[:Category:EtherCAT:EC SETUP|Setup EtherCAT]]获得更多信息}}
 
<br/>
 
<br/>
|INPUT=
 
slave address, PDO index, PDO sub-index, First SYSTEM digital output.<br/>
 
range - number of digital IOs mapped to the relevant PDO<br/>
 
inherent_offset - In some slaves, like the STX CDHD, the PDO's size is 32 bits but the DIOs are mapped from 16 to 32, therefore the inherent offset is 16.
 
  
|OUTPUT=
+
== 输出 ==
 +
从站地址,PDO索引,PDO子索引,第一个SYSTEM数字输出。<br/>
 +
range - 数字IO的数量映射到相关的PDO。<br/>
 +
inherent_offset - 在一些从站,如STX CDHD,PDO的大小为32位,但DIO映射为16到32,因此固有偏移量为16.
 +
 
 +
== 输出 ==
 
None
 
None
  
|RETURN VALUE=
+
== 返回值 ==
 
None
 
None
  
|DECLARATION=
+
== 声明 ==
 
public sub EC_ASSOCIATE_PDO_TO_SYS_DIO(byval slaveAddr as long, byval PDOindex as long, byval PDOsubindex as long, byval systemDIOnumber as long, byval range as long, byval inherent_offset as long)
 
public sub EC_ASSOCIATE_PDO_TO_SYS_DIO(byval slaveAddr as long, byval PDOindex as long, byval PDOsubindex as long, byval systemDIOnumber as long, byval range as long, byval inherent_offset as long)
|SYNTAX=
+
 
 +
== 格式 ==
 
call EC_ASSOCIATE_PDO_TO_SYS_DIO(<Slave address>, <PDO index>, <PDOS sub-index>, <first SYSTEM digital output>, <range>, <inherent offset>)
 
call EC_ASSOCIATE_PDO_TO_SYS_DIO(<Slave address>, <PDO index>, <PDOS sub-index>, <first SYSTEM digital output>, <range>, <inherent offset>)
  
|EXAMPLE=
+
== 例子 ==
call EC_ASSOCIATE_PDO_TO_SYS_DIO(drive_addr, 0x60FD, 0x0, drive_addr*100, 11, 16)  '  16 - inherent offset in 60FD to digital inputs<br/>
+
call EC_ASSOCIATE_PDO_TO_SYS_DIO(drive_addr, 0x60FD, 0x0, drive_addr*100, 11, 16)  '  16 - 0x60FD对数字输入的固有偏移<br/>
call EC_ASSOCIATE_PDO_TO_SYS_DIO(drive_addr, 0x60FE, 0x1, drive_addr*100, 6, 16)  '  16 - inherent offset in 60FE to digital outputs<br/>
+
call EC_ASSOCIATE_PDO_TO_SYS_DIO(drive_addr, 0x60FE, 0x1, drive_addr*100, 6, 16)  '  16 - 0x60FE对数字输出的固有偏移<br/>
If drive_addr == 3, the last example maps the drive's first digital output to the system digital output bit number 300,<br/>
+
如果 drive_addr == 3, 最后一个例子将驱动器的第一个数字输出映射到系统数字输出位300,<br/>
drive's second digital output to system digital output bit number 301, and so on until Drive Dout 11 and System DOut 311.<br/>
+
驱动器的第二个数字输出到系统数字输出位301,依此类推,直到Drive Dout 11和System DOut 311。<br/>
  
|SEE ALSO=
+
== 参见 ==
 
* [[:Category:EtherCAT:ECAT_GENERAL_GUIDE|ECAT_GENERAL_GUIDE]]
 
* [[:Category:EtherCAT:ECAT_GENERAL_GUIDE|ECAT_GENERAL_GUIDE]]
 
* [[EtherCAT:EC_INSTALL_STX_CDHD|EC_INSTALL_STX_CDHD]]
 
* [[EtherCAT:EC_INSTALL_STX_CDHD|EC_INSTALL_STX_CDHD]]
 
* [[EtherCAT:DIGITAL-IOS|DIGITAL-IOS]]
 
* [[EtherCAT:DIGITAL-IOS|DIGITAL-IOS]]
 
 
}}
 

Latest revision as of 10:03, 5 May 2017

语言: English  • 中文(简体)‎

描述

该子程序将系统数字IO与EtherCAT从站IO相关联。
这允许用户使用以下语法处理从站的数字IO:
?Sys.din[<first system digital input bit>][<Range>]
Sys.dout[<first system digital output bit>][<Range>] = <value>

IMPORTANT.svgIMPORTANT

由用户仔细分配系统IO,并确保没有映射相同的系统IO 到多个IO(运动驱动器或IO模块)。

如果此规则被破坏,行为是未定义的 !!!
IMPORTANT.svgIMPORTANT
在启动EtherCAT主站之前,必须调用此子程序。参考EtherCAT General GuideSetup EtherCAT获得更多信息


输出

从站地址,PDO索引,PDO子索引,第一个SYSTEM数字输出。
range - 数字IO的数量映射到相关的PDO。
inherent_offset - 在一些从站,如STX CDHD,PDO的大小为32位,但DIO映射为16到32,因此固有偏移量为16.

输出

None

返回值

None

声明

public sub EC_ASSOCIATE_PDO_TO_SYS_DIO(byval slaveAddr as long, byval PDOindex as long, byval PDOsubindex as long, byval systemDIOnumber as long, byval range as long, byval inherent_offset as long)

格式

call EC_ASSOCIATE_PDO_TO_SYS_DIO(<Slave address>, <PDO index>, <PDOS sub-index>, <first SYSTEM digital output>, <range>, <inherent offset>)

例子

call EC_ASSOCIATE_PDO_TO_SYS_DIO(drive_addr, 0x60FD, 0x0, drive_addr*100, 11, 16) ' 16 - 0x60FD对数字输入的固有偏移
call EC_ASSOCIATE_PDO_TO_SYS_DIO(drive_addr, 0x60FE, 0x1, drive_addr*100, 6, 16) ' 16 - 0x60FE对数字输出的固有偏移
如果 drive_addr == 3, 最后一个例子将驱动器的第一个数字输出映射到系统数字输出位300,
驱动器的第二个数字输出到系统数字输出位301,依此类推,直到Drive Dout 11和System DOut 311。

参见