Difference between revisions of "EtherCAT:EC PDO READ"

From SoftMC-Wiki
Jump to: navigation, search
(Created page with "{{Axystems:Template:EtherCAT-Function |DESCRIPTION= While the system is running we are able to read and write specific PDOS = without = interfering with the realtime function...")
 
 
(17 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Axystems:Template:EtherCAT-Function
+
{{Languages|EtherCAT:EC_PDO_READ}}
 +
{{Template:EtherCAT-Function
  
 
|DESCRIPTION=
 
|DESCRIPTION=
While the system is running we are able to read and write specific PDOS = without = interfering with the realtime functionality
+
While the system is running, you can read from and write to PDOs ''without interfering'' with the real-time functionality of the system.<br/>
of the system.
+
This function retrieves the value of a specific PDO within the current cycle.
In order to communicate with a specific slave we use its address and the functions EC_SDO_READ, EC_SDO_WRITE.<br/>
 
To read data from the slave we have to specify a PDO index, a sub-index and its size.<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 read value is returned from the function and can be set to a variable.<br/>
 
  
 
|INPUT=
 
|INPUT=
Slave address, PDO index, PDO sub-index, PDO size in bits, the new value to be written.
+
Slave address, PDO index, PDO sub-index.
  
 
|OUTPUT=
 
|OUTPUT=
Line 16: Line 13:
  
 
|RETURN VALUE=
 
|RETURN VALUE=
Value that is read from the slave.
+
Value that is read from the PDO.
  
 
|DECLARATION=
 
|DECLARATION=
public function EC_SDO_READ(byval slaveaddres as long, byval index as long, byval subindex as long,byval size_bits as long) as long
+
public function EC_PDO_READ(byval slaveaddres as long, byval index as long, byval subindex as long) as long
  
 
|SYNTAX=
 
|SYNTAX=
retVal = EC_SDO_READ(<Slave address>, <PDO index>, <PDO sub-index>, <PDO size in bits>)
+
retVal = EC_PDO_READ(<Slave address>, <PDO index>, <PDO sub-index>)
 +
 
 +
|EXCEPTIONS=
 +
EC_SLAVE_ADDRESS_ERROR - "SLAVE ADDRESS ERROR" 20032<br/>
 +
EC_PDO_PARMS_ERROR - "INVAILD PDO PARAMETERS" 20040<br/>
 +
EC_PDO_DIRECTION_ERROR - "PDO WRONG DIRECTION (INPUT/OUTPUT)" 20046<br/>
  
 
|EXAMPLE=
 
|EXAMPLE=
retVal = EC_SDO_READ(2, 0x6041,0, 32)  '  Read status word
+
retVal = EC_PDO_READ(2, 0x6041, 0)  '  Read status word<br/>
 +
retVal = EC_PDO_READ(2, EC_STATUS_INDEX, EC_STATUS_SUBINDEX)
  
  
 
|SEE ALSO=
 
|SEE ALSO=
* [[Axystems:EtherCAT:EC_SDO_WRITE|EC_SDO_WRITE]]
+
* [[EtherCAT:EC PDO READ N|EC_PDO_READ_N]]
 +
* [[EtherCAT:EC PDO WRITE|EC_PDO_WRITE]]
 +
* [[EtherCAT:EC SDO READ|EC_SDO_READ]]
 +
* [[EtherCAT:EC SDO WRITE|EC_SDO_WRITE]]
  
 
}}
 
}}

Latest revision as of 18:01, 5 May 2017

Language: English  • 中文(简体)‎

While the system is running, you can read from and write to PDOs without interfering with the real-time functionality of the system.
This function retrieves the value of a specific PDO within the current cycle.

Input

Slave address, PDO index, PDO sub-index.

Output

None

Return Value

Value that is read from the PDO.

Declaration

public function EC_PDO_READ(byval slaveaddres as long, byval index as long, byval subindex as long) as long

Syntax

retVal = EC_PDO_READ(<Slave address>, <PDO index>, <PDO sub-index>)

Exceptions

EC_SLAVE_ADDRESS_ERROR - "SLAVE ADDRESS ERROR" 20032
EC_PDO_PARMS_ERROR - "INVAILD PDO PARAMETERS" 20040
EC_PDO_DIRECTION_ERROR - "PDO WRONG DIRECTION (INPUT/OUTPUT)" 20046

Examples

retVal = EC_PDO_READ(2, 0x6041, 0) ' Read status word
retVal = EC_PDO_READ(2, EC_STATUS_INDEX, EC_STATUS_SUBINDEX)

See Also