Difference between revisions of "EtherCAT:EC ASSOCIATE PDO TO SYS DIO"
Line 4: | Line 4: | ||
This subroutine associates between System digital IOs to an EtherCAT slave IOs.<br/> | This subroutine associates between System digital IOs to an EtherCAT slave IOs.<br/> | ||
This allows the user to handle the slave's digital IOs by using the following syntax:<br/> | This allows the user to handle the slave's digital IOs by using the following syntax:<br/> | ||
− | ?Sys.din[<first system digital input bit>][<Range>] | + | ?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/> |
Revision as of 15:07, 4 January 2015
This subroutine associates between System digital IOs to an EtherCAT slave IOs.
This allows the user to handle the slave's digital IOs by using the following syntax:
?Sys.din[<first system digital input bit>][<Range>]
Sys.dout[<first system digital output bit>][<Range>] = <value>
IMPORTANT | |
It is up to the user to assign system IOs carefully, and make sure that the same system IO isn't mapped to more than one IO (of a motion drive or an IO module). Behavior is UNDEFINED if this rule is broken !!! |
Input
slave address, PDO index, PDO sub-indexfirst, First SYSTEM digital output. range - number of digital IOs mapped to the relevant PDO 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
None
Return Value
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)
Syntax
call EC_ASSOCIATE_PDO_TO_SYS_DIO(<Slave address>, <PDO index>, <PDOS sub-index>, <first SYSTEM digital output>, <range>, <inherent offset>)
Examples
call EC_ASSOCIATE_PDO_TO_SYS_DIO(drive_addr, 0x60FD, 0x0, drive_addr*100, 11, 16) ' 16 - inherent offset in 60FD to digital inputs
call EC_ASSOCIATE_PDO_TO_SYS_DIO(drive_addr, 0x60FE, 0x1, drive_addr*100, 6, 16) ' 16 - inherent offset in 60FD to digital inputs
If drive_addr == 3, the last example maps the drive's first digital output to the system digital output bit number 300,
drive's second digital output to system digital output bit number 301, and so on until Drive Dout 11 and System DOut 311.