06-18-2024 06:38 AM - edited 06-18-2024 06:39 AM
The title may not be clear, so let me sketch the situation. I have a program that controls multiple DAQmx channels. Each channel has it's own settings during a measurement. For example: Name, Enabled, Output etc.
I am developing a UI to configure these settings. Often times, many channels have the same settings, so instead of manually changing each one, users can select multiple channels in the UI and apply the settings to each one automatically like so (not the final code, just for illustration!)
Here's my problem. Let's say these are the current settings:
I now want to set the output of channels 1 and 2 to a different value. I would set "Channel to modify" to T,T,F and update the settings cluster. The problem is that also Name and Enable will also become the same;
Consider that the full application will have dozens of settings. What would be the best way to update the settings if I want to update just a single value, but to multiple elements in the cluster array? The only solution I can think of is to send a message containing the new settings and the name of the element that has changed, then make a case for each individual element in the settings cluster and update just that element.
But this is very tedious, not scalable and prone to bugs if I had to change labels in the future. Is there an easier, more scalable solution?
Solved! Go to Solution.
06-24-2024 09:02 AM
Just for future reference in case anyone comes across this topic, here is how I solved it: