CANopen:SET DOUT RANGE PDO DADD

From SoftMC-Wiki
Jump to: navigation, search

Set COBID and location of Digital Output inside TPDO.
Outputs are mapped to sys.dout.<startRange> to sys.dout.<startRange+payloadBits>

For example:
drvAddress = 1
SET_DOUT_RANGE_PDO_DADD(drvAddress,TPD02_COB,0, 4,10000+drvAddress*100,2,16)' 2 outputs in bits 16,17 of PDO

Device with physical address 1, 2 outputs will be mapped sys.dout.10100 to sys.dout.10101

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_DOUT_RANGE_PDO_DADD(byval as long,byval as long,byval as long,byval as long,byval as long,byval as long)

Syntax

SET_DOUT_RANGE_PDO_DADD(<dadd>,<cobid>,<offset>,<size>,<start>,<bits>,<shift>)

Exceptions

None

Examples

SET_DOUT_RANGE_PDO_DADD(1,0,0,0,0,0,0) ' Unmap digital outputs
SET_DOUT_RANGE_PDO_DADD(drvAddress,TPD02_COB,0, 4,10000+drvAddress*100,2,16)' 2 outputs in bits 16,17 of PDO

See Also