X20AP3111, X20AP3121 and X20AP3131 - Dial-Comp

X20AP3111, X20AP3121 and X20AP3131
X20AP3111, X20AP3121 and X20AP3131
1 General information
Power monitoring
These modules measure active, reactive and apparent power individually for each of the three phases and for
all of them collectively. The power consumption of each phase and the total sum is also recorded. In addition,
the modules provide the RMS values for voltage and current on the three phases. When measuring the current,
the value of the current through the neutral line can also be detected and monitored. Measurement of the mains
frequency and the phase angle of the three phases (current and voltage) complete the power measurement data.
Energy management
The integrated functions on the modules map the immediate power requirements of the machine in detail and also
record its total power consumption. For the user, all relevant data is prepared and made available in the process
image.
The ability to measure currents and voltages up to the 31st harmonic enables higher precision recording of RMS
values. This allows the modules to easily cope with irregular sine curves, and makes them well-suited to renewable
energy applications. In these types of applications, being able to accurately measure the frequency at a resolution
of 0.01 Hz between 45-65 Hz is a great advantage. In general, the modules are suitable for use with 1-phase, 2phase or 3-phase power mains.
Features
•
•
•
•
•
•
•
Record RMS values from currents and voltages
Measure active, reactive and apparent power
Measure active, reactive and apparent energy
Phasing detection
Measurement of individual phases and cumulative values
Optional measurement of current through the neutral line
High-precision frequency and harmonic measurement
2 Order data
Model number
X20AP3111
X20AP3121
X20AP3131
Short description
Analog input modules
X20 engergy measurement module, 3 analog inputs 480 VAC, 50/60 Hz, 4 analog inputs 20 mA
AC, calculation of effective, apparent, reactive power and reactive energy, calculation of RMS
values, 240 V coded
X20 engergy measurement module, 3 analog inputs 480 VAC, 50/60 Hz, 4 analog inputs 1 A
AC, calculation of effective, apparent, reactive power and reactive energy, calculation of RMS
values, 240 V coded
X20 engergy measurement module, 3 analog inputs 480 VAC, 50/60 Hz, 4 analog inputs 5 A
AC, calculation of effective, apparent, reactive power and reactive energy, calculation of RMS
values, 240 V coded
Table 1: X20AP3111, X20AP3121, X20AP3131 - Order data
Data sheet V 1.01
1
X20AP3111, X20AP3121 and X20AP3131
Required accessories
Bus modules
X20 bus module, 240 V coded, for double wide modules, internal I/O supply is interconnected
Terminal blocks
X20 terminal block, 12-pin, 240 V coded
X20BM32
X20TB32
Table 1: X20AP3111, X20AP3121, X20AP3131 - Order data
3 Technical data
Product ID
Short description
I/O module
General information
B&R ID code
Status indicators
Diagnostics
Module run/error
Inputs
Power consumption
Bus
I/O internal
Additional module power dissipation [W]
Electrical isolation
Channel - Bus
Channel - Channel
Isolation voltage
Inputs - Bus / I/O supply
Inputs - Ground
Bus / I/O supply - Ground
Certification
CE
c-UL-us
GOST-R
Voltage inputs
Number of phases
Rated voltage (between phases)
Nominal voltage (phase against N)
Maximum overload voltage
Rated frequency
Current inputs
Quantity
Nominal current
Secondary
Primary
Maximum overload current
X20AP3111
X20AP3121
X20AP3131
3-phase power and energy measurement module
0xC9DA
0xC9DB
I/O function per channel, operating state, module status
0xC9DC
Yes, using status LED and software status
Yes, using status LED and software status
0.85 W
40 mW 1)
2 W 1)
Yes
No
5500 VDC
5500 VDC
510 VAC
Yes
In preparation
Yes
3
Max. 480 VAC
Max. 277 VAC
1.5 x UN permanent
2 x UN for 1 min
50 and 60 Hz
4 AC inputs
20 mA
1A
5A
65 A directly configurable, larger values through conversion in the application 2)
20 x IN for 0.5 s
8 x IN for 0.5 s
Load
Measurement precision
URMS and IRMS
25 Ω
500 mΩ
20 mΩ
<0.5%
Effective, reactive and apparent power
Frequency, power factor and phase angle
Active energy per phase and total
Power factor = 1.0
Power factor = 0.5 L
Power factor = 0.8 C
Reactive energy per phase and total
sin ϕ = 1.0
sin ϕ = 0.5 L
sin ϕ = 0.8 C
Apparent energy
Per phase and arithmetic total
Vector sum
Active energy of fundamental frequency per phase
and total
Power factor = 1.0
Power factor = 0.5 L
Power factor = 0.8 C
Active energy of harmonics per phase and total
sin ϕ = 1.0
sin ϕ = 0.5 L
sin ϕ = 0.8 C
Operating conditions
Mounting orientation
<0.5% on average
<0.5% 3)
0.1% 4)
0.1% 5)
0.1% 3)
0.2% 4)
0.2% 5)
0.2% 3)
0.2%
0.5%
0.2% 4)
0.2% 5)
0.2% 3)
0.5% 4)
0.5% 5)
0.5% 3)
Table 2: X20AP3111, X20AP3121, X20AP3131 - Technical data
2
Data sheet V 1.01
X20AP3111, X20AP3121 and X20AP3131
Product ID
Horizontal
Vertical
Installation at altitudes above sea level
0 to 2000 m
> 2000 m
EN 60529 protection
Environmental conditions
Temperature
Operation
Horizontal installation
Vertical installation
Derating
Storage
Transport
Relative humidity
Operation
Storage
Transport
Mechanical characteristics
Note
X20AP3111
X20AP3121
Yes
Yes
X20AP3131
No limitations
Reduction of ambient temperature by 0,5°C per 100 m
IP20
-25 to 60°C
-25 to 50°C
-40 to 85°C
-40 to 85°C
5 to 95%, non-condensing
5 to 95%, non-condensing
5 to 95%, non-condensing
Order 1x X20TB32 terminal block separately
Order 1x X20BM32 bus module separately
25 +0.2 mm
Spacing
Table 2: X20AP3111, X20AP3121, X20AP3131 - Technical data
1)
2)
3)
4)
5)
Power dissipation of current measurement shunts
For measuring higher current values, see section "Pinout, current transformer".
From 0.151 VAC to 480 VAC
From 0.101 VAC to 480 VAC
From 0.126 VAC to 480 VAC
4 Status LEDs
Image
LED
Color
Operating status
r
Green
Status
Description
Off
Single flash
Blinking quickly
Blinking slowly
On
Module supply not connected
Unlink mode
Sync mode
PREOPERATIONAL mode
RUN mode
Off
On
Module supply not connected or everything is OK
Error or reset status
Analog input voltage
U1 - U3
Green / yellow Off
Display disabled or URMS < "Fail" threshold value
Module status
e
Red
Green
Yellow
Blinking
Phase sequence is correct and URMS < "Warning" threshold value
On
Phase sequence is correct and URMS > "Warning" threshold value
Blinking
Phase sequence is incorrect and URMS < "Warning" threshold value
On
Phase sequence is incorrect and URMS > "Warning" threshold value
Analog input current
I1 - I3
Green / yellow Off
Green
On
Yellow
On
Analog input neutral current
IN
Red
Off
On
Display disabled or IRMS < "Display" threshold value
Active power positive
Active power negative
Neutral current monitoring disabled
Neutral current > threshold value
Table 3: Status LEDs
Data sheet V 1.01
3
X20AP3111, X20AP3121 and X20AP3131
X20 AP 3111
5 Pinout
r e
U1 I1
U2 I2
U3 I3
IN
U L1
I L1a
U L2
I L1b
U L3
I L2a
I Na
I L2b
I Nb
I L3a
UN
I L3b
Figure 1: Pinout
Danger!
Risk of electric shock!
The terminal block must only be allowed to conduct voltage when it is inserted. It must not under any
circumstances be removed or inserted when voltage is applied or have voltage applied to it when it
is removed.
Current converter
Potential-free measurement of the AC current requires a current transformer. The current transformer is a transducer that delivers a secondary current proportional to the primary current. This secondary current is measured
by the module. The maximum primary current that can be configured directly is 65 A. Values higher than 65 A
can also be measured by implementing a transformation in the software application (see explanation and example
provided below). The maximum secondary current depends on the module:
Module
X20AP3111
X20AP3121
X20AP3131
Secondary current
20 mA
1A
5A
The rated voltage ratio is calculated using the following formula:
Rated voltage ratio K n =
Primary rated current
Secondary rated current
A smaller rated voltage ratio should be defined for measuring higher primary currents. The values calculated by
the module must be converted in the application according to the real transformation ratio that must be defined.
Example:
Currents of up to 100 A are flowing on the primary side. A current transformer with a rated voltage
ratio of 100/1 A is used. A rated voltage ratio of 50/1 A is defined in the module according to
the current transformer. If the primary current calculated by the module is 40 A, then the actual
value will be calculated as follows:
Actual primary current = 40 A * 100 / 50 = 80 A
Note:
The same factor must be used for all power ratings and energy values when making the
transformation.
Caution!
To prevent damaging the module, you must ensure the current inputs are electrically isolated. This is
done by connecting one transformer for each current input that is being used.
Any other devices connected to this secondary circuit must also be electrically isolated (also see
"Figure 3: Input circuit diagram of current inputs" on page 5)!
4
Data sheet V 1.01
X20AP3111, X20AP3121 and X20AP3131
6 Input circuit diagram
AC voltage inputs
Protective impedance
Anti-aliasing filter
A/D
converter
U Lx
Input value
Filter
UN
Figure 2: Input circuit diagram of voltage inputs
AC current inputs
External
Current converter
I xa
Measuring shunts
Anti-aliasing filter
A/D
converter
I xb
Input value
UN
Figure 3: Input circuit diagram of current inputs
7 Typical connection examples for different mains configurations
General information
There are many different mains configurations around the world. This section will present a few typical connection
examples.
Connection example 1 - Mains A
This example involves a 3-element, 3-phase, 4-line star measurement with grounded neutral conductor and optional
fault current detection.
U L1
U L2
U L3
UN
I L1a
I L1b
I L2a
I L2b
I L3a
I L3b
Optional
I Na
I Nb
L1 L2 L3 N
Figure 4: Supported mains configuration A
Data sheet V 1.01
5
X20AP3111, X20AP3121 and X20AP3131
Connection example 2 - Mains B
This example involves a 3-element, 3-phase, 3-line star measurement.
U L1
U L2
U L3
UN
I L1a
I L1b
I L2a
I L2b
I L3a
I L3b
I Na
I Nb
L1 L2 L3
Figure 5: Supported mains configuration B
Connection example 3 - Mains C
This example involves a 3-element, 3-phase, 3-line star measurement with grounded neutral conductor and optional
fault current detection.
U L1
U L2
U L3
UN
I L1a
I L1b
I L2a
I L2b
I L3a
I L3b
Optional
I Na
I Nb
L1 L2 L3
Figure 6: Supported mains configuration C
6
Data sheet V 1.01
X20AP3111, X20AP3121 and X20AP3131
Connection example 4 - Mains D
This example involves a 3-element, 3-phase, 4-line star measurement with optional fault current detection.
U L1
U L2
U L3
UN
I L1a
I L1b
I L2a
I L2b
I L3a
I L3b
Optional
I Na
I Nb
L1 L2 L3 N
Figure 7: Supported mains configuration D
Connection example 5 - Mains E
This example involves a 2-element, 2-phase, 3-line star measurement with grounded neutral line conductor.
U L1
U L2
U L3
UN
I L1a
I L1b
I L2a
I L2b
I L3a
I L3b
Optional
L1
I Na
I Nb
L3 N
Figure 8: Supported mains configuration E
Data sheet V 1.01
7
X20AP3111, X20AP3121 and X20AP3131
Connection example 6 - Mains F
This example involves a 3-element, 3-phase, 3-line delta measurement.
U L1
U L2
U L3
UN
I L1a
I L1b
I L2a
I L2b
I L3a
I L3b
I Na
I Nb
L1 L2 L3
Figure 9: Supported mains configuration F
Connection example 7 - Mains G
This example involves a 3-element, 3-phase, 4-line delta measurement with grounded neutral.
Information:
The maximum voltage value specified in the data sheet must not be exceeded!
U L1
U L2
U L3
UN
I L1a
I L1b
I L2a
I L2b
I L3a
I L3b
Optional
I Na
I Nb
L1 L2 L3 N
Figure 10: Supported mains configuration G
8
Data sheet V 1.01
X20AP3111, X20AP3121 and X20AP3131
8 Register description
8.1 Register overview - Standard
Register
Name
Data type
Read
Cyclic
Standard registers
2
4
6
8
12
130
PmeanT
QmeanT
SmeanT
AEnergyT
REnergyT
StatusInput
CntPulseActive
CntPulseApparent
CntPulseActiveFund
CntPulseActiveHarm
ZeroCrossA
ZeroCrossB
ZeroCrossC
RBTrigDFT
RBUpdateEnergy
RBClearEnergy
RBForceEnergy
194
ControlOutput
TrigDFT
EnabEnergy
ClearEnergy
ForceEnergy
Analog status registers
266
SysStatus1
270
SysStatus2
274
SysStatus3
278
SysStatus4
265
SystemStatusSel01
SumStatusPhaseLoss
SumStatusPhaseWarning
ErrOrderPhasecurrent
ErrOrderPhaseVoltage
271
SystemStatusSel02
SumStatusWarningTHDCurrent
SumStatusWarningTHDVoltage
ErrIrmsNCalc
ErrIrmsNMeas
278
PhaseStatus
LossPhaseC
LossPhaseB
LossPhaseA
WarningPhaseC
WarningPhaseB
WarningPhaseA
Analog RMS registers
290
IrmsN (measured)
294
UrmsA
298
UrmsB
302
UrmsC
306
IrmsNcalc (calculated)
310
IrmsA
314
IrmsB
318
IrmsC
Analog THD and angle registers
538
Freq
542
PAngleA
546
PAngleB
550
PAngleC
554
Temperature
558
UAngleA
562
UAngleB
564
UAngleC
Analog power registers
778
PmeanT
782
PmeanA
786
PmeanB
790
PmeanC
Data sheet V 1.01
INT
INT
INT
DINT
DINT
UINT
Bit 0
Bit 1
Bit 2
Bit 3
Bit 4
Bit 5
Bit 6
Bit 8
Bit 9
Bit 10
Bit 11
UINT
Bit 0
Bit 1
Bit 2
Bit 3
●
●
●
●
●
●
UINT
UINT
UINT
UINT
USINT
Bit 2
Bit 3
Bit 6
Bit 7
USINT
Bit 2
Bit 3
Bit 6
Bit 7
UINT
Bit 0
Bit 1
Bit 2
Bit 4
Bit 5
Bit 6
●
●
●
●
●
UINT
UINT
UINT
UINT
UINT
UINT
UINT
UINT
●
●
●
●
●
●
●
●
UINT
INT
INT
INT
INT
INT
INT
INT
●
●
●
●
●
●
●
●
INT
INT
INT
INT
●
●
●
●
Write
Acyclic
Cyclic
Acyclic
●
●
●
9
X20AP3111, X20AP3121 and X20AP3131
Register
Name
794
QmeanT
798
QmeanA
802
QmeanB
806
QmeanC
810
SmeanT
814
SmeanA
818
SmeanB
822
SmeanC
826
PFmeanT
830
PFmeanA
834
PFmeanB
838
PFmeanC
Analog energy registers
4108
APenergyT
4116
APenergyA
4124
APenergyB
4132
APenergyC
4140
ANenergyT
4148
ANenergyA
4156
ANenergyB
4164
ANenergyC
4172
RPenergyT
4180
RPenergyA
4188
RPenergyB
4196
RPenergyC
4204
RNenergyT
4212
RNenergyA
4220
RNenergyB
4228
RNenergyC
4236
SAenergyT
4244
SenergyA
4252
SenergyB
4260
SenergyC
4268
SVenergyT
4404
AEnergyT
4412
REnergyT
Module configuration
1026
ChanControl
1030
IDispTh
1034
I_RatioA
1038
I_RatioB
1042
I_RatioC
1046
I_RatioN
1050
CfgUpdate
1054
Cs0Update
1066
Cs3Update
1578
Cs3UpdateFB
ADC status configuration
1090
ZXConfig
1094
SagTh
1098
PhaseLoseTh
1102
INWarnTh0
1106
INWarnTh1
1110
THDNUTh
1114
THDNITh
ADC measurement configuration checksum 0
1154
PLconstH
1158
PLconstL
1162
MeteringMode
ADC RMS comparison checksum 3
1346
UGainA_W
1350
IGainA_W
1354
UoffsetA_W
1358
IoffsetA_W
1362
UGainB_W
1366
IGainB_W
1370
UoffsetB_W
1374
IoffsetB_W
1378
UGainC_W
1382
IGainC_W
1386
UoffsetC_W
1390
IoffsetC_W
1394
IGainN_W
10
Data type
Read
INT
INT
INT
INT
INT
INT
INT
INT
INT
INT
INT
INT
Cyclic
●
●
●
●
●
●
●
●
●
●
●
●
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
DINT
DINT
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
UINT
UINT
UINT
UINT
UINT
UINT
UINT
UINT
UINT
UINT
Write
Acyclic
Cyclic
Acyclic
●
●
●
●
●
●
●
●
●
●
UINT
UINT
UINT
UINT
UINT
UINT
UINT
●
●
●
●
●
●
●
UINT
UINT
UINT
●
●
●
UINT
UINT
INT
INT
UINT
UINT
INT
INT
UINT
UINT
INT
INT
UINT
●
●
●
●
●
●
●
●
●
●
●
●
●
Data sheet V 1.01
X20AP3111, X20AP3121 and X20AP3131
Register
Name
Data type
Read
Cyclic
1398
IoffsetN_W
ADC RMS comparison – read
1858
UGainA_R
1862
IGainA_R
1866
UoffsetA_R
1870
IoffsetA_R
1874
UGainB_R
1878
IGainB_R
1882
UoffsetB_R
1886
IoffsetB_R
1890
UGainC_R
1894
IGainC_R
1898
UoffsetC_R
1902
IoffsetC_R
1906
IGainN_R
1910
IoffsetN_R
FlatStream interface
2049
OutputMTU
2051
InputMTU
2055
FlatstreamMode
2057
Forward
2059
ForwardDelay
RxBuffer
2113
InputSequence
RxByte Array[27]: Receive byte interface
2113 + 2*N
RxByteN (N = 1..27)
TxBuffer
2177
OutputSequence
TxByte Array[15]: Send byte interface
2177 + 2*N
TxByteN (N = 1..15)
Force analog energy registers
2316
Frc_APenergyT
2324
Frc_APenergyA
2332
Frc_APenergyB
2340
Frc_APenergyC
2348
Frc_ANenergyT
2356
Frc_ANenergyA
2364
Frc_ANenergyB
2372
Frc_ANenergyC
2380
Frc_RPenergyT
2388
Frc_RPenergyA
2396
Frc_RPenergyB
2404
Frc_RPenergyC
2412
Frc_RNenergyT
2420
Frc_RNenergyA
2428
Frc_RNenergyB
2436
Frc_RNenergyC
2444
Frc_SAenergyT
2452
Frc_SenergyA
2460
Frc_SenergyB
2468
Frc_SenergyC
2476
Frc_SVenergyT
2484
Frc_APenergyTF
2492
Frc_APenergyAF
2500
Frc_APenergyBF
2508
Frc_APenergyCF
2516
Frc_ANenergyTF
2524
Frc_ANenergyAF
2532
Frc_ANenergyBF
2540
Frc_ANenergyCF
2548
Frc_APenergyTH
2556
Frc_APenergyAH
2564
Frc_APenergyBH
2572
Frc_APenergyCH
2580
Frc_ANenergyTH
2588
Frc_ANenergyAH
2596
Frc_ANenergyBH
2604
Frc_ANenergyCH
Oversampling buffer
Oversampling array[16]: Oversampling line
6146 + ((16-N)*40) IactN_SampleN (N = 16..1)
6150 + ((16-N)*40) IactA_SampleN (N = 16..1)
6154 + ((16-N)*40) UactA_SampleN (N = 16..1)
Data sheet V 1.01
Write
Acyclic
Cyclic
INT
UINT
UINT
INT
INT
UINT
UINT
INT
INT
UINT
UINT
INT
INT
UINT
INT
●
●
●
●
●
●
●
●
●
●
●
●
●
●
USINT
USINT
USINT
USINT
USINT
●
●
●
●
●
USINT
●
USINT
●
USINT
●
USINT
●
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
INT
INT
INT
Acyclic
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
11
X20AP3111, X20AP3121 and X20AP3131
Register
6158 + ((16-N)*40)
6162 + ((16-N)*40)
6166 + ((16-N)*40)
6170 + ((16-N)*40)
6773
6774
6778
6780
12
Name
IactB_SampleN (N = 16..1)
UactB_SampleN (N = 16..1)
IactC_SampleN (N = 16..1)
UactC_SampleN (N = 16..1)
SampleCount
Timestamp
Data type
INT
INT
INT
INT
SINT
INT
INT
DINT
Read
Cyclic
●
●
●
●
●
Write
Acyclic
Cyclic
Acyclic
●
Data sheet V 1.01
X20AP3111, X20AP3121 and X20AP3131
8.2 Register overview - Bus controller
Register
Offset
Name
Data type
Read
Cyclic
Standard registers
778
794
810
4404
4412
130
194
2
4
6
8
12
0
0
PmeanT
QmeanT
SmeanT
AEnergyT
REnergyT
StatusInput
CntPulseActive
CntPulseApparent
CntPulseActiveFund
CntPulseActiveHarm
ZeroCrossA
ZeroCrossB
ZeroCrossC
RBTrigDFT
RBUpdateEnergy
RBClearEnergy
RBForceEnergy
ControlOutput
TrigDFT
EnabEnergy
ClearEnergy
ForceEnergy
Analog status registers
266
SysStatus1
270
SysStatus2
274
SysStatus3
278
SysStatus4
265
SystemStatusSel01
SumStatusPhaseLoss
SumStatusPhaseWarning
ErrOrderPhasecurrent
ErrOrderPhaseVoltage
271
SystemStatusSel02
SumStatusWarningTHDCurrent
SumStatusWarningTHDVoltage
ErrIrmsNCalc
ErrIrmsNMeas
278
PhaseStatus
LossPhaseC
LossPhaseB
LossPhaseA
WarningPhaseC
WarningPhaseB
WarningPhaseA
Analog RMS registers
290
IrmsN (measured)
294
UrmsA
298
UrmsB
302
UrmsC
306
IrmsNcalc (calculated)
310
IrmsA
314
IrmsB
318
IrmsC
Analog THD and angle registers
538
Freq
542
PAngleA
546
PAngleB
550
PAngleC
554
Temperature
558
UAngleA
562
UAngleB
564
UAngleC
Analog power registers
778
PmeanT
782
PmeanA
786
PmeanB
790
PmeanC
794
QmeanT
798
QmeanA
802
QmeanB
Data sheet V 1.01
INT
INT
INT
DINT
DINT
UINT
Bit 0
Bit 1
Bit 2
Bit 3
Bit 4
Bit 5
Bit 6
Bit 8
Bit 9
Bit 10
Bit 11
UINT
Bit 0
Bit 1
Bit 2
Bit 3
●
●
●
●
●
●
UINT
UINT
UINT
●
●
●
●
●
USINT
Bit 2
Bit 3
Bit 6
Bit 7
USINT
Bit 2
Bit 3
Bit 6
Bit 7
UINT
Bit 0
Bit 1
Bit 2
Bit 4
Bit 5
Bit 6
Write
Acyclic
Cyclic
Acyclic
●
●
●
UINT
UINT
UINT
UINT
UINT
UINT
UINT
UINT
●
●
●
●
●
●
●
●
UINT
INT
INT
INT
INT
INT
INT
INT
●
●
●
●
●
●
●
●
INT
INT
INT
INT
INT
INT
INT
●
●
●
●
●
●
●
13
X20AP3111, X20AP3121 and X20AP3131
Register
Offset
Name
806
QmeanC
810
SmeanT
814
SmeanA
818
SmeanB
822
SmeanC
826
PFmeanT
830
PFmeanA
834
PFmeanB
838
PFmeanC
Analog energy registers
4108
APenergyT
4116
APenergyA
4124
APenergyB
4132
APenergyC
4140
ANenergyT
4148
ANenergyA
4156
ANenergyB
4164
ANenergyC
4172
RPenergyT
4180
RPenergyA
4188
RPenergyB
4196
RPenergyC
4204
RNenergyT
4212
RNenergyA
4220
RNenergyB
4228
RNenergyC
4236
SAenergyT
4244
SenergyA
4252
SenergyB
4260
SenergyC
4268
SVenergyT
4404
AEnergyT
4412
REnergyT
Module configuration
1026
ChanControl
1030
IDispTh
1034
I_RatioA
1038
I_RatioB
1042
I_RatioC
1046
I_RatioN
1050
CfgUpdate
1054
Cs0Update
1066
Cs3Update
1578
Cs3UpdateFB
ADC status configuration
1090
ZXConfig
1094
SagTh
1098
PhaseLoseTh
1102
INWarnTh0
1106
INWarnTh1
1110
THDNUTh
1114
THDNITh
ADC measurement configuration checksum 0
1154
PLconstH
1158
PLconstL
1162
MeteringMode
ADC RMS comparison checksum 3
1346
UGainA_W
1350
IGainA_W
1354
UoffsetA_W
1358
IoffsetA_W
1362
UGainB_W
1366
IGainB_W
1370
UoffsetB_W
1374
IoffsetB_W
1378
UGainC_W
1382
IGainC_W
1386
UoffsetC_W
1390
IoffsetC_W
1394
IGainN_W
1398
IoffsetN_W
ADC RMS comparison – read
1858
UGainA_R
14
Data type
Read
INT
INT
INT
INT
INT
INT
INT
INT
INT
Cyclic
●
●
●
●
●
●
●
●
●
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
DINT
DINT
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
UINT
UINT
UINT
UINT
UINT
UINT
UINT
UINT
UINT
UINT
Write
Acyclic
Cyclic
Acyclic
●
●
●
●
●
●
●
●
●
●
UINT
UINT
UINT
UINT
UINT
UINT
UINT
●
●
●
●
●
●
●
UINT
UINT
UINT
●
●
●
UINT
UINT
INT
INT
UINT
UINT
INT
INT
UINT
UINT
INT
INT
UINT
INT
●
●
●
●
●
●
●
●
●
●
●
●
●
●
UINT
●
Data sheet V 1.01
X20AP3111, X20AP3121 and X20AP3131
Register
Offset
Name
Data type
Read
Cyclic
1862
IGainA_R
1866
UoffsetA_R
1870
IoffsetA_R
1874
UGainB_R
1878
IGainB_R
1882
UoffsetB_R
1886
IoffsetB_R
1890
UGainC_R
1894
IGainC_R
1898
UoffsetC_R
1902
IoffsetC_R
1906
IGainN_R
1910
IoffsetN_R
FlatStream interface
2049
OutputMTU
2051
InputMTU
2055
FlatstreamMode
2057
Forward
2059
ForwardDelay
RxBuffer
2113
16
InputSequence
RxByte Array[15]: Receive byte interface
2113 + 2*N
16 + N
RxByteN (N = 1..7)
TxBuffer
2177
16
OutputSequence
TxByte Array[15]: Send byte interface
2177 + 2*N
16 + N
TxByteN (N = 1..7)
Force analog energy registers
2316
Frc_APenergyT
2324
Frc_APenergyA
2332
Frc_APenergyB
2340
Frc_APenergyC
2348
Frc_ANenergyT
2356
Frc_ANenergyA
2364
Frc_ANenergyB
2372
Frc_ANenergyC
2380
Frc_RPenergyT
2388
Frc_RPenergyA
2396
Frc_RPenergyB
2404
Frc_RPenergyC
2412
Frc_RNenergyT
2420
Frc_RNenergyA
2428
Frc_RNenergyB
2436
Frc_RNenergyC
2444
Frc_SAenergyT
2452
Frc_SenergyA
2460
Frc_SenergyB
2468
Frc_SenergyC
2476
Frc_SVenergyT
2484
Frc_APenergyTF
2492
Frc_APenergyAF
2500
Frc_APenergyBF
2508
Frc_APenergyCF
2516
Frc_ANenergyTF
2524
Frc_ANenergyAF
2532
Frc_ANenergyBF
2540
Frc_ANenergyCF
2548
Frc_APenergyTH
2556
Frc_APenergyAH
2564
Frc_APenergyBH
2572
Frc_APenergyCH
2580
Frc_ANenergyTH
2588
Frc_ANenergyAH
2596
Frc_ANenergyBH
2604
Frc_ANenergyCH
Data sheet V 1.01
UINT
INT
INT
UINT
UINT
INT
INT
UINT
UINT
INT
INT
UINT
INT
Write
Acyclic
●
●
●
●
●
●
●
●
●
●
●
●
●
Cyclic
USINT
USINT
USINT
USINT
USINT
●
●
●
●
●
USINT
●
USINT
●
USINT
●
USINT
●
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
UDINT
Acyclic
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
15
X20AP3111, X20AP3121 and X20AP3131
8.3 General information
The modules are used for power monitoring and for a machine's energy management. Examples of where this
would be used:
• Multi-phase energy measurement for class 0.5S or class 1 for
°
°
°
°
3-phase, 4-line applications with neutral line (with/without grounding)
3-phase, 3-line applications (with/without grounding)
2-phase mains networks with grounded phase B connection
Aron circuit
• Single-phase measurement by disabling inputs that are not needed
• Mains analysis according to harmonic content
• Signal trace by 8 kHz recording of the 3 voltage channels and 4 current channels with FIFO
8.3.1 Measured value preparation
The modules provide the following possibilities for measured value preparation:
• IEC62052-11, IEC62053-22 and IEC62053-23, ANSI C12.1 and ANSI C12.20: Can be used for class 0.5S
or class 1 multi-phase wattmeter or class 2 multi-phase varmeter
• Precision of ±0.1% for real energy and ±0.02% for reactive energy over a range of 6000:1
• Temperature coefficient of internal reference of 6 ppm/°C
• Each phase can be calibrated for the active power
• Calibration not required for reactive power and apparent power
• Error ≤±0.5% for voltage, current, active-, reactive-, apparent power, frequency active power factor and
phase angle
• Energy registers for active, reactive and apparent energy, separated for forward and backward, fundamental waves and harmonics
• Threshold register for status signal generation and activation of power and energy measurement
• Determining the THD harmonic component
• Discrete Fourier Transformation (DFT) up to 31st harmonic component per phase for voltage and current
• Status signals for voltage dip, loss of voltage, phase sequence, energy flow, neutral current monitor, harmonic component monitor
8.3.2 Additional information
Information
Measurement range monitoring
Extended measurement ranges
Frozen values
Environment variables
Description
Due to the majority of registers consisting of 16 bit values (exception: energy registers, which are interpolated
to 32 bit by the FW), the measurement ranges are subject to limitations, e.g. voltage 650.00 Vrms and current
65,000 Arms (after accounting for the transfer factor of the current transformer).
Extended measurement ranges can be achieved with the software application by upscaling the measured values.
Sample time register:
A NetTime is assigned to the group of measured values when read from the power meter. This NetTime can be
used to freeze the values.
The values for duty cycle, boot counter, and minimum / maximum transformer temperature are recorded.
8.3.3 Measurement function
The values measured for RMS, power, active power factor, phase angle and frequency are mean values over
16 full waves, the update rate is ~3 Hz.
The following represents the measurement time over 16 full waves at the corresponding frequency:
50 Hz ... 320 ms
60 Hz ... 267 ms
Energy measurement
The power measurement (energy measurement) is based on the integration of the measured values with a sampling
rate of 1 MHz.
The collected energy values are made available as energy pulses with an adjustable resolution of 0.1 CF or 0.01 CF
values in the energy registers and with a resolution of 1 CF on the CF status flags.
16
Data sheet V 1.01
X20AP3111, X20AP3121 and X20AP3131
The conversion can be defined using the PL constant. The default value 0x4A817C80 = 1.250.000.000 is equal
to 360 CF/kWh or 0.1 CF/kWs. Increasing the value causes the CF amount to decrease per energy unit (e.g.
0x53D1AC10 = 1.406.250.000 is equal to 320 CF/kWh). When choosing to display the values as kWh, a resolution
of 0.08789 CF/kWs is set internally and the register values are converted with a factor of 1/4096.
The energy threshold register (e.g. PStartTh) can be used to set the amount of energy needed to start an accumulation or to reset the "no load" signals in the status registers. The length of the CF pulse can vary according
to the resulting output rate.
Automatic reading of the energy meter from the transformer must be enabled because valid values are only available after the transformer has been configured. It is possible to clear the energy register or to set it with a block
of the register written in the software application.
Tp = 80 ms
CFx
T ≥ 160 ms
Tp = 0.5 T
CFx
10 ms ≤ T < 160 ms
Tp = 5 ms
CFx
if T < 10 ms,
then T is set to 10 ms
Figure 11: The length of the CF pulse can vary according to the resulting output rate
Power measurement
The phase power ratings are calculated by the module and stored in the corresponding registers.
The total power ratings are equal to the sum of the phase power ratings. To prevent the number range from being
exceeded, the value in the registers is equal to a fourth of the actual power. This value must be multiplied by 4
by the application.
The vector-based total apparent power (complex total apparent power) is calculated according to IEEE1459.
Power factor
The phase power factor is calculated by dividing the phase active power by the phase apparent power.
The total power factor is calculated by dividing the total active power by the total apparent power.
Neutral current
The neutral current can be measured or calculated. Both values are available.
The user can configure which one to use for displaying the status.
Phase angle
The phase angle is calculated based on the zero-crossing detection.
Data sheet V 1.01
17
X20AP3111, X20AP3121 and X20AP3131
Frequency
Frequency measurement is based on Phase A. If A fails, then Phase C is used. If both A and C fail, then Phase
B is used.
Temperature
The Chip-Junction temperature is measured approximately every 100 ms using the sensor integrated in the transformer.
THD+N - Sum of interference power of the harmonic (THD) + interference power of the noise (N)
The THD+N measurement is used to monitor the percentage of harmonics in the network.
If this percentage falls below 10%, then an accuracy of 0.01% can no longer be guaranteed.
This is calculated as follows: (SQR (RMStotal^2 - RMSfundamental wave^2)) / RMSfundamental wave
Fourier analysis
The harmonic component from the 2nd to the 31st harmonic is calculated for voltage and current and the THD
(Total Harmonic Distortion) of each phase.
The DFT period is 0.5 s. This is equal to a resolution of 2 Hz. The input samples are recorded at a sampling rate
of 8 kHz and can be optionally multiplied with a "Hann window" before being evaluated. This is initiated when
requested by the application.
Mains frequency
Sampling frequency
Hanning
window
Input
samples
from the
DSP processor
Scaling
X
X
Analysis of harmonics
Digital
Fourier
Transformation
Frequency
components for
fundamental wave
and
harmonics
Postprocessing
Percentage-based
components of
fundamental wave
and
harmonics
Interface to the
oversampling
buffer
Interface for automatic
output of values
Figure 12: Diagram of Fourier analysis
18
Data sheet V 1.01
X20AP3111, X20AP3121 and X20AP3131
8.3.4 Event generation
Zero-crossing detection
Zero-crossing detection can be configured for each phase for cu or voltage and edge and forms the basis for
frequency- and angle measurements and subsequently also for active- and reactive power calculations.
U
TZX
ZX
Positive zero cross-over
TD
ZX
Negative zero cross-over
ZX
All zero cross-overs
Figure 13: Time diagram of zero-crossing detection per phase
Symbol
TZX
Description
Length of high signal
TD
Delay time
Minimum
Typical
5
Maximum
Unit
ms
0.2
0.5
ms
Table 4: Specification of zero-crossing detection
Data sheet V 1.01
19
X20AP3111, X20AP3121 and X20AP3131
Detection of voltage dip or power failure
Event
Voltage dip
Power failure
Description
The threshold for voltage dips is typically set to 78% of the standard voltage (approx. 170 Vrms). The status flag is set if more
than three 8 kHz samples are below the threshold value within 2 consecutive 11 ms windows.
The threshold for voltage dips is typically set to 10% of the standard voltage (approx. 22 Vrms). The status flag is set if more than
three 8 kHz samples are below the threshold value within 2 consecutive 11 ms windows.
If a power failure is detected, then zero-crossing detection is disabled for voltage and current for this phase.
Voltage
+Threshold
Time
-Threshold
11 ms window
Cause of voltage dip / power failure
found in 2 consecutive windows
IRQ
(if enabled)
Voltage dip / power failure
detected
Figure 14: Time diagram for detecting a voltage dip or power failure
Neutral current monitoring
Neutral current monitoring of the measured and the calculated value is done with separate threshold value registers
and status flags.
Phase sequence monitoring
3 phase and 2 phase applications are handled differently:
Application
3 phases
2 phases
Description
Zero cross-overs of voltage and current must follow the sequence Phase A before Phase B before Phase C
Zero cross-overs of voltage and current must follow the sequence Phase A at least 180° before Phase C
Table 5: Phase sequence monitoring according to the application
8.3.5 Configuration register
The configuration and calibration registers are each composed of blocks and employ a checksum feature to highlight undesired changes. In order to apply this register to the transformer, the respective transfer register must be
changed after the data is transferred to the module (incrementing, bit toggling, etc.). The start value of the transfer
register is 0 after startup.
20
Data sheet V 1.01
X20AP3111, X20AP3121 and X20AP3131
8.4 Interface for transferring process variable mapping
Due to the amount of potential cyclic input data and the limitation to 30 byte cyclic X2X data, the extended Flat
Stream interface, DPS = Data Point Stream, has been defined as the mechanism for transferring the process
variables. DPS is based on the Flat Streaming Interface (FSI) for serial interface modules. The FSI was expanded
to include the block number as the first byte of the user data frame and implements the termination of a frame
(data image of the channel) with a zero segment.
The data blocks are re-transferred if a read request is triggered after a transfer has been completed. A block number
can be sent via the DPS to set a different block or transfer the entire image (default: block number 0).
It should be possible to adapt the DPS interface to the available buffer size. However, the higher-level fieldbus
must be taken into account when doing so (e.g.: CAN 8 byte object, InputMTU size 7). The block number is added
to the front of the actual payload data as a means to differentiate the blocks.
#define
#define
#define
#define
#define
#define
#define
#define
#define
ADC_BLK_ALL 0 // struct ADC_REG
ADC_BLK_STATUS 1 // long NetTimeReg + struct ADC_REG_STATUS
ADC_BLK_RMS 2 // struct ADC_REG_RMS
ADC_BLK_POWER 3 // struct ADC_REG_POWER
ADC_BLK_THD_ANGLE 4 // struct THD_ANGLE
ADC_BLK_ENERGY 5 // long NetTimeEnergy + struct ADC_REG_ENERGY
ADC_BLK_DFT 6 // long NetTimeDft + struct ADC_REG_DFT
ADC_BLK_CFGACT 7 // struct ADC_REG_CFGACT
ADC_BLK_ENVREG 8 // struct ENV_STATUS
Information:
• Consistency of the data is only provided for the individual variables because the data is transferred from the AD converter asynchronously to the conversion.
• Make sure that the byte sequence of the register is in accordance with the Little Endian model
(Intel format).
The NetTime timestamps are always updated after the blocks are generated when preparing a new alternating
buffer.
8.4.1 Data block structure
ADC_REG
typedef struct ADC_REG ADC_REG;
struct ADC_REG
{
long NetTimeReg; // Time of Section copy to Buffer
ADC_REG_STATUS Status; // Status registers
ADC_REG_RMS Rms; // RMS Registers
ADC_REG_POWER Power; // Power Registers
ADC_REG_THD_ANGLE ThdAngle; // THD + Angle Registers
// Regular Energy Registers
long NetTimeEnergy; // Time of Section copy to Buffer
ADC_REG_ENERGY Energy; // Energy Registers
long NetTimeDft; // Time of Section copy to Buffer
ADC_REG_DFT Dft; // DFT Registers
// Read Back selected CFG Registers
ADC_REG_CFGACT CfgAct; // Config read back
// Read Back Environment Registers
ENV_STATUS EnvReg;
};
ADC_REG_STATUS
typedef struct ADC_REG_STATUS ADC_REG_STATUS;
struct ADC_REG_STATUS
{
unsigned short SysStatus0; // System Status 0
unsigned short SysStatus1; // System Status 1
unsigned short EnStatus0; // Metering Status 0
Data sheet V 1.01
21
X20AP3111, X20AP3121 and X20AP3131
unsigned short EnStatus1; // Metering Status 1
};
ADC_REG_RMS
typedef struct ADC_REG_RMS ADC_REG_RMS;
struct ADC_REG_RMS
{
unsigned short IrmsN1; // N Line Sampled current RMS
unsigned short UrmsA; // phase A voltage RMS
unsigned short UrmsB; // phase B voltage RMS
unsigned short UrmsC; // phase C voltage RMS
unsigned short IrmsN0; // N Line calculated current RMS
unsigned short IrmsA; // phase A voltage RMS
unsigned short IrmsB; // phase B voltage RMS
unsigned short IrmsC; // phase C voltage RMS
};
ADC_REG_POWER
typedef struct ADC_REG_POWER ADC_REG_POWER;
struct ADC_REG_POWER
{
unsigned short SVmeanTLSB; // LSB of (Vector Sum) Total Apparent Power
unsigned short SVmeanT; // (Vector Sum) Total Apparent Power
// Power and
signed short
signed short
signed short
signed short
signed short
signed short
signed short
signed short
signed short
signed short
signed short
signed short
signed short
signed short
signed short
signed short
Power Factor Register
PmeanT; // Total Active Power
PmeanA; // Phase A Active Power
PmeanB; // Phase B Active Power
PmeanC; // Phase C Active Power
QmeanT; // Total Reactive Power
QmeanA; // Phase A Reactive Power
QmeanB; // Phase B Reactive Power
QmeanC; // Phase C Reactive Power
SAmeanT; // (Arithmetic Sum) Total apparent power
SmeanA; // phase A apparent power
SmeanB; // phase B apparent power
SmeanC; // phase C apparent power
PFmeanT; // Total power factor
PFmeanA; // phase A power factor
PFmeanB; // phase A power factor
PFmeanC; // phase A power factor
// Fundamental/ Harmonic
signed short PmeanTF; //
signed short PmeanAF; //
signed short PmeanBF; //
signed short PmeanCF; //
signed short PmeanTH; //
signed short PmeanAH; //
signed short PmeanBH; //
signed short PmeanCH; //
};
Power
Total
phase
phase
phase
Total
phase
phase
phase
and Voltage/ Current RMS Registers
active fundamental power
A active fundamental power
B active fundamental power
C active fundamental power
active harmonic power
A active harmonic power
B active harmonic power
C active harmonic power
ADC_REG_THD_ANGLE
typedef struct ADC_REG_THD_ANGLE ADC_REG_THD_ANGLE;
struct ADC_REG_THD_ANGLE
{
// THD+N, Frequency, Angle and Temperature Registers
unsigned short THDNUA; // phase A voltage THD+N
unsigned short THDNUB; // phase B voltage THD+N
unsigned short THDNUC; // phase C voltage THD+N
unsigned short THDNIA; // phase A current THD+N
unsigned short THDNIB; // phase B current THD+N
unsigned short THDNIC; // phase C current THD+N
unsigned short Freq; // Frequency
signed short PAngleA; // phase A mean phase angle
22
Data sheet V 1.01
X20AP3111, X20AP3121 and X20AP3131
signed
signed
signed
signed
signed
signed
};
short
short
short
short
short
short
PAngleB;
PAngleC;
Temp; //
UangleA;
UangleB;
UangleC;
// phase
// phase
Measured
// phase
// phase
// phase
B mean phase angle
C mean phase angle
temperature
A voltage phase angle
B voltage phase angle
C voltage phase angle
ADC_REG_ENERGY
typedef struct ADC_REG_ENERGY ADC_REG_ENERGY;
struct ADC_REG_ENERGY
{
unsigned long APenergyT; // Total Forward Active Energy
unsigned long APenergyA; // Phase A Forward Active Energy
unsigned long APenergyB; // Phase B Forward Active Energy
unsigned long APenergyC; // Phase C Forward Active Energy
unsigned long ANenergyT; // Total Reverse Active Energy
unsigned long ANenergyA; // Phase A Reverse Active Energy
unsigned long ANenergyB; // Phase B Reverse Active Energy
unsigned long ANenergyC; // Phase C Reverse Active Energy
unsigned long RPenergyT; // Total Forward Reactive Energy
unsigned long RPenergyA; // Phase A Forward Reactive Energy
unsigned long RPenergyB; // Phase B Forward Reactive Energy
unsigned long RPenergyC; // Phase C Forward Reactive Energy
unsigned long RNenergyT; // Total Reverse Reactive Energy
unsigned long RNenergyA; // Phase A Reverse Reactive Energy
unsigned long RNenergyB; // Phase B Reverse Reactive Energy
unsigned long RNenergyC; // Phase C Reverse Reactive Energy
unsigned long SAenergyT; // (Arithmetic Sum) Total Apparent Energy
unsigned long SenergyA; // Phase A Apparent Energy
unsigned long SenergyB; // Phase B Apparent Energy
unsigned long SenergyC; // Phase C Apparent Energy
unsigned long SVenergyT; // (Vector Sum) Total Apparent Energy
// Fundamental / Harmonic
unsigned long APenergyTF;
unsigned long APenergyAF;
unsigned long APenergyBF;
unsigned long APenergyCF;
unsigned long ANenergyTF;
unsigned long ANenergyAF;
unsigned long ANenergyBF;
unsigned long ANenergyCF;
unsigned long APenergyTH;
unsigned long APenergyAH;
unsigned long APenergyBH;
unsigned long APenergyCH;
unsigned long ANenergyTH;
unsigned long ANenergyAH;
unsigned long ANenergyBH;
unsigned long ANenergyCH;
Energy Register
// Total Forward Active Fundamental Energy
// Phase A Forward Active Fundamental Energy
// Phase B Forward Active Fundamental Energy
// Phase C Forward Active Fundamental Energy
// Total Reverse Active Fundamental Energy
// Phase A Reverse Active Fundamental Energy
// Phase B Reverse Active Fundamental Energy
// Phase C Reverse Active Fundamental Energy
// Total Forward Active Harmonic Energy
// Phase A Forward Active Harmonic Energy
// Phase B Forward Active Harmonic Energy
// Phase C Forward Active Harmonic Energy
// Total Reverse Active Harmonic Energy
// Phase A Reverse Active Harmonic Energy
// Phase B Reverse Active Harmonic Energy
// Phase C Reverse Active Harmonic Energy
unsigned long AEnergyT; // Total Active Energy
unsigned long REnergyT; // Total Reactive Energy
};
ADC_REG_DFT
typedef struct ADC_REG_DFT ADC_REG_DFT;
struct ADC_REG_DFT
{
// Arithmetic ratio, 2 bits integer and 14 bits fractional; That is: Harmonic
(%) = Register Value / 163.84
unsigned short DftAI[32]; // phase A, Current, Harmonic Ratio for 2nd to 32nd
component and Total Harmonic Distortion Ratio
unsigned short DftBI[32]; // phase B, Current, Harmonic Ratio for 2nd to 32nd
component and Total Harmonic Distortion Ratio
unsigned short DftCI[32]; // phase C, Current, Harmonic Ratio for 2nd to 32nd
component and Total Harmonic Distortion Ratio
Data sheet V 1.01
Ratio
order
order
order
23
X20AP3111, X20AP3121 and X20AP3131
unsigned short DftAV[32]; //
component and Total Harmonic
unsigned short DftBV[32]; //
component and Total Harmonic
unsigned short DftCV[32]; //
component and Total Harmonic
phase A, Voltage, Harmonic Ratio for 2nd to 32nd order
Distortion Ratio
phase B, Voltage, Harmonic Ratio for 2nd to 32nd order
Distortion Ratio
phase C, Voltage, Harmonic Ratio for 2nd to 32nd order
Distortion Ratio
// Format: Need special scaling/conversion. The register value * 147.62 = full-scale
input signal RMS.
// Current, Fundamental component value = Register Value * 209 * 65.535 / 8388608
// Voltage, Fundamental component value = Register Value * 209 * 655.35 / 8388608
unsigned
unsigned
unsigned
unsigned
unsigned
unsigned
};
short
short
short
short
short
short
DftAI_Fund;
DftAV_Fund;
DftBI_Fund;
DftBV_Fund;
DftCI_Fund;
DftCV_Fund;
// Excerpt of configuration registers used by APROL, readable only by FS-IF
// and with registernumbers of registers with the same names.
typedef struct ADC_REG_CFGACT ADC_REG_CFGACT;
struct ADC_REG_CFGACT
{
unsigned short ChanControl;
unsigned short IDispTh;
unsigned short I_RatioA;
unsigned short I_RatioB;
unsigned short I_RatioC;
unsigned short I_RatioN;
unsigned short ZXConfig;
unsigned short SagTh;
unsigned short PhaseLoseTh;
unsigned short INWarnTh0;
unsigned short INWarnTh1;
unsigned short THDNUTh;
unsigned short THDNITh;
unsigned short MeteringMode;
unsigned short PLconstL;
unsigned short PLconstH;
};
// Environment Variables
typedef struct ENV_STATUS ENV_STATUS;
struct ENV_STATUS
{
unsigned long ulUpTime;
unsigned long ulUpCnt;
signed short ssMinTemp;
signed short ssMaxTemp;
unsigned long ulRes[13];
};
24
Data sheet V 1.01
X20AP3111, X20AP3121 and X20AP3131
8.5 Standard registers
8.5.1 Total active power
Name:
PmeanT
The value in the register equals a fourth of the actual power. The calculation can be performed in either absolute
or arithmetic mode (see register <MeteringMode, bit 3>). Each phase can be separately enabled for the power
calculation (see register <MeteringMode, bit 0, 1 and 2>).
Data type
INT
Values
-32767...32767: Resolution 4 W
This value must be multiplied by 4 by the application. Calculation formula for actual power:
Actual total active power = Register value * 4
8.5.2 Total reactive power
Name:
QmeanT
The value in the register equals a fourth of the actual power. The calculation can be performed in either absolute
or arithmetic mode (see register <MeteringMode, bit 4>). Each phase can be separately enabled for the power
calculation (see register <MeteringMode, bit 0, 1 and 2>).
Data type
INT
Values
-32767...32767: Resolution 4 var
This value must be multiplied by 4 by the application. Calculation formula for actual power:
Actual total reactive power = Register value * 4
8.5.3 Total apparent power
Name:
SmeanT
The value in the register equals a fourth of the actual power. The power is calculated in arithmetic mode. Each
phase can be separately enabled for the power calculation (see register <MeteringMode, bit 0, 1 and 2>).
Data type
INT
Values
0...32767: Resolution 4 VA
This value must be multiplied by 4 by the application. Calculation formula for actual power:
Actual total apparent power = Register value * 4
8.5.4 Total active energy combined
Name:
AEnergyT
Total active energy in forward and backward direction.
Data type
DINT
Values
-2147483647...2147483647: Resolution 0.1 or 0.01 CF, depending on the Power Line factor (e.g. kWs)
Internal calculation formula for the total active energy:
AEnergyT = (DINT)(APenergyT - ANenergyT) ... Calculation overflows must be handled in the application
8.5.5 Total reactive energy combined
Name:
REnergyT
Total reactive energy in forward and backward direction.
Data type
DINT
Values
-2147483647...2147483647: Resolution 0.1 or 0.01 CF, depending on the Power Line factor (e.g. kWs)
Internal calculation formula for the total reactive energy:
REnergyT = (DINT)(RPenergyT - RNenergyT) ... Calculation overflows must be handled in the application
Data sheet V 1.01
25
X20AP3111, X20AP3121 and X20AP3131
8.5.6 Status signals and responses
Name:
StatusInput
The signals are recorded in 200 µs intervals.
Data type
UINT
Values
See bit structure
Bit
0
Description
CF1 energy pulse 1, total active energy
1
CF2 energy pulse 2, total apparent energy, configurable
Default:
Arithmetic sum of apparent energy, can be reconfigured via register <MeteringMode>
CF3 energy pulse 3, total active energy, fundamental wave
0
1
CF4 energy pulse 4, total active energy, harmonics
0
1
ZX1 zero cross signal – Phase A
0
1
2
3
4
Value
0
1
0
1
5
ZX2 zero cross signal – Phase B
0
1
6
ZX3 zero cross signal – Phase C
0
1
7
8
Reserved
DFT response sent
0
x
9
Energy value update response sent
10
Energy value response deleted
0
1
x
11
Energy value response set
x
12-15
Reserved
0
Information
Not yet calculated
Calculated
Not yet calculated
Calculated
Not yet calculated
Calculated
Not yet calculated
Calculated
Zero cross-over not detected
Default:
Pulse at positive edge of the zero cross signal of the voltage
input, can be reconfigured via register <ZXConfig>
Zero cross-over not detected
Default:
Pulse at positive edge of the zero cross signal of the voltage
input, can be reconfigured via register <ZXConfig>
Zero cross-over not detected
Default:
Pulse at positive edge of the zero cross signal of the voltage
input, can be reconfigured via register <ZXConfig>
If the state in the register <ControlOutput01> corresponds with
the response, then the action is complete
No update
Update complete
If the state in the register <ControlOutput01> corresponds with
the response, then the action is complete
If the state in the register <ControlOutput01> corresponds with
the response, then the action is complete
8.5.7 Control signals
Name:
ControlOutput
Control signals are evaluated in a ~5 ms interval.
Data type
UINT
Values
See bit structure
Bit
0
Description
DFT analysis
1
Automatically read energy values
2
Clear energy values
3
Set energy values
4-15
Reserved
1)
26
Value
0
1
0
1
0
1
0
1
0
Information
Don't start
Start1)
Do not automatically read
Automatically read
Do not clear
Clear1)
Don't start
Start1)
If the state in the register <ControlOutput> corresponds with the response, then the action is complete
Data sheet V 1.01
X20AP3111, X20AP3121 and X20AP3131
8.6 Analog status registers
8.6.1 Read timestamp for I/O register (+0x0022 = 16 bit)
Name:
SampleTime01_32bit
Network timestamp for the readout of the status, RMS, power register.
Data type
DINT
Values
-2147483647...2147483647: Network time
8.6.2 ADC system status 1
Name:
SysStatus1
The register is read by the converter in a ~5 ms interval.
Data type
UINT
Bit
0-1
2
3
4-5
6
7
8
9
10
11
12
13
14
15
Values
See bit structure
Description
Reserved
SumStatusPhaseLoss, voltage of one or more phases < failure
threshold in the register
Value
0
0
1
SumStatusPhaseWarning, voltage of one or more phases < 0
warning threshold in the register
1
Reserved
0
ErrOrderPhasecurrent, error in the order of phase currents
0
1
ErrOrderPhaseVoltage, error in the order of phase voltages
0
1
CS3Err, checksum error in configuration block 3
0
1
Reserved
0
CS2Err, checksum error in configuration block 2
0
1
Reserved
0
CS1Err, checksum error in configuration block 1
0
1
Reserved
0
CS0Err, checksum error in configuration block 0
0
1
Reserved
0
Information
Voltage within permitted range
Voltage lower than the failure threshold
Voltage within permitted range
Voltage lower than the warning threshold
No error
Error
No error
Error
No error
Error
No error
Error
No error
Error
No error
Error
8.6.3 ADC system status 2
Name:
SysStatus2
Data type
UINT
Bit
0
1
2
3
4
5
6
7
8
9
10
Values
See bit structure
Description
Value
RevPchgC, the direction of the active energy for phase C has 0
changed
1
RevPchgB, the direction of the active energy for phase B has 0
changed
1
RevPchgA, the direction of the active energy for phase A has 0
changed
1
RevPchgT, the direction of the active energy for the total has 0
changed
1
RevQchgC, the direction of the reactive energy for phase C has 0
changed
1
RevQchgB, the direction of the reactive energy for phase B has 0
changed
1
RevQchgA, the direction of the reactive energy for phase A has 0
changed
1
RevQchgT, the direction of the reactive energy for the total has 0
changed
1
Reserved
0
DFTDone, DFT analysis complete (temporary bit)
0
1
SumStatusWarningTHDCurrent, the THDIx value of one or more 0
phases > warning threshold in the register
1
Data sheet V 1.01
Information
No change of direction
Direction has changed
No change of direction
Direction has changed
No change of direction
Direction has changed
No change of direction
Direction has changed
No change of direction
Direction has changed
No change of direction
Direction has changed
No change of direction
Direction has changed
No change of direction
Direction has changed
DFT analysis not complete
DFT analysis complete
THDIx value within permitted range
THDIx value higher than warning threshold
27
X20AP3111, X20AP3121 and X20AP3131
Bit
11
12-13
14
15
Description
Value
SumStatusWarningTHDVoltage, the THDUx value of one or 0
more phases > warning threshold in the register
1
Reserved
0
ErrIrmsNCalc, the calculated value of the neutral line > warning 0
threshold in the Register
1
ErrIrmsNMeas, the measured value of the neutral line > warning 0
threshold in the Register
1
Information
THDUx value within permitted range
THDUx value higher than warning threshold
Calculated value within permitted range
Calculated value higher than warning threshold
Measured value within permitted range
Measured value higher than warning threshold
8.6.4 ADC system status 3
Name:
SysStatus3
Data type
UINT
Bit
0
Description
CF1RevFlag, direction of CF signal
Value
0
1
CF2RevFlag, direction of CF signal
0
1
CF3RevFlag, direction of CF signal
0
1
CF4RevFlag, direction of CF signal
0
1
Reserved
0
TVSNoload, vector-based total apparent power of all phases in 0
"No load" state
1
TASNoload, total apparent power of all phases in "No load" state 0
1
TPNoload, total active power of all phases in "No load" state
0
1
TQNoload, total reactive power of all phases in "No load" state 0
1
1
2
3
4-11
12
13
14
15
1)
2)
Values
See bit structure
Information
Forward1)
Back2)
Forward1)
Back2)
Forward1)
Back2)
Forward1)
Back2)
Status with load
Status without load
Status with load
Status without load
Status with load
Status without load
Status with load
Status without load
Forward direction of CF pulse (positive sign of corresponding energy register)
Reverse direction of CF pulse (negative sign of corresponding energy register)
8.6.5 ADC system status 4
Name:
SysStatus4
Data type
UINT
Bit
0
1
2
3
4
5
6
7-15
28
Values
See bit structure
Description
Value
LossPhaseC, voltage lower than value in the register 0
<PhaseLoseTh>
1
LossPhaseB, voltage lower than value in the register 0
<PhaseLoseTh>
1
LossPhaseA, voltage lower than value in the register 0
<PhaseLoseTh>
1
Reserved
0
WarningPhaseC, voltage lower than value in the register 0
<SagTh>
1
WarningPhaseB, voltage lower than value in the register 0
<SagTh>
1
WarningPhaseA, voltage lower than value in the register 0
<SagTh>
1
Reserved
0
Information
Voltage is higher
Voltage is lower
Voltage is higher
Voltage is lower
Voltage is higher
Voltage is lower
Voltage is higher
Voltage is lower
Voltage is higher
Voltage is lower
Voltage is higher
Voltage is lower
Data sheet V 1.01
X20AP3111, X20AP3121 and X20AP3131
8.7 Analog RMS registers
8.7.1 Current RMS neutral line measured
Name:
IrmsN
Measured value of the neutral current between the P and N connections on the current terminal, multiplied with
the transfer factor of the transformer.
Data type
UINT
Values
0...65535: Measured value 0.001 Arms
8.7.2 Voltage RMS phase A/B/C
Name:
UrmsA
UrmsB
UrmsC
Measured value for N-terminal or virtual zero point.
Data type
UINT
Values
0...65535: Measured value 0.01 Vrms
8.7.3 Current RMS neutral line calculated
Name:
IrmsNcalc
Calculated value of neutral current derived from the other 3 phases.
Data type
UINT
Data sheet V 1.01
Values
0...65535: Measured value 0.001 Arms
29
X20AP3111, X20AP3121 and X20AP3131
8.8 Analog THD and angle registers
8.8.1 THD+N value voltage phase A/B/C
Name:
THDNUA
THDNUB
THDNUC
Data type
UINT
Values
0...10000: Resolution 0.01%
Harmonic content = (SQR(Rmstotal^2 - Rmsfundamental^2))/Rmsfundamental
8.8.2 THD+N value current phase A/B/C
Name:
THDNIA
THDNIB
THDNIC
Data type
UINT
Values
0...10000: Resolution 0.01%
Harmonic content = (SQR(Rmstotal^2 - Rmsfundamental^2))/Rmsfundamental
8.8.3 Fundamental frequency measured
Name:
Freq
Measured fundamental frequency of phases A, B and C.
Data type
UINT
Values
0...10000: Resolution 0.01 Hz
8.8.4 Phase angle of power on phase A/B/C
Name:
PAngleA
PAngleB
PAngleC
Middle phase angle (power angle) of the current to the voltage based on the zero-crossing detection.
Data type
INT
Values
-1800...1800: Resolution 0.1°
8.8.5 Transformer temperature
Name:
Temperature
This register contains the internal temperature of the transformer component. The temperature is recorded in a
100 ms interval.
Data type
INT
Values
-200...200: Resolution 1°C
8.8.6 Phase angle of voltage on phase A/B/C
Name:
UAngleA
UAngleB
UAngleC
The value for phase A is always 0. On the other phases, the angle corresponds with the offset to A. This is based
on the zero-crossing detection.
Data type
INT
30
Values
-1800...1800: Resolution 0.1°
Data sheet V 1.01
X20AP3111, X20AP3121 and X20AP3131
8.9 Analog power register
8.9.1 Vector sum of the total apparent power LSW
Name:
SVmeanTLSB
The value in the register equals a fourth of the actual power.
Data type
INT
Values
-32767...32767: Resolution of units/LSB equals 4/65536 VA
This value must be multiplied by 4 by the application. Calculation formula for actual power:
Actual vector sum of the total apparent power LSW = register value * 4 (complex sum)
8.9.2 Vector sum of the total apparent power MSW
Name:
SVmeanT
The value in the register equals a fourth of the actual power. The calculation is made in accordance with IEEE 1459.
Data type
INT
Values
0...32767: Resolution 4 VA
This value must be multiplied by 4 by the application. Calculation formula for actual power:
Actual vector sum of the total apparent power MSW = register value * 4 (complex sum)
8.9.3 Total active power
Name:
PmeanT
The value in the register equals a fourth of the actual power. The calculation can be performed in either absolute
or arithmetic mode (see register <MeteringMode, bit 3>). Each phase can be separately enabled for the power
calculation (see register <MeteringMode, bit 0, 1 and 2>).
Data type
INT
Values
-32767...32767: Resolution 4 W
This value must be multiplied by 4 by the application. Calculation formula for actual power:
Actual total active power = Register value * 4
8.9.4 Active power on phase A/B/C
Name:
PmeanA
PmeanB
PmeanC
Active power on the phase. Each phase can be separately enabled for the power calculation (see register <MeteringMode, bit 0, 1 and 2>).
Data type
INT
Values
-32767...32767: Resolution 1 W
8.9.5 Total reactive power
Name:
QmeanT
The value in the register equals a fourth of the actual power. The calculation can be performed in either absolute
or arithmetic mode (see register <MeteringMode, bit 4>). Each phase can be separately enabled for the power
calculation (see register <MeteringMode, bit 0, 1 and 2>).
Data type
INT
Values
-32767...32767: Resolution 4 var
This value must be multiplied by 4 by the application. Calculation formula for actual power:
Actual total reactive power = Register value * 4
Data sheet V 1.01
31
X20AP3111, X20AP3121 and X20AP3131
8.9.6 Reactive power on phase A/B/C
Name:
QmeanA
QmeanB
QmeanC
Reactive power on the phase. Each phase can be separately enabled for the power calculation (see register
<MeteringMode, bit 0, 1 and 2>).
Data type
INT
Values
-32767...32767: Resolution 1 var
8.9.7 Total apparent power
Name:
SmeanT
The value in the register equals a fourth of the actual power. The power is calculated in arithmetic mode. Each
phase can be separately enabled for the power calculation (see register <MeteringMode, bit 0, 1 and 2>).
Data type
INT
Values
0...32767: Resolution 4 VA
This value must be multiplied by 4 by the application. Calculation formula for actual power:
Actual total apparent power = Register value * 4
8.9.8 Apparent power on phase A/B/C
Name:
SmeanA
SmeanB
SmeanC
Apparent power on the phase. Each phase can be separately enabled for the power calculation (see register
<MeteringMode, bit 0, 1 and 2>).
Data type
INT
Values
0...32767: Resolution 1 VA
8.9.9 Total power factor
Name:
PFmeanT
Data type
INT
Values
-1000...1000: Resolution 0.001
8.9.10 Total active power of fundamental wave
Name:
PmeanTF
The value in the register equals a fourth of the actual power.
Data type
INT
Values
-32767...32767: Resolution 4 W
This value must be multiplied by 4 by the application. Calculation formula for actual power:
Actual total active power of fundamental wave = Register value * 4
8.9.11 Fundamental wave active power on phase A/B/C
Name:
PmeanAF
PmeanBF
PmeanCF
Active power of fundamental wave on the phase.
Data type
INT
32
Values
-32767...32767: Resolution 1 W
Data sheet V 1.01
X20AP3111, X20AP3121 and X20AP3131
8.9.12 Total active power of harmonics
Name:
PmeanTH
The value in the register equals a fourth of the actual power.
Data type
INT
Values
-32767...32767: Resolution 4 W
This value must be multiplied by 4 by the application. Calculation formula for actual power:
Actual total active power of harmonics = Register value * 4
8.9.13 Harmonics active power on phase A/B/C
Name:
PmeanAH
PmeanBH
PmeanCH
Active power of harmonics on the phase.
Data type
INT
Data sheet V 1.01
Values
-32767...32767: Resolution 1 W
33
X20AP3111, X20AP3121 and X20AP3131
8.10 Analog energy registers
8.10.1 Read timestamp for energy registers (+0x0022 = 16 bit)
Name:
SampleTime02_32bit
Network timestamp for the readout of the energy register.
Data type
DINT
Values
-2147483647...2147483647: Network time
8.10.2 Forward total active energy
Name:
APenergyT
Total active energy in forward direction.
Data type
UDINT
Values
0...4294967295: Resolution 0.1 or 0.01 CF, depending on the Power Line factor (e.g. kWs)
Notes:
•
•
•
•
•
The unit CF is derived from the Power Line factor (default: 3600 Imp/kWh), see register <MeteringMode>
The resolution can be switched between 0.1 and 0.01, see register <MeteringMode>
The register is updated automatically after being enabled, see register <ControlOutput, bit 1>
The register is cleared upon request, see register <ControlOutput, bit 2>
The register is set upon request, see register <ControlOutput, bit 3>
8.10.3 Forward active energy on phase A/B/C
Name:
APenergyA
APenergyB
APenergyC
Active energy in forward direction of the phase.
Data type
UDINT
Values
0...4294967295: Resolution 0.1 or 0.01 CF, depending on the Power Line factor (e.g. kWs)
Notes:
•
•
•
•
•
The unit CF is derived from the Power Line factor (default: 3600 Imp/kWh), see register <MeteringMode>
The resolution can be switched between 0.1 and 0.01, see register <MeteringMode>
The register is updated automatically after being enabled, see register <ControlOutput, bit 1>
The register is cleared upon request, see register <ControlOutput, bit 2>
The register is set upon request, see register <ControlOutput, bit 3>
8.10.4 Reverse total active energy
Name:
ANenergyT
Total active energy in reverse direction.
Data type
UDINT
Values
0...4294967295: Resolution 0.1 or 0.01 CF, depending on the Power Line factor (e.g. kWs)
Notes:
•
•
•
•
•
34
The unit CF is derived from the Power Line factor (default: 3600 Imp/kWh), see register <MeteringMode>
The resolution can be switched between 0.1 and 0.01, see register <MeteringMode>
The register is updated automatically after being enabled, see register <ControlOutput, bit 1>
The register is cleared upon request, see register <ControlOutput, bit 2>
The register is set upon request, see register <ControlOutput, bit 3>
Data sheet V 1.01
X20AP3111, X20AP3121 and X20AP3131
8.10.5 Reverse active energy on phase A/B/C
Name:
ANenergyA
ANenergyB
ANenergyC
Active energy in reverse direction of the phase.
Data type
UDINT
Values
0...4294967295: Resolution 0.1 or 0.01 CF, depending on the Power Line factor (e.g. kWs)
Notes:
•
•
•
•
•
The unit CF is derived from the Power Line factor (default: 3600 Imp/kWh), see register <MeteringMode>
The resolution can be switched between 0.1 and 0.01, see register <MeteringMode>
The register is updated automatically after being enabled, see register <ControlOutput, bit 1>
The register is cleared upon request, see register <ControlOutput, bit 2>
The register is set upon request, see register <ControlOutput, bit 3>
8.10.6 Forward total reactive energy
Name:
RPenergyT
Total reactive energy in forward direction.
Data type
UDINT
Values
0...4294967295: Resolution 0.1 or 0.01 CF, depending on the Power Line factor (e.g. kWs)
Notes:
•
•
•
•
•
The unit CF is derived from the Power Line factor (default: 3600 Imp/kWh), see register <MeteringMode>
The resolution can be switched between 0.1 and 0.01, see register <MeteringMode>
The register is updated automatically after being enabled, see register <ControlOutput, bit 1>
The register is cleared upon request, see register <ControlOutput, bit 2>
The register is set upon request, see register <ControlOutput, bit 3>
8.10.7 Forward reactive energy on phase A/B/C
Name:
RPenergyA
RPenergyB
RPenergyC
Reactive energy in forward direction of the phase.
Data type
UDINT
Values
0...4294967295: Resolution 0.1 or 0.01 CF, depending on the Power Line factor (e.g. kWs)
Notes:
•
•
•
•
•
The unit CF is derived from the Power Line factor (default: 3600 Imp/kWh), see register <MeteringMode>
The resolution can be switched between 0.1 and 0.01, see register <MeteringMode>
The register is updated automatically after being enabled, see register <ControlOutput, bit 1>
The register is cleared upon request, see register <ControlOutput, bit 2>
The register is set upon request, see register <ControlOutput, bit 3>
Data sheet V 1.01
35
X20AP3111, X20AP3121 and X20AP3131
8.10.8 Reverse total reactive energy
Name:
RNenergyT
Total reactive energy in reverse direction.
Data type
UDINT
Values
0...4294967295: Resolution 0.1 or 0.01 CF, depending on the Power Line factor (e.g. kWs)
Notes:
•
•
•
•
•
The unit CF is derived from the Power Line factor (default: 3600 Imp/kWh), see register <MeteringMode>
The resolution can be switched between 0.1 and 0.01, see register <MeteringMode>
The register is updated automatically after being enabled, see register <ControlOutput, bit 1>
The register is cleared upon request, see register <ControlOutput, bit 2>
The register is set upon request, see register <ControlOutput, bit 3>
8.10.9 Reverse reactive energy on phase A/B/C
Name:
RNenergyA
RNenergyB
RNenergyC
Reactive energy in reverse direction of the phase.
Data type
UDINT
Values
0...4294967295: Resolution 0.1 or 0.01 CF, depending on the Power Line factor (e.g. kWs)
Notes:
•
•
•
•
•
The unit CF is derived from the Power Line factor (default: 3600 Imp/kWh), see register <MeteringMode>
The resolution can be switched between 0.1 and 0.01, see register <MeteringMode>
The register is updated automatically after being enabled, see register <ControlOutput, bit 1>
The register is cleared upon request, see register <ControlOutput, bit 2>
The register is set upon request, see register <ControlOutput, bit 3>
8.10.10 Arithmetic total apparent energy
Name:
SAenergyT
Data type
UDINT
Values
0...4294967295: Resolution 0.1 or 0.01 CF, depending on the Power Line factor (e.g. kWs)
Notes:
•
•
•
•
•
36
The unit CF is derived from the Power Line factor (default: 3600 Imp/kWh), see register <MeteringMode>
The resolution can be switched between 0.1 and 0.01, see register <MeteringMode>
The register is updated automatically after being enabled, see register <ControlOutput, bit 1>
The register is cleared upon request, see register <ControlOutput, bit 2>
The register is set upon request, see register <ControlOutput, bit 3>
Data sheet V 1.01
X20AP3111, X20AP3121 and X20AP3131
8.10.11 Apparent energy on phase A/B/C
Name:
SenergyA
SenergyB
SenergyC
Data type
UDINT
Values
0...4294967295: Resolution 0.1 or 0.01 CF, depending on the Power Line factor (e.g. kWs)
Notes:
•
•
•
•
•
The unit CF is derived from the Power Line factor (default: 3600 Imp/kWh), see register <MeteringMode>
The resolution can be switched between 0.1 and 0.01, see register <MeteringMode>
The register is updated automatically after being enabled, see register <ControlOutput, bit 1>
The register is cleared upon request, see register <ControlOutput, bit 2>
The register is set upon request, see register <ControlOutput, bit 3>
8.10.12 Vectorized total apparent energy
Name:
SVenergyT
Data type
UDINT
Values
0...4294967295: Resolution 0.1 or 0.01 CF, depending on the Power Line factor (e.g. kWs)
Notes:
•
•
•
•
•
The unit CF is derived from the Power Line factor (default: 3600 Imp/kWh), see register <MeteringMode>
The resolution can be switched between 0.1 and 0.01, see register <MeteringMode>
The register is updated automatically after being enabled, see register <ControlOutput, bit 1>
The register is cleared upon request, see register <ControlOutput, bit 2>
The register is set upon request, see register <ControlOutput, bit 3>
8.10.13 Forward fundamental wave total active energy
Name:
APenergyTF
Fundamental wave of total active energy in forward direction.
Data type
UDINT
Values
0...4294967295: Resolution 0.1 or 0.01 CF, depending on the Power Line factor (e.g. kWs)
Notes:
•
•
•
•
•
The unit CF is derived from the Power Line factor (default: 3600 Imp/kWh), see register <MeteringMode>
The resolution can be switched between 0.1 and 0.01, see register <MeteringMode>
The register is updated automatically after being enabled, see register <ControlOutput, bit 1>
The register is cleared upon request, see register <ControlOutput, bit 2>
The register is set upon request, see register <ControlOutput, bit 3>
Data sheet V 1.01
37
X20AP3111, X20AP3121 and X20AP3131
8.10.14 Forward fundamental wave active energy on phase A/B/C
Name:
APenergyAF
APenergyBF
APenergyCF
Fundamental wave of active energy in forward direction of the phase.
Data type
UDINT
Values
0...4294967295: Resolution 0.1 or 0.01 CF, depending on the Power Line factor (e.g. kWs)
Notes:
•
•
•
•
•
The unit CF is derived from the Power Line factor (default: 3600 Imp/kWh), see register <MeteringMode>
The resolution can be switched between 0.1 and 0.01, see register <MeteringMode>
The register is updated automatically after being enabled, see register <ControlOutput, bit 1>
The register is cleared upon request, see register <ControlOutput, bit 2>
The register is set upon request, see register <ControlOutput, bit 3>
8.10.15 Reverse fundamental wave total active energy
Name:
ANenergyTF
Fundamental wave of total active energy in reverse direction.
Data type
UDINT
Values
0...4294967295: Resolution 0.1 or 0.01 CF, depending on the Power Line factor (e.g. kWs)
Notes:
•
•
•
•
•
The unit CF is derived from the Power Line factor (default: 3600 Imp/kWh), see register <MeteringMode>
The resolution can be switched between 0.1 and 0.01, see register <MeteringMode>
The register is updated automatically after being enabled, see register <ControlOutput, bit 1>
The register is cleared upon request, see register <ControlOutput, bit 2>
The register is set upon request, see register <ControlOutput, bit 3>
8.10.16 Reverse fundamental wave active energy on phase A/B/C
Name:
ANenergyAF
ANenergyBF
ANenergyCF
Fundamental wave of active energy in reverse direction of the phase.
Data type
UDINT
Values
0...4294967295: Resolution 0.1 or 0.01 CF, depending on the Power Line factor (e.g. kWs)
Notes:
•
•
•
•
•
38
The unit CF is derived from the Power Line factor (default: 3600 Imp/kWh), see register <MeteringMode>
The resolution can be switched between 0.1 and 0.01, see register <MeteringMode>
The register is updated automatically after being enabled, see register <ControlOutput, bit 1>
The register is cleared upon request, see register <ControlOutput, bit 2>
The register is set upon request, see register <ControlOutput, bit 3>
Data sheet V 1.01
X20AP3111, X20AP3121 and X20AP3131
8.10.17 Forward harmonics total active energy
Name:
APenergyTH
Harmonics of total active energy in forward direction.
Data type
UDINT
Values
0...4294967295: Resolution 0.1 or 0.01 CF, depending on the Power Line factor (e.g. kWs)
Notes:
•
•
•
•
•
The unit CF is derived from the Power Line factor (default: 3600 Imp/kWh), see register <MeteringMode>
The resolution can be switched between 0.1 and 0.01, see register <MeteringMode>
The register is updated automatically after being enabled, see register <ControlOutput, bit 1>
The register is cleared upon request, see register <ControlOutput, bit 2>
The register is set upon request, see register <ControlOutput, bit 3>
8.10.18 Forward harmonics active energy on phase A/B/C
Name:
APenergyAH
APenergyBH
APenergyCH
Harmonics of active energy in forward direction of the phase.
Data type
UDINT
Values
0...4294967295: Resolution 0.1 or 0.01 CF, depending on the Power Line factor (e.g. kWs)
Notes:
•
•
•
•
•
The unit CF is derived from the Power Line factor (default: 3600 Imp/kWh), see register <MeteringMode>
The resolution can be switched between 0.1 and 0.01, see register <MeteringMode>
The register is updated automatically after being enabled, see register <ControlOutput, bit 1>
The register is cleared upon request, see register <ControlOutput, bit 2>
The register is set upon request, see register <ControlOutput, bit 3>
8.10.19 Reverse harmonics total active energy
Name:
ANenergyTH
Harmonics of total active energy in reverse direction.
Data type
UDINT
Values
0...4294967295: Resolution 0.1 or 0.01 CF, depending on the Power Line factor (e.g. kWs)
Notes:
•
•
•
•
•
The unit CF is derived from the Power Line factor (default: 3600 Imp/kWh), see register <MeteringMode>
The resolution can be switched between 0.1 and 0.01, see register <MeteringMode>
The register is updated automatically after being enabled, see register <ControlOutput, bit 1>
The register is cleared upon request, see register <ControlOutput, bit 2>
The register is set upon request, see register <ControlOutput, bit 3>
Data sheet V 1.01
39
X20AP3111, X20AP3121 and X20AP3131
8.10.20 Reverse harmonics active energy on phase A/B/C
Name:
ANenergyAH
ANenergyBH
ANenergyCH
Harmonics of active energy in reverse direction of the phase.
Data type
UDINT
Values
0...4294967295: Resolution 0.1 or 0.01 CF, depending on the Power Line factor (e.g. kWs)
Notes:
The unit CF is derived from the Power Line factor (default: 3600 Imp/kWh), see register <MeteringMode>
The resolution can be switched between 0.1 and 0.01, see register <MeteringMode>
The register is updated automatically after being enabled, see register <ControlOutput, bit 1>
The register is cleared upon request, see register <ControlOutput, bit 2>
The register is set upon request, see register <ControlOutput, bit 3>
•
•
•
•
•
8.10.21 Total active energy combined
Name:
AEnergyT
Total active energy in forward and backward direction.
Data type
DINT
Values
-2147483647...2147483647: Resolution 0.1 or 0.01 CF, depending on the Power Line factor (e.g. kWs)
Internal calculation formula for the total active energy:
AEnergyT = (DINT)(APenergyT - ANenergyT) ... Calculation overflows must be handled in the application
Notes:
The unit CF is derived from the Power Line factor (default: 3600 Imp/kWh), see register <MeteringMode>
The resolution can be switched between 0.1 and 0.01, see register <MeteringMode>
The register is updated automatically after being enabled, see register <ControlOutput, bit 1>
The register is cleared upon request, see register <ControlOutput, bit 2>
The register is set upon request, see register <ControlOutput, bit 3>
•
•
•
•
•
8.10.22 Total reactive energy combined
Name:
REnergyT
Total reactive energy in forward and backward direction.
Data type
DINT
Values
-2147483647...2147483647: Resolution 0.1 or 0.01 CF, depending on the Power Line factor (e.g. kWs)
Internal calculation formula for the total reactive energy:
REnergyT = (DINT)(RPenergyT - RNenergyT) ... Calculation overflows must be handled in the application
Notes:
•
•
•
•
•
40
The unit CF is derived from the Power Line factor (default: 3600 Imp/kWh), see register <MeteringMode>
The resolution can be switched between 0.1 and 0.01, see register <MeteringMode>
The register is updated automatically after being enabled, see register <ControlOutput, bit 1>
The register is cleared upon request, see register <ControlOutput, bit 2>
The register is set upon request, see register <ControlOutput, bit 3>
Data sheet V 1.01
X20AP3111, X20AP3121 and X20AP3131
8.11 Analog DFT registers
8.11.1 Read timestamp for DFT register (+0x0022 = 16 bit)
Name:
SampleTime03_32bit
Network timestamp for the readout of the DFT register.
Data type
DINT
Values
-2147483647...2147483647: Network time
8.11.2 Current HRn register for phase A/B/C
Name:
AI_HRN (2..32)
BI_HRN (2..32)
CI_HRN (2..32)
Ratio of harmonics.
Data type
UINT
Values
0...32767: Ratio of frequency component
Conversion from % = register value / 163.84
8.11.3 Current THD register for phase A/B/C
Name:
DFT_AI_THD
DFT_BI_THD
DFT_CI_THD
Ratio of total harmonic distortion.
Data type
UINT
Values
0...32767: Total harmonic distortion on phase A current
Conversion from % = register value / 163.84
8.11.4 Fundamental wave current on phase A/B/C
Name:
DftAI_Fund
DftBI_Fund
DftCI_Fund
Data type
UINT
Values
0...32767: Fundamental wave current
Conversion of fundamental wave current = register value * 209 * 65535 / 8388608
8.11.5 Fundamental wave voltage on phase A/B/C
Name:
DftAV_Fund
DftBV_Fund
DftCV_Fund
Data type
UINT
Values
0...32767: Fundamental value voltage
Conversion of fundamental wave voltage = register value * 209 * 65535 / 8388608
Data sheet V 1.01
41
X20AP3111, X20AP3121 and X20AP3131
8.12 Module configuration
8.12.1 Analog mode register
Name:
ChanControl
Data type
UINT
Bit
0
Description
Channel status LED for phase A
Value
0
1
Channel status LED for phase B
0
1
Channel status LED for phase C
0
1
Reserved
0
Neutral current monitor and status LED
0
1
Neutral current status derived from the calculated or measured 0
value
1
Conversion of energy register to kWh (internal register / 4096) 0
1
Reserved
0
Oversampling with prescaler
0
1-255
1
2
3
4
5
6
7
8-15
1)
Values
See bit structure
Information
Disabled
Enabled1)
Disabled
Enabled1)
Disabled
Enabled1)
Disabled
Enabled1)
Derived from the calculated value1)
Derived from the calculated value
Disabled
Enabled
Disabled1)
Enabled
Standard in the bus controller function model
8.12.2 Analog minimum current for active current channel LED
Name:
IDispTh
Data type
UINT
Values
100...65000: I RMS indicator threshold
The indicator threshold defines the RMS value of the current at which the status LED for the phase current is
illuminated. The default values are module-dependent and should be adjusted to the current transformer conversion
ratio. Suggestion: 1% of maximum value
Module
X20AP3111
X20AP3121
X20AP3131
Indicator threshold
200 mA
500 mA
500 mA
8.12.3 Current transformer conversion ratio of phase A/B/C/N
Name:
I_RatioA
I_RatioB
I_RatioC
I_RatioN
Data type
UINT
Values
10...x: Current transformer conversion ratio
The measured current is multiplied with the current transformer conversion ratio. The permissible values are module-dependent (resolution 0.1):
Module
X20AP3111
X20AP3121
X20AP3131
Current transformer conversion ratio
10 to 32,500 (default: 25000)
10 to 650 (default: 500)
10 to 130 (default: 100)
Information:
The maximum resulting current must not exceed the value of 65000 mA.
42
Data sheet V 1.01
X20AP3111, X20AP3121 and X20AP3131
8.12.4 Update request ADC Cfg register
Name:
CfgUpdate
The registers in the group CfgReg are only updated after the CfgUpdate register is changed. Setting 0xFFFF only
causes this register to be reset without updating the CfgReg register.
Data type
UINT
Values
0...65535: Update request
8.12.5 Update request ADC Cs0 and Cs3 register
Name:
Cs0Update
Cs3Update
The registers in the group CsxReg are only updated after the CsxUpdate register is changed. Setting 0xFFFF only
causes this register to be reset without updating the CsxReg register.
Data type
UINT
Values
0...65535: Update request
Name:
Cs3UpdateFB
The ADC configuration registers are only transferred to the feedback buffer after transfer to the ADC is complete.
Data type
UINT
Data sheet V 1.01
Values
0...65535
43
X20AP3111, X20AP3121 and X20AP3131
8.13 ADC status configuration
8.13.1 ADC hardware signal allocation
Name:
ZXConfig
Data type
UINT
Values
See bit structure
Bit
0
Description
Zero cross signals
1-2
ZX20Con: Trigger zero cross-over
3-4
ZX1Con: Trigger zero cross-over
5-6
ZX2Con: Trigger zero cross-over
7-9
ZX0Src: Signal source for ZX0 hardware signal
10-12
ZX1Src: Signal source for ZX1 hardware signal
13-15
ZX2Src: Signal source for ZX2 hardware signal
1)
Value
0
1
00
01
10
11
00
01
10
11
00
01
10
11
000
001
010
011
100
101
110
111
000
001
010
011
100
101
110
111
000
001
010
011
100
101
110
111
Information
Enabled
Disabled
Positive zero cross-over1)
Negative zero cross-over
Both zero cross-overs
No zero cross-over
Positive zero cross-over1)
Negative zero cross-over
Both zero cross-overs
No zero cross-over
Positive zero cross-over1)
Negative zero cross-over
Both zero cross-overs
No zero cross-over
Voltage A1)
Voltage B
Voltage C
Fix 0
Current A
Current B
Current C
Fix 0
Voltage A
Voltage B1)
Voltage C
Fix 0
Current A
Current B
Current C
Fix 0
Voltage A
Voltage B
Voltage C1)
Fix 0
Current A
Current B
Current C
Fix 0
Standard in the bus controller function model
8.13.2 Voltage warning threshold
Name:
SagTh
Data type
UINT
Values
5000...50000: Resolution 0.01 V
This register defines an RMS voltage value for monitoring the voltage warning signal.
8.13.3 Power failure threshold
Name:
PhaseLoseTh
Data type
UINT
Values
1000...6000: Resolution 0.01 V
This register defines an RMS voltage value for monitoring the power failure signal.
44
Data sheet V 1.01
X20AP3111, X20AP3121 and X20AP3131
8.13.4 Warning threshold for the calculated neutral current
Name:
INWarnTh0
Current value for monitoring the neutral line signals.
Data type
UINT
Values
0...65000: Resolution 0.001 A
8.13.5 Warning threshold for exceeding voltage THD
Name:
THDNUTh
Percentage value defining warning threshold for THD ratio.
Data type
UINT
Values
0...10000: Resolution 0.01%
8.13.6 Warning threshold for exceeding current THD
Name:
THDNITh
Percentage value defining warning threshold for THD ratio.
Data type
UINT
Data sheet V 1.01
Values
0...10000: Resolution 0.01%
45
X20AP3111, X20AP3121 and X20AP3131
8.14 ADC measurement configuration checksum 0
8.14.1 H-word for power line constants
Name:
PLconstH
Data type
UINT
Values
0...65535
Basis value of power line constant = 0x4A817C80 = 1,250,000,000 corresponding to 360 CF pulses per kWh
or 0.1 CF pulse per kWs. The result of setting the resolution in the energy registers to a decimal (see register
<MeteringMode, bit 9>) is 1 kWs per digit. Power line constant / 10 results in a 10x resolution.
8.14.2 L-word for power line constants
Name:
PLconstL
Data type
UINT
Values
0...65535
Basis value of power line constant = 0x4A817C80 = 1,250,000,000 corresponding to 360 CF pulses per kWh
or 0.1 CF pulse per kWs. The result of setting the resolution in the energy registers to a decimal (see register
<MeteringMode, bit 9>) is 1 kWs per digit. Power line constant / 10 results in a 10x resolution.
8.14.3 Analog ADC measurement setting 1
Name:
MeteringMode
Data type
UINT
Bit
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14-15
1)
Values
See bit structure
Description
Value
Enables phase C for adding the power and energy values to- 0
gether
1
Enables phase B for adding the power and energy values to- 0
gether
1
Enables phase A for adding the power and energy values to- 0
gether
1
Calculation method for adding active power and active energy 0
1
Calculation method for adding reactive power and reactive en- 0
ergy
1
Reserved
0
Selects apparent energy for CF2 source
0
1
CF2 source
0
1
Measuring configuration
0
1
Resolution of energy register
0
1
Integrator for didt current transformer
0
1
High-pass filter
0
1
Basis frequency
0
1
Phase assignment
0
1
Reserved
0
Information
Not enabled
Enabled1)
Not enabled
Enabled1)
Not enabled
Enabled1)
Arithmetic sum1)
Absolute sum
Arithmetic sum1)
Absolute sum
Arithmetic sum1)
Vector sum
Apparent energy
Reactive energy1)
3P4W1)
3P3W
0.1 CF1)
0.01 CF
Disabled
Enabled
Enabled
Disabled
50 Hz1)
60 Hz
I1 to Phase A and I3 to Phase C1)
I1 to Phase C and I3 to Phase A
Standard in the bus controller function model
Comments regarding measurement configurations:
Measuring configuration
3P4W
3P3W
46
Note
Monitors the phasing of voltages and currents: Phase A before phase B before phase C
Measuring configuration: Phase A and phase C, N connection bridges to phase B or open
Measurement: e.g. the 2 phases A and C and the 2 corresponding currents are measured, phase B deactivated
Monitors the phasing of voltages and currents: Phase difference between A and C >180°
Data sheet V 1.01
X20AP3111, X20AP3121 and X20AP3131
8.15 User calibration of current and voltage values
Use the following procedure to properly calculate gain and offset:
• Read out the predefined values:
See section 8.16 "ADC RMS comparison - read" on page 48
• Calculate and set new values:
See section 8.17 "ADC RMS comparison checksum 3" on page 49
• Update predefined values by setting the register <Cs3Update> (see section 8.12.5 "Update request ADC
Cs0 and Cs3 register" on page 43). The predefined values have been updated when the value in the
register <Cs3UpdateFB> (see section 8.12.5 "Update request ADC Cs0 and Cs3 register" on page 43) is
equal to the value of <Cs3Update>.
Data sheet V 1.01
47
X20AP3111, X20AP3121 and X20AP3131
8.16 ADC RMS comparison - read
8.16.1 General information
The values in the registers specified below must be read at the beginning of the calibration. This is the only way
to ensure that the gain and offset will be calculated correctly.
The values contained in the registers correspond to the valueold in the calculation formulas for gain and offset (see
section 8.17 "ADC RMS comparison checksum 3" on page 49).
8.16.2 Voltage RMS gain phase A/B/C
Name:
UGainA_R
UGainB_R
UGainC_R
Data type
UINT
Values
0...65535
8.16.3 Current RMS gain phase A/B/C/N
Name:
IGainA_R
IGainB_R
IGainC_R
IGainN_R
Data type
UINT
Values
0...65535
8.16.4 Voltage RMS offset phase A/B/C
Name:
UoffsetA_R
UoffsetB_R
UoffsetC_R
Data type
INT
Values
-32767...32767
8.16.5 Current RMS offset phase A/B/C/N
Name:
IoffsetA_R
IoffsetB_R
IoffsetC_R
IoffsetN_R
Data type
INT
48
Values
-32767...32767
Data sheet V 1.01
X20AP3111, X20AP3121 and X20AP3131
8.17 ADC RMS comparison checksum 3
8.17.1 Voltage RMS gain phase A/B/C
Name:
UGainA_W
UGainB_W
UGainC_W
Data type
UINT
Values
0...65535: Voltage RMS gain, phase-based
The resulting gain is calculated using the following formula:
Valuenew = Valueold * correction factor, determined when U = Un
8.17.2 Current RMS gain phase A/B/C/N
Name:
IGainA_W
IGainB_W
IGainC_W
IGainN_W
Data type
UINT
Values
0...65535: Current RMS gain, phase-based
The resulting gain is calculated using the following formula:
Valuenew = Valueold * correction factor, determined when I = In
8.17.3 Voltage RMS offset phase A/B/C
Name:
UoffsetA_W
UoffsetB_W
UoffsetC_W
Corresponds to the negated value of the corresponding RMS register when U = 0.
Data type
INT
Values
-32767...32767: RMS voltage offset, phase-based
8.17.4 Current RMS offset phase A/B/C/N
Name:
IoffsetA_W
IoffsetB_W
IoffsetC_W
IoffsetN_W
Corresponds to the negated value of the corresponding RMS register when I = 0.
Data type
INT
Data sheet V 1.01
Values
-32767...32767: RMS current offset, phase-based
49
X20AP3111, X20AP3121 and X20AP3131
8.18 FlatStream interface
8.18.1 Register names
List of FlatStream register names used:
OutputMTU
InputMTU
FlatstreamMode
Forward
ForwardDelay
InputSequence
RxByteN (N = 1..27)
OutputSequence
TxByteN (N = 1..15)
50
Data sheet V 1.01
X20AP3111, X20AP3121 and X20AP3131
8.19 FlatStream communication
8.19.1 Introduction
B&R offers an additional communication method for some modules. "FlatStream" was designed for X2X and
POWERLINK networks and allows data transfer adapted to individual demands. Although this method is not 100%
real-time capable, it still allows data transfer to be handled more efficiently than with standard cyclic polling.
Field Device
Language
X2X
cyclic request
via I/O-Mapping
B&R CPU
PLC or
Bus controller
cyclic request
B&R-Modules
of cached values
caches values
cyclic
Communication
B&R-Field Device
acyclic request
B&R-Modules
cyclic
Communication
B&R-Field Device
X2X-compatible
device command
B&R-Modules
device command
B&R-Field Device
acyclic request
via Library Function
B&R CPU
PLC or
Bus controller
of cached values
caches values
FlatStream
B&R CPU
PLC or
Bus controller
as Bridge
Figure 15: Three types of communication
FlatStream extends cyclic and acyclic data queries. With FlatStream communication, the module acts as a bridge.
It is used to pass CPU queries directly on to the field device.
Data sheet V 1.01
51
X20AP3111, X20AP3121 and X20AP3131
8.19.2 Message, segment, sequence, MTU
The physical properties of the bus system limit the amount of data that can be transferred during one bus cycle.
With FlatStream communication, all messages are viewed as part of a continuous data stream. Long data streams
must be broken down into several fragments that are sent one after the other. To understand how the receiver puts
these fragments back together to get the original information, it is important to understand the difference between
a message, a segment, a sequence and the MTU.
Message:
A message refers to information exchanged between two partner stations. The length of a message is not restricted
by the FlatStream communication method. Nevertheless, module-specific limitations must be considered.
Segment (logical division of a message):
A segment has a finite size and can be understood as a section of a message. The number of segments per
message is arbitrary. In order for the receiving station to reconstruct the transferred segments correctly, each
segment is preceded by a control byte containing additional information such as the length of the segment and
whether or not the segment following completes the message. This makes it possible for the receiving station to
interpret the incoming data stream correctly.
Sequence (how a segment needs to be arranged physically):
The size of a sequence corresponds exactly to the number of activated Rx or Tx bytes (later: "MTU"). The transmitting station splits the transmit array into valid sequences. These sequences are then written successively to
the MTU and transferred to the receiving station where they are put back together again. The receiver stores the
incoming sequences in a receive array, obtaining an image of the data stream in the process.
With FlatStream communication, the number of sequences sent are counted. Sequences transferred successfully
must be acknowledged by the receiving station to ensure the integrity of the transmission.
MTU (Maximum Transmission Unit) – Physical transport:
MTU refers to the activated USINT registers used with FlatStream. These registers can accept a sequence and
pass it on to the receiving station. A separate MTU is defined for each direction of communication. The OutputMTU
defines the number of FlatStream Tx bytes, and the InputMTU specifies the number of FlatStream Rx bytes. The
MTUs are transported cyclically via the X2X bus, increasing the load with each additional activated USINT register.
Features:
FlatStream messages are not transferred cyclically or in 100% real time. Many bus cycles may be needed to transfer a certain message. Although the Rx and Tx registers are exchanged between the transmitter and the receiver cyclically, they are only processed further if explicitly accepted by the "InputSequence" or "OutputSequence"
register.
Behavior in the event of an error (brief summary):
The protocol for X2X and POWERLINK networks specifies that the last valid values should be retained when
disturbances occur. With conventional communication (cyclic/acyclic data queries), this type of error can generally
be ignored.
In order for communication to also take place without errors using FlatStream, all of the sequences issued by the
receiver must be acknowledged. If "Forward" functionality is not used, then subsequent communication is delayed
for the length of the disturbance.
If "Forward" functionality is being used, the receiving station receives a transmission counter that is incremented
twice. The receiver stops, i.e. it no longer returns any acknowledgments. The transmitting station uses the SequenceAck to determine that the transmission was faulty and all affected sequences will have to be repeated.
52
Data sheet V 1.01
X20AP3111, X20AP3121 and X20AP3131
8.19.3 The FlatStream principle
Requirement:
Before FlatStream can be used, the respective communication direction must be synchronized, i.e. both communication partners cyclically query the sequence counter on the opposite station. This checks to see if there is new
data that should be accepted.
Communication:
If a communication partner wants to transmit a message to its opposite station, it should first create a transmit
array that corresponds to FlatStream conventions. This allows the FlatStream data to be organized very efficiently
without having to block other important resources.
PLC/Bus controller
Transmit array
Type: USINT
OutputMTU
Type: USINT
_data_01
_data_02
_data_03
_data_04
_data_05
...
_data_xx
TxBytes
If OutputMTU
is released:
_data_01
_data_02
_data_03
_data_04
_data_05
...
_data_xx
Module
Module-internal
Receive array
Type: USINT
If OutputSequenceCounter is
incremented:
Module adds
transmit buffer
to internal array
If successful: InputSequenceAck will
be adapted to
Transmit counter
InputMTU
Type: USINT
If InputSequenceCounter is
incremented:
InputMTU must
be added to the
end of receive
to internal array
*RxBytes
Transmit buffer
of module is
adapted
cyclically to
OutputMTU
by X2X
CPU fills
OutputMTU
with next
sequence from
Transmit array
Receive array
Type: USINT
Cyc.
Module-internal
receive buffer
Type: USINT
RxBytes
Cyc.
InputMTU is
adapted
cyclically to
Receive
buffer of
module by
X2X
Module-internal
Transmit buffer
Type: USINT
*TxBytes
(increment InputSequenceAck to
end correctly)
_data_01
_data_02
_data_03
_data_04
_data_05
...
_data_xx
Module-internal
Transmit array
Type: USINT
If allowed:
Module fills internal
Transmit buffer
with next sequence
of transmit array
Module increments
InputSequenceCounter
_data_01
_data_02
_data_03
_data_04
_data_05
...
_data_xx
Figure 16: FlatStream communication
Approach:
The first thing that happens is that the message is broken into valid segments of up to 63 bytes, and the corresponding control bytes are created. The data is added to a data stream, alternating control bytes followed by their
corresponding segments This data stream can be written to the transmit array. The maximum size of each array
element matches that of the enabled MTU so that one element corresponds to one sequence.
When the array has been completely created, the transmitter checks whether the MTU is allowed to be refilled.
Then it copies the first element of the array or the first sequence to the Tx byte registers. The MTU is transported
to the receiver station via the X2X bus and stored in the corresponding Rx byte registers. To signal that the data
should be accepted by the receiver, the transmitter increases its SequenceCounter.
If the communication direction is synchronized, the opposite station detects the incremented SequenceCounter.
The current sequence is appended to the receive array and acknowledged by SequenceAck. This acknowledgment
signals to the transmitter that the MTU can now be refilled.
If the transmission is successful, the data in the receive array will correspond 100% to the data in the transmit array.
During the transfer, the receiving station must detect and evaluate the incoming control bytes. A separate receive
array should be created for every message. This allows the receiver to immediately begin further processing of
messages once they have been completely transferred.
Data sheet V 1.01
53
X20AP3111, X20AP3121 and X20AP3131
8.19.4 Registers for FlatStream mode
Five registers are available for configuring FlatStream. The default configuration can be used to transfer small
amounts of data relatively easily.
Information:
The CPU communicates directly with the field device via the OutputSequence/InputSequence registers
and the enabled Tx bytes / Rx bytes. For this reason, the user needs to have sufficient knowledge of
the communication protocol being used on the field device.
FlatStream configuration
To use FlatStream, the program sequence must first be expanded. The cycle time of the FlatStream routines must
be set to a multiple of the bus cycle. Other program routines should be implemented in Cyclic #1 to ensure data
consistency.
At the absolute minimum, the "InputMTU" and "OutputMTU" registers need to be configured. All other registers are
filled in with default values at the beginning and can be used immediately. These registers are used for additional
options, e.g. to transfer data in a more compact way or to increase the efficiency of the general procedure.
The "Forward" registers extend the functionality of the FlatStream protocol. This functionality is useful for substantially increasing the FlatStream data rate, but it also requires quite a bit of extra work when creating the program
sequence.
OutputMTU, InputMTU
These registers define the number of activated Tx or Rx bytes, i.e. the maximum size of a sequence. The user
must consider that the more bytes made available also means a higher load on the bus system.
Information:
In the rest of this documentation, the designations "OutputMTU" and "InputMTU" do not refer to the
registers explained here. Instead, they are used as synonyms for the currently active Tx or Rx bytes.
Data type
USINT
54
Values
See the module-specific register overview (theoretically: 3 - 27)
Data sheet V 1.01
X20AP3111, X20AP3121 and X20AP3131
FlatStream operation
When using FlatStream, the communication direction is enormously important. For sending data to a module ("output" direction), the Tx bytes are used. For receiving data from a module ("input" direction"), the Rx bytes are used.
The "OutputSequence" and "InputSequence" registers are used to control and ensure that communication is taking
place properly, i.e. the transmitter issues the directive that the data should be accepted and the receiver acknowledges that a sequence has been transferred successfully.
Tx-/Rx-Bytes:
The Tx and Rx bytes are cyclic registers used to transport the payload data and the necessary control bytes.
The number of active Tx/Rx bytes is taken from the configuration of the "OutputMTU" and "InputMTU" registers,
respectively.
In the user's program, only the Tx/Rx bytes from the CPU can be used. The corresponding counterparts are located
in the module and are not accessible to the user. For this reason, designations were chosen from the CPU point
of view.
• "T" - "Transmit" → CPU transmits data to the module
• "R" - "Receive" → CPU receives data from the module
Data type
USINT
Values
0...65535
Control bytes:
In addition to the payload data, the Tx and Rx bytes also transfer the necessary control bytes. These control bytes
contain additional information about the data stream so that the receiver can reconstruct the original message from
the transferred segments.
Bit structure of a control byte:
Bit
0-5
Description
SegmentLength
6
nextCBPos
7
MessageEndBit
0-63
0
1
0
1
Information
Size in bytes of the following segment (default: max. MTUSize
- 1)
Next control byte at the beginning of the next MTU
Next control byte directly at the end of this segment
Message continues after the subsequent segment
Message ends after the subsequent segment
Segment length:
The segment length lets the receiver know the length of the coming segment. If the configured segment length
is insufficient for a message, then the information must be distributed over several segments. In these cases, the
actual end of the message is detected using bit 7 of the control byte.
Information:
The control byte is not included in the calculation to determine the segment length. The segment length
is only derived from the bytes of payload data.
nextCBPos:
This bit indicates the position where the next control byte is to be expected. This information is especially important
when using the "MultiSegmentMTU" option.
When using FlatStream communication with multi-segment MTUs, the next control byte is no longer expected in
the first Rx byte of the subsequent MTU, but directly after the current segment.
MessageEndBit:
The "MessageEndBit" is set if the subsequent segment completes a message. The message is then completely
transferred and can be processed further.
Information:
In the output direction, this bit must also be set if one individual segment is enough to take on the
entire message. The module will only process a message internally if this identifying mark is detected.
The size of the message being transferred can be calculated by adding all of the message's segment
lengths together.
FlatStream formula for calculating message length:
Message [bytes] = SegmentLengths (all CBs without ME) + SegmentLength (of the first CB with
ME)
Data sheet V 1.01
CB
ME
Control byte
MessageEndBit
55
X20AP3111, X20AP3121 and X20AP3131
OutputSequence
The "OutputSequence" register contains information about the communication status of the CPU. It is written by
the CPU and read by the module.
Data type
USINT
Values
See bit structure
Bit structure:
Bit
0-2
3
Description
OutputSequenceCounter
OutputSyncBit
4-6
7
InputSequenceAck
InputSyncAck
0-7
0
1
0-7
0
1
Information
Counter for the sequences issued in the output direction
Output direction disabled
Output direction enabled
Mirrors the InputSequenceCounter value
Input direction not ready (disabled)
Input direction ready (enabled)
OutputSequenceCounter:
The OutputSequenceCounter is a continuous counter of sequences that have been issued by the CPU. The CPU
uses the OutputSequenceCounter to direct the module to accept a sequence (the output direction must be synchronized when this happens).
OutputSyncBit:
The CPU uses the OutputSyncBit to try and synchronize the output channel.
InputSequenceAck:
InputSequenceAck is used for acknowledgment. The value of the InputSequenceCounter is mirrored if the CPU
has received a sequence successfully.
InputSyncAck:
The InputSyncAck bit acknowledges the synchronization of the input channel for the module. This indicates that
the CPU is ready to receive data.
56
Data sheet V 1.01
X20AP3111, X20AP3121 and X20AP3131
InputSequence
The "InputSequence" register contains information about the communication status of the module. It is written by
the module and should only be read by the CPU.
Data type
USINT
Values
See bit structure
Bit structure:
Bit
0-2
3
Description
InputSequenceCounter
InputSyncBit
4-6
7
OutputSequenceAck
OutputSyncAck
0-7
0
1
0-7
0
1
Information
Counter for the sequences issued in the input direction
Not ready (disabled)
Ready (enabled)
Mirrors the OutputSequenceCounter value
Not ready (disabled)
Ready (enabled)
InputSequenceCounter:
The InputSequenceCounter is a continuous counter of sequences that have been issued by the module. The
module uses the InputSequenceCounter to direct the CPU to accept a sequence (the input direction must be
synchronized when this happens).
InputSyncBit:
The module uses the InputSyncBit to try and synchronize the input channel.
OutputSequenceAck:
OutputSequenceAck is used for acknowledgment. The value of the OutputSequenceCounter is mirrored if the
module has received a sequence successfully.
OutputSyncAck:
The OutputSyncAck bit acknowledges the synchronization of the output channel for the CPU. This indicates that
the module is ready to receive data.
Relationship between OutputSequence and InputSequence
OutputSequence
InputSequence
Communication status of CPU
0-2 OutputSequenceCounter
3
OutputSyncBit
4-6
7
InputSequenceAck
InputSyncAck
Communication status of module
Crossover
Handshake
0-2
3
InputSequenceCounter
InputSyncBit
4-6
7
OutputSequenceAck
OutputSyncAck
Figure 17: Relationship between OutputSequence and InputSequence
The OutputSequence and InputSequence registers are logically composed of two half-bytes. The low part signals
to the opposite station whether a channel should be opened or if data should be accepted. The high part is to
acknowledge that the requested action was carried out.
SyncBit und SyncAck:
If SyncBit and SyncAck are set in one communication direction, then the channel is considered "synchronized", i.e.
it is possible to send messages in this direction. The status bit of the opposite station must be checked cyclically.
If SyncAck has been reset, then the SyncBit must be adjusted on that station. Before new data can be transferred,
the channel needs to be resynchronized.
SequenceCounter und SequenceAck:
The communication partners cyclically check whether the low nibble on the opposite station changes. When one
of the communication partners finishes writing a new sequence to the MTU, it increments its SequenceCounter.
The current sequence is then transferred to the receiver, who acknowledges its receipt with SequenceAck. In this
way, a "handshake" is initiated.
Information:
If communication is interrupted, segments from the unfinished message transfer are discarded. All
messages that were transferred completely are processed.
Data sheet V 1.01
57
X20AP3111, X20AP3121 and X20AP3131
Synchronization
During synchronization, a communication channel is opened. It is important to make sure that a module is present
and that the current value of the SequenceCounter is stored on the station receiving the message.
FlatStream can handle full-duplex communication. This means that both channels / communication directions can
be handled separately. They have to be synchronized completely so that simplex communication can theoretically
be carried out as well.
Synchronization in the output direction (CPU as the transmitter):
The corresponding synchronization bits (OutputSyncBit and OutputSyncAck) are reset. Because of this, FlatStream
cannot be used at this time to send messages from the CPU to the module.
Algorithm:
1.) The CPU must write 000 in the OutputSequenceCounter and reset OutputSyncBit.
CPU must cyclically poll the high nibble of the "InputSequence" register (check for 000 in OutputSequenceAck and 0 in OutputSyncAck).
The module doesn't accept the current contents of the InputMTU since the channel is not yet synchronized.
The module matches OutputSequenceAck and OutputSyncAck to the values of OutputSequenceCounter and OutputSyncBit.
2.) If the CPU registers the expected values in OutputSequenceAck and OutputSyncAck, it is allowed to increment OutputSequenceCounter.
The CPU continues cyclically querying the high nibble of the "OutputSequence" register (check for 001 in OutputSequenceAck and 0 in InputSyncAck).
The module doesn't accept the current contents of the InputMTU since the channel is not yet synchronized.
The module matches OutputSequenceAck and OutputSyncAck to the values of OutputSequenceCounter and OutputSyncBit.
3.) If the CPU registers the expected values in OutputSequenceAck and OutputSyncAck, it is allowed to set OutputSyncBit.
The CPU continues cyclically querying the high nibble of the "OutputSequence" register (check for 001 in OutputSequenceAck and 1 in InputSyncAck).
Note:
Theoretically, data can be transferred from this point forward. However, it is still recommended to wait until the output direction is completely synchronized before transferring data.
Modules sets OutputSyncAck.
Output direction synchronized; the CPU can transmit data to the module.
Synchronization in the input direction (CPU as the receiver):
The corresponding synchronization bits (InputSyncBit and InputSyncAck) are reset. Because of this, FlatStream
cannot be used at this time to send messages from the module to the CPU.
Algorithm:
The module writes 000 to InputSequenceCounter and resets InputSyncBit.
The module monitors the high nibble of the "OutputSequence" register and expects 000 in InputSequenceAck and 0 in InputSyncAck.
1.) The CPU isn't allowed to accept the current contents of the InputMTU since the channel is not yet synchronized.
The CPU has to match InputSequenceAck and InputSyncAck to the values of InputSequenceCounter and InputSyncBit.
If the module registers the expected values in InputSequenceAck and InputSyncAck, it increments the InputSequenceCounter.
The module monitors the high nibble of the "OutputSequence" registers and expects 001 in InputSequenceAck and 0 in InputSyncAck.
2.) The CPU isn't allowed to accept the current contents of the InputMTU since the channel is not yet synchronized.
The CPU has to match InputSequenceAck and InputSyncAck to the values of InputSequenceCounter and InputSyncBit.
If the module registers the expected values in InputSequenceAck and InputSyncAck, it sets the InputSyncBit.
The module monitors the high nibble of the "OutputSequence" register and expects 1 in InputSyncAck.
3.) CPU is allowed to set InputSyncAck.
Note:
Theoretically, data can be transferred right in this cycle.
Rule: If the InputSyncBit is set and InputSequenceCounter has been increased by 1, the information in the activated Rx bytes has to be accepted and acknowledged (see also "Communication in the input direction").
Input direction synchronized; the module can transmit data to the CPU.
58
Data sheet V 1.01
X20AP3111, X20AP3121 and X20AP3131
Sending and receiving
If a channel is synchronized, then the opposite station is ready to receive messages from the transmitter. Before
the transmitter can send data, it needs to first create a transmit array in oreder to meet FlatStream requirements.
The transmitting station must also generate a control byte for each segment created. This control byte contains
information about how the subsequent part of the data being transferred should be processed. The position of the
next control byte in the data stream can vary. For this reason, it must be absolutely clear at all time when a new
control byte is being transferred. The first control byte is always in the first byte of the first sequence. All subsequent
positions are conveyed recursively.
FlatStream formula for calculating the position of the next control byte:
Position (of the next control byte) = Current position + 1 + Segment length
Example:
Three autonomous messages (7 bytes, 2 bytes and 9 bytes) are being transferred using an MTU with a width of
7 bytes. The rest of the configuration corresponds to the default settings.
Transmit/Receive array
Message 1:
With 7 USINT elements according
A1
A2
A3
A4
A5
A6
to configured MTU size
A7
Default
Message 2:
B1
B2
C1
A1
A2
A3
A4
A5
A6
Sequence for bus cycle 1
C2
A7
-
-
-
-
-
Sequence for bus cycle 2
C3
B1
B2
-
-
-
-
Sequence for bus cycle 3
C4
D1
D2
D3
D4
D5
D6
C5
D7
D8
D9
-
-
-
Sequence for bus cycle 5
C0
-
-
-
-
-
-
Sequence for bus cycle 6
Message 3:
D1
D2
D3
D4
D5
D6
D7
No more data to send
-
-
-
...
D8
D9
Sequence for bus cycle 4
Figure 18: Transmit/Receive array (default)
First, the messages must be split into segments. In the default configuration, it is important to ensure that each
sequence can take on an entire segment, including the associated control byte. The sequence is limited to the size
of the activated MTU. In other words, a segment must be at least 1 byte smaller than the MTU.
MTU = 7 bytes → Max. segment length = 6 bytes
• Message 1 (7 bytes)
➯ First segment = Control byte + 6 data bytes
➯ Second segment = Control byte + 1 data byte
• Message 2 (2 bytes)
➯ First segment = Control byte + 2 data bytes
• Message 3 (9 bytes)
➯ First segment = Control byte + 6 data bytes
➯ Second segment = Control byte + 3 data bytes
• No more messages
➯ C0 control byte
Data sheet V 1.01
59
X20AP3111, X20AP3121 and X20AP3131
A unique control byte must be generated for each segment. In addition, the C0 control byte is generated to keep
communication on standby.
C0 (control byte 0)
- SegmentLength (0)
- nextCBPos (0)
- MessageEndBit (0)
Control byte
=
=
=
Σ
0
0
0
0
C1 (control byte 1)
- SegmentLength (6)
- nextCBPos (0)
- MessageEndBit (0)
Control byte
=
=
=
Σ
6
0
0
6
C2 (control byte 2)
- SegmentLength (1)
- nextCBPos (0)
- MessageEndBit (1)
Control byte
=
=
=
Σ
1
0
128
129
=
=
=
Σ
3
0
128
131
Table 6: FlatStream determination of the control bytes for default configuration example (part 1)
C3 (control byte 3)
- SegmentLength (2)
- nextCBPos (0)
- MessageEndBit (1)
Control byte
=
=
=
Σ
2
0
128
130
C4 (control byte 4)
- SegmentLength (6)
- nextCBPos (0)
- MessageEndBit (0)
Control byte
=
=
=
Σ
6
0
0
6
C5 (control byte 5)
- SegmentLength (3)
- nextCBPos (0)
- MessageEndBit (1)
Control byte
Table 7: FlatStream determination of the control bytes for default configuration example (part 2)
60
Data sheet V 1.01
X20AP3111, X20AP3121 and X20AP3131
Transmitting data to a module (output)
When transmitting data, the transmit array must be generated in the application program. Sequences are then
transferred one by one using FlatStream and received by the module.
Information:
Although all B&R modules with FlatStream communication always support the most compact transmissions in the output direction, it is recommended to use the same design for the transfer arrays in
both communication directions.
PLC/Bus controller
Transmit/Receive array
Type: USINT
_data_01
_data_02
_data_03
_data_04
_data_05
...
_data_xx
OutputMTU
Type: USINT
TxBytes
if OutputMTU
is released:
CPU fills
OutputMTU
with next
sequence from
send array
cyc.
module-internal
Receive buffer
Type: USINT
*RxBytes
Transmit buffer
of module is
adapted
cyclically to
OutputMTU
by X2X
Module
module-internal
Receive array
Type: USINT
if OutputSequencecounter is
incremented:
module adds send
buffer to internal
array
If successful: InputSequenceAck will
be adapted to
send counter
_data_01
_data_02
_data_03
_data_04
_data_05
...
_data_xx
Figure 19: FlatStream communication (output)
The length of the message is initially smaller than the OutputMTU. In this case, one sequence would be sufficient
to transfer the entire message and the necessary control byte.
Algorithm:
Cyclic status query:
- Module monitors OutputSequenceCounter
0. Cyclic checks:
- The CPU must check OutputSyncAck
→ If OutputSyncAck = 0: reset OutputSyncBit and resynchronize channel
- The CPU must check whether OutputMTU enabled
→ If OutputSequenceCounter > InputSequenceAck: MTU not enabled since last sequence not yet acknowledged
1. Preparation (create transmit array):
- The CPU must split up message into valid segments and create the necessary control bytes
- The CPU must add the segments and control bytes to the transmit array
2. Transmission:
- The CPU transfers the current element of the transmit array to the OutputMTU
→ OutputMTU is transferred cyclically to the module's transmit buffer but not processed further
- The CPU must increase OutputSequenceCounter
Response:
- The module accepts the bytes from the internal receive buffer and adds them to the internal receive array
- The module sends acknowledgment, writes the value of OutputSequenceCounter to OutputSequenceAck
3. Completion:
- The CPU must monitor OutputSequenceAck
→ A sequence is only considered to have been transferred successfully if it has been acknowledged via OutputSequenceAck. In order to detect potential transfer errors in the last sequence as well, it's important to make sure that the length of the completion phase is sufficient.
Note:
To monitor communication times exactly, the task cycles that have passed since the last increase of the OutputSequenceCounter should be counted. In this
way, the number of previous bus cycles necessary for the transfer can be measured. If the monitoring counter exceeds a predefined threshold, then the sequence can be considered lost.
(The relationship of bus to task cycle can be influenced by the user so that the threshold value needs to be determined individually.)
- Subsequent sequences may only be sent in the next bus cycle after the completion check has been carried out successfully.
Data sheet V 1.01
61
X20AP3111, X20AP3121 and X20AP3131
Message larger than the OutputMTU:
The transmit array, which needs to be created in the program sequence, consists of several elements. The user
has to arrange the control and data bytes correctly and transfer the array elements one after the other. The transfer
algorithm remains the same and is repeated at the point Cyclic checks.
General flow chart:
Start
► diff = (OutputSequenceCounter OutputSequenceAck) AND 7
► limit = (OutputSequenceCounter LastValidAck) AND 7
(diff <= limit)
AND (OutputSyncAck = 1)
AND (OutputSyncBit = 1) ?
Yes
No
diff = 0?
No
No
OutputSequenceAck =
OutputSequenceCounter?
LastValidAck =
OutputSequenceCounter?
Yes
Yes
No
LastValidAck =
OutputSequenceAck
Yes
LastValidAck =
OutputSequenceAck
OutputSequenceAck = 0?
No
Yes
No
More sequences to be sent?
OutputSequenceCounter = 1
OutputSyncBit = 1
OutputSequenceCounter = 0
LastValidAck = 0
Yes
Copy next sequence to MTU
Increase OutputSequenceCounter
Sequence handling
Synchronization
Figure 20: Flow chart for the output direction
62
Data sheet V 1.01
X20AP3111, X20AP3121 and X20AP3131
Receiving data from a module (input)
When receiving data, the transmit array is generated by the module, transferred via FlatStream and must then
be reproduced in the receive array. The structure of the incoming data stream can be configured with the mode
register. The algorithm for receiving the data does not change in this regard.
PLC/Bus controller
InputMTU
Type: USINT
receive array
Type: USINT
_data_01
_data_02
_data_03
_data_04
_data_05
...
_data_xx
if InputSequenceCounter is
incremented:
InputMTU must
be added to the
end of receive
Array
(increment InputSequenceAck to
end correctly)
RxBytes
cyc.
module-internal
Transmit Buffer
Type: USINT
*TxBytes
InputMTU is
adapted
cyclically to
receive
Buffer of
module by
X2X
Module
module-internal
Transmit array
Type: USINT
If allowed:
module fills internal
Transmit buffer
with next sequence
of transmit array
module increments
InputSequencecounter
_data_01
_data_02
_data_03
_data_04
_data_05
...
_data_xx
Figure 21: FlatStream communication (input)
Algorithm:
0. Cyclic status query:
- The CPU must monitor InputSequenceCounter
Cyclic checks:
- The module checks InputSyncAck
- The module checks InputSequenceAck
Preparation:
- The module forms the segments, creates the control bytes and transmit array
Action:
- The module transfers the current element of the internal transmit array to the internal transmit buffer
- The module increases InputSequenceCounter
1. Receiving (as soon as InputSequenceCounter is increased):
- The CPU must accept data from the InputMTU and append it to the end of the receive array
- The CPU must match InputSequenceAck to the InputSequenceCounter of the sequence currently being processed
Completion:
- The module monitors InputSequenceAck
→ A sequence is only considered to have been transferred successfully if it has been acknowledged via InputSequenceAck.
- Subsequent sequences may only be sent in the next bus cycle after the completion check has been carried out successfully.
Data sheet V 1.01
63
X20AP3111, X20AP3121 and X20AP3131
General flow chart:
InputSyncBit = 1?
► InputSequenceAck = InputSequenceCounter
► RemainingSegmentSize = 0
► SegmentFlags = 0
No
Yes
InputSyncAck = 1?
No
InputSequenceAck > 0?
Yes
No
Yes
InputSyncAck = 1
MTU_Offset = 0
Synchronization
Start
No
(InputSequenceCounter –
InputSequenceAck)
AND 0x07 = 1?
Yes
No
Yes
RemainingSegmentSize >
(InputMTU_Size – MTU_Offset)?
No
► DataSize = RemainingSegmentSize
► DataSize = InputMTU_Size – MTU_Offset
► copy segment data e.g. memcpy(xxx, ADR(MTU_Data[MTU_Offset]), DataSize)
► MTU_Offset = MTU_Offset + DataSize
► RemainingSegmentSize = RemainingSegmentSize - DataSize
RemainingSegmentSize = 0 AND
(SegmentFlags AND 0x80) = 0?
Yes
► Mark frame as complete
Segment data handling
RemainingSegmentSize = 0?
► RemainingSegmentSize =
MTU_Data[MTU_Offset] AND 0b0011 1111
► SegmentFlags =
MTU_Data[MTU_Offset] AND 0b1100 0000
► MTU_Offset = MTU_Offset + 1
Yes
No
RemainingSegmentSize = 0 AND
(SegmentFlags AND 0x40) = 0?
Yes
No
InputMTU_Size = MTU_Offset?
Yes
► InputSequenceAck =
InputSequenceCounter
No
Figure 22: Flow chart for the input direction
64
Data sheet V 1.01
X20AP3111, X20AP3121 and X20AP3131
Details
It is recommended to store transmitted messages in separate receive arrays.
After a set MessageEndBit is transferred, the subsequent segment should be added to the receive array. Then
the message is complete and can be passed on internally for further processing. A new/separate array should be
created for the next message.
Information:
When transferring with multi-segment MTUs, it's possible for several small messages to be part of one
sequence. In the program, it's important to make sure that a sufficient number of receive arrays can
be managed. The entire sequence must be accepted before it is possible to change the Acknowledge
register.
If a SequenceCounter is incremented by more than one value, then an error has occurred (this situation is very
unlikely when operating without "Forward" functionality).
In this case, the receiver stops. All additional incoming sequences are ignored until the transmission with the correct
SequenceCounter is retried. This response prevents the transmitter from receiving any more acknowledgments for
transmitted sequences. The transmitter can identify the last successfully transferred sequence from the opposite
station's SequenceAck and continue the transmission from this point.
Acknowledgments have to be checked for validity.
If the receiver has successfully accepted a sequence, it must be acknowledged. The receiver takes on the SequenceCounter value sent along with the transfer and matches the SequenceAck to it. The transmitter reads the
SequenceAck and registers the successful transfer. If the transmitter acknowledges a sequence that hasn't yet
been dispatched, then the transfer needs to be interrupted and the channel resynchronized. The synchronization
bits are reset and the current/incomplete message is discarded. It needs to be resent once the channel has been
resynchronized.
Data sheet V 1.01
65
X20AP3111, X20AP3121 and X20AP3131
FlatStream mode register
In the input direction, the transmit array is generated automatically. This register offers two options to the user
that allow an incoming data stream to have a more compact arrangement. Once enabled, the program code for
evaluation must be adapted accordingly.
Information:
All B&R modules that offer FlatStream mode support the options "Large segments" and "Multi-segment
MTU" in the output direction. Compact transmission only needs to be explicitly allowed in the input
direction.
Bit structure:
Bit
0
Description
MultiSegmentMTU
1
Large segments
2-7
Reserved
Information
Not allowed (default)
Allowed
Not allowed (default)
Allowed
0
1
0
1
Default:
By default, both options relating to compact transfers in the input direction are disabled.
1. The module only forms segments that are at least one byte smaller than the activated MTU. Each sequence
begins with a control byte so that the data stream is clearly structured and relatively easy to evaluate.
2. Since a FlatStream message can be of any length, the last segment of the message frequently doesn't fill up
all of the MTU's space. By default, the remaining bytes during this type of transfer cycle are not used.
Bus cycle 1
Bus cycle 2
C
C
ME0
ME1
Bus cycle 3
-
-
C
Segment 2
Segment 1
Message 1
C
ME0
C
ME1
-
ME1
Segment 3
Message 2
Control byte with MessageEndBit = 0
Control byte with MessageEndBit = 1
Figure 23: Message arrangement in the MTU (default)
66
Data sheet V 1.01
X20AP3111, X20AP3121 and X20AP3131
MultiSegmentMTU erlaubt:
With this option, the InputMTU is completely filled (if enough data is pending). The previously unfilled Rx bytes
transfer the next control bytes and their segments. This allows the activated Rx bytes to be used more efficiently.
Bus cycle 1
Bus cycle 2
Bus cycle 3
C
C
C
C
ME0
ME1
ME0
ME1
Segment 2
Segment 1
3
ME0
C
ME1
-
Segment 4
Message 1
C
-
Message 2
Control byte with MessageEndBit = 0
Control byte with MessageEndBit = 1
Figure 24: Message arrangement in the MTU (MultiSegmentMTU)
Large segments allowed:
When transferring very long messages or when activating only very few Rx bytes, then a great many segments
must be created by default. The bus system is more stressed than necessary since an additional control byte needs
to be created and transferred for every segment. With the "Large segments" option, the segment length is limited
to 63 bytes independently of the InputMTU. One segment can stretch across several sequences, i.e. it's possible
for "pure" sequences to occur without a control byte.
Information:
It is still possible to split up a message into several segments, however. If this option is used and
messages with more than 63 bytes occur, for example, the messages can still be split up among several
segments.
Bus cycle 1
Bus cycle 2
C
Bus cycle 3
-
ME1
-
-
C
Segment 2
Segment 1
Message 1
C
ME0
C
ME1
-
ME1
Segment 3
Message 2
Control byte with MessageEndBit = 0
Control byte with MessageEndBit = 1
Figure 25: Message arrangement in the MTU (large segments)
Data sheet V 1.01
67
X20AP3111, X20AP3121 and X20AP3131
Using both options:
It is also possible to use both options at the same time.
Bus cycle 1
Bus cycle 2
Bus cycle 3
C
C
ME1
ME1
Segment 2
Segment 1
Message 1
C
ME0
C
ME1
-
-
-
-
Segment 3
Message 2
Control byte with MessageEndBit = 0
Control byte with MessageEndBit = 1
Figure 26: Message arrangement in the MTU (large segments and MultiSegmentMTU)
68
Data sheet V 1.01
X20AP3111, X20AP3121 and X20AP3131
FlatStream adjustment
If the way messages are structured is changed, then the way data in the transmit/receive array is arranged is also
different. The following changes apply to the example given earlier on.
MultiSegmentMTU:
If MultiSegmentMTUs are allowed, then "open positions" in an MTU can be used. These "open positions" occur if
the last segment in a message doesn't fully use the entire MTU. MultiSegmentMTUs allow these bits to be used
to transfer the following control bytes and segments. In the program sequence, the "nextCBPos" bit in the control
byte is set so that the receiver can correctly identify the next control byte.
Example:
Three autonomous messages (7 bytes, 2 bytes, 9 bytes) are being transferred using an MTU with a width of 7 bytes.
The configuration allows the transfer of MultiSegmentMTUs.
Transmit/Receive array
Message1:
With 7 USINT elements according
A1
A2
A3
A4
A5
A6
to configured MTU size
A7
MultiSegmentMTU
Message2:
B1
B2
C1
A1
A2
A3
A4
A5
A6
Sequence for bus cycle 1
C2
A7
C3
B1
B2
C4
D1
Sequence for bus cycle 2
C5
D2
D3
D4
D5
D6
D7
Sequence for bus cycle 3
C6
D8
D9
C0
-
-
-
Sequence for bus cycle 4
C0
-
-
-
-
-
-
Sequence for bus cycle 5
C0
-
-
-
-
-
-
Sequence for bus cycle 6
Message3:
D1
D2
D3
D4
D5
D6
D7
D8
D9
No more data to send
-
-
-
Etc.
Figure 27: Transmit/Receive array (MultiSegmentMTU)
First, the messages must be split into segments. As in the default configuration, it's important for each sequence
to begin with a control byte. The free bits in the MTU at the end of a message are filled with data from the following
message, however. With this option, the "nextCBPos" bit is always set if payload data is transferred after the control
byte.
MTU = 7 bytes → Max. segment length = 6 bytes
• Message 1 (7 bytes)
➯ First segment = Control byte + 6 data bytes (MTU full)
➯ Second segment = Control byte + 1 data byte (MTU still has 5 open bytes)
• Message 2 (2 bytes)
➯ First segment = Control byte + 2 data bytes (MTU still has 2 open bytes)
• Message 3 (9 bytes)
➯ First segment = Control byte + 1 data byte (MTU full)
➯ Second segment = Control byte + 6 data bytes (MTU full)
➯ Third segment = Control byte + 2 data bytes (MTU still has 4 open bytes)
• No more messages
➯ C0 control byte
Data sheet V 1.01
69
X20AP3111, X20AP3121 and X20AP3131
A unique control byte must be generated for each segment. In addition, the C0 control byte is generated to keep
communication on standby.
C1 (control byte 1)
- SegmentLength (6)
- nextCBPos (1)
- MessageEndBit (0)
Control byte
=
=
=
Σ
6
64
0
70
C2 (control byte 2)
- SegmentLength (1)
- nextCBPos (1)
- MessageEndBit (1)
Control byte
=
=
=
Σ
1
64
128
193
C3 (control byte 3)
- SegmentLength (2)
- nextCBPos (1)
- MessageEndBit (1)
Control byte
=
=
=
Σ
2
64
128
194
Table 8: FlatStream determination of the control bytes for default configuration example (part 1)
Warning!
The second sequence must have been completely processed before it can be acknowledged with SequenceAck. In the example, there are three different segments within the second sequence, i.e. the
program must include enough receive arrays to handle this situation.
C4 (control byte 4)
- SegmentLength (1)
- nextCBPos (6)
- MessageEndBit (0)
Control byte
=
=
=
Σ
1
6
0
7
C5 (control byte 5)
- SegmentLength (6)
- nextCBPos (1)
- MessageEndBit (1)
Control byte
=
=
=
Σ
6
64
0
70
C6 (control byte 6)
- SegmentLength (2)
- nextCBPos (1)
- MessageEndBit (1)
Control byte
=
=
=
Σ
2
64
128
194
Table 9: FlatStream determination of the control bytes for default configuration example (part 2)
70
Data sheet V 1.01
X20AP3111, X20AP3121 and X20AP3131
Large segments:
Segments are limited to a maximum of 63 bytes. This means they can be larger than the active MTU. These large
segments are divided among several sequences when transferred. It is possible for sequences to be completely
filled with payload data and not have a control byte.
Information:
It is still possible to subdivide a message into several segments so that the size of a data packet doesn't
also have to be limited to 63 bytes.
Example:
Three autonomous messages (7 bytes, 2 bytes, 9 bytes) are being transferred using an MTU with a width of 7 bytes.
The configuration allows the transfer of large segments.
Transmit/Receive array
Message1:
With 7 USINT elements according
A1
A2
A3
A4
A5
A6
to configured MTU size
A7
Large segments
Message2:
B1
B2
C1
A1
A2
A3
A4
A5
A6
Sequence for bus cycle 1
A7
-
-
-
-
-
-
Sequence for bus cycle 2
C2
B1
B2
-
-
-
-
Sequence for bus cycle 3
C3
D1
D2
D3
D4
D5
D6
D7
D8
D9
-
-
-
-
Sequence for bus cycle 5
C0
-
-
-
-
-
-
Sequence for bus cycle 6
Message3:
D1
D2
D3
D4
D5
D6
D7
D8
D9
No more data to send
-
-
-
Etc.
Sequence for bus cycle 4
Figure 28: Transmit/Receive array (large segments)
First, the messages must be split into segments. The ability to form large segments means that messages are split
up less frequently, which results in fewer generated control bytes.
Large segments allowed → Max. segment length = 63 bytes
• Message 1 (7 bytes)
➯ First segment = Control byte + 7 data bytes
• Message 2 (2 bytes)
➯ First segment = Control byte + 2 data bytes
• Message 3 (9 bytes)
➯ First segment = Control byte + 9 data bytes
• No more messages
➯ C0 control byte
A unique control byte must be generated for each segment. In addition, the C0 control byte is generated to keep
communication on standby.
C1 (control byte 1)
- SegmentLength (7)
- nextCBPos (0)
- MessageEndBit (1)
Control byte
=
=
=
Σ
7
0
128
135
C2 (control byte 2)
- SegmentLength (2)
- nextCBPos (0)
- MessageEndBit (1)
Control byte
=
=
=
Σ
2
0
128
130
C3 (control byte 3)
- SegmentLength (9)
- nextCBPos (0)
- MessageEndBit (1)
Control byte
=
=
=
Σ
9
0
128
137
Table 10: FlatStream determination of the control bytes for large segments example
Data sheet V 1.01
71
X20AP3111, X20AP3121 and X20AP3131
Large segments and MultiSegmentMTU:
Example:
Three autonomous messages (7 bytes, 2 bytes, 9 bytes) are being transferred using an MTU with a width of 7 bytes.
The configuration allows the transfer of large segments as well as MultiSegmentMTUs.
Transmit/Receive array
Message1:
With 7 USINT elements according
A1
A2
A3
A4
A5
A6
to configured MTU size
A7
Both options
Message2:
B1
B2
C1
A1
A2
A3
A4
A5
A6
Sequence for bus cycle 1
A7
C2
B1
B2
C3
D1
D2
Sequence for bus cycle 2
D3
D4
D5
D6
D7
D8
D9
Sequence for bus cycle 3
C0
-
-
-
-
-
-
Sequence for bus cycle 4
C0
-
-
-
-
-
-
Sequence for bus cycle 5
C0
-
-
-
-
-
-
Sequence for bus cycle 6
Message3:
D1
D2
D3
D4
D5
D6
D7
D8
D9
No more data to send
-
-
-
Etc.
Figure 29: Transmit/Receive array (large segments and MultiSegmentMTU)
First, the messages must be split into segments. If the last segment of a message doesn't completely fill the MTU,
it can be used for other data in the data stream. The "nextCBPos" bit must always be set if the control byte belongs
to a segment with payload data.
The ability to form large segments means that messages are split up less frequently, which results in fewer generated control bytes. Control bytes are generated in the same way as with the "Large segments" option.
Large segments allowed → Max. segment length = 63 bytes
• Message 1 (7 bytes)
➯ First segment = Control byte + 7 data bytes
• Message 2 (2 bytes)
➯ First segment = Control byte + 2 data bytes
• Message 3 (9 bytes)
➯ First segment = Control byte + 9 data bytes
• No more messages
➯ C0 control byte
A unique control byte must be generated for each segment. In addition, the C0 control byte is generated to keep
communication on standby.
C1 (control byte 1)
- SegmentLength (7)
- nextCBPos (0)
- MessageEndBit (1)
Control byte
=
=
=
Σ
7
0
128
135
C2 (control byte 2)
- SegmentLength (2)
- nextCBPos (0)
- MessageEndBit (1)
Control byte
=
=
=
Σ
2
0
128
130
C3 (control byte 3)
- SegmentLength (9)
- nextCBPos (0)
- MessageEndBit (1)
Control byte
=
=
=
Σ
9
0
128
137
Table 11: FlatStream determination of the control bytes for large segments and MultiSegmentMTU example
72
Data sheet V 1.01
X20AP3111, X20AP3121 and X20AP3131
8.19.5 "Forward" function example on the X2X bus
The "Forward" function is a method that can be used to substantially increase the FlatStream data rate. The basic
principle is also used in other technical areas such as "pipelining" for microprocessors.
How it works
Communication on the X2X bus cycles through five different steps to transfer a FlatStream sequence. A successful
sequence transfer therefore requires at least five bus cycles.
Actions
Resource
Sequence 1
Step I
Transfer sequence from
transmit array,
increase
SequenceCounter
Transmitter
(task for sending)
Step I
Step II
Step II
Step III
Step IV
Cyclic matching of MTU and Append
sequence Cyclic matching
module buffer
toreceive array,
of MTU and module buffer
adjust SequenceAck
Step V
Check SequenceAck
Bus system
(direction 1)
Transmitter
(task for Ack checking)
Step III
Receiver
(task for receiving)
Step IV
Bus system
(direction 2)
Step V
Sequence 2
Step I
Step II
Step III
Step IV
Step V
Sequence 3
...
Bus cycle 1 Bus cycle 2 Bus cycle 3 Bus cycle 4 Bus cycle 5 Bus cycle 6 Bus cycle 7 Bus cycle 8 Bus cycle 9 Bus cycle 10
Time
Sequence 1
Step I
Sequence 2
Sequence 3
Step II
Step III
Step IV
Step V
Step I
Step II
Step III
Step IV
Step V
Step I
Step II
Step III
Step IV
Step V
Bus cycle 1 Bus cycle 2 Bus cycle 3 Bus cycle 4 Bus cycle 5 Bus cycle 6 Bus cycle 7 Bus cycle 8 Bus cycle 9 Bus cycle 10
Time
Figure 30: Transfer comparison without/with "Forward"
Each of the five steps (tasks) requires different resources. If the Forward function is not used, the sequences are
executed one after the other. Each resource is then only active if it is needed for the current sub-action.
With Forward, a resource that has executed its task can already be working on the next message. The condition
for enabling the MTU has been changed to allow for this. Now the sequences are passed to the MTU based on
timing. The transmitting station no longer waits for an acknowledgment from SequenceAck, which means that the
given bandwidth can be used much more efficiently.
In the most ideal situation, all resources are working during each bus cycle. The receiver still has to acknowledge
every sequence received. Only when SequenceAck has been changed and checked by the transmitter is the
sequence considered as having been transferred successfully.
Data sheet V 1.01
73
X20AP3111, X20AP3121 and X20AP3131
Configuration
The Forward function only has to be enabled for the input direction. Two additional configuration registers are
available for doing so. FlatStream modules have been optimized in such a way that they support this function. In
the output direction, the Forward function can be used as soon as the size of the OutputMTU is specified.
Forward:
With the "Forward" register, the user specifies how many unacknowledged sequences the module is allowed to
send.
Recommendation:
X2X bus: Max. 5
POWERLINK: Max. 7
Data type
USINT
Values
1...7
Default: 1
ForwardDelay:
The "ForwardDelay" register is used to specify the delay time in µs. This is the amount of time the module has
to wait after sending a sequence until it is allowed to write new data to the MTU in the following bus cycle. The
program routine for receiving sequences from a module can therefore be run in a task class whose cycle time is
slower than the bus cycle.
Data type
UINT
Sequence 1
Values [µs]
0...65535
Default: 0
Step I
Step II
Sequence 2
Step III
Step IV
Step I
Step II
Sequence 3
Step V
Step III
Step IV
Step I
Step II
Step V
Step III
Step IV
Step V
Bus Cycle 1 Bus Cycle 2 Bus Cycle 3 Bus Cycle 4 Bus Cycle 5 Bus Cycle 6 Bus Cycle 7 Bus Cycle 8 Bus Cycle 9 Bus Cycle 10
Time
Sequence 1
Sequence 2
Sequence 3
Step I
Step II
Step III
Step I
Step IV
Step II
Step V
Step III
Step I
Step II
Step IV
Step V
Step III
Step IV
Step V
Bus Cycle 1 Bus Cycle 2 Bus Cycle 3 Bus Cycle 4 Bus Cycle 5 Bus Cycle 6 Bus Cycle 7 Bus Cycle 8 Bus Cycle 9 Bus Cycle 10
Time
Figure 31: Effect of ForwardDelay when using FlatStream communication with the Forward function
In the program, it is important to make sure that the CPU is processing all of the incoming InputSequences and InputMTUs. The ForwardDelay value causes delayed acknowledgment in the output direction and a delayed reception in the input direction. In this way, the CPU has more time to process the incoming InputSequence or InputMTU.
74
Data sheet V 1.01
X20AP3111, X20AP3121 and X20AP3131
Sending and receiving with Forward
The basic algorithm for transmitting and receiving data remains the same. With the Forward function, up to seven
unacknowledged sequences can be transferred. Sequences can be transmitted without having to wait for the
previous message to be acknowledged. Since the waiting time between writing and response is eliminated, a
considerable amount of additional data can be transferred in the same time window.
Algorithm for transmitting:
Cyclic status query:
- Module monitors OutputSequenceCounter
0. Cyclic checks:
- The CPU must check OutputSyncAck
→ If OutputSyncAck = 0: reset OutputSyncBit and resynchronize channel
- The CPU must check whether OutputMTU enabled
→ If OutputSequenceCounter > OutputSequenceAck + 7, then not enabled since last sequence not yet acknowledged
1. Preparation (create transmit array):
- The CPU must split up message into valid segments and create the necessary control bytes
- The CPU must add the segments and control bytes to the transmit array
2. Transmit:
- The CPU must transfer the current part of the transmit array to the OutputMTU
- The CPU must increase OutputSequenceCounter for the sequence to be accepted by the module
- The CPU can then transmit in the next bus cycle if the MTU has been enabled
The module respondssince OutputSequenceCounter > OutputSequenceAck:
- The module accepts data from the internal receive buffer and appends it to the end of the internal receive array
- Module acknowledged; current received value of OutputSequenceCounter transferred to OutputSequenceAck
- The module polls the status once more
3. Completion (acknowledgment):
- The CPU must cyclically check OutputSequenceAck
→ A sequence is only considered to have been transferred successfully if it has been acknowledged via OutputSequenceAck. In order to detect potential transfer errors in the last sequence as well, it's important to make sure that the algorithm is run through long enough.
Note:
To monitor communication times exactly, the task cycles that have passed since the last increase of the OutputSequenceCounter should be counted. In this
way, the number of previous bus cycles necessary for the transfer can be measured. If the monitoring counter exceeds a predefined threshold, then the sequence can be considered lost (the relationship of bus to task cycle can be influenced by the user so that the threshold value needs to be determined individually).
Algorithm for receiving:
0. Cyclic status query:
- The CPU must monitor InputSequenceCounter
Cyclic checks:
- The module checks InputSyncAck
- The module checks InputMTU for enabling
→Enabling criteria: InputSequenceCounter > InputSequenceAck + Forward
Preparation:
- The module forms the control bytes / segments and creates the transmit array
Action:
- The module transfers the current part of the transmit array to the receive buffer
- The module increases the InputSequenceCounter
- The module waits on a new bus cycle after the ForwardDelay time has passed
- The module repeats the action if InputMTU is enabled
1. Receiving (InputSequenceCounter > InputSequenceAck):
- The CPU must accept data from the InputMTU and append it to the end of the receive array
- The CPU must match InputSequenceAck to the InputSequenceCounter of the sequence currently being processed
Completion:
- The module monitors InputSequenceAck
→ A sequence is only considered to have been transferred successfully if it has been acknowledged via InputSequenceAck.
Data sheet V 1.01
75
X20AP3111, X20AP3121 and X20AP3131
Details/Background:
1. Illegal SequenceCounter size (counter offset)
Error situation: MTU not enabled
If the difference between SequenceCounter and SequenceAck is larger than allowed during transmission,
then a transfer error has occurred. In this case, all unacknowledged sequences must be repeated with the
old SequenceCounter value.
2. Checking an acknowledgment
After an acknowledgment has been received, a check must verify whether the acknowledged sequence was
sent and hitherto unacknowledged. If a sequence has been acknowledged more than once, then a fatal error
has occurred. The channel must be closed and resynchronized (same behavior as without Forward).
Information:
In exceptional cases, the module can increment OutputSequenceAck by more than 1 when using
Forward.
This is not an error. The CPU is permitted to consider all sequences up to the one being acknowledged as having been transferred successfully.
3. Transmit and receive arrays
The Forward function has no effect on the structure of the transmit and receive arrays. They are created and
must be evaluated in the same way.
76
Data sheet V 1.01
X20AP3111, X20AP3121 and X20AP3131
Errors when using Forward
In industrial environments, it's often the case that many different devices from various manufacturers are being
used side by side. The electrical and/or electromagnetic properties of these technical devices can sometimes cause
them to interfere with one another. These kinds of situations can be reproduced and protected against in laboratory
conditions only to a certain point.
Precautions have been taken for X2X bus transfers if this type of interference occurs. For example, if an invalid
checksum occurs, the I/O system will ignore the data from this bus cycle and the receiver receives the last valid
data once more. With conventional (cyclic) data points, this error can often just be ignored. In the following cycle,
the same data point is again retrieved, adjusted and transferred.
Using the "Forward" function with FlatStream communication makes this situation more complex. The receiver
receives the old data again in this situation as well, i.e. the previous values for SequenceAck/SequenceCounter
and the old MTU.
Loss of acknowledgment (SequenceAck):
If a SequenceAck value is lost, then the MTU was already transferred properly. For this reason, the receiver is permitted to continue processing with the next sequence. The SequenceAck is aligned with the associated SequenceCounter and sent back to the transmitter. The check of incoming acknowledgments shows that all sequences up
to the last one acknowledged have been transferred successfully (see image: Sequence 1, 2).
Loss of transmission (SequenceCounter, MTU):
If a bus cycle drops out and the SequenceCounter value and/or filled MTU are lost, then no data reaches the
receiver. At this point, the transfer routine is not yet affected by the error. The time-controlled MTU is released
again and can be rewritten to. The receiver receives SequenceCounter values that have been incremented several
times. For the receive array to be put together correctly, the receiver is only allowed to process transmissions
whose SequenceCounter has been increased by one. The incoming sequences must be ignored, i.e. the receiver
stops and doesn't send back any more acknowledgments. If the maximum number of unacknowledged sequences
has been sent and no acknowledgments are returned, the transmitter must repeat the affected SequenceCounter
and associated MTUs (see image: Sequence 3, 4).
Sequence 1
Step I
Sequence 2
Step II
Step III
Step IV
Step V
Step I
Step II
Step III
Step IV
Step V
Step I
Step II
Step III
Step IV
Step V
Step I
Step II
Step III
Step IV
Step V
Bus Cycle 4
Bus Cycle 5
Bus Cycle 6
Bus Cycle 7
Bus Cycle 8
Sequence 3
Sequence 4
Bus Cycle 1
Bus Cycle 2
Bus Cycle 3
Bus Cycle 9
Bus Cycle 10
Time
Sequence 1
Step I
Sequence 2
Step II
Step III
Step I
Step II
Sequence 3
Step III
Step IV
Step I
Step II
EMC
Bus Cycle 5
Step V
Step I
Sequence 4
Bus Cycle 1
Bus Cycle 2
Bus Cycle 3
Step I
Bus Cycle 6
Bus Cycle 7
Bus Cycle 8
Step II
Step III
Step I
Step II
Bus Cycle 9
Bus Cycle 10
Time
Figure 32: Effect of a lost bus cycle
Loss of acknowledgment:
In Sequence 1, the acknowledgment is lost due to disturbance. Sequences 1 and 2 are therefore acknowledged
in Step V of Sequence 2.
Loss of transmission:
In Sequence 3, the entire transmission is lost due to disturbance. The receiver stops and doesn't send back any
more acknowledgments.
The sending station continues transmitting until it has issued the maximum allowed number of unacknowledged
transmissions.
Five bus cycles later at the earliest (depending on the configuration), it begins resending the unsuccessfully sent
transmissions.
Data sheet V 1.01
77
X20AP3111, X20AP3121 and X20AP3131
8.20 Force analog energy registers
Name:
The registers are described in section 8.10 "Analog energy registers" on page 34. The following table provides a
comparison of these two register types:
Force registers
Frc_APenergyT
Frc_APenergyTF
Frc_APenergyTH
Frc_APenergyA
Frc_APenergyAF
Frc_APenergyAH
Frc_APenergyB
Frc_APenergyBF
Frc_APenergyBH
Frc_APenergyC
Frc_APenergyCF
Frc_APenergyCH
Frc_ANenergyT
Frc_ANenergyTF
Frc_ANenergyTH
Frc_ANenergyA
Frc_ANenergyAF
Frc_ANenergyAH
Frc_ANenergyB
Frc_ANenergyBF
Frc_ANenergyBH
Frc_ANenergyC
Frc_ANenergyCF
Frc_ANenergyCH
Frc_RPenergyT
Frc_RPenergyA
Frc_RPenergyB
Frc_RPenergyC
Frc_RNenergyT
Frc_RNenergyA
Frc_RNenergyB
Frc_RNenergyC
Frc_SAenergyT
Frc_SenergyA
Frc_SenergyB
Frc_SenergyC
Frc_SVenergyT
Read registers
APenergyT
Page
34
APenergyA
34
APenergyB
34
APenergyC
34
ANenergyT
34
ANenergyA
35
ANenergyB
35
ANenergyC
35
RPenergyT
RPenergyA
RPenergyB
RPenergyC
RNenergyT
RNenergyA
RNenergyB
RNenergyC
SAenergyT
SenergyA
SenergyB
SenergyC
SVenergyT
35
35
35
35
36
36
36
36
36
37
37
37
37
These registers can be used to set the energy counter to a specific value after a module has been replaced.
Data type
UDINT
Values
0...4,294,967,295
8.20.1 Force forward total active energy
Name:
FrcAPenergyT
The registers are described in section 8.10 "Analog energy registers" on page 34.
These registers can be used to set the energy counter to a specific value after a module has been replaced. The
register is updated to the current values when triggered by ControlOutput01.Bit3.
Data type
UDINT
78
Values
0...4,294,967,295
Data sheet V 1.01
X20AP3111, X20AP3121 and X20AP3131
8.21 Oversampling buffer
8.21.1 General information
A Sample Line contains the present values for currents (4 channels) and voltages (3 channels), as well as a
consecutive number and the network time when transferred from the transformer. These values are recorded in
an interval of 125 µs * prescaler.
The user must then scale the values to respective physical values:
Voltage:
Current:
Vrms = (INT32)Vs * 4 / Sqrt(2)
Irms = (INT32)Is * 4 / Sqrt(2)
8.21.2 Sample - Neutral current
Name:
IactN_Sample1..16
Data type
INT
Values
-32767...32767: Present value of the neutral current, resolution 0,001 A
This value must be converted by the application: See section 8.21.1 "General information" on page 79
8.21.3 Sample - Current on phase A
Name:
IactA_Sample1..16
Data type
INT
Values
-32767...32767: Present current value on phase A, resolution 0.001 A
This value must be converted by the application: See section 8.21.1 "General information" on page 79
8.21.4 Sample - Voltage on phase A
Name:
UactA_Sample1..16
Data type
INT
Values
-32767...32767: Present voltage value on phase A, resolution 0.01 V
This value must be converted by the application: See section 8.21.1 "General information" on page 79
8.21.5 Sample - Current on phase B
Name:
IactB_Sample1..16
Data type
INT
Values
-32767...32767: Present current value on phase B, resolution 0.001 A
This value must be converted by the application: See section 8.21.1 "General information" on page 79
8.21.6 Sample - Voltage on phase B
Name:
UactB_Sample1..16
Data type
INT
Values
-32767...32767: Present voltage value on phase B, resolution 0.01 V
This value must be converted by the application: See section 8.21.1 "General information" on page 79
8.21.7 Sample - Current on phase C
Name:
IactC_Sample1..16
Data type
INT
Values
-32767...32767: Present current value on phase C, resolution 0.001 A
This value must be converted by the application: See section 8.21.1 "General information" on page 79
Data sheet V 1.01
79
X20AP3111, X20AP3121 and X20AP3131
8.21.8 Sample - Voltage on phase C
Name:
UactC_Sample1..16
Data type
INT
Values
-32767...32767: Present voltage value on phase C, resolution 0.01 V
This value must be converted by the application: See section 8.21.1 "General information" on page 79
8.21.9 Sample number
Name:
SampleCount1..16
Number of new Sample Lines since last readout.
Data type
SINT
INT
Values
-127..127
-32767...32767
Note
Sample Line number, ascending, cyclic
8.21.10 Sample time
Name:
Timestamp
Older Sample Lines must each be back-calculated with 125 µs.
Data type
INT
DINT
80
Values
-32767...32767
-2,147,483,647...2,147,483,647
Note
Network timestamp of Sample Line 1
Data sheet V 1.01
X20AP3111, X20AP3121 and X20AP3131
8.22 Environment variables
8.22.1 Operating time in seconds
Name:
OnTime
The operating time since startup is saved in seconds in this register.
Data type
UDINT
Values
0...4,294,967,295
8.22.2 Startup counter
Name:
UpCounter
The number of restarts since startup is saved in this register.
Data type
UDINT
Values
0...4,294,967,295
8.22.3 Minimum operating temperature
Name:
MinTemp
The lowest transformer temperature [°C] since startup is saved in this register.
Data type
INT
Values
-200...200: Resolution 1°C
8.22.4 Maximum operating temperature
Name:
MaxTemp
The highest transformer temperature [°C] since startup is saved in this register.
Data type
INT
Data sheet V 1.01
Values
-200...200: Resolution 1°C
81
X20AP3111, X20AP3121 and X20AP3131
8.23 Function models
A function model specifies the registers on the module (storage model) that are available for the application. Only
these registers are processed on the module during each cycle and transferred cyclically via the bus. In this way,
it is possible to minimize the cycle time by selecting the correct function model.
Function model
Default
Bus controllers
Number
0
254
Automation Studio
●
CANopen
DeviceNet
Modbus/TCP
CAN I/O
●
●
●
●
Table 12: Overview of possible function models
8.24 Minimum cycle time
The minimum cycle time specifies the shortest time the bus cycle can be reduced to without a communication
error or malfunction occurring. It should be noted that very fast cycles decrease the idle time available for handling
monitoring, diagnostics and acyclic commands.
Minimum cycle time
200 µs
8.25 Minimum I/O update time
The minimum I/O update time refers to the minimum time it takes for the bus cycle to shut down so that in each
cycle an I/O update takes place.
Minimum I/O update time
Voltage and current sampling rate for calculation of effective value, power and energy
Derived values: RMS, power, energy, power factor, phase angle, frequency (mean values over 16 full waves)
FFT on request (SR: 8 kHz)
82
1 MHz
Approx. 3 Hz
2 Hz
Data sheet V 1.01