06-10-2018 11:09 AM
Hy everyone! 🙂
I try to collect my joystick axis data in a array if I push the "save" button (on the joystick) but i can't, because the array save only ONE data. (the last state)
How can I save 10 state, in a 1D array? (with indexing)
06-10-2018 01:05 PM
You need to use a shift register.
I would recommend you learn more about LabVIEW from here. How to Learn LV
PS. Index Array is expandable. You only need one Cluster to Array into a single Index Array. Drag the bottom border downwards and you'll automatically get indices 0 and 1.
06-10-2018 01:58 PM
You have a basic misunderstanding of the "build array" primitive.If you want to accumulate the last 10 values, you need a 10 element array of points (cluster of x,y) in a shift register where you replace the oldest with the newest at each iteration, keeping track if the insert point (or just rotate and replace at one end, depending on the desired order (oldest vs. newest first)). What determines your loop rate? Chances are that your loop runs so fast that the ten last values are all the same. Alternatively, you could also only add elements to the history if they differ from the previous, but in that case a timestamp for each element might be useful.
Instead of converting to an array and indexing out, why not just use "unbundle by name" directly on the clusters? Much less convoluted!!! Try it.
If you want more detailed help, attach your VI. We don't debug images.