07-27-2023 12:45 PM - edited 07-27-2023 12:46 PM
Yeah, absolutely.
I like to make a single VI to both set *and* get parameters like this with an enum or boolean input to define which one. Since each item is indexed by string, that means there's only one place to write down what the string is, instead of having it once in a "Read.vi" and once in a "Write.vi" where a small typo could mean several frustrating hours of debugging.
Of course, a library with some unit tests would accomplish the same thing. Either way, the point is you want to have your attribute name in a simple reuse VI, not repeated each time you use it. If you repeat it everywhere you use it, then want to change the name later, you better hope you find ALL the places where you wrote the old name or you'll have a bug pop up 6 months down the line when you'd forgotten you ever made the swap in the first place.
07-27-2023 01:24 PM
Thanks to members tst and BertMcMahon for your excellent answers! You provided some great tips beyond the question at hand.
07-27-2023 02:05 PM - edited 07-27-2023 02:07 PM
Lots of great info already, I'm just going to take some of the building blocks BertMcMahon previously illustrated and assemble them in a different way.
When using DAQmx devices, waveforms will already include a few specific attributes that may get used automatically by graphs, charts, and TDMS files. You'd probably want to keep those intact by adding to new attributes to what's already there rather than simply replacing them. Here are 2 ways to do it, either with or without the In Place Element structure:
-Kevin P