thank you so much for the help. However, the code is working now probably, but I have question about the main function of Trigger.vi in the code that you posted. How does it work? I have tried to read the manual to understand the main function of the trigger. Is this for detecting the signal from the input channel and generate signal as fast as possible?