s7comm_plugin

package
v0.0.0-...-f7d9d65 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var S7CommConfigSpec = service.NewConfigSpec().
	Summary("Creates an input that reads data from Siemens S7 PLCs. Created & maintained by the United Manufacturing Hub. About us: www.umh.app").
	Description("This input plugin enables Benthos to read data directly from Siemens S7 PLCs using the S7comm protocol. " +
		"Configure the plugin by specifying the PLC's IP address, rack and slot numbers, and the data blocks to read.").
	Field(service.NewStringField("tcpDevice").Description("IP address of the S7 PLC.")).
	Field(service.NewIntField("rack").Description("Rack number of the PLC. Identifies the physical location of the CPU within the PLC rack.").Default(0)).
	Field(service.NewIntField("slot").Description("Slot number of the PLC. Identifies the CPU slot within the rack.").Default(1)).
	Field(service.NewIntField("batchMaxSize").Description("Maximum count of addresses to be bundled in one batch-request (PDU size).").Default(480)).
	Field(service.NewIntField("timeout").Description("The timeout duration in seconds for connection attempts and read requests.").Default(10)).
	Field(service.NewStringListField("subscriptions").Description("List of S7 addresses to read in the format '<area>.<type><address>[.extra]', e.g., 'DB5.X3.2', 'DB5.B3', or 'DB5.C3'. " +
		"Address formats include direct area access (e.g., DB1 for data block one) and data types (e.g., X for bit, B for byte)."))

S7CommConfigSpec defines the configuration options available for the S7CommInput plugin. It outlines the required information to establish a connection with the PLC and the data to be read.

Functions

func ParseSubscriptionDef

func ParseSubscriptionDef(subscription []string, batchMaxSize int) ([]subscriptionD, [][]S7DataItemWithAddressAndConverter, error)

Types

type S7CommInput

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

S7CommInput struct defines the structure for our custom Benthos input plugin. It holds the configuration necessary to establish a connection with a Siemens S7 PLC, along with the read requests to fetch data from the PLC.

func (*S7CommInput) Close

func (g *S7CommInput) Close(ctx context.Context) error

func (*S7CommInput) Connect

func (g *S7CommInput) Connect(ctx context.Context) error

func (*S7CommInput) ReadBatch

type S7DataItemWithAddressAndConverter

type S7DataItemWithAddressAndConverter struct {
	Address       string
	ConverterFunc converterFunc
	Item          gos7.S7DataItem
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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