Hello
The best way to programm the 5102 is to use the NI-SCOPE instrument driver. This driver offers not only functions to configure the scope (horizontal,vertical settings,...) but some measurements functions too. I recommend you to open the "niscope ex measurement library.vi". This VI shows you how to acquire a waveform and then how to do diffferent measurements.
Hope this helps,
Luca
Regards,
Luca