Hi,
There are two ways of going about doing this. The first, which is the easiest, is to use the easy I/O functions in the DAQ palette. You can run the Acquire Waveforms VI inside of a loop. By doing this, each time the loop runs, you can specify what your frequency is. This is not the most effient way of acquiring data.
The second method is explained in the link below. This is an example program that does exactly what you want. It uses the AO clock to clock the AI. This program is a little more complex, but it works well.
http://zone.ni.com/devzone/explprog.nsf/6c163603265406328625682a006ed37d/94f6ea3c2401ff61862565e2004c0154?OpenDocument
Andrew