Impact Acquire SDK .NET
|
The Impact Acquire .NET API has been built for the following .NET platforms:
Impact Acquire version | Installation Folder | .NET platforms supported |
---|---|---|
since 1.12.68 | $(MVIMPACT_ACQUIRE_DIR)/bin/.NET | .NET Framework 3.5 and above |
since 2.38.0 | $(MVIMPACT_ACQUIRE_DIR)/bin/.NET | .NET Framework 4.5.1 and above |
since 2.38.0 | $(MVIMPACT_ACQUIRE_DIR)/bin/netstandard2.0 | .NET Framework 4.6.1 and above .NET Core 2.0 and above Mono 5.4 and above |
The following compilers have been tested successfully with the Impact Acquire .NET API targeting the .NET Framework build on Windows:
The following compilers have been tested successfully with the Impact Acquire .NET API targeting the .NET Standard 2.0 build on Windows:
With an installed version of the .NET Core SDK (see https://docs.microsoft.com/en-us/dotnet/core/install/linux) it is possible to build an application by calling from a directory containing the project file or solution of the project which should be compiled.
dotnet build
The following versions of Mono (http://www.mono-project.com) have been tested successfully with the Impact Acquire .NET API targeting the .NET Framework build on Linux:
The first version of Microsoft Visual Studio® fully supporting .NET standard 2.0 is 2017. For new developments .NET standard is recommended, existing applications should be ported to use this version as well. No changes in the code are necessary. Only existing references to the Impact Acquire assemblies must be updated to the .NET Standard version and of course the application itself must be ported to target the .NET Standard. This provides a couple of advantages regarding platform independence as this e.g. allows to develop .NET Core applications as well as various other things. Please refer to the corresponding documentation throughout the Internet for additional information and how you can benefit from a migration to .NET Core / Standard.
The Impact Acquire .NET interface can be used with all its functionality when targeting at least the same version of the .NET framework as the one used for building the Impact Acquire .NET binaries.
When the .NET runtime version the application will be compiled against is known only the code that is suitable for that runtime version can be used of course or in order to be compatible with most version of the .NET runtime only the stuff that does not require a certain version of the runtime can be used as well.
The full Impact Acquire .NET interface currently consists of 4 assemblies:
No special knowledge regarding the Impact Acquire .NET interface is required to compile and link .NET applications using the Impact Acquire interface. Everything just works the way it does when using any other vendor's assemblies.
For reasons mentioned above when creating a new .NET library in your application we recommend to target the .NET Standard and NOT .NET Core if possible:
to
For applications (*.exe) this choice doesn't exist. But when targeting the .NET Standard with all your libraries you can build applications either targeting the .NET Framework or .NET Core while when targeting .NET Core in your libraries your applications will be bound to use .NET Core as well.
On Linux all the data types belonging to the namespace mv.impact.acquire.display will currently not be available. This is because the underlying native code modules dealing with the displaying of image data are not available on Linux.
You may build the sample applications on a Linux PC with Mono already installed by specifying the path to the mv.impact.acquire assembly.
Assuming the current directory contains the source files for the applications, you can build them like this:
gmcs CaptureToUserMemory.cs UserSuppliedMemory.cs -lib:/usr/lib/mono/mv.impact.acquire/ \ -r:mv.impact.acquire \ -out:CaptureToUserMemory-no-display.exe gmcs SingleCapture.cs -lib:/usr/lib/mono/mv.impact.acquire/ \ -r:mv.impact.acquire \ -out:SingleCapture-no-display.exe gmcs ContinuousCapture.cs -lib:/usr/lib/mono/mv.impact.acquire/ \ -r:mv.impact.acquire \ -out:ContinuousCapture-no-display.exe
In fact, it is possible to build the sample applications directly on a mvBlueGEMINI camera that already has Mono and mvimpact-acquire-dotnet IPKs installed. However if all the required IPKs just mentioned are installed on the device it is also possible to develop an application solely on Windows using Microsoft Visual Studio® as mentioned above and then copy the binary files of this application onto a mvBlueGEMINI device. The same of course applies to an application compiled on any Linux system. .NET / Mono applications are binary compatible!
To run an application that has been built using the Impact Acquire framework all native user mode libraries belonging to the framework must be located in the library search path of the application using it. The minimal list of libraries that must be present when working with the Impact Acquire .NET framework consists of
So with 4 libraries only a .NET application using the mvVirtualDevice can be developed.
A detailed list of the files and settings needed to deploy an Impact Acquire device driver can be found in the chapter Installation From Private Setup Routines.
The native libraries will automatically be loaded by the Impact Acquire .NET assemblies when needed. In addition to that the Impact Acquire .NET assemblies used by the application (at least mv.impact.acquire.dll, maybe mv.impact.acquire.display.dll and mv.impact.acquire.display.extensions.dll) must be present as well.
When an application that has been developed for Windows shall be deployed on a target system please refer to Installation From Private Setup Routines to find out which files must be copied onto the target system.
On Linux PCs, with an installed .NET Core SDK it will be sufficient to run use the dotnet binary within a directory containing a .NET solution or project file.
dotnet run
On Linux PCs, depending on the way your distribution is set up, you may have to use the Mono command to run the applications. E.g.
mono ./ContinuousCapture-no-display.exe
Please read here for more information.
On the mvBlueGEMINI you can execute Mono or .NET applications directly e.g.
./ContinuousCapture-no-display.exe [0]: MS000208(mvBlueGEMINI-1013C, family: mvBlueGEMINI) [1]: VD000001(VirtualDevice, family: mvVirtualDevice) [2]: VD000002(VirtualDevice, family: mvVirtualDevice) Please enter the number in front of the listed device followed by [ENTER] to open it: ...
Also modifying the library search path of the system is not required.