diff --git a/MTC_Sim/.vs/MTC_Sim/v14/.suo b/MTC_Sim/.vs/MTC_Sim/v14/.suo index e108687..5fb2d12 100644 Binary files a/MTC_Sim/.vs/MTC_Sim/v14/.suo and b/MTC_Sim/.vs/MTC_Sim/v14/.suo differ diff --git a/MTC_Sim/MTC_Sim/AdapterDemo.cs b/MTC_Sim/MTC_Sim/AdapterDemo.cs index 31df5e3..346a666 100644 --- a/MTC_Sim/MTC_Sim/AdapterDemo.cs +++ b/MTC_Sim/MTC_Sim/AdapterDemo.cs @@ -91,13 +91,38 @@ namespace MTC_Sim mTravel.Add(Condition.Level.FAULT, "ERR_06: Travel outside boundaries", "OP"); } - public override void getAxes() + public override void getPath() { - base.getAxes(); + base.getPath(); + mxLoad.Value = parentForm.datiProd.xLoad; mcLoad.Value = parentForm.datiProd.cLoad; } + public override int FeedRate + { + get + { + return parentForm.datiProd.PathFeedrate; + } + } + + public override int FeedRateOver + { + get + { + return parentForm.datiProd.PathFeedrateOver; + } + } + + public override int SpeedRateOver + { + get + { + return parentForm.datiProd.PathSpeedrateOver; + } + } + /// /// Recupero dati da form... /// diff --git a/MTC_Sim/MTC_Sim/AdapterGeneric.cs b/MTC_Sim/MTC_Sim/AdapterGeneric.cs index 58ca33a..3d791e8 100644 --- a/MTC_Sim/MTC_Sim/AdapterGeneric.cs +++ b/MTC_Sim/MTC_Sim/AdapterGeneric.cs @@ -65,6 +65,10 @@ namespace MTC_Sim mAdapter.AddDataItem(mMessage); // TimeSeries (es assi) + mAdapter.AddDataItem(mPathFeed); + mAdapter.AddDataItem(mPathFeedOver); + mAdapter.AddDataItem(mPathSpeedOver); + mAdapter.AddDataItem(mPosition); mAdapter.AddDataItem(mxLoad); @@ -213,6 +217,9 @@ namespace MTC_Sim #region Samples + public Sample mPathFeed = new Sample("PATH_FEEDRATE"); + public Sample mPathFeedOver = new Sample("PATH_FEEDRATE_OVER"); + public Sample mPathSpeedOver = new Sample("PATH_SPEEDRATE_OVER"); public Sample mPosition = new Sample("xPosition"); public Sample mxLoad = new Sample("xLoad"); @@ -280,7 +287,7 @@ namespace MTC_Sim // fix dati x ulteriori (allarmi, modalità RUN/EXEC, ...) getCurrMode(); - getAxes(); + getPath(); getAlarms(); @@ -299,9 +306,10 @@ namespace MTC_Sim /// /// recupero dati ASSI /// - public virtual void getAxes() + public virtual void getPath() { - // da gestire su ogni adapter... + // SE presente recupero dati path + checkPath(); } /// /// recupero allarmi @@ -356,6 +364,59 @@ namespace MTC_Sim #region area metodi comunicazione con PLC/CNC + public void checkPath() + { + if (utils.IsSetAny(STROBE_PLC, Strobe.FEED_SPEED)) + { + // leggo i valori feed/speed + mPathFeed.Value = FeedRate; + mPathFeedOver.Value = FeedRateOver; + mPathSpeedOver.Value = SpeedRateOver; + + // alzo flag lettura... + if (utils.IsSetAll(STROBE_PLC, Strobe.FEED_SPEED)) STROBE_ADP = STROBE_ADP | Strobe.FEED_SPEED; + + } + else + { + // resetto eventuali flag di lettura... + if (utils.IsSetAll(STROBE_ADP, Strobe.FEED_SPEED)) STROBE_ADP -= Strobe.FEED_SPEED; + } + } + + /// + /// recupera FeedRate (fare override!) + /// + public virtual int FeedRate + { + get + { + int answ = 0; + return answ; + } + } + /// + /// recupera FeedRateOver (fare override!) + /// + public virtual int FeedRateOver + { + get + { + int answ = 0; + return answ; + } + } + /// + /// recupera SpeedRateOver (fare override!) + /// + public virtual int SpeedRateOver + { + get + { + int answ = 0; + return answ; + } + } public void checkProd() { diff --git a/MTC_Sim/MTC_Sim/CMS_MachineSim.cs b/MTC_Sim/MTC_Sim/CMS_MachineSim.cs index 6170138..b39ee00 100644 --- a/MTC_Sim/MTC_Sim/CMS_MachineSim.cs +++ b/MTC_Sim/MTC_Sim/CMS_MachineSim.cs @@ -207,6 +207,11 @@ namespace MTC_Sim answ.pzKo = pzKo; answ.pzTot = pzOk + pzKo; + // FEED/SPEED + answ.PathFeedrate = hsPathFeed.Value; + answ.PathFeedrateOver= hsPathFeedOver.Value; + answ.PathSpeedrateOver= hsPathSpeedOver.Value; + // load... answ.xLoad = xLoad.Value; answ.cLoad = cLoad.Value; diff --git a/MTC_Sim/MTC_Sim/utils.cs b/MTC_Sim/MTC_Sim/utils.cs index 5fff87f..ae457a2 100644 --- a/MTC_Sim/MTC_Sim/utils.cs +++ b/MTC_Sim/MTC_Sim/utils.cs @@ -143,7 +143,7 @@ namespace MTC_Sim public int pzOk; public int pzKo; - public UInt32 PathFeedrate; + public int PathFeedrate; public int PathFeedrateOver; public int PathSpeedrateOver;