Difference between revisions of "EtherCAT:EC SDO WRITE"
(13 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | {{ | + | {{Languages|EtherCAT:EC_SDO_WRITE}} |
+ | {{Template:EtherCAT-Function | ||
|DESCRIPTION= | |DESCRIPTION= | ||
− | + | This function allows writing integer values of sizes 8, 16 and 32 bits.<br/> | |
− | EC_SDO_WRITE sends data to the slave over a specific | + | To communicate with a specific slave, use its address and the functions [[EtherCAT:EC SDO READ|EC_SDO_READ]], EC_SDO_WRITE. |
− | + | EC_SDO_WRITE sends data to the slave over a specific SDO. You must specify the SDO index, sub-index, size, and the new value to write to the slave. | |
− | The first sub-index is 0. If only one sub-index | + | The first sub-index is 0. If the object has only one sub-index, you must still specify 0 (this field cannot be omitted). |
|INPUT= | |INPUT= | ||
− | Slave address, | + | Slave address, SDO index, SDO sub-index, SDO size in bits, the new value to be written. |
|OUTPUT= | |OUTPUT= | ||
Line 20: | Line 21: | ||
|SYNTAX= | |SYNTAX= | ||
− | call EC_SDO_WRITE(<Slave address>, < | + | 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<br/> | ||
+ | EC_WRITE_VAL_LOW - "SDO WRITE ERROR: Written value too low" 20062<br/> | ||
+ | EC_WRITE_VAL_HIGH - "SDO WRITE ERROR: Written value too high" 20063<br/> | ||
+ | EC_SDO_GENERAL_ERROR - "SDO WRITE ERROR: Check written value validity" 20065<br/> | ||
+ | EC_SDO_WRITE_INVALID_SIZE - "SDO WRITE ERROR: Invalid Bit Size" 20066<br/> | ||
|EXAMPLE= | |EXAMPLE= | ||
Line 26: | Line 34: | ||
|SEE ALSO= | |SEE ALSO= | ||
− | * [[ | + | * [[EtherCAT:EC SDO READ|EC_SDO_READ]] |
− | * [[ | + | * [[EtherCAT:EC SDO READ STRING|EC_SDO_READ_STRING]] |
− | * [[ | + | * [[EtherCAT:EC SDO READ DOUBLE|EC_SDO_READ_DOUBLE]] |
+ | * [[EtherCAT:EC SDO WRITE DOUBLE|EC_SDO_WRITE_DOUBLE]] | ||
+ | * [[EtherCAT:EC PDO READ|EC_PDO_READ]] | ||
+ | * [[EtherCAT:EC PDO READ N|EC_PDO_READ_N]] | ||
+ | * [[EtherCAT:EC PDO WRITE|EC_PDO_WRITE]] | ||
}} | }} |
Latest revision as of 17:16, 6 May 2017
Language: | English • 中文(简体) |
---|
This function allows writing integer values of sizes 8, 16 and 32 bits.
To communicate with a specific slave, use its address and the functions EC_SDO_READ, EC_SDO_WRITE.
EC_SDO_WRITE sends data to the slave over a specific SDO. You must specify the SDO index, sub-index, size, and the new value to write to the slave.
The first sub-index is 0. If the object has only one sub-index, you must still specify 0 (this field cannot be omitted).
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