control_io_interfaceT_control_io_interfaceControlIoInterfaceControlIoInterfacecontrol_io_interface控制输入输出接口(算子)

名称

control_io_interfaceT_control_io_interfaceControlIoInterfaceControlIoInterfacecontrol_io_interface — 在输入/输出接口上执行操作。

签名

control_io_interface( : : IOInterfaceName, Action, Argument : Result)

Herror T_control_io_interface(const Htuple IOInterfaceName, const Htuple Action, const Htuple Argument, Htuple* Result)

void ControlIoInterface(const HTuple& IOInterfaceName, const HTuple& Action, const HTuple& Argument, HTuple* Result)

static HTuple HIODevice::ControlIoInterface(const HString& IOInterfaceName, const HString& Action, const HTuple& Argument)

static HTuple HIODevice::ControlIoInterface(const HString& IOInterfaceName, const HString& Action, const HString& Argument)

static HTuple HIODevice::ControlIoInterface(const char* IOInterfaceName, const char* Action, const char* Argument)

static HTuple HIODevice::ControlIoInterface(const wchar_t* IOInterfaceName, const wchar_t* Action, const wchar_t* Argument)   ( Windows only)

static void HOperatorSet.ControlIoInterface(HTuple IOInterfaceName, HTuple action, HTuple argument, out HTuple result)

static HTuple HIODevice.ControlIoInterface(string IOInterfaceName, string action, HTuple argument)

static HTuple HIODevice.ControlIoInterface(string IOInterfaceName, string action, string argument)

def control_io_interface(iointerface_name: str, action: str, argument: MaybeSequence[Union[int, float, str]]) -> Sequence[Union[int, float, str]]

描述

control_io_interfacecontrol_io_interfaceControlIoInterfaceControlIoInterfaceControlIoInterfacecontrol_io_interface 对 I/O 接口执行操作。支持的参数因接口而异,具体列表详见所用 I/O 接口的对应文档,该文档位于 doc/html/reference/io 目录中。

ActionActionActionActionactionaction 的特殊值 'keep_open'"keep_open""keep_open""keep_open""keep_open""keep_open" 用于控制接口何时卸载。若 ArgumentArgumentArgumentArgumentargumentargument 设置为 'true'"true""true""true""true""true",则接口将保持加载状态直至 HALCON 进程终止。若设置为 'false'"false""false""false""false""false",则当所有设备实例关闭后接口将立即卸载。此为默认行为。

注意

在 Windows 系统上,当接口的依赖模块未被找到时(例如未安装相应的 SDK),操作系统可能会弹出错误对话框。可通过设置 Windows 的错误模式来控制这些错误框的出现。具体操作请参阅 Windows MSDN 文档中关于 SetErrorMode 的说明。

执行信息

参数

IOInterfaceNameIOInterfaceNameIOInterfaceNameIOInterfaceNameIOInterfaceNameiointerface_name (输入控制)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

HALCON I/O 接口名称。

默认值: []

建议值: 'ADLINK-DAQPilot'"ADLINK-DAQPilot""ADLINK-DAQPilot""ADLINK-DAQPilot""ADLINK-DAQPilot""ADLINK-DAQPilot", 'ADLINK-EOS'"ADLINK-EOS""ADLINK-EOS""ADLINK-EOS""ADLINK-EOS""ADLINK-EOS", 'Advantech'"Advantech""Advantech""Advantech""Advantech""Advantech", 'Contec'"Contec""Contec""Contec""Contec""Contec", 'Hilscher-cifX'"Hilscher-cifX""Hilscher-cifX""Hilscher-cifX""Hilscher-cifX""Hilscher-cifX", 'Interface'"Interface""Interface""Interface""Interface""Interface", 'Linux-GPIO'"Linux-GPIO""Linux-GPIO""Linux-GPIO""Linux-GPIO""Linux-GPIO", 'NIDAQmx'"NIDAQmx""NIDAQmx""NIDAQmx""NIDAQmx""NIDAQmx", 'OPC_Classic'"OPC_Classic""OPC_Classic""OPC_Classic""OPC_Classic""OPC_Classic", 'OPC_UA'"OPC_UA""OPC_UA""OPC_UA""OPC_UA""OPC_UA"

ActionActionActionActionactionaction (输入控制)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

要执行的操作名称。

ArgumentArgumentArgumentArgumentargumentargument (输入控制)  string(-array) HTupleMaybeSequence[Union[int, float, str]]HTupleHtuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double)

操作的参数列表。

默认值: []

ResultResultResultResultresultresult (输出控制)  string-array HTupleSequence[Union[int, float, str]]HTupleHtuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double)

操作返回的结果列表。

结果

如果参数有效,算子 control_io_interfacecontrol_io_interfaceControlIoInterfaceControlIoInterfaceControlIoInterfacecontrol_io_interface 返回值 2 (H_MSG_TRUE)。如有必要,则抛出异常。在此情况下,可设置扩展错误信息,并可通过算子 get_extended_error_infoget_extended_error_infoGetExtendedErrorInfoGetExtendedErrorInfoGetExtendedErrorInfoget_extended_error_info 进行查询。

另见

query_io_interfacequery_io_interfaceQueryIoInterfaceQueryIoInterfaceQueryIoInterfacequery_io_interface

模块

基础