S7 Timers in hours not in ms

Gromit

Member
Join Date
Jun 2006
Location
-
Posts
119
Hello dear colleagues,

I'd like to enter a timer value not in ms, but in minutes or hours. My idea is to difine the timer var in DB1 in S5Time format (see the attached JPG). The time will be typed in a Siemens touch-screen. I've tried it, but when I type 100, it's 100 ms. How to make it 100 minutes?

Regards

type009.JPG
 
Hmi

When entering time values on an HMI, I allways do it with SFB4.
It's in the S7 IEC library I think.

Kind Regards,

Gerry



Hello dear colleagues,

I'd like to enter a timer value not in ms, but in minutes or hours. My idea is to difine the timer var in DB1 in S5Time format (see the attached JPG). The time will be typed in a Siemens touch-screen. I've tried it, but when I type 100, it's 100 ms. How to make it 100 minutes?

Regards
 
Last edited:
Hello,

I don't find the SFB4 in the Libraries > Standard libraries > IEC function Blocks.
I can't understand how to use it.

Regards
 
Hi
Scale the mS to hour in the linear tab of the HMI data entry box, so a value of 1 would be 1000 * 360. This may be 'too high' for SFB4 though.... maybe use standard on delay timer and convert the screen integer value to S5Time format with a calculation
 
Last edited:
Hi there

In PLC side under any Data Block create two entries

One with data type "TIME" and initial value "T#0MS" say m1
other one with data type "S5TIME" and initial value "S5T#0MS"
say m2.

then call FC40 (this converts IEC time to S5 time)

CALL "TIM_S5TI"
IN :=DB6.DBD0 //m1
RET_VAL:=DB6.DBW4 //m2

FC40 can be found under Libraries-->Stdlib-->iec

Now you just have to use multiply factor to set the time in your domain. If the multiply factor is 1000 and if the value entered in HMI is 4 then timer will run for 4 seconds.

If you want to enter the time in HRS then your multiply factor will be 60x60x1000=3600000

For minutes 60x1000=60000

In HMI side creat just one DINT tag.

Example for hrs:HMI tagx3600000
 
Hello Gromit;
SFB4 and other IEC timers are located inside the System Functions Library. F1 will give you access to the online help of a block when it is selected.

Attached is an extract from the Step 7 help on Elementary Datatypes. It shows how to write a timer value in either S5Time or Time format. Notice the limitations on using a S5Time value (it only goes to a bit more than 2 1/2 hours).
Hope this helps,
Daniel Chartier

Step7_TimeFormats.JPG
 

Similar Topics

Hi, I'm quite new to Rockwell PLC and currently trying to implement the following if Sw1 then for i:=1 to 20 by 1 do xEnable := 1...
Replies
9
Views
361
I'm writing some alterations to an FPWin program and need to see the running value of timers so I can set them correctly. It's my first time with...
Replies
0
Views
131
Hi everyone I am using Winproladder software for programming FATEK FBs PLCs and in programming, we often use Timers for activation of the...
Replies
4
Views
576
Hi all, I have what is likely not a complex issue, but I am working in Automation Studio and want an accumulating/retentive timer when a...
Replies
17
Views
1,911
Dear all, I want to use the interrupt service routine in FATEK PLC using WinproLadder Software. I had configured the interrupt in software as...
Replies
17
Views
1,572
Back
Top Bottom