12.1.3 Related Features

In this section, you can find functions and subroutines frequently used for Report. Please refer to the table below for applicable functions/subroutines. For more detailed information of each function and subroutine, please refer to the next section.

Command

Description

Report

Function

ReportTimeStr

Returns the time value for the report as string.

Function

TLogVal

Returns the report data value of the assigned tag.

Time

Function

TimeStr

Displays the current time in the assigned format.


ReportTimeStr

Returns the time value for the report as string.

Function

Command

ReportTimeStr (“Time Value”, Time Format)

Script

StrVal$ = ReportTimeStr (“Time Value”, Time Format)

Description

This function returns the time value which will be used for the report file, according to the Time Format. If you enter the Time Value as negative number, the assigned parameter will indicate the past date. If the Time Value is 0, it represents today.

Example

Outputs the report time value.

ReportTimeStr(0D, 9) + “ “ + ReportTimeStr(0D, 64)
= Displayed time format: yyYmmMddD   Day_of_week

TLogVal

Returns the report data value of the assigned tag.

Function

Command

TLogVal (“Tag Name”, “Time Value”, “Value Type”)

Script

n = TLogVal (“Tag Name”, “Time Value”, “Value Type”)

Description

This function returns the data value of the Tag Name according to the Time Value and Value Type from the report. The tag must be assigned as a report tag.

Example

Returns the value increment in Generator tag, from 2AM to 3AM yesterday.

TLogVal (“Generator”, “-1D3H”, “I_SUM”) = n

Analog Tag Value Type

Digital Tag Value Type

C_VAL

Tag value of the assigned time.

ON_TIME n

nth Operation time (Daily)

A_VAL

Average value of each date/month/year.

ON_TIME

Sum of the ON_TIME at assigned time.

I_VAL

Increase value at the assigned value.

ON_CNT

Number of operations at the assigned time.

C_SUM

Sum of the C_VAL by hours.

T_SUM

Sum of the ON_TIME by assigned time.

C_AVER

Average of the C_VAL by hours.

T_AVER

Average of the ON_TIME by days/months

C_MIN

Minimum value of the C_VAL by hours.

T_MIN

Minimum of the ON_TIME by days/months.

C_MAX

Maximum value of the C_VAL by hours.

T_MAX

Maximum of the ON_TIME by days/months.

C_MINTIME

The time when C_MIN value occurred.

T_MINTIME

Date/Day/Month of T_MIN.

C_MAXTIME

The time when C_MAX value occurred.

T_MAXTIME

Date/Day/Month of T_MAX.

I_SUM

Sum of the I_VAL by hours.

N_SUM

Sum of ON_CNT by weeks/months/years.

I_AVER

Average of the I_VAL by hours.

N_AVER

Average of ON_CNT by days/months.

I_MIN

Minimum value of the I_VAL by hours.

N_MIN

Minimum of ON_CNT by days/months.

I_MAX

Maximum value of the I_VAL by hours.

N_MAX

Maximum of ON_CNT by days/months.

I_MINTIME

The time when I_MIN value occurred.

N_MINTIME

Date/Day/Month when N_MIN occurred.

I_MAXTIME

The time when I_MAX value occurred.

N_MAXTIME

Date/Day/Month when N_MAX occurred.

 

(1)    Analog Tag – Time Value and Value Type

Time Value

Description

Range

Applied Value Type

hhH

Displays today’s hour.

"0H" ~ "23H"

C_VAL, I_VAL

ddDhhH

Displays the assigned day’s specific hour. 0D represents today and -1 represents yesterday.

hhH:
"0H" ~ "23H"

ddD: "-2D"~"0D"

C_VAL, I_VAL

ddD

Displays this month’s date. The negative value represents the days before today.

"1D"~"31D"

C_VAL, A_VAL, I_VAL

"-2D"~"0D"

C_SUM, C_AVER, C_MIN, C_MAX, C_MINTIME, C_MAXTIME, I_SUM, I_AVER, I_MIN, I_MAX, I_MINTIME, I_MAXTIME

mmMddD

Displays the specified month’s date. “1M” to “12M” represents the months of this year. If negative value is assigned to the ‘Month’, it represents the months before this month.

ddD: "1D"~"31D"

mmM: "2M"~"0M"

C_VAL, A_VAL, I_VAL

mmM

Displays the month of this year. “1M” to “12M” represents the months of this year. If negative value is assigned to the ‘Month’, it represents the months before this month. “-1DM” indicates the month of a day earlier.

"1M"~"12M"

C_VAL, A_VAL, I_VAL

"-2M"~"0M"

C_SUM, C_AVER, C_MIN, C_MAX, C_MINTIME, C_MAXTIME, I_SUM, I_AVER, I_MIN, I_MAX, I_MINTIME, I_MAXTIME

yyYmmM

Displays the specified year’s month. If negative value is assigned to the ‘Year’, it represents the years before this year.
"-1DY" indicates the year of a day earlier. “-1MY” indicates the year of a month earlier.

mmM: "1M"~"12M"

yyY:
"-9Y"~"2038Y"

C_VAL, A_VAL, I_VAL

yyY

Displays the assigned year. If “Y” is assigned, it indicates the present year.

"-1DY" indicates the year of a day earlier. “-1MY” indicates the year of a month earlier.

"-9Y"~"2038Y"

C_VAL, A_VAL, I_VAL, C_SUM, C_AVER, C_MIN, C_MAX, C_MINTIME, C_MAXTIME, I_SUM, I_AVER, I_MIN, I_MAX, I_MINTIME, I_MAXTIME

wDAY

Displays the day of this week.

"SUNDAY"
~ "SATURDAY"

C_VAL, A_VAL, I_VAL

nWwDAY

Displays the assigned week’s day. If “0” is assigned, it indicates the present week. If the negative value is assigned, it represents the weeks before this week.

wDAY: "SUNDAY" ~ "SATURDAY"

nW: "-5W"~ "0W"

C_VAL, A_VAL, I_VAL

nW

Displays the assigned week. “0” indicates the present week. If the negative value is assigned, it represents the weeks before this week.

“-1DW’ represents the week of a day earlier.

"-5W" ~ "0W"

C_SUM, C_AVER, C_MIN, C_MAX, C_MINTIME, C_MAXTIME, I_SUM, I_AVER, I_MIN, I_MAX, I_MINTIME, I_MAXTIME

 

(2)    Applicable range

Daily Report

"0H" ~ "23H"

C_VAL, I_VAL

Today

"-1D0H"~ "-2D23H"

A day earlier ~
2 days earlier

"D"

C_SUM, C_AVER, C_MIN, C_MAX, C_MINTIME, C_MAXTIME, I_SUM, I_AVER, I_MIN, I_MAX, I_MINTIME, I_MAXTIME

Today

"-1D","-2D"

A day earlier ~
2 days earlier

Monthly Report

"1D" ~ "31D"

C_VAL, A_VAL, I_VAL

Present month

"-1M1D"~ -2M31D"

A month earlier ~
2 months earlier

"M"

C_SUM, C_AVER, C_MIN, C_MAX, C_MINTIME, C_MAXTIME, I_SUM, I_AVER, I_MIN, I_MAX, I_MINTIME, I_MAXTIME

Present month

"-1M"~"-2M"

A month earlier ~
2 months earlier

Yearly Report

"1M" ~ "12M"

C_VAL, A_VAL, I_VAL

Present year

"-1Y1M"~ "-9Y12M"

A year earlier ~ 9 years earlier

"Y"

C_SUM, C_AVER, C_MIN, C_MAX, C_MINTIME, C_MAXTIME, I_SUM, I_AVER, I_MIN, I_MAX, I_MINTIME, I_MAXTIME

Present year

"-1Y"~"-9Y"

A year earlier ~ 9 years earlier

Weekly Report

"SUNDAY"~"SATRUDAY"

C_VAL, A_VAL, I_VAL

Current week

"-1WSUNDAY" ~

"-5WSATURDAY"

A week earlier ~

5 weeks earlier

"W"

C_SUM, C_AVER, C_MIN, C_MAX, C_MINTIME, C_MAXTIME, I_SUM, I_AVER, I_MIN, I_MAX, I_MINTIME, I_MAXTIME

Current week

"-1W"~"-5W"

A week earlier ~

5 weeks earlier

 

(3)    Analog Tag – Time Value and Value Type

Time Value

Description

Range

Applied Value Type

hhH

Displays today’s hour.

"0H" ~ "23H"

ON_TIME

ddDhhH

Displays the assigned day’s specific hour. 0D represents today and -1 represents yesterday.

hhH:
"0H" ~ "23H"

ddD: "-2D"~"0D"

ON_TIME

ddD

Displays this month’s date. If negative value is assigned, it represents the days before today.

"1D"~"31D"

ON_TIME, ON_CNT

"-2D"~"0D"

ON_TIME n, ON_TIME, ON_CNT

mmMddD

Displays the specified month’s date. “1M” to “12M” represents the months of this year. If negative value is assigned to the ‘Month’, it represents the months before this month.

ddD: "1D"~"31D"

mmM: "2M"~"0M"

ON_TIME, ON_CNT

mmM

Displays the month of this year. “1M” to “12M” represents the months of this year. If negative value is assigned to the ‘Month’, it represents the months before this month. “-1DM” indicates the month of a day earlier.

"1M"~"12M"

ON_TIME, ON_CNT

"-2M"~"0M"

T_SUM, T_AVER, T_MIN, T_MAX, T_MINTIME, T_MAXTIME, N_SUM, N_AVER, N_MIN, N_MAX, N_MINTIME, N_MAXTIME

yyYmmM

Displays the specified year’s month. If negative value is assigned to the ‘Year’, it represents the years before this year.
"-1DY" indicates the year of a day earlier. “-1MY” indicates the year of a month earlier.

mmM: "1M"~"12M"

yyY:
"-9Y"~"2038Y"

ON_TIME, ON_CNT

yyY

Displays the specified year. If “Y” is assigned, it indicates the present year.

"-1DY" indicates the year of a day earlier. “-1MY” indicates the year of a month earlier.

"-9Y"~"2038Y"

ON_TIME, ON_CNT, T_SUM, T_AVER, T_MIN, T_MAX, T_MINTIME, T_MAXTIME, N_SUM, N_AVER, N_MIN, N_MAX, N_MINTIME, N_MAXTIME

wDAY

Displays the day of this week.

"SUNDAY"
~ "SATURDAY"

ON_TIME, ON_CNT

nWwDAY

Displays the specified week’s day. If “0” is assigned, it indicates the present week. If the negative value is assigned, it represents the weeks before this week.

wDAY: "SUNDAY" ~ "SATURDAY"

nW: "-5W"~ "0W"

ON_TIME, ON_CNT

nW

Displays the assigned week. “0” indicates the present week. If the negative value is assigned, it represents the weeks before this week.

“-1DW’ represents the week of a day earlier.

"-5W" ~ "0W"

T_SUM, T_AVER, T_MIN, T_MAX, T_MINTIME, T_MAXTIME, N_SUM, N_AVER, N_MIN, N_MAX, N_MINTIME, N_MAXTIME

 

(4)    Applicable Range

Daily Report

"0H" ~ "23H"

ON_TIME

Today

"-1D0H"~ "-2D23H"

A day earlier ~
2 days earlier

"D"

ON_TIME n, ON_TIME, ON_CNT

Today

"-1D","-2D"

A day earlier ~
2 days earlier

Monthly Report

"1D" ~ "31D"

ON_TIME, ON_CNT

Present month

"-1M1D"~ -2M31D"

A month earlier ~
2 months earlier

"M"

T_SUM, T_AVER, T_MIN, T_MAX, T_MINTIME, T_MAXTIME, N_SUM, N_AVER, N_MIN, N_MAX, N_MINTIME, N_MAXTIME

Present month

"-1M"~"-2M"

A month earlier ~
2 months earlier

Yearly Report

"1M" ~ "12M"

ON_TIME, ON_CNT

Present year

"-1Y1M"~ "-9Y12M"

A year earlier ~ 9 years earlier

"Y"

T_SUM, T_AVER, T_MIN, T_MAX, T_MINTIME, T_MAXTIME, N_SUM, N_AVER, N_MIN, N_MAX, N_MINTIME, N_MAXTIME

Present year

"-1Y"~"-9Y"

A year earlier ~ 9 years earlier

Weekly Report

"SUNDAY"~"SATRUDAY"

ON_TIME, ON_CNT

Current week

"-1WSUNDAY" ~ "-5WSATURDAY"

A week earlier ~ 5 weeks earlier

"W"

T_SUM, T_AVER, T_MIN, T_MAX, T_MINTIME, T_MAXTIME, N_SUM, N_AVER, N_MIN, N_MAX, N_MINTIME, N_MAXTIME

Current week

"-1W"~"-5W"

A week earlier ~ 5 weeks earlier

 

TimeStr

Displays the current time in the assigned format.

Function

Command

TimeStr (TimeFormat)

Script

StrVal$ = TimeStr (TimeFormat)

Description

Displays the current time according to the TimeFormat.

Example

Displays the current year, month and day.

TimeStr (9) = yyyy mm dd

0

HH:MM

33

yyyy/mm/dd HH:MM:SS

1

HH:MM AM/PM

34

yyyy/mm/dd HH:MM:SS AM/PM

2

HH:MM:SS

35

yyyy-mm-dd HH:MM

3

HH:MM:SS AM/PM

36

yyyy-mm-dd HH:MM AM/PM

4

HH-MM

37

yyyy-mm-dd HH:MM:SS

5

HH-MM-SS

38

yyyy-mm-dd HH:MM:SS AM/PM

6

Month dd (e.g. March 31)

39

Month dd HH:MM
(e.g. March 31 12:00)

7

mm/dd

40

Month dd HH:MM:SS
(e.g. March 31 12:00:00)

8

mm-dd

41

Month dd yy HH:MM

(e.g. March 31 18 12:00)

9

yyyy mm dd

42

Month dd yy HH:MM:SS

(e.g. March 31 18 12:00:00)

10

yy/mm/dd

43

Month dd yyyy HH:MM

(e.g. March 31 2018 12:00)

11

yy-mm-dd

44

Month dd yyyy HH:MM:SS

(e.g. March 31 2018 12:00:00)

12

Month dd, yyyy
(e.g. March 31, 2018)

45

yy/mm

13

yyyy/mm/dd

46

yy Month (e.g. 18 March)

14

yyyy-mm-dd

47

yyyy/mm

15

mm/dd HH:MM

48

yyyy Month (e.g. 2018 March)

16

mm/dd HH:MM AM/PM

49

yy

17

mm/dd HH:MM:SS

50

yyyy

18

mm/dd HH:MM:SS AM/PM

51

mm

19

mm-dd HH:MM

52

dd

20

mm-dd HH:MM AM/PM

53

HH

21

mm-dd HH:MM:SS

54

MM

22

mm-dd HH:MM:SS AM/PM

55

SS

23

yy/mm/dd HH:MM

56

yy

24

yy/mm/dd HH:MM AM/PM

57

yyyy

25

yy/mm/dd HH:MM:SS

58

Month (e.g. March)

26

yy/mm/dd HH:MM:SS AM/PM

59

dd

27

yy-mm-dd HH:MM

60

HH

28

yy-mm-dd HH:MM AM/PM

61

MM

29

yy-mm-dd HH:MM:SS

62

SS

30

yy-mm-dd HH:MM:SS AM/PM

63

"Sunday" ~ "Saturday"

31

yyyy/mm/dd HH:MM

64

"Sunday" ~ "Saturday"

32

yyyy/mm/dd HH:MM AM/PM

65

"SUN" ~ "SAT"