# SIMATIC TIME

D

#### David

Hi list,
I try to read via applicom card a "simatic time" value (S5T#2m for example) and I receive an integer value (8285 for example). How I can transform integer values to simatic time ?

Thanks,
David.

D

#### Daniel Chartier

Hello David;
Sounds like what you are recieving is a hexadecimal value. Siemens mentions this in their help file for Step 7 (look under S5Time). Meanwhile, here is an excerpt of that file:

When working with S5TIME, you enter a time value in the range of 0 to 999 and you indicate a time base (see the following table). The time base indicates the interval at which a timer decrements the time value by one unit until it reaches 0.

One possible format for S5Time---) W#16#wxyz

Where w = time base (that is, the time interval or resolution)

Where xyz = the time value in binary coded decimal format

Note: Time base for S5TIME
00 --> 10 ms
01 --> 100 ms
10 --> 1 sec.
11 --> 10 sec.

Hope this helps
Daniel Chartier

S

#### Steve Myres, PE

If you do this repeatedly, noting the actual time associated with each result, the encoding system may become apparent, or at least, you may be able to deduce the time resolution of the integer. Once the resolution is known, you can readily calculate the base or zero point.

T

#### tecnog

Hello David,

An S5/S7 timer preset is a 16-bit variable, BCD coded, where the most significant BCD digit represents the timebase in 0..3 range (0=sec/100,
1=sec/10, 2=sec, 3=sec x 10) while the others represent the preset in 0..999 range (e.g. 1020hex = 20 x sec/10 = 2 seconds)

Reading S5T#2m should say 2120hex (8480 decimal) or 3012hex (12306 decimal)

For more details, open the online help of S7 editor, menu Help|Help on STL, and search for "S5TIME Data Type"

regards
Luca Gallina