EtherCAT:EC SDO READ STRING/zh-hans

From SoftMC-Wiki
< EtherCAT:EC SDO READ STRING
Revision as of 17:12, 6 May 2017 by Chi (talk | contribs) (Created page with "{{Languages}} == 描述 == 与EC_SDO_READ类似, 此功能允许读取STRING值。<br/> 要从从站读取数据,我们必须指定一个SDO索引...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
语言: English  • 中文(简体)‎

描述

EC_SDO_READ类似, 此功能允许读取STRING值。
要从从站读取数据,我们必须指定一个SDO索引和一个子索引。
第一个子索引为0.如果只存在一个子索引,我们还需要指定0(我们不能忽略该字段)。
读取值从函数返回,可以设置为变量。

输入

Slave address, SDO index, SDO sub-index.

输出

str_length - 该输出变量由字符串长度的函数填充

返回值

从从站中读取的字符串。

声明

public function EC_SDO_READ_STRING(byval slaveaddres as long, byval index as long, byval subindex as long, str_length as long) as string

格式

retVal = EC_SDO_READ_STRING(<Slave address>, <SDO index>, <SDO sub-index>, <String's length>)

例外

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


例子

ret_Str = EC_SDO_READ_STRING(module_address, 0x6000, 1, length)


参见