1. Second to Clock RSEC
1. Second to Clock RSEC
1.1. Instruction Description
The instruction will accumulate the number of seconds that have passed since * * 2000/1 00:00:00 * *, calculate the date and time, and write them into the specified doubleword D register in the following format.
If BCD format is selected in [PLC Settings]=>[Other]=>[Real time Clock Format], all date and time values must be encoded in BCD format (for example, 8211 represents 2013) Please refer to the table below.
| T (Dn-Dn+7) | Description | Data |
|---|---|---|
| 0 | Year (2000-2099) | Current Year |
| 1 | Month (1-12) | Current month |
| 2 | Date (1-31) | Current Date |
| 3 | Hour (0-23) | Current Hour |
| 4 | Minutes (0-59) | Current minute |
| 5 | seconds (0-59) | current second |
| 6 | 00 | Reserved |
| 7 | What day of the week (0-6) | The current day of the week, 0=Sunday |
1.1.1. Attention:
- Our HMI+PLC All-in-one could not use the function below
1.2. The valid operands of the instruction
| Input/Output | Data Type | operand | Description |
|---|---|---|---|
| SEC | 32-bit unsigned integer | D | seconds |
| D | 16 bit integer | D | Time |
1.3. Example
Command table
NETWORK 000
LD X000
RSEC D10 D0 // Convert the second D10 into clock data and store it in D0~D7。
图1 RSEC