Hello;
Basicaly, what you need to do is to use the AO Update signal as the source signal of the counter, then, at each update of the analog output channel, the counter will increment. You can set the counter either to do a simple event counting or buffered event counting.
To accomplish that by using the NI-DAQ functions, you will need a Select_Signal call, where the AO Update signal will be the signal source, and one of the RTSI lines will be the signal name.
The, when you set the counter, you make a call of GPCTR_Change_Parameter, to configure the source signal as being the same RTSI line you chose to receive the AO Update signal.
You can refer to the NI-DAQ shipping example about simple event counting at C:\Program Files\National Instruments\NI-DAQ\examples
\VBasic\Ctr\STCEventCount.
Hope this helps.
Filipe