compila senza errori (e con quasi tutto commentato) la versione SIEMENS!!! iniziata rimattaptura aree DB1499 (dati MTC), DB253 (utensili) e DB254 (dati mandrini)
This commit is contained in:
@@ -11,48 +11,64 @@ namespace MTC_Adapter
|
||||
public class AdapterSiemens : AdapterGeneric
|
||||
{
|
||||
/// <summary>
|
||||
/// Oggetto MAIN x connessione FANUC
|
||||
/// Oggetto MAIN x connessione SIEMENS
|
||||
/// </summary>
|
||||
protected FANUC FANUC_ref;
|
||||
protected SIEMENS SIEMENS_ref;
|
||||
|
||||
/// <summary>
|
||||
/// Area di memoria base x MTConnect con SIEMENS
|
||||
/// </summary>
|
||||
protected int baseMemDb = 1499;
|
||||
/// <summary>
|
||||
/// Area di memoria base x dati UTENSILE
|
||||
/// </summary>
|
||||
protected int baseMemUT = 253;
|
||||
/// <summary>
|
||||
/// Area di memoria base x dati TESTE
|
||||
/// </summary>
|
||||
protected int baseMemUO = 254;
|
||||
|
||||
// non c'è single byte...
|
||||
#if false
|
||||
/// <summary>
|
||||
/// wrapper chiamata lettura/scrittura SINGOLO BYTE...
|
||||
/// </summary>
|
||||
/// <param name="bWrite"></param>
|
||||
/// <param name="MemType"></param>
|
||||
/// <param name="MemType">main address (1499/1500)</param>
|
||||
/// <param name="memIndex"></param>
|
||||
/// <param name="Value"></param>
|
||||
/// <returns></returns>
|
||||
public bool FanucMemRW(bool bWrite, FANUC.MemType MemType, Int32 memIndex, ref byte Value)
|
||||
public bool SIEMENSMemRW(bool bWrite, int MemType, Int32 memIndex, ref byte Value)
|
||||
{
|
||||
bool answ = false;
|
||||
if (FANUC_ref.Connected)
|
||||
if (SIEMENS_ref.Connected)
|
||||
{
|
||||
try
|
||||
{
|
||||
answ = FANUC_ref.F_RW_Byte(bWrite, MemType, memIndex, ref Value);
|
||||
answ = SIEMENS_ref.S_RW_Byte(bWrite, MemType, memIndex, ref Value);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
/// <summary>
|
||||
/// wrapper chiamata lettura/scrittura MULTI BYTE...
|
||||
/// </summary>
|
||||
/// <param name="bWrite"></param>
|
||||
/// <param name="MemType"></param>
|
||||
/// <param name="MemType">main address (1499/1500)</param>
|
||||
/// <param name="memIndex"></param>
|
||||
/// <param name="MATRICE Value"></param>
|
||||
/// <returns></returns>
|
||||
public bool FanucMemRW(bool bWrite, FANUC.MemType MemType, Int32 memIndex, ref byte[] Value)
|
||||
public bool SIEMENSMemRW(bool bWrite, int MemType, Int32 memIndex, ref byte[] Value)
|
||||
{
|
||||
bool answ = false;
|
||||
if (FANUC_ref.Connected)
|
||||
if (SIEMENS_ref.Connected)
|
||||
{
|
||||
try
|
||||
{
|
||||
answ = FANUC_ref.F_RW_Byte(bWrite, MemType, memIndex, ref Value);
|
||||
answ = SIEMENS_ref.S_RW_Byte(bWrite, MemType, memIndex, ref Value);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
@@ -61,7 +77,7 @@ namespace MTC_Adapter
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// struttura dati fanuc x ALL DYN DATA
|
||||
/// struttura dati SIEMENS x ALL DYN DATA
|
||||
/// C:\Users\samuele\Documents\FOCAS A02B-0207-K737_04.20\Document\SpecE\Position\cnc_rddynamic2.htm
|
||||
/// </summary>
|
||||
protected CMSCncLib.Focas1.ODBDY2_1 allDynData;
|
||||
@@ -77,23 +93,23 @@ namespace MTC_Adapter
|
||||
/// <param name="adpConf"></param>
|
||||
public AdapterSiemens(MainForm caller, AdapterConf adpConf) : base(caller, adpConf)
|
||||
{
|
||||
lg.Info("Start init Adapter FANUC all'IP {0}", utils.CRS("ipPLC"));
|
||||
lg.Info("Start init Adapter SIEMENS all'IP {0}", utils.CRS("ipPLC"));
|
||||
|
||||
Runtime.CreateNC(CNC.NcType.FANUC, utils.CRS("ipPLC"));
|
||||
Runtime.CreateNC(CNC.NcType.SIEMENS, utils.CRS("ipPLC"));
|
||||
|
||||
// inizializzo posizioni assi...
|
||||
prevPosAxis = new double[adpConf.nAxis];
|
||||
prevDirAxis = new int[adpConf.nAxis];
|
||||
|
||||
FANUC_ref = (FANUC)Runtime.NC;
|
||||
if (utils.CRB("verbose")) lg.Info("FANUC_ref da CMSCncLib");
|
||||
SIEMENS_ref = (SIEMENS)Runtime.NC;
|
||||
if (utils.CRB("verbose")) lg.Info("SIEMENS_ref da CMSCncLib");
|
||||
|
||||
// disconnetto e connetto...
|
||||
if (utils.CRB("verbose")) lg.Info("FANUC: tryDisconnect");
|
||||
if (utils.CRB("verbose")) lg.Info("SIEMENS: tryDisconnect");
|
||||
tryDisconnect();
|
||||
lg.Info("FANUC: tryConnect");
|
||||
lg.Info("SIEMENS: tryConnect");
|
||||
tryConnect();
|
||||
lg.Info("End init Adapter FANUC");
|
||||
lg.Info("End init Adapter SIEMENS");
|
||||
}
|
||||
/// <summary>
|
||||
/// Override disconnessione
|
||||
@@ -105,14 +121,14 @@ namespace MTC_Adapter
|
||||
string szStatusConnection = "";
|
||||
try
|
||||
{
|
||||
FANUC_ref.Disconnect(ref szStatusConnection);
|
||||
SIEMENS_ref.Disconnect(ref szStatusConnection);
|
||||
connectionOk = false;
|
||||
lg.Info(szStatusConnection);
|
||||
lg.Info("Effettuata disconnessione adapter FANUC!");
|
||||
lg.Info("Effettuata disconnessione adapter SIEMENS!");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
lg.Fatal(exc, "Errore nella disconnessione dall'adapter FANUC");
|
||||
lg.Fatal(exc, "Errore nella disconnessione dall'adapter SIEMENS");
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -130,7 +146,7 @@ namespace MTC_Adapter
|
||||
string szStatusConnection = "";
|
||||
try
|
||||
{
|
||||
FANUC_ref.Connect(ref szStatusConnection);
|
||||
SIEMENS_ref.Connect(ref szStatusConnection);
|
||||
lg.Info("szStatusConnection: " + szStatusConnection);
|
||||
connectionOk = true;
|
||||
// refresh stato allarmi!!!
|
||||
@@ -155,7 +171,7 @@ namespace MTC_Adapter
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
lg.Fatal(string.Format("Errore nella connessione all'adapter FANUC: {0}{1}{2}", szStatusConnection, Environment.NewLine, exc));
|
||||
lg.Fatal(string.Format("Errore nella connessione all'adapter SIEMENS: {0}{1}{2}", szStatusConnection, Environment.NewLine, exc));
|
||||
connectionOk = false;
|
||||
lg.Info(string.Format("Segnalo Adapter NON running, pausa di {0} msec prima di ulteriori tentativi di riconnessione", utils.CRI("waitRecMSec")));
|
||||
}
|
||||
@@ -163,14 +179,14 @@ namespace MTC_Adapter
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifico connessione FANUC...
|
||||
/// Verifico connessione SIEMENS...
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override bool connectionOk
|
||||
{
|
||||
get
|
||||
{
|
||||
return FANUC_ref.Connected;
|
||||
return SIEMENS_ref.Connected;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -184,9 +200,10 @@ namespace MTC_Adapter
|
||||
{
|
||||
// leggo TUTTO ack e strobe,
|
||||
byte[] MemBlock = new byte[Strobes.Length + Acknowl.Length];
|
||||
int memIndex = 10500;
|
||||
int memIndex = 0;
|
||||
|
||||
inizio = DateTime.Now;
|
||||
FanucMemRW(R, FANUC.MemType.R, memIndex, ref MemBlock);
|
||||
SIEMENSMemRW(R, baseMemDb, memIndex, ref MemBlock);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-STROBES", MemBlock.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
|
||||
// suddivido!
|
||||
@@ -228,7 +245,7 @@ namespace MTC_Adapter
|
||||
// leggo tutto!!!
|
||||
memIndex = 10660;
|
||||
inizio = DateTime.Now;
|
||||
FanucMemRW(R, FANUC.MemType.R, memIndex, ref MemBlock);
|
||||
SIEMENSMemRW(R, baseMemDb, memIndex, ref MemBlock);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-STRB_DW1", MemBlock.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
|
||||
// check COD_M
|
||||
@@ -338,7 +355,7 @@ namespace MTC_Adapter
|
||||
if (ACK_DW1 != (StFlag32)BitConverter.ToUInt32(retACK_DW1, 0))
|
||||
{
|
||||
inizio = DateTime.Now;
|
||||
FanucMemRW(W, FANUC.MemType.R, memIndex, ref retACK_DW1);
|
||||
SIEMENSMemRW(W, baseMemDb, memIndex, ref retACK_DW1);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("W{0}-DW1", retACK_DW1.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
}
|
||||
|
||||
@@ -366,7 +383,7 @@ namespace MTC_Adapter
|
||||
// scrivo su area PLC
|
||||
memIndex = 10508;
|
||||
inizio = DateTime.Now;
|
||||
FanucMemRW(W, FANUC.MemType.R, memIndex, ref retACK_DW);
|
||||
SIEMENSMemRW(W, baseMemDb, memIndex, ref retACK_DW);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("W{0}-WatchDog", retACK_DW.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
}
|
||||
}
|
||||
@@ -391,7 +408,7 @@ namespace MTC_Adapter
|
||||
// leggo tutto!!!
|
||||
int memIndex = 11000;
|
||||
inizio = DateTime.Now;
|
||||
FanucMemRW(R, FANUC.MemType.R, memIndex, ref MemBlockTestData);
|
||||
SIEMENSMemRW(R, baseMemDb, memIndex, ref MemBlockTestData);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-TEST_DATA_DW1", MemBlockTestData.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
|
||||
// recupero cod univoco test e numero parametri impiegati
|
||||
@@ -603,7 +620,7 @@ namespace MTC_Adapter
|
||||
MemBlock = new byte[128];
|
||||
// recupero tutti i 32 bit del blocco
|
||||
inizio = DateTime.Now;
|
||||
FanucMemRW(R, FANUC.MemType.R, memIndex, ref MemBlock);
|
||||
SIEMENSMemRW(R, baseMemDb, memIndex, ref MemBlock);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-STRB_DW0", MemBlock.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
if (AlarmFlags != null)
|
||||
{
|
||||
@@ -631,7 +648,7 @@ namespace MTC_Adapter
|
||||
{
|
||||
// recupero tutti i 32 bit del blocco
|
||||
inizio = DateTime.Now;
|
||||
FanucMemRW(R, FANUC.MemType.R, memIndex + i * 4, ref MemBlock);
|
||||
SIEMENSMemRW(R, baseMemDb, memIndex + i * 4, ref MemBlock);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-STRB_DW0", MemBlock.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
|
||||
// da testare metodo copia alternativo, condizionato a web.config
|
||||
@@ -660,7 +677,7 @@ namespace MTC_Adapter
|
||||
memIndex = 10500;
|
||||
// scrivo update ad ack!!!
|
||||
inizio = DateTime.Now;
|
||||
FanucMemRW(W, FANUC.MemType.R, memIndex, ref retACK_DW0);
|
||||
SIEMENSMemRW(W, baseMemDb, memIndex, ref retACK_DW0);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("W{0}-ACK_DW0", retACK_DW0.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
ackReturned = true;
|
||||
}
|
||||
@@ -677,7 +694,7 @@ namespace MTC_Adapter
|
||||
// invio INTERO set ACK_DW0 con bit abbassati...
|
||||
retACK_DW0 = BitConverter.GetBytes(Convert.ToUInt32(STRB_DW0 & ACK_DW0));
|
||||
inizio = DateTime.Now;
|
||||
FanucMemRW(W, FANUC.MemType.R, memIndex, ref retACK_DW0);
|
||||
SIEMENSMemRW(W, baseMemDb, memIndex, ref retACK_DW0);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("W{0}-ACK_DW0", retACK_DW0.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
}
|
||||
}
|
||||
@@ -868,7 +885,7 @@ namespace MTC_Adapter
|
||||
byte[] tabDatiMtzByte = new byte[4 * maintData.Length];
|
||||
uint[] tabDatiMtz = new uint[maintData.Length];
|
||||
inizio = DateTime.Now;
|
||||
FanucMemRW(R, FANUC.MemType.R, memIndex, ref tabDatiMtzByte);
|
||||
SIEMENSMemRW(R, baseMemDb, memIndex, ref tabDatiMtzByte);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-DatiMtz", tabDatiMtzByte.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
// copio byte --> word!
|
||||
Buffer.BlockCopy(tabDatiMtzByte, 0, tabDatiMtz, 0, tabDatiMtzByte.Length);
|
||||
@@ -887,7 +904,7 @@ namespace MTC_Adapter
|
||||
byte[] tabDatiAnalogByte = new byte[4 * analogData.Length];
|
||||
uint[] tabDatiAnalog = new uint[analogData.Length];
|
||||
inizio = DateTime.Now;
|
||||
FanucMemRW(R, FANUC.MemType.R, memIndex, ref tabDatiAnalogByte);
|
||||
SIEMENSMemRW(R, baseMemDb, memIndex, ref tabDatiAnalogByte);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-DatiAnalog", tabDatiAnalogByte.Length * 4), DateTime.Now.Subtract(inizio).Ticks);
|
||||
// copio byte --> word!
|
||||
Buffer.BlockCopy(tabDatiAnalogByte, 0, tabDatiAnalog, 0, tabDatiAnalogByte.Length);
|
||||
@@ -905,7 +922,7 @@ namespace MTC_Adapter
|
||||
int numByte = 1 + (statusData.Length / 8);
|
||||
byte[] tabDatiStatus = new byte[numByte];
|
||||
inizio = DateTime.Now;
|
||||
FanucMemRW(R, FANUC.MemType.R, memIndex, ref tabDatiStatus);
|
||||
SIEMENSMemRW(R, baseMemDb, memIndex, ref tabDatiStatus);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-DatiStatus", tabDatiStatus.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
|
||||
// decodifico aree memoria secondo tab configurazione
|
||||
@@ -929,9 +946,10 @@ namespace MTC_Adapter
|
||||
// dati base...
|
||||
sb1.AppendLine(string.Format("POWER {0}: | EmStop:{1:N3} | ProcSel: {2}", mPower.Value, mEStop.Value, mProcSel.Value));
|
||||
|
||||
#if false
|
||||
// leggo dati globali...
|
||||
inizio = DateTime.Now;
|
||||
allDynData = FANUC_ref.getAllDynData();
|
||||
allDynData = SIEMENS_ref.getAllDynData();
|
||||
if (utils.CRB("recTime")) TimingData.addResult("R-ALL-DYN-DATA", DateTime.Now.Subtract(inizio).Ticks);
|
||||
|
||||
FeedRate = allDynData.actf;
|
||||
@@ -939,14 +957,15 @@ namespace MTC_Adapter
|
||||
int memIndex = 12000;
|
||||
byte[] PathData_mem = new byte[4];
|
||||
inizio = DateTime.Now;
|
||||
FanucMemRW(R, FANUC.MemType.R, memIndex, ref PathData_mem);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-PathData", PathData_mem.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
SIEMENSMemRW(R, baseMemDb, memIndex, ref PathData_mem);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-PathData", PathData_mem.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
|
||||
// 2016.07.19 mod con Fabio
|
||||
//JogRateOver = PathData_mem[0];
|
||||
FeedRateOver = PathData_mem[1];
|
||||
RapidOver = PathData_mem[2];
|
||||
SpeedRateOver = PathData_mem[3];
|
||||
#endif
|
||||
|
||||
sb1.AppendLine(string.Format("FeedRate: {0} mm/min", FeedRate));
|
||||
sb1.AppendLine(string.Format("FeedRateOver: {0} %", FeedRateOver));
|
||||
@@ -958,9 +977,11 @@ namespace MTC_Adapter
|
||||
{
|
||||
sb1.AppendLine(string.Format("Allarmi CNC: {0}", allDynData.alarm));
|
||||
|
||||
#if false
|
||||
inizio = DateTime.Now;
|
||||
allarmiCNC = FANUC_ref.getCncAlarm();
|
||||
if (utils.CRB("recTime")) TimingData.addResult("R-CNC-ALARMS", DateTime.Now.Subtract(inizio).Ticks);
|
||||
allarmiCNC = SIEMENS_ref.getCncAlarm();
|
||||
if (utils.CRB("recTime")) TimingData.addResult("R-CNC-ALARMS", DateTime.Now.Subtract(inizio).Ticks);
|
||||
#endif
|
||||
checkCNCAlarms();
|
||||
}
|
||||
else
|
||||
@@ -1068,7 +1089,7 @@ namespace MTC_Adapter
|
||||
byte[] unOpSpeedMem = new byte[60];
|
||||
|
||||
inizio = DateTime.Now;
|
||||
FanucMemRW(R, FANUC.MemType.D, memIndex, ref unOpSpeedMem);
|
||||
SIEMENSMemRW(R, baseMemUO, memIndex, ref unOpSpeedMem);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-SPEED_UNOP", unOpSpeedMem.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
|
||||
procUnOp(unOpSpeedMem);
|
||||
@@ -1083,7 +1104,7 @@ namespace MTC_Adapter
|
||||
{
|
||||
int memIndex = 13100 + 4 * j;
|
||||
inizio = DateTime.Now;
|
||||
FanucMemRW(R, FANUC.MemType.D, memIndex, ref int32Mem);
|
||||
SIEMENSMemRW(R, baseMemUT, memIndex, ref int32Mem);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-TabUT-VitaRes", int32Mem.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
return memIndex;
|
||||
}
|
||||
@@ -1096,10 +1117,12 @@ namespace MTC_Adapter
|
||||
public override int getDatiUt_step3b(ref byte int8Mem, int j)
|
||||
{
|
||||
int memIndex = 10700 + 1 * j;
|
||||
#if false
|
||||
inizio = DateTime.Now;
|
||||
FanucMemRW(R, FANUC.MemType.D, memIndex, ref int8Mem);
|
||||
SIEMENSMemRW(R, baseMemUT, memIndex, ref int8Mem);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-TabUT-FamUT", 8), DateTime.Now.Subtract(inizio).Ticks);
|
||||
return memIndex;
|
||||
#endif
|
||||
return memIndex;
|
||||
}
|
||||
/// <summary>
|
||||
/// Procedura di processing lettura memoria x DatiUt - Step 3a
|
||||
@@ -1110,7 +1133,7 @@ namespace MTC_Adapter
|
||||
{
|
||||
int memIndex = 8900;
|
||||
inizio = DateTime.Now;
|
||||
FanucMemRW(R, FANUC.MemType.D, memIndex, ref tabFam_FamUt);
|
||||
SIEMENSMemRW(R, baseMemUT, memIndex, ref tabFam_FamUt);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-TabFamUT-FamUT", tabFam_FamUt.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
return memIndex;
|
||||
}
|
||||
@@ -1124,7 +1147,7 @@ namespace MTC_Adapter
|
||||
{
|
||||
int memIndex = 11700 + 2 * j;
|
||||
inizio = DateTime.Now;
|
||||
FanucMemRW(R, FANUC.MemType.D, memIndex, ref int16Mem);
|
||||
SIEMENSMemRW(R, baseMemUT, memIndex, ref int16Mem);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-TabUT-FamUT", int16Mem.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
return memIndex;
|
||||
}
|
||||
@@ -1137,7 +1160,7 @@ namespace MTC_Adapter
|
||||
{
|
||||
int memIndex = 11300;
|
||||
inizio = DateTime.Now;
|
||||
FanucMemRW(R, FANUC.MemType.D, memIndex, ref tabUt_UT);
|
||||
SIEMENSMemRW(R, baseMemUT, memIndex, ref tabUt_UT);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-TabUT-UT", tabUt_UT.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
return memIndex;
|
||||
}
|
||||
@@ -1150,7 +1173,7 @@ namespace MTC_Adapter
|
||||
{
|
||||
int memIndex = 2960;
|
||||
inizio = DateTime.Now;
|
||||
FanucMemRW(R, FANUC.MemType.D, memIndex, ref elencoUtMem);
|
||||
SIEMENSMemRW(R, baseMemUT, memIndex, ref elencoUtMem);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-NUMUT", elencoUtMem.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
return memIndex;
|
||||
}
|
||||
@@ -1159,10 +1182,11 @@ namespace MTC_Adapter
|
||||
{
|
||||
base.getPath();
|
||||
|
||||
#if false
|
||||
// recupero vettore generale G MODE
|
||||
inizio = DateTime.Now;
|
||||
CMSCncLib.Focas1.ODBGCD vettGCodes = FANUC_ref.getPathGCodeMod();
|
||||
if (utils.CRB("recTime")) TimingData.addResult("R-GCodModal", DateTime.Now.Subtract(inizio).Ticks);
|
||||
CMSCncLib.Focas1.ODBGCD vettGCodes = SIEMENS_ref.getPathGCodeMod();
|
||||
if (utils.CRB("recTime")) TimingData.addResult("R-GCodModal", DateTime.Now.Subtract(inizio).Ticks);
|
||||
|
||||
string GCodAttivi = "";
|
||||
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd0.code);
|
||||
@@ -1195,7 +1219,7 @@ namespace MTC_Adapter
|
||||
GCodAttivi += string.Format("[{0}]", vettGCodes.gcd27.code);
|
||||
|
||||
inizio = DateTime.Now;
|
||||
vettGCodes = FANUC_ref.getPathGCode1Shot();
|
||||
vettGCodes = SIEMENS_ref.getPathGCode1Shot();
|
||||
if (utils.CRB("recTime")) TimingData.addResult("R-GCodOneShot", DateTime.Now.Subtract(inizio).Ticks);
|
||||
if (vettGCodes.gcd0.flag > 0) GCodAttivi += string.Format("[{0}]", vettGCodes.gcd0.code);
|
||||
if (vettGCodes.gcd1.flag > 0) GCodAttivi += string.Format("[{0}]", vettGCodes.gcd1.code);
|
||||
@@ -1203,8 +1227,9 @@ namespace MTC_Adapter
|
||||
if (vettGCodes.gcd3.flag > 0) GCodAttivi += string.Format("[{0}]", vettGCodes.gcd3.code);
|
||||
|
||||
inizio = DateTime.Now;
|
||||
CMSCncLib.Focas1.ODB5AXMAN vettTTCoord = FANUC_ref.getPathTTCoord();
|
||||
CMSCncLib.Focas1.ODB5AXMAN vettTTCoord = SIEMENS_ref.getPathTTCoord();
|
||||
if (utils.CRB("recTime")) TimingData.addResult("R-TTCoord", DateTime.Now.Subtract(inizio).Ticks);
|
||||
#endif
|
||||
|
||||
// ciclo su path
|
||||
StringBuilder sb_2;
|
||||
@@ -1215,6 +1240,7 @@ namespace MTC_Adapter
|
||||
sb_2 = new StringBuilder();
|
||||
sb_3 = new StringBuilder();
|
||||
|
||||
#if false
|
||||
vettPath[i].mPathCodG_Act.Value = GCodAttivi;
|
||||
|
||||
vettPath[i].mPathPosActX.Value = ((decimal)vettTTCoord.data1) / utils.CRI("fattdecimale");
|
||||
@@ -1235,7 +1261,8 @@ namespace MTC_Adapter
|
||||
sb_3.AppendLine(string.Format("Path {0}, Asse 2: {1:N3}", i + 1, ((decimal)vettTTCoord.data2) / utils.CRI("fattdecimale")));
|
||||
sb_3.AppendLine(string.Format("Path {0}, Asse 3: {1:N3}", i + 1, ((decimal)vettTTCoord.data3) / utils.CRI("fattdecimale")));
|
||||
sb_3.AppendLine(string.Format("Path {0}, Cent 1: {1:N3}", i + 1, ((decimal)vettTTCoord.c1) / utils.CRI("fattdecimale")));
|
||||
sb_3.AppendLine(string.Format("Path {0}, Cent 2: {1:N3}", i + 1, ((decimal)vettTTCoord.c2) / utils.CRI("fattdecimale")));
|
||||
sb_3.AppendLine(string.Format("Path {0}, Cent 2: {1:N3}", i + 1, ((decimal)vettTTCoord.c2) / utils.CRI("fattdecimale")));
|
||||
#endif
|
||||
|
||||
parentForm.dataMonitor_2 += sb_2.ToString();
|
||||
parentForm.dataMonitor_3 += sb_3.ToString();
|
||||
@@ -1248,12 +1275,13 @@ namespace MTC_Adapter
|
||||
// mostro assi in DataMonitor......
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
#if false
|
||||
inizio = DateTime.Now;
|
||||
CMSCncLib.Focas1.ODBPOS posAssi = FANUC_ref.getAllAxisPos();
|
||||
CMSCncLib.Focas1.ODBPOS posAssi = SIEMENS_ref.getAllAxisPos();
|
||||
if (utils.CRB("recTime")) TimingData.addResult("R-AXIS_POS", DateTime.Now.Subtract(inizio).Ticks);
|
||||
|
||||
inizio = DateTime.Now;
|
||||
CMSCncLib.Focas1.ODBSVLOAD loadAssi = FANUC_ref.getAllAxisLoad();
|
||||
CMSCncLib.Focas1.ODBSVLOAD loadAssi = SIEMENS_ref.getAllAxisLoad();
|
||||
if (utils.CRB("recTime")) TimingData.addResult("R-AXIS_LOAD", DateTime.Now.Subtract(inizio).Ticks);
|
||||
|
||||
CMSCncLib.Focas1.LOADELM valLoad = new CMSCncLib.Focas1.LOADELM();
|
||||
@@ -1403,7 +1431,7 @@ namespace MTC_Adapter
|
||||
valLoad = loadAssi.svload32;
|
||||
break;
|
||||
default:
|
||||
// 2017.03.01 suggerimento Fabio: in CMS_FANUC in advanced compiler options mettere FS30D=1,SIEMENS=1 x leggere + assi?!?
|
||||
// 2017.03.01 suggerimento Fabio: in CMS_SIEMENS in advanced compiler options mettere FS30D=1,SIEMENS=1 x leggere + assi?!?
|
||||
valPos = posAssi.p1;
|
||||
valLoad = loadAssi.svload1;
|
||||
break;
|
||||
@@ -1467,6 +1495,7 @@ namespace MTC_Adapter
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
parentForm.dataMonitor_3 += sb.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user