Hello,
What error did you get? Was there an error message? If you're using an instrument driver, did you get it from www.ni.com/devzone/idnet/ and are you initializing once at the beginning of the program, configuring, calling the any operations, and closing at the end of the program?
Ray K
NI Applications Engineer