TLogVal()
TLogVal() |
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 |
Tag Value Type
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. |
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: ddD: "-2D"~"0D" | C_VAL, I_VAL |
ddD | Displays this month’s date. If negative value is assigned, it 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 |
Applicable Range
Daily Report | "0H" ~ "23H" | C_VAL, I_VAL | Today |
"-1D0H"~ "-2D23H" | A day 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 ~ | ||
Monthly Report | "1D" ~ "31D" | C_VAL, A_VAL, I_VAL | Present month |
"-1M1D"~ -2M31D" | A month 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 ~ | ||
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 |
Digital 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: 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 |
Applicable Range
Daily Report | "0H" ~ "23H" | ON_TIME | Today |
"-1D0H"~ "-2D23H" | A day earlier ~ | ||
"D" | ON_TIME n, ON_TIME, ON_CNT | Today | |
"-1D","-2D" | A day earlier ~ | ||
Monthly Report | "1D" ~ "31D" | ON_TIME, ON_CNT | Present month |
"-1M1D"~ -2M31D" | A month 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 ~ | ||
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 |