Table of Contents

ResistorBridgeEL3356

Implements
FUNCTION_BLOCK ResistorBridgeEL3356 IMPLEMENTS ZEquipmentBeckhoff.IResistorBridgeEL3356, ZCore.IObject, ZEquipment.IAnalog, ZCore.IError, ZEquipment.IDigital, ZCore.ITrigger

Constructor

FB_init

METHOD FB_init (
 [input] bInitRetains : BOOL,
 [input] bInCopyCode : BOOL,
 [input] parent : ZCore.IManagedObject,
 [input] ethercatSlave : ZCore.IEthercatSlave,
 [input] feedback : ZEquipment.IAnalog) : BOOL

Inputs

bInitRetains BOOL

if TRUE, the retain variables are initialized (warm start / cold start)

bInCopyCode BOOL

if TRUE, the instance afterwards gets moved into the copy code (online change)

parent IManagedObject

Interface to the ManagedObject that is the parent of this object

ethercatSlave IEthercatSlave
feedback IAnalog

Interface to the IAnalog that is used as the actual value signal for the controller

Returns

BOOL

Properties

Busy

PROPERTY Busy : BOOL

This property returns TRUE if the object is busy executing a sequence or still in its initialization phase (if applicable). It returns FALSE if the object is idle or in an error state.

Property Value

BOOL

DecimalPlaces

PROPERTY DecimalPlaces : INT

Property Value

INT

Done

PROPERTY Done : BOOL

This property returns TRUE if a sequence was executate without any error and the object is in its idle state.

Property Value

BOOL

Enabled

PROPERTY Enabled : BOOL

see SetDigitalThreshold and Enabled.

Property Value

BOOL

Error

PROPERTY Error : BOOL

This property returns TRUE if a fault occured within a sequence or the initialization phase of an object, respectively. If this property returns TRUE, one of the errorMessage methods give insight about the origin of the fault.

It is also possible to distinguish between initialization errors and sequence errors by checking the exact, internal state of the object using the state method.

Property Value

BOOL

Simulation

PROPERTY Simulation : BOOL

This method is abstract. See documentation of an actual instance (e.g. AnalogInputUint)

Property Value

BOOL

Value

PROPERTY Value : LREAL

Property Value

LREAL

ValueUnit

PROPERTY ValueUnit : STRING(20)

Physical unit of the analog value (i.e. bar, degree celsius, mm)

Property Value

STRING(20)

Methods

ChangeFilterAsync

METHOD ChangeFilterAsync (
 [input] startToken : ZCore.IStartToken,
 [input] filter : ResistorBridgeEL3356Filter)

Inputs

startToken IStartToken
filter ResistorBridgeEL3356Filter

Enable

METHOD Enable (
 [input] on : BOOL)

see SetDigitalThreshold and Enable.

Inputs

on BOOL

EnableSelfCalibrationAsync

METHOD EnableSelfCalibrationAsync (
 [input] startToken : ZCore.IStartToken,
 [input] on : BOOL)

Inputs

startToken IStartToken
on BOOL

ErrorId

METHOD ErrorId () : UDINT

Returns the error code of the first error source for this object. The method recursively goes down the error stack until the initial source of error of this object can be found. For performance reasons, the error stack is not cleared when the error state is reset. So this method should always used in conjunction with Error.

Returns

UDINT

ErrorMessage

METHOD ErrorMessage () : ZCore.ZString

Returns the error description of the first error source for this object. The method recursively goes down the error stack until the initial source of error of this object can be found. For performance reasons, the error stack is not cleared when the error state is reset. So this method should always used in conjunction with Error.

Returns

ZString

ErrorSource

METHOD ErrorSource () : ZCore.IError

this method returns the direct error source of this object. This method can then be used to retrieve the actual error source by using the method of the returned IError.

Returns

IError

FallingTrigger

METHOD FallingTrigger () : BOOL

see SetDigitalThreshold and FallingTrigger.

Returns

BOOL

HasTriggered

METHOD HasTriggered () : BOOL

Returns

BOOL

Invert

METHOD Invert ()

see SetDigitalThreshold and Invert.

Name

METHOD FINAL Name () : ZCore.ZString

this method return the name that has been set with SetName

Returns

ZString

Read

METHOD Read () : LREAL

This method is abstract. See documentation of an actual instance (e.g. AnalogInputUint)

Returns

LREAL

ReferenceAsync

METHOD ReferenceAsync (
 [input] startToken : ZCore.IStartToken)

Inputs

startToken IStartToken

Resolution

METHOD Resolution () : LREAL

returns the smallest possible physical increment with a given terminal resolution and conversion function, see UpdateResolution.

Returns

LREAL

RisingTrigger

METHOD RisingTrigger () : BOOL

see SetDigitalThreshold and RisingTrigger.

Returns

BOOL

SetConversionLinear

METHOD SetConversionLinear (
 [input] slope : LREAL,
 [input] intercept : LREAL,
 [input] valueUnit : STRING(20))

This method is used to convert the values of an actual terminal (e.g. EL3102). to a phyiscal unit that may be used within the context of an application. Terminals usually provide startup parameters to perform data conversion on the hardware. However, in Zeugwerk Framework we prefer to convert these values on the PLC since this is much more flexible than relying on SDO parameters.

Values that are read and written to a terminal are internally normalized before applying any conversions on them. Terminals that use unsigned datatypes are normalized between [0,1] and terminals with signed datatypes are normalized between [-1,1] before applying the linear transformation that is set with this method to it. This makes it rather easy to specify linear conversion functions that are independent of the terminal resolution and the internal datatype that is used by a terminal.

For instance, a terminal that can measure 0V..10V with 16bit resolution, uses INT as datatype, such that the terminals values are in the interval [0, 65535].

Inputs

slope LREAL
intercept LREAL
valueUnit STRING(20)

SetConversionScaling

METHOD SetConversionScaling (
 [input] scale : LREAL,
 [input] offset : LREAL,
 [input] physicalUnit : STRING(20))

This method is used to convert the values of an actual terminal (e.g. EL3102). to a phyiscal unit that may be used within the context of an application. Terminals usually provide startup parameters to perform data conversion on the hardware. However, in Zeugwerk Framework we prefer to convert these values on the PLC since this is much more flexible than relying on SDO parameters.

In contrast to SetConversionLinear, this method performs a simple scaling of the terminal value. For example if you have a Temperature Analog-input terminal which directly provides a temperature in 0.1 degree Celsius, the scaling has to be set to 0.1 to get degrees Celsius

Inputs

scale LREAL

scale as multiplier to the delivered value; e.g. a temperature terminal returns 10 which is 1 degree Celsius so we need to set 0.1 as multiplier to get Celsius

offset LREAL

offset which defines the value when the terminal transmits zero

physicalUnit STRING(20)

physical Unit, e.g. 'bar', 'mm', '°C'

SetDigitalThreshold

METHOD SetDigitalThreshold (
 [input] threshold : LREAL)

An analog I/O can be treated as a digital I/O by defining a threshold for on/off. For values above and below this threshold the IsEnabled and Enabled (and other methods coming from IDigital will behave the same as a Digital I/O, including Logic.

The parameter of this method is given in physical value of the terminal (see SetLinearConversion). Per default digital threshold is set to 0 in physical units and the Logic is set to (DigitalLogic.Normal)[xref:ZEquipment.DigitalLogic#Normal], where values above the threshold mean on and values below or equal mean off.

Inputs

threshold LREAL

threshold for on/off in physical units, defaults to 0

SetLogger

METHOD SetLogger (
 [input] logger : ZCore.ILogger)

Using this method a logger may be supplied to the object in order to log read and write access to the terminal. Logging can be disabled by passing a 0 pointer to the method. TODO: parameter for logging threshold???

Inputs

logger ILogger

SetLogic

METHOD SetLogic (
 [input] logic : ZEquipment.DigitalLogic)

This method is used to set the logic of the analog I/O in case the IDigital is utilized via (setDigitalThreshold)[xref:ZEquipment.IAnalog]. By default, the analog I/O is using normal logic, which means that values about the digital threshold are treated as on, while values below or equal this threshold are treated as off.

Inputs

logic DigitalLogic

SetName

METHOD SetName (
 [input] name : ZCore.ZString)

This method can be used to give a name to this object. This is automatically used for logging (if enabled, see SetLogger). Also, this name is used with using this instance together with an IoBridge to make it available on a HMI.

Inputs

name ZString

SetTriggerLogic

METHOD SetTriggerLogic (
 [input] logic : ZEquipment.DigitalLogic)

Inputs

logic DigitalLogic

TaraAsync

METHOD TaraAsync (
 [input] startToken : ZCore.IStartToken)

Inputs

startToken IStartToken

TraceErrorStack

METHOD TraceErrorStack (
 [input] trace : ZCore.IErrorTrace)

This method is used internally when recording an error trace.

Inputs

trace IErrorTrace

Write

METHOD Write (
 [input] value : LREAL)

This method is abstract. See documentation of an actual instance (e.g. AnalogInputUint)

Inputs

value LREAL

WriteCalibrationValuesAsync

METHOD WriteCalibrationValuesAsync (
 [input] startToken : ZCore.IStartToken,
 [input] referenceLoad : LREAL,
 [input] nominalLoad : LREAL)

Inputs

startToken IStartToken
referenceLoad LREAL

in arbitrary units (e.g. g)

nominalLoad LREAL

in arbitrary units (e.g. g)

WriteCharacteristicsAsync

METHOD WriteCharacteristicsAsync (
 [input] startToken : ZCore.IStartToken,
 [input] referenceLoad : LREAL,
 [input] nominalLoad : LREAL,
 [input] ratedOutput : LREAL,
 [input] zeroBalance : LREAL)

Inputs

startToken IStartToken
referenceLoad LREAL

in arbitrary units (e.g. g)

nominalLoad LREAL

in arbitrary units (e.g. g)

ratedOutput LREAL

in mV/V

zeroBalance LREAL

in mV/V

ZeroBalanceAsync

METHOD ZeroBalanceAsync (
 [input] startToken : ZCore.IStartToken)

Inputs

startToken IStartToken