Kkula
Browse Questions » SIMATIC ProTool / ProTool/Pro: Display Duration

About User

Questions Asked: 29.3K

Answers Given: 0

0
  • Open

SIMATIC ProTool / ProTool/Pro: Display Duration

Hello all.
I want to know if there is a way to display a variable in Time format, xxhxxmxxs, not showing the a.m. or p.m.
What I need to show is the summation of the delay times of each working day.
Is there a way to do it? Or at least show the Time in a 24hrs format? whithout the a.m. and p.m.
The device is an MP270B
My software is Protool V6.0 SP2.
Regards and thanks.

0 Likes 0 Favourites 0 Followers 0 Comments
Answers(1)

Displaying Time in HHMMSS Format on MP270B with Protool V6.0 SP2

Yes, you can display the summation of delay times in the HHMMSS format (24-hour without a.m./p.m.) on your MP270B using Protool V6.0 SP2.

Protool V6.0 SP2 doesn't directly offer a formatting option to exclude a.m./p.m. but display in HHMMSS. However, you can achieve this by using mathematical operations and string formatting.

Here’s the approach:

  1. Calculate Total Seconds: Sum the delay times (in seconds) of each working day.
  2. Convert to HHMMSS:
    • Hours: TotalSeconds / 3600 (Integer division to get whole hours)
    • Minutes: (TotalSeconds % 3600) / 60 (Integer division to get whole minutes)
    • Seconds: TotalSeconds % 60 (Modulo operator to get remaining seconds)
  3. String Formatting: Use Protool's string concatenation functions to create a string in the HHMMSS format. Ensure you use leading zeros if necessary (e.g., "01" instead of "1" for single-digit hours/minutes/seconds).

Resources:

Note: SiePortal contains valuable FAQs and how-to guides related to Protool. Searching SiePortal with keywords like "Protool time format" or "Protool string formatting" can provide more specific examples.

0
Add a comment