Codesys TOF block reseting issue

rookie333

Member
Join Date
Sep 2020
Location
Australia
Posts
2
I will really appreciate if you could help me with this Codesys program in Ladder logic: I am working on a project where I am using TOF function block + Falling edge trigger + Timer pulse so that when som input is given to TOF block it carries it for 5 seconds and falling edge trigger goes high for one scan cycle and timer pulse is high for 200 millisecond the only problem I have is that when the input is high for TOF for more than one times before the 5 seconds timer is finished it resets the TOF timer and the process is not complete, I need to know if I can use anything before TOF block so that when an input is high twice or three times it doesn't resets the TOF block timer instead its save it somewhere and wait for the TOF timer to finish and then move to TOF fb
 
This is standard behaviour for a TOF timer. If there are more rising and falling edges of the input to the TOF timer, what would you want it to do, for which of these pulses would you want it to do it's thing? Since that is not easily defined, the TOF will reset on a rising edge of the input. Keeps it simple.



Sounds to me like you want to ignore a new input rising to high while the TOF output is still high. You can achieve that with some additional rungs but need to think carefully about how exactly you want your code to respond to inputs while the output is still on. If you do not define that unambiguously then you will keep running into situations where your code behaves not exactly as you wish.



Quite a can of worms you are opening up here. The key here is to first define exactly what you do and don't want your code to do. Think through all possible "what if" scenario's, define clearly what the correct response would be and work from there.
 
Thank you for explaining this far, I am a new Codesys user and time is not my ally here so I am putting it infront of you and all other readers, may be you can give me a better suggestion to improve or do the whole programming from scratch
Its a bottle sorting plant project: it has one convere that keeps moving, bottles are being loaded manually by workers, there are two sensors in start to check whether bottle is large or medium after passing this sensor, bottle travels for few seconds of and reaches next station where there are two actuators for pushing the medium or large bottle to their exit point, after passing actuator bottle is sensed by three actuators that are sensing small, medium, or large opaque bottles and after that bottles end up in their designated exit point, so far I think I have figured out that small bottle unless opaque deosn't need any sensing so no rung for small clear bottle is added, however rest of the system is here: you can check the whole project that is attached as project archive in link

https://drive.google.com/file/d/1tquhmf7PdBdi0BQhNdUWsv9JvD3BiJjN/view?usp=sharing
 
Propably you can use NC-contact of your TOF timer output (Q) at the timer input side? That will ignore new inputs while timer is running
 
I'm not accusing you of asking for help with homework but please let us know if this is homework.

I'm not sure what is in your google drive but it might be better to take a screen shot of your logic and post that.
 
TOF-timer can be replaced with Set, reset, temp bit and TON-block.
Usually much easier to understand also.


(Actually TON is only timer which you need (TP timer can also replaced with it)
 

Similar Topics

Hello, I am using a Hitachi Micro EHV+ for a small project, and I wanted to have a Web visu, done with Codesys V3.5 SP13 Patch 2. I test the...
Replies
6
Views
263
Hello, I have a requirement to manage the text alignment dynamically. So, for example: 1. English Texts should be displayed from Left in...
Replies
0
Views
86
Hello, I am new to Codesys, and am trying to learn about it for a project we're developing. I've got a couple questions, but first a little...
Replies
1
Views
133
Hi everyone, as this is my first experience with Rockwell Software i would like to know what's the best way to make Enumerations?
Replies
10
Views
486
I am trying to get Codesys to work with a couple of Moxa ioLogik E1200 series DIO devices (E1210 and E1211). I am able to write to the E1211 DOs...
Replies
2
Views
159
Back
Top Bottom