Thanks.
I did in fact add a connector to the Teleop.vi and tried to connect the shift register in robot main. I was able to put the shift register on the while loop in robot main, but I have a single connection point in the teleop.vi when it seems I should have 2 connections (one for each side of the shift register). I am a little confused as the timer value passes through one of my case structures (tapped off to check stored time against current time) and I am not sure what labview ‘part’ to connect to the input and output of the timer value passing in and out of Teleop.vi (I have an Enum connection on the input side, but I’m pretty sure that is incorrect).
As far as your suggestion for ‘private’ data, that would be fine as well. I did not have a while loop within teleop. Can I just put a while loop around the teleop ‘execute’, default case statement in and run the while loop continuously? Or can I just use the feedback node to pass data within teleop (I could guess on how to do this, but would appreciate help).
In looking at this last night - I didn’t want to ‘muck’ around too much with robot main’s modular design, but I am a Labview novice still and I didn’t know another way to do this.
The thing that my example pics don’t show is the unbundle and bundle operations that I typically perform when using the RobotMain shift register. (My pics show a single variable, but my/our team code has a cluster of data in that shift reg)
In any of the VI’s that use the shift-reg, upon entry I unbundle a couple variables out of the shift-reg, act on them, then if there is an update, rebundle it into the shift-reg on the way out of the VI.
If you haven’t checked it out yet, I’d recommend the FRC Mastery video on state machines. That’s where I learned about using shift registers.
http://frcmastery.com/try-me/state-machines/
Greg’s advice on keeping the data private is good. The primary reason I/we are doing things in the RobotMain while loop is we found ourselves doing the same thing in both TeleOp and Auton … so we use the same variables in either case and it made sense to just wire up the same shift-reg to both our Teleop and Auton VI’s.
I went through the FRC mastery videos for the shift register topic. I guess I have to do it again after working in Labview for a bit. I find that the best way to learn this is to use the application, but that can be slow.
I do not have access to the videos here (at work), so I am relegated to watching it at home.
I can see that you could use the same timer in Autonomous and why you’d want the shift register in that while loop - makes sense.
Thanks for the help…I’m getting there (slowly but surely).
For the private implementation, you can use either the feedback node or you can add a loop that executes for only one iteration and place the shift register on the loop. You do not want a continuous loop or your teleop will not return in time for another teleop packet to be processed.
There is very little difference between the runtime behavior of the shift register and feedback node. The shift register can be grown to hold multiple iterations of data, but the feedback node is slightly easier to initialize. The choice of which to use is largely a matter of choice.
Greg McKaskle