I’m on the road so I cannot offer up examples, but I can comment on what you have.
The code you posted has a chicken/egg issue.
None of the Latches are guaranteed to have been set by the loops on the left, before being used in the case statement to the right.
The case statement code on the right happens simultaneously with the checks you are performing on the left.
As far as using joystick buttons to select a motor speed, you can do something like this. Add more buttons (one speed and one Select per new button) for more variations in speed.
It just remembers (latches) the speed associated with the last button pushed.
I can’t tell if this is in line with how you are trying to employ the buttons.
Could you be a little more specific, I’m a bit confused as to where some of the values are coming from. Also wouldn’t it be easier to use a case structure with a choice of each value? Sorry if I’m not much help.
You still have the race condition that Mark pointed out. Putting the latches in a sequence helps some, but doesn’t keep the case statement from executing before or after the sequence.
I think you can implement the whole thing using wires and feedback nodes, and then you would have no race conditions.
As for any specific debugging, that’s almost impossible to do with a PDF of a portion of the code, and hardly any description of what the code is supposed to do. Post the VI and a detailed description and maybe someone can help. To me, it looks overly complicated, but since I don’t know what its supposed to do, I can’t say for sure.
There’s an awful lot of complicated stuff going on there. I suspect LabVIEW provides a much simpler way to do what you want, but without knowing what you want to do, I don’t want to risk giving inappropriate advice.