TRACE_PACKET_FLAGS (GVL) ¶ Trace packet flags InOut: Scope Name Type Initial Comment Constant TRACE_PACKET_FLAGS_NOT_INITIALIZED UDINT 16#0 The trace packet is not initialized TRACE_PACKET_FLAGS_COMPLETED UDINT 16#1 The trace packet is complete (all records have been added) TRACE_PACKET_FLAGS_AUTOSTART UDINT 16#2 Persistent storage of the trace and automatic start of the trace after reboot or to restore only on request TRACE_PACKET_FLAGS_CONDITION UDINT 16#4 Optional boolean condition for the trace packet is specified TRACE_PACKET_FLAGS_TIMESTAMP_MS UDINT 16#10 Time stamps for the trace samples have milliseond resolution TRACE_PACKET_FLAGS_TIMESTAMP_US UDINT 16#20 Time stamps for the trace samples have microseond resolution TRACE_PACKET_FLAGS_SYSTEM_TRACE UDINT 16#10000 Is used to mark a trace as system trace
TRACE_PACKET_STATE (GVL) ¶ Trace state InOut: Scope Name Type Initial Comment Constant TRACE_PACKET_STATE_NO_CONFIG UDINT 16#0 Trace packet not configured TRACE_PACKET_STATE_DISABLED UDINT 16#1 Trace packet disabled TRACE_PACKET_STATE_ENABLED UDINT 16#2 Trace packet enabled TRACE_PACKET_STATE_STARTED UDINT 16#3 Trace packet started TRACE_PACKET_STATE_STOPPED UDINT 16#4 Trace packet stopped
TraceMgrPacketStore (FUN) ¶ FUNCTION TraceMgrPacketStore : RTS_IEC_RESULT Stores a trace packet to a trace file. Both the trace configuration and the current trace values are stored. InOut: Scope Name Type Comment Return TraceMgrPacketStore RTS_IEC_RESULT Returns the runtime system error code (see CmpErrors.library): ERR_PARAMETER if hPacket is not a valid handle, or if pszFileName is not a valid file path ERR_NOMEMORY if the memory is not sufficient for opening the file ERR_NOT_SUPPORTED if writing to files is not supported by the runtime system ERR_NO_OBJECT if opening the file failed ERR_FAILED if creating or writing to the file failed Input hPacket RTS_IEC_HANDLE The trace packet handle Inout Const pszFileName STRING The file path
TraceMgrRecordAdd (FUN) ¶ FUNCTION TraceMgrRecordAdd : RTS_IEC_HANDLE Adds a new record to a trace packet InOut: Scope Name Type Comment Return TraceMgrRecordAdd RTS_IEC_HANDLE Returns the runtime system error code (see CmpErrors.library): ERR_PARAMETER if hPacket is not a valid packet handle, if the variable name is not set, or if the variable type is not supported ERR_NOMEMORY if there is not enough free memory to create the record Input hPacket RTS_IEC_HANDLE The trace packet handle Inout pConfiguration TraceRecordConfiguration The record configuration (in) pResult RTS_IEC_RESULT The result code (out)
TraceMgrRecordGetConfig (FUN) ¶ FUNCTION TraceMgrRecordGetConfig : RTS_IEC_RESULT Queries the configuration of a trace record. InOut: Scope Name Type Comment Return TraceMgrRecordGetConfig RTS_IEC_RESULT Returns the runtime system error code (see CmpErrors.library): ERR_PARAMETER if hPacket or hRecord is not a valid handle Input hPacket RTS_IEC_HANDLE The trace packet handle hRecord RTS_IEC_HANDLE The trace record handle Inout pConfiguration TraceRecordConfiguration The trace record configuration (out)
TraceMgrRecordGetFirst (FUN) ¶ FUNCTION TraceMgrRecordGetFirst : RTS_IEC_HANDLE Returns the first trace record of a trace packet. This function can be used together with TraceMgrRecordGetNext to iterate through all trace records of a packet. InOut: Scope Name Type Comment Return TraceMgrRecordGetFirst RTS_IEC_HANDLE Returns the runtime system error code (see CmpErrors.library): ERR_PARAMETER if hPacket is not a valid packet handle ERR_NO_OBJECT if the packet has no trace record Input hPacket RTS_IEC_HANDLE The trace packet handle Inout pResult RTS_IEC_RESULT The result code (out)
TraceMgrRecordGetNext (FUN) ¶ FUNCTION TraceMgrRecordGetNext : RTS_IEC_HANDLE Returns the next trace record of a trace packet. This function can be used together with TraceMgrRecordGetFirst to iterate through all trace records of a packet. InOut: Scope Name Type Comment Return TraceMgrRecordGetNext RTS_IEC_HANDLE Returns the runtime system error code (see CmpErrors.library): ERR_PARAMETER if hPacket or hPrevRecord is not a valid handle ERR_NO_OBJECT if the packet has no next trace record Input hPacket RTS_IEC_HANDLE The trace packet handle hPrevRecord RTS_IEC_HANDLE The trace record handle of the current record Inout pResult RTS_IEC_RESULT The result code (out)
TraceMgrRecordRemove (FUN) ¶ FUNCTION TraceMgrRecordRemove : RTS_IEC_RESULT Removes a trace record from a trace packet. InOut: Scope Name Type Comment Return TraceMgrRecordRemove RTS_IEC_RESULT Returns the runtime system error code (see CmpErrors.library): ERR_PARAMETER if the packet handle or the record handle is invalid Input hPacket RTS_IEC_HANDLE The packet handle hRecord RTS_IEC_HANDLE The record handle
TraceMgrRecordUpdate (FUN) ¶ FUNCTION TraceMgrRecordUpdate : RTS_IEC_RESULT Records the current value of the trace variable of a record together with the current time stamp. Note This function is called cyclically by CmpTraceMgr. It should not be called by the application. InOut: Scope Name Type Comment Return TraceMgrRecordUpdate 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 reading the value of the trace variable failed Input hPacket RTS_IEC_HANDLE The trace packet handle hRecord RTS_IEC_HANDLE The trace record handle
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