Ok
I’m a little confused, when I code the closes, do I need to make references to them in the autonomous mode or tele-op mode, or do I just use the get reference and then close, and never use set reference in the tele-op or autonomous vi’s
Ethan
Ok
I’m a little confused, when I code the closes, do I need to make references to them in the autonomous mode or tele-op mode, or do I just use the get reference and then close, and never use set reference in the tele-op or autonomous vi’s
Ethan
Opens go in Begin.vi
Closes go in Finish.vi
Sets go in Autonomous Independent.vi and Teleop.vi
I’m working from a Mac without LabVIEW, so I can’t give you a graphical example right now.
It takes a while to shutdown all the computers in the house and the PCs have already been put to bed.
The Auto that you posted is fine, just remove the Closes to keep it clean.
The Teleop you posted is also fine, just remove the Closes and the While loop (but not the contents).
The Get Refnums feed directly into the Sets in Teleop.
Think of the whole Teleop.vi as one giant While loop.
So I need to put a set reference in tele-op to the final.vi closes?
Ethan
I’m not clear on what you mean by that.
Finish.vi looks good.
No, you do not need those Sets in Auto.
The Sets are only done once in Begin.vi.
Begin Opens and names the thing that’s been opened.
Everywhere else just uses the name.
So do I ever reference the closes in final.vi?
There isn’t anything else you do in Finish.vi.
Think of Finish.vi as only running at the very end when you shut your robot down.
It doesn’t run at the end of Autonomous or at the end of Teleop if you’re running a practice match over and over for instance.
Ok. So that Tele-op code looks fine?
Just saw your attachments.
That is what I meant.
One problem remains with your compressor code.
The compressor is a funny operation.
The compressor should be Opened AND started/enabled in Begin.vi.
No code for the compressor goes in Auto or teleop.
Then the compressor gets Closed in Finish.vi (just like you have it now).
P.S.
You can get rid of the 1 ms timer in Teleop.vi. It does hurt and it doesn’t help.
Okay, where does the stop compressor block go then?
You can add that to Finish.vi between the Get refnum and the close
Ok
thanks! Ill try it on Monday (we don’t meet on Sundays unfortunately) and will post my failure or success here.
Thanks again!
Ethan
Good luck!
So, I tested it out, and teleop doesn’t work. Are you sure I don’t need the while loop?
Ethan
Edit: Nevermind, it works!
Thanks
does autonomous works ??
from the pic you provided in thread, we can’t seem to get our autonomous working !
Besides the compressor code, the very last image I posted in here should work, you just have to define all of those things in begin.vi first.
Ethan
ALSO make sure that your line sensors are calibrated correctly, otherwise it won’t run. If it detects with both, the motors won’t move.
Ethan