库伯勒立撤倍加福三合一拉线编码器配置工具

news/2024/11/9 9:44:28/

库伯勒立撤倍加福三合一拉线编码器配置工具

    • 库伯勒编码器配置界面
    • 立撤编码器配置界面
    • 倍加福编码器配置界面

基于C#语言开发,快速配置,自动保存,支持多种CAN工具接入使用。
无需使用查看配置手册,即可能够快速有效的配置拉线编码器。
给安装、生产、调试带来便利。

软件下载地址:https://download.csdn.net/download/ahphong/87246828

库伯勒编码器配置界面

在这里插入图片描述

立撤编码器配置界面

在这里插入图片描述

倍加福编码器配置界面

在这里插入图片描述

部分核心代码

#region can初始化/// <summary>/// can初始化/// </summary>private void CAN_init(){List<Devtype> Devtype_List = new List<Devtype>();Devtype_List.Add(new Devtype { ID = 0, Name = "请选择CAN盒" });Devtype_List.Add(new Devtype { ID = 1, Name = "PCI5121" });Devtype_List.Add(new Devtype { ID = 2, Name = "PCI9810" });Devtype_List.Add(new Devtype { ID = 3, Name = "USBCAN1" });Devtype_List.Add(new Devtype { ID = 4, Name = "USBCAN2/USBCAN2A" });Devtype_List.Add(new Devtype { ID = 5, Name = "PCI9820" });Devtype_List.Add(new Devtype { ID = 6, Name = "CAN232" });Devtype_List.Add(new Devtype { ID = 7, Name = "PCI5110" });Devtype_List.Add(new Devtype { ID = 8, Name = "CANLITE" });Devtype_List.Add(new Devtype { ID = 9, Name = "ISA9620" });Devtype_List.Add(new Devtype { ID = 10, Name = "ISA5420" });Devtype_List.Add(new Devtype { ID = 11, Name = "PC104CAN" });Devtype_List.Add(new Devtype { ID = 12, Name = "CANETUDP" });Devtype_List.Add(new Devtype { ID = 13, Name = "DNP9810" });Devtype_List.Add(new Devtype { ID = 14, Name = "PCI9840" });Devtype_List.Add(new Devtype { ID = 15, Name = "PC104CAN2" });Devtype_List.Add(new Devtype { ID = 16, Name = "PCI9820I" });Devtype_List.Add(new Devtype { ID = 17, Name = "CANETTCP" });Devtype_List.Add(new Devtype { ID = 18, Name = "PEC9920" });Devtype_List.Add(new Devtype { ID = 19, Name = "PCI5010U" });Devtype_List.Add(new Devtype { ID = 20, Name = "USBCAN_E_U" });Devtype_List.Add(new Devtype { ID = 21, Name = "USBCAN_2E_U" });Devtype_List.Add(new Devtype { ID = 22, Name = "PCI5020U" });Devtype_List.Add(new Devtype { ID = 23, Name = "EG20T_CAN" });comboBox_devtype.ItemsSource = Devtype_List;comboBox_devtype.SelectedIndex = 21; //默认USBCAN_2E_UList<DevIndex> DevIndex_List = new List<DevIndex>();DevIndex_List.Add(new DevIndex { ID = 0, Name = "0" });DevIndex_List.Add(new DevIndex { ID = 1, Name = "1" });comboBox_DevIndex.ItemsSource = DevIndex_List;comboBox_DevIndex.SelectedIndex = 0; //默认0索引List<CANIndex> CANIndex_List = new List<CANIndex>();CANIndex_List.Add(new CANIndex { ID = 0, Name = "0" });CANIndex_List.Add(new CANIndex { ID = 1, Name = "1" });CANIndex_List.Add(new CANIndex { ID = 2, Name = "2" });CANIndex_List.Add(new CANIndex { ID = 3, Name = "3" });comboBox_CANIndex.ItemsSource = CANIndex_List;comboBox_CANIndex.SelectedIndex = 0; //默认0路canList<Filter> Filter_List = new List<Filter>();Filter_List.Add(new Filter { ID = 0, Name = "双滤波" });Filter_List.Add(new Filter { ID = 1, Name = "单滤波" });comboBox_Filter.ItemsSource = Filter_List;comboBox_Filter.SelectedIndex = 1;List<Mode> Mode_List = new List<Mode>();Mode_List.Add(new Mode { ID = 0, Name = "正常" });Mode_List.Add(new Mode { ID = 1, Name = "只听" });comboBox_Mode.ItemsSource = Mode_List;comboBox_Mode.SelectedIndex = 0;List<SendType> SendType_List = new List<SendType>();SendType_List.Add(new SendType { ID = 0, Name = "正常发送" });SendType_List.Add(new SendType { ID = 1, Name = "单次正常发送" });SendType_List.Add(new SendType { ID = 2, Name = "自发自收" });SendType_List.Add(new SendType { ID = 3, Name = "单次自发自收" });List<FrameFormat> FrameFormat_List = new List<FrameFormat>();FrameFormat_List.Add(new FrameFormat { ID = 0, Name = "正常发送" });FrameFormat_List.Add(new FrameFormat { ID = 1, Name = "单次正常发送" });List<FrameType> FrameType_List = new List<FrameType>();FrameType_List.Add(new FrameType { ID = 0, Name = "标准帧" });FrameType_List.Add(new FrameType { ID = 1, Name = "扩展帧" });List<e_u_baud> e_u_baud_List = new List<e_u_baud>();e_u_baud_List.Add(new e_u_baud { ID = 0, Name = "1000K" });e_u_baud_List.Add(new e_u_baud { ID = 1, Name = "800K" });e_u_baud_List.Add(new e_u_baud { ID = 2, Name = "500K" });e_u_baud_List.Add(new e_u_baud { ID = 3, Name = "250K" });e_u_baud_List.Add(new e_u_baud { ID = 4, Name = "125K" });e_u_baud_List.Add(new e_u_baud { ID = 5, Name = "100K" });comboBox_e_u_baud.ItemsSource = e_u_baud_List;comboBox_e_u_baud.SelectedIndex = 3;//250KbpsList<e_u_Filter> e_u_Filter_List = new List<e_u_Filter>();e_u_Filter_List.Add(new e_u_Filter { ID = 0, Name = "标准帧滤波" });e_u_Filter_List.Add(new e_u_Filter { ID = 1, Name = "扩展帧滤波" });e_u_Filter_List.Add(new e_u_Filter { ID = 2, Name = "禁能滤波" });comboBox_e_u_Filter.ItemsSource = e_u_Filter_List;comboBox_e_u_Filter.SelectedIndex = 2;//禁用List<e_u_startid> e_u_startid_List = new List<e_u_startid>();e_u_startid_List.Add(new e_u_startid { ID = 0, Name = "1" });textBox_e_u_startid.ItemsSource = e_u_startid_List;textBox_e_u_startid.SelectedIndex = 0;List<e_u_endid> e_u_endid_List = new List<e_u_endid>();e_u_endid_List.Add(new e_u_endid { ID = 0, Name = "FF" });textBox_e_u_endid.ItemsSource = e_u_endid_List;textBox_e_u_endid.SelectedIndex = 0;}#region 显示接收数据/// <summary>/// 显示接收数据/// </summary>unsafe private void ReceiveServer(){UInt32 res = new UInt32();res = VCI_GetReceiveNum(m_devtype, m_devind, m_canind);if (res == 0)return;IntPtr pt = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(VCI_CAN_OBJ)) * (Int32)res);res = VCI_Receive(m_devtype, m_devind, m_canind, pt, res, 100);String str = "";for (UInt32 i = 0; i < res; i++){VCI_CAN_OBJ obj = (VCI_CAN_OBJ)Marshal.PtrToStructure((IntPtr)((UInt32)pt + i * Marshal.SizeOf(typeof(VCI_CAN_OBJ))), typeof(VCI_CAN_OBJ));str = "收到: ";str += "ID:0x" + System.Convert.ToString((Int32)obj.ID, 16);str += " 格式:";if (obj.RemoteFlag == 0)str += "数据帧 ";elsestr += "远程帧 ";if (obj.ExternFlag == 0)str += "标准帧 ";elsestr += "扩展帧 ";if (obj.RemoteFlag == 0){str += "数据:";byte len = (byte)(obj.DataLen % 9);byte j = 0;if (j++ < len)str += " " + obj.Data[0].ToString("X2");if (j++ < len)str += " " + obj.Data[1].ToString("X2");if (j++ < len)str += " " + obj.Data[2].ToString("X2");if (j++ < len)str += " " + obj.Data[3].ToString("X2");if (j++ < len)str += " " + obj.Data[4].ToString("X2");if (j++ < len)str += " " + obj.Data[5].ToString("X2");if (j++ < len)str += " " + obj.Data[6].ToString("X2");if (j++ < len)str += " " + obj.Data[7].ToString("X2");}System.Windows.Application.Current.Dispatcher.Invoke(new Action(() =>{listBox_Info.Items.Add(str);listBox_Info_Count.Content = listBox_Info.Items.Count;listBox_Info.SelectedIndex = listBox_Info.Items.Count;listBox_Info.ScrollIntoView(listBox_Info.SelectedItem);}));if (listBox_Info.Items.Count >= 9999){try{System.Windows.Application.Current.Dispatcher.Invoke(new Action(() =>{listBox_Info.Items.Clear();listBox_Info_Count.Content = 0;}));}catch{Dispatcher.Invoke(new Action(delegate{listBox_Info.Items.Clear();listBox_Info_Count.Content = 0;}));}}}Marshal.FreeHGlobal(pt);}#endregion#endregion#region 开启节点/// <summary>/// 开启节点/// </summary>/// <param name="sender"></param>/// <param name="e"></param>unsafe private void OpenCAN_Click(object sender, EventArgs e){if (m_bOpen == 0){Dispatcher.Invoke(new Action(delegate{MessageBox.Show("设备未连接,请先点击【连接并启动】按钮", this);}));return;}try{string FrameID = "01 00";System.Windows.Application.Current.Dispatcher.Invoke(new Action(() =>{VCI_CAN_OBJ sendobj = new VCI_CAN_OBJ();sendobj.SendType = (byte)0;sendobj.RemoteFlag = (byte)0;sendobj.ExternFlag = (byte)0;sendobj.ID = System.Convert.ToUInt32("0x" + "00000000", 16);int len = (FrameID.Length + 1) / 3;sendobj.DataLen = System.Convert.ToByte(len);String strdata = FrameID;int i = -1;if (i++ < len - 1)sendobj.Data[0] = System.Convert.ToByte("0x" + strdata.Substring(i * 3, 2), 16);if (i++ < len - 1)sendobj.Data[1] = System.Convert.ToByte("0x" + strdata.Substring(i * 3, 2), 16);if (i++ < len - 1)sendobj.Data[2] = System.Convert.ToByte("0x" + strdata.Substring(i * 3, 2), 16);if (i++ < len - 1)sendobj.Data[3] = System.Convert.ToByte("0x" + strdata.Substring(i * 3, 2), 16);if (i++ < len - 1)sendobj.Data[4] = System.Convert.ToByte("0x" + strdata.Substring(i * 3, 2), 16);if (i++ < len - 1)sendobj.Data[5] = System.Convert.ToByte("0x" + strdata.Substring(i * 3, 2), 16);if (i++ < len - 1)sendobj.Data[6] = System.Convert.ToByte("0x" + strdata.Substring(i * 3, 2), 16);if (i++ < len - 1)sendobj.Data[7] = System.Convert.ToByte("0x" + strdata.Substring(i * 3, 2), 16);int nTimeOut = 0;VCI_SetReference(m_devtype, m_devind, m_canind, 4, (byte*)&nTimeOut);if (VCI_Transmit(m_devtype, m_devind, m_canind, ref sendobj, 1) == 0){Dispatcher.Invoke(new Action(delegate{MessageBox.Show("节点开启失败", this);}));return;}}));}catch { }}#endregion
#region 发送数据VCI_CAN_OBJ sendobj = new VCI_CAN_OBJ();/// <summary>/// CAN发送数据,CANID、FrameData数据/// </summary>/// <param name="CANID"></param>/// <param name="FrameData"></param>unsafe private void CANSendMessage(string CANID, String FrameData){if (m_bOpen == 0){Dispatcher.Invoke(new Action(delegate{MessageBox.Show("设备未连接,请先点击【连接并启动】按钮", this);}));return;}try{sendobj.SendType = (byte)0;sendobj.RemoteFlag = (byte)0;sendobj.ExternFlag = (byte)0;sendobj.ID = System.Convert.ToUInt32("0x" + CANID, 16);int len = (FrameData.Length + 1) / 3;sendobj.DataLen = System.Convert.ToByte(len);String strdata = FrameData;int i = -1;System.Windows.Application.Current.Dispatcher.Invoke(new Action(() =>{if (i++ < len - 1)sendobj.Data[0] = System.Convert.ToByte("0x" + strdata.Substring(i * 3, 2), 16);if (i++ < len - 1)sendobj.Data[1] = System.Convert.ToByte("0x" + strdata.Substring(i * 3, 2), 16);if (i++ < len - 1)sendobj.Data[2] = System.Convert.ToByte("0x" + strdata.Substring(i * 3, 2), 16);if (i++ < len - 1)sendobj.Data[3] = System.Convert.ToByte("0x" + strdata.Substring(i * 3, 2), 16);if (i++ < len - 1)sendobj.Data[4] = System.Convert.ToByte("0x" + strdata.Substring(i * 3, 2), 16);if (i++ < len - 1)sendobj.Data[5] = System.Convert.ToByte("0x" + strdata.Substring(i * 3, 2), 16);if (i++ < len - 1)sendobj.Data[6] = System.Convert.ToByte("0x" + strdata.Substring(i * 3, 2), 16);if (i++ < len - 1)sendobj.Data[7] = System.Convert.ToByte("0x" + strdata.Substring(i * 3, 2), 16);int nTimeOut = 0;VCI_SetReference(m_devtype, m_devind, m_canind, 4, (byte*)&nTimeOut);if (VCI_Transmit(m_devtype, m_devind, m_canind, ref sendobj, 1) == 0){Thread.Sleep(SleppTime);}}));if (ShowSendMsg){SHOWCANID = CANID;System.Windows.Application.Current.Dispatcher.Invoke(new Action(() =>{listBox_Send.Items.Add(DateTime.Now.ToString(" HH:mm:ss") + "  发送:  " + SHOWCANID + "    " + FrameData);listBox_Send_Count.Content = listBox_Send.Items.Count;listBox_Send.SelectedIndex = listBox_Send.Items.Count;listBox_Send.ScrollIntoView(listBox_Send.SelectedItem);listBox_Send.ScrollIntoView(listBox_Send.SelectedIndex);}));}if (listBox_Send.Items.Count >= 9999){listBox_Send.Items.Clear();listBox_Send_Count.Content = 0;}}catch{}}#endregion

http://www.ppmy.cn/news/178840.html

相关文章

beoplay耳机序列号查询_BO PLAY推出全新无线蓝牙耳机BEOPLAY E8

B&O PLAY推出全新无线蓝牙耳机BEOPLAY E8 Beoplay E8在传送优质音效的同时彰显出简捷有型的设计气势派头&#xff0c;Bang #00183; 连接上Beoplay E8的同时&#xff0c;只需将两只耳机插入充电盒便可自动充电&#xff0c;只需将耳机从高级皮革充电收纳盒中取出&#xff0c;…

倍加福耦合器KFD2-BR-1.PA.1500

倍加福耦合器KFD2-BR-1.PA.1500 基本段耦合器 KFD2-BR-1.PA.1500 输出&#xff1a;24 … 26 V/400 mA 将 PROFIBUS PA 设备透明地耦合到 PROFIBUS DP 高功率干线&#xff0c;适用于高设备数量和长电缆长度 安装在 Zone 2/Class I, Div. 2 高达 1.5 MBit 自适应 PROFIBUS DP 终…

倍加福LB1108A数字量输入模块

倍加福LB1108A数字量输入模块 数字输入 LB1108A 8通道 输入 Ex ia 安装在 Zone 2, Class I/Div.2 或安全区域 干接点或 NAMUR 输入 正负逻辑可选 服务操作的模拟模式&#xff08;强制&#xff09; 线路故障检测 (LFD) 永久自我监控 模块可带电压互换 占用槽位 2 供应 连接背板…

鸽鸽乐游戏

一款割草游戏

百利天恒更新招股书:上半年收入约3亿元,持续加大研发投入

近日&#xff0c;四川百利天恒药业股份有限公司&#xff08;下称“百利天恒”&#xff09;在上海证券交易所科创板更新了招股书&#xff08;注册稿&#xff09;&#xff0c;补充了2022年上半年的财务数据等信息&#xff0c;并对2022年前三季度的业绩进行了预测。 据贝多财经了…

倍加福安全栅Hic2081

倍加福安全栅Hic2081 温度转换器 HiC2081 1通道隔离栅 24 V DC 电源&#xff08;总线供电&#xff09; 热电偶、RTD、电位器或电压输入 线性化输出 4 mA … 20 mA&#xff0c;灌/源 传感器破损检测 可通过 PACTware 进行配置 线路故障检测 (LFD) 符合 SIL 2 标准。符合 IEC/EN …

数亿!加速科技完成数亿元B+轮战略融资

半导体测试设备领军企业加速科技完成数亿元B轮战略融资&#xff01;本轮融资由方广资本领投&#xff0c;中金资本、东方富海、绅湾资本、银润投资等跟投&#xff0c;将快速推进加速科技新品研发进程&#xff0c;全面助力扩大产能、开拓市场。 加速科技自2015年成立以来&#xf…

倍加福二维码测试1-串口助手测试

读头型号&#xff1a;PCV100-F200-R4-V19-6011 注意&#xff1a;PCV读头用的码带是双层的码带&#xff0c;单层的码带是PXV读头使用&#xff0c;PCV虽然测试也可以读出&#xff0c;但是在移动速度加快以后是响应不过来的。 码带的安装&#xff1a; 1、默认相对平行&#xff0…