Difference between revisions of "CANopen:SET DIN RANGE PDO DADD"
(Created page with "{{Template:CANopen Firmware Functions |DESCRIPTION= Set COBID and location of Digital Inputs inside TPDO.<br> Inputs are mapped to sys.din.<startRange> to sys.din.<startRange...") |
|||
Line 28: | Line 28: | ||
|DECLARATION= | |DECLARATION= | ||
− | import_c | + | import_c SET_DIN_RANGE_PDO_DADD(byval as long,byval as long,byval as long,byval as long,byval as long,byval as long) |
|SYNTAX= | |SYNTAX= | ||
− | + | SET_DIN_RANGE_PDO_DADD(<dadd>,<cobid>,<offset>,<size>,<start>,<bits>,<shift>) | |
|EXCEPTIONS= | |EXCEPTIONS= | ||
Line 37: | Line 37: | ||
|EXAMPLE= | |EXAMPLE= | ||
− | + | SET_DIN_RANGE_PDO_DADD(1,0,0,0,0,0,0) ' Unmap digital inputs<br> | |
− | + | SET_DIN_RANGE_PDO_DADD(1,0x280,0 , 4,10000+drvAddress*100,31,0) ' Digital Inputs are located in bytes 0,1,2 and 3 of RPDO with COBID 0x280<br> | |
+ | |||
|SEE ALSO= | |SEE ALSO= |
Revision as of 13:32, 1 March 2016
Set COBID and location of Digital Inputs inside TPDO.
Inputs are mapped to sys.din.<startRange> to sys.din.<startRange+payloadBits>
For example:
drvAddress = 1
SET_DIN_RANGE_PDO_DADD(drvAddress,TPD02_COB,0, 4,10000+drvAddress*100,31,0)' 32 inputs in all bits
As for device with physical address 32 inputs will be mapped sys.din.10100 to sys.din.10131
Input
dadd: physical slave address 1..127
cobid: COBID
offset: offset within PDO
objectsize: size of DIN/DOUT object in bytes, 4-bytes for standard 0x60fe an 0x60fd objects
startRange: start of set for sys.din.startRange and sys.dout.startRange, usually = 10000 * bus number + dadd*100
payloadBits: number of real IO lines
targetshift: payload shift if effective bits is not mapped from bit #0, for example 0x60FE uses bits 16-31 for digital output and need shift 16
Output
None
Return Value
None
Declaration
import_c SET_DIN_RANGE_PDO_DADD(byval as long,byval as long,byval as long,byval as long,byval as long,byval as long)
Syntax
SET_DIN_RANGE_PDO_DADD(<dadd>,<cobid>,<offset>,<size>,<start>,<bits>,<shift>)
Exceptions
None
Examples
SET_DIN_RANGE_PDO_DADD(1,0,0,0,0,0,0) ' Unmap digital inputs
SET_DIN_RANGE_PDO_DADD(1,0x280,0 , 4,10000+drvAddress*100,31,0) ' Digital Inputs are located in bytes 0,1,2 and 3 of RPDO with COBID 0x280