connette sempre...

This commit is contained in:
Samuele E. Locatelli
2017-11-29 17:14:17 +01:00
parent 165a70e416
commit 4e81776e78
+1 -20
View File
@@ -85,27 +85,9 @@ namespace Test_S7
//Stopwatch sw = new Stopwatch();
sw.Start();
// inizializzo
#if false
CpuType tipoCpu = CpuType.S7300;
short slot = 0;
short rack = 0;
#endif
string titolo = "";
string contenuto = "";
txtOut.Text = "";
#if false
// leggo selezione...
try
{
short.TryParse(txtSlot.Text, out slot);
short.TryParse(txtRack.Text, out rack);
tipoCpu = (CpuType)Enum.Parse(typeof(CpuType), cbCpuType.SelectedItem.ToString());
}
catch (Exception exc)
{
lg.Error(exc, "Errore in parse parametri");
}
#endif
//if (parametri.ipAdrr != "" && parametri.rack >= 0 && parametri.slot >= 0)
//{
// using (var plc = new Plc(tipoCpu, txtIP.Text, rack, slot))
@@ -124,8 +106,7 @@ namespace Test_S7
}
else
{
// provo ad aprire connessione SE NON APERTA...
if(!currPLC.IsConnected) currPLC.Open();
currPLC.Open();
if (!currPLC.IsAvailable)
{
titolo = "Errore Disponibilità";