Measuring time between pulse patterns

mulderm

Member
Join Date
Jun 2003
Location
Netherlands
Posts
298
Hello,

First of all best wishes to everyone on this great forum.
I start this new year with a question.
I like using a timer to measure the time between pulse patterns and the measurement time of writing to a marker word (measurement time in ms).
Thus, writing the measurement time between each two pulses.
I know about that the time between the pulses ranges from between 1 and 4 seconds.
I would prefer to use the standard Siemens timers (eg ODT timers).
Is this possible?

Grt mulderm
 
Why would you prefer to use Siemens timers over the IEC ones?
How accurately do you want to measure the time?
 
It's I think easier?
This timers are not accurately?
Or have you other possibilitys. it's also welcome.
Ton Timers examples from rockwell are also good, I can that programmed in Siemens to.
 
Last edited:
The example you gave was for a Q output. The Q's are updated before the scan of OB1 so you can measure the time by reading the system time at 0 to 1 transitions and calculating the time difference - no timers required.
 
The example you gave was for a Q output. The Q's are updated before the scan of OB1 so you can measure the time by reading the system time at 0 to 1 transitions and calculating the time difference - no timers required.

But isn't it easier still to use timer and rising edge detection with move block? (No calculations needed if little less accuracy is no problem)
 
few answers to this:
1. look at www.oscat.de for a very good library (i am codesys but also available for siemens.
If it is really an output it is easy as you can start a timer in same time.
but when it is an input you will have to use rising edge , when true
newtime=TIME()
calculate the newtime - oldtime, this is your measuretime.
put the newtime in oldtime.
that is all.
the cycle time is about 10 ms which gives you an accuracy of 10 ms.
(thus your measuretime must be bigger than the scantime obvious)
i am living in s hertogenbosch
 
Can one read a millisecond or finer system clock during an interrupt. If the interrupt can be programed to occur on ONLY the rising edge it is possible to read the system clock and subtract the last reading to get the difference in what ever resolution the system clock has. There would be some sample jitter due to the interrupts being disabled from time to time.

The best way to do this is to use a counter/timer card.

If accuracy isn't required then shooter's method is good enough.
 
I have experiment with the idea of Lare.
See attachment, it works excellent.
With a accuracy of 10 ms (scan cycle time)and for test using
the internal clock bit.
But how must I program the shooter/L D[AR2,P#0.0] idea?

Greetings,
mulderm

Measure_Time.jpg
 
As shown on your sketch, your signal to start measuring the time disappear, so this timer must be able to work with. So a normal on-delay timer will stop counting the time when the signal disappears.

I would use an IEC timer (SFB 3 - SFB 5) as they are part of the operating system of the CPU and therefore the most accurate.

Another option is to use runtime measurements from the system time, where you can get the result in milliseconds. I am attaching link to Siemens support around the measurement of time:
http://support.automation.siemens.com/WW/view/en/26116927
 
Jera,

Can you send an example program of the IEC timer (SFB 3 - SFB 5)for mine question above
so it's interesting to learn.

Grt mulderm
 
Last edited:

Similar Topics

Hi everyone, I want to know if in S7 300, there is a standard watch or something like that to measure the elapsed time between two events. And...
Replies
1
Views
3,926
Hi everyone, I don't know much of PLCs but it happened that i need to connect Leuze AMS358i Ethernet laser measurement to Productivity 1000...
Replies
0
Views
1,061
Hello everyone! Firstly I'd like to say that I'm new to this forum and also new to PLC programming world altogether, that said I really would...
Replies
27
Views
4,838
I am looking for a way to determine level in a silo. The material is called Perilite which has a very light density. Bulk density could be...
Replies
10
Views
2,748
In our water cooling tank, I've installed and successfully wired up 4 float switches & updated the PLC (big thanks to @parky for that). As a...
Replies
46
Views
11,458
Back
Top Bottom