EasyManua.ls Logo

FATEK FBs-CB2 - SECOND→HOUR:MINUTE:SECOND (FUN62 →HMS)

FATEK FBs-CB2
348 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Advanced Function Instruction
7-42
FUN 62 P
HMS
SECONDHOURMINUTESECOND
FUN 62 P
HMS
S :Starting register of second to be converted
D :Starting register storing result of conversion
(hour : minute : second)
WX WY WM WS TMR CTR HR IR OR SR ROR DR K
Range
Ope-
rand
WX0
WX240
WY0
WY240
WM0
WM1896
WS0
WS984
T0
T255
C0
C255
R0
R3839
R3840
R3903
R3904
R3967
R3968
R4167
R5000
R8071
D0
D4095
117968399
117964799
S
D * *
z When conversion control "EN" = 1 or "EN" ( P instruction) has a transition from 0 to 1, will convert the
second data from the S~S+1 32-bit register into the equivalent hour : minute : second time value and store it
in the three successive registers D~D+2. All the data in this instruction is represented in binary (if there is a
negative value it is represented using the 2's complement.)
B15 B0 B15 B0
S D
(
sec
)
59 sec
59 sec
S
1
Second
Ö
D
1 (min)
59 min
59 min
B31 B16
D
2 (hr)
32768 hr
32767 hr
The bit B31 of the second
register is used as the sign
bit of the second value.
The bits B15 of each register are used as
the sign bit of the hour : minute : second
value.
z As shown in the diagram above, after convert to hour : minute : second value, the minute : second value can
only be in the range of -59 to 59, and the hour number can be in the range of -32768 to 32767 hours.
Because of this, the maximum limit of D is -32768 hours, -59 minutes, -59 seconds to 32767 hours, 59
minutes, 59 seconds, the corresponding second value of S which is in the range of -117968399 to
117964799 seconds. If the S value exceeds this range, this instruction cannot be carried out, and will set the
over range flag "OVR" to 1. If S = 0 then result is 0 flag "D = 0" will be set to 1.
z The program in the diagram below is an example of this instruction. Please note that the content of the
registers are denoted by hexadecimal, and on the right is its equivalent value in decimal notation.
R0
5D17H
R1 0060H
6315287 sec
Ø
X0
R10 002FH 47 sec
R11 000EH 14 min
X0
EN
S :
R 0
62P. HMS
D :
R 10
D=0
OVR
R12 06D
A
H 1754 h
r

Other manuals for FATEK FBs-CB2

Related product manuals