TraceMgrRecordUpdate2 (FUN)

FUNCTION TraceMgrRecordUpdate2 : RTS_IEC_RESULT

Stores entries in the ring buffer of a trace record.

This function can be used to provide the data for so called system parameters from the IEC application. (See TRACE_VAR_ADDRESS_FLAGS_SYSTEM.) If only a single entry is to be added, consider using TraceMgrRecordUpdate3 instead.

InOut:

Scope

Name

Type

Comment

Return

TraceMgrRecordUpdate2

RTS_IEC_RESULT

Returns the runtime system error code (see CmpErrors.library):
  • ERR_PARAMETER if hPacket or hPrevRecord is not a valid handle

  • ERR_NOTINITIALIZED if the packet is not currently recording (not started, trigger reached, …)

  • ERR_PENDING if no value is recorded for this cycle due to TracePacketConfiguration.ulEveryNCycles

  • ERR_FAILED if ulLen is not a multiple of the entry size (size of a time stamp plus a sample value)

Input

hPacket

RTS_IEC_HANDLE

The trace packet handle

hRecord

RTS_IEC_HANDLE

The trace record handle

Inout

pBuffer

TraceRecordEntry

A pointer to the buffer of trace entries

Input

ulLen

UDINT

The number of bytes to copy from pBuffer