Quote:
Originally Posted by ruralrobotics
Example: While holding button six down and pulling the trigger on the joystick cannon one goes off. Then release button six and press button five down while pulling the trigger to shoot cannon two.
|
Just to clarify - all you want is to have to hit and hold two buttons down in order to fire - and in this case it would be the trigger?
There's lots of ways to implement this, but I would recommend this a structure like this:
Code:
if (trigger == 1):
{
if (button1 == 1): fire cannon 1
if (button2 == 1): fire cannon 2
..
}
else
{ //do nothing }
Basically you just want a nested case (
https://decibel.ni.com/content/docs/DOC-3507) Your top level case will be if the safety button (your trigger in your example) is selected, and your inner case will just be the logic for the joystick buttons to fire a cannon.
Note: I realize this is the labview forum and I gave written code example, but I don't have labview on this computer. If this doesn't help and no one else chimes in, I'll see if I can find a computer that has it installed to build up real quick.