|
|
@@ -111,7 +111,7 @@ namespace YSAI.Siemens
|
|
|
string SN = Depart("On");
|
|
|
try
|
|
|
{
|
|
|
- if (PlcS7 != null && PlcS7.IsConnected)
|
|
|
+ if (GetStatus().State)
|
|
|
{
|
|
|
return Break(SN, false, "已连接");
|
|
|
}
|
|
|
@@ -144,7 +144,7 @@ namespace YSAI.Siemens
|
|
|
string SN = Depart("Off");
|
|
|
try
|
|
|
{
|
|
|
- if (PlcS7 != null && PlcS7.IsConnected)
|
|
|
+ if (GetStatus().State)
|
|
|
{
|
|
|
if (tokenSource != null)
|
|
|
{
|
|
|
@@ -186,7 +186,7 @@ namespace YSAI.Siemens
|
|
|
string SN = Depart("Read");
|
|
|
try
|
|
|
{
|
|
|
- if (PlcS7 != null && PlcS7.IsConnected)
|
|
|
+ if (GetStatus().State)
|
|
|
{
|
|
|
//节点数据
|
|
|
ConcurrentDictionary<string, AddressValue> param = new ConcurrentDictionary<string, AddressValue>();
|
|
|
@@ -300,7 +300,7 @@ namespace YSAI.Siemens
|
|
|
string SN = Depart("Write");
|
|
|
try
|
|
|
{
|
|
|
- if (PlcS7 != null && PlcS7.IsConnected)
|
|
|
+ if (GetStatus().State)
|
|
|
{
|
|
|
//失败消息
|
|
|
List<string> FailMessage = new List<string>();
|