Average value (0BA7 and later versions only)

Short description

The average value function samples the analog input signal during configured time period and outputs the average value at AQ.

LOGO! 9 and later versions support two data types: integer (16-bit) and float (32-bit).

Connection

Description

Input En

A positive edge (0 to 1 transition) at input En (Enable) sets the output AQ to the average value of input Ax after the configured time. A negative edge (1 to 0 transition) holds the output at its last calculated value.

Input R

A positive edge (0 to 1 transition) at input R (Reset) resets the output AQ to 0.

Input Ax

Input Ax is one of the following analog signals (integer or float):

  • AI 1:

    • LOGO! 9: AI1 to AI16 3

    • 0BA8: AI1 to AI8 4

  • AM 1:

    • LOGO! 9: AM1 to AM128

    • 0BA8: AM1 to AM64

    • 0BA7: AM1 to AM16

    • 0BA6: AM1 to AM6

  • NAI 1:

    • LOGO! 9: NAI1 to NAI128

    • 0BA7 or 0BA8: NAI1 to NAI32

  • AQ 1:

    • LOGO! 9: AQ1 to AQ16

    • 0BA8: AQ1 to AQ8

    • 0BA7: AQ1 and AQ2

  • NFAI 2:

    • LOGO! 9: NFAI1 to NFAI16

  • FAM 2:

    • LOGO! 9: FAM1 to FAM32

  • The block number of a function with analog output 1 2

Parameter

St (Sampling time): You can set it to Seconds, Days, Hours or Minutes.

Range of values:

If St = Seconds: 1 to 59

If St = Days: 1 to 365

If St = Hours: 1 to 23

If St = Minutes: 1 to 59

Sn (Number of samples):

Range of values:

If St = Seconds: 1 to St*100

If St = Days: 1 to 32767

If St = Hours: 1 to 32767

If St = Minutes and St ≤ 5 minutes: 1 to St * 6000

If St = Minutes and St ≥ 6 minutes: 1 to 32767

Output AQ

AQ outputs the average value over the specified time of sampling.

When Sn = 1, AQ is the last value of Ax.

1 If the data type of Ax is integer and the data type of this FB is configured as float, LSC will convert Ax into 32-bit receivable float data.

2 If the data type of Ax is float and the data type of this FB is configured as integer, LSC will cut off the decimal numbers of Ax and convert it into 16-bit receivable integer data.

3 AI1 to AI16: 0 to 10 V corresponds with 0 to 1000, 0 to 4095 or 0 to 10000 (internal value).

4 AI1 to AI8: 0 to 10 V corresponds with 0 to 1000 (internal value).

Parameter St and Sn

Parameter St represents the sampling time and parameter Sn represents the number of samples.

Timing diagram

Description of the function

When En = 1, the average value function calculates the average value of the samples during the configured time interval. At the end of the sampling time, this function sets output AQ to this calculated average value.

When En = 0, the calculation stops, and AQ retains the last calculated value. When R = 0, AQ is reset to 0.

Overview