You should read the digital signal and analog signals continuously. Put the write to file in the true case of a case structure. Wire your digital signal to the case structure. When the signal is high, the value is true, you log the data. When it is low, the value is false, you don't log the data.
↧