Added offset management
Added family put Model fix
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user