From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Click event for dynamically created array of buttons

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! 

0 Kudos
Message 1 of 3
(1,913 Views)

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.

0 Kudos
Message 2 of 3
(1,903 Views)

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.

 

 

SelectSomeCosines.png

 

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.

0 Kudos
Message 3 of 3
(1,890 Views)