CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum
Deutsche Version English version russian version 
It is currently Thu Jul 27, 2017 1:37 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Tue Apr 19, 2016 12:08 pm 
Offline

Joined: Sun May 24, 2015 4:01 pm
Posts: 5
Hello,

I'm trying to make a very simple timing delay with Ladder, i've tried some coding, but i can't make it work.

I just want to add some delay after a pulse, wait a number of ms.
The problem with the TON is that the input signal must remain for the TON to become active. If the input signal is gone before the TON starts then there is never an output pulse. I want a pulse after a specific time after the input pulse, but my input is already 0 when the timer starts.
See my picture. Can anybody help me?


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Tue Apr 19, 2016 12:38 pm 
Offline
Frequent User
Frequent User

Joined: Fri Sep 02, 2011 8:02 pm
Posts: 231
You will need to add a latched variable (SET coil) to your logic. Remember you have TON, TOFF and TP timers to work with.


Top
   
PostPosted: Tue Apr 19, 2016 1:36 pm 
Offline

Joined: Sun May 24, 2015 4:01 pm
Posts: 5
Thanks for reply.
Sorry but i'm very stupid. Can you put an example please?


Top
   
PostPosted: Tue Apr 19, 2016 6:15 pm 
Offline
Frequent User
Frequent User

Joined: Fri Sep 02, 2011 8:02 pm
Posts: 231
There are many ways, but here is one. I made it a function block so you can use it several times. Note - this version starts with rising edge of Start input and cannot be stopped - it will delay, then turn on Output, delay then turn it off again. Maybe not what you really wanted...

Attachment:
pulse.png


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Fri Apr 22, 2016 6:46 am 
Offline

Joined: Sun May 24, 2015 4:01 pm
Posts: 5
Just what I needed, thank you very much!


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 5 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited