Completato inserimento metodi x M156
This commit is contained in:
@@ -957,6 +957,54 @@ public static class ThreadsFunctions
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public static void ReadMComandsData()
|
||||
{
|
||||
NcAdapter ncAdapter = new NcAdapter();
|
||||
Stopwatch sw = new Stopwatch();
|
||||
|
||||
try
|
||||
{
|
||||
// Try connection
|
||||
CmsError libraryError = ncAdapter.Connect();
|
||||
if (libraryError.errorCode != 0)
|
||||
ManageLibraryError(libraryError);
|
||||
|
||||
while (true)
|
||||
{
|
||||
sw.Restart();
|
||||
|
||||
if (ncAdapter.numericalControl.NC_IsConnected())
|
||||
{
|
||||
// solo x S7Net...
|
||||
if (NcConfig.NcVendor == NC_VENDOR.S7NET)
|
||||
{
|
||||
libraryError = ncAdapter.GetM156Data(out List<DTOM156InputModel> m156Data);
|
||||
if (libraryError.IsError())
|
||||
ManageLibraryError(libraryError);
|
||||
else
|
||||
MessageServices.Current.Publish(SEND_M156_DATA, null, m156Data);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
RestoreConnection();
|
||||
|
||||
sw.Stop();
|
||||
|
||||
//Update thread timer
|
||||
UpdateStat(MethodBase.GetCurrentMethod().Name, sw.ElapsedMilliseconds);
|
||||
|
||||
// Wait
|
||||
Thread.Sleep(CalcSleepTime(200, (int)sw.ElapsedMilliseconds));
|
||||
}
|
||||
}
|
||||
catch (ThreadAbortException)
|
||||
{
|
||||
ncAdapter.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public static void ReadM154Data()
|
||||
{
|
||||
NcAdapter ncAdapter = new NcAdapter();
|
||||
|
||||
@@ -35,7 +35,9 @@ namespace Thermo.Active.Core
|
||||
ThreadsFunctions.ReadAreaData,
|
||||
ThreadsFunctions.ReadModulesData,
|
||||
ThreadsFunctions.ReadScadaData,
|
||||
ThreadsFunctions.ReadMComandsData,
|
||||
ThreadsFunctions.ReadM154Data // levare?
|
||||
|
||||
};
|
||||
private static Action ThreadSetupCmsConnect = ThreadsFunctions.SetupCmsConnect;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user