The lovely program LabVIEW has excellent commands to get the axis inputs from the joystick, but I am having problems with the buttons.
I assume the method “Get” and “Get Raw” of the Joystick pallette are meant to retrieve this data by the fact that they have outputs called “buttons” and “axes.” Unfortunately I have been wholly unsuccessful in my fruitless attempts to assimilate this command.
I have been informed of other groups who have actual “Get Button” commands similar to the “Get Axis” command which is the only one I’ve successfully incorporated.
What I’m trying to say is I really do not know why this simplest of tasks is not working and I would like to know what I’ve simply overlooked.
Thank you all in advance and I hope you all have better luck with LabVIEW than us.
The button behavior in the Get and GetRaw vis is identical. The only difference between Get and GetRaw is that the axis values are scaled to -1,1] for the Get.
Judging from your description, it sounds like you may be having trouble with the clusters. Both Get.vi and GetRaw.vi output the axes and button values in clusters. The buttons indicator is a cluster (think container) of a number of independent buttons. If you drop a Get (or GetRaw) vi onto your block diagram, then you should be able to get at a single button’s value by right clicking on the Button terminal and selecting Cluster, Class & Variant Palette and then selecting the first function (i.e. Unbundle by Name).
Wire the Unbundle by Name to the Buttons output of the Get.vi. By default you should see Button 1 in the Unbundle by Name but you can change that to any button you like (or stretch the Unbundle by Name to have multiple button outputs).
Don’t forget to wire the device reference to the Get.vi or GetRaw.vi
Oh, well we’ve been using unbundle by name already. Otherwise the wire types do not match. Sorry, I should have been a little more specific.
When we set it up like you said and run it (which it does successfully to a point) it runs for a second then pauses and selects the unbundle by name and brings it to the front on the computer screen. When we unpause it it skips it and brings up the next unbundle by name used similarly.
Well, no. I removed those when after accidentally adding them in a different spot in the program. I didn’t add them there and I double checked that. And it isn’t just in one case, it is any case in which I use “Get” or “GetRaw.” Even if it accidentally happened, deleting the whole thing and recreating it should get rid of the breakpoints anyway. So I’m at a loss for what to do.
The behavior you describe still sounds like a breakpoint. There are actually two types.
The most precise is the one put on nodes and wires. It looks like a red border around the node, or a red dot on a wire.
The second type is the pause button at the top of the window. This is a button you can just push at any point to pause execution. If a subVI has the pause set, then each time the subVI is called, it will stop at the first node, which could be an unbundle.
The other possibility is that there could be hidden code – code under the edge of a structure or underneath a structure. Clearly this isn’t well written code if it happens, but I’ve seen it on more than one occasion. In the edit menu is an item for removing Breakpoints from hierarchy. You might want to give that a try.