Siemens Simatic SM331 Getting Started page 56

Ai 8x12 bit
Hide thumbs Also See for Simatic SM331:
Table of Contents

Advertisement

SE_3 := 0.000000e+000;
END_DATA_BLOCK
FUNCTION FC 1 : VOID
TITLE = Conversion of a channel's raw values
VERSION : 1.0
VAR_INPUT
Raw : WORD ;
// Analog value display
END_VAR
VAR_OUTPUT
Current : REAL ;
END_VAR
VAR_TEMP
TDoubleInt : DINT ;
TInt : INT ;
END_VAR
BEGIN
NETWORK
TITLE = Conversion of raw values in mA
L
#Raw;
T
#TInt;
// Only long integers can be converted into REAL format
L
#TInt;
ITD
;
T
#TDoubleInt;
L
#TDoubleInt; //
DTR
;
T
#Current;
L
1.728000e+003; //
/R
;
T
#Current;
L
4.000000e+000;
+R
;
T
#Current;
END_FUNCTION
54
// Current in mA
HEX value
//
Current = --------------------
//
!
//
!
//
!
/
//
+-----/-----------+----
//
4
// Offset adjustment
Getting Started SM331 AI 8x12bit Part1: 4-20mA
1728
/
/
20
A5E00253410

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents