LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems loading the mpusbapi.dll with contructor node. Constructor node or Call Library Function Node?

Hello,

 

I want to use the methods provided by the mpusbapi.dll in order to communicate the labview with a pic microcontroller. With the purpose to achieve this, I have tried to use the LabView functions from the .NET palette (Constructor node, Property node, Invoke node..) in order to access to the methods of the dll. Unfortunately, I get the following error:

 

System.BadImageFormatException: The file 'mpusbapi.dll' can't be loaded. It was expected that the module had an assembly manifest.

 

On the other hand, if I use the LabVIEW function Call Library Function Node then it works properly, and I can access to the functions of the dll. However, I have checked that this function slows the execution of the LabVIEW program very much and for me, the speed on the execution is very critical. Is this true? The call library function node is much slow compared to the constructor node? I want to clarify that the error checking of the function is disabled, but the call still being slow. 

 

Any help is appreciated. Sorry for my english. 

 

 

0 Kudos
Message 1 of 3
(3,158 Views)
You need to understand that in order to use the .NET functions, the dll must have been created with .NET. You have a normal or c type dll and trying to use it with the LabVIEW .NET functions just does not make any sense. You can't arbitrarily select what to use and saying one is faster than the other does make any sense either.
0 Kudos
Message 2 of 3
(3,143 Views)

After dll has been loaded, it works very fast, it does not matter whether it is a .NET assembly or simple dll. The linking mechanism of dll  into Labview is not a problem.

What can slow the program is

microcontroller response

dll function implementation

your program, overloading communication with extra data, unnecessary operations.

What is your data rate? How fast can microcontroller give out data? How often are you demanding them? Does communication interfere with user interface? 

 

PS: mpusbapi.dll from microchip is a regular dll, not .NET assembly.

0 Kudos
Message 3 of 3
(3,126 Views)