1) It's tough to say. The run-time error goes away if you comment out (skip) the session closing step? Does viClose works on all your instruments besides the custom instrument? Does a simple VISA example in CVI work for your custom instrument (especially closing the session)?
2) The only issue you might have in not closing the session is when you go to run your application again. Because the session was not closed down, you might not be able to open another session.
Best Regards,
Matt P. Applications Engineer National Instruments
Regarding item (1): Yes, only this instrument gives me the problem. If I comment it out, there will be no error. And yes, ViClose works fine on the other instruments.