• 大小: 1.77MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-09-02
  • 语言: C#
  • 标签: 电机驱动  

资源简介

用C#编写的直流无刷电机控制上位机源代码,active-semi ,PAC52xx

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;



namespace WindowsFormsApplication1
{
    public partial class Cafe_Form : Form
    {
        FOC_UART_Protocol mFoc;

        public Cafe_Form(FOC_UART_Protocol foc)
        {
            mFoc = foc;

            InitializeComponent();
        }

        private void Cafe_Form_Load(object sender EventArgs e)
        {
            tbAddr.Text = WindowsFormsApplication1.Properties.Settings.Default.cafeRegAddr;
        }

        private void llClear_linkClicked(object sender linkLabellinkClickedEventArgs e)
        {
            tbOutput.Clear();
        }

        private void bRead_Click(object sender EventArgs e)
        {
            uint address;
            if (UInt32.TryParse(tbAddr.Text System.Globalization.Numberstyles.HexNumber null out address) == false)
            {
                MessageBox.Show(“Error: address not valid HEX number“ “Error“ MessageBoxButtons.OK MessageBoxIcon.Error);
                return;
            }

            UInt32 data = 0;
            if (mFoc.cafeRegisterRead((FOC_UART_Protocol.CafeRegAddress)address ref data) != FOC_UART_Protocol.Status.success)
            {
                MessageBox.Show(“Error reading CAFE register“ “Error“ MessageBoxButtons.OK MessageBoxIcon.Error);
                return;
            }

            tbOutput.Text += “ADDR: 0x“ + address.ToString(“X2“) + “ DATA: 0x“ + data.ToString(“X2“) + Environment.NewLine;

        }

        private void tbAddr_TextChanged(object sender EventArgs e)
        {
            WindowsFormsApplication1.Properties.Settings.Default.cafeRegAddr = tbAddr.Text;
            WindowsFormsApplication1.Properties.Settings.Default.Save();
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2016-06-14 07:06  pac52xx_foc_gui-2016-06-06\
     文件         918  2016-06-09 02:54  pac52xx_foc_gui-2016-06-06\pac5xxx_foc_gui.sln
     文件       28160  2016-06-09 02:54  pac52xx_foc_gui-2016-06-06\pac5xxx_foc_gui.v12.suo
     目录           0  2016-06-14 07:06  pac52xx_foc_gui-2016-06-06\WindowsFormsApplication1\
     文件          14  2016-06-09 02:54  pac52xx_foc_gui-2016-06-06\WindowsFormsApplication1\.gitignore
     文件        6526  2016-06-09 02:54  pac52xx_foc_gui-2016-06-06\WindowsFormsApplication1\app.config
     文件    14918932  2016-06-09 02:54  pac52xx_foc_gui-2016-06-06\WindowsFormsApplication1\AS_bug_3D_white_bkgd_tm.ico
     文件       67646  2016-06-09 02:54  pac52xx_foc_gui-2016-06-06\WindowsFormsApplication1\as_icon_gui.ico
     文件        1934  2016-06-09 02:54  pac52xx_foc_gui-2016-06-06\WindowsFormsApplication1\CAFE Form.cs
     文件        4756  2016-06-09 02:54  pac52xx_foc_gui-2016-06-06\WindowsFormsApplication1\CAFE Form.Designer.cs
     文件        5817  2016-06-09 02:54  pac52xx_foc_gui-2016-06-06\WindowsFormsApplication1\CAFE Form.resx
     文件        6618  2016-06-09 02:54  pac52xx_foc_gui-2016-06-06\WindowsFormsApplication1\CAFE Register Form.cs
     文件       10216  2016-06-09 02:54  pac52xx_foc_gui-2016-06-06\WindowsFormsApplication1\CAFE Register Form.Designer.cs
     文件        5817  2016-06-09 02:54  pac52xx_foc_gui-2016-06-06\WindowsFormsApplication1\CAFE Register Form.resx
     文件       73243  2016-06-09 02:54  pac52xx_foc_gui-2016-06-06\WindowsFormsApplication1\CAFE Registers.cs
     文件       28776  2016-06-09 02:54  pac52xx_foc_gui-2016-06-06\WindowsFormsApplication1\Debug_Form.cs
     文件       43151  2016-06-09 02:54  pac52xx_foc_gui-2016-06-06\WindowsFormsApplication1\Debug_Form.Designer.cs
     文件        6020  2016-06-09 02:54  pac52xx_foc_gui-2016-06-06\WindowsFormsApplication1\Debug_Form.resx
     文件       48381  2016-06-09 02:54  pac52xx_foc_gui-2016-06-06\WindowsFormsApplication1\FOC_UART_Prototocol.cs
     文件        1611  2016-06-09 02:54  pac52xx_foc_gui-2016-06-06\WindowsFormsApplication1\Graph Forms.cs
     文件        2523  2016-06-09 02:54  pac52xx_foc_gui-2016-06-06\WindowsFormsApplication1\Graph Forms.Designer.cs
     文件        5817  2016-06-09 02:54  pac52xx_foc_gui-2016-06-06\WindowsFormsApplication1\Graph Forms.resx
     文件      274789  2016-06-09 02:54  pac52xx_foc_gui-2016-06-06\WindowsFormsApplication1\Main Form.cs
     文件      264486  2016-06-09 02:54  pac52xx_foc_gui-2016-06-06\WindowsFormsApplication1\Main Form.Designer.cs
     文件      502978  2016-06-09 02:54  pac52xx_foc_gui-2016-06-06\WindowsFormsApplication1\Main Form.resx
     文件        1074  2016-06-09 02:54  pac52xx_foc_gui-2016-06-06\WindowsFormsApplication1\Parameters_Form.cs
     文件        2328  2016-06-09 02:54  pac52xx_foc_gui-2016-06-06\WindowsFormsApplication1\Parameters_Form.Designer.cs
     文件        5817  2016-06-09 02:54  pac52xx_foc_gui-2016-06-06\WindowsFormsApplication1\Parameters_Form.resx
     文件       12408  2016-06-09 02:54  pac52xx_foc_gui-2016-06-06\WindowsFormsApplication1\Plots Form.cs
     文件       20877  2016-06-09 02:54  pac52xx_foc_gui-2016-06-06\WindowsFormsApplication1\Plots Form.Designer.cs
     文件      193045  2016-06-09 02:54  pac52xx_foc_gui-2016-06-06\WindowsFormsApplication1\Plots Form.resx
............此处省略27个文件信息

评论

共有 条评论