Modbus – IAI America ROBO Cylinder Series User Manual

Page 81

Advertising
background image

5. Modbus RTU

73

Modbus

4ὸᴾ

Conversion of Read Data into Time

The read data output the current time by the setting on the controller.ᴾ

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.

1) How present time is calculated

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

;

[Procedure 1] Convert into decimal number:ᴾ S= 172C1B8B

H

Ÿ

388766603

[Procedure 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

[Procedure 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.

2) How to Calculate Passed Timeᴾ

Example) Assuming the current time data is E1B8B

H

:ᴾ

Convert into decimal number:ᴾ E1B8B

H

Ÿ

924555

Therefore, it means 924555msec (15min. 24sec. 555) has passed since the power was turned on.ᴾ

Advertising