資源簡介
本程序用于實現研華運動控制在PC端用labview程序實現各種運動控制
代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Text;
using?System.Windows.Forms;
using?Advantech.Motion;//Common?Motion?API
namespace?AIO
{
????public?partial?class?Form1?:?Form
????{
????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????private?void?Form1_Load(object?sender?EventArgs?e)
????????{
????????????int?Result;
????????????Result?=?Motion.mAcm_GetAvailableDevs(CurAvailableDevs?Motion.MAX_DEVICES?ref?deviceCount);
????????????if?(Result?!=?(int)ErrorCode.SUCCESS)
????????????{
????????????????MessageBox.Show(“Can?Not?Get?Available?Device“?“Device?DIO“?MessageBoxButtons.OK?MessageBoxIcon.Error);
????????????????return;
????????????}
????????????CmbAvailableDevice.Items.Clear();
????????????for?(int?i?=?0;?i?????????????{
????????????????CmbAvailableDevice.Items.Add(CurAvailableDevs[i].DeviceName);
????????????}
????????????if?(deviceCount?>?0)
????????????{
????????????????CmbAvailableDevice.SelectedIndex?=?0;
????????????????DeviceNum?=?CurAvailableDevs[0].DeviceNum;
????????????}
????????}
????????private?void?CmbAvailableDevice_SelectedIndexChanged(object?sender?EventArgs?e)
????????{??
????????????//Stop?Every?Axes
????????????if?(m_bInit?==?true)
????????????{
????????????????//Close?Device
????????????????Motion.mAcm_DevClose(ref?m_DeviceHandle);
????????????????m_DeviceHandle?=?IntPtr.Zero;
????????????????timer1.Enabled?=?false;
????????????????m_bInit?=?false;
????????????}
????????????DeviceNum?=?CurAvailableDevs[CmbAvailableDevice.SelectedIndex].DeviceNum;
????????}
????????private?void?timer1_Tick(object?sender?EventArgs?e)
????????{
????????????ushort?rawData?=0;
????????????float?voltData?=?0.0f;
????????????Motion.mAcm_DaqAiGetRawData(m_DeviceHandle?(ushort)cb_AiChan.SelectedIndex?ref?rawData);
????????????Motion.mAcm_DaqAiGetVoltData(m_DeviceHandle?(ushort)cb_AiChan.SelectedIndex?ref?voltData);
????????????tb_RawData.Text?=?rawData.ToString();
????????????tb_VoltData.Text?=?voltData.ToString(“f4“);
????????}
?
????????private?void?btn_OpenBrd_Click(object?sender?EventArgs?e)
????????{
????????????UInt32?Result;
????????????uint?buffer?=0?bufferLen=?sizeof(uint);
????????????Result?=?Motion.mAcm_DevOpen(DeviceNum?ref?m_DeviceHandle);
????????????if?(Result?!=?(uint)ErrorCode.SUCCESS)
????????????{
????????????????MessageBox.Show(“Can?Not?Open?Device“?“AIO“?MessageBoxButtons.OK?MessageBoxIcon.Error);
????????????????return;
????????????}
????????????m_bInit?=?true;
????????????Result?=?Motion.mAcm_GetProperty(m_DeviceHandle?(uint)PropertyID.CFG_DaqAiChanType?ref?buffer?ref?bufferLen);
????????????if?(Result?!=?(uint)ErrorCode.SUCCESS)
????????????{
????????????????MessageBox.Show(“Failed?To?Get?AI?Channel?Type?Configuration!“?“AIO“?MessageBoxButtons.OK?MessageBoxIcon.Error);
????????????
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2015-09-24?13:49??Common?Motion\
?????目錄???????????0??2015-09-24?13:48??Common?Motion\Examples\
?????目錄???????????0??2015-09-24?13:48??Common?Motion\Examples\General\
?????文件????????4968??2014-06-20?15:21??Common?Motion\Examples\General\General.bas
?????文件?????????140??2014-06-20?15:21??Common?Motion\Examples\General\General.h
?????目錄???????????0??2015-09-24?13:49??Common?Motion\Examples\Windows\
?????目錄???????????0??2015-09-24?13:49??Common?Motion\Examples\Windows\C#\
?????目錄???????????0??2015-09-24?13:48??Common?Motion\Examples\Windows\C#\AIO\
?????文件????????3646??2014-06-20?15:22??Common?Motion\Examples\Windows\C#\AIO\AIO.csproj
?????文件?????????894??2014-06-20?15:22??Common?Motion\Examples\Windows\C#\AIO\AIO.sln
?????文件???????12589??2014-06-20?15:22??Common?Motion\Examples\Windows\C#\AIO\Form1.Designer.cs
?????文件????????5074??2014-06-20?15:22??Common?Motion\Examples\Windows\C#\AIO\Form1.cs
?????文件????????6008??2014-06-20?15:22??Common?Motion\Examples\Windows\C#\AIO\Form1.resx
?????文件?????????473??2014-06-20?15:22??Common?Motion\Examples\Windows\C#\AIO\Program.cs
?????目錄???????????0??2015-09-24?13:48??Common?Motion\Examples\Windows\C#\AIO\Properties\
?????文件????????1278??2014-06-20?15:22??Common?Motion\Examples\Windows\C#\AIO\Properties\AssemblyInfo.cs
?????文件????????2833??2014-06-20?15:22??Common?Motion\Examples\Windows\C#\AIO\Properties\Resources.Designer.cs
?????文件????????5612??2014-06-20?15:22??Common?Motion\Examples\Windows\C#\AIO\Properties\Resources.resx
?????文件????????1084??2014-06-20?15:22??Common?Motion\Examples\Windows\C#\AIO\Properties\Settings.Designer.cs
?????文件?????????249??2014-06-20?15:22??Common?Motion\Examples\Windows\C#\AIO\Properties\Settings.settings
?????文件?????????814??2014-06-20?15:22??Common?Motion\Examples\Windows\C#\AIO\Properties\app.manifest
?????目錄???????????0??2015-09-24?13:48??Common?Motion\Examples\Windows\C#\AIO\bin\
?????目錄???????????0??2015-09-24?13:48??Common?Motion\Examples\Windows\C#\AIO\bin\Release\
?????文件???????24576??2014-06-20?15:22??Common?Motion\Examples\Windows\C#\AIO\bin\Release\AIO.exe
?????文件????????2899??2014-06-20?15:22??Common?Motion\Examples\Windows\C#\AIO\bin\Release\AIO.exe.manifest
?????文件???????90112??2014-06-20?15:22??Common?Motion\Examples\Windows\C#\AIO\bin\Release\AdvMotAPI.dll
?????目錄???????????0??2015-09-24?13:48??Common?Motion\Examples\Windows\C#\ARC\
?????文件????????3600??2014-06-20?15:22??Common?Motion\Examples\Windows\C#\ARC\ARC.csproj
?????文件?????????894??2014-06-20?15:22??Common?Motion\Examples\Windows\C#\ARC\ARC.sln
?????文件???????34425??2014-06-20?15:22??Common?Motion\Examples\Windows\C#\ARC\Form1.Designer.cs
?????文件???????17590??2014-06-20?15:22??Common?Motion\Examples\Windows\C#\ARC\Form1.cs
............此處省略2009個文件信息
- 上一篇:vlc-2.2.1-win32.exe
- 下一篇:打印機維修不是事
評論
共有 條評論