Hello everybody,
I am writing a Labview program (using LV 7.1.1) to control valves on a chemical installation (each valve is connected to a digital I/O of the board), there are 30 to 40 valves in all, and there is a physical separation in that we use three different instruments. Some valves are only to allow reactants in/out, others will need to be pulsed during the experiments.
I am wondering how to write the tasks in MAX, would you recommend a single task per valve, with the advantage that it will have a human-readable name in the programs and that I can create arrays of tasks later, or maybe directly a task per instrument (i.e., containing about 10 DIO for 10 valves) to more simply deal with arrays of bool later? Or maybe many redundant tasks (I mean tasks that act on the same channels) to pull out like global variables, in the latter case I would use a 10-channels task for initialization and then a single-channel task for pulsing or opening a valve?
What would be the recommended way? Most flexible and simpler to code for?
Now, I have tried the one-task-per-valve approach and then, these tasks put into an array. But I have a problem with finding which channel to switch for changing the state of a single valve in the array. I have written an ENUM to name the tasks in the array, but it is not very flexible (because the ENUM and the array of tasks are separated and easily fall out of sync: different files, different coding priorities...). The latter may actually be my biggest problem here.