dep_yangw
我叫锄头 10 months ago
parent ad3ffbde0e
commit 8c0bd3c159

@ -636,6 +636,10 @@ namespace ProductionSystem.Forms
middleIsCanRound = false;
Thread.Sleep(Program.ReadPlcRate);
PWMHelper.Open();
PWMHelper.Cloud();
//自动模式 如果是手动模式就是false
if (D1004)
{

@ -39,8 +39,8 @@ namespace ProductionSystem.Untils
_data = new List<byte>();
_serialPort = new SerialPort
{
PortName = Program.PortName,
BaudRate = Program.BaudRate,
PortName = "COM5",
BaudRate = 9600,
Parity = (Parity)Program.Parity,
DataBits = Program.DataBits,
StopBits = (StopBits)Program.StopBits
@ -138,7 +138,7 @@ namespace ProductionSystem.Untils
}
}
private (bool isok, string msg) writeData(string sendString)
public (bool isok, string msg) writeData(string sendString)
{
try
{

@ -1,4 +1,5 @@
using ProductionSystem_Model.ViewModel.Response.Para;
using DevExpress.Data.Helpers;
using ProductionSystem_Model.ViewModel.Response.Para;
namespace ProductionSystem.Untils
{
@ -15,6 +16,27 @@ namespace ProductionSystem.Untils
{
return PWMDeviceHelper.Instance.Run(paraCategory, speed, pointKeyValue);
}
public static void Open()
{
string a =
"01 10 00 00 00 0D 1A 00 78 00 00 00 64 01 CC 00 14 00 0A 00 0A 00 32 03 E8 01 90 00 32 00 01 00 01 62 55";
PWMDeviceHelper.Instance.writeData(a);
a = "01 06 00 0D 00 01 D9 C9";
PWMDeviceHelper.Instance.writeData(a);
}
public static void Cloud()
{
string a =
"01 06 00 0D 00 00 18 09";
PWMDeviceHelper.Instance.writeData(a);
}
}

Loading…
Cancel
Save