I would like to use a .NET library to control a motor controller (8742, New Focus) with Python. I use Python 2.7 and an Anaconda distribution. In the .dll file there is a constructor that I have to call first. From the documentation I have these information about the constructor.
/// <summary>
/// Constructor.
/// </summary>
public CmdLib8742 ()
/// <summary>
/// Constructor.
/// </summary>
/// <param name="logging">True to request logging, otherwise false.</param>
/// <param name="msecDelayForDiscovery">The number of milliseconds to wait for devices to be discovered.</param>
/// <param name="deviceKey">The first device in the list of open instruments (null = none found).</param>///
public CmdLib8742 (bool logging, int msecDelayForDiscovery, ref string deviceKey)
My Python code looks like this:
import ctypes as c
class Picomotor:
def __init__(self):
self.dll = c.cdll.LoadLibrary('C:\\Program Files\\New Focus\\New Focus Picomotor Application\\Bin\\CmdLib8742.dll')
self.dll.CmdLib8742()
If I write in the console
Picomotor()
I get the error "AttributeError: function 'CmdLib8742' not found"
How can I call the constructor correctly and use the functions in the .dll-file (not shown in the example)?
Thank you very much for help.
PS: This previous answer doesn't help me.