First of all, hello everyone and thank you for reading this
So I am learning LabView on myself for FRC and I got stuck.
I need to make a window motor connected on relay ( Spike ) and then when button 4 is pressed it rotates forward for some time ( for example 1 sec after that he must stop ) and then when button 2 is pressed it goes reverse ( because I need to lift a ramp for discs 4 times and then take it down for new load ) .
Also when I try to open new relay ( relay 2 ) LabView does not enable me to do it ( wire does not connect to Relay open ) , but I really need to use like 3 or 4 relays for my future work with motors…
Here is a sample multi-button sequence that goes in Periodic Tasks.vi (NOT Teleop.vi, because of the delays).
The sequences for each button are independent although Button 1 goes first if both buttons are pressed simultaneously.
However, the possibility of the wrong button being pushed must be handled.
What happens if button 1 is pushed twice in a row?
You can add a check that only allows the proper button to be pushed. That’s called a state machine.
That might also be handled by adding a limit switch at the bottom as feedback for when it’s all the way down, and maybe another to prevent it from going too far up. A limit switch check would then simply replace the timer at the beginning of each of the sequences.
For Opening Relays, if you can get one Open successfully coded, then you can highlight all of it , then copy/paste to get the next one.
Then use the cursor to select a different Relay number.
Even the one with the unbroken wire is telling you something is wrong. That red dot on the function input says there’s a mismatch between the type of value you’re giving it and what it expects.
To fix them, delete the enum constant (the name in the blue rectangle with the various little triangles around it) and the broken wires. Then right-click on the terminal you want to connect it to and choose Create >> Constant from the menu. Now you can change the constant to whatever value is appropriate for the code.