I am trying to create a vi which represents the insertion of data into a database from 38 generators. Each generator has 22 variables.
As there will be 836 variables in the code, I am looking for ways to collect the variables to make the code more readable. I created a sub-vi containing 22 control variables for a generator. I plan to use this vi as the case for all 38 generators so I changed the settings to a preallocated clone re entrant vi to allow multiple executions in parallel.
When I insert the sub-vi into the main VI the the variables show up as a sink rather than source? But they are set as controls in the sub-vi. How do I make this work? Is it possible to collect the variables in this way or is it better to use a cluster?
Solved! Go to Solution.
Well, your code certainly isn't readable (by us) now. If you post your code (as a VI -- no pictures, please), we can comment on its readability and make suggestions appropriate to your level of expertise.
Attached is my current vi. I clustered 22 variables for each generator (38 in total) and in case use a sub-vi which formats the values into a string ready to insert into the database. I am working with PostgreSQL 9.6.
I'm sure there's a better way of doing it, but this is all I've come up with so far.
Thanks for your time.
Thanks for your suggestion. When you say make an array of the generators, list the values for all 38 generators in the array to begin with? or to convert from the cluster? I'd like to have controls so i can change the values and know what variable they refer to. Also with the loop- if it's in parallel this would require 38 separate loops?
Thanks for your suggestion. When you say make an array of the generators, list the values for all 38 generators in the array to begin with? or to convert from the cluster? I'd like to have controls so i can change the values and know what variable they refer to. Also if in parallel, would this require 38 separate loops?
Thank you for posting your code. I agree with Yamaeda that an array of Clusters would be much simpler. I also think I see where the Control/Indicator confusion might arise.
So some basic questions.
Bob thank you so much for your detailed help.
Thanks again, your assistance is much appreciated!