Sample Program 7 (General Decimation In The Plc) - Beckhoff EPP3504-0023 Short Manual

4-channel measuring bridge,(sg) full/half/quarter bridge, 24 bit, 10 ksps
Hide thumbs Also See for EPP3504-0023:
Table of Contents

Advertisement

Commissioning
// ============================================================
// Junction of the two inputs
nCollected := SEL(nToggle, MAIN.nSamples_1_, MAIN.nSamples_2_);
nToggle := NOT nToggle;
The input variables required for the ScopeView are read in this task from the 100 µs task, so that the
individual values can be represented at 50 µs intervals.
Variant with 2 x oversampling 10 = oversampling 20
If, for example, an oversampling factor of 10 is used for both input terminals, a field variable is used for the
total measured value. A simple loop can be used for interlacing the input values, which reads the values
sequentially into a field variable for the resulting result variable:
Variable declaration sample program 6b
PROGRAM MAIN
VAR
   aSamples_1         AT%I*      :ARRAY[0..9] OF DINT; // EL3751 input with no added shift time
   aSamples_2         AT%I*      :ARRAY[0..9] OF DINT; // EL3751 input with -50 µs added shift time
   aCollectedResult              :ARRAY[0..19] OF DINT;
// ===================================================
   nPos                          :BYTE;
END_VAR
Execution part:
// Example program 6b:
// 1 ms task
// ============================================================
FOR nPos := 0 TO 9 DO
   // Put 1st Value of sequence into array:
   aCollectedResult[2*nPos] := aSamples_1[nPos];
   // Put n-th value of sequence into array (2nd here):
   aCollectedResult[2*nPos+1] := aSamples_2[nPos];
END_FOR
Download TwinCAT 3 project / sample program 6b: https://infosys.beckhoff.com/content/1033/epp3504/
Resources/4867891467/.zip
Sample program 6b returns the same result, except that the total input signal is only available in the form of
a field variable with 20 elements.
4.3.6

Sample program 7 (general decimation in the PLC)

The EPP3504‑0023 can only decimate their basic sampling rate f
by integer multiples, see chapter
max
"Decimation". To realize any other sampling rates (f
 < f
) for a channel, you can proceed as follows, for
target
max
example:
• Operate the box module /channel at the maximum sampling rate and transfer the data to the controller
(PLC) via EtherCAT/oversampling
EPP3504-0023
Version: 1.2
101

Advertisement

Table of Contents
loading

Table of Contents