binaryiotypeb

package
v1.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package binaryiotypeb provides the API for the io4edge binaryIoTypeB functionblock

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client represents a client for the binaryIoTypeB Module

func NewClientFromUniversalAddress

func NewClientFromUniversalAddress(addrOrService string, timeout time.Duration) (*Client, error)

NewClientFromUniversalAddress creates a new binaryIoTypeB client from addrOrService. If addrOrService is of the form "host:port", it creates the client from that host/port, otherwise it assumes addrOrService is the instance name of a mdns service (without _io4edge_binaryIoTypeB._tcp). The timeout specifies the maximal time waiting for a service to show up. If 0, use default timeout. Not used for "host:port"

func (*Client) AllInputs

func (c *Client) AllInputs(mask uint8) (uint8, error)

AllInputs reads the state of all input pins defined by mask.

Each bit in the returned value corresponds to one channel, bit0 being channel 0. The bit is false if the input channel is inactive, true if the input channel is active Channels whose bit is cleared in mask are reported as 0

func (*Client) Close

func (c *Client) Close()

Close terminates the underlying connection to the functionblock

func (*Client) Describe

func (c *Client) Describe() (*Description, error)

Describe reads the binaryIoTypeB function block description

func (*Client) Input

func (c *Client) Input(channel int) (bool, error)

Input reads the state of the input pin of a single channel.

The returned value is false if the input channel is inactive, true if the input channel is active

func (*Client) SetAllOutputs

func (c *Client) SetAllOutputs(states uint8, mask uint8) error

SetAllOutputs sets all or a group of output channels

states: binary coded map of outputs. 0 means deactivate output channel, 1 means activate output channel, LSB is Output0

mask: defines which channels are affected by the set all command.

func (*Client) SetOutput

func (c *Client) SetOutput(channel int, state bool) error

SetOutput sets a single output channel a true activates the output

type Description

type Description struct {
	Channels []*fspb.ChannelConfig
}

Description represents the describe response of the binaryIoTypeB function

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL