Fix vari con Fabio

Fix lettura area D--> area R x vari mtz
Fix valori lettura da aree UT
This commit is contained in:
Samuele E. Locatelli
2016-07-19 14:52:52 +02:00
parent 75c818fae4
commit fdafaf63ac
5 changed files with 19 additions and 17 deletions
+11 -12
View File
@@ -701,8 +701,6 @@ namespace MTC_Adapter
public override void getSlowChangingData()
{
base.getSlowChangingData();
// dati da PC
mClock.Value = DateTime.Now.Date.ToFileTimeUtc();
// reload dati da file...
reloadDataFromFile();
@@ -723,7 +721,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.D, memIndex, ref tabDatiMtz);
FANUC_ref.F_RW_Byte(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
@@ -905,7 +903,7 @@ namespace MTC_Adapter
int memIndex = 12000;
byte[] PathData = new byte[8];
inizio = DateTime.Now;
FANUC_ref.F_RW_Byte(R, FANUC.MemType.D, memIndex, ref PathData);
FANUC_ref.F_RW_Byte(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);
@@ -1077,6 +1075,7 @@ namespace MTC_Adapter
int[] tabUt = new int[maxMemAddr];
int[] tabFamUt = new int[maxMemAddr];
int memIndex = 0;
byte[] int32Mem = new byte[4];
byte[] int16Mem = new byte[2];
byte int8Mem = new byte();
@@ -1111,7 +1110,7 @@ namespace MTC_Adapter
for (int j = 0; j < maxMemAddr; j++)
{
// controllo, se l'id utensile è quello dell'attuale UnOp...
if (tabUt_UT[j] == idUtMontato[i])
if (tabUt[j] == idUtMontato[i])
{
// leggo FamUt puntuale..
memIndex = 11700 + 2 * j;
@@ -1148,7 +1147,7 @@ namespace MTC_Adapter
if (tabFamUt[j] == idFamUt[i] && !found)
{
// leggo FamUt puntuale..
memIndex = 10700 + 2 * j;
memIndex = 10700 + 1 * j;
inizio = DateTime.Now;
FANUC_ref.F_RW_Byte(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);
@@ -1166,15 +1165,15 @@ namespace MTC_Adapter
for (int j = 0; j < maxMemAddr; j++)
{
// controllo, se l'id utensile è quello dell'attuale UnOp...
if (tabUt_UT[j] == idUtMontato[i])
if (tabUt[j] == idUtMontato[i])
{
// leggo FamUt puntuale..
memIndex = 13100 + 2 * j;
memIndex = 13100 + 4 * j;
inizio = DateTime.Now;
FANUC_ref.F_RW_Byte(R, FANUC.MemType.D, memIndex, ref int16Mem);
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-TabUT-VitaRes", int16Mem.Length), DateTime.Now.Subtract(inizio).Ticks);
FANUC_ref.F_RW_Byte(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.ToUInt16(int16Mem, 0);
valVitaUtRes[i] = BitConverter.ToInt32(int32Mem, 0);
}
}
}
@@ -1359,7 +1358,7 @@ namespace MTC_Adapter
// calcolo distanza e salvo valore...
distPerc = newPos - prevPosAxis[i];
vettAxis[i].mAxDistDone.Value = Math.Abs(distPerc);
//vettAxis[i].mAxDistDone.Value = Math.Abs(distPerc);
// sistemo direzione +/- (POS/NEG se lineari, CCW/CW se rotativi)
if (distPerc != 0)
+2
View File
@@ -1685,6 +1685,8 @@ namespace MTC_Adapter
/// </summary>
public virtual void getSlowChangingData()
{
// dati da PC
mClock.Value = string.Format("{0:yyyy-MM-dd} {0:HH:mm:ss}", DateTime.Now);
// da gestire su ogni adapter...
}
/// <summary>
+2 -1
View File
@@ -30,7 +30,8 @@
<!--SIM PC
IP ETH: 192.168.139.201/255.255.255.0
ipFanuc = "192.168.139.100"-->
<add key="ipFanuc" value="192.168.139.100" />
<!--<add key="ipFanuc" value="192.168.139.100" />-->
<add key="ipFanuc" value="192.168.139.1" />
<!--PRODUZIONE
IP ETH: 192.168.139.201/255.255.255.0
+2 -2
View File
@@ -5,7 +5,7 @@
using System.Reflection;
[assembly: AssemblyVersion("1.1.14.93")]
[assembly: AssemblyFileVersion("1.1.14.93")]
[assembly: AssemblyVersion("1.1.15.93")]
[assembly: AssemblyFileVersion("1.1.15.93")]
[assembly: AssemblyCopyright("Steamware-SCM-CMS © 2015-2016")]
[assembly: AssemblyCompany("Steamware-SCM-CMS")]
+2 -2
View File
@@ -6,8 +6,8 @@
using System.Reflection;
[assembly: AssemblyVersion("1.1.14.<#= this.RevisionNumber #>")]
[assembly: AssemblyFileVersion("1.1.14.<#= this.RevisionNumber #>")]
[assembly: AssemblyVersion("1.1.15.<#= this.RevisionNumber #>")]
[assembly: AssemblyFileVersion("1.1.15.<#= this.RevisionNumber #>")]
[assembly: AssemblyCopyright("Steamware-SCM-CMS © 2015-<#= DateTime.Now.Year #>")]
[assembly: AssemblyCompany("Steamware-SCM-CMS")]
<#+