Sign in to follow this  
Followers 0
Penko Mitev

Set output for a period of time from a subroutine?

1 post in this topic

Hello everybody! I have configured I0.4 on my Twido as a High-priority event pointed to Subroutine 10. The purpose is: Rung 1 of SR10 -> LD I0.1 -> OUT Q0.2(but for 10 ms). If this was in the main program, I don't have troubles doing it. However, putting this in a subroutine does not make the trick. The way I am trying is with TP(Pulse) Timer, configured at 10 ms. So, the code inside the subroutine is like this. LD I0.1, TM1(TP, 10 ms) -> OUT Q0.2. Why do I need this? I have a machine vision sensor which is according to my mind very stupid. It does not have direct configuration of output duration. In my case, I need 8-10 ms and I need to control an air nozzle which orientates parts. Because of this camera's firmware limitation, I have to get the signal to the PLC and control the nozzle from there. In order this to happen as quickly as possible, I would not like to put the camera processing logic in the main program where it will be affected by scanning time which will additionally affect performance and it's possible that the duration of this how cycle is much more than the one expected. So, to summarize, the question is, is there a way to SET a coil from a Subroutine rung and this SET to have a specific duration. It's important to note that this logic is event-triggered and it will execute every time camera's READY signal has a raising-edge and the PLC detects the change. By default, the camera holds the output until the next trigger. This results in the parts being nozzled out before they actually reach the photosensor which triggers the camera. That's why I need to specifiy a certain output duration. Thanks

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0