connette sempre...
This commit is contained in:
+1
-20
@@ -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à";
|
||||
|
||||
Reference in New Issue
Block a user