LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Make a program for arm/disarm funct

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

0 Kudos
Message 1 of 7
(900 Views)

I figured out the solution. It was pretty simple. 

I've attached the image below. 

 

sarwatsarfaraz_0-1659076121036.png

 

0 Kudos
Message 2 of 7
(881 Views)

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?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 7
(879 Views)

You mean it should be like this? 

 

sarwatsarfaraz_0-1659077801776.png

 

0 Kudos
Message 4 of 7
(868 Views)

Better…

 

What about that Case structure that outputs TRUE when the selector is TRUE?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 7
(860 Views)

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. 

 

sarwatsarfaraz_0-1659079274130.png

 

0 Kudos
Message 6 of 7
(856 Views)

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

0 Kudos
Message 7 of 7
(827 Views)