ni.com is currently undergoing scheduled maintenance.
Some services may be unavailable at this time. Please contact us for help or try again later.
05-19-2022 10:53 AM
The first one is because you can choose which one from the array depending of the channel. Habitually it's a control that you chose on the front panel but for now I changed it for a constant. I wanted to reduce it later.
The second one I didn't know how to do it.
I have 4 channel and I want to combine the data and do a mean so I compare it on a graph with something else.
05-19-2022 11:16 AM - edited 05-19-2022 11:27 AM
@anickt wrote:
The first one is because you can choose which one from the array depending of the channel.
Yes, but its all from the same array so one "index array" is sufficient. It can be resized. If each index can differ, you would use a FOR loop.
@anickt wrote:
The second one I didn't know how to do it.
A good rule of thumb: If dynamic data is involved, there is probably a better, more efficient, and cleaner way. All these "to/from DDT" have hidden configurations that make their exact functionality completely opaque and impossible to reproduce from a picture. Too many unknowns.
If you have five channels, why don't you collect the data in a single 2D array instead of five different 1D arrays. Herding cats. 😄 <<20% of the code!