When you call kvCanInitializeLibrary.vi in your application, the driver determines what hardware is attached to the PC and assigns channel numbers. Â The driver will not recognize any additional hardware until the dynamic link library (DLL) is unloaded. Â This would normally happen when the application exits. Â However, Windows associates the DLL with LabVIEW – not the running VI. Â Therefore, the DLL is not unloaded until LabVIEW is completely exited.
So, if you run your VI until the VI exits, then attach Kvaser hardware. Â When you run the VI again, the newly attached Kvaser hardware will not be recognized unless you completely exit LabVIEW first.
If you would like to unload the DLL within you VI, you can create a VI wrapper for the canlib32.dll function canUnloadLibrary().