|
@@ -5912,6 +5912,9 @@ namespace Welling_Motor_Debug_Tool
|
|
|
Code[0] = 0x00;//5S协议
|
|
|
Code[1] = 0x00;
|
|
|
mySerialProcess.SendCmd((ushort)0x7FF, (byte)0x16, (ushort)0x7702, Code);
|
|
|
+ Delay_ms(500);
|
|
|
+ mySerialProcess.SendCmd((ushort)0x7FF, (byte)0x16, (ushort)0x7702, Code);
|
|
|
+ Delay_ms(500);
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "发送指令进入5S协议" + "\r\n");
|
|
|
}
|
|
|
|
|
@@ -6003,9 +6006,12 @@ namespace Welling_Motor_Debug_Tool
|
|
|
Code[0] = 0x00;//5S协议
|
|
|
Code[1] = 0x00;
|
|
|
mySerialProcess.SendCmd((ushort)0x7FF, (byte)0x16, (ushort)0x7702, Code);
|
|
|
+ Delay_ms(500);
|
|
|
+ mySerialProcess.SendCmd((ushort)0x7FF, (byte)0x16, (ushort)0x7702, Code);
|
|
|
+ Delay_ms(500);
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "发送指令进入5S协议" + "\r\n");
|
|
|
}
|
|
|
- Delay_ms(2000);
|
|
|
+
|
|
|
|
|
|
//检查是否有故障
|
|
|
if (textBox_ErrorCode.Text.Contains("H"))
|
|
@@ -6317,6 +6323,7 @@ namespace Welling_Motor_Debug_Tool
|
|
|
//发送指令启动电机
|
|
|
do
|
|
|
{
|
|
|
+#if false //通过运行模式3启动电机
|
|
|
//发送指令读取调试信息
|
|
|
richTextBox_DebugParam.Clear();
|
|
|
mySerialProcess.SendCmd((ushort)0x751, (byte)0x11, (ushort)0x4500, null);
|
|
@@ -6357,10 +6364,33 @@ namespace Welling_Motor_Debug_Tool
|
|
|
mySerialProcess.SendCmd((ushort)0x751, (byte)0x16, (ushort)0x463C, Code);
|
|
|
label_FacModeStatus.Text = "启动电机";
|
|
|
richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "启动电机" + "\r\n");
|
|
|
+#else //通过Walk模式启动电机
|
|
|
//设置转速100%
|
|
|
var Data = new byte[1];
|
|
|
Data[0] = (byte)100;
|
|
|
mySerialProcess.SendCmd((ushort)0x751, (byte)0x16, (ushort)0x2C01, Data);
|
|
|
+ //启动电机进入WALK模式
|
|
|
+ richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "基础功能检测,进入WALK" + "\r\n");
|
|
|
+ Code[0] = 0x22;
|
|
|
+ Code[1] = 0xF0;
|
|
|
+ mySerialProcess.SendCmd((ushort)0x751, (byte)0x16, (ushort)0x2802, Code);
|
|
|
+ WriteACK = false;
|
|
|
+ WriteCnt = 0;
|
|
|
+ ACK_WaitCnt = 0;
|
|
|
+ while (ACK_WaitCnt <= 2) ; //1s
|
|
|
+ if ((textBox_RunInfo_GearSt.Text != "WALK") || (Convert.ToInt32(textBox_RunInfo_MotorSpeed.Text.Split(' ')[0]) < 200))
|
|
|
+ {
|
|
|
+ richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "进入WALK异常" + "\r\n");
|
|
|
+ label_FacModeStatus.Text = "存在故障!";
|
|
|
+ label_FacModeResult.BackColor = Color.Red;
|
|
|
+ label_FacModeResult.Text = "测试异常";
|
|
|
+ Delay_ms(500);
|
|
|
+ //存储异常并上传
|
|
|
+ FacMode_Stop(false);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ richTextBox_FacModeLog.AppendText(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "->" + "已进入WALK,开始检测" + "\r\n");
|
|
|
+#endif
|
|
|
Delay_ms(3000);
|
|
|
} while (false);
|
|
|
|