Skip to content

Sample .NET/CLR plugin for WaveMetrics' Igor Pro

License

Notifications You must be signed in to change notification settings

mcintosh/igor-xop.net

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XOP.NET

###Sample .NET/CLR plugin for WaveMetrics' Igor Pro

This repo contains the source code for my XOP.NET project on IgorExchange

It is a barebones Visual Studio 2012 solution for an Igor Pro XOP that calls C# (.NET) code in a separate library.

It was originally written to work on Igor 5 and I've now updated it for Igor 6.3.

To use it, you'll need to already be familiar with both .NET and XOP programming, and you'll need to write a little bit of C++/CLI, Microsoft's C++ -like language that lets you mix managed .NET code with traditional C++.

The basic idea is to compile the XOP as a C++/CLI project, and in places where the XOP functions are executed, put in C++/CLI calls to the external C# code. You can see an example of this in the MyFunc function in MyXOP/MyXOP.cpp

###To build and test

  1. Make sure you've built the XOPSupport project in your XOP Toolkit folder

  2. Set an environment variable called XOPSupport to point to the XOPSupport directory

  3. Copy Igor.lib, XOPSupport.lib, and vc90.pdb into the local lib directory.

  4. Build this solution. It will put MyCSharpLib.dll and MyXOP.xop in XOP.NET\output

  5. In your Igor Extensions folder, make a shortcut to MyXOP.xop.

  6. Start Igor

  7. Enter the following command

    Print MyFunc(6,7)
    

    You should see 42. That multiplication was courtesy of the .NET runtime.

The DllResolver.cpp file is there to help the .NET runtime library loader find your custom .NET library, which gets loaded in step 6. Without it, the standard library search behavior doesn't work properly.

If you only have access to the 'Express' (free) versions of Visual Studio, the XOP.NET.sln 'solution' file won't work for you. Instead, open the 'project' files MyXOP.vcproj and MyCSharpLib.csproj individually. You may need to mess with some settings in the VC project so it can find the C# library dependency.

###License Some parts of the source code are copies, or modified versions, of the example code in the XOP Toolkit. The modifications, and the new code here are provided under the open source BSD license

About

Sample .NET/CLR plugin for WaveMetrics' Igor Pro

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • C++ 66.9%
  • PowerShell 11.7%
  • IGOR Pro 8.9%
  • C 8.7%
  • C# 3.8%