binaryiotypea

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package binaryiotypea provides the API for the io4edge binaryIoTypeA 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 binaryIoTypeA Module

func NewClientFromUniversalAddress

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

NewClientFromUniversalAddress creates a new binaryIoTypeA 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_binaryIoTypeA._tcp). The timeout specifies the maximal time waiting for a service to show up. 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 level is below switching threshold, true otherwise. Channels whose bit is cleared in mask are reported as 0

func (*Client) Describe

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

Describe reads the binaryIoTypeA function block description

func (*Client) DownloadConfiguration

func (c *Client) DownloadConfiguration() (*Configuration, error)

DownloadConfiguration reads the binaryIoTypeA function block configuration

func (*Client) ExitErrorState

func (c *Client) ExitErrorState() error

ExitErrorState tries to recover the binary output controller from error state.

The binary output controller enters error state when there is an overurrent condition for a long time.

In the error state, no outputs can be set; inputs can still be read. This call tells the binary output controller to try again. This call does however not wait if the recovery was successful or not.

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 level is below switching threshold, true otherwise

func (*Client) ReadStream

func (c *Client) ReadStream(timeout time.Duration) (*StreamData, error)

ReadStream reads the next stream data object from the buffer.

Returns the meta data and the unmarshalled function specific stream data

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 switch off, 1 means switch on, 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" state turns on the output switch

func (*Client) StartStream

func (c *Client) StartStream(genericConfig *functionblock.StreamConfiguration, channelFilterMask uint8) error

StartStream starts the stream on this connection.

channelFilterMask defines the watched channels. Only changes on those channels generate samples in the stream

func (*Client) StopStream

func (c *Client) StopStream() error

StopStream stops the stream on this connection

func (*Client) UploadConfiguration

func (c *Client) UploadConfiguration(config *Configuration) error

UploadConfiguration configures the binaryIoTypeA function block

type Configuration

type Configuration struct {
	OutputFrittingMask    uint8
	OutputWatchdogMask    uint8
	OutputWatchdogTimeout uint32
}

Configuration represents the configuration parameters of the binaryIoTypeA function

type Description

type Description struct {
	NumberOfChannels int
}

Description represents the describe response of the binaryIoTypeA function

type StreamData

type StreamData struct {
	functionblock.StreamDataMeta
	FSData *fspb.StreamData
}

StreamData contains the meta data of the stream and the unmarshalled function specific data

Jump to

Keyboard shortcuts

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