aggiunto lampeggio x comunicazione OSAI...
This commit is contained in:
@@ -30,11 +30,13 @@ namespace MTC_Adapter
|
||||
{
|
||||
try
|
||||
{
|
||||
parentForm.commPlcActive = true;
|
||||
answ = OSAI_ref.O_RW_Byte(bWrite, MemType, memIndex, memOrderStart, ref Value);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
parentForm.commPlcActive = false;
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
@@ -52,11 +54,13 @@ namespace MTC_Adapter
|
||||
{
|
||||
try
|
||||
{
|
||||
parentForm.commPlcActive = true;
|
||||
answ = OSAI_ref.O_RW_Word(bWrite, MemType, memIndex, ref Value);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
parentForm.commPlcActive = false;
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
@@ -74,11 +78,13 @@ namespace MTC_Adapter
|
||||
{
|
||||
try
|
||||
{
|
||||
parentForm.commPlcActive = true;
|
||||
answ = OSAI_ref.O_RW_DWord(bWrite, MemType, memIndex, ref Value);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
parentForm.commPlcActive = false;
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
@@ -96,11 +102,13 @@ namespace MTC_Adapter
|
||||
{
|
||||
try
|
||||
{
|
||||
parentForm.commPlcActive = true;
|
||||
answ = OSAI_ref.O_RW_Short(bWrite, MemType, memIndex, ref Value);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
parentForm.commPlcActive = false;
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
@@ -118,11 +126,13 @@ namespace MTC_Adapter
|
||||
{
|
||||
try
|
||||
{
|
||||
parentForm.commPlcActive = true;
|
||||
answ = OSAI_ref.O_RW_Integer(bWrite, MemType, memIndex, ref Value);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
parentForm.commPlcActive = false;
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
@@ -140,11 +150,13 @@ namespace MTC_Adapter
|
||||
{
|
||||
try
|
||||
{
|
||||
parentForm.commPlcActive = true;
|
||||
answ = OSAI_ref.O_RW_Double(bWrite, MemType, memIndex, ref Value);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
parentForm.commPlcActive = false;
|
||||
return answ;
|
||||
}
|
||||
|
||||
@@ -175,8 +187,10 @@ namespace MTC_Adapter
|
||||
prevPosAxis = new double[adpConf.nAxis];
|
||||
prevDirAxis = new int[adpConf.nAxis];
|
||||
|
||||
parentForm.commPlcActive = true;
|
||||
OSAI_ref = (OSAI)Runtime.NC;
|
||||
if (utils.CRB("verbose")) lg.Info(string.Format("Generato oggetto OSAI_ref da CMSCncLib:{0}{1}", Environment.NewLine, OSAI_ref.Descrizione));
|
||||
parentForm.commPlcActive = false;
|
||||
|
||||
// disconnetto e connetto...
|
||||
if (utils.CRB("verbose")) lg.Info("OSAI: tryDisconnect");
|
||||
@@ -517,9 +531,11 @@ namespace MTC_Adapter
|
||||
sb1.AppendLine(string.Format("POWER {0}: | EmStop:{1:N3} | ProcSel: {2}", mPower.Value, mEStop.Value, mProcSel.Value));
|
||||
|
||||
// leggo dati globali...
|
||||
parentForm.commPlcActive = true;
|
||||
inizio = DateTime.Now;
|
||||
OSAI_ref.O_GetNcInfo1(ref allNcData);
|
||||
if (utils.CRB("recTime")) TimingData.addResult("R-NcInfo", DateTime.Now.Subtract(inizio).Ticks);
|
||||
parentForm.commPlcActive = false;
|
||||
|
||||
// recupero speed e feed...
|
||||
FeedRate = Convert.ToInt32(allNcData.realfeed);
|
||||
@@ -838,10 +854,12 @@ namespace MTC_Adapter
|
||||
public override void getPath()
|
||||
{
|
||||
// recupero vettore generale G MODE
|
||||
parentForm.commPlcActive = true;
|
||||
inizio = DateTime.Now;
|
||||
ushort[] vettGCodes = new ushort[14];
|
||||
OSAI_ref.getPathGCodeMod(ref vettGCodes);
|
||||
if (utils.CRB("recTime")) TimingData.addResult("R-GCodModal", DateTime.Now.Subtract(inizio).Ticks);
|
||||
parentForm.commPlcActive = false;
|
||||
|
||||
// attenzione: il vettore contiene come campi "vuoti" il valore MAX di USHort (16bit) ovvero 2^16 -1 (base 0) --> 65535
|
||||
string GCodAttivi = "";
|
||||
@@ -907,6 +925,7 @@ namespace MTC_Adapter
|
||||
// mostro assi in DataMonitor......
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
parentForm.commPlcActive = true;
|
||||
inizio = DateTime.Now;
|
||||
// inizializzo x numero assi...
|
||||
CMSCncLib.OPENcontrol.GETINTDATA[] posAssiTgt = new CMSCncLib.OPENcontrol.GETINTDATA[currAdpConf.nAxis];
|
||||
@@ -914,6 +933,7 @@ namespace MTC_Adapter
|
||||
OSAI_ref.getAllAxisPos(1, ref posAssiTgt);
|
||||
OSAI_ref.getAllAxisPos(2, ref posAssi);
|
||||
if (utils.CRB("recTime")) TimingData.addResult("R-AXIS_POS", DateTime.Now.Subtract(inizio).Ticks);
|
||||
parentForm.commPlcActive = false;
|
||||
|
||||
// nuova posizione (per calcoli)
|
||||
double newPos = 0;
|
||||
|
||||
Reference in New Issue
Block a user