3. Instruction Set
S+4: the local time zone (integer format)
S+5: to see if the daylight saving is enabled or not (integer format); 0: disabled
S+6, S+7, S+8: the present year, month and date (integer format); you need to enter the last
two digits of the year and the first two digits will be filled by PLC.
D:
D+0, D+1, D+2: calculated sunrise time (24 hour format); hr : min : sec (integer format)
D+3, D+4, D+5: calculated sunset time (24 hour format); hr : min : sec (integer format)
m: K15
n: Reserved
Calculate the time to sunrise and sunset in Taoyuan, Taiwan on January 1st, 2018. The official time zone in
Taiwan is defined by an UTC offset of +08:00. And daily saving time is NOT implemented in Taiwan. After
calculation, the time to sunrise is at 06:39:47 and the time to sunset is at 17:16:42. See the example program
below. The allowable range is from +3 to -3.
Enter values for the local longitude and latitude in numbers. For example, the longitude and latitude of Taoyuan,
Taiwan is 121.30098 and 24.99363. Latitudes north of the Equator are denoted by a positive sign. Latitudes
south of the Equator are given negative values.
Register Inputted value Register Calculated value
D0 (longitude) F121.301 D10 (sunrise: hour) 6
D2 (latitude) F24.993 D11 (sunrise: minute) 39
D4 (time zone) K8 D12 (sunrise: second) 47
D6 (year) K18 D13 (sunset: hour) 17
D7 (month) K1 D14 (sunset: minute) 16
D8 (date) K1 D15 (sunset: second) 42