Stp.dll DLLImport

From scripting
Revision as of 20:04, 24 April 2017 by Nickpisca (talk | contribs) (Created page with " #region // dll setup data [DllImport("stp.dll", SetLastError = true, CharSet = CharSet.Auto)] public static extern int InitStp(); [DllImport("s...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
       #region // dll setup data
       [DllImport("stp.dll", SetLastError = true, CharSet = CharSet.Auto)]
       public static extern int InitStp();
       [DllImport("stp.dll", SetLastError = true, CharSet = CharSet.Auto)]
       public static extern bool RunMotor1(
           int steps,
           int interval,
           int direction,
           int outputs
           );
       [DllImport("stp.dll", SetLastError = true, CharSet = CharSet.Auto)]
       public static extern bool RunMotor2(
           int steps,
           int interval,
           int direction,
           int outputs
           );
       [DllImport("stp.dll", SetLastError = true, CharSet = CharSet.Auto)]
       public static extern bool StopMotor1(
           int outputs);
       [DllImport("stp.dll", SetLastError = true, CharSet = CharSet.Auto)]
       public static extern bool StopMotor2(
           int outputs);
       [DllImport("stp.dll", SetLastError = true, CharSet = CharSet.Auto)]
       public static extern bool SetStepMode(
           int M1Mode,
           int M2Mode);
       [DllImport("stp.dll", SetLastError = true, CharSet = CharSet.Auto)]
       public static extern bool GetCurrentStatus(
           out int M1Active,
           out int M2Active,
           out int M1Steps,
           out int M2Steps,
           out int Inputs);
       #endregion


This C# code I wrote is based on the VB code located on the PC-Controls stepper controller documentation: PC-Controls Docs

Unrelated MEL scripting help located here: YSYT.