Programing Problem

tielp

Member
Join Date
Jan 2003
Posts
2
HELLO IM BACK AGAIN. THANKS FOR YOUR INPUT FROM THE LAST QUESTION I HAD. I HAVE ANOTHER QUESTION. IS THERE A WAY WHEN USING A PHOTO SENSOR TO START A ON DELAY TIMER AND HAVE THE DONE BIT SET WHEN THE PRESET VALUE IS REACHED. THE PHOTO EYE IS CLOSED PAST THE PRESET TIME
AND SOMETIMES IT IS OPEN BEFORE THE PRESET TIME. CAUSING A TRUE OR UNTRUE CONDITION BEFORE THE PRESET TIME. I HAVE A 1747-L532E PROCESSOR AND A 5/03 CPU.


THANKS TIELP
 
The answer is yes - that is exactly what timers are for. You may wnat to spend some time going through your hardware and software manual and looking at the various instrucctions available and some of the samples given. This is one place where a printed manual is more useful than on-line help.
 
Properly defining what you want to happen is the key to success.

You said:
...USING A PHOTO SENSOR TO START A ON DELAY TIMER AND HAVE THE DONE BIT SET WHEN THE PRESET VALUE IS REACHED.

This statement yeilds the following code:
  

PE +------ TON ---+
---| |----| Timer: T4:0 |
+--------------+

T4:0.DN
---| |--- . . .



`
The DN bit of the timer come on when the preset value is reached.

That's what you currently have, and that's what's not working the way you want it to.


The proper way of stating your requirements is:
A Photoeye starts a timer, and once the timer starts, the timer keeps timing until it's done.

That produces the following code:
  
PE +------ TON ---+
Start the timer ==> ---| |-----+----| Timer: T4:0 |
| +--------------+
T4:0.TT |
Keep it running ==> ---| |----+
Until it is done

T4:0.DN
---| |--- . . .



`
Now you might still have problems with this logic. You state that sometimes the eye is blocked for the full duration of the timer, and sometimes it's unblocked before the timer is done.

What would happen (or, rather, what should happen) if the photoeye gets blocked (starting the timer), gets unblocked (but the timer keeps on ticking), and then gets blocked again (which should start the timer, except that it's still ticking from the first hit)?


Some ladder to contemplate to see if it might be of any use to you:
  
+------ TON ---+
-------| Timer: T4:0 | // Note that the timer is unconditioned
+--------------+

PE T4:0
---| |---[OSR]---(RES) // Reset the timer on the edge of the PE


`
The Timer Done bit is always on, except when new object has appeared.

In the previous code examples, the Timer Done bit could be is on until the eye is unblocked. This could be anything from one scan (if it's unblocked before the timer times out) to ????

Perhaps you sould step back and ask yourself what you are trying to accomplish. If you state your goals properly, the code should write itself.
 
Last edited:
Why make things so difficult, when you could adjust your timer to a lower value, to reflect whatever "Real" time the eye must be blocked to see your object in question? Or alter the view point of your photoeye to a more reliable read location for the part, etc.
 

Similar Topics

hello,i have a plc nais (panasonics) fp0-c16 and ac motor connected to my pc with fpwin ver2.7( ladder logic diagram ) . I am having a task on...
Replies
0
Views
1,198
Hello Everybody, I AM USING A GE FANUC 90-30 PLC, VERSAPRO TO WRITE THE LADDER DIAGRAM, THE PROBLEM IS THAT I HAVE AN OLD LADDER PRINTED ON...
Replies
3
Views
6,588
Hello. I am very new into PLC and am still learning basic logic and the commands using the LogixPro 500 software. My teacher assigned us a...
Replies
15
Views
4,434
Hi, I am using AS 2.7. Could anybody told me about AR000-emulator? I am using pp420. After building project and made AR000_TCPIP...
Replies
0
Views
3,092
hi all, Is there some one there to help me out for this interesting omron logic?? the thing is that let us assume that i have D0 to D5000 memory...
Replies
4
Views
4,446
Back
Top Bottom