LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Loading driver DLL dependent of PC configuration?

Hi,

I've got 2 PCs, one with RS232 and one with RS232 plus a PCI measuring card that needs a driver DLL. I want to use one top level VI where I can select the communication interface being COM1, COM2 or via the PCI card using the driver DLL.

My Labview program should run on both PCs and should be some kind of "intelligent", meaning that the missing PCI card and driver doesn't cause an error.

How can I do that?

Thanks.

Uwe
0 Kudos
Message 1 of 3
(2,592 Views)
If your PCI card uses a DLL and you install the DLL only when you install the card, you can check if the DLL file exists. On your diagram, from the File I/O palette, goto Advanced File Functions then select File/Directory Info. Wire File/Directory Info's path input to a path constant (or control) initialized to the path of the DLL file. If you get no error, the file is there and you can try to use it.
The DLL file should return an error if it couldn't communicate with the card. If you attempt to use the DLL and get an error, you could default to using the RS232 COM port and not the PCI card.
0 Kudos
Message 2 of 3
(2,592 Views)
One other thing is that if a statically called VI requires a DLL and the DLL is missing, the VI will be broken and the main app will not load. In that case, the VI with the DLL should be dynamically called and only after the presence of the DLL is verified.
Message 3 of 3
(2,592 Views)