跳转至

DLLGetNumberDrives

函数 DLLGetNumberDrives 获取 EtherCAT 总线上发现的总驱动数量。

所属:C/C++ API 函数索引

C/C++

ErrorCode DLLGetNumberDrives(INT_PTR hClientHandle, int* outNumDrives);

C#

Controller.Information.MotionDrives.Count — 属性,返回总线上驱动数量。

参数

hClientHandle (INT_PTR)

客户端会话句柄,由 DLLSysConnect 获取。

outNumDrives (int*)

输出。接收 EtherCAT 总线上发现的驱动数量。

返回值

返回 ErrorCodeNoError (0) 表示成功,正值为错误码,详见 SDK 发布头 ErrorCode.h。

示例

int numDrives = 0;
DLLGetNumberDrives(handle, &numDrives);
printf("Drives: %d\n", numDrives);

相关函数