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

From SoftMC-Wiki
Jump to: navigation, search
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
 +
{{Languages|EtherCAT:EC_SDO_READ_DOUBLE}}
 
{{Template:EtherCAT-Function
 
{{Template:EtherCAT-Function
  
 
|DESCRIPTION=
 
|DESCRIPTION=
 
Similar to [[EtherCAT:EC SDO READ|EC_SDO_READ]], this function allows reading DOUBLE values.<br/>
 
Similar to [[EtherCAT:EC SDO READ|EC_SDO_READ]], this function allows reading DOUBLE values.<br/>
To read data from the slave we have to specify a SDO index and a sub-index.<br/>
+
To read data from the slave you must specify an SDO index and a sub-index.<br/>
The first sub-index is 0. If only one sub-index exists, we still have to specify 0 (we cannot omit this field).<br/>
+
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/>
 
The read value is returned from the function and can be set to a variable.<br/>
 
The read value is returned from the function and can be set to a variable.<br/>
<br/><br/>
+
 
 
{{Note/Important|
 
{{Note/Important|
At the moment only 32 bits variables can be read}}
+
Only 32 bits variables can be read.}}
 
<br/>
 
<br/>
 
|INPUT=
 
|INPUT=

Latest revision as of 16:25, 6 May 2017

Language: English  • 中文(简体)‎

Similar to EC_SDO_READ, this function allows reading DOUBLE values.
To read data from the slave you must specify an SDO index and a 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).
The read value is returned from the function and can be set to a variable.

IMPORTANT.svgIMPORTANT
Only 32 bits variables can be read.


Input

Slave address, SDO index, SDO sub-index, Variable size (32 or 64 bits).

Output

None

Return Value

Value that is read from the slave.

Declaration

public function EC_SDO_READ_DOUBLE(byval slaveaddres as long, byval index as long, byval subindex as long, byval varSize as long) as double

Syntax

retVal = EC_SDO_READ_DOUBLE(<Slave address>, <SDO index>, <SDO sub-index>, <Variable Size>)

Exceptions

EC_SDO_READ_WRITE_DOUBLE - "SDO READ/WRITE DOUBLE ERROR: Invalid Size. Must be 32 or 64" 20071
EC_SLAVE_ADDRESS_ERROR - "SLAVE ADDRESS ERROR" 20032
EC_SDO_READ_WRITE_ONLY - "SDO READ ERROR: Attempt to read a write-only object" 20060
EC_SDO_READ_SIZE - "SDO READ ERROR: Received an unreasonable amount of data" 20064

Examples

retVal = EC_SDO_READ_DOUBLE(ax.Dadd, 0x2027, 0, 32) ' Read CDHD kvp

See Also