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

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

@ -39,8 +39,8 @@ namespace ProductionSystem.Untils
_data = new List<byte>(); _data = new List<byte>();
_serialPort = new SerialPort _serialPort = new SerialPort
{ {
PortName = Program.PortName, PortName = "COM5",
BaudRate = Program.BaudRate, BaudRate = 9600,
Parity = (Parity)Program.Parity, Parity = (Parity)Program.Parity,
DataBits = Program.DataBits, DataBits = Program.DataBits,
StopBits = (StopBits)Program.StopBits 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 try
{ {

@ -1,4 +1,5 @@
using ProductionSystem_Model.ViewModel.Response.Para; using DevExpress.Data.Helpers;
using ProductionSystem_Model.ViewModel.Response.Para;
namespace ProductionSystem.Untils namespace ProductionSystem.Untils
{ {
@ -15,6 +16,27 @@ namespace ProductionSystem.Untils
{ {
return PWMDeviceHelper.Instance.Run(paraCategory, speed, pointKeyValue); 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