Display PCS 7 CountOh Runtime as hh:mm:ss in WinCC
To display a CountOh runtime as an elapsed duration, format the block's accumulated seconds into hours, minutes, and seconds in a WinCC display object, after confirming the output name and type in the installed APL version. The source reports a TotalTime output and an aggr08 faceplate example, while Siemens' APL V71 manual documents a Seconds output. The ticket does not establish how to plot the formatted duration in Tag Logging; retain numeric seconds for a numeric trend and verify any alternate presentation against the deployed WinCC release.
Table of Contents
- Converting the runtime for an operator display
- Logging runtime for a trend
- Version and interface checks
- What the evidence does and does not establish
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
Converting the runtime for an operator display
In the discussion, the suggested display method is to split the accumulated runtime in seconds into hours, minutes, and seconds, then format the three components with colon separators in a WinCC I/O field. This is a source-reported approach, not a confirmed, version-independent Siemens procedure. Before using it, identify the exact CountOh block interface in the installed Advanced Process Library (APL) version: the ticket names TotalTime, while the APL V71 manual documents an output named Seconds, typed INT, with the description “Operating time [in sec]”. Do not rename or substitute a pin without checking the installed block interface.
For a nonnegative total-second value, the arithmetic is straightforward: hours are the integer quotient after division by 3,600; the remaining seconds divided by 60 give whole minutes; and the remainder after division by 60 gives seconds. This representation can exceed 23 hours and is an elapsed duration, not a clock time. Use a string-formatting method supported by the specific WinCC release and ensure the field can hold the largest expected display. Siemens documents ANSI-C scripting in WinCC V7.4 and notes a 360-character processing limit for its printf(), sprintf() and fprintf() functions; that limit concerns text length, not runtime range, and does not establish which scripting pattern applies to this unspecified project version.
Logging runtime for a trend
Keep the accumulated runtime as a numeric value in seconds for process-value archiving when the objective is a continuous numeric trend. A trend plots archived samples against time; converting the archived value into a formatted string is a separate display decision and the ticket does not identify a WinCC release, archive configuration, or trend control that would allow a reliable procedure for plotting a duration string as hh:mm:ss.
If operators require duration-formatted labels or a table, establish whether the deployed WinCC version and chosen control support formatting or a separately calculated display value while retaining numeric archive data. The available evidence does not establish such a method for this installation. Do not replace the numeric source tag with a string archive or claim that a numeric trend can render a duration format without checking the release-specific manual and testing that configuration on a project copy.
Version and interface checks
- Record the PCS 7, WinCC, and APL versions and the exact CountOh block type used in the project.
- Open the block interface for that installed APL version and confirm the output name, data type, unit, range, and status handling. The V71 manual is only applicable when using that documented library version; it lists
Secondsas anINToutput in seconds. - Confirm the live value against an independently calculated duration before enabling the display. For the discussion's example, 4,536 seconds is 1 hour, 15 minutes, and 36 seconds.
- Configure the archive on the numeric seconds value if the requirement is a numeric operating-time history. Check the archive's acquisition cycle, stored values, and trend's selected archive tag in the installed WinCC configuration.
- Validate long durations, leading zeroes for minutes and seconds, invalid quality/status, and display-field width in a nonproduction project before applying the presentation to operating screens.
What the evidence does and does not establish
The example conversion is arithmetically correct: 4,536 seconds equals 1:15:36. It does not prove that every CountOh version exposes the same pin name, type, or range. The official APL V71 manual documents Seconds; the forum response reports TotalTime without giving the APL or WinCC version.
The available documentation and discussion do not establish the requested WinCC trend presentation in hh:mm:ss. Treat the numeric-seconds archive with a separate formatted display as the bounded implementation direction, then verify the specific display and trend features against the exact deployed release. No lab test is implied.
Verification
Check that the selected CountOh output updates with the expected accumulated operating time and has good signal quality. Compare a known value in seconds with its converted hours, minutes, and seconds, including a value above 24 hours to ensure the display represents elapsed time rather than a time of day. For the history, confirm that archive samples remain numeric seconds and that the trend's tag, time range, and acquisition behavior show those same archived values. The unresolved string-format trend requirement needs version-specific confirmation before publication as a reproducible recipe.
Limitations and Operational Precautions
The source gives no PCS 7, WinCC, or APL version, exact CountOh pin definition, tag type, archive setup, or trend-control configuration. Consequently, the reported TotalTime output and faceplate example cannot be treated as universal. Use documentation matching the installed versions.
Changing archive tag types or replacing an established numeric archive can affect existing displays and historical data handling. Preserve the existing project and archive configuration, validate proposed presentation changes on a copy, and use the site's approved change-control and rollback process. The ticket provides no verified method for logging an accumulated duration as an hh:mm:ss trend value.
Engineer FAQ
Can a runtime of 4,536 seconds be displayed as 1:15:36? Yes. Splitting elapsed seconds into hours, whole minutes, and remaining seconds yields 1 hour, 15 minutes, and 36 seconds.
Is TotalTime the CountOh output name in every APL version? No universal conclusion is supported. The discussion uses TotalTime; the APL V71 manual documents Seconds. Confirm the installed block interface.
Should the value be archived as formatted text for a trend? The evidence here does not establish that. Retaining a numeric seconds value preserves a numeric process-value history; confirm the desired presentation with the deployed WinCC trend control.
Does hh:mm:ss represent time of day? In this case it should represent elapsed operating duration. Do not wrap hours at 24 unless the intended quantity is explicitly a time of day.
Does the discussion's faceplate example provide a universal script? No. It refers to an example in the aggr08 Industry Library faceplate parameter view but does not name the library release or include the script. Match it to the installed library before reusing it.
Technical References
- Siemens, PCS 7 Advanced Process Library V71 Function Manual, CountOh I/Os, page 1324. The documented
Secondsoutput is described as operating time in seconds and has typeINT: PDF. - Siemens, SIMATIC HMI WinCC V7.4 Scripting (VBS, ANSI-C, VBA), ANSI-C function documentation. It documents the WinCC scripting context and the 360-character processing limit for
printf(),sprintf(), andfprintf(): PDF.