S7 minutes > hr:mm

Werner

Member
Join Date
Apr 2005
Location
IJsselstein
Posts
336
In my S7 program I have a number indicating minutes [INT]. For protool display I want this to indicate as [HH:MM]. Example:

180 -> 3:00
160 -> 2:40
etc.

I'm looking for some cleaver solution. If there isn't one I can always calculate the hours/minutes in the plc.

Any ideas?
 
I think, you can use simple trick with 'whole number' calculation, just :

min ... minutes count

f_m ... min - ((min / 60) * 60)
f_h ... (min-f_m) / 60

you just have to convert it into stl/lad

for example min == 183
f_m = 183-((183/60)*60) == 183 - (3*60) == 183 - 180 == 3
f_h = (183 - 3) / 60 == 3

so 183 -> 03:03
 
... i meant, that for showing of time, that maybe would be neccessary to convert into simatic time variable, so why not calculate it directly into two integers?
 

Similar Topics

Hello Friends My experience with Siemens is limited. From HMI I would like introduce Minutes and Seconds to a timer. Also, in HMI I would like...
Replies
5
Views
3,922
Hello I was needing to stop one device and start the second device at a certain time each day, for example 10:00 am each day. I thought the best...
Replies
13
Views
5,209
Hello, In CLX5000 I have a DINT being used to store the shift's break time as a whole number ie 1:00 would be 100. The issue is if I want to...
Replies
32
Views
8,691
I have a 90-30 system.* Once a timer gets to 16 minutes, it goes back to 10 and it never really times out.* I am using an HMI to set the timer.*I...
Replies
5
Views
2,017
Hello everyone, i'm very new to PLC's. I have a VFD hooked up to a tank agitator motor, the VFD is connected to an output on my Allen...
Replies
5
Views
1,768
Back
Top Bottom