Hello,
i want to use the Dobot M1 with C#. I have downloaded the DLL for the M1, but this is a C/C++ API. After that i have written a library to get the functions from the C/C++ API in the C# Program. As template i have used the C#-API from the Dobot Magician. The Problem is, that the Function SetArmOrientation is missing. So i have added the import function like:
[DllImport(“DobotDllM1”, EntryPoint = “SetArmOrientation”, CallingConvention = CallingConvention.Cdecl)]
public static extern int SetArmOrientation(ref ArmOrientation armOrientation, bool is Queued, ref UInt64 queuedCmdIndex);
After that i added the type definition for “ArmOrientation”:
public enum handy{
LeftyArmOrientation,
RightyArmOrientation
};
[StructLayout (LayoutKind.Sequential, CharSet=CharSet.Ansi, Pack=1)]
public struct ArmOrientation{
public byte handy;
}
But the function this won’t work. All other imported functions and datatypes are working well. So i think the problem is, that the datatype for handy is not correct.