03-24-2019 01:01 PM
I have angles from 30 to 360 given as Boolean OK Buttons and I have to calculate the cosine. I know how to calculate it. My problem is that I have to put the output ONLY from the clicked angles to an dynamic array. For example If I have 60, 90 and 150 clicked my array should be filled with result of this angles. Thanks!
03-24-2019 01:23 PM
I don't know what you mean by dynamically created array. Perhaps attaching the VI you have created so far would help.
But if you want to tell what buttons are true in an array of buttons, then you could use Search 1D Array for all the true elements.
03-24-2019 02:06 PM
I assume that the array of buttons is fixed and not dynamically created, but you would like to create an output array of cosines based on the selected buttons.
I would create a diagram constant of a DBL array of the same size containing the pre-calculated cosines for all buttons, then use a FOR loop autoindexing on both, and using a conditional output tunnel to create the array of selected cosines.
Use a "value changed" event on the array to calculate the new output for each button change or just poll. Hard to tell without seeing the context. Obviously, your question is a bit ambiguous. It always helps to attach a simple VI so we can see what you have.