AnalogTechnology 9
AnalogTechnology 9
AnalogTechnology_9
for PC Worx 6
Documentation for
PHOENIX CONTACT function blocks
PHOENIX CONTACT GmbH Co. KG
Flachsmarktstrasse 8
D-32825 Blomberg, Germany
This documentation is available in English only.
AnalogTechnology_9 2/149
Table of Contents
1 Installation hint
2 General information
3 Change notes
4 Supported PLCs
5 Function blocks
6 AI_NORM
6.1 Function block call
6.2 Input parameters
6.3 Output parameters
6.4 Diagnosis
6.5 Module types
7 AO_NORM
7.1 Function block call
7.2 Input parameters
7.3 Output parameters
7.4 Diagnosis
7.5 Module types
8 IL_AI_2_SF
8.1 Function block call
8.2 Input parameters
8.3 Output parameters
8.4 Diagnosis
9 IL_AI_4_EF
9.1 Function block call
9.2 Input parameters
9.3 Output parameters
9.4 Diagnosis
9.5 Appendix
10 IL_AI_4_UI
10.1 IL_AI_4_UI_Para
10.2 IL_AI_4_UI_Com
10.3 IL_AI_4_UI_Diag
10.4 Appendix
11 IL_AI_8
11.1 Operating modes
11.2 Function block call
11.3 Input parameters
11.4 Output parameters
11.5 Block parameters
11.6 Diagnosis
11.7 Appendix
12 IL_AO_1_SF
12.1 Function block call
AnalogTechnology_9 3/149
1 Installation hint
Please copy the library data to your PC Worx 6 working library directory.
If you did not specify a different directory during PC Worx 6 installation the default PC Worx 6 working library
directory is
C:\Users\Public\Documents\PC WORX\Libraries
2 General information
The AnalogTechnology library offers function blocks for acquisition and evaluation of analog signals.
AnalogTechnology_9 6/149
3 Change notes
Library Library PC Worx Change notes Supported
version build version PLCs
9 20220118 6.30.2972 Revised documentation Refer to
Revised all examples “Supported
Added ANL_*_EXA_IL_AI_4_UI_U.zwt example PLCs”
8 20210112 6.30.2907 "
AI_Norm:
Added ANL_8_EXA_AI_Norm.zwt example
AO_Norm:
Added ANL_8_EXA_AO_Norm.zwt example
IL_AI_4_UI:
Added ANL_8_EXA_IL_AI_4_UI_I.zwt example
IL_AO_2_UI:
Added ANL_8_EXA_IL_AO_2_UI.zwt example
IL_AI_8:
Added ANL_8_EXA_IL_AI_8.zwt example
IL_AO4_8:
Added ANL_8_EXA_IL_AO4_8.zwt example
IL_AO_1_SF:
Added ANL_8_EXA_IL_AO_1_SF.zwt example
ANL_IL_SGI_2P_EF:
Added ANL_8_EXA_IL_SGI_2P_EF.zwt example
Added ANL_8_EXA_IL_SGI_2P_EF_PN.zwt
example
Documentation improved
Added new functions: xResetTara and xAdjust2
Bug fixes
ANL_IL_SGI_2P_EF_Para: New input rAdjust2
ANL_IL_SGI_2P_EF_Adju: New inputs xAdjust2 and
xResetTara
ANL_IL_SGI_2P_EF_DiagInfo_EN/DE: Added new
DiagCodes
7 20201027 6.30.2907 IL_AO4_8: Documentation error fixed. Wrong module was "
specified.
7 20200512 6.30.2907 IL_AI_4_EF: Added ANL_7_EXA_IL_AI_4_EF.zwt example "
and adapted documentation.
7 20200324 6.30.2519 Documentation improved "
AnalogTechnology_9 7/149
4 Supported PLCs
AXC 1050 (2700988)
AXC 1050 XC (2701295)
AXC 3050 (2700989)
ILC 130 ETH (2988803)
ILC 131 ETH (2700973)
ILC 131 ETH/XC (2701034)
ILC 150 ETH (2985330)
ILC 151 ETH (2700974)
ILC 151 GSM/GPRS (2700977)
ILC 170 ETH 2TX (2916532)
ILC 171 ETH 2TX (2700975)
ILC 190 ETH 2TX (2700527)
ILC 191 ETH 2TX (2700976)
ILC 191 ME/AN (2700074)
ILC 191 ME/INC (2700075)
ILC 330 ETH (2737193)
ILC 330 PN (2988191)
ILC 350 ETH (2737203)
ILC 350 ETH/M (2985819)
ILC 350 PN (2876928)
ILC 370 ETH 2TX-IB (2876999)
ILC 370 PN 2TX-IB (2876915)
ILC 370 PN 2TX-IB/M (2985576)
ILC 390 PN 2TX-IB (2985314)
RFC 430 ETH-IB (2730190)
RFC 450 ETH-IB (2730200)
RFC 470S PN 3TX (2916794)
RFC 470 PN 3TX (2916600)
RFC 480S PN 4TX (2404577)
AnalogTechnology_9 10/149
5 Function blocks
Function block Description Version Supported License
articles
ANL_IL_SGI_2P_EF Function block for evaluating and parameterizing 5 IB IL SGI none
the IB IL SGI 2/P/EF-PAC (2702373) module for 2/P/EF-PAC
load cells and force tranducers. (2702373)
AI_NORM Function block for standardization of analog input 1.03 IBS RT 24 none
values for analog modules. AIO 4/2-T
(?)
IBS RT 24
AI 8-T
(2723194)
IB IL AI
2/SF
(2726285)
IB ST 24 AI
4/SF-WT
(2752534)
IB ST 24
BAI 8/I
(2721028)
IB ST 24
BAI 8/U
(2721015)
IB ST ZF 24
AI 4/BP
(2724737)
IB ST ZF 24
AI 4/I
(2721264)
IB ST ZF 24
AI 4/SF
(2750620)
IB ST ZF 24
AI 4/SF4
(2750594)
IB ST ZF 24
BAI 2/BP
(2724957)
IB ST ZF 24
BAI 2/SF
(2723958)
AnalogTechnology_9 11/149
6 AI_NORM
The AI_NORM function block cyclically converts the analog values of the Phoenix Contact analog modules in a
measuring range preset by the user (rLoLim to rHiLim).
Caution: The function block does not support 16-bit representation of hardware error messages (iModuleType = 3,
6, 7).
The function block is not responsible for hardware error messages (module) or for parameterizing the module.
Example
6.4 Diagnosis
This function block has no diagnosis. Please refer to output parameter “ERR”.
AnalogTechnology_9 16/149
7 AO_NORM
The AO_NORM function block converts a standardized value on an analog output module. This module is intended
for the listed output modules manufactured by Phoenix Contact.
The AO_NORM function block cyclically converts the rIn values into analog values for the Phoenix Contact analog
modules. The block is not responsible for hardware error messages (module) or for parameterizing the module.
7.4 Diagnosis
This function block has no diagnosis. Please refer to output parameter “ERR”.
AnalogTechnology_9 19/149
8 IL_AI_2_SF
The IL_AI_2_SF function standardized an analog value from the IB IL AI 2/SF-PAC (2861302) analog input module
between the limits rLO_Limit and rHI_Limit.
Example:
8.4 Diagnosis
wDiagCode Meaning
16#0000 Block is not activated.
16#8000 Block is active and operating without errors.
16#C001 Error from the Inline clip.
Measuring range exceeded (overrange).
16#C002 Error from the Inline clip.
Open circuit.
16#C003 Error from the Inline clip.
Measured value invalid/no valid measured value available (e.g.,because the channel has not
been configured).
16#C004 Error from the Inline clip.
Configuration faulty.
16#C005 Error from the Inline clip.
Device faulty
16#C006 Error from the Inline clip.
Below measuring range (underrange).
16#C010 Error from the function block.
The desired format is not allowed. Valid values are from 0 to 2.
16#C020 Error from the function block
The desired format is not allowed. Valid values are from 0 to 4.
16#C030 Error from the function block.
The Limits are not correct. OGR <= UGR
AnalogTechnology_9 23/149
9 IL_AI_4_EF
This function block is used to parameterize the IB IL AI 4/EF (2863478) and IB IL AI 4/EF-PAC (2878447) module.
In addition, the block offers detailed diagnostic properties.
Available operating modes:
Read analog values (default): Analog input values are read in the set format.
Read configuration: The set configuration of the channels is displayed.
Read device data: The firmware and device data is displayed.
dwConfig DWORD
If, for example, all channels are set to 0 mA - 20 mA, ST format, and average
value of 32, dwConfig is 0xD8D8D8D8
xReset BOOL Resets the block to its initial settings. Errors will be acknowledged.
arrPDU_IN AIEF_ARR_b_0_9 Input process data item of the IB IL AI 4/EF-PAC (2878447) module.
AnalogTechnology_9 25/149
9.4 Diagnosis
wDiagCode wAddDiagCode Description
16#0000 16#0000 Function block is deactivated.
16#8000 Function block is in regular operation
16#C100 16#0000 Value of iSelect must be between 0…5.
16#C200 16#0000 No communication with the block. Check process data connection. Device
may not be ready for operation.
16#C210 16#0000 Incorrect dwConfig.
16#xxx1 Incorrect configuration, byte 0 channel 1.
16#xx1x Incorrect configuration, byte 1 channel 2.
16#x1xx Incorrect configuration, byte 2 channel 3.
16#1xxx Incorrect configuration, byte 3 channel 4.
16#C300 16#0000 Range error/error bit.
16#xxx1 Overrange, channel 1.
16#xxx2 Underrange, channel 1.
16#xxx3 Open circuit, channel 1.
16#xxx4 Measured value invalid, channel 1.
16#xxx5 Sensor – analog voltage of channel 1 too low.
16#xxx6 Channel 1 faulty.
16#xx1x Overrange, channel 2.
16#xx2x Underrange, channel 2.
16#xx3x Open circuit, channel 2.
16#xx4x Measured value invalid, channel 2.
16#xx5x Sensor – analog voltage of channel 2 too low.
16#xx6x Channel 2 faulty.
16#x1xx Overrange, channel 3.
16#x2xx Underrange, channel 3.
16#x3xx Open circuit, channel 3.
16#x4xx Measured value invalid, channel 3.
16#x5xx Sensor – analog voltage of channel 3 too low.
16#x6xx Channel 3 faulty.
16#1xxx Overrange, channel 4.
16#2xxx Underrange, channel 4.
16#3xxx Open circuit, channel 4.
16#4xxx Measured value invalid, channel 4.
16#5xxx Sensor – analog voltage of channel 4 too low.
16#6xxx Channel 4 faulty.
16#C400 16#0000 Communication with block aborted/faulty.
16#CFFF 16#0000 Error bit received, cause unknown.
AnalogTechnology_9 27/149
9.5 Appendix
9.5.1 Data types
TYPE
AIEF_ARR_b_0_9 : ARRAY[0..9] OF BYTE;
END_TYPE
AnalogTechnology_9 28/149
10 IL_AI_4_UI
The IL_AI_4_UI_Com function block is recommended for using the modules IB IL AI 4 /I-PAC (2700458) and IB IL
AI 4 /U-PAC (2700459).
For easier handling, the IL_AI_4_UI_Para function block is available to parameterize the module.
The IL_AI_4_UI_Diag function block is indicating the standardized value and the diagnostic information in the event
of an error.
Function block group
The IL_AI_4_UI_Com block is used to parameterize modules IB IL AI 4 /I-PAC (2700458) and IB IL AI 4 /U-PAC
(2700459). In addition, the block outputs the four inputs standardized in a structure. The modules can be
parameterized by using a structure or with the help of the IL_AI_4_UI_Para function block.
The IL_AI_4_UI_Para function block can be used to select the measuring filter and measuring range. The
measuring value is standardized according to the values set at rHighLimit and rLowLimit, and output as a real
value.
The value is output in the udtStatus structure of the IL_AI_4_UI_Com function block or by using the
IL_AI_4_UI_Diag function block at the rCurentValue output. In this block, the structure is split and the standardized
real value is output. In addition, information about the validity of the value as well as an error description for invalid
values can be found here.
If no parameters are set for iMode, iFilter, rHighLimit and/or rLowLimit, the default values of the module are
accepted. All other input parameters require the use of values for operation.
The standard error codes and diagnostic messages are implemented. They are indicated via wDiagCode.
After block activation, the firmware version and the module number are indicated at strFirmware output additionally.
Changes to the parameters in the block are only implemented after a positive edge at the xActivate input.
An error state can be acknowledged with a positive edge at the xActivate input.
AnalogTechnology_9 29/149
10.1 IL_AI_4_UI_Para
The IL_AI_4_UI_Para block is used to parameterize modules IB IL AI 4 /I-PAC (2700458) and IB IL AI 4 /U-PAC
(2700459).
10.2 IL_AI_4_UI_Com
The function block can be operated in various operating modes. The operating modes are set via iModul, iMode,
iFilter and bSelect. However, bSelect only selects the channels for which the parameterization is to be applied.
10.2.5 Diagnosis
DiagCode Description
16#0000 Function block is deactivated
16#8000 Function block is in regular operation
16#8001 Measuring range exceeded (overrange)
16#8002 Open circuit
16#8004 Measured value invalid/no valid measured value available
16#8010 Configuration invalid
16#8020 Supply voltage faulty
16#8040 Device faulty
16#8080 Below measuring range (underrange)
16#C100 Incorrect parameters
16#C101 Invalid parameter for iMode
16#C102 Invalid parameter for iFilter
16#C103 Invalid parameter for bSelect
16#C104 Invalid limit values at rHighLimit and rLowLimit
AnalogTechnology_9 35/149
10.3 IL_AI_4_UI_Diag
The IL_AI_4_UI_Diag block is used for diagnostics.
10.4 Appendix
10.4.1 Data types
TYPE
ANL_udt_Status_1_5: STRUCT
CH1xDataValid : BOOL;
CH1wDiagCode : WORD;
CH1rCurrentValue: REAL;
CH1iChannel : INT;
CH2xDataValid : BOOL;
CH2wDiagCode : WORD;
CH2rCurrentValue: REAL;
CH2iChannel : INT;
CH3xDataValid : BOOL;
CH3wDiagCode : WORD;
CH3rCurrentValue: REAL;
CH3iChannel : INT;
CH4xDataValid : BOOL;
CH4wDiagCode : WORD;
CH4rCurrentValue: REAL;
CH4iChannel : INT;
END_STRUCT
ANL_udt_Para_1_5: STRUCT
CH1iChannel : INT;
CH1iMode : INT;
CH1iFilter : INT;
CH1rHighLimit : REAL;
CH1rLowLimit : REAL;
CH1wDiagCode : WORD;
CH2iChannel : INT;
CH2iMode : INT;
CH2iFilter : INT;
CH2rHighLimit : REAL;
CH2rLowLimit : REAL;
CH2wDiagCode : WORD;
CH3iChannel : INT;
CH3iMode : INT;
CH3iFilter : INT;
CH3rHighLimit : REAL;
CH3rLowLimit : REAL;
CH3wDiagCode : WORD;
CH4iChannel : INT;
CH4iMode : INT;
CH4iFilter : INT;
CH4rHighLimit : REAL;
CH4rLowLimit : REAL;
CH4wDiagCode : WORD;
END_STRUCT
ANL_ARR_AI4UI_ChaDats : ARRAY[1..4] OF ANL_UDT_AI4UI_ChaDat;
ANL_UDT_AI4UI_ChaDat :STRUCT(* Internal data of one channel *)
iChannel : INT; (* Channel number *)
iMode : INT; (* Parameter *)
iFilter : INT; (* Parameter *)
rHighLimit : REAL; (* Parameter *)
rLowLimit : REAL; (* Parameter *)
xConfigured : BOOL; (* TRUE = Channel is configured and configuration is valid *)
xSelected : BOOL; (* TRUE = Channel is selected by bSelect *)
AnalogTechnology_9 37/149
11 IL_AI_8
The IL_AI_8 function block is used to parameterize and standardize measured values for the terminal types listed
in chapter 5 Function blocks.
A plausibility check is performed on the parameter data entered with this block.
Errors detected by the function block are displayed in the diagnostic register of the function block. These include
device error messages and exceeding parameter data limit values. A block call for each Inline terminal is required.
new measured value has been read for a cycle. If an error is detected for a channel by the function block (e.g. limit
value exceeded), the Error bit is controlled from FALSE to TRUE. The Errorcode contains the error code in IL
format. Please note the last valid measured values are still displayed.
AnalogTechnology_9 40/149
11.6 Diagnosis
wDiagCode wAddDiagCode Description
16#0000 Block is not active.
16#8000 Block is active.
16#C010 Timeout during communication
16#0001 Module not responding or indicates an error Range 0-6 at terminal IB IL
AI8/IS
16#C014 Filter - range limit exceeded
16#CCXX CC = channel, XX = range value
16#C017 Range - limit exceeded
16#CCXX CC = channel, XX = range value
16#C018 LowLimit >= HighLimit
16#00CC CC = channel
If several errors occur simultaneously, only the first error is indicated initially. The other error messages are
displayed once the first error has been removed and acknowledged. The error is reset by generating a positive edge
at xActivate. This process is repeated until all the errors have been removed.
AnalogTechnology_9 43/149
11.7 Appendix
11.7.1 Data types
TYPE
(* UDT_IL_AI_8_Para *)
ANL_UDT_AI_8_IN_V_1 : STRUCT
Filter : INT; (* Filter by mean-value generation *)
Range : INT; (* Current measuring range *)
Standardization : BOOL; (* TRUE: Standardization enabled *)
LoLim : REAL; (* Lower limit value *)
HiLim : REAL; (* Upper limit value *)
END_STRUCT;
(* UDT_IL_AI_8_Data *)
ANL_UDT_AI_8_OUT_V_1 : STRUCT
Value_PD : WORD; (* Measured value as WORD *)
Value : REAL; (* Measured value as REAL *)
Error : BOOL; (* TRUE: Channel indicates an error *)
ErrorCode : WORD; (* Error code of the channel *)
NDR : BOOL; (* TRUE: New value present *)
END_STRUCT;
(* Array of UDT_IL_AI_8_Para *)
ANL_ARR_IL_AI_8_Para : ARRAY[1..8] OF ANL_UDT_AI_8_IN_V_1;
(* Array of UDT_IL_AI_8_Data *)
ANL_ARR_IL_AI_8_Data : ARRAY[1..8] OF ANL_UDT_AI_8_OUT_V_1;
(* Array of Bool for selected channels *)
ANL_ARR_IL_AI_8_SelectCH : ARRAY[1..8] OF BOOL;
END_TYPE
AnalogTechnology_9 44/149
Code(hex) Error
16#8001 Overrange
16#8002 Open circuit
16#8004 Measured value invlaid/no valid measured value available
16#8010 Invalid configuration
16#8020 I/O supply voltage fault
16#8040 Module faulty
16#8001 Underrange
AnalogTechnology_9 45/149
12 IL_AO_1_SF
The IL_AO_1_SF function block converts a standardized value at the analog output of the IB IL AO 1/SF (2726298)
and IB IL AO 1/U/SF (2727776) modules.
The IL_AO_1_SF function block outputs a standardized analog value to the analog output of the IB IL AO 1/SF
(2726298) or IB IL AO 1/U/SF (2727776) module.
Example:
Please also refer to chapter 12.5.
12.4 Diagnosis
DiagCode Description
16#0000 Function block is deactivated
16#8000 Function block is in regular operation
C030hex Error from the function block: The limits are not correct. rHILimit <= rLOLimit
C040hex Error from the function block: High limit overranged rIN_AO > rHILimit
C050hex Error from the function block Low limit underranged rIN_AO < rLO_Limit
AnalogTechnology_9 47/149
13 IL_AO
The IL_AO function block serves for parameterization and operation of the Inline analog output modules IB IL AO 2
/U/BP-PAC (2861467 ) and IB IL AO 2 /SF-PAC (2863083).
The function block is responsible for the following tasks:
Additionally the IL_AO_Channel function block is to be used for connection or transmission of the standardized
values and their upper and lower limits. With the help of this block, three values (one for each channel) will be
made available by structure to the IL_AO function block at the udtChannelX input parameter.
13.4 Diagnosis
wDiagCode wAddDiagCode Description
16#0000 16#0000 Function block is deactivated.
16#8000 16#0000 Function block is in regular operation.
16#C200 Error during activation of the block
16#0001 Channel 1: Incorrect parameterization of the upper limit <= lower limit
(rHI_Limit_CH1 <= rLO_Limit_CH1)
16#0002 Channel 2: Incorrect parameterization of the upper limit <= lower limit
(rHI_Limit_CH2 <= rLO_Limit_CH2)
16#0003 Incorrect parameterization channel selection (iSelectChannels)
16#0004 Incorrect parameterization: Module type (iModulType)
16#0005 Incorrect parameterization: Volatile or non-volatile parameterization
(iParameters)
16#0006 Incorrect parameterization: Output behavior in the case of error
(iOutputBehavior)
16#0007 Analog module does not acknowledges parameterization within 5 seconds -
> Timeout
Possible errors:
Incorrect module type was parameterized
Incorrect process data assignment
16#0008 The parameters iModulType and bTyp_BP_SF do not correspond
16#C300 Error in run
16#0001 Channel 1: Input value < lower limit
16#0002 Channel 1: Input value > upper limit
16#0003 Channel 2: Input value < lower limit
16#0004 Channel 2: Input value > upper limit
16#FFFF Error in hardware
16#8010 Invalid configuration or wrong wire bridges
16#8020 Error in the I/O voltage supply.
16#8040 Module is defect.
AnalogTechnology_9 50/149
13.5 IL_AO_Channel
The function block IL_AO_Channel serves to determine the limit values. Corresponding data is made available to
the function block IL_AO_2 as a structure.
13.6 Appendix
13.6.1 Data types
TYPE
ST_Value : STRUCT
rNormValue : REAL; (* Input raw value *)
rHI_Limit : REAL; (* Upper limit *)
rLO_Limit : REAL; (* Lower limit *)
END_STRUCT;
ANL_UDT_AO_DIAG : STRUCT
iState : INT;
END_STRUCT;
END_TYPE
AnalogTechnology_9 52/149
14 IL_AO_2_UI
The function block is used for parameterizing and operating the IB IL AO 2/UI-PAC (2700775) Inline analog output
terminal. The input values within the value range (rLoLim and rHiLim) that is set by the user, are standardized and
are output as corresponding analog value by the Inline analog output terminal.
The following output ranges are supported:
For the setting or transmission of standardization values and their upper and lower limits, the IL_AO_UI_2_Para
function block has to be used. Using the IL_AO_2_UI function block the values are provided at the input parameter
arrParameter by structure. For differentiated channel diagnostics, the IL_AO_UI_2_Diag function block can be
used. Using this function block the data of the arrDiag structure of IL_AO_2_UI function block can be read out and
provided more easily.
AnalogTechnology_9 53/149
14.1 IL_AO_2_UI_Para
The IL_AO_2_UI_Para function block defines the limit values and the output range. The corresponding data for the
IL_AO_2_UI_Para function block is provided by structure. The illustration in the startup example shows the setting
for both channels.
14.2 IL_AO_2_UI
The function block is used for parameterizing and operating the IB IL AO 2/UI-PAC (2700775) Inline analog output
terminal. The input values within the value range (rLoLim and rHiLim) that is set by the user, are standardized and
are output as corresponding analog value by the Inline analog output terminal.
The following output ranges are supported:
14.2.4 Diagnosis
14.3 IL_AO_2_UI_Diag
The function block IL_AO_2_UI_Diag is used for the simplified readout of data from the arrDiag structure of the
IL_AO_2_UI function block. The output structure is assigned to the function block IL_AO_2_UI_Diag and dissolved
in single output variables.
14.4 Appendix
14.4.1 Data types
TYPE
udtDiag : STRUCT
xError : BOOL; (* TRUE: error *)
wErrorCode : WORD; (* Error message *)
iDelay : INT; (* Delay of arrInputPD[3/4] to arrOutputPD[3/4] *)
END_STRUCT;
ANL_ARR_Diag_1_2 : ARRAY [1..2] OF udtDiag;
(* Values for channel parameterization *)
udtPara : STRUCT
iRange : INT; (* Output range *)
rHiLim : REAL; (* Upper limit value *)
rLoLim : REAL; (* Lower limit value *)
rSetValue : REAL; (* Analog value to be output *)
xError : BOOL; (* TRUE: channel indicates an error *)
END_STRUCT;
ANL_ARR_Para_1_2 : ARRAY [1..2] OF udtPara;
(** At 1 ms cycle the module needs up to 12 cycles for mirroring the process data.
** New output process data in between this duration are ignored!
*)
ANL_ARR_AO2UI_PD_BUF : ARRAY[0..31] OF WORD;
ANL_ARR_AO2UI_PD_BAK : ARRAY[1..2] OF ANL_ARR_AO2UI_PD_BUF;
ANL_UDT_AO2UI_CHA : STRUCT
xSelected : BOOL; (* TRUE: channel is selected *)
iRange : INT; (* Output range of channel *)
rLoLim : REAL; (* Lower limit value of channel *)
rHiLim : REAL; (* Upper limit value of channel *)
rMaxLimit : REAL; (* Max allowable value for this output range *)
rMinLimit : REAL; (* Min allowable value for this output range *)
wConfigCode : WORD; (* Configuration parameter *)
wParameter : WORD;
rParameter : REAL;
END_STRUCT;
ANL_ARR_AO2UI_CHA : ARRAY[1..2] OF ANL_UDT_AO2UI_CHA;
END_TYPE
AnalogTechnology_9 59/149
15 IL_AO4_8
The IL_AO4_8 function block is used to parameterize and standardize measured values for the IB IL AO 4/8/U/BP-
PAC (2878036) and IB IL AO 4/8 /U/BP 2MBD-PAC (2878052) terminal types. A plausibility check is performed on
the parameter data entered with this block. Errors detected by the function block are displayed in the diagnostic
register of the function block. These include exceeding parameter data limit values. A function block call is required
for each Inline terminal.
15.5 Diagnosis
wDiagCode wAddDiagCode Description
16#0000 16#0000 Function block is deactivated.
16#8300 16#0000 Function block is in regular operation
16#C001 Timeout
16#0000 Timeout at request to module.
16#C011 Range limit exceeded.
16#000X X = Channel
16#C012 MinValue > MaxValue
16#000X X = Channel
16#C013 Value < MinValue
16#000X X = Channel
16#C014 Value > MaxValue
16#000X X = Channel
16#C015 MinValue = MaxValue
16#000X X = Channel
If several errors occur simultaneously, only the first error is indicated initially. The other error messages are
displayed once the first error has been removed and acknowledged. The error is reset by generating a positive edge
at Activate. This process is repeated until all the errors have been removed.
AnalogTechnology_9 63/149
15.6 Appendix
15.6.1 Data types
TYPE
(* UDT_AO4_8_Para *)
Analog_UDT_AO4_8_IN : STRUCT
Hold : BOOL; (* Output behavior on bus reset *)
Range : INT; (* Channel output range *)
Value : REAL; (* Set point *)
MinValue : REAL; (* Minimum set point *)
MaxValue : REAL; (* Maximum set point *)
END_STRUCT;
(* UDT_AO4_8_Data *)
Analog_UDT_AO4_8_OUT : STRUCT
(* Set point transmitted (for one cycle set to TRUE) *)
Done : BOOL;
END_STRUCT;
UDT_IL_AO4_8_Para : ARRAY[1..8] OF Analog_UDT_AO4_8_IN;
UDT_IL_AO4_8_Conf : ARRAY[1..8] OF Analog_UDT_AO4_8_OUT;
AR_W_1_8 : ARRAY[1..8] OF WORD;
END_TYPE
AnalogTechnology_9 64/149
16 ANL_IL_SGI_2P_EF
We recommend the ANL_IL_SGI_2P_EF function block when using the IB IL SGI 2/P/EF-PAC (2702373) module.
For easier handling, the following function blocks are available additionally:
ANL_IL_SGI_2P_EF_Para,
ANL_IL_SGI_2P_EF_Adju,
ANL_IL_SGI_2P_EF_Val,
ANL_IL_SGI_2P_EF_DIEN,
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 2/P/EF-PAC (2702373) 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.
The ANL_IL_SGI_2P_EF function block is the main block for communication with an IB IL SGI 2/P/EF-PAC
(2702373) module.
In addition, the Asyn_Com library is required for startup.
NOTE: Do not use the Asyn_Com struct of the ANL_IL_SGI_2P_EF with another function block.
16.5 Diagnosis
wDiagCode wAddDiagCode Description
16#0000 16#00000000 Function block is deactivated
16#8000 16#00000000 Function block is in regular operation
16#8100 16#0000.0000 Initialization.
16#C110 Invalid input value.
16#0000.0001 Invalid input parameter at bSelect.
16#0000.0102 Invalid mean value - channel 1.
16#0000.0202 Invalid mean value - channel 2.
16#0000.0103 Invalid characteristic - channel 1.
16#0000.0203 Invalid characteristic - channel 2.
16#0000.0104 Invalid nominal load - channel 1.
16#0000.0204 Invalid nominal load - channel 2.
16#0000.0105 Invalid adjustment value - channel 1.
16#0000.0205 Invalid adjustment value - channel 2.
16#0000.0106 Invalid conversion time - channel 1.
16#0000.0206 Invalid conversion time - channel 2.
16#0000.0107 Invalid Characteristic value - channel 1.
16#0000.0207 Invalid Characteristic value - channel 2.
16#0000.0108 Invalid adjustment value2 - channel 1.
16#0000.0208 Invalid adjustment value2 - channel 2.
16#C210 16#0000.0000 Device faulty.
16#C211 16#0000.0000 Measured value invalid/no valid measured value available (e.g., because
channel was not configured).
16#C212 Measuring range exceeded (overrange).
16#0000.0100 Channel 1.
16#0000.0200 Channel 2.
16#C213 Below measuring range (underrange).
16#0000.0100 Channel 1.
16#0000.0200 Channel 2.
16#C214 Open circuit.
16#0000.0100 Channel 1.
16#0000.0200 Channel 2.
16#C215 16#0000.0000 Supply voltage faulty.
16#C310 Error PCP_CONNECT.
16#0000.C410 Timeout PCP_CONNECT.
16#xxxx.xxxx Error of PCP_CONNECT.
16#C311 Error PCP_READ.
16#0000.C411 Timeout PCP_READ.
16#xxxx.xxxx Error of PCP_READ.
16#C312 Error PCP_WRITE.
16#0000.C412 Timeout PCP_WRITE.
16#xxxx.xxxx Error of PCP_WRITE.
16#C350 RDREC error.
AnalogTechnology_9 67/149
16.6 ANL_IL_SGI_2P_EF_Para
This function block parameterizes the ANL_IL_SGI_2P_EF 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.
All parameters are registered in ANL_IL_SGI_2P_EF with the rising edge of ANL_IL_SGI_2P_EF.xActivate.
Changes at ANL_IL_SGI_2P_EF_Para have no effect until next rising edge of ANL_IL_SGI_2P_EF.xActivate.
16.7 ANL_IL_SGI_2P_EF_Adju
This auxiliary block supports the following functions:
Zero point:
Once the input xZeroPoint is activated, the terminal determines the zero point, and sets the status bit xZeroPoint
to TRUE, when it is reached.
Contact Ka_Kb:
A resistance can be added with the potential-free contact. The upper and lower switching threshold can be defined
via the variables wKa_Kb_Up and wKa_Kb_Dn. The behavior of the contact can be defined via the input iKa_Kb.
The contact is activated or deactivated via the input xKa_Kb.
Adjustment:
The terminal determines the current measured value and is adjusted to the adjustment value. Each weight value is
now displayed with the highest possible degree of accuracy. Before the adjustment process can be performed, the
zero point must be defined and the scale loaded with the adjustment weight.
Tare:
The tare function calculates the difference between the gross and net weight.
ResetTara:
The ResetTara function resets the tare function.
0: N/O contacts can be controlled via “Control Static” PCP object (0092hex)
1: Close in the event of upper switching threshold overrange and open in the event
of lower switching threshold underrange
2: Open in the event of upper switching threshold overrange and close in the event
of lower switching threshold underrange
3: Close when within the lower and upper switching threshold
4: Open when within the lower and upper switching threshold
16.8 ANL_IL_SGI_2P_EF_Val
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 function block also outputs some status information on the terminal.
This function block has to be instantiated separately for each channel.
16.9 ANL_IL_SGI_2P_EF_DIDE
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.
16.10 ANL_IL_SGI_2P_EF_DIEN
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.
16.11 Appendix
16.11.1 Data types
TYPE
(* Process data *)
ANL_ARR_SGI_PD : ARRAY[0..2] OF WORD;
(* ANL_IL_SGI_2P_EF_Adju *)
ANL_UDT_SGI_ADJUST : STRUCT
(*Inputs*)
xAdjust : BOOL;
xAdjust2 : BOOL;
xSetZeroPoint : BOOL;
xTara : BOOL;
xResetTara : 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;
wCharacteristic : WORD;
rNominalWeight : REAL;
iConversionTime : INT;
rAdjustValue : REAL;
rAdjustValue2 : REAL;
wAdjustValue : WORD;
wAdjustValue2 : WORD;
wNominalWeight : WORD;
END_STRUCT;
(* ANL_IL_SGI_2P_EF_Val *)
ANL_UDT_SGI_VALUE : STRUCT
(* Outputs *)
rVal : REAL;
xValid : BOOL;
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;
(* Struct for one channel *)
ANL_UDT_SGI_CHANNEL : STRUCT
udtAdjust : ANL_UDT_SGI_ADJUST;
udtPara : ANL_UDT_SGI_PARA;
AnalogTechnology_9 78/149
udtVal : ANL_UDT_SGI_VALUE;
xSelected : BOOL; (* TRUE- Channel is active *)
xAdjust : BOOL;
xTara : BOOL;
xZeroPoint : BOOL;
xKa_Kb : BOOL;
wConfig : WORD;(* Config parameter *)
(* Padding *)
wPadding : 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 state machine *)
wDeviceInfo : WORD; (* Firmware of the device *)
xConnect : BOOL; (* Activate the AysnCom-FB *)
xWrite : BOOL; (* Activate write/service *)
xRead : BOOL; (* Activate read service *)
iCNT : INT; (* Number of data to be read/write *)
wIndexWrite : WORD; (* PCP-command write *)
wSubIndexWrite : WORD; (* Add. PCP-command write *)
wIndexRead : WORD; (* PCP-command read *)
wSubIndexRead : WORD; (* Add. PCP-command read *)
iValue : INT; (* Internal paramter *)
xConnectError : BOOL; (* Error during connection *)
xWriteDone : BOOL; (* Write process successfully finished *)
xWriteError : BOOL; (* Error write *)
xNDR : BOOL; (* New data received *)
xReadError : BOOL; (* Error read *)
xConnectValid : BOOL; (* Valid connection exits *)
xSetDefaultSettings : BOOL; (* Reset on default settings *)
udtDiag : ANL_UDT_SGI_DIAG; (* Diag struct *)
arrCH : ANL_ARR_SGI_CHANNELS; (* Array of the two channels *)
END_STRUCT;
END_TYPE
AnalogTechnology_9 79/149
17 IL_SGI_1_CAL
The IL_SGI_1_CAL function block is intended for parameterization and operation of the IB IL SGI 1 /CAL (2700064)
module for load cells and force transducers.
For easier handling, the following function blocks are available additionally:
IL_SGI_1_CAL_Para,
IL_SGI_1_CAL_AddV,
IL_SGI_1_CAL_Adj,
IL_SGI_1_CAL_Diag,
IL_SGI_1_CAL_SMP.
In order to operate the module, only the IL_SGI_1_CAL, IL_SGI_1_CAL_Adj as well as the IL_SGI_1_CAL_Para
blocks are required. The other blocks are used to meet additional requirements.
17.5 Diagnosis
wDiagCode wAddDiagCode Description
16#0000 16#0000 Function block is deactivated.
16#8000 16#0000 Function block is in regular operation.
16#C100 16#0000 Timeout while reading the firmware version.
16#C101 16#0000 Timeout during initialization.
16#C111 16#0000 Error message from the terminal during initialization.
16#C113 16#0000 Invalid characteristic value.
16#C114 16#0000 Invalid nominal load.
16#C115 16#0000 Invalid adjustment value.
16#C116 16#0000 Invalid mean value.
16#C118 16#0000 Invalid floating point.
16#C301 16#0000 Timeout during operation.
16#C312 Error message from the terminal during operation.
16#8001 Overrange.
16#8002 Open circuit.
16#8004 Measured value invalid/no valid measured value available
(e.g., because channel was not configured).
16#8020 Supply voltage faulty.
16#8040 Device faulty.
16#8090 Underrange.
16#C050 Error message in PCP mode.
16#0020 Service cannot be executed in current state.
16#0021 Service cannot be executed in current state.
16#xx30 Outside value range or parameterization error.
16#0000 Hardware fault.
16#8C00 Refer to data sheet of the IB IL SGI Error message in PCP mode not causing operation to be
1 /CAL (2700064) module interrupted.
AnalogTechnology_9 82/149
17.6 IL_SGI_1_CAL_Para
This auxiliary block groups the iFilter, iCharacteristic, rNominalWeight and rAdjustValue input parameters of one
channel to form a data structure, which is transferred to the udtChannel1 or udtChannel2 inputs of the
IL_SGI_1_CAL block for parameterization.
17.7 IL_SGI_1_CAL_AddV
This auxiliary block decodes the udtPara data structure of the IL_SGI_1_CAL function block. It contains the
following data, the firmware version, minimum/maximum measured values as well as measured and display values
of the channels in the highest possible accuracy of the terminal.
17.8 IL_SGI_2P_EF_Adj
This auxiliary block is used for path calibration and supports the following functions:
Zero point:
Once the input is activated, the terminal determines the zero point and sets the status bit -0- to TRUE when the
zero point is reached.
Adjustment:
The terminal determines the current measured value and is adjusted to the adjustment value. Each weight value is
now displayed with the highest possible degree of accuracy.
Tare:
The tare function calculates the difference between the gross and net weight of the good to be weighed.
17.9 IL_SGI_1_CAL_Diag
This auxiliary block contains the status of the status display LEDs as well as information on the default state of the
adjustment values.
17.10 IL_SGI_1_CAL_LMP
This auxiliary block contains the status of the status display LEDs as well as information on the default state of the
adjustment values.
17.11 IL_SGI_1_CAL_SMP
This auxiliary block contains the status of the status display LEDs as well as information on the default state of the
adjustment values.
17.12 Appendix
17.12.1 Data types
TYPE
ANA_ARR_B_1_33 : ARRAY [1..33] OF BYTE;
ANA_ARR_B_1_3 : ARRAY [1..3] OF BYTE;
ANA_ARR_B_1_5 : ARRAY [1..5] OF BYTE;
ANA_ARR_B_0_3 : ARRAY [0..3] OF BYTE;
ANA_ARR_STR_1_12 : ARRAY [1..12] OF STRING;
(******************************************************************************)
(* PCP - 83 *)
ANA_UDT_SGI_1_CAL_AddValues_V1:
STRUCT
xMeasurmentProtocol : BOOL;
xReadLastProtocol : BOOL;
xReadSelectProtocol : BOOL;
iBaseNoProtocol : INT;
rTaraValue : REAL;
wDeviceInfo : WORD;
arrMeasuredValueFloat : ANA_ARR_B_1_6;(* PCP - 82 *)
arrDisplayValueFloat : ANA_ARR_B_1_6;(* PCP - 83 *)
arrTaraValueFloat : ANA_ARR_B_1_6;(* PCP - 84 *)
END_STRUCT;
ANA_UDT_SGI_1_CAL_Adjust_V1 :
STRUCT
xAdjust : BOOL;
xZeroPoint : BOOL;
xTara : BOOL;
END_STRUCT;
ANA_UDT_SGI_1_CAL_Para_V1 :
STRUCT
(* X15=0: Do not store configuration table retentively *)
xSaveRemanend : BOOL;
(* X12-X14: 0..4*)
iFrequencyLimit : INT;
(* X8-X10: 0..3, Critical attenuation *)
iFilter : INT;
(* X4, X5: 0..3 *)
iOrdinalNumber : INT;
(* X0-X3: 0..5: Nominal characteristic value *)
iCharacteristic : INT;
(* Nominal weight value *)
uintNominalWeight : UINT;
(* Adjustment value *)
rAdjustValue : REAL;
(* Division factor *)
rDivisionCount : REAL;
(* g, Kg, t *)
strMeasurementUnit : STRING;
wDummy : WORD;
END_STRUCT;
(******************************************************************************)
(* PCP - 94 *)
ANA_UDT_SGI_1_CAL_SMP_V1 :
STRUCT
arrSelectedMeasureProtocol : ANA_ARR_B_1_33;(* PCP - 96 *)
xRSP : BOOL;
iMeasurementNo : INT;
AnalogTechnology_9 93/149
strDate : STRING;
rMeasurementDisplay : REAL;
rMeasurementGross : REAL;
rMeasurementTara : REAL;
strASCII : STRING;
rCommaValue : REAL;
iStatus : INT;
uintSerialNo : UINT;
iCRC : INT;
dwBaseNumber : DWORD;
END_STRUCT;
ANA_UDT_SGI_1_CAL_LMP_V1 :
STRUCT
arrLastMeasureProtocol : ANA_ARR_B_1_33;(* PCP - 94 *)
iMeasurementNo : INT;
strDate : STRING;
rMeasurementDisplay : REAL;
rMeasurementGross : REAL;
rMeasurementTara : REAL;
strASCII : STRING;
rCommaValue : REAL;
iStatus : INT;
uintSerialNo : UINT;
iCRC : INT;
wDummy : WORD;
END_STRUCT;
(******************************************************************************)
(* PCP - 94 *)
ANA_UDT_SGI_1_CAL_DiagState_V1:
STRUCT
xFault : BOOL;(* TRUE: A malfunction has occurred. *)
xParaLock : BOOL;(* TRUE: The parameter lock is active. *)
xMax : BOOL;(* TRUE: The measured value is above the
maximum value of MAX + 9e*)
xMin : BOOL;(*TRUE: The measured value is below the
minimum value of 20d. *)
xResolution : BOOL;(* TRUE: The measured value is displayed
with 10-fold resolution. *)
xProtocol : BOOL;(*TRUE: Measurement protocols are
generated. *)
xStandStill : BOOL;
xZeroPoint : BOOL;
xNettoValue : BOOL;
xDefault : BOOL;
END_STRUCT;
END_TYPE
TYPE
ANA_UDT_REAL_TO_BYTE:
STRUCT
Byte0 : BYTE;
Byte1 : BYTE;
Byte2 : BYTE;
Byte3 : BYTE;
Byte4 : BYTE;
Byte5 : BYTE;
Byte6 : BYTE;
Byte7 : BYTE;
RealWert : REAL;
END_STRUCT ;
END_TYPE
AnalogTechnology_9 94/149
TYPE
udtSGI_1_CAL:
STRUCT
(* 21 Bytes + 3 Bits *)
AddValues : ANA_UDT_SGI_1_CAL_AddValues_V1;
(* 3 Bits *)
AdjustValues : ANA_UDT_SGI_1_CAL_Adjust_V1;
Parameter : ANA_UDT_SGI_1_CAL_Para_V1;
RD_LMP : ANA_UDT_SGI_1_CAL_LMP_V1;
RD_SMP : ANA_UDT_SGI_1_CAL_SMP_V1;
Diagnose : ANA_UDT_SGI_1_CAL_DiagState_V1;
xActivato : BOOL;
wDummy : WORD;
wDummy1 : WORD;
END_STRUCT;
END_TYPE
AnalogTechnology_9 95/149
18 IL_SGI_2F
The SGI blocks are used to parameterize and operate the IB IL SGI 2/F-PAC (2878638) module.
For easier handling, the following function blocks are available additionally:
IL_SGI_2F_Para,
IL_SGI_2F_AddVal,
IL_SGI_2F_MeanVal,
IL_SGI_2F_Offset.
The IL_SGI_2F and IL_SGI_2F_Para function blocks alone are sufficient to operate the module; the other blocks
meet more advanced requirements.
This IL_SGI_2F function block is used to evaluate and parameterize the IB IL SGI 2/F-PAC (2878638) module for
load cells and force transducers. It converts raw measured data into standardized and scaled output values.
Furthermore, the minimum and maximum values and the raw measured data for both channels can be read out via
the IL_SGI_2F_AddVal auxiliary block, as can the firmware version.
18.4 Diagnosis
wDiagCode wAddDiagCode Description
16#0000 16#0000 Function block is deactivated.
16#8000 16#0000 Function block is in regular operation.
16#C101 16#0000 Timeout during initialization.
16#C700 16#0000 Error message during configuration.
16#C800 16#0000 Invalid entry for bSelect.
16#C101 16#0000 Timeout during initialization.
16#C112 16#0000 Terminal error message during initialization of channel 1.
16#C122 16#0000 Terminal error message during initialization of channel 2.
16#C113 16#0000 Invalid characteristic for channel 1.
16#C123 16#0000 Invalid characteristic for channel 2.
16#C301 16#0000 Timeout in Active state.
16#C312 Terminal error message during operation of channel 1.
16#C322 Terminal error message during operation of channel 2.
16#8001 Measuring range exceeded (overrange).
16#8002 Open circuit.
16#8004 Measured value invalid/no valid measured value available (e.g., because
channel was not configured).
16#8020 Supply voltage faulty.
16#8040 Device faulty.
16#8080 Below measuring range (underrange).
AnalogTechnology_9 98/149
18.5 IL_SGI_2F_Para
This auxiliary block groups together the xFilterOnOff, bCharacteristic, rNominalWeight, and wOffset input
parameters of a channel to form a data structure, to which the udtChannel1/udtChannel2 inputs of the IL_SGI_2F
function block are transferred for parameterization. The block is connected to the udtChannel1 and udtChannel2
input parameters of the IL_SGI_2F function block.
18.6 IL_SGI_2F_AddVal
This auxiliary block decodes the udtAddValues output parameter of the IL_SGI_2F function block. The block
contains the following data: min./max. and raw measured values of channels and the module’s firmware version.
18.7 IL_SGI_2F_MeanVal
This auxiliary block not only calculates the internal 16-sample average value of the module, but also an average
value from either 16 or 32 input values; it then outputs this value in a variable string format, which is defined at the
strFormat input. Calculation of the average value can be disabled by entering a value of 0 at the iSelectGrade input
(1 => 16-sample; 2 => 32-sample).
18.8 IL_SGI_2F_Offset
This auxiliary block outputs the instantaneous input value as a constant output value when there is a positive edge
at the xCalibrate input. It is provided in order to implement a TARE function.
18.9 Appendix
18.9.1 Data types
(* Arrays *)
TYPE
ANL_ARR_W_1_3 : ARRAY [1..3] OF WORD;
ANL_ARR_R_1_32 : ARRAY [1..32] OF REAL;
ANL_ARR_R_0_32 : ARRAY [0..32] OF REAL;
(* Structures *)
ANL_UDT_SGI_2F_PARA_V1 :
STRUCT
xFilterOnOff : BOOL;
bCharacteristic : BYTE;
rNominalweight : REAL;
wOffset : WORD;
wDummy : WORD;
END_STRUCT;
ANL_UDT_SGI_2F_AddValues_V1 :
STRUCT
rMinValCh1 : REAL; (* Min value channel 1 *)
rMaxValCh1 : REAL; (* Max value channel 1 *)
rMinValCh2 : REAL; (* Min value channel 2 *)
rMaxValCh2 : REAL; (* Max value channel 2 *)
wRawValCh1 : WORD; (* Raw value channel 1 *)
wRawValCh2 : WORD; (* Raw value channel 2 *)
wDeviceInfo : WORD; (* FW/HW version *)
wDummy : WORD;
END_STRUCT;
END_TYPE
AnalogTechnology_9 103/149
19 IL_SGI_2P_A
The IL_SGI_2P_A function block is recommended for using module IB IL SGI 2/P-PAC (2884907) module for load
cells and force transducers.
For easier handling, the following function blocks are available additionally:
The IL_SGI_2P_A and IL_SGI_2P_A_Adju as well as the IL_SGI_2P_A_Para blocks are already sufficient for
operation of the module. The other blocks are optionally used to meet additional requirements.
Furthermore, one of the communication function blocks from the AsynCom library is required.
19.5 Diagnosis
wDiagCode wAddDiagCode Description
16#0000 16#0000 Function block is deactivated.
16#8000 16#0000 Function block is in regular operation.
16#C100 16#0000 Timeout while reading the firmware version.
16#C101 16#0000 Timeout during initialization.
16#C800 16#0000 Invalid entry for bSelect.
16#C111 16#0000 Error message from the terminal block during initialization of channel 1.
16#C112 16#0000 Error message from the terminal block during initialization of channel 2.
16#C113 16#0000 Invalid characteristic for channel 1.
16#C123 16#0000 Invalid characteristic for channel 2.
16#C114 16#0000 Invalid nominal load for channel 1.
16#C124 16#0000 Invalid nominal load for channel 2.
16#C115 16#0000 Invalid adjustment value for channel 1.
16#C125 16#0000 Invalid adjustment value for channel 2.
16#C116 16#0000 Invalid mean value for channel 1.
16#C126 16#0000 Invalid mean value for channel 2.
16#C312 Terminal error message during operation of channel 1.
16#C322 Terminal error message during operation of channel 2.
16#8001 Measuring range exceeded (overrange).
16#8002 Open circuit.
16#8004 Measured value invalid/no valid measured value available (e.g., because
channel was not configured).
16#8020 Supply voltage faulty.
16#8040 Device faulty.
16#8080 Below measuring range (underrange).
16#C050 Error message in PCP mode.
16#0020 Service cannot be executed in current state.
16#0021 Service cannot be executed in current state.
16#xx30 Outside value range or parameterization error.
16#0000 Hardware fault.
AnalogTechnology_9 106/149
19.6 IL_SGI_2P_A_Para
This auxiliary block groups the iFilter, iCharacteristic, rNominalWeight, xConversionTime, and rAdjustValuet input
parameters of one channel to form a data structure, which is transferred for parameterization to the udtChannel1 or
udtChannel2 inputs of the IL_SGI_2P_A function block.
19.7 IL_SGI_2P_A_Value
This auxiliary block decodes the udtAddValues output parameter of the IL_SGI_2P_A function block. This contains
the following data: the firmware version, min/max measured values as well as measured and display values of the
channels in the highest possible accuracy of the module.
19.8 IL_SGI_2P_A_Adju
This auxiliary block supports the following functions:
Zero point:
Once the input is activated, the terminal determines the zero point and sets the status bit -0- to TRUE when the
zero point is reached.
Contact Ka_Kb:
The shunt resistance is switched on with the Ka-Kb N/O contact, and an output signal of 80% of the nominal
pressure is created. When the system is in a steady state, the status bit standstill reached >< is set.
Adjustment:
The terminal determines the current measured value and is adjusted to the adjustment value. Each weight value is
now displayed with the highest possible degree of accuracy.
Tare:
The tare function calculates the difference between the gross and net weight of the goods to be weighed.
19.9 IL_SGI_2P_A_Diag
This auxiliary block contains the status of the status display LEDs as well as information on the default state of the
adjustment values.
19.10 Appendix
19.10.1 Data types
(* Arrays *)
TYPE
SGI_2P_PN_ARR_B_1_33 : ARRAY [1..33] OF BYTE;
SGI_2P_PN_ARR_B_1_3 : ARRAY [1..3] OF BYTE;
SGI_2P_PN_ARR_B_1_5 : ARRAY [1..5] OF BYTE;
SGI_2P_PN_ARR_B_0_3 : ARRAY [0..3] OF BYTE;
SGI_2P_PN_ARR_STR_1_12 : ARRAY [1..12] OF STRING;
SGI_2P_PN_ARR_W_1_2 : ARRAY [1..2] OF WORD;
SGI_2P_PN_ARR_W_1_8 : ARRAY [1..8] OF WORD;
SGI_2P_PN_ARR_B_1_16 : ARRAY [1..16] OF BYTE;
SGI_2P_PN_ARR_B_1_6 : ARRAY [1..6] OF BYTE;
SGI_2P_PN_ARR_B_1_2 : ARRAY [1..2] OF BYTE;
SGI_2P_PN_ARR_B_1_4 : ARRAY [1..4] OF BYTE;
END_TYPE
TYPE
SGI_2P_PN_UDT_REAL_TO_BYTE :
STRUCT
Byte0 : BYTE;
Byte1 : BYTE;
Byte2 : BYTE;
Byte3 : BYTE;
Byte4 : BYTE;
Byte5 : BYTE;
Byte6 : BYTE;
Byte7 : BYTE;
RealWert : REAL;
END_STRUCT ;
(******************************************************************)
SGI_2P_PN_UDT_AddValues_V1 :
STRUCT
rMinValCh1 : REAL;
rMaxValCh1 : REAL;
rMinValCh2 : REAL;
rMaxValCh2 : REAL;
wDeviceInfo : WORD;
arrFloatValueCh1 : SGI_2P_PN_ARR_B_1_4;
arrDispalyValueCh1 : SGI_2P_PN_ARR_B_1_4;
arrFloatValueCh2 : SGI_2P_PN_ARR_B_1_4;
arrDispalyValueCh2 : SGI_2P_PN_ARR_B_1_4;
wDummy : WORD;
END_STRUCT;
(*****************************************************************)
SGI_2P_PN_UDT_Adjust_V1 :
STRUCT
xAdjust : BOOL;
xZeroPoint : BOOL;
xTare : BOOL;
xKa_Kb : BOOL;
END_STRUCT;
(*****************************************************************)
SGI_2P_PN_UDT_Para_V1 :
STRUCT
iFilter : INT;(* Average value *)
iCharacteristic : INT;(* Nominal value *)
rNominalWeight : REAL;(* Nominal load *)
AnalogTechnology_9 111/149
20 Startup examples
For the startup instruction of the FB_Name function block please find the following example(s):
Example 1: ANL_*_EXA_AI_Norm.zwt
Example 2: ANL_*_EXA_AO_Norm.zwt
Example 3: ANL_*_EXA_IL_AI_2_SF.zwt
Example 4: ANL_*_EXA_IL_AI_4_EF.zwt
Example 5: ANL_*_EXA_IL_AI_4_UI.zwt
Example 6: ANL_*_EXA_IL_AI_8.zwt
Example 7: ANL_*_EXA_IL_AO_2.zwt
Example 8: ANL_*_EXA_IL_AO_2_UI.zwt
Example 9: ANL_*_EXA_IL_AO_1_SF_I.zwt (Current mode)
Example 10: ANL_*_EXA_IL_AO_1_SF_U.zwt (Voltage mode)
Example 11: ANL_*_EXA_IL_AO4_8.zwt
Example 12: ANL_*_EXA_IL_SGI_2P_EF.zwt (Local bus)
Example 13: ANL_*_EXA_IL_SGI_2P_EFPN.zwt (Profinet)
These examples are packed in the zipped Examples folder of the library.
They describe the use of different Inline input and output modules with the function blocks of AnalogTechnology
library.
AnalogTechnology_9 113/149
For starting ExampleMachine function block, xStart input has set to TRUE.
CASE udtExample.iState OF
0: (* Init *)
IF xStart = TRUE THEN
udtExample.udtANL_AI_NORM.rHiLim := 4000.0;
udtExample.udtANL_AI_NORM.rLoLim := 2000.0;
udtExample.udtANL_AI_NORM.iModuleType := 1;
udtExample.iState := 10;
END_IF;
10: (* Checking for iError *)
IF
udtExample.udtANL_AI_NORM.iError = INT#0
THEN
udtExample.iState := 32000;
ELSE
udtExample.iState := 9000;
END_IF;
9000: (* Error handling *)
(* Insert your error handling here *)
IF xStart = FALSE THEN
udtExample.iState := 32000;
END_IF;
32000: (* Example is finished *)
(* Deactivation of FB *)
udtExample.udtANL_AI_NORM.rHiLim := 0.0;
udtExample.udtANL_AI_NORM.rLoLim := 0.0;
udtExample.udtANL_AI_NORM.iModuleType := 0;
IF xStart = FALSE THEN
AnalogTechnology_9 114/149
udtExample.iState := 0;
END_IF;
END_CASE;
iState := udtExample.iState;
AnalogTechnology_9 115/149
For starting ExampleMachine function block, xStart input has set to TRUE.
CASE udtExample.iState OF
0: (* Init *)
IF xStart = TRUE THEN
udtExample.udtANL_AO_NORM.rHiLim := 4000.0;
udtExample.udtANL_AO_NORM.rIn_AO := 3000.0;
udtExample.udtANL_AO_NORM.rLoLim := 2000.0;
udtExample.udtANL_AO_NORM.iModuleType := 3;
udtExample.iState := 10;
END_IF;
10: (* Checking for iError *)
IF
udtExample.udtANL_AO_NORM.iError = INT#0
THEN
udtExample.iState := 32000;
ELSE
udtExample.iState := 9000;
END_IF;
9000: (* Error handling *)
(* Insert your error handling here *)
IF xStart = FALSE THEN
udtExample.iState := 32000;
END_IF;
32000: (* Example is finished *)
(* Deactivation of FB *)
udtExample.udtANL_AO_NORM.rHiLim := 0.0;
udtExample.udtANL_AO_NORM.rIn_AO := 0.0;
udtExample.udtANL_AO_NORM.rLoLim := 0.0;
udtExample.udtANL_AO_NORM.iModuleType := 0;
AnalogTechnology_9 116/149
To provide voltage and current values for the IB IL AI 2/SF-PAC (2861302) analog input module, the analog output
module IB IL AO 2/UI-PAC (2700775) is used additionally.
For starting ExampleMachine function block, xStart input has set to TRUE.
CASE udtExample.iState OF
0: (* Init *)
IF xStart = TRUE THEN
(* Parameterization of IL_AO_2_UI function block *)
(* Channel selection *)
udtExample.udtANL_AO2_UI.iSelectCH := 3;
(* Parameterization of IL_AO_2_UI_Para function block for CH1 *)
(* Voltage mode *)
(* Output range *)
udtExample.arrANL_AO2_UI_Para[1].iRange := 0;
(* Upper limit value of the standardized range *)
udtExample.arrANL_AO2_UI_Para[1].rHiLim := 10.0;
(* Lower limit value of the standardized range *)
udtExample.arrANL_AO2_UI_Para[1].rLoLim := 0.0;
(* Analog value to be output *)
udtExample.arrANL_AO2_UI_Para[1].rSetValue := 5.0;
(* Parameterization of IL_AO_2_UI_Para function block for CH2 *)
(* Current mode *)
(* Output range *)
udtExample.arrANL_AO2_UI_Para[2].iRange := 2;
(* Upper limit value of the standardized range *)
udtExample.arrANL_AO2_UI_Para[2].rHiLim := 20.0;
(* Lower limit value of the standardized range *)
udtExample.arrANL_AO2_UI_Para[2].rLoLim := 0.0;
(* Analog value to be output *)
AnalogTechnology_9 118/149
udtExample.arrANL_AO2_UI_Para[2].rSetValue := 10.0;
(* Parameterization of IL_AI_2_SF function block for CH1 *)
(* Voltage mode *)
(* High limit of the normed range *)
udtExample.arrANL_AI2_SF[1].rHI_Limit := 10.0;
(* Low limit of the normed range *)
udtExample.arrANL_AI2_SF[1].rLO_Limit := 0.0;
(* Disables the filter *)
udtExample.arrANL_AI2_SF[1].xNoFilter := FALSE;
(* Choose the format *)
udtExample.arrANL_AI2_SF[1].iSelectFormat := 0;
(* Choose the range *)
udtExample.arrANL_AI2_SF[1].iSelectRange := 0;
(* Parameterization of IL_AI_2_SF function block for CH2 *)
(* Current mode *)
(* High limit of the normed range *)
udtExample.arrANL_AI2_SF[2].rHI_Limit := 20.0;
(* Low limit of the normed range *)
udtExample.arrANL_AI2_SF[2].rLO_Limit := 0.0;
(* Disables the filter *)
udtExample.arrANL_AI2_SF[2].xNoFilter := FALSE;
(* Choose the format *)
udtExample.arrANL_AI2_SF[2].iSelectFormat := 0;
(* Choose the range *)
udtExample.arrANL_AI2_SF[2].iSelectRange := 1;
(* Activation of function block *)
udtExample.udtANL_AO2_UI.xActivate := TRUE;
FOR iChannel := 1 TO 2 DO
udtExample.arrANL_AI2_SF[iChannel].xActivate := TRUE;
END_FOR;
udtExample.iState := 100;
END_IF;
10: (*Checking for an error of IL_AO_2_UI function block *)
IF udtExample.udtANL_AO2_UI.xError = TRUE THEN
udtExample.iState := 9000;
ELSE
udtExample.iState := 20;
END_IF;
20: (*Checking for an error of IL_AI_2_SF function blocks *)
FOR iChannel := 1 TO 2 DO
IF udtExample.arrANL_AI2_SF[iChannel].xError = TRUE THEN
udtExample.iState := 9000;
ELSIF udtExample.arrANL_AI2_SF[iChannel].xActive = TRUE THEN
udtExample.iState := 32000;
END_IF;
END_FOR;
9000: (* Error handling *)
(* Insert your error handling here *)
IF xStart = FALSE THEN
udtExample.iState := 32000;
END_IF;
32000: (* Example is finished *)
(* Deactivation of all FBs *)
FOR iChannel := 1 TO 2 DO
udtExample.arrANL_AO2_UI_Para[iChannel].iRange := 0;
udtExample.arrANL_AO2_UI_Para[iChannel].rHiLim := 0.0;
AnalogTechnology_9 119/149
udtExample.arrANL_AO2_UI_Para[iChannel].rLoLim := 0.0;
udtExample.arrANL_AO2_UI_Para[iChannel].rSetValue := 0.0;
udtExample.arrANL_AI2_SF[iChannel].xActivate := FALSE;
udtExample.arrANL_AI2_SF[iChannel].rHI_Limit := 0.0;
udtExample.arrANL_AI2_SF[iChannel].rLO_Limit := 0.0;
udtExample.arrANL_AI2_SF[iChannel].xNoFilter := FALSE;
udtExample.arrANL_AI2_SF[iChannel].iSelectFormat := 0;
udtExample.arrANL_AI2_SF[iChannel].iSelectRange := 0;
END_FOR;
udtExample.udtANL_AO2_UI.iSelectCH := 0;
udtExample.udtANL_AO2_UI.xActivate := FALSE;
IF xStart = FALSE THEN
udtExample.iState := 0;
END_IF;
END_CASE;
iState := udtExample.iState;
AnalogTechnology_9 120/149
For starting ExampleMachine function block, xStart input has set to TRUE.
CASE udtExample.iState OF
0: (* Init *)
IF xStart = TRUE THEN
(* Selection of the operating mode:
Read analog values (default):(Output: wValueChannel1…4) *)
udtExample.udtANL_IL_AI4_EF.iSelect := 0;
(* Configuration of channels:
CH1 = 0-10 V, ST, Average 16
CH2 = +/- 5 V, ST, No average
CH3 = 0-20 mA, IL, Average 4
CH4 = +/- 20 mA, NORM, Average 32 *)
udtExample.udtANL_IL_AI4_EF.dwConfig := DWORD#16#F9885310;
(* Resets the block to its initial settings *)
udtExample.udtANL_IL_AI4_EF.xReset := FALSE;
(* Activation of function block *)
udtExample.udtANL_IL_AI4_EF.xActivate := TRUE;
udtExample.iState := 10;
END_IF;
10: (* Checking for xError *)
IF udtExample.udtANL_IL_AI4_EF.xError THEN
udtExample.iState := 9000;
ELSE
udtExample.iState := 32000;
END_IF;
9000: (* Error handling *)
(* Insert your error handling here *)
IF xStart = FALSE THEN
AnalogTechnology_9 121/149
udtExample.iState := 32000;
END_IF;
32000: (* Example is finished *)
(* Deactivation of FB *)
udtExample.udtANL_IL_AI4_EF.iSelect := 0;
udtExample.udtANL_IL_AI4_EF.dwConfig := DWORD#16#00000000;
udtExample.udtANL_IL_AI4_EF.xReset := FALSE;
udtExample.udtANL_IL_AI4_EF.xActivate := FALSE;
IF xStart = FALSE THEN
udtExample.iState := 0;
END_IF;
END_CASE;
iState := udtExample.iState;
AnalogTechnology_9 122/149
To provide current and voltage values for the analog input modules, the analog output module IB IL AO 2/UI-PAC
(2700775) is used additionally.
AnalogTechnology_9 123/149
For starting ExampleMachine function block, the requested example can be selected at iExample input and xStart
input has set to TRUE.
ANL_*_EXA_IL_AI_8.zwt
To provide current and voltage values for the IB IL AI 8/SF-PAC (2861412) analog input module, the analog output
module IB IL AO 2/UI-PAC (2700775) is used additionally.
AnalogTechnology_9 128/149
For starting ExampleMachine function block, xStart input has set to TRUE.
CASE udtExample.iState OF
0: (* Init *)
IF xStart = TRUE THEN
(* Parameterization of IL_AO_2_UI function block *)
(* Channel selection *)
udtExample.udtANL_IL_AO_2_UI.iSelectCH := 3;
(* Activation of function block *)
udtExample.udtANL_IL_AO_2_UI.xActivate := TRUE;
(* Parameterization of IL_AO_2_UI_Para function block for CH1 *)
(* Voltage mode *)
(* Output range *)
udtExample.arrANL_IL_AO_2_UI_Para[1].iRange := 0;
(* Upper limit value of the standardized range *)
udtExample.arrANL_IL_AO_2_UI_Para[1].rHiLim := 10.0;
(* Lower limit value of the standardized range *)
udtExample.arrANL_IL_AO_2_UI_Para[1].rLoLim := 0.0;
(* Analog value to be output *)
udtExample.arrANL_IL_AO_2_UI_Para[1].rSetValue := 5.0;
(* Parameterization of IL_AO_2_UI_Para function block for CH2 *)
(* Current mode *)
(* Output range *)
udtExample.arrANL_IL_AO_2_UI_Para[2].iRange := 2;
(* Upper limit value of the standardized range *)
udtExample.arrANL_IL_AO_2_UI_Para[2].rHiLim := 20.0;
(* Lower limit value of the standardized range *)
udtExample.arrANL_IL_AO_2_UI_Para[2].rLoLim := 0.0;
(* Analog value to be output *)
udtExample.arrANL_IL_AO_2_UI_Para[2].rSetValue := 10.0;
(* Parameterization of IL_AI_8 function block for CH1 and CH2 *)
(* CH1: Voltage mode *)
(* Selection of filter *)
udtExample.udtANL_IL_AI_8.udtParameter[1].Filter := 0;
(* Measuring range: 0-10V *)
udtExample.udtANL_IL_AI_8.udtParameter[1].Range := 0;
(* Standardization enabled *)
udtExample.udtANL_IL_AI_8.udtParameter[1].Standardization := TRUE;
(* Upper limit value *)
udtExample.udtANL_IL_AI_8.udtParameter[1].LoLim := 0.0;
(* Lower limit value *)
udtExample.udtANL_IL_AI_8.udtParameter[1].HiLim := 10.0;
(* CH2: Current mode *)
(* Selection of filter *)
udtExample.udtANL_IL_AI_8.udtParameter[2].Filter := 0;
(* Measuring range: 0-20mA *)
AnalogTechnology_9 129/149
udtExample.udtANL_IL_AI_8.udtParameter[2].Range := 8;
(* Standardization enabled *)
udtExample.udtANL_IL_AI_8.udtParameter[2].Standardization := TRUE;
(* Upper limit value *)
udtExample.udtANL_IL_AI_8.udtParameter[2].LoLim := 0.0;
(* Lower limit value *)
udtExample.udtANL_IL_AI_8.udtParameter[2].HiLim := 20.0;
(* Selection of used CH1 and CH2 *)
udtExample.udtANL_IL_AI_8.bSelect := BYTE#16#03;
(* Activation of function block *)
udtExample.udtANL_IL_AI_8.xActivate := TRUE;
udtExample.iState := 10;
END_IF;
10: (*Checking for an error of IL_AO_2_UI function block *)
IF
udtExample.udtANL_IL_AO_2_UI.xError = TRUE OR
udtExample.udtANL_IL_AI_8.xError = TRUE
THEN
udtExample.iState := 9000;
ELSE
udtExample.iState := 32000;
END_IF;
9000: (* Error handling *)
(* Insert your error handling here *)
IF xStart = FALSE THEN
udtExample.iState := 32000;
END_IF;
32000: (* Example is finished *)
(* Deactivation of all FBs *)
FOR iChannel := 1 TO 2 DO
udtExample.arrANL_IL_AO_2_UI_Para[iChannel].iRange := 0;
udtExample.arrANL_IL_AO_2_UI_Para[iChannel].rHiLim := 0.0;
udtExample.arrANL_IL_AO_2_UI_Para[iChannel].rLoLim := 0.0;
udtExample.arrANL_IL_AO_2_UI_Para[iChannel].rSetValue := 0.0;
udtExample.udtANL_IL_AI_8.udtParameter[iChannel].Filter := 0;
udtExample.udtANL_IL_AI_8.udtParameter[iChannel].Range := 0;
udtExample.udtANL_IL_AI_8.udtParameter[iChannel].Standardization := FALSE;
udtExample.udtANL_IL_AI_8.udtParameter[iChannel].LoLim := 0.0;
udtExample.udtANL_IL_AI_8.udtParameter[iChannel].HiLim := 0.0;
END_FOR;
udtExample.udtANL_IL_AO_2_UI.iSelectCH := 0;
udtExample.udtANL_IL_AO_2_UI.xActivate := FALSE;
udtExample.udtANL_IL_AI_8.xActivate := FALSE;
IF xStart = FALSE THEN
udtExample.iState := 0;
END_IF;
END_CASE;
iState := udtExample.iState;
AnalogTechnology_9 130/149
In order to be able to evaluate the output voltage and current values of the IB IL AO 2 /SF-PAC (2863083) analog
output module, the IB IL AI 4/EF-PAC (2878447) input module is used additionally.
For starting ExampleMachine function block, xStart input has set to TRUE.
CASE udtExample.iState OF
0: (* Init *)
IF xStart = TRUE THEN
(* Parameterization of IL_AO_Channel function blocks *)
(* CH1 *)
(* Analog value to be outputted *)
udtExample.arrANL_IL_AO_CH[1].rNormValue := 5.0;
(* Upper limit value *)
udtExample.arrANL_IL_AO_CH[1].rHI_Limit := 10.0;
(* Lower limit value *)
udtExample.arrANL_IL_AO_CH[1].rLO_Limit := 0.0;
(* CH2 *)
(* Analog value to be outputted *)
udtExample.arrANL_IL_AO_CH[2].rNormValue := 15.0;
(* Upper limit value *)
udtExample.arrANL_IL_AO_CH[2].rHI_Limit := 20.0;
(* Lower limit value *)
udtExample.arrANL_IL_AO_CH[2].rLO_Limit := 0.0;
(* Parameterization of IL_AO function block *)
(* Resets the function block *)
udtExample.udtANL_IL_AO.xReset := FALSE;
(* Channel selection of CH1 and CH2 *)
AnalogTechnology_9 131/149
udtExample.udtANL_IL_AO.iSelectChannels := 0;
(* Module type 3 = IB IL AO 2/SF *)
udtExample.udtANL_IL_AO.iModulType := 3;
(* Behavior of the outputs in the event of an error *)
udtExample.udtANL_IL_AO.iOutputBehavior := 1;
(* Parameterization of the terminal *)
udtExample.udtANL_IL_AO.iParameters := 1;
(* Parameterization/selection of hardware used *)
(* IB IL AO 2 /SF-PAC (2863083) *)
udtExample.udtANL_IL_AO.bTyp_BP_SF := TRUE;
(* Activation of function blocks *)
udtExample.udtANL_IL_AO.xActivate := TRUE;
(* Parameterization of IL_AI_4_EF function block *)
(* Selection of the operating mode 0= read channel 1-4 *)
udtExample.udtANL_IL_AI_4_EF.iSelect := 0;
(* Configuration of channels:
CH1 = 0-10 V, IL, average 16
CH2 = 0-20 mA, IL, no average *)
udtExample.udtANL_IL_AI_4_EF.dwConfig := DWORD#16#00004800;
(* Resets the block to its initial settings *)
udtExample.udtANL_IL_AI_4_EF.xReset := FALSE;
(* Activation of function block *)
udtExample.udtANL_IL_AI_4_EF.xActivate := TRUE;
udtExample.iState := 10;
END_IF;
10: (* Checking for xError *)
IF
udtExample.udtANL_IL_AI_4_EF.xError = TRUE OR
udtExample.udtANL_IL_AO.xError = TRUE
THEN
udtExample.iState := 9000;
ELSE
udtExample.iState := 32000;
END_IF;
9000: (* Error handling *)
(* Insert your error handling here *)
IF xStart = FALSE THEN
udtExample.iState := 32000;
END_IF;
32000: (* Example is finished *)
(* Deactivation of function blocks *)
FOR iChannel := 1 TO 2 DO
udtExample.arrANL_IL_AO_CH[iChannel].rNormValue := 0.0;
udtExample.arrANL_IL_AO_CH[iChannel].rHI_Limit := 0.0;
udtExample.arrANL_IL_AO_CH[iChannel].rLO_Limit := 0.0;
END_FOR;
udtExample.udtANL_IL_AO.xReset := FALSE;
udtExample.udtANL_IL_AO.iSelectChannels := 0;
udtExample.udtANL_IL_AO.iModulType := 0;
udtExample.udtANL_IL_AO.iOutputBehavior := 0;
udtExample.udtANL_IL_AO.iParameters := 0;
udtExample.udtANL_IL_AO.bTyp_BP_SF := FALSE;
udtExample.udtANL_IL_AO.xActivate := FALSE;
udtExample.udtANL_IL_AI_4_EF.iSelect := 0;
udtExample.udtANL_IL_AI_4_EF.dwConfig := DWORD#16#00000000;
udtExample.udtANL_IL_AI_4_EF.xReset := FALSE;
udtExample.udtANL_IL_AI_4_EF.xActivate := FALSE;
AnalogTechnology_9 132/149
In order to be able to evaluate the output voltage values of the IB IL AO 2/UI-PAC (2700775) analog output module,
the IB IL AI 2/SF-PAC (2861302) input module is used additionally.
CASE udtExample.iState OF
0: (* Init *)
IF xStart = TRUE THEN
(* Parameterization of IL_AO_2_UI function block *)
(* Channel selection *)
udtExample.udtANL_AO2_UI.iSelectCH := 3;
(* Activation of function block *)
udtExample.udtANL_AO2_UI.xActivate := TRUE;
(* Parameterization of IL_AO_2_UI_Para function block for CH1 *)
(* Voltage mode *)
(* Output range *)
udtExample.arrANL_AO2_UI_Para[1].iRange := 0;
(* Upper limit value of the standardized range *)
udtExample.arrANL_AO2_UI_Para[1].rHiLim := 10.0;
(* Lower limit value of the standardized range *)
udtExample.arrANL_AO2_UI_Para[1].rLoLim := 0.0;
(* Analog value to be output *)
udtExample.arrANL_AO2_UI_Para[1].rSetValue := 5.0;
(* Parameterization of IL_AO_2_UI_Para function block for CH2 *)
(* Current mode *)
(* Output range *)
udtExample.arrANL_AO2_UI_Para[2].iRange := 2;
(* Upper limit value of the standardized range *)
udtExample.arrANL_AO2_UI_Para[2].rHiLim := 20.0;
(* Lower limit value of the standardized range *)
udtExample.arrANL_AO2_UI_Para[2].rLoLim := 0.0;
(* Analog value to be output *)
udtExample.arrANL_AO2_UI_Para[2].rSetValue := 10.0;
AnalogTechnology_9 134/149
udtExample.arrANL_AO2_UI_Para[iChannel].rSetValue := 0.0;
udtExample.arrANL_AI2_SF[iChannel].xActivate := FALSE;
udtExample.arrANL_AI2_SF[iChannel].rHI_Limit := 0.0;
udtExample.arrANL_AI2_SF[iChannel].rLO_Limit := 0.0;
udtExample.arrANL_AI2_SF[iChannel].xNoFilter := FALSE;
udtExample.arrANL_AI2_SF[iChannel].iSelectFormat := 0;
udtExample.arrANL_AI2_SF[iChannel].iSelectRange := 0;
END_FOR;
udtExample.udtANL_AO2_UI.iSelectCH := 0;
udtExample.udtANL_AO2_UI.xActivate := FALSE;
IF xStart = FALSE THEN
udtExample.iState := 0;
END_IF;
END_CASE;
iState := udtExample.iState;
AnalogTechnology_9 136/149
In order to be able to evaluate the output voltage values of the IB IL AO 1/SF (2726298) analog output module, the
IB IL AI 2/SF-PAC (2861302) input module is used additionally.
For starting ExampleMachine function block, xStart input has set to TRUE.
CASE udtExample.iState OF
0: (* Init *)
IF xStart = TRUE THEN
(* Parameterization of IL_AO_1_SF function block *)
(* Analog value to be output *)
udtExample.udtANL_IL_AO_1_SF.rNormValue := 10.0;
(* High limit of the normed range *)
udtExample.udtANL_IL_AO_1_SF.rHI_Limit := 20.0;
(* Low limit of the normed range *)
udtExample.udtANL_IL_AO_1_SF.rLO_Limit := 0.0;
(* Activation of function block *)
udtExample.udtANL_IL_AO_1_SF.xActivate := TRUE;
(* Parameterization of IL_AI_2_SF function block *)
(* CH1: current mode *)
(* High limit of the normed range *)
udtExample.udtANL_IL_AI_2_SF.rHI_Limit := 20.0;
(* Low limit of the normed range *)
udtExample.udtANL_IL_AI_2_SF.rLO_Limit := 0.0;
(* Disables filter *)
udtExample.udtANL_IL_AI_2_SF.xNoFilter := FALSE;
(* Chooses IB IL format *)
udtExample.udtANL_IL_AI_2_SF.iSelectFormat := 0;
(* Chooses range 0-20mA *)
udtExample.udtANL_IL_AI_2_SF.iSelectRange := 1;
(* Activates function block *)
AnalogTechnology_9 137/149
udtExample.udtANL_IL_AI_2_SF.xActivate := TRUE;
udtExample.iState := 10;
END_IF;
10: (*Checking for an error of IL_AO_2_UI function block *)
IF
udtExample.udtANL_IL_AO_1_SF.xError = TRUE OR
udtExample.udtANL_IL_AI_2_SF.xError = TRUE
THEN
udtExample.iState := 9000;
ELSE
udtExample.iState := 32000;
END_IF;
9000: (* Error handling *)
(* Insert your error handling here *)
IF xStart = FALSE THEN
udtExample.iState := 32000;
END_IF;
32000: (* Example is finished *)
(* Deactivation of function blocks *)
udtExample.udtANL_IL_AO_1_SF.rNormValue := 0.0;
udtExample.udtANL_IL_AO_1_SF.rHI_Limit := 0.0;
udtExample.udtANL_IL_AO_1_SF.rLO_Limit := 0.0;
udtExample.udtANL_IL_AO_1_SF.xActivate := FALSE;
udtExample.udtANL_IL_AI_2_SF.rHI_Limit := 0.0;
udtExample.udtANL_IL_AI_2_SF.rLO_Limit := 0.0;
udtExample.udtANL_IL_AI_2_SF.xNoFilter := FALSE;
udtExample.udtANL_IL_AI_2_SF.iSelectFormat := 0;
udtExample.udtANL_IL_AI_2_SF.iSelectRange := 0;
udtExample.udtANL_IL_AI_2_SF.xActivate := FALSE;
IF xStart = FALSE THEN
udtExample.iState := 0;
END_IF;
END_CASE;
iState := udtExample.iState;
AnalogTechnology_9 138/149
In order to be able to evaluate the output voltage values of the IB IL AO 1/SF (2726298) analog output module, the
IB IL AI 2/SF-PAC (2861302) input module is used additionally.
For starting ExampleMachine function block, xStart input has set to TRUE.
CASE udtExample.iState OF
0: (* Init *)
IF xStart = TRUE THEN
(* Parameterization of IL_AO_1_SF function block *)
(* Analog value to be output *)
udtExample.udtANL_IL_AO_1_SF.rNormValue := 3000.0;
(* High limit of the normed range *)
udtExample.udtANL_IL_AO_1_SF.rHI_Limit := 4000.0;
(* Low limit of the normed range *)
udtExample.udtANL_IL_AO_1_SF.rLO_Limit := 2000.0;
(* Activation of function block *)
udtExample.udtANL_IL_AO_1_SF.xActivate := TRUE;
(* Parameterization of IL_AI_2_SF function block *)
(* CH1: voltage mode *)
(* High limit of the normed range *)
udtExample.udtANL_IL_AI_2_SF.rHI_Limit := 10.0;
(* Low limit of the normed range *)
udtExample.udtANL_IL_AI_2_SF.rLO_Limit := 0.0;
(* Disables filter *)
udtExample.udtANL_IL_AI_2_SF.xNoFilter := FALSE;
(* Chooses IB IL format *)
udtExample.udtANL_IL_AI_2_SF.iSelectFormat := 0;
(* Chooses range 0-10V *)
udtExample.udtANL_IL_AI_2_SF.iSelectRange := 0;
(* Activates function block *)
AnalogTechnology_9 139/149
udtExample.udtANL_IL_AI_2_SF.xActivate := TRUE;
udtExample.iState := 10;
END_IF;
10: (*Checking for an error of IL_AO_2_UI function block *)
IF
udtExample.udtANL_IL_AO_1_SF.xError = TRUE OR
udtExample.udtANL_IL_AI_2_SF.xError = TRUE
THEN
udtExample.iState := 9000;
ELSE
udtExample.iState := 32000;
END_IF;
9000: (* Error handling *)
(* Insert your error handling here *)
IF xStart = FALSE THEN
udtExample.iState := 32000;
END_IF;
32000: (* Example is finished *)
(* Deactivation of function blocks *)
udtExample.udtANL_IL_AO_1_SF.rNormValue := 0.0;
udtExample.udtANL_IL_AO_1_SF.rHI_Limit := 0.0;
udtExample.udtANL_IL_AO_1_SF.rLO_Limit := 0.0;
udtExample.udtANL_IL_AO_1_SF.xActivate := FALSE;
udtExample.udtANL_IL_AI_2_SF.rHI_Limit := 0.0;
udtExample.udtANL_IL_AI_2_SF.rLO_Limit := 0.0;
udtExample.udtANL_IL_AI_2_SF.xNoFilter := FALSE;
udtExample.udtANL_IL_AI_2_SF.iSelectFormat := 0;
udtExample.udtANL_IL_AI_2_SF.iSelectRange := 0;
udtExample.udtANL_IL_AI_2_SF.xActivate := FALSE;
IF xStart = FALSE THEN
udtExample.iState := 0;
END_IF;
END_CASE;
iState := udtExample.iState;
AnalogTechnology_9 140/149
In order to be able to evaluate the output voltage values of the IB IL AO 4/8/U/BP-PAC (2878036) analog output
module, the IB IL AI 2/SF-PAC (2861302) input module is used additionally.
AnalogTechnology_9 141/149
For starting ExampleMachine function block, xStart input has set to TRUE.
CASE udtExample.iState OF
0: (* Init *)
IF xStart = TRUE THEN
(* Parameterization of IL_AO4_8 function block *)
(* Activation of function block *)
udtExample.udtANL_IL_AO4_8.xActivate := TRUE;
(* Selection of channel 1 *)
udtExample.udtANL_IL_AO4_8.bSelect := BYTE#16#01;
(* Output behavior on bus reset *)
udtExample.udtANL_IL_AO4_8.udtParameter[1].Hold := TRUE;
(* Maximum set point *)
udtExample.udtANL_IL_AO4_8.udtParameter[1].MaxValue := 10.0;
(* Minimum set point *)
udtExample.udtANL_IL_AO4_8.udtParameter[1].MinValue := 0.0;
(* Channel output range *)
udtExample.udtANL_IL_AO4_8.udtParameter[1].Range := 0;
(* Set point *)
udtExample.udtANL_IL_AO4_8.udtParameter[1].Value := 7.5;
(* Parameterization of IL_AI_2_SF function block *)
(* Activation of function block *)
udtExample.udtANL_IL_AI_2_SF.xActivate := TRUE;
(* High limit of the normed range *)
udtExample.udtANL_IL_AI_2_SF.rHI_Limit := 10.0;
(* Low limit of the normed range *)
udtExample.udtANL_IL_AI_2_SF.rLO_Limit := 0.0;
(* Disabling filter *)
udtExample.udtANL_IL_AI_2_SF.xNoFilter := FALSE;
(* Selection of format 0 = IB-IL-Format (15 Bit) *)
udtExample.udtANL_IL_AI_2_SF.iSelectFormat := 0;
(* Selection of range 0 = Unipolar (0-10V) *)
udtExample.udtANL_IL_AI_2_SF.iSelectRange := 0;
udtExample.iState := 10;
END_IF;
10: (* Checking for xError *)
IF
udtExample.udtANL_IL_AO4_8.xError = TRUE OR
udtExample.udtANL_IL_AI_2_SF.xError = TRUE
THEN
udtExample.iState := 9000;
ELSE
udtExample.iState := 32000;
END_IF;
AnalogTechnology_9 142/149
For starting ExampleMachine function block, xStart input has set to TRUE.
CASE udtExample.iState OF
0: (* Wait for xStart *)
IF xStart = TRUE THEN
(* Parameterization of AsynCom_IBS function block *)
(* Connect slot *)
udtExample.udtAsynCom_IBS.strPartner := 'CR2';
(* Channel selection for adjustment *)
(* Selects channel 1 *)
udtExample.arrSGI_2P_EF_Adju[1].bSelect := BYTE#16#01;
(* Selects channel 2 *)
udtExample.arrSGI_2P_EF_Adju[2].bSelect := BYTE#16#02;
(* Selects channels for parameterization *)
(* Selects channel 1 *)
udtExample.arrSGI_2P_EF_Para[1].bSelect := BYTE#16#01;
(* Selects channel 2 *)
udtExample.arrSGI_2P_EF_Para[2].bSelect := BYTE#16#02;
(* Selection of channels for status information *)
(* Selects channel 1 *)
udtExample.arrSGI_2P_EF_Val[1].bSelect := BYTE#16#01;
(* Selects channel 2 *)
udtExample.arrSGI_2P_EF_Val[2].bSelect := BYTE#16#02;
(* Parameterization of ANL_IL_SGI_2P_EF function block *)
(* Select both channels *)
udtExample.udtSGI_2P_EF.bSelect := BYTE#16#00;
(* Add parameter to ANL_IL_SGI_2P_EF_Para function block *)
FOR iIndex := 1 TO 2 DO
(* Setting the filter of the channel *)
udtExample.arrSGI_2P_EF_Para[iIndex].iFilter := 3;
(* Properties of the strain gauge characteristic 0= ±1 mV/V *)
udtExample.arrSGI_2P_EF_Para[iIndex].iCharacteristic := 0;
AnalogTechnology_9 144/149
iState := udtExample.iState;
AnalogTechnology_9 146/149
For starting ExampleMachine function block, xStart input has set to TRUE.
CASE udtExample.iState OF
0: (* Wait for xStart *)
IF xStart = TRUE THEN
(* Parameterization of AsynCom_IBS function block *)
(* Connect slot *)
udtExample.udtAsynCom_IBS.strPartner := 'CR2';
(* Channel selection for adjustment *)
(* Selects channel 1 *)
udtExample.arrSGI_2P_EF_Adju[1].bSelect := BYTE#16#01;
(* Selects channel 2 *)
udtExample.arrSGI_2P_EF_Adju[2].bSelect := BYTE#16#02;
(* Selects channels for parameterization *)
(* Selects channel 1 *)
udtExample.arrSGI_2P_EF_Para[1].bSelect := BYTE#16#01;
(* Selects channel 2 *)
udtExample.arrSGI_2P_EF_Para[2].bSelect := BYTE#16#02;
(* Selection of channels for status information *)
(* Selects channel 1 *)
udtExample.arrSGI_2P_EF_Val[1].bSelect := BYTE#16#01;
(* Selects channel 2 *)
udtExample.arrSGI_2P_EF_Val[2].bSelect := BYTE#16#02;
(* Parameterization of ANL_IL_SGI_2P_EF function block *)
(* Select both channels *)
udtExample.udtSGI_2P_EF.bSelect := BYTE#16#00;
(* Add parameter to ANL_IL_SGI_2P_EF_Para function block *)
FOR iIndex := 1 TO 2 DO
(* Setting the filter of the channel *)
udtExample.arrSGI_2P_EF_Para[iIndex].iFilter := 3;
AnalogTechnology_9 147/149
END_CASE;
iState := udtExample.iState;
AnalogTechnology_9 149/149
21 Support
For technical support please contact your local PHOENIX CONTACT agency
at https://www.phoenixcontact.com
Owner:
PHOENIX CONTACT Electronics GmbH
Business Unit Automation Systems
System Services
Library Services