query_io_interfaceT_query_io_interfaceQueryIoInterfaceQueryIoInterfacequery_io_interface (算子)
名称
query_io_interfaceT_query_io_interfaceQueryIoInterfaceQueryIoInterfacequery_io_interface — 查询指定输入/输出设备接口的信息。
签名
def query_io_interface(iointerface_name: str, query: MaybeSequence[str]) -> Sequence[Union[int, float, str]]
描述
算子 query_io_interfacequery_io_interfaceQueryIoInterfaceQueryIoInterfaceQueryIoInterfacequery_io_interface returns information about
the I/O device interface IOInterfaceNameIOInterfaceNameIOInterfaceNameIOInterfaceNameIOInterfaceNameiointerface_name. The desired
information is specified via QueryQueryQueryQueryqueryquery. If applicable,
ResultResultResultResultresultresult contains a list of supported values.
Generally, when passing the value 'interface_name'"interface_name""interface_name""interface_name""interface_name""interface_name" for
QueryQueryQueryQueryqueryquery, all available I/O interfaces are returned. The value
of the parameter IOInterfaceNameIOInterfaceNameIOInterfaceNameIOInterfaceNameIOInterfaceNameiointerface_name is ignored in this case.
Please check the directory doc/html/reference/io
for documentation about your specific I/O device interface, where
all supported interface specific parameters are listed.
注意
On Windows Systems, error dialog boxes from the operating system can occur
when dependency modules of the interface are not found, e.g., the according
SDK was not installed. The occurrence of the error boxes can be controlled by
setting Windows' Error Mode. Please refer to the description of SetErrorMode
within the Windows MSDN documentation.
执行信息
- 多线程类型:可重入(与非独占算子并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 未采用并行化处理。
参数
IOInterfaceNameIOInterfaceNameIOInterfaceNameIOInterfaceNameIOInterfaceNameiointerface_name (输入控制) string → HTuplestrHTupleHtuple (string) (string) (HString) (char*)
HALCON I/O interface name.
默认值:
[]
建议值:
'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"
QueryQueryQueryQueryqueryquery (输入控制) string(-array) → HTupleMaybeSequence[str]HTupleHtuple (string) (string) (HString) (char*)
Parameter name of the query.
默认值:
'io_device_names'
"io_device_names"
"io_device_names"
"io_device_names"
"io_device_names"
"io_device_names"
建议值:
'interface_name'"interface_name""interface_name""interface_name""interface_name""interface_name", 'io_device_names'"io_device_names""io_device_names""io_device_names""io_device_names""io_device_names", 'param_name'"param_name""param_name""param_name""param_name""param_name", 'revision'"revision""revision""revision""revision""revision"
ResultResultResultResultresultresult (输出控制) string-array → HTupleSequence[Union[int, float, str]]HTupleHtuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double)
List of result values (according to QueryQueryQueryQueryqueryquery).
示例(HDevelop)
* Select a suitable i/o device interface of name IOInterfaceName
query_io_interface (IOInterfaceName, 'io_device_names', DeviceNames)
open_io_device (IOInterfaceName, DeviceNames[0], [], [], IODeviceHandle)
query_io_device (IODeviceHandle, [], 'io_channel_names.digital_input', \
ChannelInputNames)
open_io_channel (IODeviceHandle, ChannelInputNames[0], [], [], \
IOChannelHandle)
read_io_channel (IOChannelHandle, Value, Status)
结果
如果参数有效,算子
query_io_interfacequery_io_interfaceQueryIoInterfaceQueryIoInterfaceQueryIoInterfacequery_io_interface 返回值 2 ( H_MSG_TRUE )。如有必要,则抛出异常。在这种情况下,可以设置扩展错误信息,并可进行查询通过算子 get_extended_error_infoget_extended_error_infoGetExtendedErrorInfoGetExtendedErrorInfoGetExtendedErrorInfoget_extended_error_info。
可能的后继
open_io_deviceopen_io_deviceOpenIoDeviceOpenIoDeviceOpenIoDeviceopen_io_device
模块
基础