Added offset management

Added family put
Model fix
This commit is contained in:
Lucio Maranta
2018-07-05 17:11:45 +02:00
parent fa335443f3
commit 30b72ff724
16 changed files with 581 additions and 286 deletions
+44
View File
@@ -2,6 +2,7 @@
using Step.Model.DTOModels;
using Step.Model.DTOModels.ToolModels;
using Step.NC;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
@@ -350,6 +351,49 @@ public static class ThreadsFunctions
}
}
public static void ReadAxes()
{
NcHandler ncHandler = new NcHandler();
Stopwatch sw = new Stopwatch();
try
{
// Try connection
CmsError libraryError = ncHandler.Connect();
if (libraryError.errorCode != 0)
ManageLibraryError(libraryError);
while (true)
{
sw.Restart();
if (ncHandler.numericalControl.NC_IsConnected())
{
Stopwatch stopwatch = new Stopwatch();
stopwatch.Start();
// Get Data from config and PLC
libraryError = ncHandler.GetAxesPositionsByProcess(1, out DTOAxesModel axes);
Console.WriteLine("TEMPO" + stopwatch.ElapsedMilliseconds);
}
else
TryNcConnection();
sw.Stop();
//Update thread timer
ReadAxesNamesTimer += sw.ElapsedMilliseconds;
ReadAxesNamesTimes++;
// Wait
Thread.Sleep(CalcSleepTime(200, (int)sw.ElapsedMilliseconds));
}
}
catch (ThreadAbortException)
{
ncHandler.Dispose();
}
}
public static void ReadAxesNamesData()
{
NcHandler ncHandler = new NcHandler();