OpenTP1 Version 7 Programming Guide

[Contents][Index][Back][Next]

2.12 Real-time statistical information acquisition

The execution time and the execution count in an arbitrary section in the UAP can be acquired as real-time statistical information. Note that real-time statistical information for arbitrary sections cannot be acquired if the target UAP performs offline processing.

To acquire real-time statistical information in an arbitrary section, call the function dc_rts_utrace_put() [CBLDCRTS('RTSPUT ')] from the UAP.

Specify the item to be acquired in event_id and the action related to acquisition in flags. The table below lists the actions that can be specified with flags.

Table 2-4 Specifying the flags argument to the function dc_rts_utrace_put()

flags value Acquisition-related action
DCRTS_START Start execution time measurement.
DCRTS_END Acquire the execution time and end measurement.
DCNOFLAGS Acquire only the execution count.

The execution count and the execution time acquired by the function dc_rts_utrace_put() are edited and output as real-time statistical information for the item ID assigned to event_id.

The figure below provides an example of acquiring real-time statistical information for arbitrary sections.

Figure 2-58 Example of acquiring real-time statistical information in arbitrary sections

[Figure]

  1. Start execution time measurement for item ID 1.
  2. Start execution time measurement for item ID 2.
  3. End execution time measurement for item ID 1 and acquire statistical information (the execution time and the execution count) in the RTS service shared memory area.
  4. End execution time measurement for item ID 2 and acquire statistical information (the execution time and the execution count) in the RTS service shared memory area.