Issue
How to decode the Week Chart Hexadecimal Value in Vista.
Point Name |
TSCHED.TS09 |
Channel Name |
DMAVISTA-LNS-DMA-Channel4-LTG_04_09 |
Object Name |
Time Chart - TAC Xenta |
Week Chart Value |
00006270^00001C20^7F~00001D4C^00006270^7F |
Interpretation |
[7:00:00 AM - 2:00:00 AM, SMTWTFS] [2:05:00 AM - 7:00:00 AM, SMTWTFS] |
Environment
Time Schedules
Cause
A Hexadecimal Code is generated upon creation or modification of a time schedule.
Resolution
The Hex code represents seconds after midnight and days of the week, and days of the week that the schedule is on.
An Excel spreadsheet to perform the conversion for you can be downloaded here.
In this Example:
[7:00:00 AM - 2:00:00 AM, SMTWTFS] [2:05:00 AM - 7:00:00 AM, SMTWTFS], Is coded to be:
00006270^00001C20^7F~00001D4C^00006270^7F
Break down each bracket into parts, here is the first bracketed time elapse:
00006270^00001C20^7F
00006270 =7:00:00 AM
00001C20 =2:00:00 AM
7F=SMTWTFS
To decode 00006270 which represents 7:00:00AM:
00006270 (Hex seconds) =25200 (Decimal seconds)
25200/60 (seconds in a minute)= 420 minutes
420 /60 (minutes in an hour) = 7 hours
12AM midnight plus 7 hours is 7:00:00AM
To decode 00001C20 which represents 2:00:00AM:
00001C20=7200
7200seconds = 120 minutes
120 minutes = 2 hours
2:00AM
To decode 7F which represents SMTWTFS
7F (Hex days of the week) =127 (decimal) =1111111 (binary) = SMTWTFS
Each bit of a 7 digit binary value is used to represent the day on in the schedule…
S=1000000
M=1
T=10
W=100
T=1000
F=10000
S=100000
Here is another example:
0000003C^00000078^04
[12:01:00 AM - 12:02:00 AM, ---W---]
3Ch=60, 78h=120, 04h=0001000