multiple warrior dlls registered

This is the English forum for all topics related to IO-Warrior. Please post in English only

Moderator: Guido Körber

Post Reply
CHerrera
Posts: 4
Joined: Tue Mar 16, 2010 10:01 am

multiple warrior dlls registered

Post by CHerrera »

We have two io modules (dll's, running in Visual Studio 2008) which use the warrior api. Upon installation of our software, the two dll's are registered. This however gives problems when running the software and the user chooses to use one of the io modules. The solution so far is to unregister the other not needed dll, but this is not handy for the user. Is there a better way to solve this?
Guido Körber
Site Admin
Posts: 2856
Joined: Tue Nov 25, 2003 10:25 pm
Location: Germany/Berlin
Contact:

Re: multiple warrior dlls registered

Post by Guido Körber »

Why do you have two DLLs? There should be only a single instance of the DLL.
CHerrera
Posts: 4
Joined: Tue Mar 16, 2010 10:01 am

Re: multiple warrior dlls registered

Post by CHerrera »

We have two IO boxes (each can connect to different devices) that are used for different purposes. Each box is accessed using its own dll, and both are dependent on the iowkit dll. The decision to create separate dll's for each box was made, so as not to mix the functionalities of each box.

We have an application where the user can choose which io box he wants to use. But then, once a choice is made, it can happen (as we have seen in a run) that the wrong dll is accessed. This can be solved only by unregistering the other dll before the choice is made.

Is it not possible to have more than one instance of the iowkit dll? Is there a way to specify that the iowkit dll in one of the io box dlls should be used? Or in general, what is the best way to approach this problem?
Guido Körber
Site Admin
Posts: 2856
Joined: Tue Nov 25, 2003 10:25 pm
Location: Germany/Berlin
Contact:

Re: multiple warrior dlls registered

Post by Guido Körber »

If there are multiple instances of the DLL how should they find out which IO-Warriors they should handle? Also there is no communication between the two instances of the DLL so collisions and problems are granted.
CHerrera
Posts: 4
Joined: Tue Mar 16, 2010 10:01 am

Re: multiple warrior dlls registered

Post by CHerrera »

The multiple instances do not need to know which other instances are running and they do not need to communicate with each other . But the program that lets the user choose which io box to use (you can call this the third program) should know which IO warrior dll should be handled. Is there a way to do this? Now it seems like it takes the first registered dll for the iowkit calls.
Guido Körber
Site Admin
Posts: 2856
Joined: Tue Nov 25, 2003 10:25 pm
Location: Germany/Berlin
Contact:

Re: multiple warrior dlls registered

Post by Guido Körber »

There is no way to make this work reliably. Windows simply has no mechanisms to tell several instances of identically named DLLs apart.

Why do you have multiple DLLs at all? If the user has to chose one device in any case there would be no problem in using the standard DLL.
CHerrera
Posts: 4
Joined: Tue Mar 16, 2010 10:01 am

Re: multiple warrior dlls registered

Post by CHerrera »

thx for ur answer.

The current setup has been designed to make an independent plug-in like structure, in which plug-ins handle specific devices. Seperate plug-ins can thus both use the warrior SDK. However now they are interfering with each other.

Upon opening of the plug-in all IO warriror devices are queried. The plugin checks if it can handle the device, and when not needed it closes the devices. However there is no way to close a device individually; with IowKitCloseDevice() all devices are closed, even devices which are handled by different DLL's (or applications).
Guido Körber wrote:There is no way to make this work reliably. Windows simply has no mechanisms to tell several instances of identically named DLLs apart.
We do not understand it. We have experience with other hardware manufactorers, which also have SDK's which can be programmed. These SDK's allow cross application / DLL access. A simple solution would be that the warrior SDK internally uses reference counting per device or that a device could be locked. This could even work over processess when stored in shared memory section. Ofc we have no knowledge of the IO warrior, so the solution presented here may not be applicable.

Alternatively we have to make a wrapper around the SDK warrior which does above functionality. Our plug-ins should then not use the warrior SDK directly, but our own wrapper. This ofc breaks when an external application (not provided by Noldus) uses the warrior SDK possibly closing all devices.

thx in advance.
Guido Körber
Site Admin
Posts: 2856
Joined: Tue Nov 25, 2003 10:25 pm
Location: Germany/Berlin
Contact:

Re: multiple warrior dlls registered

Post by Guido Körber »

The problem is that the DLL is not designed for access from multiple applications, Windows is not making this easier, the Linux version does not have this restriction. We had multiple application access until V1.4 of the DLL but this was generating some problems with asynchronous functions.

One option would be to access the IO-Warrior direct without use of the DLL. But the interference with other devices using IO-Warrior can only be prevented if you use a custom chip istead of the off the self IO-Warrior. Some of our customers do this to prevens interference with other IO-Warrior based products.
Post Reply