IOL_MeasurementDataChannel

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.
Inputs
Name | Type | Description |
---|---|---|
Enable | BOOL | Activates the use of the function block |
ProfileID | WORD | Selected ProfileID, or process data layout |
SubstituteValue | DINT | The specified value is applied to ValueReal and ValueDINT if ValueStatus is not 0. |
ChannelState |
| |
ScaleIN | SINT | Scale of the IO-Link device |
ProcessData | ANY_INT | Measured value |
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 | 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 |