Download as pdf or txt
Download as pdf or txt
You are on page 1of 19

AXL_Analog_2 1/19

Function block library

AXL_ANALOG_2

for PC Worx
Documentation for
PHOENIX CONTACT function blocks
PHOENIX CONTACT GmbH Co. KG
Flachsmarktstrasse 8
D-32825 Blomberg, Germany
This documentation is available in English only.
AXL_Analog_2 2/19

Table of Contents
1 Installation hint
2 General information
3 Change notes
4 Supported PLCs
5 Function blocks
6 AXL_ANALOG_IN
6.1 Function block call
6.2 Input parameters
6.3 Output parameters
6.4 Diagnosis
7 AXL_ANALOG_OUT
7.1 Function block call
7.2 Input parameters
7.3 Output parameters
7.4 Diagnosis
8 AXL_RTD

8.1 Function block call


8.2 Input parameters
8.3 Output parameters
8.4 Diagnosis
9 Startup examples
9.1 Example 1: AXL_ANL_X_EXA_ANL_IN_OUT
10 Support
AXL_Analog_2 3/19

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 AXL_Analog library provides function blocks for acquisition and evaluation of analog signals in an Axioline
system.
AXL_Analog_2 4/19

3 Change notes
Library version Library build PC Worx version Change notes
2 20211210 6.30.2972 New example:
AXL_ANL_2_EXA_ANL_IN_OUT.zwt
2 20210914 6.30.2972 Updated example:
AXL_ANL_2_EXA_ANL_IN_OUT.zwt
2 20210914 6.30.2972 Added example:
AXL_ANL_2_EXA_ANL_IN_OUT.zwt
2 20210105 6.30.2907 This version additionally supports:

AXL F AI2 AO2 1H (2702072)


AXL SE AI4 I 4-20 (1088062)
AXL SE AI4 U 0-10 (1088104)
AXL SE AO4 I 4-20 (1088123)
AXL SE AO4 U 0-10 (1088126)
AXL SE RTD4 PT100 (1088106)

1.00 20200817 6.10.200 New build based on Markdown documentation


1.00 - 6.10.200 Initial version
New version number: Functional changes of at least one function block, incompatibilities (e.g. change of library
format)
New build number: No functional changes, but changes in the ZIP file (e.g. documentation update, additional
examples)
AXL_Analog_2 5/19

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)
AXL_Analog_2 6/19

5 Function blocks
Function block Description Version Supported License
articles
AXL_Analog_IN Function block for calculating standardized data 2 AXL AI 8 none
values from the process data of the analog input (2688064)
terminals in the Axioline product range. AXL F AI2
AO2 1H
(2702072)
AXL F AI4 I
1H
(2688491)
AXL F AI4
U 1H
(2688501)
AXL SE
AI4 I 4-20
(1088062)
AXL SE
AI4 U 0-10
(1088104)
AXL_Analog_OUT Function block for calculating standardized data 2 AXL AO8 none
values from the process data of the analog output (2688080)
terminals in the Axioline product range. AXL F AI2
AO2 1H
(2702072)
AXL F AO4
1H
(2688527)
AXL SE
AO4 I 4-20
(1088123)
AXL SE
AO4 U 0-
10
(1088126)
AXL_RTD Function block for calculating standardized data 2 AXL F none
values for temperature recording from the process RTD8 1F
data of the input terminals in the Axioline product (2688077)
range. AXL RTD
8-ME
(2688190)
AXL SE
RTD4
PT100
(1088106)
AXL_Analog_2 7/19

6 AXL_ANALOG_IN
The AXL_ANALOG_IN block uses the process data from the analog input terminal blocks of the Axioline product
range to calculate standardized data values for further processing by the control program.
The analog input channels can be in the local bus of a class AXC controller or in PROFINET stations after an AXL
BK PN bus coupler.
To standardize the analog values, create a global variable for linking the block to the process data of the analog
terminal block and connect the variable using the iAnalogIn input. In addition, when accessing an analog terminal
block within a PROFINET IO station, the “PNIO Data Valid” status of the bus coupler can be transferred to the
block. This status enables the block to also monitor the PROFINET connection and the validity of the incoming
process data.
As well as linking the global variables, various parameters are transferred to the block. The rLimitLow and
rLimitHigh inputs indicate the lower and upper limit values for the program variables. For example, an analog input
current ranging from 4 to 20 mA corresponds in the program to values ranging from 0.0 to 100.0, which are
converted by the block. For this standardization, the block expects information about the selected input range at
the iRange input. The configuration of the input range of the analog channel can be found in the “Bus Structure” of
PC WORX in the “Device parameters” view for the analog terminal block. The iSubstitute parameter can be used to
determine how the block should deal with its rValue output in the event that an abnormal operating state is
detected.
Once the block has been configured and connected to the hardware, the rValue output directly provides the real
value, which can be used in your calculations. Each block call processes the current value of the global process
data variables and transfers it to the data value at the block output. If the block does not detect an error, the xValid
output is set to True. Invalid input parameters such as the output range, substitute value behavior or limit values are
indicated by the value False and a corresponding diagnostic status at the xValid output. This is also used to
indicate that the bus coupler is not providing valid process data (possibly due to a connection error) or that the
analog terminal block is indicating an error. In the event of a hardware error message, the wStatus output provides
diagnostic information directly according to the description in the terminal block data sheet.
In the event of an abnormal operating state such as a communication error or a sensor error, the rValue output is
typically set to the value REAL#0.0. To hold the last valid value, select the value Integer#1 for the iSubstitute input
or use the value Integer#2 to set the rValue output to the lower limit value.

6.1 Function block call


AXL_Analog_2 8/19

6.2 Input parameters


Name Type Description
iAnalogIn INT Process data value of the analog input.
xPnioDataValid BOOL Status PNIO_DATA_VALID for the connection between controller and PROFINET IO
bus coupler. When accessing an analog channel in the local bus of an AXC type
controller, set this input to the value BOOL#TRUE.
rLimitLow REAL Lower limit value of the standardized data value (default value is REAL#0.0).
rLimitHigh REAL Upper limit value of the standardized data value (default value is REAL#10.0).
iRange INT Input range of the analog channel, see below.
This parameter must correspond to the parameterization of the analog channel.
iSubstitute INT Substitute value behavior for the rValue output in the event of invalid block
parameterization:
INT#0: output value REAL#0.0 (default value)
INT#1: last valid output value is held
INT#2: output of lower limit value

6.2.1 iRange

0 - 10 V ±10 V
0-5V ±5 V 4 -20 mA
0 - 20 mA ±20 mA
AXL AI 8 (2688064) 1 2 3
AXL F AI2 AO2 1H (2702072) 1 2 3
AXL F AI4 I 1H (2688491) 1 2 3
AXL F AI4 U 1H (2688501) 1 2 -
AXL SE AI4 I 4-20 (1088062) - - 5
AXL SE AI4 U 0-10 (1088104) 4 - -

6.3 Output parameters


Name Type Description
rValue REAL Data value in the standardized value range.
xValid BOOL Status for the standardized input value:
TRUE: input value is read in by the block, standardized, and output.
FALSE: PNIO communication error, sensor error or invalid input parameters at the block.
In the event of an error, the wStatus output provides additional information.
wStatus WORD Information for diagnostics of the internal block function, process data communication, and
signal acquisition. See overview in the diagnostics section.
AXL_Analog_2 9/19

6.4 Diagnosis
DiagCode Description
16#0000 No information available.
16#0C01 The entry for the input range (iRange) is invalid.
16#0C02 The entries for the limit values (rLimitLow and rLimitHigh) are invalid.
16#0C03 The entry for the substitute value behavior (iSubstitute) is invalid.
16#0C20 The process data of the PROFINET IO device is invalid (“PNIO Data Valid” status).
16#8001 Sensor error – measuring range exceeded (overrange).
16#8002 Sensor error – open circuit.
16#8004 Sensor error – no valid measured value available.
16#8020 Sensor error – supply voltage faulty.
16#8040 Sensor error – channel faulty.
16#8080 Sensor error – below measuring range (underrange).
16#80xx For other sensor errors, refer to the data sheet for the analog terminal block used.
AXL_Analog_2 10/19

7 AXL_ANALOG_OUT
The AXL_ANALOG_OUT block uses the standardized data values of the control program to calculate the relevant
process data for the analog output terminal blocks of the Axioline product range. The analog output channels can
be in the local bus of a class AXC controller or in PROFINET stations after an AXL BK PN bus coupler.
To output the analog values, create a global variable for linking the block to the process data of the analog terminal
block and connect the variable using the AnalogOut output and the iAnalogIn input. Reading back the process data
of the terminal block enables the block to provide extended diagnostics for the actuator. In addition, when
accessing an analog terminal block within a PROFINET IO station, the “PNIO Data Valid” status of the bus coupler
can be transferred to the block. This status enables the block to also monitor the PROFINET connection and the
validity of the incoming process data.
As well as linking the global variables, various parameters are transferred to the block. The rLimitLow and
rLimitHigh inputs indicate the lower and upper limit values for the program variables. For example, your program
variable takes values ranging from 0.0 to 100.0, which are converted by the block to an analog output current with
values ranging from 4 to 20 mA. For this standardization, the block expects information about the selected output
range at the iRange input. The configuration of the output range of the analog channel can be found in the “Bus
Structure” of PC WORX in the “Device parameters” view for the analog terminal block. The iSubstitute parameter
can be used to determine how the block should deal with its iAnalogOut output in the event that an abnormal
operating state is detected.
Once the block has been configured and connected to the hardware, create your real program variable directly at
the rValue input, which can be used in your calculations. Each block call processes the current data value and
transfers it to the global process data variables at the block output. If the block does not detect an error, the xValid
output is set to True. Invalid input parameters such as the output range, substitute value behavior or limit values are
indicated by the value False and a corresponding diagnostic status at the xValid output. This is also used to
indicate that the bus coupler is not providing valid process data (possibly due to a connection error) or that the
analog terminal block is indicating an error. In the event of a hardware error message, the wStatus output provides
diagnostic information directly according to the description in the terminal block data sheet.
In the event of an abnormal operating state, typically the iAnalogOut output is set to 0, and on request in the event
of invalid values for the output range or the entry of a lower limit value greater than the entry for the upper limit
value, the last valid process data item is output. To hold the last valid value, select the value Integer#1 for the
iSubstitute input. If the value of the rValue program variable is greater than the upper limit, the iAnalogOut output is
set to the maximum output value (e.g., +10 V, +20 mA, +5 V, etc.). If the value is below the lower limit value, the
minimum output value (0 V, 0 mA, -5 V, etc.) is selected.

7.1 Function block call


AXL_Analog_2 11/19

7.2 Input parameters


Name Type Description
rValue REAL Data value in the standardized value range.
rLimitLow REAL Lower limit value of the standardized data value (default value is REAL#0.0).
rLimitHigh REAL Upper limit value of the standardized data value (default value is REAL#10.0).
iRange INT Output range of the analog channel, see below
This parameter must correspond to the parameterization of the analog channel.
iSubstitute INT Substitute value behavior for the rValue output in the event of invalid block
parameterization:
INT#0: output value REAL#0.0 (default value)
INT#1: last valid output value is held
iAnalogIn INT Process data item of the analog channel for diagnostic purposes (actuator error).
xPnioDataValid BOOL Status PNIO_DATA_VALID for the connection between controller and PROFINET IO
bus coupler. When accessing an analog channel in the local bus of an AXC type
controller, set this input to the value BOOL#TRUE.

7.2.1 iRange

0 - 10 V ±10 V
0-5V ±5 V 4 -20 mA
0 - 20 mA ±20 mA
AXL AO8 (2688080) 1 2 3
AXL F AI2 AO2 1H (2702072) 1 2 3
AXL F AO4 1H (2688527) 1 2 3
AXL SE AO4 I 4-20 (1088123) - - 4
AXL SE AO4 U 0-10 (1088126) 5 - -

7.3 Output parameters


Name Type Description
iAnalogOut INT Process data value for the analog output.
xValid BOOL Status for output of the analog value:
TRUE: output value is calculated, transferred to the output module, and output.
FALSE: PNIO communication error, actuator error, invalid input parameters at the block
or data value outside the limit values.
In the event of an error, the wStatus output provides additional information.
wStatus WORD Information for diagnostics of the internal block function, process data communication,
and signal acquisition. See overview in the diagnostics section.
AXL_Analog_2 12/19

7.4 Diagnosis
DiagCode Description
16#0000 No information available.
16#0C01 The entry for the output range (iRange) is invalid.
16#0C02 The entries for the limit values (rLimitLow and rLimitHigh) are invalid.
16#0C03 The entry for the substitute value behavior (iSubstitute) is invalid.
16#0C04 The data value is less than the lower limit value. The process data value is set to the minimum
value.
16#0C05 The data value is greater than the upper limit value. The process data value is set to the maximum
value.
16#0C20 The process data of the PROFINET IO device is invalid (“PNIO Data Valid” status).
16#8002 Actuar error – open circuit.
16#8003 Actuator error – short circuit.
16#8010 Actuator error – parameter table invalid.
16#8020 Actuator error – supply voltage faulty.
16#8040 Actuator error – channel faulty.
16#80xx For other actuator errors, refer to the data sheet for the analog terminal block used.
AXL_Analog_2 13/19

8 AXL_RTD
The AXL_RTD block uses the process data from the input terminal blocks of the Axioline product range for
temperature recording to calculate standardized data values for further processing by the control program.
This block provides support in the processing of signals from terminal blocks for temperature recording in the
Axioline product range. The analog input channels can be in the local bus of a class AXC controller or in
PROFINET stations after an AXL BK PN bus coupler.
To standardize the analog values, create a global variable for linking the block to the process data of the analog
terminal block and connect the variable using the iAnalogIn input. In addition, when accessing an analog terminal
block within a PROFINET IO station, the “PNIO Data Valid” status of the bus coupler can be transferred to the
block. This status enables the block to also monitor the PROFINET connection and the validity of the incoming
process data.
As well as linking the global variables, various parameters are transferred to the block. For the preparation of
process data at the iResolution input, the block expects information about the selected resolution. The
configuration of the resolution of the analog channel can be found in the “Bus Structure” of PC WORX in the “Device
parameters” view for the terminal block. The iSubstitute parameter can be used to determine how the block should
deal with its rValue output in the event that an abnormal operating state is detected.
Once the block has been configured and connected to the hardware, the real value is available directly at the
rValue output, which can be used in your calculations. Each block call processes the current value of the global
process data variables and transfers it to the data value at the block output. If the block does not detect an error,
the xValid output is set to True. Invalid input parameters for the resolution of the substitute value behavior are
indicated by the value False and a corresponding diagnostic status at the xValid output. This is also used to
indicate that the bus coupler is not providing valid process data (possibly due to a connection error) or that the
terminal block is indicating an error. In the event of a hardware error message, the wStatus output provides
diagnostic information directly according to the description in the terminal block data sheet.
In the event of an abnormal operating state such as a communication error or a sensor error, the rValue output is
typically set to the value REAL#0.0. To hold the last valid value, select the value Integer#1 for the iSubstitute input.

8.1 Function block call


AXL_Analog_2 14/19

8.2 Input parameters


Name Type Description
iAnalogIn INT Process data value of the analog input.
xPnioDataValid BOOL Status PNIO_DATA_VALID for the connection between controller and PROFINET IO
bus coupler. When accessing an analog channel in the local bus of an AXC type
controller, set this input to the value BOOL#TRUE.
iResolution INT Resolution of the analog channel:
INT#0 – 1
INT#1 – 0.1 (default value)
INT#2 – 0.01
This parameter must correspond to the parameterization of the analog channel.
iSubstitute INT Substitute value behavior for the rValue output in the event of invalid block
parameterization:
INT#0 – output value REAL#0.0 (default value)
INT#1 – last valid output value is held

8.3 Output parameters


Name Type Description
rValue REAL Data value depending on the selected resolution.
xValid BOOL Status for the standardized input value:
TRUE: input value is read in by the block, prepared, and output.
FALSE: PNIO communication error, sensor error or invalid input parameters at the block.
In the event of an error, the wStatus output provides additional information.
wStatus WORD IInformation for diagnostics of the internal block function, process data communication,
and signal acquisition. See overview in the diagnostics section.

8.4 Diagnosis
DiagCode Description
16#0000 No information available.
16#0C03 The entry for the substitute value behavior (iSubstitute) is invalid.
16#0C06 The entry for the resolution is invalid.
16#0C20 The process data of the PROFINET IO device is invalid (“PNIO Data Valid” status).
16#8001 Sensor error – measuring range exceeded (overrange).
16#8002 Sensor error – open circuit.
16#8004 Sensor error – no valid measured value available.
16#8010 Sensor error – parameter table invalid.
16#8020 Sensor error – supply voltage faulty.
16#8040 Sensor error – channel faulty.
16#8080 Sensor error – below measuring range (underrange).
16#80xx For other sensor errors, refer to the data sheet for the analog terminal block used.
AXL_Analog_2 15/19

9 Startup examples
For the startup instruction of the AXL_ANALOG_IN and AXL_ANALOG_OUT function blocks please find the
following example:

AXL_ANL_*_EXA_ANL_IN_OUT.zwt

This example is packed in the zipped Examples folder of the library.

9.1 Example 1: AXL_ANL_X_EXA_ANL_IN_OUT


9.1.1 Bus structure
For this example, the following hardware is used:

AXC 1050 (2700988)


AXL F AI2 AO2 1H (2702072)

The analog output supplies the voltage and also the current for the analog input.
AXL_Analog_2 16/19

9.1.2 Example description


In this example, CH 1 of the Axioline analog input and output module is parameterized in voltage mode and CH 2 in
current mode.
Before you instantiate the AXL_ANALOG_IN and AXL_ANALOG_OUT function blocks, you must configure the
input and output range of the AXL F AI2 AO2 1H (2702072) module at the “Device parameters” view in your PC
Worx application.
Please note, a second global variable can be created for the “PNIO Data Valid” status of a PROFINET bus coupler
as an option. Otherwise, set the xPnioDataValid input to TRUE.

9.1.2.1 Example machine

For starting ExampleMachine function block, xStart input has set to TRUE.

9.1.2.2 State machine

CASE udtExample.iState OF
0: (* Init *)
IF xStart = TRUE THEN
(* Init AXL_ANALOG_OUT function blocks *)
(* Channel 1 in voltage mode *)
(* Data value in the standardized value range*)
udtExample.arrAXL_ANL_OUT[1].rValue := 5.0;
(* Lower limit value of the standardized data value *)
udtExample.arrAXL_ANL_OUT[1].rLimitLow := 0.0;
(* Higher limit value of the standardized data value *)
udtExample.arrAXL_ANL_OUT[1].rLimitHigh := 10.0;
(* Output range of the analog channel *)
udtExample.arrAXL_ANL_OUT[1].iRange := 1;
(* Substitute value behavior for the rValue output *)
udtExample.arrAXL_ANL_OUT[1].iSubstitute := 0;
(* Status PNIO_DATA_VALID *)
udtExample.arrAXL_ANL_OUT[1].xPnioDataValid := TRUE;
(* Channel 2 in current mode *)
(* Data value in the standardized value range*)
udtExample.arrAXL_ANL_OUT[2].rValue := 10.0;
(* Lower limit value of the standardized data value *)
udtExample.arrAXL_ANL_OUT[2].rLimitLow := 0.0;
(* Higher limit value of the standardized data value *)
udtExample.arrAXL_ANL_OUT[2].rLimitHigh := 20.0;
(* Output range of the analog channel *)
udtExample.arrAXL_ANL_OUT[2].iRange := 1;
(* Substitute value behavior for the rValue output *)
udtExample.arrAXL_ANL_OUT[2].iSubstitute := 0;
(* Status PNIO_DATA_VALID *)
udtExample.arrAXL_ANL_OUT[2].xPnioDataValid := TRUE;
(* Init AXL_ANALOG_IN function blocks *)
(* Channel 1 in voltage mode *)
(* Status PNIO_DATA_VALID *)
AXL_Analog_2 17/19

udtExample.arrAXL_ANL_IN[1].xPnioDataValid := TRUE;
(* Lower limit value of the standardized data value *)
udtExample.arrAXL_ANL_IN[1].rLimitLow := 0.0;
(* Higher limit value of the standardized data value *)
udtExample.arrAXL_ANL_IN[1].rLimitHigh := 10.0;
(* Input range of the analog channel *)
udtExample.arrAXL_ANL_IN[1].iRange := 1;
(* Substitute value behavior for the rValue output *)
udtExample.arrAXL_ANL_IN[1].iSubstitute := 0;
(* Channel 2 in current mode *)
(* Status PNIO_DATA_VALID *)
udtExample.arrAXL_ANL_IN[2].xPnioDataValid := TRUE;
(* Lower limit value of the standardized data value *)
udtExample.arrAXL_ANL_IN[2].rLimitLow := 0.0;
(* Higher limit value of the standardized data value *)
udtExample.arrAXL_ANL_IN[2].rLimitHigh := 20.0;
(* Input range of the analog channel *)
udtExample.arrAXL_ANL_IN[2].iRange := 1;
(* Substitute value behavior for the rValue output *)
udtExample.arrAXL_ANL_IN[2].iSubstitute := 0;
udtExample.iState := 10;
END_IF;
10: (* Waiting for xValid *)
For iChannel := 1 TO 2 DO
IF
udtExample.arrAXL_ANL_OUT[iChannel].xValid = FALSE OR
udtExample.arrAXL_ANL_IN[iChannel].xValid = FALSE
THEN
udtExample.iState := 9000;
ELSE
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 FBs *)
For iChannel := 1 TO 2 DO
udtExample.arrAXL_ANL_OUT[iChannel].rValue := 0.0;
udtExample.arrAXL_ANL_OUT[iChannel].rLimitLow := 0.0;
udtExample.arrAXL_ANL_OUT[iChannel].rLimitHigh := 0.0;
udtExample.arrAXL_ANL_OUT[iChannel].iRange := 0;
udtExample.arrAXL_ANL_OUT[iChannel].iSubstitute := 0;
udtExample.arrAXL_ANL_OUT[iChannel].xPnioDataValid := FALSE;
udtExample.arrAXL_ANL_IN[iChannel].xPnioDataValid := FALSE;
udtExample.arrAXL_ANL_IN[iChannel].rLimitLow := 0.0;
udtExample.arrAXL_ANL_IN[iChannel].rLimitHigh := 0.0;
udtExample.arrAXL_ANL_IN[iChannel].iRange := 0;
udtExample.arrAXL_ANL_IN[iChannel].iSubstitute := 0;
END_FOR;
IF xStart = FALSE THEN
udtExample.iState := 0;
END_IF;
END_CASE;
AXL_Analog_2 18/19

iState := udtExample.iState;
AXL_Analog_2 19/19

10 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

You might also like