Creates a link to a Mathematica kernel based on MathLink parameters supplied as a single string.
The created link.
You can use standard MathLink specifications for establishing a link, as documented in the Mathematica book or other MathLink documentation. For example, the -linkprotocol, -linkname, and -linkmode switches.
An example of a string argument would be:string mlArgs = "-linkmode listen -linkname foo"; IKernelLink ml = MathLinkFactory.CreateKernelLink(mlArgs);If you give a pathname, make sure you surround it with quotes. Also, to avoid needing to use 4 \ characters for directory separators, use a forward slash (/) in the path:
string mlArgs = "-linkmode launch -linkname \"c:/path/to/my/mathematica/mathkernel.exe\""; IKernelLink ml = MathLinkFactory.CreateKernelLink(mlArgs);
Exception Type | Condition |
---|---|
MathLinkException | If the opening of the link fails. |
MathLinkFactory Class | Wolfram.NETLink Namespace | MathLinkFactory.CreateKernelLink Overload List