Refresh gestione EXE mode (check precedente mode prima di sovrascrivere)
+ nuovi installers
This commit is contained in:
Binary file not shown.
@@ -28,6 +28,51 @@ namespace MTC_Adapter
|
||||
/// </summary>
|
||||
protected FANUC FANUC_ref;
|
||||
|
||||
/// <summary>
|
||||
/// wrapper chiamata lettura/scrittura fanuc...
|
||||
/// </summary>
|
||||
/// <param name="bWrite"></param>
|
||||
/// <param name="MemType"></param>
|
||||
/// <param name="memIndex"></param>
|
||||
/// <param name="Value"></param>
|
||||
/// <returns></returns>
|
||||
public bool FanucMemRW(bool bWrite, FANUC.MemType MemType, Int32 memIndex, ref byte Value)
|
||||
{
|
||||
bool answ = false;
|
||||
if (FANUC_ref.Connected)
|
||||
{
|
||||
try
|
||||
{
|
||||
answ = FANUC_ref.F_RW_Byte(bWrite, MemType, memIndex, ref Value);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// wrapper chiamata lettura/scrittura fanuc...
|
||||
/// </summary>
|
||||
/// <param name="bWrite"></param>
|
||||
/// <param name="MemType"></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)
|
||||
{
|
||||
bool answ = false;
|
||||
if (FANUC_ref.Connected)
|
||||
{
|
||||
try
|
||||
{
|
||||
answ = FANUC_ref.F_RW_Byte(bWrite, MemType, memIndex, ref Value);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// struttura dati fanuc x ALL DYN DATA
|
||||
/// C:\Users\samuele\Documents\FOCAS A02B-0207-K737_04.20\Document\SpecE\Position\cnc_rddynamic2.htm
|
||||
@@ -141,7 +186,7 @@ namespace MTC_Adapter
|
||||
byte[] MemBlock = new byte[Strobes.Length + Acknowl.Length];
|
||||
int memIndex = 10500;
|
||||
inizio = DateTime.Now;
|
||||
FANUC_ref.F_RW_Byte(R, FANUC.MemType.R, memIndex, ref MemBlock);
|
||||
FanucMemRW(R, FANUC.MemType.R, memIndex, ref MemBlock);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-STROBES", MemBlock.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
|
||||
// suddivido!
|
||||
@@ -183,7 +228,7 @@ namespace MTC_Adapter
|
||||
// leggo tutto!!!
|
||||
memIndex = 10660;
|
||||
inizio = DateTime.Now;
|
||||
FANUC_ref.F_RW_Byte(R, FANUC.MemType.R, memIndex, ref MemBlock);
|
||||
FanucMemRW(R, FANUC.MemType.R, 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
|
||||
@@ -272,7 +317,7 @@ namespace MTC_Adapter
|
||||
if (ACK_DW1 != (StFlag32)BitConverter.ToUInt32(retACK_DW1, 0))
|
||||
{
|
||||
inizio = DateTime.Now;
|
||||
FANUC_ref.F_RW_Byte(W, FANUC.MemType.R, memIndex, ref retACK_DW1);
|
||||
FanucMemRW(W, FANUC.MemType.R, memIndex, ref retACK_DW1);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("W{0}-DW1", retACK_DW1.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
}
|
||||
|
||||
@@ -286,7 +331,7 @@ namespace MTC_Adapter
|
||||
// scrivo su area PLC
|
||||
memIndex = 10508;
|
||||
inizio = DateTime.Now;
|
||||
FANUC_ref.F_RW_Byte(W, FANUC.MemType.R, memIndex, ref retACK_DW2);
|
||||
FanucMemRW(W, FANUC.MemType.R, memIndex, ref retACK_DW2);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("W{0}-DW2", retACK_DW2.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
}
|
||||
}
|
||||
@@ -309,7 +354,7 @@ namespace MTC_Adapter
|
||||
// leggo tutto!!!
|
||||
int memIndex = 11000;
|
||||
inizio = DateTime.Now;
|
||||
FANUC_ref.F_RW_Byte(R, FANUC.MemType.R, memIndex, ref MemBlockTestData);
|
||||
FanucMemRW(R, FANUC.MemType.R, 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
|
||||
@@ -510,7 +555,7 @@ namespace MTC_Adapter
|
||||
MemBlock = new byte[128];
|
||||
// recupero tutti i 32 bit del blocco
|
||||
inizio = DateTime.Now;
|
||||
FANUC_ref.F_RW_Byte(R, FANUC.MemType.R, memIndex, ref MemBlock);
|
||||
FanucMemRW(R, FANUC.MemType.R, memIndex, ref MemBlock);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-STRB_DW0", MemBlock.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
|
||||
try
|
||||
@@ -536,7 +581,7 @@ namespace MTC_Adapter
|
||||
{
|
||||
// recupero tutti i 32 bit del blocco
|
||||
inizio = DateTime.Now;
|
||||
FANUC_ref.F_RW_Byte(R, FANUC.MemType.R, memIndex + i * 4, ref MemBlock);
|
||||
FanucMemRW(R, FANUC.MemType.R, 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 !!!FARE!!!
|
||||
@@ -565,7 +610,7 @@ namespace MTC_Adapter
|
||||
memIndex = 10500;
|
||||
// scrivo update ad ack!!!
|
||||
inizio = DateTime.Now;
|
||||
FANUC_ref.F_RW_Byte(W, FANUC.MemType.R, memIndex, ref retACK_DW0);
|
||||
FanucMemRW(W, FANUC.MemType.R, 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;
|
||||
}
|
||||
@@ -582,7 +627,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;
|
||||
FANUC_ref.F_RW_Byte(W, FANUC.MemType.R, memIndex, ref retACK_DW0);
|
||||
FanucMemRW(W, FANUC.MemType.R, memIndex, ref retACK_DW0);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("W{0}-ACK_DW0", retACK_DW0.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
}
|
||||
}
|
||||
@@ -638,22 +683,26 @@ namespace MTC_Adapter
|
||||
}
|
||||
|
||||
// switch su EXE mode...
|
||||
|
||||
string exeMode = "";
|
||||
if (STRB_DW2.HasFlag(StFlag32.B08))
|
||||
{
|
||||
vettPath[idxPath].mPathExeMode.Value = "RUN";
|
||||
exeMode = "RUN";
|
||||
}
|
||||
else if (STRB_DW2.HasFlag(StFlag32.B09))
|
||||
{
|
||||
vettPath[idxPath].mPathExeMode.Value = "READY";
|
||||
exeMode = "READY";
|
||||
}
|
||||
else if (STRB_DW2.HasFlag(StFlag32.B10))
|
||||
{
|
||||
vettPath[idxPath].mPathExeMode.Value = "HOLD";
|
||||
exeMode = "HOLD";
|
||||
}
|
||||
else if (STRB_DW2.HasFlag(StFlag32.B11))
|
||||
{
|
||||
vettPath[idxPath].mPathExeMode.Value = "FEEDHOLD";
|
||||
exeMode = "FEEDHOLD";
|
||||
}
|
||||
if (vettPath[idxPath].mPathExeMode.Value.ToString() != exeMode)
|
||||
{
|
||||
vettPath[idxPath].mPathExeMode.Value = exeMode;
|
||||
}
|
||||
|
||||
// verifico tipo path...
|
||||
@@ -666,7 +715,6 @@ namespace MTC_Adapter
|
||||
vettPath[idxPath].mPathType.Value = "ASSERV";
|
||||
}
|
||||
|
||||
|
||||
// verifico POWER ON...
|
||||
if (STRB_DW2.HasFlag(StFlag32.B13))
|
||||
{
|
||||
@@ -737,7 +785,7 @@ namespace MTC_Adapter
|
||||
int memIndex = 14000;
|
||||
byte[] tabDatiMtz = new byte[4 * maintData.Length];
|
||||
inizio = DateTime.Now;
|
||||
FANUC_ref.F_RW_Byte(R, FANUC.MemType.R, memIndex, ref tabDatiMtz);
|
||||
FanucMemRW(R, FANUC.MemType.R, memIndex, ref tabDatiMtz);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-DatiMtz", tabDatiMtz.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
// uno ad uno vado a inserirli nella mappa dei dati dell'adapter...
|
||||
int shift = 4; // 32bit
|
||||
@@ -950,7 +998,7 @@ namespace MTC_Adapter
|
||||
int numByte = 1 + (statusData.Length / 8);
|
||||
byte[] tabDatiStatus = new byte[numByte];
|
||||
inizio = DateTime.Now;
|
||||
FANUC_ref.F_RW_Byte(R, FANUC.MemType.R, memIndex, ref tabDatiStatus);
|
||||
FanucMemRW(R, FANUC.MemType.R, memIndex, ref tabDatiStatus);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-DatiStatus", tabDatiStatus.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
// uno ad uno vado a inserirli nella mappa dei dati dell'adapter...
|
||||
int numero = 0;
|
||||
@@ -1050,7 +1098,7 @@ namespace MTC_Adapter
|
||||
int memIndex = 12000;
|
||||
byte[] PathData = new byte[4];
|
||||
inizio = DateTime.Now;
|
||||
FANUC_ref.F_RW_Byte(R, FANUC.MemType.R, memIndex, ref PathData);
|
||||
FanucMemRW(R, FANUC.MemType.R, memIndex, ref PathData);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-PathData", PathData.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
|
||||
// 2016.07.19 mod con Fabio
|
||||
@@ -1226,7 +1274,7 @@ namespace MTC_Adapter
|
||||
byte[] unOpSpeedMem = new byte[60];
|
||||
|
||||
inizio = DateTime.Now;
|
||||
FANUC_ref.F_RW_Byte(R, FANUC.MemType.D, memIndex, ref unOpSpeedMem);
|
||||
FanucMemRW(R, FANUC.MemType.D, memIndex, ref unOpSpeedMem);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-SPEED_UNOP", unOpSpeedMem.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
|
||||
// NON VA: RICHIEDE OPZIONE... The extended driver/library function is necessary.
|
||||
@@ -1283,7 +1331,7 @@ namespace MTC_Adapter
|
||||
// leggo area memoria degli UT montati
|
||||
memIndex = 2960;
|
||||
inizio = DateTime.Now;
|
||||
FANUC_ref.F_RW_Byte(R, FANUC.MemType.D, memIndex, ref elencoUtMem);
|
||||
FanucMemRW(R, FANUC.MemType.D, memIndex, ref elencoUtMem);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-NUMUT", elencoUtMem.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
// decodifica da byte a int16 dell'ID Utensile
|
||||
for (int i = 0; i < maxNumOp; i++)
|
||||
@@ -1295,7 +1343,7 @@ namespace MTC_Adapter
|
||||
memIndex = 11300;
|
||||
byte[] tabUt_UT = new byte[2 * maxMemAddr];
|
||||
inizio = DateTime.Now;
|
||||
FANUC_ref.F_RW_Byte(R, FANUC.MemType.D, memIndex, ref tabUt_UT);
|
||||
FanucMemRW(R, FANUC.MemType.D, memIndex, ref tabUt_UT);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-TabUT-UT", tabUt_UT.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
// decodifico TUTTI i maxMemAddr utensili
|
||||
for (int i = 0; i < maxMemAddr; i++)
|
||||
@@ -1314,7 +1362,7 @@ namespace MTC_Adapter
|
||||
// leggo FamUt puntuale..
|
||||
memIndex = 11700 + 2 * j;
|
||||
inizio = DateTime.Now;
|
||||
FANUC_ref.F_RW_Byte(R, FANUC.MemType.D, memIndex, ref int16Mem);
|
||||
FanucMemRW(R, FANUC.MemType.D, memIndex, ref int16Mem);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-TabUT-FamUT", int16Mem.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
// step 2b: leggo puntualmente la FamUt dal suo indice...
|
||||
idFamUt[i] = BitConverter.ToUInt16(int16Mem, 0);
|
||||
@@ -1327,7 +1375,7 @@ namespace MTC_Adapter
|
||||
memIndex = 8900;
|
||||
byte[] tabFam_FamUt = new byte[2 * maxMemAddr];
|
||||
inizio = DateTime.Now;
|
||||
FANUC_ref.F_RW_Byte(R, FANUC.MemType.D, memIndex, ref tabFam_FamUt);
|
||||
FanucMemRW(R, FANUC.MemType.D, memIndex, ref tabFam_FamUt);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-TabFamUT-FamUT", tabFam_FamUt.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
// decodifico TUTTI i maxMemAddr utensili
|
||||
for (int i = 0; i < maxMemAddr; i++)
|
||||
@@ -1348,7 +1396,7 @@ namespace MTC_Adapter
|
||||
// leggo FamUt puntuale..
|
||||
memIndex = 10700 + 1 * j;
|
||||
inizio = DateTime.Now;
|
||||
FANUC_ref.F_RW_Byte(R, FANUC.MemType.D, memIndex, ref int8Mem);
|
||||
FanucMemRW(R, FANUC.MemType.D, memIndex, ref int8Mem);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-TabUT-FamUT", 8), DateTime.Now.Subtract(inizio).Ticks);
|
||||
// step 3b: leggo puntualmente il TIPO DI vita UT dal suo indice...
|
||||
idTipoVitaUt[i] = int8Mem;
|
||||
@@ -1369,7 +1417,7 @@ namespace MTC_Adapter
|
||||
// leggo FamUt puntuale..
|
||||
memIndex = 13100 + 4 * j;
|
||||
inizio = DateTime.Now;
|
||||
FANUC_ref.F_RW_Byte(R, FANUC.MemType.D, memIndex, ref int32Mem);
|
||||
FanucMemRW(R, FANUC.MemType.D, memIndex, ref int32Mem);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-TabUT-VitaRes", int32Mem.Length), DateTime.Now.Subtract(inizio).Ticks);
|
||||
// leggo puntualmente valore della vita ut residua da indice utensile...
|
||||
valVitaUtRes[i] = BitConverter.ToInt32(int32Mem, 0);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: AssemblyVersion("1.1.39.107")]
|
||||
[assembly: AssemblyFileVersion("1.1.39.107")]
|
||||
[assembly: AssemblyVersion("1.1.40.107")]
|
||||
[assembly: AssemblyFileVersion("1.1.40.107")]
|
||||
[assembly: AssemblyCopyright("Steamware-SCM-CMS © 2015-2016")]
|
||||
[assembly: AssemblyCompany("Steamware-SCM-CMS")]
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: AssemblyVersion("1.1.39.<#= this.RevisionNumber #>")]
|
||||
[assembly: AssemblyFileVersion("1.1.39.<#= this.RevisionNumber #>")]
|
||||
[assembly: AssemblyVersion("1.1.40.<#= this.RevisionNumber #>")]
|
||||
[assembly: AssemblyFileVersion("1.1.40.<#= this.RevisionNumber #>")]
|
||||
[assembly: AssemblyCopyright("Steamware-SCM-CMS © 2015-<#= DateTime.Now.Year #>")]
|
||||
[assembly: AssemblyCompany("Steamware-SCM-CMS")]
|
||||
<#+
|
||||
|
||||
Reference in New Issue
Block a user