LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

.NET dll to Specific instrument driver

Solved!
Go to solution
Hi, I have a .dll for a stepper motor from NanoTec. It is in .NET and I have no problem in accessing it directly from VS2008 or TestStand. The target is: - to develop class driver and specific instrument driver for the motor - the dll is CommandsPD4I.dll with a class ComMotorCommands and the class has respective function to control, run, stop motor etc. - I wish to create an object of above class and access the functions and variables in it. - I have gone through the wizard to write a specific instrument driver My questions are: - how to create an object as the drivers are written in C. - If I use CDotNetLibrary, I do not know which functins are to be used and in which order - Where to place these functions is also a question: __Init, __InitWithOptions, __IviInit etc. In help, all functions have been written they do not answer above questions, nor I have been able to find an example which implements the above. Can someone help? Thanks and regards Ricky
0 Kudos
Message 1 of 4
(4,137 Views)

Ricky,

 

LabWindows/CVI is ANSI-C, so there is no native OOP.

 

I did not quite catch from your posting why you are not content with the "Create .NET Controller..." functionality, but this being said, you can do almost everything necessary (like instancing objects, ...) manually using the .NET library. There are quite a few sample applications for this shipped with CVI. One that I can recommend is the "SimpleTaskMonitor", which can be found in the C:\Users\Public\Documents\National Instruments\CVI2010\samples\dotnet\SimpleTaskMonitor directory. It uses a custom wrapper library called "SystemWrapper", which features all the necessary code for object management.

 

Additionally, there is a chapter in the CVI help with specific sample code for calling assemblies manually in the ".NET Library" topic (see attached screenshot):cvi dotnet calling.gif

 

Best regards,

Sebastian

 

0 Kudos
Message 2 of 4
(4,118 Views)

Hi Sebastian,

 

thanks for replying.

 

Actually the problem is that the vendor does not supply and MyAssembly.h. Does it mean that I have to write a new assembly myself?

 

Regards

Ricky

0 Kudos
Message 3 of 4
(4,114 Views)
Solution
Accepted by topic author dotNet_to_LabW

Ricky,

 

 

yes, I believe that you will need the .h file.

 

Best regards,

Sebastian

Message 4 of 4
(4,086 Views)