S5Time

damelect

Member
Join Date
Jun 2002
Posts
1
Can anyone help me in writing a value into an S7 Timer??...I 've tried several times an different methods but still can not accomplish this. I have an Integer value that I have converted to BCD but that only allows me to input 9s before the processor goes into Stop Mode (Simulation). I have alway set Bit 13 of the word high to set the Time Base but this doesn't seem to have an effect. Any help you can provide will be appreciated. Thank You
 
The S5Time has exactly the same format as KT with S5 did: a 4 digit BCD number, with the left digit being the timebase (0=10ms, 1=100ms, 2=1s and 3=10s) and the three right digits being the number of timebases to run (000 ... 999). But don't fuss with the S5Time variable directly. S7 won't accept it. Put your timevalue in a MW without assigning it the S5Time format (don't give it a symbolic name and format). Assign this MW to your timer and it should work.

If you need more info, maybe you could email me the project and I could take a look at it.
 
I've written a ladder in which I convert the time value (integer) to BCD then a WOR_W add the time base to it. Then I perform a move to get it into an S5Time format which is entered into the timer. I've ran it with PLCsim but haven't had the chance to actually use it in a program because all our siemens equipment hasn't been installed yet.

Does anyone see a problem with this method?

integer to s5time.jpg
 
Labotomi wrote:
Does anyone see a problem with this method?
Well Labotomi,

I do see a few problems:
  1. the ladder statements don't match your comment. With this ladder you wont get the time in seconds but in 0.01s units.
  2. you do need to check the number to start with to be in the range 1 to 999.
    [/list=1]
    You could also perform this action with the standard IEC function FC40 "IEC Time to S5 Time" (check the standard library). The timevalue to start with is 32bit integer (DINT) representing a number of milliseconds. You still have to check wether this value is OK to transfer to S5TIME, iow if it is smaller than 9990s or 2h46m30s.

    Kind regards,
 
I caught the discrepancy in my ladder after I'd posted it, but didn't want to go through the trouble to change the post. The value is coming from wonderware where it's being limited to 1-999 seconds.

The IEC to S5time function is something that I'll look into.

Thanks
 
you can convert the value from Intouch to a BCD format in the step7,
the Step7 support two types time in timer s5T# as a direct iunput, and 16 bits BCD as a indirect input the highest 4 bits defines the time base is 1s or 0.1ms.......
rest 12 bits restore the time information each 4 bits is a BCD unit
 

Similar Topics

Hi All, Anyone know what a STRUCT Type S5TIME is in Intouch tagname dictionary item? example PLC Step 7, DB19, Type, STRUCT is S5TIME and...
Replies
1
Views
1,660
Hi i need help in converting Time to S5time in S71200, in s7-300 converted using T_conv Thanks in Advance Ragu
Replies
7
Views
5,330
I have a strange problem in my software. I'm using a 315-2DP PLC and picked (what I thought) a free timer to use in my code. Timer 128. I used...
Replies
14
Views
7,209
I am trying to store timer values into DB's for changeability from HMI, but for some reason I can only put in values of milliseconds from...
Replies
5
Views
3,726
I am trying to use FC40 to go from time to S5time. I have the time going in as a DW set to type time and I have a mw set to s5time on the out. No...
Replies
5
Views
6,153
Back
Top Bottom