資源簡介
代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Linq;
using?System.Text;
using?System.Threading.Tasks;
using?System.Windows.Forms;
using?csLTDMC;
namespace?定長運動_脈沖當量_
{
????public?partial?class?Form1?:?Form
????{
????????private?ushort?_CardID?=?0;
????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????private?void?Form1_Load(object?sender?EventArgs?e)
????????{
????????????short?num?=?LTDMC.dmc_board_init();//獲取卡數量
????????????if?(num?<=?0?||?num?>?8)
????????????{
????????????????MessageBox.Show(“初始卡失敗!“?“出錯“);
????????????}
????????????ushort?_num?=?0;
????????????ushort[]?cardids?=?new?ushort[8];
????????????uint[]?cardtypes?=?new?uint[8];
????????????short?res?=?LTDMC.dmc_get_CardInfList(ref?_num?cardtypes?cardids);
????????????if?(res?!=?0)
????????????{
????????????????MessageBox.Show(“獲取卡信息失敗!“);
????????????}
????????????_CardID?=?cardids[0];
????????????//
????????????timer1.Start();
????????}
????????private?ushort?GetAxis()
????????{
????????????return?decimal.ToUInt16(numericUpDown1.Value);
????????}
????????private?void?button1_Click(object?sender?EventArgs?e)
????????{
????????????ushort?axis?=?GetAxis();?//軸號
????????????double?dEquiv;?//脈沖當量
????????????double?dStartVel;//起始速度
????????????double?dMaxVel;//運行速度
????????????double?dTacc;//加速時間
????????????double?dTdec;//減速時間
????????????double?dStopVel;//停止速度
????????????double?dS_para;//S段時間
????????????double?dDist;//目標位置
????????????ushort?sPosi_mode;?//運動模式0:相對坐標模式,1:絕對坐標模式
????????????dEquiv?=?decimal.ToDouble(numericUpDown2.Value);
????????????dStartVel?=?decimal.ToDouble(numericUpDown3.Value);
????????????dMaxVel?=?decimal.ToDouble(numericUpDown4.Value);
????????????dTacc?=?decimal.ToDouble(numericUpDown5.Value);
????????????dTdec?=?decimal.ToDouble(numericUpDown6.Value);
????????????dStopVel?=?decimal.ToDouble(numericUpDown8.Value);
????????????dS_para?=?decimal.ToDouble(numericUpDown7.Value);
????????????dDist?=?decimal.ToDouble(numericUpDown9.Value);
????????????sPosi_mode?=?0;
???
????????????LTDMC.dmc_set_equiv(_CardID?axis?dEquiv);??//設置脈沖當量
???????
????????????LTDMC.dmc_set_profile_unit(_CardID?axis?dStartVel?dMaxVel?dTacc?dTdec?dStopVel);//設置速度參數
????????????LTDMC.dmc_set_s_profile(_CardID?axis?0?dS_para);//設置S段速度參數
????????????LTDMC.dmc_set_dec_stop_time(_CardID?axis?dTdec);?//設置減速停止時間
????????????LTDMC.dmc_pmove_unit(_CardID?axis?dDist?sPosi_mode);//定長運動
???????????
????????}
????????private?void?button4_Click(object?sender?EventArgs?e)
????????{
????????????ushort?axis?=?GetAxis();?//軸號
????????????ushort?stop_mode?=?0;?//制動方式,0:減速停止,1:緊急停止
????????????LTDMC.dmc_stop(_CardID?axis?stop_mode);
????????}
????????private?void?button5_Click(object?sender?EventArgs?e)
????????{
????????????ushort?axis?=?GetAxis();?//軸號
????????????d
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2020-06-06?15:00??例1_定長運動(脈沖當量)\
?????目錄???????????0??2020-06-06?15:00??例1_定長運動(脈沖當量)\.vs\
?????目錄???????????0??2020-06-06?15:00??例1_定長運動(脈沖當量)\.vs\定長運動(脈沖當量)\
?????目錄???????????0??2020-06-06?15:01??例1_定長運動(脈沖當量)\.vs\定長運動(脈沖當量)\v15\
?????文件???????39936??2020-06-06?15:33??例1_定長運動(脈沖當量)\.vs\定長運動(脈沖當量)\v15\.suo
?????目錄???????????0??2020-06-06?15:01??例1_定長運動(脈沖當量)\.vs\定長運動(脈沖當量)\v15\Server\
?????目錄???????????0??2020-06-06?15:01??例1_定長運動(脈沖當量)\.vs\定長運動(脈沖當量)\v15\Server\sqlite3\
?????文件???????????0??2020-06-06?15:01??例1_定長運動(脈沖當量)\.vs\定長運動(脈沖當量)\v15\Server\sqlite3\db.lock
?????文件????????4096??2020-06-06?15:01??例1_定長運動(脈沖當量)\.vs\定長運動(脈沖當量)\v15\Server\sqlite3\storage.ide
?????文件???????32768??2020-06-06?15:33??例1_定長運動(脈沖當量)\.vs\定長運動(脈沖當量)\v15\Server\sqlite3\storage.ide-shm
?????文件??????745752??2020-06-06?15:01??例1_定長運動(脈沖當量)\.vs\定長運動(脈沖當量)\v15\Server\sqlite3\storage.ide-wal
?????目錄???????????0??2020-04-24?10:35??例1_定長運動(脈沖當量)\定長運動(脈沖當量)\
?????文件?????????167??2017-12-04?00:00??例1_定長運動(脈沖當量)\定長運動(脈沖當量)\App.config
?????文件???????39544??2017-12-04?00:00??例1_定長運動(脈沖當量)\定長運動(脈沖當量)\Form1.Designer.cs
?????文件????????5660??2017-12-04?00:00??例1_定長運動(脈沖當量)\定長運動(脈沖當量)\Form1.cs
?????文件????????6011??2017-12-04?00:00??例1_定長運動(脈沖當量)\定長運動(脈沖當量)\Form1.resx
?????文件??????124861??2017-12-04?00:00??例1_定長運動(脈沖當量)\定長運動(脈沖當量)\LTDMC.cs
?????文件?????????538??2017-12-04?00:00??例1_定長運動(脈沖當量)\定長運動(脈沖當量)\Program.cs
?????目錄???????????0??2020-04-24?10:35??例1_定長運動(脈沖當量)\定長運動(脈沖當量)\Properties\
?????文件????????1390??2017-12-04?00:00??例1_定長運動(脈沖當量)\定長運動(脈沖當量)\Properties\AssemblyInfo.cs
?????文件????????2891??2017-12-04?00:00??例1_定長運動(脈沖當量)\定長運動(脈沖當量)\Properties\Resources.Designer.cs
?????文件????????5612??2017-12-04?00:00??例1_定長運動(脈沖當量)\定長運動(脈沖當量)\Properties\Resources.resx
?????文件????????1125??2017-12-04?00:00??例1_定長運動(脈沖當量)\定長運動(脈沖當量)\Properties\Settings.Designer.cs
?????文件?????????249??2017-12-04?00:00??例1_定長運動(脈沖當量)\定長運動(脈沖當量)\Properties\Settings.settings
?????目錄???????????0??2020-04-24?10:35??例1_定長運動(脈沖當量)\定長運動(脈沖當量)\bin\
?????目錄???????????0??2020-04-24?10:35??例1_定長運動(脈沖當量)\定長運動(脈沖當量)\bin\Debug\
?????文件??????595968??2017-12-04?00:00??例1_定長運動(脈沖當量)\定長運動(脈沖當量)\bin\Debug\LTDMC.dll
?????文件???????65024??2020-10-21?10:13??例1_定長運動(脈沖當量)\定長運動(脈沖當量)\bin\Debug\定長運動(脈沖當量).exe
?????文件?????????167??2017-12-04?00:00??例1_定長運動(脈沖當量)\定長運動(脈沖當量)\bin\Debug\定長運動(脈沖當量).exe.config
?????文件???????71168??2020-10-21?10:13??例1_定長運動(脈沖當量)\定長運動(脈沖當量)\bin\Debug\定長運動(脈沖當量).pdb
?????文件???????22472??2021-01-11?17:24??例1_定長運動(脈沖當量)\定長運動(脈沖當量)\bin\Debug\定長運動(脈沖當量).vshost.exe
............此處省略28個文件信息
評論
共有 條評論