增加吸盘使能/开始/停止按钮

This commit is contained in:
uu
2025-06-27 10:17:20 +08:00
parent 9ab1bac0ad
commit 3724f0b0ea
23 changed files with 5674 additions and 35 deletions

View File

@@ -83,6 +83,9 @@
<Reference Include="MvCameraControl.Net">
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\MVS\Development\DotNet\AnyCpu\MvCameraControl.Net.dll</HintPath>
</Reference>
<Reference Include="NModbus4, Version=2.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\NModbus4.2.1.0\lib\net40\NModbus4.dll</HintPath>
</Reference>
<Reference Include="OfficeOpenXml.Extension.AspNetCore, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\OfficeOpenXml.Extension.AspNetCore.1.0.0\lib\netstandard2.0\OfficeOpenXml.Extension.AspNetCore.dll</HintPath>
</Reference>

View File

@@ -182,6 +182,14 @@
this.label27 = new System.Windows.Forms.Label();
this.button5 = new System.Windows.Forms.Button();
this.tab_SuctionCup = new System.Windows.Forms.TabPage();
this.button22 = new System.Windows.Forms.Button();
this.button21 = new System.Windows.Forms.Button();
this.button20 = new System.Windows.Forms.Button();
this.button19 = new System.Windows.Forms.Button();
this.textBox10 = new System.Windows.Forms.TextBox();
this.comboBox4 = new System.Windows.Forms.ComboBox();
this.label34 = new System.Windows.Forms.Label();
this.button13 = new System.Windows.Forms.Button();
this.groupBox8 = new System.Windows.Forms.GroupBox();
this.button17 = new System.Windows.Forms.Button();
this.button16 = new System.Windows.Forms.Button();
@@ -196,6 +204,7 @@
this.lbl_Refresh_ID = new System.Windows.Forms.Label();
this.tim_IO_Refresh = new System.Windows.Forms.Timer(this.components);
this.rit_Coord = new System.Windows.Forms.RichTextBox();
this.groupBox9 = new System.Windows.Forms.GroupBox();
this.tac_MainForm.SuspendLayout();
this.tap_Axis.SuspendLayout();
this.grb_R.SuspendLayout();
@@ -226,6 +235,7 @@
this.groupBox8.SuspendLayout();
this.groupBox7.SuspendLayout();
this.panel1.SuspendLayout();
this.groupBox9.SuspendLayout();
this.SuspendLayout();
//
// btn_Init
@@ -1909,6 +1919,10 @@
//
// tab_SuctionCup
//
this.tab_SuctionCup.Controls.Add(this.groupBox9);
this.tab_SuctionCup.Controls.Add(this.button22);
this.tab_SuctionCup.Controls.Add(this.button21);
this.tab_SuctionCup.Controls.Add(this.button20);
this.tab_SuctionCup.Controls.Add(this.groupBox8);
this.tab_SuctionCup.Controls.Add(this.groupBox7);
this.tab_SuctionCup.Location = new System.Drawing.Point(4, 22);
@@ -1920,13 +1934,87 @@
this.tab_SuctionCup.UseVisualStyleBackColor = true;
this.tab_SuctionCup.Click += new System.EventHandler(this.tab_SuctionCup_Click);
//
// button22
//
this.button22.Location = new System.Drawing.Point(556, 65);
this.button22.Name = "button22";
this.button22.Size = new System.Drawing.Size(76, 27);
this.button22.TabIndex = 19;
this.button22.Text = "停止";
this.button22.UseVisualStyleBackColor = true;
this.button22.Click += new System.EventHandler(this.button22_Click);
//
// button21
//
this.button21.Location = new System.Drawing.Point(464, 65);
this.button21.Name = "button21";
this.button21.Size = new System.Drawing.Size(76, 27);
this.button21.TabIndex = 18;
this.button21.Text = "开始";
this.button21.UseVisualStyleBackColor = true;
this.button21.Click += new System.EventHandler(this.button21_Click);
//
// button20
//
this.button20.Location = new System.Drawing.Point(374, 65);
this.button20.Name = "button20";
this.button20.Size = new System.Drawing.Size(76, 27);
this.button20.TabIndex = 17;
this.button20.Text = "使能";
this.button20.UseVisualStyleBackColor = true;
this.button20.Click += new System.EventHandler(this.button20_Click);
//
// button19
//
this.button19.Location = new System.Drawing.Point(107, 72);
this.button19.Name = "button19";
this.button19.Size = new System.Drawing.Size(76, 27);
this.button19.TabIndex = 16;
this.button19.Text = "修改ID";
this.button19.UseVisualStyleBackColor = true;
this.button19.Click += new System.EventHandler(this.button19_Click);
//
// textBox10
//
this.textBox10.Location = new System.Drawing.Point(34, 76);
this.textBox10.Name = "textBox10";
this.textBox10.Size = new System.Drawing.Size(63, 21);
this.textBox10.TabIndex = 15;
//
// comboBox4
//
this.comboBox4.FormattingEnabled = true;
this.comboBox4.Location = new System.Drawing.Point(34, 34);
this.comboBox4.Name = "comboBox4";
this.comboBox4.Size = new System.Drawing.Size(63, 20);
this.comboBox4.TabIndex = 14;
//
// label34
//
this.label34.AutoSize = true;
this.label34.Location = new System.Drawing.Point(4, 38);
this.label34.Name = "label34";
this.label34.Size = new System.Drawing.Size(29, 12);
this.label34.TabIndex = 13;
this.label34.Text = "ID";
//
// button13
//
this.button13.Location = new System.Drawing.Point(107, 31);
this.button13.Name = "button13";
this.button13.Size = new System.Drawing.Size(76, 27);
this.button13.TabIndex = 12;
this.button13.Text = "扫描ID";
this.button13.UseVisualStyleBackColor = true;
this.button13.Click += new System.EventHandler(this.button13_Click);
//
// groupBox8
//
this.groupBox8.Controls.Add(this.button17);
this.groupBox8.Controls.Add(this.button16);
this.groupBox8.Controls.Add(this.button15);
this.groupBox8.Controls.Add(this.button14);
this.groupBox8.Location = new System.Drawing.Point(43, 180);
this.groupBox8.Location = new System.Drawing.Point(43, 171);
this.groupBox8.Name = "groupBox8";
this.groupBox8.Size = new System.Drawing.Size(192, 127);
this.groupBox8.TabIndex = 11;
@@ -1982,7 +2070,7 @@
this.groupBox7.Controls.Add(this.comboBox3);
this.groupBox7.Controls.Add(this.label33);
this.groupBox7.Controls.Add(this.button18);
this.groupBox7.Location = new System.Drawing.Point(43, 42);
this.groupBox7.Location = new System.Drawing.Point(43, 32);
this.groupBox7.Margin = new System.Windows.Forms.Padding(2);
this.groupBox7.Name = "groupBox7";
this.groupBox7.Padding = new System.Windows.Forms.Padding(2);
@@ -2013,7 +2101,7 @@
//
// button18
//
this.button18.Location = new System.Drawing.Point(29, 67);
this.button18.Location = new System.Drawing.Point(42, 66);
this.button18.Margin = new System.Windows.Forms.Padding(2);
this.button18.Name = "button18";
this.button18.Size = new System.Drawing.Size(104, 27);
@@ -2064,6 +2152,20 @@
this.rit_Coord.Text = "";
this.rit_Coord.TextChanged += new System.EventHandler(this.rit_Coord_TextChanged);
//
// groupBox9
//
this.groupBox9.Controls.Add(this.comboBox4);
this.groupBox9.Controls.Add(this.label34);
this.groupBox9.Controls.Add(this.button13);
this.groupBox9.Controls.Add(this.textBox10);
this.groupBox9.Controls.Add(this.button19);
this.groupBox9.Location = new System.Drawing.Point(43, 323);
this.groupBox9.Name = "groupBox9";
this.groupBox9.Size = new System.Drawing.Size(192, 121);
this.groupBox9.TabIndex = 20;
this.groupBox9.TabStop = false;
this.groupBox9.Text = "ID设置";
//
// ShowForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -2129,6 +2231,8 @@
this.groupBox7.ResumeLayout(false);
this.groupBox7.PerformLayout();
this.panel1.ResumeLayout(false);
this.groupBox9.ResumeLayout(false);
this.groupBox9.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
@@ -2302,6 +2406,15 @@
private System.Windows.Forms.ComboBox comboBox3;
private System.Windows.Forms.Label label33;
private System.Windows.Forms.Button button18;
private System.Windows.Forms.Button button13;
private System.Windows.Forms.TextBox textBox10;
private System.Windows.Forms.ComboBox comboBox4;
private System.Windows.Forms.Label label34;
private System.Windows.Forms.Button button19;
private System.Windows.Forms.Button button20;
private System.Windows.Forms.Button button22;
private System.Windows.Forms.Button button21;
private System.Windows.Forms.GroupBox groupBox9;
}
}

View File

@@ -11,6 +11,7 @@ using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using TcpserverExDll;
@@ -346,6 +347,7 @@ namespace HitBotCSharpDemo
suctionCupControl = new SuctionCupControl();
suctionCupControl.LoadAvailablePorts(comboBox3);
suctionCupControl.SetComboBoxReference(comboBox4);
textBox6.Click += TextBox_Click;
textBox7.Click += TextBox_Click;
@@ -362,10 +364,13 @@ namespace HitBotCSharpDemo
button10.Enabled = false;
button12.Enabled = false;
button21.Enabled = false;
button22.Enabled = false;
cam_zoom.SizeMode = PictureBoxSizeMode.Zoom;
InitializeHeatingButtons();
textBox10.Text = "9";
}
private void InitializeHeatingButtons()
{
@@ -1862,5 +1867,191 @@ namespace HitBotCSharpDemo
{
MoveToSuctionCupPosition(3); // 移动到第4个吸盘点位
}
private void button13_Click(object sender, EventArgs e)
{
// 检查串口是否打开
if (suctionCupControl == null || !suctionCupControl.IsSerialPortOpen())
{
MessageBox.Show("请先打开吸盘控制串口", "提示",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
// 禁用按钮,防止重复点击
button13.Enabled = false;
button13.Text = "扫描中...";
// 清空ComboBox4
comboBox4.Items.Clear();
// 在后台线程中执行扫描
Task.Run(() =>
{
try
{
// 扫描ID范围1-247的设备
List<int> availableDevices = suctionCupControl.ScanModbusDevices(1, 247);
// 在UI线程中更新ComboBox
this.Invoke(new Action(() =>
{
foreach (int deviceId in availableDevices)
{
comboBox4.Items.Add(deviceId.ToString());
}
// 如果找到设备,默认选择第一个
if (comboBox4.Items.Count > 0)
{
comboBox4.SelectedIndex = 0;
MessageBox.Show($"扫描完成,找到 {comboBox4.Items.Count} 个设备", "扫描结果",
MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
MessageBox.Show("未找到任何设备", "扫描结果",
MessageBoxButtons.OK, MessageBoxIcon.Information);
}
// 恢复按钮状态
button13.Enabled = true;
button13.Text = "扫描设备";
}));
}
catch (Exception ex)
{
// 在UI线程中显示错误信息
this.Invoke(new Action(() =>
{
MessageBox.Show($"扫描设备时发生错误: {ex.Message}", "错误",
MessageBoxButtons.OK, MessageBoxIcon.Error);
// 恢复按钮状态
button13.Enabled = true;
button13.Text = "扫描设备";
}));
}
});
}
private void button19_Click(object sender, EventArgs e)
{
// 检查吸盘控制串口是否打开
if (suctionCupControl == null || !suctionCupControl.IsSerialPortOpen())
{
MessageBox.Show("请先打开吸盘控制串口", "提示",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
// 验证textBox10中的输入
if (string.IsNullOrWhiteSpace(textBox10.Text))
{
MessageBox.Show("请输入有效的ID号", "输入错误",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
if (!int.TryParse(textBox10.Text, out int newId) || newId < 1 || newId > 247)
{
MessageBox.Show("ID号必须是1-247之间的整数", "输入错误",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
// 确认修改操作
//DialogResult result = MessageBox.Show($"确定要将设备ID修改为 {newId} 吗?\n修改后需要重新连接设备。",
// "确认修改",
// MessageBoxButtons.YesNo,
// MessageBoxIcon.Question);
//if (result == DialogResult.Yes)
//{
// // 调用修改ID的方法
// suctionCupControl.ModifyDeviceId(newId);
//}
suctionCupControl.ModifyDeviceId(newId);
}
private void button20_Click(object sender, EventArgs e)
{
// 检查吸盘控制串口是否打开
if (suctionCupControl == null || !suctionCupControl.IsSerialPortOpen())
{
MessageBox.Show("请先打开吸盘控制串口", "提示",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
// 验证textBox10中的输入
if (string.IsNullOrWhiteSpace(textBox10.Text))
{
MessageBox.Show("请输入有效的设备ID", "输入错误",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
if (!int.TryParse(textBox10.Text, out int deviceId) || deviceId < 1 || deviceId > 247)
{
MessageBox.Show("设备ID必须是1-247之间的整数", "输入错误",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
// 获取当前设备的使能状态
bool currentState = suctionCupControl.GetEnableState(deviceId);
// 切换使能状态
bool newState = !currentState;
// 发送使能/禁用命令
suctionCupControl.ControlSuctionCupEnable(deviceId, newState);
// 更新按钮文本
button20.Text = newState ? "禁用" : "使能";
button21.Enabled = newState;
button22.Enabled = newState;
}
private void button21_Click(object sender, EventArgs e)
{
// 检查吸盘控制串口是否打开
if (suctionCupControl == null || !suctionCupControl.IsSerialPortOpen())
{
MessageBox.Show("请先打开吸盘控制串口", "提示",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
// 验证textBox10中的输入
if (string.IsNullOrWhiteSpace(textBox10.Text))
{
MessageBox.Show("请输入有效的设备ID", "输入错误",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
if (!int.TryParse(textBox10.Text, out int deviceId) || deviceId < 1 || deviceId > 247)
{
MessageBox.Show("设备ID必须是1-247之间的整数", "输入错误",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
// 发送开始抽真空命令
suctionCupControl.StartVacuum(deviceId);
}
private void button22_Click(object sender, EventArgs e)
{
// 检查吸盘控制串口是否打开
if (suctionCupControl == null || !suctionCupControl.IsSerialPortOpen())
{
MessageBox.Show("请先打开吸盘控制串口", "提示",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
// 验证textBox10中的输入
if (string.IsNullOrWhiteSpace(textBox10.Text))
{
MessageBox.Show("请输入有效的设备ID", "输入错误",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
if (!int.TryParse(textBox10.Text, out int deviceId) || deviceId < 1 || deviceId > 247)
{
MessageBox.Show("设备ID必须是1-247之间的整数", "输入错误",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
// 发送停止抽真空命令
suctionCupControl.StopVacuum(deviceId);
}
}
}

View File

@@ -1,4 +1,5 @@
using System;
using Modbus.Device;
using System;
using System.Collections.Generic;
using System.IO.Ports;
using System.Linq;
@@ -11,8 +12,10 @@ namespace HitBotCSharpDemo
internal class SuctionCupControl
{
private SerialPort suctioncupport;
public SuctionCupControl()
private static IModbusMaster master;
private System.Windows.Forms.ComboBox comboBox4;
private Dictionary<int, bool> enableStates = new Dictionary<int, bool>(); // 存储各设备的使能状态
public SuctionCupControl()
{
InitializeSerialPort();
}
@@ -23,25 +26,9 @@ namespace HitBotCSharpDemo
suctioncupport.DataBits = 8; // 数据位
suctioncupport.StopBits = StopBits.One; // 停止位
suctioncupport.Parity = Parity.None; // 奇偶校验
suctioncupport.DataReceived += SuctioncupPort_DataReceived;
}
// 数据接收事件处理
private void SuctioncupPort_DataReceived(object sender, SerialDataReceivedEventArgs e)
{
try
{
string data = suctioncupport.ReadExisting();
// 处理接收到的数据
Console.WriteLine($"吸盘控制器返回数据: {data}");
}
catch (Exception ex)
{
Console.WriteLine($"处理吸盘控制器数据时发生错误: {ex.Message}");
}
}
public void LoadAvailablePorts(ComboBox comboBox)
public void LoadAvailablePorts(System.Windows.Forms.ComboBox comboBox)
{
try
{
@@ -77,8 +64,6 @@ namespace HitBotCSharpDemo
// 串口已打开,执行关闭操作
suctioncupport.Close();
UpdateUIStatus(false, button, comboBox);
MessageBox.Show("吸盘控制串口已关闭", "提示",
MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
@@ -91,8 +76,6 @@ namespace HitBotCSharpDemo
}
suctioncupport.Open();
UpdateUIStatus(true, button, comboBox);
MessageBox.Show($"吸盘控制串口 {suctioncupport.PortName} 已成功打开", "提示",
MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
catch (UnauthorizedAccessException)
@@ -171,23 +154,220 @@ namespace HitBotCSharpDemo
MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
// 资源释放方法
public void OnFormClosing()
public List<int> ScanModbusDevices(int startId = 1, int endId = 247)
{
List<int> availableDevices = new List<int>();
if (suctioncupport == null || !suctioncupport.IsOpen)
{
MessageBox.Show("串口未打开,无法扫描设备", "提示",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
return availableDevices;
}
try
{
if (suctioncupport != null && suctioncupport.IsOpen)
// 创建Modbus RTU主站
master = ModbusSerialMaster.CreateRtu(suctioncupport);
//master.Transport.ReadTimeout = 25; // 设置读取超时时间为25ms
//master.Transport.WriteTimeout = 25; // 设置写入超时时间为25ms
for (byte deviceId = (byte)startId; deviceId <= endId; deviceId++)
{
suctioncupport.Close();
try
{
// 尝试读取设备ID寄存器(0x138D低字节)
// 功能码03读保持寄存器
ushort[] response = master.ReadHoldingRegisters(deviceId, 0x138D, 1);
if (response != null && response.Length > 0)
{
// 如果成功读取,说明设备存在
availableDevices.Add(deviceId);
}
}
catch (Exception)
{
// 读取失败说明该ID下没有设备或设备无响应
// 继续扫描下一个ID
continue;
}
}
suctioncupport?.Dispose();
}
catch (Exception ex)
{
MessageBox.Show($"关闭吸盘控制串口时发生错误: {ex.Message}", "错误",
MessageBox.Show($"扫描设备时发生错误: {ex.Message}", "错误",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
return availableDevices;
}
public bool IsSerialPortOpen()
{
return suctioncupport != null && suctioncupport.IsOpen;
}
public void SetComboBoxReference(System.Windows.Forms.ComboBox comboBox)
{
this.comboBox4 = comboBox;
}
//修改id
public void ModifyDeviceId(int newId)
{
if (suctioncupport == null || !suctioncupport.IsOpen)
{
MessageBox.Show("串口未打开无法修改设备ID", "提示",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
try
{
// 创建Modbus RTU主站
if (master == null)
{
master = ModbusSerialMaster.CreateRtu(suctioncupport);
//master.Transport.ReadTimeout = 2000;
//master.Transport.WriteTimeout = 2000;
}
// 设备ID寄存器地址为0x138D低字节
// 使用功能码160x10写入单个寄存器
ushort[] values = new ushort[] { (ushort)newId };
// 设备ID为comboBox4中选中数字
byte currentDeviceId = 1; // 默认ID
if (comboBox4 != null && comboBox4.SelectedItem != null)
{
if (byte.TryParse(comboBox4.SelectedItem.ToString(), out byte selectedId))
{
currentDeviceId = selectedId;
}
}
// 写入新的设备ID到寄存器0x138D
master.WriteMultipleRegisters(currentDeviceId, 0x138D, values);
MessageBox.Show($"设备ID已成功修改为 {newId}\n请重新扫描设备以确认修改结果", "修改成功",
MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex)
{
MessageBox.Show($"修改设备ID时发生错误: {ex.Message}", "错误",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
// 控制吸盘使能/禁用
public void ControlSuctionCupEnable(int deviceId, bool enable)
{
if (suctioncupport == null || !suctioncupport.IsOpen)
{
MessageBox.Show("串口未打开,无法控制吸盘使能", "提示",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
try
{
// 创建Modbus RTU主站
if (master == null)
{
master = ModbusSerialMaster.CreateRtu(suctioncupport);
master.Transport.ReadTimeout = 1000;
master.Transport.WriteTimeout = 1000;
}
// 控制寄存器地址为0x03E8
// rACT位在bit0enable为true时设置为1false时设置为0
ushort controlValue = enable ? (ushort)0x0001 : (ushort)0x0000;
ushort[] values = new ushort[] { controlValue };
master.WriteMultipleRegisters((byte)deviceId, 0x03E8, values);
// 更新使能状态
enableStates[deviceId] = enable;
string action = enable ? "使能" : "禁用";
MessageBox.Show($"设备ID {deviceId} {action}命令发送成功", "操作成功",
MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex)
{
MessageBox.Show($"控制吸盘使能时发生错误: {ex.Message}", "错误",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
// 获取设备使能状态
public bool GetEnableState(int deviceId)
{
return enableStates.ContainsKey(deviceId) && enableStates[deviceId];
}
// 停止所有设备使能(串口关闭时调用)
public void StopAllDevicesEnable()
{
foreach (var kvp in enableStates.ToList())
{
if (kvp.Value) // 如果设备当前是使能状态
{
try
{
ControlSuctionCupEnable(kvp.Key, false);
}
catch (Exception ex)
{
Console.WriteLine($"停止设备{kvp.Key}使能时出错: {ex.Message}");
}
}
}
enableStates.Clear();
}
// 开始抽真空
public void StartVacuum(int deviceId)
{
if (suctioncupport == null || !suctioncupport.IsOpen)
{
MessageBox.Show("串口未打开,无法发送开始抽真空命令", "提示",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
try
{
// 创建Modbus RTU主站
if (master == null)
{
master = ModbusSerialMaster.CreateRtu(suctioncupport);
}
// 控制寄存器地址为0x03E8
// 使用自动模式开始抽真空: rACT=1, rMODE=0, rGTO=1
// 控制值为0x091D (二进制: 00011101)
ushort controlValue = 0x001D;
ushort[] values = new ushort[] { controlValue };
master.WriteMultipleRegisters((byte)deviceId, 0x03E8, values);
}
catch (Exception ex)
{
MessageBox.Show($"发送开始抽真空命令时发生错误: {ex.Message}", "错误",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
// 停止抽真空
public void StopVacuum(int deviceId)
{
if (suctioncupport == null || !suctioncupport.IsOpen)
{
MessageBox.Show("串口未打开,无法发送停止抽真空命令", "提示",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
try
{
// 创建Modbus RTU主站
if (master == null)
{
master = ModbusSerialMaster.CreateRtu(suctioncupport);
}
// 控制寄存器地址为0x03E8
// 破真空方式停止: rACT=1, rMODE=0, rATR=1, rGTO=1
// 控制值为0x0025 (二进制: 00100101)
ushort controlValue = 0x0025;
ushort[] values = new ushort[] { controlValue };
master.WriteMultipleRegisters((byte)deviceId, 0x03E8, values);
}
catch (Exception ex)
{
MessageBox.Show($"发送停止抽真空命令时发生错误: {ex.Message}", "错误",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
}

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -1319,3 +1319,366 @@
2025-06-26 10:42:59.165 trail_number0.222532
2025-06-26 10:42:59.165 tcp_distance 22.253181
2025-06-26 10:42:59.166 angle1_1 = -66.002686 angle2_1 = 60.082100 z1 = -97.620598 r1 = -1005.581970 angle1_2 = -66.002686 angle2_2 = 60.082100 z2 = -119.998100 r2 = -1005.581970
2025-06-26 18:53:34.439 SDK_VERSION_V2.0.0.29_Release
2025-06-26 18:53:34.440 robot connected
2025-06-26 18:53:34.440 26
2025-06-26 18:53:34.440 current generation=26
2025-06-26 18:53:34.943 0x1a
2025-06-26 18:53:35.885 initial joint2 1750023
2025-06-26 18:53:35.886 C:\Users\fusy_\source\repos\HitBotCSharpDemo_x64\HitBotCSharpDemo\HitBotCSharpDemo\bin\x64\Debug\\j4_pid.txt do not exist
2025-06-26 18:53:35.886 robot WritePID
2025-06-26 18:53:36.195 initial joint1 -961232
2025-06-26 18:53:36.243 initial joint2 1750021
2025-06-26 18:53:36.306 initial joint3 -349530
2025-06-26 18:53:36.366 initial joint4 -23681034
2025-06-26 18:53:36.382 initial joint1 -961232
2025-06-26 18:53:36.442 initial joint2 1750024
2025-06-26 18:53:36.502 initial joint3 -349530
2025-06-26 18:53:36.564 initial joint4 -23681035
2025-06-26 18:53:36.595 initial joint1 -961233
2025-06-26 18:53:36.643 initial joint2 1750029
2025-06-26 18:53:36.704 initial joint3 -349531
2025-06-26 18:53:36.765 initial joint4 -23681036
2025-06-26 18:53:38.912 initial_thread initialized
2025-06-26 18:53:38.912 servo enable
2025-06-26 18:53:38.912 brake open
2025-06-26 18:53:38.912 set_brake_state 0 1
2025-06-26 18:53:39.125 robot initialized
2025-06-26 18:53:39.695 get_scara_param -66.002701 60.082600 -120.002197 -1005.581726
2025-06-26 18:53:39.695 get_scara_real_coor -66.002602 60.082600 -120.002899 -1005.581726
2025-06-26 18:53:39.696 <09><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>ɢ<EFBFBD><C9A2><EFBFBD><EFBFBD>
2025-06-26 18:53:39.696 position -961233.937500 1750032.500000 -349531.718750 -23681036.000000 0.000000 0.000000 0.000000 0.000000
2025-06-26 18:53:39.696 speed 66002.695313 60082.597656 120002.187500 975628.687500
2025-06-26 18:53:39.696 set_first_position_after_initial
2025-06-26 18:53:39.698 movej_old start_pos: -66.002693 60.082596 -120.002190 -1005.581787 end_pos: -66.002602 60.082504 -120.002098 -1005.581787 org_sp 10.000000 end_sp 1.402460
2025-06-26 18:53:39.988 J3 Belt Meilage=40.963825km
2025-06-26 18:53:43.961 30 30 30 30
2025-06-26 18:53:43.962 new_movej_xyz_lr 288.406189 -221.612305 -97.620598 -1005.581787 100.000000 0.000000 1
2025-06-26 18:53:43.963 goal_angle -66.002632 60.082561
2025-06-26 18:53:43.963 new_movej_angle -66.002632 60.082561 -97.620598 -1005.581787 0.000000 100.000000
2025-06-26 18:53:43.964 z1 -120.002098 z2 -97.620598
2025-06-26 18:53:43.964 angle1_1 -66.002602 angle2_1 60.082504 z1 -120.002098 r1 -1005.581787
2025-06-26 18:53:43.964 angle1_2 -66.002632 angle2_2 60.082561 z2 -97.620598 r2 -1005.581787
2025-06-26 18:53:43.965 speed 100.000000
2025-06-26 18:53:43.965 tcp_distance 22.257156
2025-06-26 18:53:43.965 new_end_speed 100.000000 j1_acc_t 0.111286 j1_avg_time 0.000000 j1_max_acc 237.000000 j1_max_sp 0.000300
2025-06-26 18:53:43.966 new_end_speed 100.000000 j2_acc_t 0.111286 j2_avg_time 0.000000 j2_max_acc 2566.500000 j2_max_sp 0.000562
2025-06-26 18:53:43.966 new_end_speed 100.000000 j3_acc_t 0.111286 j3_avg_time 0.000000 j3_max_acc 3869.100098 j3_max_sp 219.972198
2025-06-26 18:53:43.966 new_end_speed 100.000000 j4_acc_t 0.111286 j4_avg_time 0.000000 j4_max_acc 1572.900024 j4_max_sp 0.000000
2025-06-26 18:53:43.966 end_speed 100.000000
2025-06-26 18:53:43.966 trail_number0.222572
2025-06-26 18:53:43.966 tcp_distance 22.257156
2025-06-26 18:53:43.967 angle1_1 = -66.002602 angle2_1 = 60.082504 z1 = -120.002098 r1 = -1005.581787 angle1_2 = -66.002632 angle2_2 = 60.082561 z2 = -97.620598 r2 = -1005.581787
2025-06-26 18:53:43.970 wait_stop in
2025-06-26 18:53:44.607 wait_stop out_0
2025-06-26 18:53:44.608 new_movej_xyz_lr 287.342896 73.423103 -97.620598 -1005.557007 100.000000 0.000000 1
2025-06-26 18:53:44.608 goal_angle -28.070442 90.288498
2025-06-26 18:53:44.608 new_movej_angle -28.070442 90.288498 -97.620598 -1005.557007 0.000000 100.000000
2025-06-26 18:53:44.608 z1 -97.620598 z2 -97.620598
2025-06-26 18:53:44.608 angle1_1 -66.002632 angle2_1 60.082561 z1 -97.620598 r1 -1005.581787
2025-06-26 18:53:44.609 angle1_2 -28.070442 angle2_2 90.288498 z2 -97.620598 r2 -1005.557007
2025-06-26 18:53:44.609 speed 100.000000
2025-06-26 18:53:44.609 tcp_distance 306.713043
2025-06-26 18:53:44.609 new_end_speed 100.000000 j1_acc_t 1.533565 j1_avg_time 0.000000 j1_max_acc 237.000000 j1_max_sp 27.053516
2025-06-26 18:53:44.609 new_end_speed 100.000000 j2_acc_t 1.533565 j2_avg_time 0.000000 j2_max_acc 2566.500000 j2_max_sp 21.543095
2025-06-26 18:53:44.610 new_end_speed 100.000000 j3_acc_t 1.533565 j3_avg_time 0.000000 j3_max_acc 3869.100098 j3_max_sp 0.000000
2025-06-26 18:53:44.610 new_end_speed 100.000000 j4_acc_t 1.533565 j4_avg_time 0.000000 j4_max_acc 1572.900024 j4_max_sp 0.017673
2025-06-26 18:53:44.611 end_speed 100.000000
2025-06-26 18:53:44.611 trail_number3.067130
2025-06-26 18:53:44.611 tcp_distance 306.713043
2025-06-26 18:53:44.611 angle1_1 = -66.002632 angle2_1 = 60.082561 z1 = -97.620598 r1 = -1005.581787 angle1_2 = -28.070442 angle2_2 = 90.288498 z2 = -97.620598 r2 = -1005.557007
2025-06-26 18:53:44.623 wait_stop in
2025-06-26 18:53:47.758 wait_stop out_0
2025-06-26 18:53:47.759 new_movej_xyz_lr 287.342896 73.423103 -118.853500 -1005.557007 100.000000 0.000000 1
2025-06-26 18:53:47.759 goal_angle -28.070442 90.288498
2025-06-26 18:53:47.759 new_movej_angle -28.070442 90.288498 -118.853500 -1005.557007 0.000000 100.000000
2025-06-26 18:53:47.759 z1 -97.620598 z2 -118.853500
2025-06-26 18:53:47.760 angle1_1 -28.070442 angle2_1 90.288498 z1 -97.620598 r1 -1005.557007
2025-06-26 18:53:47.760 angle1_2 -28.070442 angle2_2 90.288498 z2 -118.853500 r2 -1005.557007
2025-06-26 18:53:47.761 speed 100.000000
2025-06-26 18:53:47.761 tcp_distance 21.114937
2025-06-26 18:53:47.761 new_end_speed 100.000000 j1_acc_t 0.105575 j1_avg_time 0.000000 j1_max_acc 237.000000 j1_max_sp 0.000000
2025-06-26 18:53:47.761 new_end_speed 100.000000 j2_acc_t 0.105575 j2_avg_time 0.000000 j2_max_acc 2566.500000 j2_max_sp 0.000000
2025-06-26 18:53:47.761 new_end_speed 100.000000 j3_acc_t 0.105575 j3_avg_time 0.000000 j3_max_acc 3869.100098 j3_max_sp 219.972137
2025-06-26 18:53:47.761 new_end_speed 100.000000 j4_acc_t 0.105575 j4_avg_time 0.000000 j4_max_acc 1572.900024 j4_max_sp 0.000000
2025-06-26 18:53:47.761 end_speed 100.000000
2025-06-26 18:53:47.762 trail_number0.211149
2025-06-26 18:53:47.762 tcp_distance 21.114937
2025-06-26 18:53:47.762 angle1_1 = -28.070442 angle2_1 = 90.288498 z1 = -97.620598 r1 = -1005.557007 angle1_2 = -28.070442 angle2_2 = 90.288498 z2 = -118.853500 r2 = -1005.557007
2025-06-26 19:17:27.730 SDK_VERSION_V2.0.0.29_Release
2025-06-26 19:17:27.731 robot connected
2025-06-26 19:17:27.731 26
2025-06-26 19:17:27.731 current generation=26
2025-06-26 19:17:28.243 0x1a
2025-06-26 19:17:29.152 initial joint2 2629848
2025-06-26 19:17:29.153 C:\Users\fusy_\source\repos\HitBotCSharpDemo_x64\HitBotCSharpDemo\HitBotCSharpDemo\bin\x64\Debug\\j4_pid.txt do not exist
2025-06-26 19:17:29.153 robot WritePID
2025-06-26 19:17:29.462 initial joint1 -408806
2025-06-26 19:17:29.508 initial joint2 2629849
2025-06-26 19:17:29.555 initial joint3 -346191
2025-06-26 19:17:29.601 initial joint4 -25041054
2025-06-26 19:17:29.617 initial joint1 -408806
2025-06-26 19:17:29.680 initial joint2 2629849
2025-06-26 19:17:29.742 initial joint3 -346191
2025-06-26 19:17:29.788 initial joint4 -25041054
2025-06-26 19:17:29.803 initial joint1 -408806
2025-06-26 19:17:29.850 initial joint2 2629850
2025-06-26 19:17:29.897 initial joint3 -346191
2025-06-26 19:17:29.943 initial joint4 -25041055
2025-06-26 19:17:32.150 initial_thread initialized
2025-06-26 19:17:32.151 servo enable
2025-06-26 19:17:32.151 brake open
2025-06-26 19:17:32.151 set_brake_state 0 1
2025-06-26 19:17:32.365 robot initialized
2025-06-26 19:17:32.920 get_scara_param -28.070499 90.288803 -118.855202 -1005.557007
2025-06-26 19:17:32.920 get_scara_real_coor -28.070400 90.288696 -118.855499 -1005.557007
2025-06-26 19:17:32.920 <09><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>ɢ<EFBFBD><C9A2><EFBFBD><EFBFBD>
2025-06-26 19:17:32.921 position -408806.281250 2629852.000000 -346190.875000 -25041058.000000 0.000000 0.000000 0.000000 0.000000
2025-06-26 19:17:32.921 speed 28070.500000 90288.796875 118855.203125 1031659.812500
2025-06-26 19:17:32.921 set_first_position_after_initial
2025-06-26 19:17:32.921 movej_old start_pos: -28.070499 90.288803 -118.855202 -1005.557068 end_pos: -28.070499 90.288803 -118.855202 -1005.557129 org_sp 10.000000 end_sp 10.000000
2025-06-26 19:17:33.210 J3 Belt Meilage=40.964001km
2025-06-26 19:17:34.955 30 30 30 30
2025-06-26 19:17:34.956 new_movej_xyz_lr 287.342010 73.423302 -97.620598 -1005.557129 100.000000 0.000000 1
2025-06-26 19:17:34.956 goal_angle -28.070503 90.288818
2025-06-26 19:17:34.957 new_movej_angle -28.070503 90.288818 -97.620598 -1005.557129 0.000000 100.000000
2025-06-26 19:17:34.957 z1 -118.855202 z2 -97.620598
2025-06-26 19:17:34.957 angle1_1 -28.070499 angle2_1 90.288803 z1 -118.855202 r1 -1005.557129
2025-06-26 19:17:34.957 angle1_2 -28.070503 angle2_2 90.288818 z2 -97.620598 r2 -1005.557129
2025-06-26 19:17:34.957 speed 100.000000
2025-06-26 19:17:34.958 tcp_distance 21.116631
2025-06-26 19:17:34.958 new_end_speed 100.000000 j1_acc_t 0.105583 j1_avg_time 0.000000 j1_max_acc 237.000000 j1_max_sp 0.000040
2025-06-26 19:17:34.958 new_end_speed 100.000000 j2_acc_t 0.105583 j2_avg_time 0.000000 j2_max_acc 2566.500000 j2_max_sp 0.000158
2025-06-26 19:17:34.958 new_end_speed 100.000000 j3_acc_t 0.105583 j3_avg_time 0.000000 j3_max_acc 3869.100098 j3_max_sp 219.971970
2025-06-26 19:17:34.958 new_end_speed 100.000000 j4_acc_t 0.105583 j4_avg_time 0.000000 j4_max_acc 1572.900024 j4_max_sp 0.000000
2025-06-26 19:17:34.959 end_speed 100.000000
2025-06-26 19:17:34.959 trail_number0.211166
2025-06-26 19:17:34.959 tcp_distance 21.116631
2025-06-26 19:17:34.959 angle1_1 = -28.070499 angle2_1 = 90.288803 z1 = -118.855202 r1 = -1005.557129 angle1_2 = -28.070503 angle2_2 = 90.288818 z2 = -97.620598 r2 = -1005.557129
2025-06-26 19:17:34.972 wait_stop in
2025-06-26 19:17:35.559 wait_stop out_0
2025-06-26 19:17:35.559 new_movej_xyz_lr 285.909302 -66.236198 -97.620598 -1005.585022 100.000000 0.000000 1
2025-06-26 19:17:35.560 goal_angle -55.984741 91.477249
2025-06-26 19:17:35.560 new_movej_angle -55.984741 91.477249 -97.620598 -1005.585022 0.000000 100.000000
2025-06-26 19:17:35.560 z1 -97.620598 z2 -97.620598
2025-06-26 19:17:35.560 angle1_1 -28.070503 angle2_1 90.288818 z1 -97.620598 r1 -1005.557129
2025-06-26 19:17:35.561 angle1_2 -55.984741 angle2_2 91.477249 z2 -97.620598 r2 -1005.585022
2025-06-26 19:17:35.561 speed 100.000000
2025-06-26 19:17:35.562 tcp_distance 140.227524
2025-06-26 19:17:35.562 new_end_speed 100.000000 j1_acc_t 0.701138 j1_avg_time 0.000000 j1_max_acc 237.000000 j1_max_sp 43.545227
2025-06-26 19:17:35.562 new_end_speed 100.000000 j2_acc_t 0.701138 j2_avg_time 0.000000 j2_max_acc 2566.500000 j2_max_sp 1.853910
2025-06-26 19:17:35.562 new_end_speed 100.000000 j3_acc_t 0.701138 j3_avg_time 0.000000 j3_max_acc 3869.100098 j3_max_sp 0.000000
2025-06-26 19:17:35.562 new_end_speed 100.000000 j4_acc_t 0.701138 j4_avg_time 0.000000 j4_max_acc 1572.900024 j4_max_sp 0.043512
2025-06-26 19:17:35.562 end_speed 100.000000
2025-06-26 19:17:35.563 trail_number1.402275
2025-06-26 19:17:35.563 tcp_distance 140.227524
2025-06-26 19:17:35.563 angle1_1 = -28.070503 angle2_1 = 90.288818 z1 = -97.620598 r1 = -1005.557129 angle1_2 = -55.984741 angle2_2 = 91.477249 z2 = -97.620598 r2 = -1005.585022
2025-06-26 19:17:35.574 wait_stop in
2025-06-26 19:17:37.051 wait_stop out_0
2025-06-26 19:17:37.051 new_movej_xyz_lr 285.909302 -66.236198 -119.977501 -1005.585022 100.000000 0.000000 1
2025-06-26 19:17:37.051 goal_angle -55.984741 91.477249
2025-06-26 19:17:37.051 new_movej_angle -55.984741 91.477249 -119.977501 -1005.585022 0.000000 100.000000
2025-06-26 19:17:37.053 z1 -97.620598 z2 -119.977501
2025-06-26 19:17:37.053 angle1_1 -55.984741 angle2_1 91.477249 z1 -97.620598 r1 -1005.585022
2025-06-26 19:17:37.053 angle1_2 -55.984741 angle2_2 91.477249 z2 -119.977501 r2 -1005.585022
2025-06-26 19:17:37.053 speed 100.000000
2025-06-26 19:17:37.053 tcp_distance 22.232697
2025-06-26 19:17:37.054 new_end_speed 100.000000 j1_acc_t 0.111163 j1_avg_time 0.000000 j1_max_acc 237.000000 j1_max_sp 0.000000
2025-06-26 19:17:37.054 new_end_speed 100.000000 j2_acc_t 0.111163 j2_avg_time 0.000000 j2_max_acc 2566.500000 j2_max_sp 0.000000
2025-06-26 19:17:37.054 new_end_speed 100.000000 j3_acc_t 0.111163 j3_avg_time 0.000000 j3_max_acc 3869.100098 j3_max_sp 219.972122
2025-06-26 19:17:37.054 new_end_speed 100.000000 j4_acc_t 0.111163 j4_avg_time 0.000000 j4_max_acc 1572.900024 j4_max_sp 0.000000
2025-06-26 19:17:37.054 end_speed 100.000000
2025-06-26 19:17:37.054 trail_number0.222327
2025-06-26 19:17:37.055 tcp_distance 22.232697
2025-06-26 19:17:37.055 angle1_1 = -55.984741 angle2_1 = 91.477249 z1 = -97.620598 r1 = -1005.585022 angle1_2 = -55.984741 angle2_2 = 91.477249 z2 = -119.977501 r2 = -1005.585022
2025-06-26 19:17:44.278 30 30 30 30
2025-06-26 19:17:44.278 new_movej_xyz_lr 285.909302 -66.236198 -97.620598 -1005.585022 100.000000 0.000000 1
2025-06-26 19:17:44.278 goal_angle -55.984741 91.477249
2025-06-26 19:17:44.280 new_movej_angle -55.984741 91.477249 -97.620598 -1005.585022 0.000000 100.000000
2025-06-26 19:17:44.280 z1 -119.977501 z2 -97.620598
2025-06-26 19:17:44.280 angle1_1 -55.984741 angle2_1 91.477249 z1 -119.977501 r1 -1005.585022
2025-06-26 19:17:44.280 angle1_2 -55.984741 angle2_2 91.477249 z2 -97.620598 r2 -1005.585022
2025-06-26 19:17:44.280 speed 100.000000
2025-06-26 19:17:44.280 tcp_distance 22.232697
2025-06-26 19:17:44.280 new_end_speed 100.000000 j1_acc_t 0.111163 j1_avg_time 0.000000 j1_max_acc 237.000000 j1_max_sp 0.000000
2025-06-26 19:17:44.281 new_end_speed 100.000000 j2_acc_t 0.111163 j2_avg_time 0.000000 j2_max_acc 2566.500000 j2_max_sp 0.000000
2025-06-26 19:17:44.281 new_end_speed 100.000000 j3_acc_t 0.111163 j3_avg_time 0.000000 j3_max_acc 3869.100098 j3_max_sp 219.972122
2025-06-26 19:17:44.281 new_end_speed 100.000000 j4_acc_t 0.111163 j4_avg_time 0.000000 j4_max_acc 1572.900024 j4_max_sp 0.000000
2025-06-26 19:17:44.281 end_speed 100.000000
2025-06-26 19:17:44.281 trail_number0.222327
2025-06-26 19:17:44.281 tcp_distance 22.232697
2025-06-26 19:17:44.282 angle1_1 = -55.984741 angle2_1 = 91.477249 z1 = -119.977501 r1 = -1005.585022 angle1_2 = -55.984741 angle2_2 = 91.477249 z2 = -97.620598 r2 = -1005.585022
2025-06-26 19:17:44.290 wait_stop in
2025-06-26 19:17:44.894 wait_stop out_0
2025-06-26 19:17:44.895 new_movej_xyz_lr 288.405792 -221.614197 -97.620598 -1005.581970 100.000000 0.000000 1
2025-06-26 19:17:44.895 goal_angle -66.002686 60.082100
2025-06-26 19:17:44.895 new_movej_angle -66.002686 60.082100 -97.620598 -1005.581970 0.000000 100.000000
2025-06-26 19:17:44.895 z1 -97.620598 z2 -97.620598
2025-06-26 19:17:44.895 angle1_1 -55.984741 angle2_1 91.477249 z1 -97.620598 r1 -1005.585022
2025-06-26 19:17:44.896 angle1_2 -66.002686 angle2_2 60.082100 z2 -97.620598 r2 -1005.581970
2025-06-26 19:17:44.896 speed 100.000000
2025-06-26 19:17:44.896 tcp_distance 157.331512
2025-06-26 19:17:44.896 new_end_speed 100.000000 j1_acc_t 0.786658 j1_avg_time 0.000000 j1_max_acc 237.000000 j1_max_sp 13.928713
2025-06-26 19:17:44.896 new_end_speed 100.000000 j2_acc_t 0.786658 j2_avg_time 0.000000 j2_max_acc 2566.500000 j2_max_sp 43.651073
2025-06-26 19:17:44.897 new_end_speed 100.000000 j3_acc_t 0.786658 j3_avg_time 0.000000 j3_max_acc 3869.100098 j3_max_sp 0.000000
2025-06-26 19:17:44.897 new_end_speed 100.000000 j4_acc_t 0.786658 j4_avg_time 0.000000 j4_max_acc 1572.900024 j4_max_sp 0.004243
2025-06-26 19:17:44.897 end_speed 100.000000
2025-06-26 19:17:44.897 trail_number1.573315
2025-06-26 19:17:44.897 tcp_distance 157.331512
2025-06-26 19:17:44.897 angle1_1 = -55.984741 angle2_1 = 91.477249 z1 = -97.620598 r1 = -1005.585022 angle1_2 = -66.002686 angle2_2 = 60.082100 z2 = -97.620598 r2 = -1005.581970
2025-06-26 19:17:44.910 wait_stop in
2025-06-26 19:17:46.547 wait_stop out_0
2025-06-26 19:17:46.547 new_movej_xyz_lr 288.405792 -221.614197 -119.998100 -1005.581970 100.000000 0.000000 1
2025-06-26 19:17:46.548 goal_angle -66.002686 60.082100
2025-06-26 19:17:46.548 new_movej_angle -66.002686 60.082100 -119.998100 -1005.581970 0.000000 100.000000
2025-06-26 19:17:46.548 z1 -97.620598 z2 -119.998100
2025-06-26 19:17:46.548 angle1_1 -66.002686 angle2_1 60.082100 z1 -97.620598 r1 -1005.581970
2025-06-26 19:17:46.548 angle1_2 -66.002686 angle2_2 60.082100 z2 -119.998100 r2 -1005.581970
2025-06-26 19:17:46.548 speed 100.000000
2025-06-26 19:17:46.549 tcp_distance 22.253181
2025-06-26 19:17:46.549 new_end_speed 100.000000 j1_acc_t 0.111266 j1_avg_time 0.000000 j1_max_acc 237.000000 j1_max_sp 0.000000
2025-06-26 19:17:46.549 new_end_speed 100.000000 j2_acc_t 0.111266 j2_avg_time 0.000000 j2_max_acc 2566.500000 j2_max_sp 0.000000
2025-06-26 19:17:46.549 new_end_speed 100.000000 j3_acc_t 0.111266 j3_avg_time 0.000000 j3_max_acc 3869.100098 j3_max_sp 219.972198
2025-06-26 19:17:46.549 new_end_speed 100.000000 j4_acc_t 0.111266 j4_avg_time 0.000000 j4_max_acc 1572.900024 j4_max_sp 0.000000
2025-06-26 19:17:46.550 end_speed 100.000000
2025-06-26 19:17:46.550 trail_number0.222532
2025-06-26 19:17:46.550 tcp_distance 22.253181
2025-06-26 19:17:46.550 angle1_1 = -66.002686 angle2_1 = 60.082100 z1 = -97.620598 r1 = -1005.581970 angle1_2 = -66.002686 angle2_2 = 60.082100 z2 = -119.998100 r2 = -1005.581970
2025-06-26 19:27:42.698 SDK_VERSION_V2.0.0.29_Release
2025-06-26 19:27:42.698 robot connected
2025-06-26 19:27:42.698 26
2025-06-26 19:27:42.698 current generation=26
2025-06-26 19:27:43.214 0x1a
2025-06-26 19:27:44.168 initial joint2 1750021
2025-06-26 19:27:44.168 C:\Users\fusy_\source\repos\HitBotCSharpDemo_x64\HitBotCSharpDemo\HitBotCSharpDemo\bin\x64\Debug\\j4_pid.txt do not exist
2025-06-26 19:27:44.168 robot WritePID
2025-06-26 19:27:44.478 initial joint1 -961234
2025-06-26 19:27:44.524 initial joint2 1750024
2025-06-26 19:27:44.570 initial joint3 -349526
2025-06-26 19:27:44.618 initial joint4 -23681034
2025-06-26 19:27:44.633 initial joint1 -961234
2025-06-26 19:27:44.680 initial joint2 1750024
2025-06-26 19:27:44.726 initial joint3 -349527
2025-06-26 19:27:44.788 initial joint4 -23681035
2025-06-26 19:27:44.818 initial joint1 -961233
2025-06-26 19:27:44.865 initial joint2 1750025
2025-06-26 19:27:44.928 initial joint3 -349528
2025-06-26 19:27:44.975 initial joint4 -23681036
2025-06-26 19:27:47.197 initial_thread initialized
2025-06-26 19:27:47.197 servo enable
2025-06-26 19:27:47.197 brake open
2025-06-26 19:27:47.198 set_brake_state 0 1
2025-06-26 19:27:47.413 robot initialized
2025-06-26 19:27:47.986 get_scara_param -66.002701 60.082298 -120.001198 -1005.581970
2025-06-26 19:27:47.987 get_scara_real_coor -66.002602 60.082401 -120.001900 -1005.581787
2025-06-26 19:27:47.987 <09><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>ɢ<EFBFBD><C9A2><EFBFBD><EFBFBD>
2025-06-26 19:27:47.987 position -961233.937500 1750023.875000 -349528.812500 -23681038.000000 0.000000 0.000000 0.000000 0.000000
2025-06-26 19:27:47.987 speed 66002.695313 60082.300781 120001.195313 975628.750000
2025-06-26 19:27:47.987 set_first_position_after_initial
2025-06-26 19:27:47.988 movej_old start_pos: -66.002693 60.082302 -120.001198 -1005.582031 end_pos: -66.002602 60.082302 -120.001198 -1005.582031 org_sp 10.000000 end_sp 1.001647
2025-06-26 19:27:48.280 J3 Belt Meilage=40.964226km
2025-06-26 19:28:11.301 30 30 30 30
2025-06-26 19:28:11.302 new_movej_xyz_lr 275.780212 -295.934296 -97.620598 -1005.468994 100.000000 0.000000 1
2025-06-26 19:28:11.302 goal_angle -61.881187 31.250517
2025-06-26 19:28:11.302 new_movej_angle -61.881187 31.250517 -97.620598 -1005.468994 0.000000 100.000000
2025-06-26 19:28:11.304 z1 -120.001198 z2 -97.620598
2025-06-26 19:28:11.304 angle1_1 -66.002602 angle2_1 60.082302 z1 -120.001198 r1 -1005.582031
2025-06-26 19:28:11.304 angle1_2 -61.881187 angle2_2 31.250517 z2 -97.620598 r2 -1005.468994
2025-06-26 19:28:11.304 speed 100.000000
2025-06-26 19:28:11.304 tcp_distance 78.949852
2025-06-26 19:28:11.305 new_end_speed 100.000000 j1_acc_t 0.394749 j1_avg_time 0.000000 j1_max_acc 237.000000 j1_max_sp 11.419392
2025-06-26 19:28:11.305 new_end_speed 100.000000 j2_acc_t 0.394749 j2_avg_time 0.000000 j2_max_acc 2566.500000 j2_max_sp 79.885551
2025-06-26 19:28:11.305 new_end_speed 100.000000 j3_acc_t 0.394749 j3_avg_time 0.000000 j3_max_acc 3869.100098 j3_max_sp 62.010956
2025-06-26 19:28:11.305 new_end_speed 100.000000 j4_acc_t 0.394749 j4_avg_time 0.000000 j4_max_acc 1572.900024 j4_max_sp 0.313197
2025-06-26 19:28:11.305 end_speed 100.000000
2025-06-26 19:28:11.305 trail_number0.789499
2025-06-26 19:28:11.305 tcp_distance 78.949852
2025-06-26 19:28:11.306 angle1_1 = -66.002602 angle2_1 = 60.082302 z1 = -120.001198 r1 = -1005.582031 angle1_2 = -61.881187 angle2_2 = 31.250517 z2 = -97.620598 r2 = -1005.468994
2025-06-26 19:28:15.217 30 30 30 30
2025-06-26 19:28:15.218 new_movej_xyz_lr 285.909302 -66.236198 -97.620598 -1005.585022 100.000000 0.000000 1
2025-06-26 19:28:15.219 goal_angle -55.984741 91.477249
2025-06-26 19:28:15.219 new_movej_angle -55.984741 91.477249 -97.620598 -1005.585022 0.000000 100.000000
2025-06-26 19:28:15.219 z1 -97.620598 z2 -97.620598
2025-06-26 19:28:15.219 angle1_1 -61.881187 angle2_1 31.250517 z1 -97.620598 r1 -1005.468994
2025-06-26 19:28:15.219 angle1_2 -55.984741 angle2_2 91.477249 z2 -97.620598 r2 -1005.585022
2025-06-26 19:28:15.219 speed 100.000000
2025-06-26 19:28:15.219 tcp_distance 240.658829
2025-06-26 19:28:15.219 new_end_speed 100.000000 j1_acc_t 1.203294 j1_avg_time 0.000000 j1_max_acc 237.000000 j1_max_sp 5.359652
2025-06-26 19:28:15.220 new_end_speed 100.000000 j2_acc_t 1.203294 j2_avg_time 0.000000 j2_max_acc 2566.500000 j2_max_sp 54.743870
2025-06-26 19:28:15.220 new_end_speed 100.000000 j3_acc_t 1.203294 j3_avg_time 0.000000 j3_max_acc 3869.100098 j3_max_sp 0.000000
2025-06-26 19:28:15.220 new_end_speed 100.000000 j4_acc_t 1.203294 j4_avg_time 0.000000 j4_max_acc 1572.900024 j4_max_sp 0.105465
2025-06-26 19:28:15.220 end_speed 100.000000
2025-06-26 19:28:15.220 trail_number2.406588
2025-06-26 19:28:15.220 tcp_distance 240.658829
2025-06-26 19:28:15.222 angle1_1 = -61.881187 angle2_1 = 31.250517 z1 = -97.620598 r1 = -1005.468994 angle1_2 = -55.984741 angle2_2 = 91.477249 z2 = -97.620598 r2 = -1005.585022
2025-06-26 19:28:15.234 wait_stop in
2025-06-26 19:28:17.677 wait_stop out_0
2025-06-26 19:28:17.677 new_movej_xyz_lr 285.909302 -66.236198 -119.977501 -1005.585022 100.000000 0.000000 1
2025-06-26 19:28:17.678 goal_angle -55.984741 91.477249
2025-06-26 19:28:17.678 new_movej_angle -55.984741 91.477249 -119.977501 -1005.585022 0.000000 100.000000
2025-06-26 19:28:17.678 z1 -97.620598 z2 -119.977501
2025-06-26 19:28:17.678 angle1_1 -55.984741 angle2_1 91.477249 z1 -97.620598 r1 -1005.585022
2025-06-26 19:28:17.678 angle1_2 -55.984741 angle2_2 91.477249 z2 -119.977501 r2 -1005.585022
2025-06-26 19:28:17.678 speed 100.000000
2025-06-26 19:28:17.679 tcp_distance 22.232697
2025-06-26 19:28:17.679 new_end_speed 100.000000 j1_acc_t 0.111163 j1_avg_time 0.000000 j1_max_acc 237.000000 j1_max_sp 0.000000
2025-06-26 19:28:17.679 new_end_speed 100.000000 j2_acc_t 0.111163 j2_avg_time 0.000000 j2_max_acc 2566.500000 j2_max_sp 0.000000
2025-06-26 19:28:17.679 new_end_speed 100.000000 j3_acc_t 0.111163 j3_avg_time 0.000000 j3_max_acc 3869.100098 j3_max_sp 219.972122
2025-06-26 19:28:17.679 new_end_speed 100.000000 j4_acc_t 0.111163 j4_avg_time 0.000000 j4_max_acc 1572.900024 j4_max_sp 0.000000
2025-06-26 19:28:17.679 end_speed 100.000000
2025-06-26 19:28:17.679 trail_number0.222327
2025-06-26 19:28:17.679 tcp_distance 22.232697
2025-06-26 19:28:17.680 angle1_1 = -55.984741 angle2_1 = 91.477249 z1 = -97.620598 r1 = -1005.585022 angle1_2 = -55.984741 angle2_2 = 91.477249 z2 = -119.977501 r2 = -1005.585022
2025-06-26 19:28:19.435 30 30 30 30
2025-06-26 19:28:19.435 new_movej_xyz_lr 285.909302 -66.236198 -97.620598 -1005.585022 100.000000 0.000000 1
2025-06-26 19:28:19.435 goal_angle -55.984741 91.477249
2025-06-26 19:28:19.436 new_movej_angle -55.984741 91.477249 -97.620598 -1005.585022 0.000000 100.000000
2025-06-26 19:28:19.436 z1 -119.977501 z2 -97.620598
2025-06-26 19:28:19.436 angle1_1 -55.984741 angle2_1 91.477249 z1 -119.977501 r1 -1005.585022
2025-06-26 19:28:19.436 angle1_2 -55.984741 angle2_2 91.477249 z2 -97.620598 r2 -1005.585022
2025-06-26 19:28:19.436 speed 100.000000
2025-06-26 19:28:19.436 tcp_distance 22.232697
2025-06-26 19:28:19.437 new_end_speed 100.000000 j1_acc_t 0.111163 j1_avg_time 0.000000 j1_max_acc 237.000000 j1_max_sp 0.000000
2025-06-26 19:28:19.437 new_end_speed 100.000000 j2_acc_t 0.111163 j2_avg_time 0.000000 j2_max_acc 2566.500000 j2_max_sp 0.000000
2025-06-26 19:28:19.437 new_end_speed 100.000000 j3_acc_t 0.111163 j3_avg_time 0.000000 j3_max_acc 3869.100098 j3_max_sp 219.972122
2025-06-26 19:28:19.437 new_end_speed 100.000000 j4_acc_t 0.111163 j4_avg_time 0.000000 j4_max_acc 1572.900024 j4_max_sp 0.000000
2025-06-26 19:28:19.437 end_speed 100.000000
2025-06-26 19:28:19.437 trail_number0.222327
2025-06-26 19:28:19.438 tcp_distance 22.232697
2025-06-26 19:28:19.438 angle1_1 = -55.984741 angle2_1 = 91.477249 z1 = -119.977501 r1 = -1005.585022 angle1_2 = -55.984741 angle2_2 = 91.477249 z2 = -97.620598 r2 = -1005.585022
2025-06-26 19:28:19.447 wait_stop in
2025-06-26 19:28:20.048 wait_stop out_0
2025-06-26 19:28:20.048 new_movej_xyz_lr 288.405792 -221.614197 -97.620598 -1005.581970 100.000000 0.000000 1
2025-06-26 19:28:20.049 goal_angle -66.002686 60.082100
2025-06-26 19:28:20.049 new_movej_angle -66.002686 60.082100 -97.620598 -1005.581970 0.000000 100.000000
2025-06-26 19:28:20.049 z1 -97.620598 z2 -97.620598
2025-06-26 19:28:20.049 angle1_1 -55.984741 angle2_1 91.477249 z1 -97.620598 r1 -1005.585022
2025-06-26 19:28:20.049 angle1_2 -66.002686 angle2_2 60.082100 z2 -97.620598 r2 -1005.581970
2025-06-26 19:28:20.049 speed 100.000000
2025-06-26 19:28:20.050 tcp_distance 157.331512
2025-06-26 19:28:20.050 new_end_speed 100.000000 j1_acc_t 0.786658 j1_avg_time 0.000000 j1_max_acc 237.000000 j1_max_sp 13.928713
2025-06-26 19:28:20.050 new_end_speed 100.000000 j2_acc_t 0.786658 j2_avg_time 0.000000 j2_max_acc 2566.500000 j2_max_sp 43.651073
2025-06-26 19:28:20.050 new_end_speed 100.000000 j3_acc_t 0.786658 j3_avg_time 0.000000 j3_max_acc 3869.100098 j3_max_sp 0.000000
2025-06-26 19:28:20.050 new_end_speed 100.000000 j4_acc_t 0.786658 j4_avg_time 0.000000 j4_max_acc 1572.900024 j4_max_sp 0.004243
2025-06-26 19:28:20.050 end_speed 100.000000
2025-06-26 19:28:20.052 trail_number1.573315
2025-06-26 19:28:20.052 tcp_distance 157.331512
2025-06-26 19:28:20.052 angle1_1 = -55.984741 angle2_1 = 91.477249 z1 = -97.620598 r1 = -1005.585022 angle1_2 = -66.002686 angle2_2 = 60.082100 z2 = -97.620598 r2 = -1005.581970
2025-06-26 19:28:20.063 wait_stop in
2025-06-26 19:28:21.682 wait_stop out_0
2025-06-26 19:28:21.682 new_movej_xyz_lr 288.405792 -221.614197 -119.998100 -1005.581970 100.000000 0.000000 1
2025-06-26 19:28:21.683 goal_angle -66.002686 60.082100
2025-06-26 19:28:21.683 new_movej_angle -66.002686 60.082100 -119.998100 -1005.581970 0.000000 100.000000
2025-06-26 19:28:21.683 z1 -97.620598 z2 -119.998100
2025-06-26 19:28:21.683 angle1_1 -66.002686 angle2_1 60.082100 z1 -97.620598 r1 -1005.581970
2025-06-26 19:28:21.683 angle1_2 -66.002686 angle2_2 60.082100 z2 -119.998100 r2 -1005.581970
2025-06-26 19:28:21.683 speed 100.000000
2025-06-26 19:28:21.684 tcp_distance 22.253181
2025-06-26 19:28:21.684 new_end_speed 100.000000 j1_acc_t 0.111266 j1_avg_time 0.000000 j1_max_acc 237.000000 j1_max_sp 0.000000
2025-06-26 19:28:21.684 new_end_speed 100.000000 j2_acc_t 0.111266 j2_avg_time 0.000000 j2_max_acc 2566.500000 j2_max_sp 0.000000
2025-06-26 19:28:21.684 new_end_speed 100.000000 j3_acc_t 0.111266 j3_avg_time 0.000000 j3_max_acc 3869.100098 j3_max_sp 219.972198
2025-06-26 19:28:21.684 new_end_speed 100.000000 j4_acc_t 0.111266 j4_avg_time 0.000000 j4_max_acc 1572.900024 j4_max_sp 0.000000
2025-06-26 19:28:21.684 end_speed 100.000000
2025-06-26 19:28:21.685 trail_number0.222532
2025-06-26 19:28:21.685 tcp_distance 22.253181
2025-06-26 19:28:21.685 angle1_1 = -66.002686 angle2_1 = 60.082100 z1 = -97.620598 r1 = -1005.581970 angle1_2 = -66.002686 angle2_2 = 60.082100 z2 = -119.998100 r2 = -1005.581970

View File

@@ -1 +1 @@
918f8f9dd9ea6d7c9583382c2685485fc97aa9ca5866c488dc4e9d2e71f33cf4
5e82670f65ee76d39541b2437a6360d1aa6564474c7497f2bd09053c722cb920

View File

@@ -138,3 +138,5 @@ C:\Users\fusy_\source\repos\HitBotCSharpDemo_x64\HitBotCSharpDemo\HitBotCSharpDe
C:\Users\fusy_\source\repos\HitBotCSharpDemo_x64\HitBotCSharpDemo\HitBotCSharpDemo\bin\x64\Debug\EPPlus.xml
C:\Users\fusy_\source\repos\HitBotCSharpDemo_x64\HitBotCSharpDemo\HitBotCSharpDemo\obj\x64\Debug\CSharpDemo.csproj.SuggestedBindingRedirects.cache
C:\Users\fusy_\source\repos\HitBotCSharpDemo_x64\HitBotCSharpDemo\HitBotCSharpDemo\obj\x64\Debug\HitBotCSharpDemo.ParameterInputForm.resources
C:\Users\fusy_\source\repos\HitBotCSharpDemo_x64\HitBotCSharpDemo\HitBotCSharpDemo\bin\x64\Debug\NModbus4.dll
C:\Users\fusy_\source\repos\HitBotCSharpDemo_x64\HitBotCSharpDemo\HitBotCSharpDemo\bin\x64\Debug\NModbus4.xml

View File

@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EPPlus" version="5.0.3" targetFramework="net461" />
<package id="NModbus4" version="2.1.0" targetFramework="net461" />
<package id="OfficeOpenXml.Extension.AspNetCore" version="1.0.0" targetFramework="net461" />
</packages>

BIN
packages/NModbus4.2.1.0/.signature.p7s vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
packages/NModbus4.2.1.0/NModbus4.pdb vendored Normal file

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff