Simply a timer for Machine Activity

BartPeters88

Member
Join Date
Feb 2015
Location
Asten
Posts
18
Hello there,

I'm working with a PLC S7-1200 CPU 1215C DC/DC/DC. And I use Siemens Tia Portal v11 to programm it.

But I've got a question about something pretty simple (atleast that's what I think...).
When some output is HIGH(machine is active) start a timer/counter. Or the other way around: when the machine ISN'T active, start a timer/counter.


I just want to use this to check the machine activity.

It sounds really easy but I can't figure it out with the build in timers(TP/ToF/ToN).
 
Last edited:
Don't know if this will make it easier or not but in Extended Instructions / Date and Time-of-Day you have a Runtime meter which does what you want. If you stick with timers then you will need to use the Retentive type so that time is stored.
 
Thanks for your reply BryanG, But that is not really using anything with the TIME data type. If I'm wrong, could you please give an example?
 
Runtime meter output is a Dint of Hours run. If you need to know to the current second/minute then you can use a retentive timer. Or again in the Date/Time-of-day functions you can read the current time and use the T_SUB or T_DIFF to calculate the difference between current and past. Output from those functions can be DTL or Time depending on the input. If you want to convert from DTL to Time/ Time to DTL you use T-CONV. DTL is a 12-byte date-and-time structure containing Year, Month, Day, Hour, Minute, Second and Nanosecond. If you still want to use timers then as I mentioned you will need to use a retentive timer.
 
Personally I just use a counter. Granted I don't have the experience with Siemens but shouldn't be much different. I have a second pulse and when true it counts up. My time is just in SECONDS.

On my SCADA displays I just use an expression to compute the seconds data into DDD HH:MM:SS format.
 
In with the other timers, but it has an R after it. If you want to store the time on power off I think you will also need to set the instance database to Retain.
 

Similar Topics

Windows 10, x86_64, RSLogix Micro Starter Lite RSLogix Emulate 500 6.00.00.07 (CPR9) RSLinx Classic 2.57.00.14 CPR 9 SR 3 See the attached ZIP...
Replies
41
Views
10,975
Hi mi name is Eduardo Fernandez i am a electrical engineer at Leitner-Poma. I work on control systems for ski lift, gondolas, etc. We use AB for...
Replies
0
Views
3,412
I have downloaded SimplyModbus and have succeeded in writing values to the PLC, but I cannot seem to read any of the registers. Has anyone had any...
Replies
4
Views
3,978
Hi Gents, I am new with Siemens as probably a few of you already know.I did post a few questions before on this forum and with your help I...
Replies
29
Views
4,252
Hi. We are learning Simatic Step7 on our studies now. And teacher asked us to solve 2 problems. First. One button. When we push for the...
Replies
6
Views
4,979
Back
Top Bottom