|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: Difference between Shift Register and Feedback Node
We use shift reg all the time in teleop.
The number one way I use shift reg is in single loop while loop just to store a value for later use. |
|
#2
|
||||
|
||||
|
Re: Difference between Shift Register and Feedback Node
Could you explain more about this? Post a code example perhaps. I was under the impression as well that you could not do this since the shift register involved a loop and you didn't want the loop tying up telop. In the past, I have written information to a Global Variable and let a loop inside of Periodic Task access the value.
|
|
#3
|
||||
|
||||
|
Re: Difference between Shift Register and Feedback Node
Our team uses while loops with shift registers to run all of our inputs and outputs. Inside each loop is a case structure with an enum for 3 modes, which are init, run and end. All the code that would normally be placed in the begin VI is placed in the init case, and then that case is run in begin. In run is all of our code that is used at runtime. In end it the code that is normally located in finish. This shift registers are used to transfer the references between the 3 states. This means that we do not need to use refnums which saves some resources.
|
|
#4
|
||||
|
||||
|
Re: Difference between Shift Register and Feedback Node
Just be careful with Enums like this. This is very common practice BTW, and one method to keep your code isolated. Your action Enum, (Init|work|end) should always be a TypeDefd control. This also presents the possibility of the constant value automatically changing if the typedef is updated. I typically will write the desired value as a BD note, next to the Enum constant.
|
|
#5
|
||||||
|
||||||
|
Re: Difference between Shift Register and Feedback Node
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|