From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Clearing a digital write

Solved!
Go to solution

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?

0 Kudos
Message 1 of 2
(2,071 Views)
Solution
Accepted by bassinbc

@bassinbc wrote:

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.

0 Kudos
Message 2 of 2
(2,066 Views)