public static bool PLCStop(PPIReadWritePara para)
{
if (!serialPort1.IsOpen)
{
serialPort1.Open();
}
PPIAddress ppiAddress = new PPIAddress();
ppiAddress.DAddress = Convert.ToByte(para.PlcAddress);
serialPort1.DiscardInBuffer();
serialPort1.DiscardOutBuffer();
serialPort1.Write(ppiAddress.StopBytesyte, 0, ppiAddress.StopBytesyte.Length);
//Thread.Sleep(10);
string str = ByteHelper.ByteToString(ppiAddress.StopBytesyte);
if (serialPort1.ReadByte() == 0xE5)
{
return(true);
}
else
{
return(false);
}
}