how to send a sinewave to analog port of NI DAC and read back?

Hi i am trying to write my own codes to make a sinewave and then send it to NI DAC for employing and controlling a external supply and also need to scan the data from this supply and read them and see the figure.
actually i dont know my codes are right or not ! because i couldnt see the data when i am scanning.
here i provided my codes and please help me by your directions to do that.

Function sinnwave()
Make/B/O/N=10000 sinn
Variable x=0
For(I=0;I<10000;I=I+0.0001)
sinn[I]=5*sin(2*Pi*1*I)
fDAQmx_WriteChan("NIdevice", 0, (sinn[I]), -10, 10)
endfor
end
.................................................
scanning data
Function scan()
Make/O/N=10000 Wave1
SetScale/P x,0,0.0001, "s", Wave1
DAQmx_Scan/DEV="NIdevice" /BKG Waves="Wave1, 3/NRSE,-10,10"
Display Wave1
end

Thank you in advance