6/10/2014 11:29 AM | |
Posts: 5225 Rating: (1185) |
Hi there. Is it a action that you wish to delay using an encoder as your "timer"? w |
6/10/2014 1:10 PM | |
Posts: 13 Rating: (3) |
@William B. Same, same but different - as good friend of mine would say. Your example is exactly that I want to do. There are two functions: 1. Marks (pushers) on conveyor are passing before sensor. On each pusher I need to trigger some action but delayed for some time, so I do not need to measure pulse duration. I can reconstruct pushers with pulses with fixed duration some time later (delayed). 2. As you put it, on some other place i need to measure product passing time, and then shift if and reconstruct exactly some time later. If delay is less then product passing time this can be done with TON - TOF pair. But if delay is greater than passing time I need to measure time and then reconstruct it after delay. Problem I proposed is generalization of these two scenarios so I can use one function throughout program. I apologize if something is "lost in translation" as English is not my native language. I hope I can explain problem in enough detail so we can came to good solution. So general problem would be: If I have repetitive pulses of variable duration and fixed period (or to be precise period of which I know minimal time), how I can shift this pulses for time which is constant and known in advance. This delay is fraction of (minimal) period - I do not need to remember more than one time in some buffer, as this is only needed if delay is greater than period. I need pulses to be the same as they come, only delayed. Simple as that |
Last edited by: drgry at: 6/10/2014 1:27 PM |
|
6/10/2014 3:17 PM | |
Posts: 13 Rating: (3) |
@Jens_app This is the place where I stopped. S7-1200 do not haveTIME_TCK function and I can not find any other function like that (maybe I am not looking where I should). All I can find is TON,TOF and TP nothing else. As I wrote in my first post: To all this is related, as a problem to me, measuring time duration of impulses. I do not know how to do this on S7-1200.
|
6/10/2014 3:32 PM | |
Joined: 1/5/2011 Last visit: 4/22/2024 Posts: 815 Rating: (121) |
Dear drgry, sorry I did not know youwere using s7-1200. Then I'd suggest using IEC timers like you did before. They also have milisecond accuracy. Let me add; functions like T_CONV, T_ADD,... might simplefy your logic. Kind regards, Jens |
Last edited by: Jens_app at: 6/10/2014 3:43 PMKeep it simple and on-topic. |
|
6/10/2014 6:09 PM | |
Joined: 7/7/2010 Last visit: 4/26/2024 Posts: 14631 Rating: (2349)
|
You can use a 2 ms time interrupt OB to check if a time has expired for your registration sensor and activate if required any diverter gate or other action as required by your logic. Just make anything in the interrupt OB very quick so it does not interfere with your normal scan. |
science guy |
|
Follow us on