Difference between revisions of "EtherCAT:EC SDO WRITE"
m (Miborich moved page Axystems:EtherCAT:EC SDO WRITE to EtherCAT:EC SDO WRITE: Global renaming of Axystems: namespace into (Main):) |
m (Text replace - "Axystems:" to "") |
||
Line 1: | Line 1: | ||
− | {{ | + | {{Template:EtherCAT-Function |
|DESCRIPTION= | |DESCRIPTION= |
Revision as of 09:14, 22 May 2014
In order to communicate with a specific slave we use its address and the functions EC_SDO_READ, EC_SDO_WRITE.
EC_SDO_WRITE sends data to the slave over a specific SDO. We have to specify the SDO's index, and its sub-index, its size, and the new value
that we would like to write to the slave.
The first sub-index is 0. If only one sub-index exists, we still have to specify 0 (we cannot omit this field).
Input
Slave address, SDO index, SDO sub-index, SDO size in bits, the new value to be written.
Output
None
Return Value
Void
Declaration
public sub EC_SDO_WRITE(byval slaveaddress as long, byval index as long, byval subindex as long,byval size_bits as long, byval new_val as long)
Syntax
call EC_SDO_WRITE(<Slave address>, <SDO index>, <SDO sub-index>, <SDO size in bits>, <new value>)
Exceptions
EC_SDO_WRITE_READ_ONLY - "SDO WRITE ERROR: Attempt to write a read-only object" 20061
EC_WRITE_VAL_LOW - "SDO WRITE ERROR: Written value too low" 20062
EC_WRITE_VAL_HIGH - "SDO WRITE ERROR: Written value too high" 20063
EC_SDO_GENERAL_ERROR - "SDO WRITE ERROR: Check written value validity" 20065
EC_SDO_WRITE_INVALID_SIZE - "SDO WRITE ERROR: Invalid Bit Size" 20066
Examples
call EC_SDO_WRITE(1, 0x6040, 0, 16, 128) 'clear faults