├── 软件界面.png
├── 写字效果图.png
├── bin
├── Debug
│ ├── LTSMC.dll
│ ├── elipse.exe
│ ├── elipse.pdb
│ └── elipse.exe.config
└── x64
│ └── Debug
│ ├── LTSMC.dll
│ ├── elipse.exe
│ ├── elipse.pdb
│ └── elipse.exe.config
├── obj
├── Debug
│ ├── elipse.exe
│ ├── elipse.pdb
│ ├── elipse.Form1.resources
│ ├── elipse.Properties.Resources.resources
│ ├── elipse.csproj.GenerateResource.cache
│ ├── elipse.csprojAssemblyReference.cache
│ ├── DesignTimeResolveAssemblyReferences.cache
│ ├── DesignTimeResolveAssemblyReferencesInput.cache
│ └── elipse.csproj.FileListAbsolute.txt
└── x64
│ └── Debug
│ ├── elipse.exe
│ ├── elipse.pdb
│ ├── elipse.Form1.resources
│ ├── elipse.csproj.GenerateResource.cache
│ ├── elipse.csprojAssemblyReference.cache
│ ├── elipse.Properties.Resources.resources
│ ├── DesignTimeResolveAssemblyReferences.cache
│ ├── DesignTimeResolveAssemblyReferencesInput.cache
│ └── elipse.csproj.FileListAbsolute.txt
├── README.md
├── App.config
├── Properties
├── Settings.settings
├── AssemblyInfo.cs
├── Settings.Designer.cs
├── Resources.Designer.cs
└── Resources.resx
├── Program.cs
├── elipse.sln
├── elipse.csproj
├── Form1.resx
├── Form1.Designer.cs
├── Form1.cs
└── LTSMC.cs
/软件界面.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/povertyboy/control-three-axis-platform-writing-Leadshine-motion-control-card/HEAD/软件界面.png
--------------------------------------------------------------------------------
/写字效果图.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/povertyboy/control-three-axis-platform-writing-Leadshine-motion-control-card/HEAD/写字效果图.png
--------------------------------------------------------------------------------
/bin/Debug/LTSMC.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/povertyboy/control-three-axis-platform-writing-Leadshine-motion-control-card/HEAD/bin/Debug/LTSMC.dll
--------------------------------------------------------------------------------
/bin/Debug/elipse.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/povertyboy/control-three-axis-platform-writing-Leadshine-motion-control-card/HEAD/bin/Debug/elipse.exe
--------------------------------------------------------------------------------
/bin/Debug/elipse.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/povertyboy/control-three-axis-platform-writing-Leadshine-motion-control-card/HEAD/bin/Debug/elipse.pdb
--------------------------------------------------------------------------------
/obj/Debug/elipse.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/povertyboy/control-three-axis-platform-writing-Leadshine-motion-control-card/HEAD/obj/Debug/elipse.exe
--------------------------------------------------------------------------------
/obj/Debug/elipse.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/povertyboy/control-three-axis-platform-writing-Leadshine-motion-control-card/HEAD/obj/Debug/elipse.pdb
--------------------------------------------------------------------------------
/bin/x64/Debug/LTSMC.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/povertyboy/control-three-axis-platform-writing-Leadshine-motion-control-card/HEAD/bin/x64/Debug/LTSMC.dll
--------------------------------------------------------------------------------
/bin/x64/Debug/elipse.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/povertyboy/control-three-axis-platform-writing-Leadshine-motion-control-card/HEAD/bin/x64/Debug/elipse.exe
--------------------------------------------------------------------------------
/bin/x64/Debug/elipse.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/povertyboy/control-three-axis-platform-writing-Leadshine-motion-control-card/HEAD/bin/x64/Debug/elipse.pdb
--------------------------------------------------------------------------------
/obj/x64/Debug/elipse.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/povertyboy/control-three-axis-platform-writing-Leadshine-motion-control-card/HEAD/obj/x64/Debug/elipse.exe
--------------------------------------------------------------------------------
/obj/x64/Debug/elipse.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/povertyboy/control-three-axis-platform-writing-Leadshine-motion-control-card/HEAD/obj/x64/Debug/elipse.pdb
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # control-three-axis-platform-writing-Leadshine-motion-control-card
2 | C#/雷赛运动控制卡/三轴平台写字/VS2019
3 |
4 | 并可以用鼠标当笔在框里画画,三轴平台会同时运行
5 |
6 | 附软件界面和写字效果图
7 |
--------------------------------------------------------------------------------
/obj/Debug/elipse.Form1.resources:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/povertyboy/control-three-axis-platform-writing-Leadshine-motion-control-card/HEAD/obj/Debug/elipse.Form1.resources
--------------------------------------------------------------------------------
/obj/x64/Debug/elipse.Form1.resources:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/povertyboy/control-three-axis-platform-writing-Leadshine-motion-control-card/HEAD/obj/x64/Debug/elipse.Form1.resources
--------------------------------------------------------------------------------
/obj/Debug/elipse.Properties.Resources.resources:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/povertyboy/control-three-axis-platform-writing-Leadshine-motion-control-card/HEAD/obj/Debug/elipse.Properties.Resources.resources
--------------------------------------------------------------------------------
/obj/Debug/elipse.csproj.GenerateResource.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/povertyboy/control-three-axis-platform-writing-Leadshine-motion-control-card/HEAD/obj/Debug/elipse.csproj.GenerateResource.cache
--------------------------------------------------------------------------------
/obj/Debug/elipse.csprojAssemblyReference.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/povertyboy/control-three-axis-platform-writing-Leadshine-motion-control-card/HEAD/obj/Debug/elipse.csprojAssemblyReference.cache
--------------------------------------------------------------------------------
/obj/x64/Debug/elipse.csproj.GenerateResource.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/povertyboy/control-three-axis-platform-writing-Leadshine-motion-control-card/HEAD/obj/x64/Debug/elipse.csproj.GenerateResource.cache
--------------------------------------------------------------------------------
/obj/x64/Debug/elipse.csprojAssemblyReference.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/povertyboy/control-three-axis-platform-writing-Leadshine-motion-control-card/HEAD/obj/x64/Debug/elipse.csprojAssemblyReference.cache
--------------------------------------------------------------------------------
/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/obj/Debug/DesignTimeResolveAssemblyReferences.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/povertyboy/control-three-axis-platform-writing-Leadshine-motion-control-card/HEAD/obj/Debug/DesignTimeResolveAssemblyReferences.cache
--------------------------------------------------------------------------------
/obj/x64/Debug/elipse.Properties.Resources.resources:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/povertyboy/control-three-axis-platform-writing-Leadshine-motion-control-card/HEAD/obj/x64/Debug/elipse.Properties.Resources.resources
--------------------------------------------------------------------------------
/obj/x64/Debug/DesignTimeResolveAssemblyReferences.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/povertyboy/control-three-axis-platform-writing-Leadshine-motion-control-card/HEAD/obj/x64/Debug/DesignTimeResolveAssemblyReferences.cache
--------------------------------------------------------------------------------
/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/povertyboy/control-three-axis-platform-writing-Leadshine-motion-control-card/HEAD/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
--------------------------------------------------------------------------------
/bin/Debug/elipse.exe.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/obj/x64/Debug/DesignTimeResolveAssemblyReferencesInput.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/povertyboy/control-three-axis-platform-writing-Leadshine-motion-control-card/HEAD/obj/x64/Debug/DesignTimeResolveAssemblyReferencesInput.cache
--------------------------------------------------------------------------------
/bin/x64/Debug/elipse.exe.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using System.Windows.Forms;
6 |
7 | namespace elipse
8 | {
9 | static class Program
10 | {
11 | ///
12 | /// 应用程序的主入口点。
13 | ///
14 | [STAThread]
15 | static void Main()
16 | {
17 | Application.EnableVisualStyles();
18 | Application.SetCompatibleTextRenderingDefault(false);
19 | Application.Run(new Form1());
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/obj/Debug/elipse.csproj.FileListAbsolute.txt:
--------------------------------------------------------------------------------
1 | G:\file\21年11月\Leadshine\elipse\elipse\obj\Debug\elipse.csprojAssemblyReference.cache
2 | G:\file\21年11月\Leadshine\elipse\elipse\obj\Debug\elipse.Form1.resources
3 | G:\file\21年11月\Leadshine\elipse\elipse\obj\Debug\elipse.Properties.Resources.resources
4 | G:\file\21年11月\Leadshine\elipse\elipse\obj\Debug\elipse.csproj.GenerateResource.cache
5 | G:\file\21年11月\Leadshine\elipse\elipse\bin\Debug\elipse.exe.config
6 | G:\file\21年11月\Leadshine\elipse\elipse\bin\Debug\elipse.exe
7 | G:\file\21年11月\Leadshine\elipse\elipse\bin\Debug\elipse.pdb
8 | G:\file\21年11月\Leadshine\elipse\elipse\obj\Debug\elipse.exe
9 | G:\file\21年11月\Leadshine\elipse\elipse\obj\Debug\elipse.pdb
10 |
--------------------------------------------------------------------------------
/obj/x64/Debug/elipse.csproj.FileListAbsolute.txt:
--------------------------------------------------------------------------------
1 | G:\file\21年11月\Leadshine\elipse\elipse\bin\x64\Debug\elipse.exe.config
2 | G:\file\21年11月\Leadshine\elipse\elipse\bin\x64\Debug\elipse.exe
3 | G:\file\21年11月\Leadshine\elipse\elipse\bin\x64\Debug\elipse.pdb
4 | G:\file\21年11月\Leadshine\elipse\elipse\obj\x64\Debug\elipse.csprojAssemblyReference.cache
5 | G:\file\21年11月\Leadshine\elipse\elipse\obj\x64\Debug\elipse.Form1.resources
6 | G:\file\21年11月\Leadshine\elipse\elipse\obj\x64\Debug\elipse.Properties.Resources.resources
7 | G:\file\21年11月\Leadshine\elipse\elipse\obj\x64\Debug\elipse.csproj.GenerateResource.cache
8 | G:\file\21年11月\Leadshine\elipse\elipse\obj\x64\Debug\elipse.exe
9 | G:\file\21年11月\Leadshine\elipse\elipse\obj\x64\Debug\elipse.pdb
10 |
--------------------------------------------------------------------------------
/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的一般信息由以下
6 | // 控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("elipse")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("elipse")]
13 | [assembly: AssemblyCopyright("Copyright © 2021")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 会使此程序集中的类型
18 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
19 | //请将此类型的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("f7606a35-25cd-48bd-9c98-dc30f031613e")]
24 |
25 | // 程序集的版本信息由下列四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 生成号
30 | // 修订号
31 | //
32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
33 | //通过使用 "*",如下所示:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace elipse.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/elipse.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.29613.14
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "elipse", "elipse.csproj", "{F7606A35-25CD-48BD-9C98-DC30F031613E}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Debug|x64 = Debug|x64
12 | Release|Any CPU = Release|Any CPU
13 | Release|x64 = Release|x64
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {F7606A35-25CD-48BD-9C98-DC30F031613E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17 | {F7606A35-25CD-48BD-9C98-DC30F031613E}.Debug|Any CPU.Build.0 = Debug|Any CPU
18 | {F7606A35-25CD-48BD-9C98-DC30F031613E}.Debug|x64.ActiveCfg = Debug|x64
19 | {F7606A35-25CD-48BD-9C98-DC30F031613E}.Debug|x64.Build.0 = Debug|x64
20 | {F7606A35-25CD-48BD-9C98-DC30F031613E}.Release|Any CPU.ActiveCfg = Release|Any CPU
21 | {F7606A35-25CD-48BD-9C98-DC30F031613E}.Release|Any CPU.Build.0 = Release|Any CPU
22 | {F7606A35-25CD-48BD-9C98-DC30F031613E}.Release|x64.ActiveCfg = Release|x64
23 | {F7606A35-25CD-48BD-9C98-DC30F031613E}.Release|x64.Build.0 = Release|x64
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | GlobalSection(ExtensibilityGlobals) = postSolution
29 | SolutionGuid = {6AD82D57-EDDA-4C89-B868-A0CDFA91C546}
30 | EndGlobalSection
31 | EndGlobal
32 |
--------------------------------------------------------------------------------
/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本: 4.0.30319.42000
5 | //
6 | // 对此文件的更改可能导致不正确的行为,如果
7 | // 重新生成代码,则所做更改将丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace elipse.Properties
12 | {
13 |
14 |
15 | ///
16 | /// 强类型资源类,用于查找本地化字符串等。
17 | ///
18 | // 此类是由 StronglyTypedResourceBuilder
19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
20 | // 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen
21 | // (以 /str 作为命令选项),或重新生成 VS 项目。
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources
26 | {
27 |
28 | private static global::System.Resources.ResourceManager resourceMan;
29 |
30 | private static global::System.Globalization.CultureInfo resourceCulture;
31 |
32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
33 | internal Resources()
34 | {
35 | }
36 |
37 | ///
38 | /// 返回此类使用的缓存 ResourceManager 实例。
39 | ///
40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
41 | internal static global::System.Resources.ResourceManager ResourceManager
42 | {
43 | get
44 | {
45 | if ((resourceMan == null))
46 | {
47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("elipse.Properties.Resources", typeof(Resources).Assembly);
48 | resourceMan = temp;
49 | }
50 | return resourceMan;
51 | }
52 | }
53 |
54 | ///
55 | /// 覆盖当前线程的 CurrentUICulture 属性
56 | /// 使用此强类型的资源类的资源查找。
57 | ///
58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
59 | internal static global::System.Globalization.CultureInfo Culture
60 | {
61 | get
62 | {
63 | return resourceCulture;
64 | }
65 | set
66 | {
67 | resourceCulture = value;
68 | }
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/elipse.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {F7606A35-25CD-48BD-9C98-DC30F031613E}
8 | WinExe
9 | elipse
10 | elipse
11 | v4.7.2
12 | 512
13 | true
14 | true
15 |
16 |
17 | x64
18 | true
19 | full
20 | false
21 | bin\Debug\
22 | DEBUG;TRACE
23 | prompt
24 | 4
25 |
26 |
27 | AnyCPU
28 | pdbonly
29 | true
30 | bin\Release\
31 | TRACE
32 | prompt
33 | 4
34 |
35 |
36 | true
37 | bin\x64\Debug\
38 | DEBUG;TRACE
39 | full
40 | x64
41 | 7.3
42 | prompt
43 | MinimumRecommendedRules.ruleset
44 | true
45 |
46 |
47 | bin\x64\Release\
48 | TRACE
49 | true
50 | pdbonly
51 | x64
52 | 7.3
53 | prompt
54 | MinimumRecommendedRules.ruleset
55 | true
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 | Form
73 |
74 |
75 | Form1.cs
76 |
77 |
78 |
79 |
80 |
81 | Form1.cs
82 |
83 |
84 | ResXFileCodeGenerator
85 | Resources.Designer.cs
86 | Designer
87 |
88 |
89 | True
90 | Resources.resx
91 |
92 |
93 | SettingsSingleFileGenerator
94 | Settings.Designer.cs
95 |
96 |
97 | True
98 | Settings.settings
99 | True
100 |
101 |
102 |
103 |
104 |
105 |
106 |
--------------------------------------------------------------------------------
/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/Form1.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | 17, 17
122 |
123 |
124 | 122, 17
125 |
126 |
127 | 261, 15
128 |
129 |
130 | 434, 15
131 |
132 |
133 | 627, 15
134 |
135 |
136 | 96
137 |
138 |
--------------------------------------------------------------------------------
/Form1.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace elipse
2 | {
3 | partial class Form1
4 | {
5 | ///
6 | /// 必需的设计器变量。
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// 清理所有正在使用的资源。
12 | ///
13 | /// 如果应释放托管资源,为 true;否则为 false。
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows 窗体设计器生成的代码
24 |
25 | ///
26 | /// 设计器支持所需的方法 - 不要修改
27 | /// 使用代码编辑器修改此方法的内容。
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.components = new System.ComponentModel.Container();
32 | this.drawElipse = new System.Windows.Forms.Button();
33 | this.machiningCAM = new System.Windows.Forms.Button();
34 | this.timer1 = new System.Windows.Forms.Timer(this.components);
35 | this.textBoxXPos = new System.Windows.Forms.TextBox();
36 | this.textBoxYPos = new System.Windows.Forms.TextBox();
37 | this.pictureBox1 = new System.Windows.Forms.PictureBox();
38 | this.pictureGroupBox = new System.Windows.Forms.GroupBox();
39 | this.pictureBox2 = new System.Windows.Forms.PictureBox();
40 | this.xMovPostive = new System.Windows.Forms.Button();
41 | this.xMovNegative = new System.Windows.Forms.Button();
42 | this.constantSpeedMovementGroupBox = new System.Windows.Forms.GroupBox();
43 | this.zMovNegative = new System.Windows.Forms.Button();
44 | this.zMovPostive = new System.Windows.Forms.Button();
45 | this.yMovNegative = new System.Windows.Forms.Button();
46 | this.yMovPostive = new System.Windows.Forms.Button();
47 | this.home = new System.Windows.Forms.Button();
48 | this.stop = new System.Windows.Forms.Button();
49 | this.textBoxSpeed = new System.Windows.Forms.TextBox();
50 | this.speedChange = new System.Windows.Forms.TrackBar();
51 | this.textBoxZPos = new System.Windows.Forms.TextBox();
52 | this.timerSpeed = new System.Windows.Forms.Timer(this.components);
53 | this.pointMoventGroupBox = new System.Windows.Forms.GroupBox();
54 | this.zMovRelative = new System.Windows.Forms.Button();
55 | this.yMovRelative = new System.Windows.Forms.Button();
56 | this.xMovRelative = new System.Windows.Forms.Button();
57 | this.textBoxPos = new System.Windows.Forms.TextBox();
58 | this.absolutePositionGroupBox = new System.Windows.Forms.GroupBox();
59 | this.drawButton = new System.Windows.Forms.Button();
60 | this.doDrawButton = new System.Windows.Forms.Button();
61 | this.writeGroupBox = new System.Windows.Forms.GroupBox();
62 | this.textBoxMovY = new System.Windows.Forms.TextBox();
63 | this.textBoxMovX = new System.Windows.Forms.TextBox();
64 | this.textBoxHight = new System.Windows.Forms.TextBox();
65 | this.textBoxWidth = new System.Windows.Forms.TextBox();
66 | this.write = new System.Windows.Forms.Button();
67 | this.timerDrawTrack = new System.Windows.Forms.Timer(this.components);
68 | this.timerSpeedCurve = new System.Windows.Forms.Timer(this.components);
69 | this.timerButtonClick = new System.Windows.Forms.Timer(this.components);
70 | this.textBoxLaser = new System.Windows.Forms.TextBox();
71 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
72 | this.pictureGroupBox.SuspendLayout();
73 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
74 | this.constantSpeedMovementGroupBox.SuspendLayout();
75 | ((System.ComponentModel.ISupportInitialize)(this.speedChange)).BeginInit();
76 | this.pointMoventGroupBox.SuspendLayout();
77 | this.absolutePositionGroupBox.SuspendLayout();
78 | this.writeGroupBox.SuspendLayout();
79 | this.SuspendLayout();
80 | //
81 | // drawElipse
82 | //
83 | this.drawElipse.Location = new System.Drawing.Point(11, 17);
84 | this.drawElipse.Name = "drawElipse";
85 | this.drawElipse.Size = new System.Drawing.Size(128, 23);
86 | this.drawElipse.TabIndex = 1;
87 | this.drawElipse.Text = "drawElipse";
88 | this.drawElipse.UseVisualStyleBackColor = true;
89 | this.drawElipse.Click += new System.EventHandler(this.drawElipse_Click);
90 | //
91 | // machiningCAM
92 | //
93 | this.machiningCAM.Location = new System.Drawing.Point(13, 46);
94 | this.machiningCAM.Name = "machiningCAM";
95 | this.machiningCAM.Size = new System.Drawing.Size(128, 23);
96 | this.machiningCAM.TabIndex = 2;
97 | this.machiningCAM.Text = "machiningCAM";
98 | this.machiningCAM.UseVisualStyleBackColor = true;
99 | this.machiningCAM.Click += new System.EventHandler(this.machiningCAM_Click);
100 | //
101 | // timer1
102 | //
103 | this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
104 | //
105 | // textBoxXPos
106 | //
107 | this.textBoxXPos.Location = new System.Drawing.Point(6, 24);
108 | this.textBoxXPos.Name = "textBoxXPos";
109 | this.textBoxXPos.Size = new System.Drawing.Size(64, 25);
110 | this.textBoxXPos.TabIndex = 3;
111 | this.textBoxXPos.Text = "X:";
112 | //
113 | // textBoxYPos
114 | //
115 | this.textBoxYPos.Location = new System.Drawing.Point(76, 24);
116 | this.textBoxYPos.Name = "textBoxYPos";
117 | this.textBoxYPos.Size = new System.Drawing.Size(64, 25);
118 | this.textBoxYPos.TabIndex = 4;
119 | this.textBoxYPos.Text = "Y:";
120 | //
121 | // pictureBox1
122 | //
123 | this.pictureBox1.Location = new System.Drawing.Point(16, 24);
124 | this.pictureBox1.Name = "pictureBox1";
125 | this.pictureBox1.Size = new System.Drawing.Size(400, 400);
126 | this.pictureBox1.TabIndex = 0;
127 | this.pictureBox1.TabStop = false;
128 | this.pictureBox1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseDown);
129 | this.pictureBox1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseMove);
130 | this.pictureBox1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseUp);
131 | //
132 | // pictureGroupBox
133 | //
134 | this.pictureGroupBox.Controls.Add(this.pictureBox2);
135 | this.pictureGroupBox.Controls.Add(this.pictureBox1);
136 | this.pictureGroupBox.Location = new System.Drawing.Point(380, 12);
137 | this.pictureGroupBox.Name = "pictureGroupBox";
138 | this.pictureGroupBox.Size = new System.Drawing.Size(509, 506);
139 | this.pictureGroupBox.TabIndex = 5;
140 | this.pictureGroupBox.TabStop = false;
141 | this.pictureGroupBox.Text = "pictureBox";
142 | //
143 | // pictureBox2
144 | //
145 | this.pictureBox2.Location = new System.Drawing.Point(16, 430);
146 | this.pictureBox2.Name = "pictureBox2";
147 | this.pictureBox2.Size = new System.Drawing.Size(400, 64);
148 | this.pictureBox2.TabIndex = 1;
149 | this.pictureBox2.TabStop = false;
150 | //
151 | // xMovPostive
152 | //
153 | this.xMovPostive.Location = new System.Drawing.Point(23, 51);
154 | this.xMovPostive.Name = "xMovPostive";
155 | this.xMovPostive.Size = new System.Drawing.Size(33, 23);
156 | this.xMovPostive.TabIndex = 6;
157 | this.xMovPostive.Text = "X+";
158 | this.xMovPostive.UseVisualStyleBackColor = true;
159 | this.xMovPostive.MouseDown += new System.Windows.Forms.MouseEventHandler(this.xMovPostive_MouseDown);
160 | this.xMovPostive.MouseUp += new System.Windows.Forms.MouseEventHandler(this.xMovPostive_MouseUp);
161 | //
162 | // xMovNegative
163 | //
164 | this.xMovNegative.Location = new System.Drawing.Point(86, 51);
165 | this.xMovNegative.Name = "xMovNegative";
166 | this.xMovNegative.Size = new System.Drawing.Size(33, 23);
167 | this.xMovNegative.TabIndex = 7;
168 | this.xMovNegative.Text = "X-";
169 | this.xMovNegative.UseVisualStyleBackColor = true;
170 | this.xMovNegative.MouseDown += new System.Windows.Forms.MouseEventHandler(this.xMovNegative_MouseDown);
171 | this.xMovNegative.MouseUp += new System.Windows.Forms.MouseEventHandler(this.xMovNegative_MouseUp);
172 | //
173 | // constantSpeedMovementGroupBox
174 | //
175 | this.constantSpeedMovementGroupBox.Controls.Add(this.zMovNegative);
176 | this.constantSpeedMovementGroupBox.Controls.Add(this.zMovPostive);
177 | this.constantSpeedMovementGroupBox.Controls.Add(this.yMovNegative);
178 | this.constantSpeedMovementGroupBox.Controls.Add(this.yMovPostive);
179 | this.constantSpeedMovementGroupBox.Controls.Add(this.xMovPostive);
180 | this.constantSpeedMovementGroupBox.Controls.Add(this.xMovNegative);
181 | this.constantSpeedMovementGroupBox.Location = new System.Drawing.Point(10, 231);
182 | this.constantSpeedMovementGroupBox.Name = "constantSpeedMovementGroupBox";
183 | this.constantSpeedMovementGroupBox.RightToLeft = System.Windows.Forms.RightToLeft.No;
184 | this.constantSpeedMovementGroupBox.Size = new System.Drawing.Size(286, 128);
185 | this.constantSpeedMovementGroupBox.TabIndex = 8;
186 | this.constantSpeedMovementGroupBox.TabStop = false;
187 | this.constantSpeedMovementGroupBox.Text = "constantSpeedMovementBox";
188 | //
189 | // zMovNegative
190 | //
191 | this.zMovNegative.Location = new System.Drawing.Point(121, 80);
192 | this.zMovNegative.Name = "zMovNegative";
193 | this.zMovNegative.Size = new System.Drawing.Size(33, 23);
194 | this.zMovNegative.TabIndex = 11;
195 | this.zMovNegative.Text = "Z-";
196 | this.zMovNegative.UseVisualStyleBackColor = true;
197 | this.zMovNegative.MouseDown += new System.Windows.Forms.MouseEventHandler(this.zMovNegative_MouseDown);
198 | this.zMovNegative.MouseUp += new System.Windows.Forms.MouseEventHandler(this.zMovNegative_MouseUp);
199 | //
200 | // zMovPostive
201 | //
202 | this.zMovPostive.Location = new System.Drawing.Point(121, 24);
203 | this.zMovPostive.Name = "zMovPostive";
204 | this.zMovPostive.Size = new System.Drawing.Size(33, 23);
205 | this.zMovPostive.TabIndex = 10;
206 | this.zMovPostive.Text = "Z+";
207 | this.zMovPostive.UseVisualStyleBackColor = true;
208 | this.zMovPostive.MouseDown += new System.Windows.Forms.MouseEventHandler(this.zMovPostive_MouseDown);
209 | this.zMovPostive.MouseUp += new System.Windows.Forms.MouseEventHandler(this.zMovPostive_MouseUp);
210 | //
211 | // yMovNegative
212 | //
213 | this.yMovNegative.Location = new System.Drawing.Point(53, 24);
214 | this.yMovNegative.Name = "yMovNegative";
215 | this.yMovNegative.Size = new System.Drawing.Size(33, 23);
216 | this.yMovNegative.TabIndex = 9;
217 | this.yMovNegative.Text = "Y-";
218 | this.yMovNegative.UseVisualStyleBackColor = true;
219 | this.yMovNegative.MouseDown += new System.Windows.Forms.MouseEventHandler(this.yMovNegative_MouseDown);
220 | this.yMovNegative.MouseUp += new System.Windows.Forms.MouseEventHandler(this.yMovNegative_MouseUp);
221 | //
222 | // yMovPostive
223 | //
224 | this.yMovPostive.Location = new System.Drawing.Point(53, 80);
225 | this.yMovPostive.Name = "yMovPostive";
226 | this.yMovPostive.Size = new System.Drawing.Size(33, 23);
227 | this.yMovPostive.TabIndex = 8;
228 | this.yMovPostive.Text = "Y+";
229 | this.yMovPostive.UseVisualStyleBackColor = true;
230 | this.yMovPostive.MouseDown += new System.Windows.Forms.MouseEventHandler(this.yMovPostive_MouseDown);
231 | this.yMovPostive.MouseUp += new System.Windows.Forms.MouseEventHandler(this.yMovPostive_MouseUp);
232 | //
233 | // home
234 | //
235 | this.home.Location = new System.Drawing.Point(153, 115);
236 | this.home.Name = "home";
237 | this.home.Size = new System.Drawing.Size(65, 23);
238 | this.home.TabIndex = 15;
239 | this.home.Text = "HOME";
240 | this.home.UseVisualStyleBackColor = true;
241 | this.home.Click += new System.EventHandler(this.home_Click);
242 | //
243 | // stop
244 | //
245 | this.stop.ForeColor = System.Drawing.Color.Blue;
246 | this.stop.Location = new System.Drawing.Point(153, 86);
247 | this.stop.Name = "stop";
248 | this.stop.Size = new System.Drawing.Size(65, 23);
249 | this.stop.TabIndex = 14;
250 | this.stop.Text = "STOP";
251 | this.stop.UseVisualStyleBackColor = true;
252 | this.stop.Click += new System.EventHandler(this.stop_Click);
253 | //
254 | // textBoxSpeed
255 | //
256 | this.textBoxSpeed.Location = new System.Drawing.Point(13, 113);
257 | this.textBoxSpeed.Name = "textBoxSpeed";
258 | this.textBoxSpeed.Size = new System.Drawing.Size(126, 25);
259 | this.textBoxSpeed.TabIndex = 13;
260 | this.textBoxSpeed.Text = "SPEED (mm/s)";
261 | //
262 | // speedChange
263 | //
264 | this.speedChange.LargeChange = 15;
265 | this.speedChange.Location = new System.Drawing.Point(11, 144);
266 | this.speedChange.Maximum = 15;
267 | this.speedChange.Minimum = 1;
268 | this.speedChange.Name = "speedChange";
269 | this.speedChange.Size = new System.Drawing.Size(187, 56);
270 | this.speedChange.SmallChange = 0;
271 | this.speedChange.TabIndex = 12;
272 | this.speedChange.Value = 10;
273 | this.speedChange.Scroll += new System.EventHandler(this.speedChange_Scroll);
274 | //
275 | // textBoxZPos
276 | //
277 | this.textBoxZPos.Location = new System.Drawing.Point(146, 24);
278 | this.textBoxZPos.Name = "textBoxZPos";
279 | this.textBoxZPos.Size = new System.Drawing.Size(64, 25);
280 | this.textBoxZPos.TabIndex = 9;
281 | this.textBoxZPos.Text = "Z:";
282 | //
283 | // timerSpeed
284 | //
285 | this.timerSpeed.Interval = 20;
286 | this.timerSpeed.Tick += new System.EventHandler(this.timerSpeed_Tick);
287 | //
288 | // pointMoventGroupBox
289 | //
290 | this.pointMoventGroupBox.Controls.Add(this.zMovRelative);
291 | this.pointMoventGroupBox.Controls.Add(this.yMovRelative);
292 | this.pointMoventGroupBox.Controls.Add(this.xMovRelative);
293 | this.pointMoventGroupBox.Controls.Add(this.textBoxPos);
294 | this.pointMoventGroupBox.Location = new System.Drawing.Point(11, 379);
295 | this.pointMoventGroupBox.Name = "pointMoventGroupBox";
296 | this.pointMoventGroupBox.Size = new System.Drawing.Size(285, 139);
297 | this.pointMoventGroupBox.TabIndex = 10;
298 | this.pointMoventGroupBox.TabStop = false;
299 | this.pointMoventGroupBox.Text = "pointMoventBox";
300 | //
301 | // zMovRelative
302 | //
303 | this.zMovRelative.Location = new System.Drawing.Point(187, 84);
304 | this.zMovRelative.Name = "zMovRelative";
305 | this.zMovRelative.Size = new System.Drawing.Size(33, 23);
306 | this.zMovRelative.TabIndex = 18;
307 | this.zMovRelative.Text = "Z";
308 | this.zMovRelative.UseVisualStyleBackColor = true;
309 | this.zMovRelative.Click += new System.EventHandler(this.zMovRelative_Click);
310 | //
311 | // yMovRelative
312 | //
313 | this.yMovRelative.Location = new System.Drawing.Point(187, 55);
314 | this.yMovRelative.Name = "yMovRelative";
315 | this.yMovRelative.Size = new System.Drawing.Size(33, 23);
316 | this.yMovRelative.TabIndex = 17;
317 | this.yMovRelative.Text = "Y";
318 | this.yMovRelative.UseVisualStyleBackColor = true;
319 | this.yMovRelative.Click += new System.EventHandler(this.yMovRelative_Click);
320 | //
321 | // xMovRelative
322 | //
323 | this.xMovRelative.Location = new System.Drawing.Point(187, 26);
324 | this.xMovRelative.Name = "xMovRelative";
325 | this.xMovRelative.Size = new System.Drawing.Size(33, 23);
326 | this.xMovRelative.TabIndex = 16;
327 | this.xMovRelative.Text = "X";
328 | this.xMovRelative.UseVisualStyleBackColor = true;
329 | this.xMovRelative.Click += new System.EventHandler(this.xMovRelative_Click);
330 | //
331 | // textBoxPos
332 | //
333 | this.textBoxPos.Location = new System.Drawing.Point(27, 24);
334 | this.textBoxPos.Name = "textBoxPos";
335 | this.textBoxPos.Size = new System.Drawing.Size(126, 25);
336 | this.textBoxPos.TabIndex = 14;
337 | this.textBoxPos.Text = "POS (mm)";
338 | //
339 | // absolutePositionGroupBox
340 | //
341 | this.absolutePositionGroupBox.Controls.Add(this.textBoxXPos);
342 | this.absolutePositionGroupBox.Controls.Add(this.textBoxYPos);
343 | this.absolutePositionGroupBox.Controls.Add(this.textBoxZPos);
344 | this.absolutePositionGroupBox.Location = new System.Drawing.Point(153, 12);
345 | this.absolutePositionGroupBox.Name = "absolutePositionGroupBox";
346 | this.absolutePositionGroupBox.Size = new System.Drawing.Size(221, 78);
347 | this.absolutePositionGroupBox.TabIndex = 11;
348 | this.absolutePositionGroupBox.TabStop = false;
349 | this.absolutePositionGroupBox.Text = "absolutePositionBox";
350 | //
351 | // drawButton
352 | //
353 | this.drawButton.Location = new System.Drawing.Point(11, 75);
354 | this.drawButton.Name = "drawButton";
355 | this.drawButton.Size = new System.Drawing.Size(65, 23);
356 | this.drawButton.TabIndex = 16;
357 | this.drawButton.Text = "DRAW";
358 | this.drawButton.UseVisualStyleBackColor = true;
359 | this.drawButton.Click += new System.EventHandler(this.drawButton_Click);
360 | //
361 | // doDrawButton
362 | //
363 | this.doDrawButton.Location = new System.Drawing.Point(82, 75);
364 | this.doDrawButton.Name = "doDrawButton";
365 | this.doDrawButton.Size = new System.Drawing.Size(65, 23);
366 | this.doDrawButton.TabIndex = 17;
367 | this.doDrawButton.Text = "DO";
368 | this.doDrawButton.UseVisualStyleBackColor = true;
369 | this.doDrawButton.Click += new System.EventHandler(this.doDrawButton_Click);
370 | //
371 | // writeGroupBox
372 | //
373 | this.writeGroupBox.Controls.Add(this.textBoxMovY);
374 | this.writeGroupBox.Controls.Add(this.textBoxMovX);
375 | this.writeGroupBox.Controls.Add(this.textBoxHight);
376 | this.writeGroupBox.Controls.Add(this.textBoxWidth);
377 | this.writeGroupBox.Controls.Add(this.write);
378 | this.writeGroupBox.Location = new System.Drawing.Point(229, 96);
379 | this.writeGroupBox.Name = "writeGroupBox";
380 | this.writeGroupBox.Size = new System.Drawing.Size(145, 129);
381 | this.writeGroupBox.TabIndex = 18;
382 | this.writeGroupBox.TabStop = false;
383 | this.writeGroupBox.Text = "writeBox";
384 | //
385 | // textBoxMovY
386 | //
387 | this.textBoxMovY.Location = new System.Drawing.Point(75, 84);
388 | this.textBoxMovY.Name = "textBoxMovY";
389 | this.textBoxMovY.Size = new System.Drawing.Size(64, 25);
390 | this.textBoxMovY.TabIndex = 22;
391 | this.textBoxMovY.Text = "Y:";
392 | //
393 | // textBoxMovX
394 | //
395 | this.textBoxMovX.Location = new System.Drawing.Point(75, 53);
396 | this.textBoxMovX.Name = "textBoxMovX";
397 | this.textBoxMovX.Size = new System.Drawing.Size(64, 25);
398 | this.textBoxMovX.TabIndex = 21;
399 | this.textBoxMovX.Text = "X:";
400 | //
401 | // textBoxHight
402 | //
403 | this.textBoxHight.Location = new System.Drawing.Point(7, 84);
404 | this.textBoxHight.Name = "textBoxHight";
405 | this.textBoxHight.Size = new System.Drawing.Size(64, 25);
406 | this.textBoxHight.TabIndex = 10;
407 | this.textBoxHight.Text = "hight:";
408 | //
409 | // textBoxWidth
410 | //
411 | this.textBoxWidth.Location = new System.Drawing.Point(7, 53);
412 | this.textBoxWidth.Name = "textBoxWidth";
413 | this.textBoxWidth.Size = new System.Drawing.Size(64, 25);
414 | this.textBoxWidth.TabIndex = 20;
415 | this.textBoxWidth.Text = "width:";
416 | //
417 | // write
418 | //
419 | this.write.Location = new System.Drawing.Point(6, 24);
420 | this.write.Name = "write";
421 | this.write.Size = new System.Drawing.Size(65, 23);
422 | this.write.TabIndex = 19;
423 | this.write.Text = "WRITE";
424 | this.write.UseVisualStyleBackColor = true;
425 | this.write.Click += new System.EventHandler(this.write_Click);
426 | //
427 | // timerDrawTrack
428 | //
429 | this.timerDrawTrack.Interval = 20;
430 | this.timerDrawTrack.Tick += new System.EventHandler(this.timerDrawTrack_Tick);
431 | //
432 | // timerSpeedCurve
433 | //
434 | this.timerSpeedCurve.Interval = 10;
435 | this.timerSpeedCurve.Tick += new System.EventHandler(this.timerSpeedCurve_Tick);
436 | //
437 | // timerButtonClick
438 | //
439 | this.timerButtonClick.Enabled = true;
440 | this.timerButtonClick.Interval = 10;
441 | this.timerButtonClick.Tick += new System.EventHandler(this.timerButtonClick_Tick);
442 | //
443 | // textBoxLaser
444 | //
445 | this.textBoxLaser.Location = new System.Drawing.Point(13, 200);
446 | this.textBoxLaser.Name = "textBoxLaser";
447 | this.textBoxLaser.Size = new System.Drawing.Size(116, 25);
448 | this.textBoxLaser.TabIndex = 19;
449 | this.textBoxLaser.Text = "Laser: CLOSE";
450 | this.textBoxLaser.Click += new System.EventHandler(this.textBoxLaser_Click);
451 | //
452 | // Form1
453 | //
454 | this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
455 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
456 | this.ClientSize = new System.Drawing.Size(1018, 551);
457 | this.Controls.Add(this.textBoxLaser);
458 | this.Controls.Add(this.writeGroupBox);
459 | this.Controls.Add(this.doDrawButton);
460 | this.Controls.Add(this.drawButton);
461 | this.Controls.Add(this.home);
462 | this.Controls.Add(this.absolutePositionGroupBox);
463 | this.Controls.Add(this.stop);
464 | this.Controls.Add(this.pointMoventGroupBox);
465 | this.Controls.Add(this.textBoxSpeed);
466 | this.Controls.Add(this.constantSpeedMovementGroupBox);
467 | this.Controls.Add(this.speedChange);
468 | this.Controls.Add(this.pictureGroupBox);
469 | this.Controls.Add(this.machiningCAM);
470 | this.Controls.Add(this.drawElipse);
471 | this.Name = "Form1";
472 | this.Text = "Form1";
473 | this.Load += new System.EventHandler(this.Form1_Load);
474 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
475 | this.pictureGroupBox.ResumeLayout(false);
476 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
477 | this.constantSpeedMovementGroupBox.ResumeLayout(false);
478 | ((System.ComponentModel.ISupportInitialize)(this.speedChange)).EndInit();
479 | this.pointMoventGroupBox.ResumeLayout(false);
480 | this.pointMoventGroupBox.PerformLayout();
481 | this.absolutePositionGroupBox.ResumeLayout(false);
482 | this.absolutePositionGroupBox.PerformLayout();
483 | this.writeGroupBox.ResumeLayout(false);
484 | this.writeGroupBox.PerformLayout();
485 | this.ResumeLayout(false);
486 | this.PerformLayout();
487 |
488 | }
489 |
490 | #endregion
491 | private System.Windows.Forms.Button drawElipse;
492 | private System.Windows.Forms.Button machiningCAM;
493 | private System.Windows.Forms.Timer timer1;
494 | private System.Windows.Forms.TextBox textBoxXPos;
495 | private System.Windows.Forms.TextBox textBoxYPos;
496 | private System.Windows.Forms.PictureBox pictureBox1;
497 | private System.Windows.Forms.GroupBox pictureGroupBox;
498 | private System.Windows.Forms.Button xMovPostive;
499 | private System.Windows.Forms.Button xMovNegative;
500 | private System.Windows.Forms.GroupBox constantSpeedMovementGroupBox;
501 | private System.Windows.Forms.Button zMovNegative;
502 | private System.Windows.Forms.Button zMovPostive;
503 | private System.Windows.Forms.Button yMovNegative;
504 | private System.Windows.Forms.Button yMovPostive;
505 | private System.Windows.Forms.TrackBar speedChange;
506 | private System.Windows.Forms.TextBox textBoxSpeed;
507 | private System.Windows.Forms.Button stop;
508 | private System.Windows.Forms.Button home;
509 | private System.Windows.Forms.TextBox textBoxZPos;
510 | private System.Windows.Forms.Timer timerSpeed;
511 | private System.Windows.Forms.GroupBox pointMoventGroupBox;
512 | private System.Windows.Forms.TextBox textBoxPos;
513 | private System.Windows.Forms.Button zMovRelative;
514 | private System.Windows.Forms.Button yMovRelative;
515 | private System.Windows.Forms.Button xMovRelative;
516 | private System.Windows.Forms.GroupBox absolutePositionGroupBox;
517 | private System.Windows.Forms.Button drawButton;
518 | private System.Windows.Forms.Button doDrawButton;
519 | private System.Windows.Forms.GroupBox writeGroupBox;
520 | private System.Windows.Forms.Button write;
521 | private System.Windows.Forms.Timer timerDrawTrack;
522 | private System.Windows.Forms.PictureBox pictureBox2;
523 | private System.Windows.Forms.Timer timerSpeedCurve;
524 | private System.Windows.Forms.TextBox textBoxHight;
525 | private System.Windows.Forms.TextBox textBoxWidth;
526 | private System.Windows.Forms.TextBox textBoxMovY;
527 | private System.Windows.Forms.TextBox textBoxMovX;
528 | private System.Windows.Forms.Timer timerButtonClick;
529 | private System.Windows.Forms.TextBox textBoxLaser;
530 | }
531 | }
532 |
533 |
--------------------------------------------------------------------------------
/Form1.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 | using Leadshine;
11 | using System.Threading;
12 |
13 | namespace elipse {
14 | public partial class Form1 : Form {
15 |
16 | int x, x0, x1, x2, x3, x4;
17 | int y, y0, y1, y2, y3, y4;
18 | int width = 0, height = 0;
19 | int countLines = 0;
20 | int[] xPos = new int[30];
21 | int[] yPos = new int[30];
22 | ushort mouseDown = 0;//画笔标识
23 | ushort penUpFlag = 0;
24 |
25 |
26 | int Min_Vel = 1;
27 | int Max_Vel = 15;
28 | int speed = 10;
29 | readonly ushort CardNo = 0;
30 | readonly ushort[] axis = { 0, 1, 2 };
31 | readonly double Tacc = 0.1; //加速时间
32 | readonly double Tdec = 0.1; //减速时间
33 | readonly uint Stop_Vel = 5; //停止速度
34 | readonly double S_para = 1;
35 |
36 |
37 | ushort[] AxirArray = { 0, 1 };
38 | double[] Dist = { 0, 1 };
39 | double θ = 50;
40 |
41 | double tim = 0;
42 |
43 |
44 |
45 | readonly double[] xWordPos1 = { -0.07, 1.82, 1.82, -0.07, -1.94,
46 | -1.94, -0.51, 1.13, 1.13, -0.51,
47 | -1.94, -1.94, 0.79, 2.47, 2.47,
48 | 0.79, -5.52, -7.55, -7.55, -5.52,
49 | -3.09, -3.09, -4.36, -6.34, -6.34,
50 | -4.36, -3.09, -3.09, -4.92, -6.98,
51 | -6.98, -4.92, -0.07 };
52 | readonly double[] xWordPos2 = { 1.60, 0.89, -1.41, -0.80, 1.60, 1.60, 0 };
53 |
54 | readonly double[] yWordPos1 = { 11.49, 11.53, 10.49, 10.53, 10.53,
55 | 7.85, 7.85, 7.90, 6.77, 6.81,
56 | 6.81, 3.53, 3.53, 3.57, 2.49,
57 | 2.53, 2.53, 2.49, 3.57, 3.53,
58 | 3.53, 6.81, 6.81, 6.77, 7.90,
59 | 7.85 ,7.85 ,10.53 ,10.53,10.49,
60 | 11.53 ,11.49 ,11.49 };
61 | readonly double[] yWordPos2 = { 4.60, 3.79, 5.52, 6.34, 4.60, 4.60, 0 };
62 |
63 | //停止函数多线程
64 | private Thread Job1; // 定义线程名
65 | private Thread Job2; // 定义线程名
66 |
67 | bool laserFlag = false;
68 |
69 |
70 |
71 | public Form1 () {
72 | InitializeComponent();
73 | }
74 |
75 |
76 |
77 | private void Form1_Load (object sender, EventArgs e) {
78 | short res = LTSMC.smc_board_init(CardNo, 2, "192.168.5.11", 0);
79 | if (res != 0) {
80 | MessageBox.Show("连接错误!", "出错");
81 | return;
82 | }
83 | //三轴打开并设置脉冲当量
84 | LTSMC.nmcs_set_axis_enable(0, 0);
85 | LTSMC.nmcs_set_axis_enable(0, 1);
86 | LTSMC.nmcs_set_axis_enable(0, 2);
87 | //(设置脉冲当量(控制器号,轴号,脉冲当量)1000脉冲/1mm)
88 | LTSMC.smc_set_equiv(0, 0, 1000);
89 | LTSMC.smc_set_equiv(0, 1, 1000);
90 | LTSMC.smc_set_equiv(0, 2, 1000);
91 |
92 | }
93 |
94 | private void Form1_FormClosed (object sender, FormClosedEventArgs e) {
95 | LTSMC.smc_board_close(0);
96 | }
97 | public void stop_Click (object sender, EventArgs e) {
98 | LTSMC.smc_stop(CardNo, axis[0], 1);
99 | LTSMC.smc_stop(CardNo, axis[1], 1);
100 | LTSMC.smc_stop(CardNo, axis[2], 1);
101 |
102 | Job1.Abort(); // 终止线程
103 | write.Visible = true; // 按键可见
104 | }
105 | private void timerButtonClick_Tick (object sender, EventArgs e) {
106 | if (LTSMC.smc_read_inbit(0, 29) == 0) {
107 | write_Click(sender, e);
108 | }
109 | }
110 | private void motorJob () {
111 | this.PenUp();
112 | while (LTSMC.smc_check_done(0, 2) == 0) { Application.DoEvents(); }
113 |
114 | //赋值速度 把速度曲线设置一下
115 | LTSMC.smc_set_vector_profile_unit(CardNo, 0, Min_Vel, speed, Tacc, Tdec, Stop_Vel);
116 |
117 | //画布大小400,64
118 | Graphics g = pictureBox1.CreateGraphics(); // 创建Graphics对象
119 | g.Clear(Color.White); // 画布清零
120 | Graphics f = pictureBox2.CreateGraphics(); // 创建Graphics对象
121 | f.Clear(Color.White); // 画布清零
122 |
123 | timerDrawTrack.Start();
124 | timerSpeedCurve.Start();
125 |
126 | double ratioX = double.Parse(textBoxWidth.Text) / 9.81; //6.31
127 | double ratioY = double.Parse(textBoxHight.Text) / 9.04; //9.04
128 |
129 | Console.WriteLine(xWordPos2.Length);
130 |
131 | //正常的字
132 | while (LTSMC.smc_check_done(0, 2) == 0) { Application.DoEvents(); }
133 | for (int i = 0; i < xWordPos1.Length; i++) {
134 | Dist[0] = xWordPos1[i] * ratioX + double.Parse(textBoxMovX.Text) + 2.0 * ratioX;
135 | Dist[1] = yWordPos1[i] * ratioY + double.Parse(textBoxMovY.Text) - 2.49 * ratioY;
136 | LTSMC.smc_line_unit(0, 0, 2, AxirArray, Dist, 1);
137 | while (LTSMC.smc_check_done(0, 0) == 0 ||
138 | LTSMC.smc_check_done(0, 1) == 0) {
139 | Application.DoEvents();
140 | }
141 | this.PenDown();
142 | while (LTSMC.smc_check_done(0, 2) == 0) { Application.DoEvents(); }
143 | }
144 | this.PenUp();
145 | while (LTSMC.smc_check_done(0, 2) == 0) {
146 | Application.DoEvents();
147 | }
148 |
149 | while (LTSMC.smc_check_done(0, 2) == 0) { Application.DoEvents(); }
150 | for (int i = 0; i < xWordPos2.Length - 1; i++) {
151 | Dist[0] = xWordPos2[i] * ratioX + double.Parse(textBoxMovX.Text) + 2.0 * ratioX;
152 | Dist[1] = yWordPos2[i] * ratioY + double.Parse(textBoxMovY.Text) - 2.5 * ratioY;
153 | LTSMC.smc_line_unit(0, 0, 2, AxirArray, Dist, 1);
154 | while (LTSMC.smc_check_done(0, 0) == 0 ||
155 | LTSMC.smc_check_done(0, 1) == 0) {
156 | Application.DoEvents();
157 | }
158 | this.PenDown();
159 | while (LTSMC.smc_check_done(0, 2) == 0) { Application.DoEvents(); }
160 | }
161 |
162 | this.PenUp();
163 | while (LTSMC.smc_check_done(0, 2) == 0) { Application.DoEvents(); }
164 |
165 | //旋转的字
166 | while (LTSMC.smc_check_done(0, 2) == 0) { Application.DoEvents(); };
167 | for (int i = 0; i < xWordPos1.Length; i++) {
168 | Dist[0] = (xWordPos1[i] * Math.Cos(θ) - yWordPos1[i] * Math.Sin(θ)) + 130;
169 | Dist[1] = (xWordPos1[i] * Math.Sin(θ) + yWordPos1[i] * Math.Cos(θ)) + 30;
170 | LTSMC.smc_line_unit(0, 0, 2, AxirArray, Dist, 1);
171 | while (LTSMC.smc_check_done(0, 0) == 0 ||
172 | LTSMC.smc_check_done(0, 1) == 0) {
173 | Application.DoEvents();
174 | }
175 | this.PenDown();
176 | while (LTSMC.smc_check_done(0, 2) == 0) { Application.DoEvents(); }
177 | }
178 |
179 | this.PenUp();
180 | while (LTSMC.smc_check_done(0, 2) == 0) { Application.DoEvents(); }
181 |
182 | for (int i = 0; i < xWordPos2.Length-1i++) {
183 | Dist[0] = (xWordPos2[i] * Math.Cos(θ) - yWordPos2[i] * Math.Sin(θ)) + 130;
184 | Dist[1] = (xWordPos2[i] * Math.Sin(θ) + yWordPos2[i] * Math.Cos(θ)) + 30;
185 | LTSMC.smc_line_unit(0, 0, 2, AxirArray, Dist, 1);
186 | while (LTSMC.smc_check_done(0, 0) == 0 ||
187 | LTSMC.smc_check_done(0, 1) == 0) {
188 | Application.DoEvents();
189 | }
190 | this.PenDown();
191 | while (LTSMC.smc_check_done(0, 2) == 0) { Application.DoEvents(); }
192 | }
193 | this.PenUp();
194 | while (LTSMC.smc_check_done(0, 2) == 0) { Application.DoEvents(); }
195 |
196 | //水平偏移变换
197 | while (LTSMC.smc_check_done(0, 2) == 0) { Application.DoEvents(); }
198 | for (int i = 0; i < xWordPos1.Length; i++) {
199 | Dist[0] = xWordPos1[i] * 2 + 20;
200 | Dist[1] = xWordPos1[i] * 2 * 0.7 + yWordPos1[i] * 2 + 30;
201 | LTSMC.smc_line_unit(0, 0, 2, AxirArray, Dist, 1);
202 | while (LTSMC.smc_check_done(0, 0) == 0 ||
203 | LTSMC.smc_check_done(0, 1) == 0) {
204 | Application.DoEvents();
205 | }
206 | this.PenDown();
207 | while (LTSMC.smc_check_done(0, 2) == 0) { Application.DoEvents(); }
208 | }
209 | this.PenUp();
210 | while (LTSMC.smc_check_done(0, 2) == 0) {
211 | Application.DoEvents();
212 | }
213 |
214 | while (LTSMC.smc_check_done(0, 2) == 0) { Application.DoEvents(); }
215 | for (int i = 0; i < xWordPos2.Length - 1; i++) {
216 | Dist[0] = xWordPos2[i] * 2 + 20;
217 | Dist[1] = xWordPos2[i] * 2 * 0.5 + yWordPos2[i] * 2 + 30;
218 | LTSMC.smc_line_unit(0, 0, 2, AxirArray, Dist, 1);
219 | while (LTSMC.smc_check_done(0, 0) == 0 ||
220 | LTSMC.smc_check_done(0, 1) == 0) {
221 | Application.DoEvents();
222 | }
223 | this.PenDown();
224 | while (LTSMC.smc_check_done(0, 2) == 0) { Application.DoEvents(); }
225 | }
226 | this.PenUp();
227 | while (LTSMC.smc_check_done(0, 2) == 0) { Application.DoEvents(); }
228 | timerDrawTrack.Stop();
229 |
230 |
231 | }
232 | private void write_Click (object sender, EventArgs e){
233 | Job1 = new Thread(motorJob);
234 | // 创建线程
235 | Job1.Priority = ThreadPriority.Normal;
236 | // 线程Job1优先级一般
237 | Job1.Start(); // 启动线程
238 | write.Visible = false;// 按键不可见,防止多次启动线程
239 | }
240 |
241 | //激光待补充
242 | private void textBoxLaser_Click (object sender, EventArgs e) {
243 | laserFlag = !laserFlag;
244 | if (laserFlag == true) {
245 | LTSMC.smc_write_outbit(0, 60, 0);
246 | textBoxLaser.Text = "Laser: OPEN";
247 | }
248 | else {
249 | LTSMC.smc_write_outbit(0, 60, 1);
250 | textBoxLaser.Text = "Laser: CLOSE";
251 | }
252 | }
253 |
254 |
255 |
256 |
257 |
258 | //未使用此函数已废
259 | private void Stop () {
260 | this.Invoke((MethodInvoker)delegate {
261 | //this.stop.PerformClick();
262 | });
263 | Thread.Sleep(1); // 延时1ms
264 | //线程测试
265 | //int count1=0;
266 | //for (int i = 0; i < 100000; i++) {
267 | // count1 = count1 + 1;
268 | // this.Invoke((MethodInvoker)delegate
269 | // { this.home.Text = count1.ToString(); });
270 | // // 跨线程操作,在Form1线程上执行指定的委托
271 | // Thread.Sleep(1); // 延时1ms
272 | //}
273 |
274 | }
275 |
276 | //实时显示速度
277 | private void speedChange_Scroll (object sender, EventArgs e) {
278 | speed = speedChange.Value;
279 | textBoxSpeed.Text = "SPEED:" + speedChange.Value.ToString() + " mm/s";
280 | }
281 |
282 | //测试用凸轮
283 | private void drawElipse_Click (object sender, EventArgs e) {
284 | pictureBox1.Size = new Size(400, 400);
285 | Graphics g = pictureBox1.CreateGraphics(); // 创建Graphics对象
286 | g.PageUnit = GraphicsUnit.Pixel; // 以像素为单位
287 | g.PageScale = 0.5f; // 像素与坐标单位的比例,即1个单位为0.5个像素。
288 | g.TranslateTransform(0, 700); // y轴下移 700 ,方向 仍朝下
289 | g.Clear(Color.White); // 画布清零
290 | Pen GreenPen = new Pen(Color.Green);
291 | // 计算P1、P2、P3、P4的坐标
292 | x1 = (int)(300 - 200 * Math.Cos(30.0 * 3.14159 / 180.0));
293 | y1 = (int)(300 + 200 * Math.Sin(30.0 * 3.14159 / 180.0));
294 | x2 = (int)(300 - 120 * Math.Cos(30.0 * 3.14159 / 180.0));
295 | y2 = (int)(500 + 120 * Math.Sin(30.0 * 3.14159 / 180.0));
296 | x3 = (int)(300 + 120 * Math.Cos(30.0 * 3.14159 / 180.0));
297 | y3 = (int)(500 + 120 * Math.Sin(30.0 * 3.14159 / 180.0));
298 | x4 = (int)(300 + 200 * Math.Cos(30.0 * 3.14159 / 180.0));
299 | y4 = (int)(300 + 200 * Math.Sin(30.0 * 3.14159 / 180.0));
300 | // 画直线P1P2和P3P4
301 | g.DrawLine(GreenPen, x1, -1 * y1, x2, -1 * y2);
302 | g.DrawLine(GreenPen, x3, -1 * y3, x4, -1 * y4);
303 | // 画圆弧P2P3
304 | x0 = (int)(300 + 120 * Math.Cos(30 * 3.14159 / 180.0));
305 | y0 = -1 * (int)(500 + 120 * Math.Sin(30 * 3.14159 / 180.0));
306 | for (int i = 31; i < 150; i++) {
307 | x = (int)(300 + 120 * Math.Cos(i * 3.14159 / 180.0));
308 | y = -1 * (int)(500 + 120 * Math.Sin(i * 3.14159 / 180.0));
309 | g.DrawLine(GreenPen, x0, y0, x, y);
310 | x0 = x;
311 | y0 = y;
312 | }
313 | // 画圆弧P4P1
314 | x0 = (int)(300 + 200 * Math.Cos(150 * 3.14159 / 180.0));
315 | y0 = -1 * (int)(300 + 200 * Math.Sin(150 * 3.14159 / 180.0));
316 | for (int i = 151; i < 390; i++) {
317 | x = (int)(300 + 200 * Math.Cos(i * 3.14159 / 180.0));
318 | y = -1 * (int)(300 + 200 * Math.Sin(i * 3.14159 / 180.0));
319 | g.DrawLine(GreenPen, x0, y0, x, y);
320 | x0 = x;
321 | y0 = y;
322 | }
323 |
324 | }
325 | private void machiningCAM_Click (object sender, EventArgs e) {
326 | double[] pos = new double[2];
327 | double[] centor = new double[2];
328 | double LookaheadAcc = 10000;
329 | int LookaheadSegment = 200;
330 | double PathError = 1;
331 | short result = 0;
332 |
333 | timer1.Start();
334 | //设置X轴速度曲线参数
335 | LTSMC.smc_set_profile_unit(CardNo, axis[0], Min_Vel, Max_Vel, Tacc, Tdec, Stop_Vel);
336 | LTSMC.smc_set_s_profile(CardNo, axis[0], 0, S_para); //设置S段参数
337 | LTSMC.smc_pmove_unit(CardNo, 0, x1, 1); //启动定长运动
338 | //设置Y轴速度曲线参数
339 | LTSMC.smc_set_profile_unit(CardNo, axis[1], Min_Vel, Max_Vel, Tacc, Tdec, Stop_Vel);
340 | LTSMC.smc_set_s_profile(CardNo, axis[1], 0, S_para); //设置S段参数
341 | LTSMC.smc_pmove_unit(CardNo, axis[1], y1, 1); //启动定长运动
342 | while (LTSMC.smc_check_done(0, 1) == 0) // 等待2个电机都停止
343 | {
344 | Application.DoEvents();
345 | }
346 | Thread.Sleep(100); // 延时100毫秒
347 | LTSMC.smc_conti_set_lookahead_mode(CardNo, 0, 1, LookaheadSegment,
348 | PathError, LookaheadAcc); // 设置连续插补前瞻模式
349 | LTSMC.smc_set_vector_profile_unit(CardNo, 0, Min_Vel, Max_Vel, Tacc, Tdec, Stop_Vel); // 设置连续插补的速度
350 | LTSMC.smc_set_vector_s_profile(CardNo, 0, 0, S_para); //设置连续插补S段时间
351 | LTSMC.smc_conti_open_list(CardNo, 0, 2, axis); // 打开连续插补指令表
352 | LTSMC.smc_conti_start_list(CardNo, 0); // 开始连续插补
353 | //连续直线插补P1到P2
354 | pos[0] = x2; //设置连续直线插补的终点
355 | pos[1] = y2;
356 | result = LTSMC.smc_conti_line_unit(CardNo, 0, 2, axis, pos, 1, 0);
357 | //连续圆弧插补P2到P3
358 | pos[0] = x3; //设置连续圆弧插补的终点
359 | pos[1] = y3;
360 | centor[0] = 300; //设置连续圆弧插补的圆心
361 | centor[1] = 500;
362 | LTSMC.smc_conti_arc_move_center_unit(CardNo, 0, 2, axis, pos, centor, 0, 0, 1, 1);
363 | //连续直线插补P3到P4
364 | pos[0] = x4;
365 | pos[1] = y4;
366 | result = LTSMC.smc_conti_line_unit(CardNo, 0, 2, axis, pos, 1, 2);
367 | //连续圆弧插补P4到P1
368 | pos[0] = x1;
369 | pos[1] = y1;
370 |
371 | LTSMC.smc_conti_arc_move_center_unit(CardNo, 0, 2, axis, pos, centor, 0, 0, 1, 3);
372 | LTSMC.smc_conti_close_list(CardNo, 0); //关闭连续插补指令表
373 | }
374 | private void timer1_Tick (object sender, EventArgs e) {
375 | double positionX = 0, positionX0 = 0;
376 | double positionY = 0, positionY0 = 0;
377 | Graphics g = pictureBox1.CreateGraphics(); // 创建Graphics对象
378 | g.PageUnit = GraphicsUnit.Pixel; // 以像素为单位
379 | g.PageScale = 0.5f; // 像素与坐标单位的比例,即1个单位为0.5个像素。
380 | g.TranslateTransform(0, 700); // y轴下移 700 ,方向 仍朝下
381 | Pen RedPen = new Pen(Color.Red);
382 | LTSMC.smc_get_position_unit(CardNo, 0, ref positionX); // 读X轴指令坐标
383 | textBoxXPos.Text = positionX.ToString();
384 | LTSMC.smc_get_position_unit(CardNo, 1, ref positionY); // 读Y轴指令坐标
385 | textBoxYPos.Text = positionY.ToString();
386 | // 画加工轨迹
387 | g.DrawLine(RedPen, (float)positionX0, -1 * (float)positionY0, (float)positionX, -1 * (float)positionY);
388 | positionX0 = positionX;
389 | positionY0 = positionY;
390 | }
391 |
392 | //回零
393 | private void home_Click (object sender, EventArgs e) {
394 | this.PenUp();
395 | for (ushort i = 0; i < 2; i++) {
396 | //控制器号,轴号,低速,高速,加速时间,减速时间
397 | LTSMC.smc_set_home_profile_unit(0, i, 1, speed, 0.1, 0.1);
398 |
399 | LTSMC.smc_set_homemode(CardNo, i, 0, 1, 21, 0); // 设置回零模式
400 | LTSMC.smc_set_home_position_unit(CardNo, i, 1, 0);// 设置偏移模式
401 |
402 | LTSMC.smc_home_move(CardNo, i); // 启动回零
403 | LTSMC.smc_set_position_unit(CardNo, i, 0);
404 | }
405 | while (LTSMC.smc_check_done(0, 0) == 0 ||
406 | LTSMC.smc_check_done(0, 1) == 0) {
407 | Application.DoEvents();
408 | }
409 | //控制器号,轴号,低速,高速,加速时间,减速时间
410 | LTSMC.smc_set_home_profile_unit(0, 2, 1, speed, 0.1, 0.1);
411 |
412 | LTSMC.smc_set_homemode(CardNo, 2, 0, 1, 21, 0); // 设置回零模式
413 | LTSMC.smc_set_home_position_unit(CardNo, 2, 1, 0);// 设置偏移模式
414 |
415 | LTSMC.smc_home_move(CardNo, 2); // 启动回零
416 | LTSMC.smc_set_position_unit(CardNo, 2, 0);
417 | timerSpeed.Start();
418 | }
419 |
420 | //实时读取位置
421 | private void timerSpeed_Tick (object sender, EventArgs e) {
422 | double pos = 0;
423 | LTSMC.smc_get_position_unit(CardNo, axis[0], ref pos); // 获取0号轴当前指令位置
424 | textBoxXPos.Text = pos.ToString(); // 显示当前位置
425 | LTSMC.smc_get_position_unit(CardNo, axis[1], ref pos); // 获取1号轴当前指令位置
426 | textBoxYPos.Text = pos.ToString(); // 显示当前位置
427 | LTSMC.smc_get_position_unit(CardNo, axis[2], ref pos); // 获取2号轴当前指令位置
428 | textBoxZPos.Text = pos.ToString(); // 显示当前位置
429 | }
430 |
431 | //以下是画画事件
432 | private void drawButton_Click (object sender, EventArgs e) {
433 | pictureBox1.Size = new Size(360, 150);
434 | mouseDown = 1;
435 | Graphics g = pictureBox1.CreateGraphics(); // 创建Graphics对象
436 | g.Clear(Color.White); // 画布清零
437 |
438 | }
439 | private void pictureBox1_MouseDown (object sender, MouseEventArgs e) {
440 | // 画画按钮打开时才可以画画
441 | if (e.Button == MouseButtons.Left && mouseDown == 1) {
442 | x1 = e.X; // 获取鼠标左键按下时的坐标
443 | y1 = e.Y;
444 | mouseDown = 2; // 鼠标左键按下标识为1
445 | }
446 | }
447 | private void pictureBox1_MouseMove (object sender, MouseEventArgs e) {
448 | // 鼠标左键按下后的移动
449 | if (mouseDown == 2) {
450 |
451 | Graphics g = pictureBox1.CreateGraphics();
452 | Pen WhitePen = new Pen(Color.White);
453 | Pen RedPen = new Pen(Color.Red);
454 |
455 | //擦除上次画的线
456 | g.DrawLine(WhitePen, x0, y0, x0 + width, y0 + height);
457 | width = e.X - x1; // 计算鼠标左键按下后移动的距离
458 | height = e.Y - y1;
459 | g.DrawLine(RedPen, x1, y1, e.X, e.Y);
460 | //Console.WriteLine(x1 + "-" + y1);
461 | x0 = x1; y0 = y1;
462 | }
463 | }
464 | private void pictureBox1_MouseUp (object sender, MouseEventArgs e) {
465 | // 鼠标左键抬起
466 | if (e.Button == MouseButtons.Left) {
467 | x2 = e.X;// 获取鼠标左键抬起时的坐标
468 | y2 = e.Y;
469 | mouseDown = 1; // 鼠标左键按下标识为0
470 | xPos[countLines] = x1;
471 | yPos[countLines] = y1;
472 | countLines++;
473 | xPos[countLines] = x2;
474 | yPos[countLines] = y2;
475 | countLines++;
476 |
477 | //画出保存的线
478 | Graphics g = pictureBox1.CreateGraphics();
479 | Pen BluePen = new Pen(Color.Blue);
480 | g.DrawLine(BluePen, x1, y1, x2, y2);
481 | }
482 |
483 | }
484 | private void doDrawButton_Click (object sender, EventArgs e) {
485 | mouseDown = 0;
486 | this.PenUp();
487 |
488 | //赋值速度
489 | LTSMC.smc_set_vector_profile_unit(CardNo, 0, Min_Vel, speed, Tacc, Tdec, Stop_Vel);
490 |
491 | //坐标需要先转换
492 | for (int i = 0; i < countLines; i++) {
493 | xPos[i] = ConversionX(xPos[i]);
494 | yPos[i] = ConversionY(yPos[i]);
495 | }
496 |
497 | timerDrawTrack.Start();
498 | for (int i = 0; i < countLines; i++) {
499 | //x与坐标反向正负相反
500 | Dist[0] = xPos[i];
501 | Dist[1] = yPos[i];
502 | LTSMC.smc_line_unit(0, 0, 2, AxirArray, Dist, 1);
503 | while (LTSMC.smc_check_done(0, 0) == 0 ||
504 | LTSMC.smc_check_done(0, 1) == 0) {
505 | Application.DoEvents();
506 | }
507 | this.PenDown();
508 | while (LTSMC.smc_check_done(0, 2) == 0) {
509 | Application.DoEvents();
510 | }
511 |
512 | i++;
513 | Dist[0] = xPos[i];
514 | Dist[1] = yPos[i];
515 | LTSMC.smc_line_unit(0, 0, 2, AxirArray, Dist, 1);
516 | while (LTSMC.smc_check_done(0, 0) == 0 ||
517 | LTSMC.smc_check_done(0, 1) == 0) {
518 | Application.DoEvents();
519 | }
520 |
521 | this.PenUp();
522 | while (LTSMC.smc_check_done(0, 2) == 0) {
523 | Application.DoEvents();
524 | }
525 | }
526 | //执行完关闭定时器
527 | timerDrawTrack.Stop();
528 | }
529 |
530 | //画画显示位置
531 | private void timerDrawTrack_Tick (object sender, EventArgs e) {
532 | double positionX = 0, positionX0 = 0;
533 | double positionY = 0, positionY0 = 0;
534 | int temp1, temp2;
535 |
536 | Graphics g = pictureBox1.CreateGraphics(); // 创建Graphics对象
537 |
538 | Pen RedPen = new Pen(Color.Red, 2.0f);
539 |
540 | LTSMC.smc_get_position_unit(CardNo, 0, ref positionX); // 读X轴指令坐标
541 | LTSMC.smc_get_position_unit(CardNo, 1, ref positionY); // 读Y轴指令坐标
542 |
543 | temp1 = Convert.ToInt32(positionX);
544 | temp2 = Convert.ToInt32(positionY);
545 |
546 | //落笔时才画
547 | if (penUpFlag == 1) {
548 | g.DrawLine(RedPen, this.ConversionX(temp1, 1), this.ConversionY(temp2, 1),
549 | this.ConversionX(temp1, 1) + 1, this.ConversionY(temp2, 1) + 1);
550 | LTSMC.smc_write_outbit(0, 60, 0);//落笔打开激光
551 | //textBoxLaser.Text = "Laser: OPEN";
552 | }
553 | else {
554 | LTSMC.smc_write_outbit(0, 60, 1);//抬笔时关闭激光
555 | //textBoxLaser.Text = "Laser: CLOSE";
556 | }
557 |
558 | positionX0 = positionX;
559 | positionY0 = positionY;
560 | }
561 |
562 | //画画显示速度函数
563 | private void timerSpeedCurve_Tick (object sender, EventArgs e) {
564 |
565 | double nowVec = 0, xVec = 0, yVec = 0;
566 | //画布大小400,64
567 | Graphics g = pictureBox2.CreateGraphics(); // 创建Graphics对象
568 |
569 | g.TranslateTransform(0, 50);
570 | // X轴下移50;Y轴右移200,方向仍朝下
571 |
572 | Pen AliceBluePen = new Pen(Color.AliceBlue, 2.0f);
573 | Pen BlackPen = new Pen(Color.Black);
574 | g.DrawLine(BlackPen, 0, 0, 400, 0);//画x轴
575 |
576 | LTSMC.smc_read_current_speed_unit(CardNo, axis[0], ref xVec);
577 | LTSMC.smc_read_current_speed_unit(CardNo, axis[1], ref yVec);
578 | nowVec = Math.Sqrt(xVec * xVec + yVec* yVec);
579 | g.DrawEllipse(AliceBluePen, (float)tim, (float)(-nowVec)*3, 1, 1);
580 | tim += 0.1;
581 |
582 | }
583 |
584 |
585 | //以下是坐标转换
586 | public int ConversionX (int x=0, int flag=0) {
587 | if (flag == 0)
588 | return x * 180 / 360;
589 | else
590 | return 360 * x / 180;
591 | }
592 | public int ConversionY (int y=0, int flag = 0) {
593 | if (flag == 0)
594 | return 75 - y * 75 / 150;
595 | else
596 | return (75 - y) * 150 / 75;
597 | }
598 |
599 | //以下是抬笔和落笔
600 | private void PenUp () {
601 | LTSMC.smc_set_profile_unit(CardNo, axis[2], Min_Vel, speed + 10, Tacc, Tdec, Stop_Vel);
602 | LTSMC.smc_set_s_profile(CardNo, axis[2], 0, S_para);
603 | LTSMC.smc_pmove_unit(0, axis[2], 8, 1);
604 | penUpFlag = 0;
605 | }
606 | private void PenDown () {
607 | LTSMC.smc_set_profile_unit(CardNo, axis[2], Min_Vel, speed + 10, Tacc, Tdec, Stop_Vel);
608 | LTSMC.smc_set_s_profile(CardNo, axis[2], 0, S_para);
609 | LTSMC.smc_pmove_unit(0, axis[2], 0, 1);
610 | penUpFlag = 1;
611 | }
612 |
613 | //以下是鼠标点击XYZ事件 点位运动
614 | private void xMovRelative_Click (object sender, EventArgs e) {
615 | double pos = double.Parse(textBoxPos.Text);
616 | LTSMC.smc_set_profile_unit(CardNo, axis[0], Min_Vel, speed, Tacc, Tdec, Stop_Vel);
617 | LTSMC.smc_set_s_profile(CardNo, axis[0], 0, S_para);
618 | LTSMC.smc_pmove_unit(0, axis[0], pos, 0);
619 | }
620 | private void yMovRelative_Click (object sender, EventArgs e) {
621 | double pos = double.Parse(textBoxPos.Text);
622 | LTSMC.smc_set_profile_unit(CardNo, axis[1], Min_Vel, speed, Tacc, Tdec, Stop_Vel);
623 | LTSMC.smc_set_s_profile(CardNo, axis[1], 0, S_para);
624 | LTSMC.smc_pmove_unit(0, axis[1], pos, 0);
625 | }
626 | private void zMovRelative_Click (object sender, EventArgs e) {
627 | double pos = double.Parse(textBoxPos.Text);
628 | LTSMC.smc_set_profile_unit(CardNo, axis[2], Min_Vel, speed, Tacc, Tdec, Stop_Vel);
629 | LTSMC.smc_set_s_profile(CardNo, axis[2], 0, S_para);
630 | LTSMC.smc_pmove_unit(0, axis[2], pos, 0);
631 | }
632 |
633 | //以下是鼠标点击XYZ事件 恒速运动
634 | private void xMovPostive_MouseDown (object sender, MouseEventArgs e) {
635 | LTSMC.smc_set_profile_unit(CardNo, axis[0], Min_Vel, speed, Tacc, Tdec, Stop_Vel);
636 | LTSMC.smc_set_s_profile(CardNo, axis[0], 0, S_para);
637 | LTSMC.smc_vmove(CardNo, axis[0], 1);//控制器号, 轴号,方向
638 | }
639 |
640 |
641 | private void xMovPostive_MouseUp (object sender, MouseEventArgs e) {
642 | LTSMC.smc_stop(CardNo, axis[0], 1);
643 | LTSMC.smc_stop(CardNo, axis[1], 1);
644 | LTSMC.smc_stop(CardNo, axis[2], 1);
645 | }
646 | private void xMovNegative_MouseDown (object sender, MouseEventArgs e) {
647 | LTSMC.smc_set_profile_unit(CardNo, axis[0], Min_Vel, speed, Tacc, Tdec, Stop_Vel);
648 | LTSMC.smc_set_s_profile(CardNo, axis[0], 0, S_para);
649 | LTSMC.smc_vmove(CardNo, axis[0], 0);//控制器号, 轴号,方向
650 | }
651 | private void xMovNegative_MouseUp (object sender, MouseEventArgs e) {
652 | LTSMC.smc_stop(CardNo, axis[0], 1);
653 | LTSMC.smc_stop(CardNo, axis[1], 1);
654 | LTSMC.smc_stop(CardNo, axis[2], 1);
655 | }
656 | private void yMovPostive_MouseDown (object sender, MouseEventArgs e) {
657 | LTSMC.smc_set_profile_unit(CardNo, axis[1], Min_Vel, speed, Tacc, Tdec, Stop_Vel);
658 | LTSMC.smc_set_s_profile(CardNo, axis[1], 0, S_para);
659 | LTSMC.smc_vmove(CardNo, axis[1], 1);//控制器号, 轴号,方向
660 | }
661 | private void yMovPostive_MouseUp (object sender, MouseEventArgs e) {
662 | LTSMC.smc_stop(CardNo, axis[0], 1);
663 | LTSMC.smc_stop(CardNo, axis[1], 1);
664 | LTSMC.smc_stop(CardNo, axis[2], 1);
665 | }
666 | private void yMovNegative_MouseDown (object sender, MouseEventArgs e) {
667 | LTSMC.smc_set_profile_unit(CardNo, axis[1], Min_Vel, speed, Tacc, Tdec, Stop_Vel);
668 | LTSMC.smc_set_s_profile(CardNo, axis[1], 0, S_para);
669 | LTSMC.smc_vmove(CardNo, axis[1], 0);//控制器号, 轴号,方向
670 | }
671 | private void yMovNegative_MouseUp (object sender, MouseEventArgs e) {
672 | LTSMC.smc_stop(CardNo, axis[0], 1);
673 | LTSMC.smc_stop(CardNo, axis[1], 1);
674 | LTSMC.smc_stop(CardNo, axis[2], 1);
675 | }
676 | private void zMovPostive_MouseDown (object sender, MouseEventArgs e) {
677 | LTSMC.smc_set_profile_unit(CardNo, axis[2], Min_Vel, speed, Tacc, Tdec, Stop_Vel);
678 | LTSMC.smc_set_s_profile(CardNo, axis[2], 0, S_para);
679 | LTSMC.smc_vmove(CardNo, axis[2], 1);//控制器号, 轴号,方向
680 | }
681 | private void zMovPostive_MouseUp (object sender, MouseEventArgs e) {
682 | LTSMC.smc_stop(CardNo, axis[0], 1);
683 | LTSMC.smc_stop(CardNo, axis[1], 1);
684 | LTSMC.smc_stop(CardNo, axis[2], 1);
685 | }
686 | private void zMovNegative_MouseDown (object sender, MouseEventArgs e) {
687 | LTSMC.smc_set_profile_unit(CardNo, axis[2], Min_Vel, speed, Tacc, Tdec, Stop_Vel);
688 | LTSMC.smc_set_s_profile(CardNo, axis[2], 0, S_para);
689 | LTSMC.smc_vmove(CardNo, axis[2], 0);//控制器号, 轴号,方向
690 | }
691 | private void zMovNegative_MouseUp (object sender, MouseEventArgs e) {
692 | LTSMC.smc_stop(CardNo, axis[0], 1);
693 | LTSMC.smc_stop(CardNo, axis[1], 1);
694 | LTSMC.smc_stop(CardNo, axis[2], 1);
695 | }
696 | }
697 |
698 | }
699 |
700 |
701 |
--------------------------------------------------------------------------------
/LTSMC.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Runtime.InteropServices;
6 |
7 | namespace Leadshine
8 | {
9 | public partial class LTSMC
10 | {
11 | /*********************************************************************************************************
12 | 功能函数
13 | ***********************************************************************************************************/
14 | //板卡配置
15 | [DllImport("LTSMC.dll")]
16 | public static extern short smc_board_init(ushort ConnectNo, ushort ConnectType, string pconnectstring, uint baud);
17 | [DllImport("LTSMC.dll")]
18 | public static extern short smc_board_init_ex(ushort ConnectNo, ushort type, string pconnectstring, uint dwBaudRate, uint dwByteSize, uint dwParity, uint dwStopBits);
19 | [DllImport("LTSMC.dll")]
20 | public static extern short smc_board_close(ushort ConnectNo);
21 | [DllImport("LTSMC.dll")]
22 | public static extern short smc_get_CardInfList(ref ushort CardNum, uint[] CardTypeList, ushort[] ConnectTypeList);
23 | [DllImport("LTSMC.dll")]
24 | public static extern short smc_get_card_version(ushort ConnectNo, ref uint CardVersion);
25 | [DllImport("LTSMC.dll")]
26 | public static extern short smc_get_card_soft_version(ushort ConnectNo, ref uint FirmID, ref uint SubFirmID);
27 | [DllImport("LTSMC.dll")]
28 | public static extern short smc_get_release_version(ushort ConnectNo, byte[] ReleaseVersion);
29 | [DllImport("LTSMC.dll")]
30 | public static extern short smc_get_card_lib_version(ref uint LibVer);
31 | [DllImport("LTSMC.dll")]
32 | public static extern short smc_get_total_axes(ushort ConnectNo, ref uint TotalAxis); //读取指定卡轴数
33 | [DllImport("LTSMC.dll")]
34 | public static extern short smc_get_total_ionum(ushort ConnectNo, ref ushort TotalIn, ref ushort TotalOut);
35 | [DllImport("LTSMC.dll")]
36 | public static extern short smc_get_total_adcnum(ushort ConnectNo, ref ushort TotalIn, ref ushort TotalOut);
37 |
38 | [DllImport("LTSMC.dll")]
39 | public static extern short smc_get_total_liners(ushort ConnectNo, ref uint TotalLiner);
40 | [DllImport("LTSMC.dll")]
41 | public static extern short smc_set_debug_mode(ushort mode, char[] FileName);
42 | [DllImport("LTSMC.dll")]
43 | public static extern short smc_get_debug_mode(ref ushort mode, char[] FileName);
44 | [DllImport("LTSMC.dll")]
45 | public static extern short smc_format_flash(ushort ConnectNo);
46 | [DllImport("LTSMC.dll")]
47 | public static extern short smc_set_ipaddr(ushort ConnectNo, byte[] IpAddr);
48 | [DllImport("LTSMC.dll")]
49 | public static extern short smc_get_ipaddr(ushort ConnectNo, byte[] IpAddr);
50 | [DllImport("LTSMC.dll")]
51 | public static extern short smc_set_com(ushort ConnectNo, ushort com, uint dwBaudRate, ushort wByteSize, ushort wParity, ushort wStopBits);
52 | [DllImport("LTSMC.dll")]
53 | public static extern short smc_get_com(ushort ConnectNo, ushort com, ref uint dwBaudRate, ref ushort wByteSize, ref ushort wParity, ref ushort dwStopBits);
54 |
55 | //序列号
56 | [DllImport("LTSMC.dll")]
57 | public static extern short smc_write_sn(ushort ConnectNo, UInt64 sn);
58 | [DllImport("LTSMC.dll")]
59 | public static extern short smc_read_sn(ushort ConnectNo, ref UInt64 sn);
60 | //加密
61 | [DllImport("LTSMC.dll")]
62 | public static extern short smc_write_password(ushort ConnectNo, string str_pass);
63 | [DllImport("LTSMC.dll")]
64 | public static extern short smc_check_password(ushort ConnectNo, string str_pass);
65 |
66 | //脉冲模式
67 | [DllImport("LTSMC.dll")]
68 | public static extern short smc_set_pulse_outmode(ushort ConnectNo, ushort axis, ushort outmode); //设定脉冲输出模式
69 | [DllImport("LTSMC.dll")]
70 | public static extern short smc_get_pulse_outmode(ushort ConnectNo, ushort axis, ref ushort outmode); //读取脉冲输出模式
71 | //脉冲当量
72 | [DllImport("LTSMC.dll")]
73 | public static extern short smc_set_equiv(ushort ConnectNo, ushort axis, double equiv);
74 | [DllImport("LTSMC.dll")]
75 | public static extern short smc_get_equiv(ushort ConnectNo, ushort axis, ref double equiv);
76 | //反向间隙
77 | [DllImport("LTSMC.dll")]
78 | public static extern short smc_set_backlash_unit(ushort ConnectNo, ushort axis, double backlash);
79 | [DllImport("LTSMC.dll")]
80 | public static extern short smc_get_backlash_unit(ushort ConnectNo, ushort axis, ref double backlash);
81 | //编码器
82 | [DllImport("LTSMC.dll")]
83 | public static extern short smc_set_counter_inmode(ushort ConnectNo, ushort axis, ushort mode); //设定编码器的计数方式
84 | [DllImport("LTSMC.dll")]
85 | public static extern short smc_get_counter_inmode(ushort ConnectNo, ushort axis, ref ushort mode); //读取编码器的计数方式
86 | [DllImport("LTSMC.dll")]
87 | public static extern int smc_get_encoder(ushort ConnectNo, ushort axis);
88 | [DllImport("LTSMC.dll")]
89 | public static extern short smc_set_encoder(ushort ConnectNo, ushort axis, int encoder_value);
90 | [DllImport("LTSMC.dll")]
91 | public static extern short smc_set_ez_mode(ushort ConnectNo, ushort axis, ushort ez_logic, ushort ez_mode, double filter); //设置EZ信号
92 | [DllImport("LTSMC.dll")]
93 | public static extern short smc_get_ez_mode(ushort ConnectNo, ushort axis, ref ushort ez_logic, ref ushort ez_mode, ref double filter); //读取设置EZ信号
94 | [DllImport("LTSMC.dll")]
95 | public static extern short smc_set_counter_reverse(ushort ConnectNo, ushort axis, ushort reverse);
96 | [DllImport("LTSMC.dll")]
97 | public static extern short smc_get_counter_reverse(ushort ConnectNo, ushort axis, ref ushort reverse);
98 | //辅助编码器
99 | [DllImport("LTSMC.dll")]
100 | public static extern short smc_set_extra_encoder(ushort ConnectNo, ushort axis, int pos);
101 | [DllImport("LTSMC.dll")]
102 | public static extern short smc_get_extra_encoder(ushort ConnectNo, ushort axis, ref int pos);
103 | //单轴速度参数
104 | [DllImport("LTSMC.dll")]
105 | public static extern short smc_set_profile_unit(ushort ConnectNo, ushort axis, double Min_Vel, double Max_Vel, double Tacc, double Tdec, double Stop_Vel);
106 | [DllImport("LTSMC.dll")]
107 | public static extern short smc_get_profile_unit(ushort ConnectNo, ushort axis, ref double Min_Vel, ref double Max_Vel, ref double Tacc, ref double Tdec, ref double Stop_Vel);
108 | [DllImport("LTSMC.dll")]
109 | public static extern short smc_set_s_profile(ushort ConnectNo, ushort axis, ushort s_mode, double s_para); //设置平滑速度曲线参数
110 | [DllImport("LTSMC.dll")]
111 | public static extern short smc_get_s_profile(ushort ConnectNo, ushort axis, ushort s_mode, ref double s_para); //读取平滑速度曲线参数 兼容DMC5800 s_mode改用指针返回参数值
112 | //单轴运动
113 | [DllImport("LTSMC.dll")]
114 | public static extern short smc_pmove_unit(ushort ConnectNo, ushort axis, double Dist, ushort posi_mode);
115 | [DllImport("LTSMC.dll")]
116 | public static extern short smc_vmove(ushort ConnectNo, ushort axis, ushort dir); //指定轴做连续运动
117 | [DllImport("LTSMC.dll")]
118 | public static extern short smc_change_speed(ushort ConnectNo, ushort axis, double Curr_Vel, double Taccdec); //在线改变指定轴的当前运动速度
119 | //正弦曲线定长运动
120 | [DllImport("LTSMC.dll")]
121 | public static extern short smc_sine_oscillate_unit(ushort ConnectNo,ushort axis,double Amplitude,double Frequency);//正弦曲线定长运动
122 | [DllImport("LTSMC.dll")]
123 | public static extern short smc_sine_oscillate_stop(ushort ConnectNo,ushort axis);//正弦曲线停止,停止在中心位置
124 | //回零运动
125 | [DllImport("LTSMC.dll")]
126 | public static extern short smc_set_home_pin_logic(ushort ConnectNo, ushort axis, ushort org_logic, double filter); //设置HOME信号
127 | [DllImport("LTSMC.dll")]
128 | public static extern short smc_get_home_pin_logic(ushort ConnectNo, ushort axis, ref ushort org_logic, ref double filter); //读取设置HOME信号
129 | [DllImport("LTSMC.dll")]
130 | public static extern short smc_set_home_profile_unit(ushort ConnectNo, ushort axis, double Low_Vel, double High_Vel, double Tacc, double Tdec);
131 | [DllImport("LTSMC.dll")]
132 | public static extern short smc_get_home_profile_unit(ushort ConnectNo, ushort axis, ref double Low_Vel, ref double High_Vel, ref double Tacc, ref double Tdec);
133 | [DllImport("LTSMC.dll")]
134 | public static extern short smc_set_ez_count(ushort ConnectNo, ushort axis, ushort ez_count);
135 | [DllImport("LTSMC.dll")]
136 | public static extern short smc_get_ez_count(ushort ConnectNo, ushort axis, ref ushort ez_count);
137 | [DllImport("LTSMC.dll")]
138 | public static extern short smc_set_homemode(ushort ConnectNo, ushort axis, ushort home_dir, double vel_mode, ushort mode, ushort pos_source);//设定指定轴的回原点模式
139 | [DllImport("LTSMC.dll")]
140 | public static extern short smc_get_homemode(ushort ConnectNo, ushort axis, ref ushort home_dir, ref double vel_mode, ref ushort home_mode, ref ushort pos_source);//读取指定轴的回原点模式
141 | [DllImport("LTSMC.dll")]
142 | public static extern short smc_home_move(ushort ConnectNo, ushort axis);
143 | [DllImport("LTSMC.dll")]
144 | public static extern short smc_get_home_result(ushort ConnectNo, ushort axis, ref ushort state);
145 | [DllImport("LTSMC.dll")]
146 | public static extern short smc_set_home_position_unit(ushort ConnectNo, ushort axis, ushort enable, double position);
147 | [DllImport("LTSMC.dll")]
148 | public static extern short smc_get_home_position_unit(ushort ConnectNo, ushort axis, ref ushort enable, ref double position);
149 | //手轮运动(旧)
150 | [DllImport("LTSMC.dll")]
151 | public static extern short smc_set_handwheel_channel(ushort CardNo, ushort index);
152 | [DllImport("LTSMC.dll")]
153 | public static extern short smc_get_handwheel_channel(ushort CardNo, ref ushort index);
154 | [DllImport("LTSMC.dll")]
155 | public static extern short smc_set_handwheel_inmode(ushort CardNo, ushort axis, ushort inmode, int multi, double vh);
156 | [DllImport("LTSMC.dll")]
157 | public static extern short smc_get_handwheel_inmode(ushort CardNo, ushort axis, ref ushort inmode, ref int multi, ref double vh);
158 | [DllImport("LTSMC.dll")]
159 | public static extern short smc_set_handwheel_inmode_extern(ushort CardNo, ushort inmode, ushort AxisNum, ushort[] AxisList, int[] multi);
160 | [DllImport("LTSMC.dll")]
161 | public static extern short smc_get_handwheel_inmode_extern(ushort CardNo, ref ushort inmode, ref ushort AxisNum, ushort[] AxisList, int[] multi);
162 | //[DllImport("LTSMC.dll")]
163 | //public static extern short smc_handwheel_move(ushort CardNo, ushort axis);
164 | //手轮运动
165 | [DllImport("LTSMC.dll")]
166 | public static extern short smc_handwheel_set_axislist(ushort ConnectNo, ushort AxisSelIndex, ushort AxisNum, ushort[] AxisList);
167 | [DllImport("LTSMC.dll")]
168 | public static extern short smc_handwheel_get_axislist(ushort ConnectNo, ushort AxisSelIndex, ref ushort AxisNum, ushort[] AxisList);
169 | [DllImport("LTSMC.dll")]
170 | public static extern short smc_handwheel_set_ratiolist(ushort ConnectNo, ushort AxisSelIndex, ushort StartRatioIndex, ushort RatioSelNum, double[] RatioList);
171 | [DllImport("LTSMC.dll")]
172 | public static extern short smc_handwheel_get_ratiolist(ushort ConnectNo, ushort AxisSelIndex, ushort StartRatioIndex, ushort RatioSelNum, double[] RatioList);
173 | [DllImport("LTSMC.dll")]
174 | public static extern short smc_handwheel_set_mode(ushort ConnectNo, ushort InMode, ushort IfHardEnable);
175 | [DllImport("LTSMC.dll")]
176 | public static extern short smc_handwheel_get_mode(ushort ConnectNo, ref ushort InMode, ref ushort IfHardEnable);
177 | [DllImport("LTSMC.dll")]
178 | public static extern short smc_handwheel_set_index(ushort ConnectNo, ushort AxisSelIndex, ushort RatioSelIndex);
179 | [DllImport("LTSMC.dll")]
180 | public static extern short smc_handwheel_get_index(ushort ConnectNo, ref ushort AxisSelIndex, ref ushort RatioSelIndex);
181 | [DllImport("LTSMC.dll")]
182 | public static extern short smc_handwheel_move(ushort ConnectNo, ushort ForceMove);
183 | [DllImport("LTSMC.dll")]
184 | public static extern short smc_handwheel_stop(ushort ConnectNo);
185 | //原点锁存
186 | [DllImport("LTSMC.dll")]
187 | public static extern short smc_set_homelatch_mode(ushort ConnectNo, ushort axis, ushort enable, ushort logic, ushort source);
188 | [DllImport("LTSMC.dll")]
189 | public static extern short smc_get_homelatch_mode(ushort ConnectNo, ushort axis, ref ushort enable, ref ushort logic, ref ushort source);
190 | [DllImport("LTSMC.dll")]
191 | public static extern int smc_get_homelatch_flag(ushort ConnectNo, ushort axis);
192 | [DllImport("LTSMC.dll")]
193 | public static extern short smc_reset_homelatch_flag(ushort ConnectNo, ushort axis);
194 | [DllImport("LTSMC.dll")]
195 | public static extern short smc_get_homelatch_value_unit(ushort ConnectNo, ushort axis, ref double value);
196 | //EZ锁存
197 | [DllImport("LTSMC.dll")]
198 | public static extern short smc_set_ezlatch_mode(ushort ConnectNo, ushort axis, ushort enable, ushort logic, ushort source);
199 | [DllImport("LTSMC.dll")]
200 | public static extern short smc_get_ezlatch_mode(ushort ConnectNo, ushort axis, ref ushort enable, ref ushort logic, ref ushort source);
201 | [DllImport("LTSMC.dll")]
202 | public static extern short smc_get_ezlatch_flag(ushort ConnectNo, ushort axis);
203 | [DllImport("LTSMC.dll")]
204 | public static extern short smc_reset_ezlatch_flag(ushort ConnectNo, ushort axis);
205 | [DllImport("LTSMC.dll")]
206 | public static extern short smc_get_ezlatch_value_unit(ushort ConnectNo, ushort axis, ref double pos_by_mm);
207 | //高速锁存(旧)
208 | [DllImport("LTSMC.dll")]
209 | public static extern short smc_set_ltc_mode(ushort ConnectNo, ushort axis, ushort ltc_logic, ushort ltc_mode, double filter); //设置LTC信号
210 | [DllImport("LTSMC.dll")]
211 | public static extern short smc_get_ltc_mode(ushort ConnectNo, ushort axis, ref ushort ltc_logic, ref ushort ltc_mode, ref double filter); //读取设置LTC信号
212 | [DllImport("LTSMC.dll")]
213 | public static extern short smc_set_latch_mode(ushort ConnectNo, ushort axis, ushort latchmode, ushort latch_source, ushort latch_channel); //设置锁存方式
214 | [DllImport("LTSMC.dll")]
215 | public static extern short smc_get_latch_mode(ushort ConnectNo, ushort axis, ref ushort latchmode, ref ushort latch_source, ref ushort latch_channel);
216 | [DllImport("LTSMC.dll")]
217 | public static extern short smc_SetLtcOutMode(ushort ConnectNo, ushort axis, ushort enable, ushort bitno);//反相输出
218 | [DllImport("LTSMC.dll")]
219 | public static extern short smc_GetLtcOutMode(ushort ConnectNo, ushort axis, ref ushort enable, ref ushort bitno);
220 | [DllImport("LTSMC.dll")]
221 | public static extern short smc_get_latch_flag(ushort ConnectNo, ushort axis); //读取锁存器标志
222 | [DllImport("LTSMC.dll")]
223 | public static extern short smc_reset_latch_flag(ushort ConnectNo, ushort axis); //复位锁存器标志
224 | [DllImport("LTSMC.dll")]
225 | public static extern short smc_get_latch_value_unit(ushort ConnectNo, ushort axis, ref double value); //读取编码器锁存器的值
226 | [DllImport("LTSMC.dll")]
227 | public static extern short smc_get_latch_flag_extern(ushort ConnectNo, ushort axis); //读取锁存器标志
228 | [DllImport("LTSMC.dll")]
229 | public static extern int smc_get_latch_value_extern(ushort ConnectNo, ushort axis, ushort index); //按索引取值
230 | [DllImport("LTSMC.dll")]
231 | public static extern short smc_set_latch_stop_time(ushort ConnectNo, ushort axis, int time); //触发急停时间
232 | [DllImport("LTSMC.dll")]
233 | public static extern short smc_get_latch_stop_time(ushort ConnectNo, ushort axis, ref int time);
234 | //高速锁存(新)
235 | [DllImport("LTSMC.dll")]
236 | public static extern short smc_ltc_set_mode(ushort ConnectNo, ushort latch, ushort ltc_mode, ushort ltc_logic, double filter);
237 | [DllImport("LTSMC.dll")]
238 | public static extern short smc_ltc_get_mode(ushort ConnectNo, ushort latch, ref ushort ltc_mode, ref ushort ltc_logic, ref double filter);
239 | [DllImport("LTSMC.dll")]
240 | public static extern short smc_ltc_set_source(ushort ConnectNo, ushort latch, ushort axis, ushort ltc_source);
241 | [DllImport("LTSMC.dll")]
242 | public static extern short smc_ltc_get_source(ushort ConnectNo, ushort latch, ushort axis, ref ushort ltc_source);
243 | [DllImport("LTSMC.dll")]
244 | public static extern short smc_ltc_reset(ushort ConnectNo, ushort latch);
245 | [DllImport("LTSMC.dll")]
246 | public static extern short smc_ltc_get_number(ushort ConnectNo, ushort latch, ushort axis, ref int number);
247 | [DllImport("LTSMC.dll")]
248 | public static extern short smc_ltc_get_value_unit(ushort ConnectNo, ushort latch, ushort axis, ref double value);
249 | //软锁存
250 | [DllImport("LTSMC.dll")]
251 | public static extern short smc_softltc_set_mode(ushort ConnectNo, ushort latch, ushort ltc_enable, ushort ltc_mode, ushort ltc_inbit, ushort ltc_logic, double filter);
252 | [DllImport("LTSMC.dll")]
253 | public static extern short smc_softltc_get_mode(ushort ConnectNo, ushort latch, ref ushort ltc_enable, ref ushort ltc_mode, ref ushort ltc_inbit, ref ushort ltc_logic, ref double filter);
254 | [DllImport("LTSMC.dll")]
255 | public static extern short smc_softltc_set_source(ushort ConnectNo, ushort latch, ushort axis, ushort ltc_source);
256 | [DllImport("LTSMC.dll")]
257 | public static extern short smc_softltc_get_source(ushort ConnectNo, ushort latch, ushort axis, ref ushort ltc_source);
258 | [DllImport("LTSMC.dll")]
259 | public static extern short smc_softltc_reset(ushort ConnectNo, ushort latch);
260 | [DllImport("LTSMC.dll")]
261 | public static extern short smc_softltc_get_number(ushort ConnectNo, ushort latch, ushort axis, ref int number);
262 | [DllImport("LTSMC.dll")]
263 | public static extern short smc_softltc_get_value_unit(ushort ConnectNo, ushort latch, ushort axis, ref double value);
264 | //PVT运动
265 | [DllImport("LTSMC.dll")]
266 | public static extern short smc_pvt_table_unit(ushort ConnectNo, ushort iaxis, uint count, double[] pTime, double[] pPos, double[] pVel);
267 | [DllImport("LTSMC.dll")]
268 | public static extern short smc_pts_table_unit(ushort ConnectNo, ushort iaxis, uint count, double[] pTime, double[] pPos, double[] pPercent);
269 | [DllImport("LTSMC.dll")]
270 | public static extern short smc_pvts_table_unit(ushort ConnectNo, ushort iaxis, uint count, double[] pTime, double[] pPos, double velBegin, double velEnd);
271 | [DllImport("LTSMC.dll")]
272 | public static extern short smc_ptt_table_unit(ushort ConnectNo, ushort iaxis, uint count, double[] pTime, double[] pPos);
273 | [DllImport("LTSMC.dll")]
274 | public static extern short smc_pvt_move(ushort ConnectNo, ushort AxisNum, ushort[] AxisList);
275 | //安全机制
276 | [DllImport("LTSMC.dll")]
277 | public static extern short smc_set_el_mode(ushort ConnectNo, ushort axis, ushort enable, ushort el_logic, ushort el_mode); //设置EL信号
278 | [DllImport("LTSMC.dll")]
279 | public static extern short smc_get_el_mode(ushort ConnectNo, ushort axis, ref ushort enable, ref ushort el_logic, ref ushort el_mode); //读取设置EL信号
280 | [DllImport("LTSMC.dll")]
281 | public static extern short smc_set_emg_mode(ushort ConnectNo, ushort axis, ushort enable, ushort emg_logic); //设置EMG信号
282 | [DllImport("LTSMC.dll")]
283 | public static extern short smc_get_emg_mode(ushort ConnectNo, ushort axis, ref ushort enable, ref ushort emg_logic); //读取设置EMG信号
284 | [DllImport("LTSMC.dll")]
285 | public static extern short smc_set_softlimit_unit(ushort ConnectNo, ushort axis, ushort enable, ushort source_sel, ushort SL_action, double N_limit, double P_limit); //设置软限位参数
286 | [DllImport("LTSMC.dll")]
287 | public static extern short smc_get_softlimit_unit(ushort ConnectNo, ushort axis, ref ushort enable, ref ushort source_sel, ref ushort SL_action, ref double N_limit, ref double P_limit); //读取软限位参数
288 | //轴IO映射
289 | [DllImport("LTSMC.dll")]
290 | public static extern short smc_set_axis_io_map(ushort ConnectNo, ushort Axis, ushort IoType, ushort MapIoType, ushort MapIoIndex, double Filter);
291 | [DllImport("LTSMC.dll")]
292 | public static extern short smc_get_axis_io_map(ushort ConnectNo, ushort Axis, ushort IoType, ref ushort MapIoType, ref ushort MapIoIndex, ref double Filter);
293 | //状态监控
294 | [DllImport("LTSMC.dll")]
295 | public static extern short smc_check_done(ushort ConnectNo, ushort axis); //读取指定轴的运动状态
296 | [DllImport("LTSMC.dll")]
297 | public static extern short smc_stop(ushort ConnectNo, ushort axis, ushort stop_mode); //单轴停止
298 | [DllImport("LTSMC.dll")]
299 | public static extern short smc_emg_stop(ushort ConnectNo); //紧急停止所有轴
300 | [DllImport("LTSMC.dll")]
301 | public static extern short smc_check_done_multicoor(ushort ConnectNo, ushort Crd);
302 | [DllImport("LTSMC.dll")]
303 | public static extern short smc_stop_multicoor(ushort ConnectNo, ushort Crd, ushort stop_mode);
304 | [DllImport("LTSMC.dll")]
305 | public static extern uint smc_axis_io_status(ushort ConnectNo, ushort axis);
306 | [DllImport("LTSMC.dll")]
307 | public static extern uint smc_axis_io_enable_status(ushort ConnectNo, ushort axis);
308 | [DllImport("LTSMC.dll")]
309 | public static extern short smc_get_axis_run_mode(ushort ConnectNo, ushort axis, ref ushort run_mode);
310 | [DllImport("LTSMC.dll")]
311 | public static extern short smc_read_current_speed_unit(ushort ConnectNo, ushort axis, ref double current_speed);
312 | [DllImport("LTSMC.dll")]
313 | public static extern short smc_set_position_unit(ushort ConnectNo, ushort axis, double pos);
314 | [DllImport("LTSMC.dll")]
315 | public static extern short smc_get_position_unit(ushort ConnectNo, ushort axis, ref double pos);
316 | [DllImport("LTSMC.dll")]
317 | public static extern int smc_get_target_position_unit(ushort ConnectNo, ushort axis, ref double pos); //读取指定轴的目标位置
318 | [DllImport("LTSMC.dll")]
319 | public static extern short smc_set_workpos_unit(ushort ConnectNo, ushort axis, double pos);
320 | [DllImport("LTSMC.dll")]
321 | public static extern short smc_get_workpos_unit(ushort ConnectNo, ushort axis, ref double pos);
322 | [DllImport("LTSMC.dll")]
323 | public static extern short smc_get_stop_reason(ushort ConnectNo, ushort axis, ref int StopReason);
324 | [DllImport("LTSMC.dll")]
325 | public static extern short smc_clear_stop_reason(ushort ConnectNo, ushort axis);
326 | //通用IO
327 | [DllImport("LTSMC.dll")]
328 | public static extern short smc_read_inbit(ushort ConnectNo, ushort bitno); //读取输入口的状态
329 | [DllImport("LTSMC.dll")]
330 | public static extern short smc_write_outbit(ushort ConnectNo, ushort bitno, ushort on_off); //设置输出口的状态
331 | [DllImport("LTSMC.dll")]
332 | public static extern short smc_read_outbit(ushort ConnectNo, ushort bitno); //读取输出口的状态
333 | [DllImport("LTSMC.dll")]
334 | public static extern uint smc_read_inport(ushort ConnectNo, ushort portno); //读取输入端口的值
335 | [DllImport("LTSMC.dll")]
336 | public static extern uint smc_read_outport(ushort ConnectNo, ushort portno); //读取输出端口的值
337 | [DllImport("LTSMC.dll")]
338 | public static extern short smc_write_outport(ushort ConnectNo, ushort portno, uint outport_val); //设置输出端口的值
339 | [DllImport("LTSMC.dll")]
340 | public static extern short smc_reverse_outbit(ushort ConnectNo, ushort bitno, double reverse_time);
341 | [DllImport("LTSMC.dll")]
342 | public static extern short smc_set_io_count_mode(ushort ConnectNo, ushort bitno, ushort mode, double filter);
343 | [DllImport("LTSMC.dll")]
344 | public static extern short smc_get_io_count_mode(ushort ConnectNo, ushort bitno, ref ushort mode, ref double filter);
345 | [DllImport("LTSMC.dll")]
346 | public static extern short smc_set_io_count_value(ushort ConnectNo, ushort bitno, uint CountValue);
347 | [DllImport("LTSMC.dll")]
348 | public static extern short smc_get_io_count_value(ushort ConnectNo, ushort bitno, ref uint CountValue);
349 | [DllImport("LTSMC.dll")]
350 | public static extern short smc_set_io_dstp_mode(ushort ConnectNo, ushort axis, ushort enable, ushort logic); //enable:0-禁用,1-按时间减速停止,2-按距离减速停止
351 | [DllImport("LTSMC.dll")]
352 | public static extern short smc_get_io_dstp_mode(ushort ConnectNo, ushort axis, ref ushort enable, ref ushort logic);
353 | [DllImport("LTSMC.dll")]
354 | public static extern short smc_set_dec_stop_time(ushort ConnectNo, ushort axis, double time);
355 | [DllImport("LTSMC.dll")]
356 | public static extern short smc_get_dec_stop_time(ushort ConnectNo, ushort axis, ref double time);
357 | [DllImport("LTSMC.dll")]
358 | public static extern short smc_set_io_pwmoutput(ushort ConnectNo, ushort outbit, double time1, double time2, uint counts);//设置IO输出一定脉冲个数的PWM波形曲线
359 | [DllImport("LTSMC.dll")]
360 | public static extern short smc_clear_io_pwmoutput(ushort ConnectNo, ushort outbit);//清除IO输出PWM波形曲线
361 | //专用IO操作
362 | [DllImport("LTSMC.dll")]
363 | public static extern short smc_set_alm_mode(ushort ConnectNo, ushort axis, ushort enable, ushort alm_logic, ushort alm_action); //设置ALM信号
364 | [DllImport("LTSMC.dll")]
365 | public static extern short smc_get_alm_mode(ushort ConnectNo, ushort axis, ref ushort enable, ref ushort alm_logic, ref ushort alm_action); //读取设置ALM信号
366 | [DllImport("LTSMC.dll")]
367 | public static extern short smc_set_inp_mode(ushort ConnectNo, ushort axis, ushort enable, ushort inp_logic); //设置INP信号
368 | [DllImport("LTSMC.dll")]
369 | public static extern short smc_get_inp_mode(ushort ConnectNo, ushort axis, ref ushort enable, ref ushort inp_logic); //读取设置INP信号
370 | [DllImport("LTSMC.dll")]
371 | public static extern short smc_set_rdy_mode(ushort ConnectNo, ushort axis, ushort enable, ushort rdy_logic); //设置RDY信号
372 | [DllImport("LTSMC.dll")]
373 | public static extern short smc_get_rdy_mode(ushort ConnectNo, ushort axis, ref ushort enable, ref ushort rdy_logic); //读取设置RDY信号
374 | [DllImport("LTSMC.dll")]
375 | public static extern short smc_set_erc_mode(ushort ConnectNo, ushort axis, ushort enable, ushort erc_logic, ushort erc_width, ushort erc_off_time); //设置ERC信号
376 | [DllImport("LTSMC.dll")]
377 | public static extern short smc_get_erc_mode(ushort ConnectNo, ushort axis, ref ushort enable, ref ushort erc_logic, ref ushort erc_width, ref ushort erc_off_time); //读取设置ERC信号
378 |
379 | [DllImport("LTSMC.dll")]
380 | public static extern short smc_write_sevon_pin(ushort ConnectNo, ushort axis, ushort on_off); //输出SEVON信号
381 | [DllImport("LTSMC.dll")]
382 | public static extern short smc_read_sevon_pin(ushort ConnectNo, ushort axis); //读取SEVON信号
383 | [DllImport("LTSMC.dll")]
384 | public static extern short smc_read_rdy_pin(ushort ConnectNo, ushort axis); //读取RDY状态
385 | [DllImport("LTSMC.dll")]
386 | public static extern short smc_write_erc_pin(ushort ConnectNo, ushort axis, ushort on_off); //控制ERC信号输出
387 | [DllImport("LTSMC.dll")]
388 | public static extern short smc_read_erc_pin(ushort ConnectNo, ushort axis);
389 | [DllImport("LTSMC.dll")]
390 | public static extern short smc_write_sevrst_pin(ushort ConnectNo, ushort axis, ushort on_off); //输出伺服复位信号
391 | [DllImport("LTSMC.dll")]
392 | public static extern short smc_read_sevrst_pin(ushort ConnectNo, ushort axis); //读伺服复位信号
393 |
394 | [DllImport("LTSMC.dll")]
395 | public static extern short smc_set_dstp_mode(ushort ConnectNo, ushort axis, ushort enable, ushort logic, uint time);
396 | [DllImport("LTSMC.dll")]
397 | public static extern short smc_get_dstp_mode(ushort ConnectNo, ushort axis, ref ushort enable, ref ushort logic, ref uint time);
398 | [DllImport("LTSMC.dll")]
399 | public static extern short smc_set_dstp_time(ushort ConnectNo, ushort axis, uint time);
400 | [DllImport("LTSMC.dll")]
401 | public static extern short smc_get_dstp_time(ushort ConnectNo, ushort axis, ref uint time);
402 |
403 | [DllImport("LTSMC.dll")]
404 | public static extern short smc_set_io_dstp_bitno(ushort ConnectNo, ushort axis, ushort bitno, double filter); //设置通用输入口的一位位减速停止IO口
405 | [DllImport("LTSMC.dll")]
406 | public static extern short smc_get_io_dstp_bitno(ushort ConnectNo, ushort axis, ref ushort bitno, ref double filter);
407 | //插补参数设置
408 | [DllImport("LTSMC.dll")]
409 | public static extern short smc_set_vector_profile_unit(ushort ConnectNo, ushort Crd, double Min_Vel, double Max_Vel, double Tacc, double Tdec, double Stop_Vel);
410 | [DllImport("LTSMC.dll")]
411 | public static extern short smc_get_vector_profile_unit(ushort ConnectNo, ushort Crd, ref double Min_Vel, ref double Max_Vel, ref double Tacc, ref double Tdec, ref double Stop_Vel);
412 | [DllImport("LTSMC.dll")]
413 | public static extern short smc_set_vector_tacc(ushort ConnectNo, ushort Crd, double Tacc);
414 | [DllImport("LTSMC.dll")]
415 | public static extern short smc_set_vector_acc(ushort ConnectNo, ushort Crd, double acc);
416 | [DllImport("LTSMC.dll")]
417 | public static extern short smc_set_vector_speed_unit(ushort ConnectNo, ushort Crd, double Max_vel);
418 |
419 | [DllImport("LTSMC.dll")]
420 | public static extern short smc_set_vector_s_profile(ushort ConnectNo, ushort Crd, ushort s_mode, double s_para); //设置平滑速度曲线参数
421 | [DllImport("LTSMC.dll")]
422 | public static extern short smc_get_vector_s_profile(ushort ConnectNo, ushort Crd, ushort s_mode, ref double s_para);
423 | [DllImport("LTSMC.dll")]
424 | public static extern short smc_set_vector_dec_stop_time(ushort ConnectNo, ushort Crd, double time);
425 | [DllImport("LTSMC.dll")]
426 | public static extern short smc_get_vector_dec_stop_time(ushort ConnectNo, ushort Crd, ref double time);
427 |
428 | //单段插补
429 | [DllImport("LTSMC.dll")]
430 | public static extern short smc_line_unit(ushort ConnectNo, ushort Crd, ushort AxisNum, ushort[] AxisList, double[] Dist, ushort posi_mode);
431 | [DllImport("LTSMC.dll")]
432 | public static extern short smc_arc_move_center_unit(ushort ConnectNo, ushort Crd, ushort AxisNum, ushort[] AxisList, double[] Target_Pos, double[] Cen_Pos, ushort Arc_Dir, int Circle, ushort posi_mode);
433 | [DllImport("LTSMC.dll")]
434 | public static extern short smc_arc_move_radius_unit(ushort ConnectNo, ushort Crd, ushort AxisNum, ushort[] AxisList, double[] Target_Pos, double Arc_Radius, ushort Arc_Dir, int Circle, ushort posi_mode);
435 | [DllImport("LTSMC.dll")]
436 | public static extern short smc_arc_move_3points_unit(ushort ConnectNo, ushort Crd, ushort AxisNum, ushort[] AxisList, double[] Target_Pos, double[] Mid_Pos, int Circle, ushort posi_mode);
437 | //连续插补
438 | [DllImport("LTSMC.dll")]
439 | public static extern short smc_conti_open_list(ushort ConnectNo, ushort Crd, ushort AxisNum, ushort[] AxisList); //打开连续缓存区
440 | [DllImport("LTSMC.dll")]
441 | public static extern short smc_conti_close_list(ushort ConnectNo, ushort Crd); //关闭连续缓存区
442 | [DllImport("LTSMC.dll")]
443 | public static extern short smc_conti_stop_list(ushort ConnectNo, ushort Crd, ushort stop_mode); //连续插补中停止
444 | [DllImport("LTSMC.dll")]
445 | public static extern short smc_conti_pause_list(ushort ConnectNo, ushort Crd); //连续插补中暂停
446 | [DllImport("LTSMC.dll")]
447 | public static extern short smc_conti_start_list(ushort ConnectNo, ushort Crd); //开始连续插补
448 | [DllImport("LTSMC.dll")]
449 | public static extern short smc_conti_check_done(ushort ConnectNo, ushort Crd);
450 | [DllImport("LTSMC.dll")]
451 | public static extern short smc_conti_get_run_state(ushort ConnectNo, ushort Crd);//0-运行,1-暂停,2-正常停止,3-未启动,4-空闲
452 | [DllImport("LTSMC.dll")]
453 | public static extern int smc_conti_remain_space(ushort ConnectNo, ushort Crd); //查连续插补剩余缓存数
454 | [DllImport("LTSMC.dll")]
455 | public static extern int smc_conti_read_current_mark(ushort ConnectNo, ushort Crd); //读取当前连续插补段的标号
456 | [DllImport("LTSMC.dll")]
457 | public static extern short smc_conti_change_speed_ratio(ushort ConnectNo, ushort Crd, double percent); //设置插补中动态变速
458 | //Blend模式
459 | [DllImport("LTSMC.dll")]
460 | public static extern short smc_conti_set_blend(ushort ConnectNo, ushort Crd, ushort enable);
461 | [DllImport("LTSMC.dll")]
462 | public static extern short smc_conti_get_blend(ushort ConnectNo, ushort Crd, ref ushort enable);
463 | //小线段前瞻
464 | [DllImport("LTSMC.dll")]
465 | public static extern short smc_conti_set_lookahead_mode(ushort ConnectNo, ushort Crd, ushort enable, int LookaheadSegments, double PathError, double LookaheadAcc);
466 | [DllImport("LTSMC.dll")]
467 | public static extern short smc_conti_get_lookahead_mode(ushort ConnectNo, ushort Crd, ref ushort enable, ref int LookaheadSegments, ref double PathError, ref double LookaheadAcc);
468 | //设置每段速度
469 | [DllImport("LTSMC.dll")]
470 | public static extern short smc_conti_set_taccdec(ushort ConnectNo, ushort Crd, double Taccdec);
471 | [DllImport("LTSMC.dll")]
472 | public static extern short smc_conti_set_speed_unit(ushort ConnectNo, ushort Crd, double Max_vel);
473 | [DllImport("LTSMC.dll")]
474 | public static extern short smc_conti_set_override(ushort ConnectNo, ushort Crd, double Percent);
475 | //连续插补IO
476 | [DllImport("LTSMC.dll")]
477 | public static extern short smc_conti_wait_input(ushort ConnectNo, ushort Crd, ushort bitno, ushort on_off, double TimeOut, int mark);
478 | [DllImport("LTSMC.dll")]
479 | public static extern short smc_conti_delay_outbit_to_start(ushort ConnectNo, ushort Crd, ushort bitno, ushort on_off, double delay_value, ushort delay_mode, double ReverseTime);
480 | [DllImport("LTSMC.dll")]
481 | public static extern short smc_conti_delay_outbit_to_stop(ushort ConnectNo, ushort Crd, ushort bitno, ushort on_off, double delay_time, double ReverseTime);
482 | [DllImport("LTSMC.dll")]
483 | public static extern short smc_conti_ahead_outbit_to_stop(ushort ConnectNo, ushort Crd, ushort bitno, ushort on_off, double ahead_value, ushort ahead_mode, double ReverseTime);
484 | [DllImport("LTSMC.dll")]
485 | public static extern short smc_conti_accurate_outbit_unit(ushort ConnectNo, ushort Crd, ushort cmp_no, ushort on_off, ushort axis, double abs_pos, ushort pos_source, double ReverseTime);
486 | [DllImport("LTSMC.dll")]
487 | public static extern short smc_conti_write_outbit(ushort ConnectNo, ushort Crd, ushort bitno, ushort on_off, double ReverseTime);
488 | [DllImport("LTSMC.dll")]
489 | public static extern short smc_conti_clear_io_action(ushort ConnectNo, ushort Crd, uint Io_Mask);
490 | [DllImport("LTSMC.dll")]
491 | public static extern short smc_conti_set_pause_output(ushort ConnectNo, ushort Crd, ushort action, int mask, int state);
492 | [DllImport("LTSMC.dll")]
493 | public static extern short smc_conti_get_pause_output(ushort ConnectNo, ushort Crd, ref ushort action, ref int mask, ref int state);
494 | [DllImport("LTSMC.dll")]
495 | public static extern short smc_conti_delay(ushort ConnectNo, ushort Crd, double delay_time, int mark);//延时指令
496 | //连续插补轨迹
497 | [DllImport("LTSMC.dll")]
498 | public static extern short smc_conti_line_unit(ushort ConnectNo, ushort Crd, ushort AxisNum, ushort[] AxisList, double[] pPosList, ushort posi_mode, int mark);
499 | [DllImport("LTSMC.dll")]
500 | public static extern short smc_conti_arc_move_center_unit(ushort ConnectNo, ushort Crd, ushort AxisNum, ushort[] AxisList, double[] Target_Pos, double[] Cen_Pos, ushort Arc_Dir, int Circle, ushort posi_mode, int mark);
501 | [DllImport("LTSMC.dll")]
502 | public static extern short smc_conti_arc_move_radius_unit(ushort ConnectNo, ushort Crd, ushort AxisNum, ushort[] AxisList, double[] Target_Pos, double Arc_Radius, ushort Arc_Dir, int Circle, ushort posi_mode, int mark);
503 | [DllImport("LTSMC.dll")]
504 | public static extern short smc_conti_arc_move_3points_unit(ushort ConnectNo, ushort Crd, ushort AxisNum, ushort[] AxisList, double[] Target_Pos, double[] Mid_Pos, int Circle, ushort posi_mode, int mark);
505 | [DllImport("LTSMC.dll")]
506 | public static extern short smc_conti_pmove_unit(ushort ConnectNo, ushort Crd, ushort axis, double dist, ushort posi_mode, ushort mode, int imark);
507 | [DllImport("LTSMC.dll")]
508 | public static extern short smc_conti_set_involute_mode(ushort ConnectNo, ushort Crd, ushort mode);
509 | [DllImport("LTSMC.dll")]
510 | public static extern short smc_conti_get_involute_mode(ushort ConnectNo, ushort Crd, ref ushort mode);
511 | //二维位置比较提前输出,读取相对于起点的距离
512 | [DllImport("LTSMC.dll")]
513 | public static extern short smc_get_distance_to_start(ushort ConnectNo,ushort Crd,ref double distance_x,ref double distance_y,int imark);
514 | //二维位置比较提前输出,设置标志位,表示是否开始计算相对起点
515 | [DllImport("LTSMC.dll")]
516 | public static extern short smc_set_start_distance_flag(ushort ConnectNo, ushort Crd, ushort flag);
517 | [DllImport("LTSMC.dll")]
518 | public static extern short smc_get_start_distance_flag(ushort ConnectNo, ushort Crd, ref ushort flag);
519 | //连续插补PWM
520 | [DllImport("LTSMC.dll")]
521 | public static extern short smc_conti_set_pwm_output(ushort ConnectNo, ushort Crd, ushort PwmNo, double fDuty, double fFre);
522 | [DllImport("LTSMC.dll")]
523 | public static extern short smc_conti_set_pwm_follow_speed(ushort ConnectNo, ushort Crd, ushort pwm_no, ushort mode, double MaxVel, double MaxValue, double OutValue);
524 | [DllImport("LTSMC.dll")]
525 | public static extern short smc_conti_get_pwm_follow_speed(ushort ConnectNo, ushort Crd, ushort pwm_no, ref ushort mode, ref double MaxVel, ref double MaxValue, ref double OutValue);
526 | //设置PWM开关对应的占空比
527 | [DllImport("LTSMC.dll")]
528 | public static extern short smc_set_pwm_onoff_duty(ushort ConnectNo, ushort PwmNo, double fOnDuty, double fOffDuty);
529 | [DllImport("LTSMC.dll")]
530 | public static extern short smc_get_pwm_onoff_duty(ushort ConnectNo, ushort PwmNo, ref double fOnDuty, ref double fOffDuty);
531 | [DllImport("LTSMC.dll")]
532 | public static extern short smc_conti_delay_pwm_to_start(ushort ConnectNo, ushort Crd, ushort pwmno, ushort on_off, double delay_value, ushort delay_mode, double ReverseTime);
533 | [DllImport("LTSMC.dll")]
534 | public static extern short smc_conti_delay_pwm_to_stop(ushort ConnectNo, ushort Crd, ushort pwmno, ushort on_off, double delay_time, double ReverseTime);
535 | [DllImport("LTSMC.dll")]
536 | public static extern short smc_conti_ahead_pwm_to_stop(ushort ConnectNo, ushort Crd, ushort bitno, ushort on_off, double ahead_value, ushort ahead_mode, double ReverseTime);
537 | [DllImport("LTSMC.dll")]
538 | public static extern short smc_conti_write_pwm(ushort ConnectNo, ushort Crd, ushort pwmno, ushort on_off, double ReverseTime);
539 | //PWM功能
540 | [DllImport("LTSMC.dll")]
541 | public static extern short smc_set_pwm_enable(ushort ConnectNo, ushort enable);
542 | [DllImport("LTSMC.dll")]
543 | public static extern short smc_get_pwm_enable(ushort ConnectNo, ref ushort enable);
544 | [DllImport("LTSMC.dll")]
545 | public static extern short smc_set_pwm_output(ushort ConnectNo, ushort PwmNo, double fDuty, double fFre);
546 | [DllImport("LTSMC.dll")]
547 | public static extern short smc_get_pwm_output(ushort ConnectNo, ushort PwmNo, ref double fDuty, ref double fFre);
548 | //位置比较
549 | //单轴位置比较
550 | [DllImport("LTSMC.dll")]
551 | public static extern short smc_compare_set_config(ushort ConnectNo, ushort axis, ushort enable, ushort cmp_source); //配置比较器
552 | [DllImport("LTSMC.dll")]
553 | public static extern short smc_compare_get_config(ushort ConnectNo, ushort axis, ref ushort enable, ref ushort cmp_source); //读取配置比较器
554 | [DllImport("LTSMC.dll")]
555 | public static extern short smc_compare_clear_points(ushort ConnectNo, ushort axis); //清除所有比较点
556 | [DllImport("LTSMC.dll")]
557 | public static extern short smc_compare_add_point_unit(ushort ConnectNo, ushort axis, double pos, ushort dir, ushort action, uint actpara); //添加比较点
558 | [DllImport("LTSMC.dll")]
559 | public static extern short smc_compare_get_current_point_unit(ushort ConnectNo, ushort axis, ref double pos); //读取当前比较点
560 | [DllImport("LTSMC.dll")]
561 | public static extern short smc_compare_get_points_runned(ushort ConnectNo, ushort axis, ref int pointNum); //查询已经比较过的点
562 | [DllImport("LTSMC.dll")]
563 | public static extern short smc_compare_get_points_remained(ushort ConnectNo, ushort axis, ref int pointNum); //查询可以加入的比较点数量
564 | [DllImport("LTSMC.dll")]
565 | public static extern short smc_compare_add_point_cycle(ushort CardNo, ushort cmp, int pos, ushort dir, uint bitno, uint cycle, ushort level);
566 |
567 | //二维位置比较
568 | [DllImport("LTSMC.dll")]
569 | public static extern short smc_compare_set_config_extern(ushort ConnectNo, ushort enable, ushort cmp_source); //配置比较器
570 | [DllImport("LTSMC.dll")]
571 | public static extern short smc_compare_get_config_extern(ushort ConnectNo, ref ushort enable, ref ushort cmp_source); //读取配置比较器
572 | [DllImport("LTSMC.dll")]
573 | public static extern short smc_compare_clear_points_extern(ushort ConnectNo); //清除所有比较点
574 | [DllImport("LTSMC.dll")]
575 | public static extern short smc_compare_add_point_extern_unit(ushort ConnectNo, ushort[] axis, double[] pos, ushort[] dir, ushort action, uint actpara); //添加两轴位置比较点
576 | [DllImport("LTSMC.dll")]
577 | public static extern short smc_compare_get_current_point_extern_unit(ushort ConnectNo, double[] pos); //读取当前比较点
578 | [DllImport("LTSMC.dll")]
579 | public static extern short smc_compare_get_points_runned_extern(ushort ConnectNo, ref int pointNum); //查询已经比较过的点
580 | [DllImport("LTSMC.dll")]
581 | public static extern short smc_compare_get_points_remained_extern(ushort ConnectNo, ref int pointNum); //查询可以加入的比较点数量
582 |
583 | //高速位置比较
584 | [DllImport("LTSMC.dll")]
585 | public static extern short smc_hcmp_set_mode(ushort ConnectNo, ushort hcmp, ushort cmp_mode);
586 | [DllImport("LTSMC.dll")]
587 | public static extern short smc_hcmp_get_mode(ushort ConnectNo, ushort hcmp, ref ushort cmp_mode);
588 | [DllImport("LTSMC.dll")]
589 | public static extern short smc_hcmp_set_config(ushort ConnectNo, ushort hcmp, ushort axis, ushort cmp_source, ushort cmp_logic, int time);
590 | [DllImport("LTSMC.dll")]
591 | public static extern short smc_hcmp_get_config(ushort ConnectNo, ushort hcmp, ref ushort axis, ref ushort cmp_source, ref ushort cmp_logic, ref int time);
592 | [DllImport("LTSMC.dll")]
593 | public static extern short smc_hcmp_add_point_unit(ushort ConnectNo, ushort hcmp, double cmp_pos);
594 | [DllImport("LTSMC.dll")]
595 | public static extern short smc_hcmp_set_liner_unit(ushort ConnectNo, ushort hcmp, double Increment, int Count);
596 | [DllImport("LTSMC.dll")]
597 | public static extern short smc_hcmp_get_liner_unit(ushort ConnectNo, ushort hcmp, ref double Increment, ref int Count);
598 | [DllImport("LTSMC.dll")]
599 | public static extern short smc_hcmp_get_current_state_unit(ushort ConnectNo, ushort hcmp, ref int remained_points, ref double current_point, ref int runned_points);
600 | [DllImport("LTSMC.dll")]
601 | public static extern short smc_hcmp_clear_points(ushort ConnectNo, ushort hcmp);
602 | [DllImport("LTSMC.dll")]
603 | public static extern short smc_read_cmp_pin(ushort ConnectNo, ushort hcmp);
604 | [DllImport("LTSMC.dll")]
605 | public static extern short smc_write_cmp_pin(ushort ConnectNo, ushort hcmp, ushort on_off);
606 | //高速二维位置比较
607 | [DllImport("LTSMC.dll")]
608 | public static extern short smc_hcmp_2d_set_enable(ushort ConnectNo, ushort hcmp, ushort cmp_enable);
609 | [DllImport("LTSMC.dll")]
610 | public static extern short smc_hcmp_2d_get_enable(ushort ConnectNo, ushort hcmp, ref ushort cmp_enable);
611 | [DllImport("LTSMC.dll")]
612 | public static extern short smc_hcmp_2d_set_config_unit(ushort ConnectNo, ushort hcmp, ushort cmp_mode, ushort x_axis, ushort x_cmp_source, double x_cmp_error, ushort y_axis, ushort y_cmp_source, double y_cmp_error, ushort cmp_logic, int time);
613 | [DllImport("LTSMC.dll")]
614 | public static extern short smc_hcmp_2d_get_config_unit(ushort ConnectNo, ushort hcmp, ref ushort cmp_mode, ref ushort x_axis, ref ushort x_cmp_source, ref double x_cmp_error, ref ushort y_axis, ref ushort y_cmp_source, ref double y_cmp_error, ref ushort cmp_logic, ref int time);
615 | [DllImport("LTSMC.dll")]
616 | public static extern short smc_hcmp_2d_set_pwmoutput(ushort ConnectNo, ushort hcmp, ushort pwm_enable, double duty, double freq, ushort pwm_number);
617 | [DllImport("LTSMC.dll")]
618 | public static extern short smc_hcmp_2d_get_pwmoutput(ushort ConnectNo, ushort hcmp, ref ushort pwm_enable, ref double duty, ref double freq, ref ushort pwm_number);
619 | [DllImport("LTSMC.dll")]
620 | public static extern short smc_hcmp_2d_add_point_unit(ushort ConnectNo, ushort hcmp, double x_cmp_pos, double y_cmp_pos, ushort cmp_outbit);
621 | [DllImport("LTSMC.dll")]
622 | public static extern short smc_hcmp_2d_get_current_state(ushort ConnectNo, ushort hcmp, ref int remained_points, ref double x_current_point, ref double y_current_point, ref int runned_points, ref ushort current_state, ref ushort current_outbit);
623 | [DllImport("LTSMC.dll")]
624 | public static extern short smc_hcmp_2d_clear_points(ushort ConnectNo, ushort hcmp);
625 | [DllImport("LTSMC.dll")]
626 | public static extern short smc_hcmp_2d_force_output(ushort ConnectNo, ushort hcmp, ushort outbit);
627 |
628 | //模拟量操作
629 | //AD
630 | [DllImport("LTSMC.dll")]
631 | public static extern double smc_get_ain(ushort ConnectNo, ushort channel);
632 | [DllImport("LTSMC.dll")]
633 | public static extern short smc_set_ain_action(ushort ConnectNo, ushort channel, ushort mode, double fvoltage, ushort action, double actpara);
634 | [DllImport("LTSMC.dll")]
635 | public static extern short smc_get_ain_action(ushort ConnectNo, ushort channel, ref ushort mode, ref double fvoltage, ref ushort action, ref double actpara);
636 | [DllImport("LTSMC.dll")]
637 | public static extern short smc_get_ain_state(ushort ConnectNo, ushort channel);
638 | [DllImport("LTSMC.dll")]
639 | public static extern short smc_set_ain_state(ushort ConnectNo, ushort channel);
640 | //DA
641 | [DllImport("LTSMC.dll")]
642 | public static extern short smc_set_da_output(ushort ConnectNo, ushort channel, double Vout);
643 | [DllImport("LTSMC.dll")]
644 | public static extern short smc_get_da_output(ushort ConnectNo, ushort channel, ref double Vout);
645 | //点胶参数设置
646 | [DllImport("LTSMC.dll")]
647 | public static extern short smc_glue_set_profile(ushort ConnectNo, ushort glue, ushort io, ushort on_off, double[] Offset, double[] dist, double[] time);
648 | [DllImport("LTSMC.dll")]
649 | public static extern short smc_glue_get_profile(ushort ConnectNo, ushort glue, ref ushort io, ref ushort on_off, double[] Offset, double[] dist, double[] time);
650 | //文件操作
651 | [DllImport("LTSMC.dll")]
652 | public static extern short smc_download_file(ushort CardNo, string pfilename, byte[] pfilenameinControl, ushort filetype);
653 | [DllImport("LTSMC.dll")]
654 | public static extern short smc_download_memfile(ushort CardNo, byte[] pbuffer, uint buffsize, byte[] pfilenameinControl, ushort filetype);
655 | [DllImport("LTSMC.dll")]
656 | public static extern short smc_upload_file(ushort CardNo, string pfilename, byte[] pfilenameinControl, ushort filetype);
657 | [DllImport("LTSMC.dll")]
658 | public static extern short smc_upload_memfile(ushort CardNo, byte[] pbuffer, uint buffsize, byte[] pfilenameinControl, ref uint puifilesize, ushort filetype);
659 | [DllImport("LTSMC.dll")]
660 | public static extern short smc_download_file_to_ram(ushort CardNo, string pfilename, ushort filetype);
661 | [DllImport("LTSMC.dll")]
662 | public static extern short smc_download_memfile_to_ram(ushort CardNo, byte[] pbuffer, uint buffsize, ushort filetype);
663 | [DllImport("LTSMC.dll")]
664 | public static extern short smc_get_progress(ushort ConnectNo, ref float progress);
665 | //寄存器操作
666 | [DllImport("LTSMC.dll")]
667 | public static extern short smc_set_modbus_0x(ushort CardNo, ushort start, ushort inum, byte[] pdata);
668 | [DllImport("LTSMC.dll")]
669 | public static extern short smc_get_modbus_0x(ushort CardNo, ushort start, ushort inum, byte[] pdata);
670 | [DllImport("LTSMC.dll")]
671 | public static extern short smc_set_modbus_4x(ushort CardNo, ushort start, ushort inum, ushort[] pdata);
672 | [DllImport("LTSMC.dll")]
673 | public static extern short smc_get_modbus_4x(ushort CardNo, ushort start, ushort inum, ushort[] pdata);
674 | //Basic变量
675 | [DllImport("LTSMC.dll")]
676 | public static extern short smc_read_array(ushort CardNo, string name, uint index, long[] var, ref int num);
677 | [DllImport("LTSMC.dll")]
678 | public static extern short smc_modify_array(ushort CardNo, string name, uint index, long[] var, int num);
679 | [DllImport("LTSMC.dll")]
680 | public static extern short smc_read_var(ushort CardNo, string varstring, long[] var, ref int num);
681 | [DllImport("LTSMC.dll")]
682 | public static extern short smc_modify_var(ushort CardNo, string varstring, long[] var, int varnum);
683 | [DllImport("LTSMC.dll")]
684 | public static extern short smc_read_array_ex(ushort ConnectNo, string name, uint index, double[] var, ref int num);
685 | [DllImport("LTSMC.dll")]
686 | public static extern short smc_modify_array_ex(ushort ConnectNo, string name, uint index, double[] var, int num);
687 | [DllImport("LTSMC.dll")]
688 | public static extern short smc_read_var_ex(ushort ConnectNo, string varstring, double[] var, ref int num);
689 | [DllImport("LTSMC.dll")]
690 | public static extern short smc_modify_var_ex(ushort ConnectNo, string varstring, double[] var, int varnum);
691 | [DllImport("LTSMC.dll")]
692 | public static extern short smc_write_array_ex(ushort ConnectNo, string name, uint startindex, double[] var, int num);
693 | [DllImport("LTSMC.dll")]
694 | public static extern short smc_get_stringtype(ushort CardNo, string varstring, ref int m_Type, ref int num);
695 | //Basic控制
696 | [DllImport("LTSMC.dll")]
697 | public static extern short smc_basic_state(ushort CardNo, ref ushort State);
698 | [DllImport("LTSMC.dll")]
699 | public static extern short smc_basic_run(ushort CardNo);
700 | [DllImport("LTSMC.dll")]
701 | public static extern short smc_basic_pause(ushort CardNo);
702 | [DllImport("LTSMC.dll")]
703 | public static extern short smc_basic_stop(ushort CardNo);
704 | [DllImport("LTSMC.dll")]
705 | public static extern short smc_basic_continue_run(ushort CardNo);
706 | //Basic调试
707 | [DllImport("LTSMC.dll")]
708 | public static extern short smc_basic_current_line(ushort CardNo, ref int line);
709 | [DllImport("LTSMC.dll")]
710 | public static extern short smc_basic_break_info(ushort CardNo, int[] line, int linenum);
711 | [DllImport("LTSMC.dll")]
712 | public static extern short smc_basic_step_over(ushort CardNo);
713 | [DllImport("LTSMC.dll")]
714 | public static extern short smc_basic_step_run(ushort CardNo);
715 | [DllImport("LTSMC.dll")]
716 | public static extern short smc_basic_message(ushort CardNo, byte[] pbuff, uint uimax, ref uint puiread);
717 | [DllImport("LTSMC.dll")]
718 | public static extern short smc_basic_command(ushort CardNo, byte[] pszCommand, byte[] psResponse, uint uiResponseLength);
719 | //G代码
720 |
721 | [DllImport("LTSMC.dll")]
722 | public static extern short smc_gcode_start(ushort CardNo);
723 | [DllImport("LTSMC.dll")]
724 | public static extern short smc_gcode_stop(ushort CardNo);
725 | [DllImport("LTSMC.dll")]
726 | public static extern short smc_gcode_pause(ushort CardNo);
727 | [DllImport("LTSMC.dll")]
728 | public static extern short smc_gcode_state(ushort CardNo, ref ushort state);
729 | [DllImport("LTSMC.dll")]
730 | public static extern short smc_gcode_clear_file(ushort CardNo);
731 | [DllImport("LTSMC.dll")]
732 | public static extern short smc_gcode_delete_file(ushort CardNo, byte[] pfilenameinControl);
733 | [DllImport("LTSMC.dll")]
734 | public static extern short smc_gcode_current_line(ushort CardNo, ref uint line, byte[] pCurLine);
735 | [DllImport("LTSMC.dll")]
736 | public static extern short smc_gcode_set_current_file(ushort CardNo, byte[] pFileName);
737 | [DllImport("LTSMC.dll")]
738 | public static extern short smc_gcode_get_current_file(ushort CardNo, byte[] pFileName, ref short fileid);
739 | [DllImport("LTSMC.dll")]
740 | public static extern short smc_gcode_get_first_file(ushort CardNo, byte[] pfilenameinControl, ref uint pFileSize);
741 | [DllImport("LTSMC.dll")]
742 | public static extern short smc_gcode_get_next_file(ushort CardNo, byte[] pfilenameinControl, ref uint pFileSize);
743 | [DllImport("LTSMC.dll")]
744 | public static extern short smc_gcode_check_file(ushort CardNo, byte[] pfilenameinControl, ref byte pbIfExist, ref uint pFileSize);
745 | [DllImport("LTSMC.dll")]
746 | public static extern short smc_gcode_get_file_profile(ushort CardNo, ref uint maxfilenum, ref uint maxfilesize);
747 | /******************************************
748 | U盘文件管理
749 | ***************************************/
750 | [DllImport("LTSMC.dll")]
751 | public static extern short smc_udisk_get_state(ushort ConnectNo, ref ushort state);
752 | [DllImport("LTSMC.dll")]
753 | public static extern short smc_udisk_check_file(ushort ConnectNo, byte[] filename, ref int filesize, ushort filetype);
754 | [DllImport("LTSMC.dll")]
755 | public static extern short smc_udisk_get_first_file(ushort ConnectNo, byte[] filename, ref int filesize, ref int fileid, ushort filetype);
756 | [DllImport("LTSMC.dll")]
757 | public static extern short smc_udisk_get_next_file(ushort ConnectNo, byte[] filename, ref int filesize, ref int fileid, ushort filetype);
758 | [DllImport("LTSMC.dll")]
759 | public static extern short smc_udisk_copy_file(ushort ConnectNo, string SrcFileName, string DstFileName, ushort filetype, ushort mode);
760 | //当前位置
761 | [DllImport("LTSMC.dll")]
762 | public static extern short smc_set_encoder_unit(ushort ConnectNo, ushort axis, double pos);
763 | [DllImport("LTSMC.dll")]
764 | public static extern short smc_get_encoder_unit(ushort ConnectNo, ushort axis, ref double pos);
765 | //变速变位
766 | [DllImport("LTSMC.dll")]
767 | public static extern short smc_reset_target_position_unit(ushort ConnectNo, ushort axis, double New_Pos);
768 | [DllImport("LTSMC.dll")]
769 | public static extern short smc_update_target_position_unit(ushort ConnectNo, ushort axis, double New_Pos);
770 | [DllImport("LTSMC.dll")]
771 | public static extern short smc_change_speed_unit(ushort ConnectNo, ushort axis, double New_Vel, double Taccdec);
772 |
773 |
774 | [DllImport("LTSMC.dll")]
775 | public static extern short smc_enter_password(ushort ConnectNo, byte[] str_pass);
776 | [DllImport("LTSMC.dll")]
777 | public static extern short smc_modify_password(ushort ConnectNo, byte[] spassold, byte[] spass);
778 | //掉电保存寄存器操作
779 | [DllImport("LTSMC.dll")]
780 | public static extern short smc_set_persistent_reg(ushort ConnectNo, ushort start, ushort inum, byte[] pdata);
781 | [DllImport("LTSMC.dll")]
782 | public static extern short smc_get_persistent_reg(ushort ConnectNo, ushort start, ushort inum, byte[] pdata);
783 | //参数文件
784 | [DllImport("LTSMC.dll")]
785 | public static extern short smc_download_parafile(ushort ConnectNo, byte[] FileName);
786 | [DllImport("LTSMC.dll")]
787 | public static extern short smc_upload_parafile(ushort ConnectNo, byte[] FileName);
788 | //圆弧限制
789 | [DllImport("LTSMC.dll")]
790 | public static extern short smc_set_arc_limit(ushort ConnectNo, ushort Crd, ushort Enable, double MaxCenAcc, double MaxArcError);
791 | [DllImport("LTSMC.dll")]
792 | public static extern short smc_get_arc_limit(ushort ConnectNo, ushort Crd, ref ushort Enable, ref double MaxCenAcc, ref double MaxArcError);
793 | //
794 | [DllImport("LTSMC.dll")]
795 | public static extern short smc_read_trace_data(ushort ConnectNo, ushort axis, int bufsize, double[] time, double[] pos, double[] vel, double[] acc, ref int recv_num);
796 | [DllImport("LTSMC.dll")]
797 | public static extern short smc_trace_start(ushort ConnectNo, ushort AxisNum, ushort[] AxisList);
798 | [DllImport("LTSMC.dll")]
799 | public static extern short smc_trace_stop(ushort ConnectNo);
800 | [DllImport("LTSMC.dll")]
801 | public static extern short smc_trace_set_source(ushort ConnectNo, ushort source);
802 | //
803 | //实时时钟
804 | [DllImport("LTSMC.dll")]
805 | public static extern short smc_rtc_get_time(ushort ConnectNo, ref int year, ref int month, ref int day, ref int hour, ref int min, ref int sec);
806 | [DllImport("LTSMC.dll")]
807 | public static extern short smc_rtc_set_time(ushort ConnectNo, int year, int month, int day, int hour, int min, int sec);
808 |
809 | //
810 | //
811 | [DllImport("LTSMC.dll")]
812 | public static extern short smc_soft_reset(ushort ConnectNo);
813 | [DllImport("LTSMC.dll")]
814 | public static extern short nmcs_reset_canopen(ushort ConnectNo);
815 | [DllImport("LTSMC.dll")]
816 | public static extern short nmcs_get_total_axes(ushort ConnectNo, ref uint TotalAxis); //读取指定卡轴数
817 | [DllImport("LTSMC.dll")]
818 | public static extern short nmcs_get_total_ionum(ushort ConnectNo, ref ushort TotalIn, ref ushort TotalOut);
819 | [DllImport("LTSMC.dll")]
820 | public static extern short nmcs_get_total_adcnum(ushort ConnectNo, ref ushort TotalIn, ref ushort TotalOut);
821 | [DllImport("LTSMC.dll")]
822 | public static extern short nmcs_get_slave_nodes(ushort ConnectNo, ushort PortNum, ushort baudrate, ushort[] NodeID, ref ushort NodeNum);
823 | [DllImport("LTSMC.dll")]
824 | public static extern short nmcs_get_EmergeneyMessege_Nodes(ushort CardNo, ushort PortNum, uint[] NodeMsg, ref ushort MsgNum);
825 | [DllImport("LTSMC.dll")]
826 | public static extern short nmcs_get_LostHeartbeat_Nodes(ushort CardNo, ushort PortNum, ushort[] NodeID, ref ushort NodeNum);
827 | [DllImport("LTSMC.dll")]
828 | public static extern short nmcs_get_manager_od(ushort CardNo, ushort PortNum, ushort index, ushort subindex, ushort valuelength, ref uint value);
829 | [DllImport("LTSMC.dll")]
830 | public static extern short nmcs_get_manager_para(ushort CardNo, ushort PortNum, ref uint baudrate, ref ushort ManagerID);
831 | [DllImport("LTSMC.dll")]
832 | public static extern short nmcs_get_node_od(ushort CardNo, ushort PortNum, ushort nodenum, ushort index, ushort subindex, ushort valuelength, ref uint value);
833 | [DllImport("LTSMC.dll")]
834 | public static extern short nmcs_reset_to_factory(ushort CardNo, ushort PortNum, ushort NodeNum);
835 | [DllImport("LTSMC.dll")]
836 | public static extern short nmcs_SendNmtCommand(ushort CardNo, ushort PortNum, ushort NodeID, ushort NmtCommand);
837 | [DllImport("LTSMC.dll")]
838 | public static extern short nmcs_set_alarm_clear(ushort CardNo, ushort PortNum, ushort nodenum);
839 | [DllImport("LTSMC.dll")]
840 | public static extern short nmcs_set_axis_enable(ushort CardNo, ushort PortNum, ushort nodenum);
841 | [DllImport("LTSMC.dll")]
842 | public static extern short nmcs_set_manager_od(ushort CardNo, ushort PortNum, ushort index, ushort subindex, ushort valuelength, uint value);
843 | [DllImport("LTSMC.dll")]
844 | public static extern short nmcs_set_manager_para(ushort CardNo, ushort PortNum, int baudrate, ushort ManagerID);
845 | [DllImport("LTSMC.dll")]
846 | public static extern short nmcs_set_node_od(ushort CardNo, ushort PortNum, ushort nodenum, ushort index, ushort subindex, ushort valuelength, uint value);
847 | [DllImport("LTSMC.dll")]
848 | public static extern short nmcs_syn_move(ushort CardNo, ushort AxisNum, ushort[] AxisList, int[] Position, ushort[] PosiMode);
849 | [DllImport("LTSMC.dll")]
850 | public static extern short nmcs_write_outbit(ushort ConnectNo, ushort PortNum, ushort NodeID, ushort IoBit, ushort IoValue);
851 | [DllImport("LTSMC.dll")]
852 | public static extern short nmcs_read_outbit(ushort ConnectNo, ushort PortNum, ushort NodeID, ushort IoBit, ref ushort IoValue);
853 | [DllImport("LTSMC.dll")]
854 | public static extern short nmcs_read_inbit(ushort ConnectNo, ushort PortNum, ushort NodeID, ushort IoBit, ref ushort IoValue);
855 | [DllImport("LTSMC.dll")]
856 | public static extern short nmcs_write_outport(ushort ConnectNo, ushort PortNum, ushort NodeID, ushort PortNo, int IoValue);
857 | [DllImport("LTSMC.dll")]
858 | public static extern short nmcs_read_outport(ushort ConnectNo, ushort PortNum, ushort NodeID, ushort PortNo, ref int IoValue);
859 | [DllImport("LTSMC.dll")]
860 | public static extern short nmcs_read_inport(ushort ConnectNo, ushort PortNum, ushort NodeID, ushort PortNo, ref int IoValue);
861 |
862 | [DllImport("LTSMC.dll")]
863 | public static extern short nmcs_set_controller_workmode(ushort ConnectNo, ushort controller_mode);
864 | [DllImport("LTSMC.dll")]
865 | public static extern short nmcs_get_controller_workmode(ushort ConnectNo, ref ushort controller_mode);
866 | [DllImport("LTSMC.dll")]
867 | public static extern short nmcs_set_cycletime(ushort ConnectNo, ushort FieldbusType, uint CycleTime);
868 | [DllImport("LTSMC.dll")]
869 | public static extern short nmcs_get_cycletime(ushort ConnectNo, ushort FieldbusType, ref uint CycleTime);
870 |
871 | [DllImport("LTSMC.dll")]
872 | public static extern short nmcs_get_axis_state_machine(ushort ConnectNo, ushort axis, ref ushort Axis_StateMachine);
873 | [DllImport("LTSMC.dll")]
874 | public static extern short nmcs_get_axis_statusword(ushort ConnectNo, ushort axis, ref int statusword);
875 | [DllImport("LTSMC.dll")]
876 | public static extern short nmcs_get_axis_setting_contrlmode(ushort ConnectNo, ushort axis, ref int contrlmode);
877 | [DllImport("LTSMC.dll")]
878 | public static extern short nmcs_get_axis_contrlword(ushort ConnectNo, ushort axis, ref int contrlword);
879 | [DllImport("LTSMC.dll")]
880 | public static extern short nmcs_get_axis_type(ushort ConnectNo, ushort axis, ref ushort Axis_Type);
881 |
882 | [DllImport("LTSMC.dll")]
883 | public static extern short nmcs_get_consume_time_fieldbus(ushort ConnectNo, ushort Fieldbustype, ref uint Average_time, ref uint Max_time, ref UInt64 Cycles);
884 | [DllImport("LTSMC.dll")]
885 | public static extern short nmcs_clear_consume_time_fieldbus(ushort ConnectNo, ushort Fieldbustype);
886 |
887 | [DllImport("LTSMC.dll")]
888 | public static extern short nmcs_set_axis_enable(ushort ConnectNo, ushort axis);
889 | [DllImport("LTSMC.dll")]
890 | public static extern short nmcs_set_axis_disable(ushort ConnectNo, ushort axis);
891 | [DllImport("LTSMC.dll")]
892 | public static extern short nmcs_get_axis_io_out(ushort ConnectNo, ushort axis);
893 | [DllImport("LTSMC.dll")]
894 | public static extern short nmcs_set_axis_io_out(ushort ConnectNo, ushort axis, uint iostate);
895 | [DllImport("LTSMC.dll")]
896 | public static extern short nmcs_get_axis_io_in(ushort ConnectNo, ushort axis);
897 |
898 | [DllImport("LTSMC.dll")]
899 | public static extern short nmcs_get_axis_node_address(ushort ConnectNo, ushort axis, ref ushort SlaveAddr, ref ushort Sub_SlaveAddr);
900 | [DllImport("LTSMC.dll")]
901 | public static extern short nmcs_get_total_slaves(ushort ConnectNo, ushort PortNum, ref ushort TotalSlaves);
902 | [DllImport("LTSMC.dll")]
903 | public static extern short nmcs_set_home_profile(ushort ConnectNo, ushort axis, ushort home_mode, double High_Vel, double Low_Vel, double Tacc, double Tdec, double offsetpos);
904 | [DllImport("LTSMC.dll")]
905 | public static extern short nmcs_get_home_profile(ushort ConnectNo, ushort axis, ref ushort home_mode, ref double High_Vel, ref double Low_Vel, ref double Tacc, ref double Tdec, ref double offsetpos);
906 | [DllImport("LTSMC.dll")]
907 | public static extern short nmcs_home_move(ushort ConnectNo, ushort axis);
908 | //
909 | [DllImport("LTSMC.dll")]
910 | public static extern short nmcs_get_errcode(ushort CardNo, ushort channel, ref ushort errcode);
911 | [DllImport("LTSMC.dll")]
912 | public static extern short nmcs_clear_errcode(ushort CardNo, ushort channel);
913 | [DllImport("LTSMC.dll")]
914 | public static extern short nmcs_get_axis_errcode(ushort CardNo, ushort axis, ref ushort Errcode);
915 | [DllImport("LTSMC.dll")]
916 | public static extern short nmcs_clear_axis_errcode(ushort CardNo, ushort axis);
917 | //
918 | [DllImport("LTSMC.dll")]
919 | public static extern short nmcs_write_rxpdo_extra(ushort ConnectNo, ushort PortNum, ushort address, ushort DataLen, uint Value);
920 | [DllImport("LTSMC.dll")]
921 | public static extern short nmcs_read_rxpdo_extra(ushort ConnectNo, ushort PortNum, ushort address, ushort DataLen, ref uint Value);
922 | [DllImport("LTSMC.dll")]
923 | public static extern short nmcs_read_txpdo_extra(ushort ConnectNo, ushort PortNum, ushort address, ushort DataLen, ref uint Value);
924 | //
925 | //RTEX
926 | //
927 | [DllImport("LTSMC.dll")]
928 | public static extern short nmcs_start_connect(ushort ConnectNo, ushort chan, ushort[] info, ref ushort len);
929 | [DllImport("LTSMC.dll")]
930 | public static extern short nmcs_get_vendor_info(ushort ConnectNo, ushort axis, byte[] info, ref ushort len);
931 | [DllImport("LTSMC.dll")]
932 | public static extern short nmcs_get_slave_type_info(ushort ConnectNo, ushort axis, byte[] info, ref ushort len);
933 | [DllImport("LTSMC.dll")]
934 | public static extern short nmcs_get_slave_name_info(ushort ConnectNo, ushort axis, byte[] info, ref ushort len);
935 | [DllImport("LTSMC.dll")]
936 | public static extern short nmcs_get_slave_version_info(ushort ConnectNo, ushort axis, byte[] info, ref ushort len);
937 | [DllImport("LTSMC.dll")]
938 | public static extern short nmcs_write_parameter(ushort ConnectNo, ushort axis, ushort index, ushort subindex, uint para_data);
939 | [DllImport("LTSMC.dll")]
940 | public static extern short nmcs_write_slave_eeprom(ushort ConnectNo, ushort axis);
941 | [DllImport("LTSMC.dll")]
942 | public static extern short nmcs_read_parameter(ushort ConnectNo, ushort axis, ushort index, ushort subindex, ref uint para_data);
943 | [DllImport("LTSMC.dll")]
944 | public static extern short nmcs_read_parameter_attributes(ushort ConnectNo, ushort axis, ushort index, ushort subindex, ref uint para_data);
945 | [DllImport("LTSMC.dll")]
946 | public static extern short nmcs_set_cmdcycletime(ushort ConnectNo, ushort PortNum, uint cmdtime);
947 | [DllImport("LTSMC.dll")]
948 | public static extern short nmcs_get_cmdcycletime(ushort ConnectNo, ushort PortNum, ref uint cmdtime);
949 | [DllImport("LTSMC.dll")]
950 | public static extern short nmcs_start_log(ushort ConnectNo, ushort chan, ushort node, ushort Ifenable);
951 | [DllImport("LTSMC.dll")]
952 | public static extern short nmcs_get_log(ushort ConnectNo, ushort chan, ushort node, uint[] data);
953 | [DllImport("LTSMC.dll")]
954 | public static extern short nmcs_config_atuo_log(ushort ConnectNo, ushort ifenable, ushort dir, ushort byte_index, ushort mask, ushort condition, uint counter);
955 | [DllImport("LTSMC.dll")]
956 | public static extern short nmcs_get_log_state(ushort ConnectNo, ushort chan, ref uint state);
957 | [DllImport("LTSMC.dll")]
958 | public static extern short nmcs_driver_reset(ushort ConnectNo, ushort axis);
959 |
960 |
961 |
962 | }
963 | }
964 |
--------------------------------------------------------------------------------