Table of Contents

Class IOMasterExtensions

Namespace
Loehnert.Lisrt.IO.Beckhoff
Assembly
Loehnert.Lisrt.IO.Beckhoff.dll

This class contains utility functions for IIOMaster implementations.

public static class IOMasterExtensions
Inheritance
IOMasterExtensions
Inherited Members

Methods

AddDigitalInputsTerminal<TTerminal>(IIOMaster, TTerminal, string, params string[])

Adds a terminal to the master and sets its name and the names of the inputs.

public static TTerminal AddDigitalInputsTerminal<TTerminal>(this IIOMaster master, TTerminal terminal, string name, params string[] inputNames) where TTerminal : IDigitalInputsTerminal, ITerminal

Parameters

master IIOMaster

Master to add the terminal.

terminal TTerminal

Terminal to add.

name string

Name of the terminal.

inputNames string[]

Names of the inputs.

Returns

TTerminal

The terminal.

Type Parameters

TTerminal

Type of the terminal.

Examples

Use this method to simplify adding digital input terminals to the master.

var term1 = master.AddDigitalInputsTerminal(new EL1809(), "10K11", "InBasePosition", "ControlIsOn");

This is equivalent to:

var term1 = new EL1809();
term1.Name = "10K11";
term1.Inputs[0] = "InBasePosition";
term1.Inputs[1] = "ControlIsOn";
master.Add(term1);

Exceptions

ArgumentNullException

Thrown when master, terminal or inputNames is null.

ArgumentException

Thrown when the length of inputNames is greater than count of Inputs.

AddDigitalOutputsTerminal<TTerminal>(IIOMaster, TTerminal, string, params string[])

Adds a terminal to the master and sets its name and the names of the outputs.

public static TTerminal AddDigitalOutputsTerminal<TTerminal>(this IIOMaster master, TTerminal terminal, string name, params string[] outputNames) where TTerminal : IDigitalOutputsTerminal, ITerminal

Parameters

master IIOMaster

Master to add the terminal.

terminal TTerminal

Terminal to add.

name string

Name of the terminal.

outputNames string[]

Names of the outputs.

Returns

TTerminal

The terminal.

Type Parameters

TTerminal

Type of the terminal.

Exceptions

ArgumentNullException

Thrown when master, terminal or outputNames is null.

ArgumentException

Thrown when the length of outputNames is greater than count of Outputs.

AddTerminal<TTerminal>(IIOMaster, TTerminal, string)

Adds a terminal to the master and sets its name.

public static TTerminal AddTerminal<TTerminal>(this IIOMaster master, TTerminal terminal, string name) where TTerminal : ITerminal

Parameters

master IIOMaster

Master to add the terminal.

terminal TTerminal

Name to add.

name string

Name of the terminal.

Returns

TTerminal

The terminal.

Type Parameters

TTerminal

Type of the terminal.

Examples

Use this method to simplify adding terminals to the master.

var term1 = master.AddTerminal(new EL1809(), "10K11");

This is equivalent to:

var term1 = new EL1809();
term1.Name = "10K11";
master.Add(term1);

Exceptions

ArgumentNullException

Thrown when master or terminal is null.