07-29-2022 12:36 AM
I have a joystick from which I'll control an automated vehicle. I want two buttons on it (switch until released type) to work it as arm and disarm buttons. I'm trying to make the program on Labview but I can't.
I've attached the type of program I'm trying to make.
Button 7(arm) and 8(disarm) are the buttons of the joystick.
I've placed an LED button in the system instead of placing the whole program of the system (sensors, motors, all indicators, etc), for ease.
The logic I'm applying is that when button 8 gives a HIGH value, the SYSTEM (which is a boolean in my program) goes false. And when button 7 gives a HIGH value, the SYSTEM goes true.
Is this logic even applicable for this program?
If not, is there any other way I can make a program for ARM/DISARM function?
P.S: I first tried this program by using Push buttons as arm/disarm controls instead of the actual joystick buttons. That worked. I'm trying to make this kind of program but I want the controls to be the buttons of the joystick. I've attached this file too for reference.
Thanks
07-29-2022 01:29 AM
I figured out the solution. It was pretty simple.
I've attached the image below.
07-29-2022 01:32 AM
Hi Sarwat,
@sarwatsarfaraz wrote:
I figured out the solution. It was pretty simple.
And it looks very Rube-Goldbergish…
What's the point of a Select node when both selections are the very same value?
What's the point of a Case structure when its output is the same as the selector input value?
07-29-2022 01:57 AM
You mean it should be like this?
07-29-2022 02:05 AM
07-29-2022 02:22 AM
I've now placed the indicator inside the second case structure, that's cleaner i guess.
But I can't remove that case structure because there's a huge program that'll be replacing the SYSTEM indicator. This is just an led so it can be connected to the output of the first case structure, a whole system cannot be connected by just one wire.
P.S: this a prototype program to turn a big system on and off.
07-29-2022 08:16 AM - edited 07-29-2022 08:18 AM
What will happen when you push both buttons and just hold them for 5 seconds?
Can you make a table like this?
Previous State | Button 7 | Button 8 | Next State |
DISARM | 0 | 0 | DISARM |
DISARM | 1 | 0 | ARM |
X | X | 1 | DISARM |
ARM | X | 0 | ARM |
X: Any |
If you have such a table, you can implement the program as a map of (Previous, B7, B8) -> Next