|
View unanswered posts | View active topics
|
Page 1 of 1
|
[ 3 posts ] |
|
| Author |
Message |
|
iepie
|
Post subject: rising / faling edge detection Posted: Sat Jan 28, 2012 11:28 am |
|
Joined: Thu Mar 31, 2011 8:07 pm Posts: 5 Location: The Netherlands
|
|
Hello,
I am trying to detect a rising edge of an input. Normally when i use PLC controls there is a commando to detect a edge. how is this done in C or C++ language? Are there any examples?
thanks in advance. Patrick
Edit by Admin: Thread moved, obviously wrong Forum.
|
|
| Top |
|
 |
|
Valen
|
Post subject: Re: rising / faling edge detection Posted: Sat Jan 28, 2012 1:12 pm |
|
Joined: Thu Oct 16, 2008 1:08 pm Posts: 190
|
|
It depends on the electronics/microprocessor involved. What product are you talking about? Is it one of the robots, or the Arexx measurement products?
|
|
| Top |
|
 |
|
Arexx-Henk
|
Post subject: Re: rising / faling edge detection Posted: Sun Jan 29, 2012 8:57 pm |
|
Joined: Thu Jun 23, 2005 10:52 am Posts: 693 Location: Zwolle
|
|
hi,
you will always have to remember the last state.
if current-state is 1 and last-state is 0 then (remember current-state as last-state) a rising-edge has occurred. if current-state is 0 and last-state is 1 then (remember current-state as last-state) a falling-edge has occurred. if current-state unequals last-state then (remember current-state as last-state) an edge is detected.
Henk
|
|
| Top |
|
 |
|
Page 1 of 1
|
[ 3 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 0 guests |
|
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
|
|
|