TRND – Real-time trend recording

Block SymbolLicensing group: STANDARD
Qt SVG Document Exported by REXYGEN Studio u1 u2 u3 u4 RUN R1 y1 y2 y3 y4 iE TRND

Function Description
The TRND block is designed for storing of up to 4 input signals (u1 to u4) in cyclic buffers in the memory of the target device. The main advantage of the TRND block is the synchronization with the real-time executive, which allows trending of even very fast signals (i.e. with very high sampling frequency). In contrary to asynchronous data storing in the higher level operator machine (host), there are no lost or multiply stored samples. For better clarity, the individual trends can be assigned names by the Title parameter and the individual signals by the SigNames parameter.

The actual number of stored signals is determined by the parameter n. In case the trend buffers of length l samples get full, the oldest samples are overwritten. Data can be stored once in pfac executions of the block (decimation), i.e. with the period pfac Ts, where Ts is the period of the block execution [s]. The stored data can be further processed according to the values of the parameters ptype1 to ptype4. The other decimation factor afac can be used for storing data in archives. The period of storing is then given by afac pfac Ts. Each value is stored with a time stamp. The source of the time stamp can be set by the timesrc parameter (see the TS block for more information).

The list of archives for storing is specified by the arc parameter, e.g. 1,3..5,8. The event will be stored in all specified archives. Each archiving block must have a unique event identification code in the archive given by the id parameter. For more information about these parameters see the introduction of Chapter 10.

The type of trend buffers can be specified in order to conserve memory of the target device. The memory requirements of the trend buffers are defined by the formula s nl, where s is the size of the corresponding variable in bytes. The default type Double consumes 8 bytes per sample, thus for storing n= 4 trends of this type and length l = 1000, 8 4 1000 = 32000 bytes are required. In case the input signals come from 16-bit A/D converter the Word type can be used and memory requirements drop to one quarter. Memory requirements and allowed ranges of individual types are summarized in table 1.1 in this reference guide.

It can happen that the processed input value exceeds the representable limits when using different type of buffer than Double. In such a case the highest (lowest) representable number of the corresponding type is stored in the buffer and an error is binary encoded to the iE output according to the following table (the unused bits are omitted):

Range underflow
Range overflow









Error









Input u4 u3 u2 u1 u4 u3 u2 u1
Bit number 11 10 9 8 3 2 1 0
Bit weight 2048 1024 512 256 8 4 2 1









In case of simultaneous errors the resulting error code is given by the sum of the weights of individual errors. Note that underflow and overflow cannot happen simultaneously on a single input.

It is possible to read, display and export the stored data by the REXYGEN Studio in the Watch mode. After double-clicking on the corresponding TRND block, a new card with the prefix Trend will open.

WARNING: set any of the parameters arc, afac, id to 0/empty disable writing data into archive. The data are available in diagnostic tools only in this case.

This block does not propagate the signal quality. More information can be found in the 1.4 section.

Input

u1..u4

Analog input of the block

Double (F64)

RUN

Enable execution

Bool

R1

Block reset

Bool

Parameter

n

Number of signals (trend buffers)   1  4 4

Long (I32)

l

Number of samples per trend buffer   0  268435000 1000

Long (I32)

btype

Type of all trend buffers  8

Long (I32)

1 ....

Bool

2 ....

Byte (U8)

3 ....

Short (I16)

4 ....

Long (I32)

5 ....

Word (U16)

6 ....

DWord (U32)

7 ....

Float (F32)

8 ....

Double (F64)

10 ...

Large (I64)

ptype1..ptype4

Data processing  1

Long (I32)

1 ....

Store

2 ....

Minimum

3 ....

Maximum

4 ....

Sum

5 ....

Average

6 ....

RMS

7 ....

Variance

pfac

Processing factor   1  1000000 1

Long (I32)

afac

Archiving factor   0  1000000

Long (I32)

arc

List of archives to write the events to

Word (U16)

id

Unique archive item ID  1

Word (U16)

Title

Trend title string  Trend Title

String

timesrc

Source of timestamps  1

Long (I32)

1 ....

CORETIMER

2 ....

CORETIMER (precise)

3 ....

RTC (UTC)

4 ....

RTC (localtime)

5 ....

PFC

6 ....

TSC

SigNames

Name of signals (each line one signal respectively)

String

ViewConfig

User string for description and formatting

String

Output

y1..y4

Analog output of the block

Double (F64)

iE

Error code (bitwise multiplexed)

Long (I32)

2024 © REX Controls s.r.o., www.rexygen.com