Modbus – IAI America ROBO Cylinder Series User Manual

Page 49

Advertising
background image

4. Communication

41

Modbus

(10) Data of present time (Address = 841A

H

(SCON-CA), 8420

H

(PCON-CA/CFA) (TIMN)

Bit

Symbol

Name

Function

31

-

Present time 2147202832

30

-

Present time 1073601416

29

-

Present time 536800708

28

-

Present tiime 268400354

27

-

Present time 134200177

26

-

Present time 67108864

25

-

Present time 33554432

24

-

Present time 16777216

23

-

Present time 8388608

22

-

Present time 4194304

21

-

Present time 2097152

20

-

Present time 1048576

19

-

Present time 524288

18

-

Present time 262144

17

-

Present time 131072

16

-

Present time 65536

15

-

Present time 32768

14

-

Present time 16384

13

-

Present time 8192

12

-

Present time 4096

11

-

Present time 2048

10

-

Present time 1024

9

-

Present time 512

8

-

Present time 256

7

-

Present time 128

6

-

Present time 64

5

-

Present time 32

4

-

Present time 16

3

-

Present time 8

2

-

Present time 4

1

-

Present time 2

0

-

Present time 1

It outputs the time of the present time issuance.

[1] For the models that are equipped with the calendar

function (RTC), when RTC is set effective, it shows

the time of alarm issuance.

[2] When RTC is set ineffective or for the models that is

not equipped with RTC, it shows the time [msec]

passed since the power to the controller is turned on.

Ɣ How present time is calculated in 1)

The data of present time shows the seconds passed from

the origin time (00hr:00min:00sec 1January2000).

Passed second from the origin time is expressed with S,

passed minute with M, passed hour with H, passed day

with D and passed year with Y, and the calculation is

conducted with a formula as shown below:

S=ᴾ Data of read alarm issuance time

M=ᴾ S/60(decimal fraction to be rounded down)

H=ᴾ M/60(decimal fraction to be rounded down)

D=ᴾ H/24(decimal fraction to be rounded down)

Y=ᴾ D/365.25(decimal fraction to be rounded down)

L(Leap year)=ᴾ Y/4(decimal fraction to be rounded up)

Assuming the second of time is SA, minute is MA, hour is

HA, passed day in this year is DA and year is YA, the

time can be calculated with a formula as shown below:

SA=ᴾ Remainder of S/60

MA=ᴾ Remainder of M/60

HA=ᴾ Remainder of H/24

DA=ᴾ D-(Y×365+L)

Year and day can be figured out by subtracting

the number of days in each month from DA.

YA=ᴾ Y+2000ᴾ (A.D.)

Example) Assuming present time data is 172C1B8B

H

;

(1) Convert into decimal numberᾉ

S= 172C1B8B

H

Ÿ

388766603

(2) Calculate M, H, D, Y and L.

M=ᴾ 388766603/60= 6479443

H=ᴾ 6479443/60= 107990

D=ᴾ 107990/24= 4499

Y=ᴾ 4499/365.25= 12

L=ᴾ 12/4= 3

(3)

Figure out SA, MA, HA and DA.

SA=ᴾ Remainder of 388766603/60= 23

MA=ᴾ Remainder of 6479443/60= 43

HA=ᴾ Remainder of 107990/24= 14

DA=ᴾ 4499-(12×365+3)

=ᴾ (116 days has passed in this year and the time of

alarm issuance is on the day 117.)

Year and day = 117 – {31 (Jan) – 29 (Feb) – 31 (Mar)}

= 26 (since the number becomes a negative if

days in April is subtracted, the time of present is

on 26April)

YA=ᴾ 12+2000= 2012

As figured out with the calculation above, the

present time is 14:43:23 26Apr2012.

Advertising