IOL_MeasurementDataChannel

IOL_MeasurementDataChannel 1:

The measuring data channel defines the process data structure, functions, and presentation of measuring sensors. The function block is defined to provide derived status signals and enable a standardized interface for user programs.

IOL_MeasurementDataChannel 2:Inputs

Name

Type

Description

Enable

BOOL

Activates the use of the function block

ProfileID

WORD

Selected ProfileID, or process data layout
1 = SSP 3.1 = profile 0x000A
2 = SSP 3.2 = profile 0x000B
3 = SSP 3.3 = profile 0x000C
4 = SSP 3.4 = profile 0x000D

SubstituteValue

DINT

The specified value is applied to ValueReal and ValueDINT if ValueStatus is not 0.

ChannelState

E_IolPortState

 

ScaleIN

SINT

Scale of the IO-Link device

ProcessData

ANY_INT

Measured value

IOL_MeasurementDataChannel 3:Outputs

Name

Type

Description

Valid

BOOL

If true, the supplied values are valid and can be used for further calculations.

Error

BOOL

If true, an internal error is detected and further information is provided by the function block.

ValueStatus

E_IoLMDC_ValueStatus

Provides error codes

ValueReal

LREAL

Process data in real format for evaluation in the PLC

ValueINT

DINT

Process data in Dint format for evaluation in the PLC

Scale

INT

Process data scaling factor

Example

The following function block is part of the IoLink sample project. For more information, see the chapter Samples.

FUNCTION_BLOCK FB_Sample_07_MeasurementDataChannel
VAR_INPUT
  nStateChannel    AT%I*:USINT;
  nScale           AT%I*:SINT;
  MVDistance       AT%I*:INT;
END_VAR
VAR_OUTPUT
  bValid          :BOOL;
  bError          :BOOL;
  nValueStatus    :E_IolMdc_ValueStatus;
  nValueDINT      :DINT;
  nValueREAL      :REAL;
  nScaleOut       :INT;
END_VAR
VAR
  fbMeasurement:IOL_MeasurementDataChannel_INT;
END_VAR
fbMeasurement(
  Enable := TRUE,
  SubstituteValue := 500,
  ChannelState := nStateChannel,
  ScaleIn := nScale , 
  MeasurementValue := MVDistance,
  Valid=>bValid,
  Error=>bError,
  ValueStatus=>nValueStatus,
  ValueReal=>nValueREAL,
  ValueDINT=>nValueDINT 
  Scale=>nScaleOut );

Requirements

Development environment

Required PLC library

TwinCAT from v3.1.4024.25

Tc3_IoLink from v3.3.4.0