Professional Documents
Culture Documents
Function block
ANL_IL_SGI_2P_EF_3
Documentation for
PHOENIX CONTACT function blocks
PHOENIX CONTACT GmbH & Co. KG
Flachsmarktstraße 8
32825 Blomberg, Germany
ANL_IL_SGI_2P_EF_3_001.docx Page 1 of 24
ANL_IL_SGI_2P_EF_3
Table of contents
1 General information ........................................................................................................ 4
2 Block versions/Change notes ......................................................................................... 4
3 Releases ........................................................................................................................ 4
4 ANL_IL_SGI_2P_EF ...................................................................................................... 5
4.1 Block call ................................................................................................................. 5
4.2 Input parameters ..................................................................................................... 5
4.3 Output parameters .................................................................................................. 6
4.4 Input and output parameters ................................................................................... 6
4.5 Diagnostics ............................................................................................................. 6
5 ANL_IL_SGI_2P_EF_Para ............................................................................................. 8
5.1 Block call ................................................................................................................. 8
5.2 Input parameters ..................................................................................................... 9
5.3 Output parameters .................................................................................................. 9
5.4 Input and output parameters ................................................................................... 9
6 ANL_IL_SGI_2P_EF_Adju ............................................................................................10
6.1 Block description ....................................................................................................10
6.2 Block call ................................................................................................................10
6.3 Input parameters ....................................................................................................11
6.4 Output parameters .................................................................................................11
6.5 Input and output parameters ..................................................................................11
7 ANL_IL_SGI_2P_EF_Val ..............................................................................................12
7.1 Block description ....................................................................................................12
7.2 Block call ................................................................................................................12
7.3 Input parameters ....................................................................................................13
7.4 Output parameters .................................................................................................13
7.5 Input and output parameters ..................................................................................13
8 ANL_IL_SGI_2P_EF_DIDE ...........................................................................................14
8.1 Block description ....................................................................................................14
8.2 Block call ................................................................................................................14
8.3 Input parameters ....................................................................................................14
8.4 Output parameters .................................................................................................14
8.5 Input and output parameters ..................................................................................14
9 ANL_IL_SGI_2P_EF_DIEN ...........................................................................................15
9.1 Block description ....................................................................................................15
9.2 Block call ................................................................................................................15
ANL_IL_SGI_2P_EF_3_001.docx Page 2 of 24
ANL_IL_SGI_2P_EF_3
ANL_IL_SGI_2P_EF_3_001.docx Page 3 of 24
ANL_IL_SGI_2P_EF_3
1 General information
We recommend the ANL_IL_SGI_2P_EF (2702373) function block when using the IB IL SGI
2P EF module.
For easier handling, the following function blocks are available: ANL_IL_SGI_2P_EF_Para,
ANL_IL_SGI_2P_EF_Adju, ANL_IL_SGI_2P_EF_Val, ANL_IL_SGI_2P_EF_DIEN, and
ANL_IL_SGI_2P_EF_DIDE.
The ANL_IL_SGI_2P_EF_Para and ANL_IL_SGI_2P_EF_Adju function blocks are sufficient
to start up the IB IL SGI 2P EF module.
The ANL_IL_SGI_2P_EF_Val function block is for decoding the measurement data. The
ANL_IL_SGI_2P_EF_DIEN and ANL_IL_SGI_2P_EF_DIDE function blocks can be used for
decoding the error code of the ANL_IL_SGI_2P_EF block.
In addition, the Asyn_Com library is required for startup.
Block Description
ANL_IL_SGI_2P_EF Communication with the module
ANL_IL_SGI_2P_EF_Para Decoding of the configuration parameters of a channel
ANL_IL_SGI_2P_EF_Adju Calibration of a channel
ANL_IL_SGI_2P_EF_Val Decoding of the measurement data of a channel
ANL_IL_SGI_2P_EF_DIEN Output of error texts in English
ANL_IL_SGI_2P_EF_DIDE Output of error texts in German
Version Description
1 Initial version
2 ANL_IL_SGI_2P_EF_2: Bug fix for
In some cases xActive = TRUE after xActivate = FALSE.
Sporadic RDREC error.
Corrections and improvement of the documentation.
ANL_IL_SGI_2P_EF_VAL_2: Bug fix for
xError = FALSE when bSelect = 0 (invalid).
rVal = 0 while process data contain valid values.
3 ANL_IL_SGI_2P_EF_3: Bug fix
ANL_IL_SGI_2P_EF_DIDE/DIEN_2:
Add new DiagCodes
3 Releases
These versions of function blocks do not require any licence.
These versions of function blocks are approved for all controller types.
ANL_IL_SGI_2P_EF_3_001.docx Page 4 of 24
ANL_IL_SGI_2P_EF_3
4 ANL_IL_SGI_2P_EF
This function block is for parameterization and communication with the IB IL SGI 2P EF
module.
ANL_IL_SGI_2P_EF_3_001.docx Page 5 of 24
ANL_IL_SGI_2P_EF_3
4.5 Diagnostics
ANL_IL_SGI_2P_EF_3_001.docx Page 6 of 24
ANL_IL_SGI_2P_EF_3
16#0000.0100 Channel 1
16#0000.0200 Channel 2
16#0000.0100 Channel 1
16#0000.0200 Channel 2
16#0000.0100 Channel 1
16#0000.0200 Channel 2
ANL_IL_SGI_2P_EF_3_001.docx Page 7 of 24
ANL_IL_SGI_2P_EF_3
5 ANL_IL_SGI_2P_EF_Para
This function block parameterizes the main block. The input parameters, iFilter,
iCharacteristic, rNominalWeight, rAdjustValue and iConversionTime, of a channel are
transferred to the main block via the structure. The channel to be parameterized by the block
is selected via the bSelect input.
ANL_IL_SGI_2P_EF_3_001.docx Page 8 of 24
ANL_IL_SGI_2P_EF_3
ANL_IL_SGI_2P_EF_3_001.docx Page 9 of 24
ANL_IL_SGI_2P_EF_3
6 ANL_IL_SGI_2P_EF_Adju
6.1 Block description
ANL_IL_SGI_2P_EF_3_001.docx Page 10 of 24
ANL_IL_SGI_2P_EF_3
ANL_IL_SGI_2P_EF_3_001.docx Page 11 of 24
ANL_IL_SGI_2P_EF_3
7 ANL_IL_SGI_2P_EF_Val
7.1 Block description
This auxiliary block decrypts the data structure udtSGI_Data of the main block, and outputs
data like firmware version, measured values, min/max values, as well as display values.
The block also outputs some status information on the terminal.
This function block has to be instantiated separately for each channel.
ANL_IL_SGI_2P_EF_3_001.docx Page 12 of 24
ANL_IL_SGI_2P_EF_3
ANL_IL_SGI_2P_EF_3_001.docx Page 13 of 24
ANL_IL_SGI_2P_EF_3
8 ANL_IL_SGI_2P_EF_DIDE
8.1 Block description
In the event of an error at the main block, the block displays the diagnostics as text in
German. The source code is neither read- nor write-protected, and can be adapted by the
user to individual requirements. In this way, diagnostic messages can be changed,
expanded, or translated into a different language. The text output of the outputs strDiagInfo
and strAddDiagInfo is limited to 80 characters respectively.
ANL_IL_SGI_2P_EF_3_001.docx Page 14 of 24
ANL_IL_SGI_2P_EF_3
9 ANL_IL_SGI_2P_EF_DIEN
9.1 Block description
In the event of an error at the main block, the block displays the diagnostics as text in
English. The source code is neither read- nor write-protected, and can be adapted by the
user to individual requirements. In this way, diagnostic messages can be changed,
expanded, or translated into a different language. The text output of the outputs strDiagInfo
and strAddDiagInfo is limited to 80 characters respectively.
ANL_IL_SGI_2P_EF_3_001.docx Page 15 of 24
ANL_IL_SGI_2P_EF_3
10 Startup instruction
10.1 INTERBUS
ANL_IL_SGI_2P_EF_3_001.docx Page 16 of 24
ANL_IL_SGI_2P_EF_3
ANL_IL_SGI_2P_EF_3_001.docx Page 17 of 24
ANL_IL_SGI_2P_EF_3
When using the IL_SGI_2P_EF_1 function block in an application under INTERBUS, the
AsynCom_ISB function block is also required for communication via PCP. The
communication between the two blocks takes place via the udtAsynCom structure.
The communication between the other blocks takes place via the udtSGI_Data structure.
The IN process data of the terminal is connected to the arrInputPD input. The OUT process
data is connected to the arrOutputPD output.
The ANL_IL_SGI_2P_EF_Para has always to stand on the top of the processing sequence.
The channels to be parameterized or read out, are specified via the bSelect inputs at the
function blocks.
ANL_IL_SGI_2P_EF_3_001.docx Page 18 of 24
ANL_IL_SGI_2P_EF_3
10.2 PROFINET
ANL_IL_SGI_2P_EF_3_001.docx Page 19 of 24
ANL_IL_SGI_2P_EF_3
ANL_IL_SGI_2P_EF_3_001.docx Page 20 of 24
ANL_IL_SGI_2P_EF_3
When using the IL_SGI_2P_EF_1 function block in an application under INTERBUS, the
AsynCom_ISB function block is also required for communication via PCP. The
communication between the two blocks takes place via the udtAsynCom structure.
The communication between the other blocks takes place via the udtSGI_Data structure.
The IN process data of the terminal is connected to the arrInputPD input. The OUT process
data is connected to the arrOutputPD output.
The ANL_IL_SGI_2P_EF_Para has always to stand on the top of the processing sequence.
The channels to be parameterized or read out, are specified via the bSelect inputs at the
function blocks.
ANL_IL_SGI_2P_EF_3_001.docx Page 21 of 24
ANL_IL_SGI_2P_EF_3
11 Appendix
11.1 Data types
TYPE
(*Processdata*)
ANL_ARR_SGI_PD : ARRAY[0..2] OF WORD;
(*ANL_IL_SGI_2P_EF_Adju*)
ANL_UDT_SGI_ADJUST : STRUCT
(*Inputs*)
xAdjust : BOOL;
xSetZeroPoint : BOOL;
xTara : BOOL;
xKa_Kb : BOOL;
wKa_Kb : WORD;
wKa_Kb_Up : WORD;
wKa_Kb_Dn : WORD;
END_STRUCT;
(*ANL_IL_SGI_2P_EF_Para*)
ANL_UDT_SGI_PARA : STRUCT
(*Inputs*)
iFilter : INT;
iCharacteristic : INT;
rNominalWeight : REAL;
iConversionTime : INT;
rAdjustValue : REAL;
wAdjustValue : WORD;
wNominalWeight : WORD;
END_STRUCT;
(*ANL_IL_SGI_2P_EF_Val*)
ANL_UDT_SGI_VALUE : STRUCT
(*Outputs*)
rVal : REAL;
xValid : BOOL;
ANL_IL_SGI_2P_EF_3_001.docx Page 22 of 24
ANL_IL_SGI_2P_EF_3
rMinVal : REAL;
rMaxVal : REAL;
arrFloatValue : SGI_2P_PN_ARR_B_1_4;
arrDisplayValue : SGI_2P_PN_ARR_B_1_4;
xStandstill : BOOL;
xZeroPoint : BOOL;
xNettoValue : BOOL;
xDefault : BOOL;
END_STRUCT;
(*Diag struct*)
ANL_UDT_SGI_DIAG : STRUCT
wDiagCode : WORD;
dwAddDiagCode : DWORD;
END_STRUCT;
(*Array of channels*)
ANL_ARR_SGI_CHANNELS : ARRAY[1..2] OF ANL_UDT_SGI_CHANNEL;
ANL_UDT_SGI_2P_EF : STRUCT
iState : INT; (*actual State of the
statemachine*)
ANL_IL_SGI_2P_EF_3_001.docx Page 23 of 24
ANL_IL_SGI_2P_EF_3
END_TYPE
ANL_IL_SGI_2P_EF_3_001.docx Page 24 of 24