open_io_channelT_open_io_channelOpenIoChannelOpenIoChannelopen_io_channel (算子)

名称

open_io_channelT_open_io_channelOpenIoChannelOpenIoChannelopen_io_channel — 打开并配置输入/输出通道。

签名

open_io_channel( : : IODeviceHandle, IOChannelName, GenParamName, GenParamValue : IOChannelHandle)

Herror T_open_io_channel(const Htuple IODeviceHandle, const Htuple IOChannelName, const Htuple GenParamName, const Htuple GenParamValue, Htuple* IOChannelHandle)

void OpenIoChannel(const HTuple& IODeviceHandle, const HTuple& IOChannelName, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* IOChannelHandle)

HIOChannelArray HIODevice::OpenIoChannel(const HTuple& IOChannelName, const HTuple& GenParamName, const HTuple& GenParamValue) const

HIOChannel HIODevice::OpenIoChannel(const HString& IOChannelName, const HTuple& GenParamName, const HTuple& GenParamValue) const

HIOChannel HIODevice::OpenIoChannel(const char* IOChannelName, const HTuple& GenParamName, const HTuple& GenParamValue) const

HIOChannel HIODevice::OpenIoChannel(const wchar_t* IOChannelName, const HTuple& GenParamName, const HTuple& GenParamValue) const   ( Windows only)

void HIOChannel::HIOChannel(const HIODevice& IODeviceHandle, const HString& IOChannelName, const HTuple& GenParamName, const HTuple& GenParamValue)

void HIOChannel::HIOChannel(const HIODevice& IODeviceHandle, const char* IOChannelName, const HTuple& GenParamName, const HTuple& GenParamValue)

void HIOChannel::HIOChannel(const HIODevice& IODeviceHandle, const wchar_t* IOChannelName, const HTuple& GenParamName, const HTuple& GenParamValue)   ( Windows only)

static HIOChannelArray HIOChannel::OpenIoChannel(const HIODevice& IODeviceHandle, const HTuple& IOChannelName, const HTuple& GenParamName, const HTuple& GenParamValue)

void HIOChannel::OpenIoChannel(const HIODevice& IODeviceHandle, const HString& IOChannelName, const HTuple& GenParamName, const HTuple& GenParamValue)

void HIOChannel::OpenIoChannel(const HIODevice& IODeviceHandle, const char* IOChannelName, const HTuple& GenParamName, const HTuple& GenParamValue)

void HIOChannel::OpenIoChannel(const HIODevice& IODeviceHandle, const wchar_t* IOChannelName, const HTuple& GenParamName, const HTuple& GenParamValue)   ( Windows only)

static void HOperatorSet.OpenIoChannel(HTuple IODeviceHandle, HTuple IOChannelName, HTuple genParamName, HTuple genParamValue, out HTuple IOChannelHandle)

HIOChannel[] HIODevice.OpenIoChannel(HTuple IOChannelName, HTuple genParamName, HTuple genParamValue)

HIOChannel HIODevice.OpenIoChannel(string IOChannelName, HTuple genParamName, HTuple genParamValue)

public HIOChannel(HIODevice IODeviceHandle, string IOChannelName, HTuple genParamName, HTuple genParamValue)

static HIOChannel[] HIOChannel.OpenIoChannel(HIODevice IODeviceHandle, HTuple IOChannelName, HTuple genParamName, HTuple genParamValue)

void HIOChannel.OpenIoChannel(HIODevice IODeviceHandle, string IOChannelName, HTuple genParamName, HTuple genParamValue)

def open_io_channel(iodevice_handle: HHandle, iochannel_name: MaybeSequence[str], gen_param_name: Sequence[str], gen_param_value: Sequence[Union[int, float, str]]) -> Sequence[HHandle]

def open_io_channel_s(iodevice_handle: HHandle, iochannel_name: MaybeSequence[str], gen_param_name: Sequence[str], gen_param_value: Sequence[Union[int, float, str]]) -> HHandle

描述

算子 open_io_channelopen_io_channelOpenIoChannelOpenIoChannelOpenIoChannelopen_io_channel opens and configures transmission channels of an opened I/O device instance. The device instance must have been opened by open_io_deviceopen_io_deviceOpenIoDeviceOpenIoDeviceOpenIoDeviceopen_io_device before and is passed to IODeviceHandleIODeviceHandleIODeviceHandleIODeviceHandleIODeviceHandleiodevice_handle. The transmission channels themselves are addressed by their names passed to IOChannelNameIOChannelNameIOChannelNameIOChannelNameIOChannelNameiochannel_name. Available names can be queried using query_io_devicequery_io_deviceQueryIoDeviceQueryIoDeviceQueryIoDevicequery_io_device with query parameter 'io_channel_name'"io_channel_name""io_channel_name""io_channel_name""io_channel_name""io_channel_name". The channels can be configured by the parameters GenParamNameGenParamNameGenParamNameGenParamNamegenParamNamegen_param_name and GenParamValueGenParamValueGenParamValueGenParamValuegenParamValuegen_param_value. A reference to each transmission channel is returned in IOChannelHandleIOChannelHandleIOChannelHandleIOChannelHandleIOChannelHandleiochannel_handle. If the instance of the channel is not needed any more, it should be released and closed via the operator close_io_channelclose_io_channelCloseIoChannelCloseIoChannelCloseIoChannelclose_io_channel。Besides, it will be closed automatically when closing the associated device instance by close_io_deviceclose_io_deviceCloseIoDeviceCloseIoDeviceCloseIoDeviceclose_io_device

Having opened a transmission channel, values can be read and written by the operators read_io_channelread_io_channelReadIoChannelReadIoChannelReadIoChannelread_io_channel and write_io_channelwrite_io_channelWriteIoChannelWriteIoChannelWriteIoChannelwrite_io_channel on the channel.

An opened channel can be reconfigured by using the operators set_io_channel_paramset_io_channel_paramSetIoChannelParamSetIoChannelParamSetIoChannelParamset_io_channel_param and get_io_channel_paramget_io_channel_paramGetIoChannelParamGetIoChannelParamGetIoChannelParamget_io_channel_param

Please check the directory doc/html/reference/io for documentation about your specific I/O device interface, where all supported device specific parameters are listed.

执行信息

此算子返回一个句柄。请注意,即使该句柄被用作特定算子的输入参数,这些算子仍可能改变此句柄类型的实例状态。

参数

IODeviceHandleIODeviceHandleIODeviceHandleIODeviceHandleIODeviceHandleiodevice_handle (输入控制)  io_device HIODevice, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Handle of the opened I/O device.

IOChannelNameIOChannelNameIOChannelNameIOChannelNameIOChannelNameiochannel_name (输入控制)  string(-array) HTupleMaybeSequence[str]HTupleHtuple (string) (string) (HString) (char*)

HALCON I/O channel names of the specified device.

GenParamNameGenParamNameGenParamNameGenParamNamegenParamNamegen_param_name (输入控制)  string-array HTupleSequence[str]HTupleHtuple (string) (string) (HString) (char*)

Parameter names.

默认值: []

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

Parameter values.

默认值: []

IOChannelHandleIOChannelHandleIOChannelHandleIOChannelHandleIOChannelHandleiochannel_handle (输出控制)  io_channel(-array) HIOChannel, HTupleSequence[HHandle]HTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Handles of the opened I/O channel.

示例(HDevelop)

query_io_device (IODeviceHandle, [], 'io_channel_names.digital_output', \
                 ChannelOutputNames)
open_io_channel (IODeviceHandle, ChannelOutputNames[0], [], [], \
                 IOChannelHandle)
write_io_channel (IOChannelHandle, 1, Status)

结果

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

可能的前趋

open_io_deviceopen_io_deviceOpenIoDeviceOpenIoDeviceOpenIoDeviceopen_io_device, query_io_devicequery_io_deviceQueryIoDeviceQueryIoDeviceQueryIoDevicequery_io_device

可能的后继

set_io_channel_paramset_io_channel_paramSetIoChannelParamSetIoChannelParamSetIoChannelParamset_io_channel_param, read_io_channelread_io_channelReadIoChannelReadIoChannelReadIoChannelread_io_channel, write_io_channelwrite_io_channelWriteIoChannelWriteIoChannelWriteIoChannelwrite_io_channel

模块

基础