Difference between revisions of "EtherCAT:EC SDO WRITE DOUBLE"

From SoftMC-Wiki
Jump to: navigation, search
(Created page with "{{Template:EtherCAT-Function |DESCRIPTION= Similar to EC_SDO_WRITE, this function allows writing DOUBLE values.<br/> EC_SDO_WRITE_DOUBLE sends data ...")
 
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
{{Languages|EtherCAT:EC_SDO_WRITE_DOUBLE}}
 
{{Template:EtherCAT-Function
 
{{Template:EtherCAT-Function
  
 
|DESCRIPTION=
 
|DESCRIPTION=
Similar to [[EtherCAT:EC SDO WRITE|EC_SDO_WRITE]], this function allows writing DOUBLE values.<br/>
+
Similar to [[EtherCAT:EC SDO WRITE|EC_SDO_WRITE]], this subroutine allows writing DOUBLE values.<br/>
EC_SDO_WRITE_DOUBLE 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.<br/>
+
EC_SDO_WRITE_DOUBLE 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.<br/>
The first sub-index is 0. If only one sub-index exists, we still have to specify 0 (we cannot omit this field).
+
The first sub-index is 0. If the object has only one sub-index, you must still specify 0 (this field cannot be omitted).
<br/><br/>
+
 
 
{{Note/Important|
 
{{Note/Important|
At the moment only 32 bits variables can be written}}
+
Only 32-bit variables can be written}}
<br/>
+
 
 +
 
 
|INPUT=
 
|INPUT=
 
Slave address, SDO index, SDO sub-index, SDO size in bits, the new value to be written.
 
Slave address, SDO index, SDO sub-index, SDO size in bits, the new value to be written.
Line 19: Line 21:
  
 
|DECLARATION=
 
|DECLARATION=
public sub EC_SDO_WRITE_DOUBLE(byval slaveaddress as long, byval index as long, byval subindex as long,byval varSize as long, byval new_val as double)
+
public sub EC_SDO_WRITE_DOUBLE(byval slaveaddress as long, byval index as long, byval subindex as long, byval varSize as long, byval new_val as double)
  
 
|SYNTAX=
 
|SYNTAX=
Line 39: Line 41:
 
* [[EtherCAT:EC SDO READ|EC_SDO_READ]]
 
* [[EtherCAT:EC SDO READ|EC_SDO_READ]]
 
* [[EtherCAT:EC SDO WRITE|EC_SDO_WRITE]]
 
* [[EtherCAT:EC SDO WRITE|EC_SDO_WRITE]]
 +
* [[EtherCAT:EC SDO READ STRING|EC_SDO_READ_STRING]]
 
* [[EtherCAT:EC PDO READ|EC_PDO_READ]]
 
* [[EtherCAT:EC PDO READ|EC_PDO_READ]]
 
* [[EtherCAT:EC PDO WRITE|EC_PDO_WRITE]]
 
* [[EtherCAT:EC PDO WRITE|EC_PDO_WRITE]]
  
 
}}
 
}}

Latest revision as of 17:28, 6 May 2017

Language: English  • 中文(简体)‎

Similar to EC_SDO_WRITE, this subroutine allows writing DOUBLE values.
EC_SDO_WRITE_DOUBLE 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).

IMPORTANT.svgIMPORTANT
Only 32-bit variables can be written

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_DOUBLE(byval slaveaddress as long, byval index as long, byval subindex as long, byval varSize as long, byval new_val as double)

Syntax

call EC_SDO_WRITE_DOUBLE(<Slave address>, <SDO index>, <SDO sub-index>, <SDO size in bits>, <new value>)

Exceptions

EC_SDO_READ_WRITE_DOUBLE - "SDO READ/WRITE DOUBLE ERROR: Invalid Size. Must be 32 or 64" 20071 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_DOUBLE(ax.Dadd, 0x2027, 0, 32, 96) ' Write CDHD kvp

See Also