EtherCAT:EC SDO READ/zh-hans

From SoftMC-Wiki
Jump to: navigation, search
语言: English  • 中文(简体)‎

描述

此功能允许读取大小为8,16和32位的INTEGER值.
要与特定从站进行通信,请使用其地址和功能EC_SDO_READ和EC_SDO_WRITE
要从从站读取数据,您必须指定SDO索引和子索引。
第一个子索引为0.如果对象只有一个子索引,则仍必须指定0(该字段不能被省略)
读取值从函数返回,可以设置为变量。


输入

Slave address, SDO index, SDO sub-index.

输出

None

返回

Value that is read from the slave.

声明

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

格式

retVal = EC_SDO_READ(<Slave address>, <SDO index>, <SDO sub-index>)

例外

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

例子

retVal = EC_SDO_READ(2, 0x6041,0) ' Read status word


|SEE ALSO=