Solenoid not working in autonomous

is there any reason for a specific solenoid to not work in autonomous, but then be fine for teleop? don’t have code right now, but any help would be appreciated

I think if you post some pictures of your code folks may be able to help you more specifically.

Nothing particularly unique that distinguishes Teleop from Autonomous vi’s.

A Ref name misspelling could cause it to work one place, but not another.
Being set in a third vi, like Periodic Tasks, at the same time could cause conflicts.
A general code error such as setting and resetting it too fast for the eye to follow might be a cause.

No Diagnostic error messages to decypher?

nothing except for the Robot Drive not running fast enough, but that is always there. I’ll see if i can get the code

here is the code. I couldn’t see anything wrong with it; i hope someone can help me

Autonomous (53.2 KB) (63.4 KB)
Periodic (68.4 KB)

Autonomous (53.2 KB) (63.4 KB)
Periodic (68.4 KB)

So which specific solenoid isn’t working the way you want it to? What do you expect it to do, and what does it do instead?

You didn’t show us Teleop, which you said does work. Seeing it might give us a clue as to the problem.

[edit]The Periodic Tasks vi runs constantly, even during autonomous. It looks like the Loader solenoid is going to be set Forward every ten milliseconds, regardless of what Autonomous Independent wants it to be doing.[/edit]

when i said teleop, i meant teleoperated mode (i put it under periodic tasks). It is the first solenoid under autonomous (the solenoid named “Loader”) I think you can figure out what i want it to do by the code, but it isn’t doing anything.

i think you can refer your problem to the problem i had

This is happening because you are giving the solenoid a command. 100 times a second you tell it to be Forward inside Periodic. in Autonomous you tell it to go to Reverse, but then less than 1/100 of a second after that you tell it again in Periodic to go Forward, so it never had a chance to move.

You have to realize that Periodic Tasks runs all the time, even during Autonomous. Use for your teleop needs, not Periodic.

A common way to update motors/actuators is to write to a global variable inside teleop or autonomous, and then read from that global variable in Periodic and update the motor accordingly.

ok i got it now. i didn’t realize that before, so i had a local variable controlling the same solenoid, which defaults in reversing the pistons, so that would make it not work.

One more question, if you copy the time cluster from the front panel of teleop and paste it into teleop and use that to find the elapsed teleop time, would that work or is Elapsed only writing to the one in teleop?