Error -301706, indicates that the device reference is invalid. The NI-8451 driver does not support automatic detection within the VISA control. In Measurement and Automation explorer you should be able to change the name of the alias for the device to another name then save it. Your device should now run without error. I know you mention that you did provide the reference name, but you might not have saved the changes. You might get problems while reopening the resource ones the error occurs. In order to avoid this problem, errors should be cleared from the error line before passing it into the NI-845x Close Reference VI. This will allow the VI to operate properly, freeing the resource so that it can be opened in the next iteration of the program.
Thanks
Arjun K
National Instruments
Applications Engineer