Quote:
Originally Posted by kamocat
I don't think shift registers are neccessary here; the data in those refnums aren't changing, except perhaps the error state. However, if you would like to pass on the error every iteration, feel free.
One thing here that doesn't make sense to me is the use of the relay output. I see you have values such as -200 or even the iteration counter, wired to the relay state.
In fact, there are only four meaningful values: Off (0), On (1), Forward (2), and Reverse (3).
Anything outside that range will be coerced to the nearest meaningful value. That means -200 will be coerced to 0 (Off), and the iteration counter will go through all four states, and end on Reverse.
I also see that the only thing measured here is time. That being the case, there is a simpler way to write your code.
- Disable the timeout on the drive base.
- Use a "wait" function to wait the entire time something should execute.
- Compartmentalize each action with flat sequence structures, forcing sequential execution through data dependency.
I've attached an example of this.
|
Thanks for the file. I hope this one will work. Now since build is done, i can concentrate on an autonomous code. In regards to the comments about enable and disable safety config, does it really matter which way i leave them?