also, the VIs in this link maybe of helpful in your coding...
http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=506500000008000000D83A0000&UCATEGORY_0=_49_%24_6_&UCATEGORY_S=0&USEARCHCONTEXT_QUESTION_0=volume+control&USEARCHCONTEXT_QUESTION_S=0