NI cDAQ-9178 and CDAQ-9481 on windows 7. I have a sub vi that runs over and over that will write to the relay module.
For memory management, is it better to clear a digital write each time it runs in the sub vi, or wait till the program ends and clear the task?
I'm not sure exactly what you mean by "clear a digital write each time it runs in the sub vi". I assume that you're using the DAQmx API, have created an output task prior to the sub vi, are writing the boolean in the sub vi, then closing the task when you're finished using the hardware (eg. cleanup). But I can't tell any more from your description and I confess the terminaology you use is not clear to me. Do you have example code? As far as I'm aware the digital output status is maintained between "writes" so there is only a need to write when the output status needs updating (ie negating), but I'm not especially familiar with the two DAQs you mention. If they work the same way as the ones I'm familiar with, then the only time I "clear" a write is to reset the output status to False on application shutdown.