![]() |
reset the shift register?
1 Attachment(s)
Hi All
is it possible to reset a number in a feedback loop? I attached an image, I am taking a number from a shift register and i want to increment it until a setpoint is reached but I want to start with another number in the feedback loop and start incrementing again. P.S Title should read: reset the feedback loop. |
Re: reset the shift register?
1 Attachment(s)
I can make a couple comments about the code that you attached, but I'm not sure that they will help you solve your problem. If you'd like help writing the code that performs the logic, it would be better to attach more of the code and a more thorough description of what it is trying to accomplish.
First, notice that the enable terminal in your example serves no purpose. By placing the shift register and add inside of a case, you have double guarded the operation. The value going to the enable must always be True, which is equivalent to hiding it again. Or you can possibly remove the case statement, but I can't tell for sure since I can't see enough of your code. Second, I find it helpful to think about feedback nodes as delaying your input for N cycles of execution. The only purpose for the initializer is for the initial execution. After that, you control their next output by controlling this input. In the code that you showed, this will likely be accomplished by simplifying ... by removing the case statement and using a select statement instead. I suspect that what you may want is something like this ... Notice that it writes to the feedback node each execution, either a zero or an incremented count. There are many other ways to write this, but first, let's make sure it does what you intended. Greg McKaskle |
| All times are GMT -5. The time now is 08:52. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi