Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Plant SCADA

StrToPeriod

  • Last UpdatedJul 18, 2023
  • 1 minute read

Converts a string into a time period. You would normally use this function to convert operator input, for example, to set a trend period.

A valid period string is in the format HH:MM:SS, MM:SS or SS, where HH is the hours, MM is the minutes and SS is the seconds. The colon character (':') represents the time delimiter for these fields, which will be the current system time delimiter as set in the Windows Control Panel.

If minutes are specified, seconds need to be in the range 0-59. If hours are specified, minutes need to be in the range 0-59.

Syntax

StrToPeriod(String)

String:

The string to convert.

Return Value

A period (converted from String), or -1 if no conversion can be performed.

StrToTime, StrToDate

Example

Variable=StrToPeriod("200");

! Sets Variable to 200 (seconds).

Variable=StrToPeriod("200:40");

! Sets Variable to 12040 (12000 + 40 seconds).

Variable=StrToPeriod("48:00:40");

! Sets Variable to 172840 (172800 + 40 seconds).

See Also

String Functions

Using the Caret Escape Sequence Character

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in