update lettura area di memoria generica x counter + cambio nome var memoria
This commit is contained in:
@@ -59,12 +59,12 @@ BLINK_FILT=0
|
||||
;BLINK_FILT=28
|
||||
|
||||
[OPTPAR]
|
||||
;PZCOUNT_MODE=STD|BIT.indice
|
||||
PZCOUNT_MODE=STD.D.DW.1604 ;contapezzi.area.indice.tipo_mem
|
||||
PZ_CAD_MADDR=1602; cad
|
||||
PZ_REQ_MADDR=1603; pz richiesti (DW)
|
||||
PZ_DONE_MADDR=1604; pz fatti
|
||||
PZ_GTOT_MADDR=1605; pz tot macchina
|
||||
;PZCOUNT_MODE=STD.[PAR/MEM].info|BIT.indice
|
||||
PZCOUNT_MODE=STD.D.1604.DW;contapezzi.area.indice.tipo_mem
|
||||
;PZ_CAD_MADDR=1602; cad
|
||||
;PZ_REQ_MADDR=1603; pz richiesti (DW)
|
||||
;PZ_DONE_MADDR=1604; pz fatti
|
||||
;PZ_GTOT_MADDR=1605; pz tot macchina
|
||||
|
||||
[BRANCH]
|
||||
NAME=develop
|
||||
+50
-26
@@ -106,23 +106,23 @@ namespace IOB_WIN
|
||||
/// <summary>
|
||||
/// Dati dell'area D
|
||||
/// </summary>
|
||||
protected memAddressFanuc areaD;
|
||||
protected memAreaFanuc areaD;
|
||||
/// <summary>
|
||||
/// Dati dell'area PARameters
|
||||
/// </summary>
|
||||
protected memAddressFanuc areaPAR;
|
||||
protected memAreaFanuc areaPAR;
|
||||
/// <summary>
|
||||
/// Dati dell'area R
|
||||
/// </summary>
|
||||
protected memAddressFanuc areaR;
|
||||
protected memAreaFanuc areaR;
|
||||
/// <summary>
|
||||
/// Dati dell'area X
|
||||
/// </summary>
|
||||
protected memAddressFanuc areaX;
|
||||
protected memAreaFanuc areaX;
|
||||
/// <summary>
|
||||
/// Dati dell'area Y
|
||||
/// </summary>
|
||||
protected memAddressFanuc areaY;
|
||||
protected memAreaFanuc areaY;
|
||||
|
||||
/// <summary>
|
||||
/// estende l'init della classe base...
|
||||
@@ -155,31 +155,31 @@ namespace IOB_WIN
|
||||
enablePrgName = fIni.ReadBoolean("CNC", "GETPRGNAME", true);
|
||||
|
||||
// salvo le aree X-Y-D (per dump/sample/ottimizzazione lettura)
|
||||
areaD = new memAddressFanuc
|
||||
areaD = new memAreaFanuc
|
||||
{
|
||||
areaName = "AreaD",
|
||||
startIdx = fIni.ReadInteger("MEMORY", "AREAD_START", 0),
|
||||
arraySize = fIni.ReadInteger("MEMORY", "AREAD_SIZE", 0)
|
||||
};
|
||||
areaPAR = new memAddressFanuc
|
||||
areaPAR = new memAreaFanuc
|
||||
{
|
||||
areaName = "AreaPARR",
|
||||
startIdx = fIni.ReadInteger("MEMORY", "PAR_START", 0),
|
||||
arraySize = fIni.ReadInteger("MEMORY", "PAR_SIZE", 0)
|
||||
};
|
||||
areaR = new memAddressFanuc
|
||||
areaR = new memAreaFanuc
|
||||
{
|
||||
areaName = "AreaR",
|
||||
startIdx = fIni.ReadInteger("MEMORY", "AREAR_START", 0),
|
||||
arraySize = fIni.ReadInteger("MEMORY", "AREAR_SIZE", 0)
|
||||
};
|
||||
areaX = new memAddressFanuc
|
||||
areaX = new memAreaFanuc
|
||||
{
|
||||
areaName = "AreaX",
|
||||
startIdx = fIni.ReadInteger("MEMORY", "AREAX_START", 0),
|
||||
arraySize = fIni.ReadInteger("MEMORY", "AREAX_SIZE", 0)
|
||||
};
|
||||
areaY = new memAddressFanuc
|
||||
areaY = new memAreaFanuc
|
||||
{
|
||||
areaName = "AreaY",
|
||||
startIdx = fIni.ReadInteger("MEMORY", "AREAY_START", 0),
|
||||
@@ -642,14 +642,15 @@ namespace IOB_WIN
|
||||
// verifico quale modalità sia richiesta: STD (6711) oppure BIT (Custom, con indicazione area)
|
||||
if (currIobConf.optPar.Count > 0 && currIobConf.optPar["PZCOUNT_MODE"] != "")
|
||||
{
|
||||
if (currIobConf.optPar["PZCOUNT_MODE"].StartsWith("STD"))
|
||||
string memAddr = currIobConf.optPar["PZCOUNT_MODE"];
|
||||
if (memAddr.StartsWith("STD"))
|
||||
{
|
||||
// inizio verifica area memoria/parametro levando prima parte codice
|
||||
memAddr = memAddr.Replace("STD.", "");
|
||||
// var di appoggio
|
||||
object output = new object();
|
||||
int cntAddr = 0;
|
||||
// inizio verifica area memoria/parametro levando prima aprte codice
|
||||
string memAddr = currIobConf.optPar["PZCOUNT_MODE"].Replace("STD.", "");
|
||||
// verifico se si tratta di lettura parametro...
|
||||
object outputVal = new object();
|
||||
// verifico se si tratta di lettura parametro... formatp tipo STD.PAR.6711
|
||||
if (memAddr.StartsWith("PAR."))
|
||||
{
|
||||
// recupero parametro...
|
||||
@@ -658,22 +659,45 @@ namespace IOB_WIN
|
||||
|
||||
// processo parametro contapezzi (lavorati)
|
||||
stopwatch.Restart();
|
||||
FANUC_ref.F_RW_Param_Integer(false, cntAddr, 3, ref output);
|
||||
FANUC_ref.F_RW_Param_Integer(false, cntAddr, 3, ref outputVal);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(currIobConf.codIOB, string.Format("R{0}-PAR", 4), stopwatch.ElapsedTicks);
|
||||
|
||||
// salvo ultimo conteggio rilevato
|
||||
Int32.TryParse(outputVal.ToString(), out lastCountCNC);
|
||||
}
|
||||
// altrimenti se legge da area memoria specifica leggo da li...
|
||||
// altrimenti se legge da area memoria specifica leggo da li... formto tipo STD.D.1604.DW
|
||||
else
|
||||
{
|
||||
// in primis AREA di memoria...
|
||||
string area = memAddr.Substring(0, memAddr.IndexOf("."));
|
||||
memAddr = memAddr.Replace(area + ".", "");
|
||||
// poi controllo tipo di memoria
|
||||
string tipo = "";
|
||||
// infine recupero indirizzo...
|
||||
}
|
||||
memAddressFanuc areaCounter = new memAddressFanuc(memAddr);
|
||||
|
||||
// salvo ultimo conteggio rilevato
|
||||
Int32.TryParse(output.ToString(), out lastCountCNC);
|
||||
// leggo!
|
||||
stopwatch.Restart();
|
||||
// switch x tipo dati --> tipo lettura... e salvo ultimo conteggio rilevato
|
||||
switch (areaCounter.vType)
|
||||
{
|
||||
case "B":
|
||||
byte valB = 0;
|
||||
FANUC_ref.F_RW_Byte(false, areaCounter.mType, areaCounter.mPos, ref valB);
|
||||
outputVal = valB;
|
||||
break;
|
||||
case "D":
|
||||
ushort valW = 0;
|
||||
FANUC_ref.F_RW_Word(false, areaCounter.mType, areaCounter.mPos, ref valW);
|
||||
outputVal = valW;
|
||||
break;
|
||||
case "DW":
|
||||
uint valDW = 0;
|
||||
FANUC_ref.F_RW_DWord(false, areaCounter.mType, areaCounter.mPos, ref valDW);
|
||||
outputVal = valDW;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (utils.CRB("recTime")) TimingData.addResult(currIobConf.codIOB, string.Format("R-{0}.{1}.{2}", areaCounter.mType, areaCounter.mPos, areaCounter.vType), stopwatch.ElapsedTicks);
|
||||
|
||||
// salvo...
|
||||
Int32.TryParse(outputVal.ToString(), out lastCountCNC);
|
||||
}
|
||||
stopwatch.Stop();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace IOB_WIN
|
||||
if (testCncConn())
|
||||
{
|
||||
// decodifico memoria...
|
||||
memAddressSiemens memoria = new memAddressSiemens(parametri.memAddrRead);
|
||||
memAreaSiemens memoria = new memAreaSiemens(parametri.memAddrRead);
|
||||
int numByte = parametri.memSizeRead;
|
||||
Byte[] memByteRead = currPLC.ReadBytes(DataType.DataBlock, memoria.DbNum, memoria.indiceMem, numByte);
|
||||
// copio in value, sennò do errore...
|
||||
|
||||
+83
-4
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using CncLib.CNC;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -9,7 +10,7 @@ namespace IOB_WIN
|
||||
/// <summary>
|
||||
/// Definizione area memoria SIEMENS
|
||||
/// </summary>
|
||||
public class memAddressSiemens
|
||||
public class memAreaSiemens
|
||||
{
|
||||
/// <summary>
|
||||
/// Indice DB
|
||||
@@ -27,7 +28,7 @@ namespace IOB_WIN
|
||||
/// Inizializza da un formato stringa
|
||||
/// </summary>
|
||||
/// <param name="strFormat"></param>
|
||||
public memAddressSiemens(string strFormat)
|
||||
public memAreaSiemens(string strFormat)
|
||||
{
|
||||
string[] memComp = strFormat.Split('.');
|
||||
int.TryParse(memComp[0].Replace("DB", ""), out DbNum);
|
||||
@@ -39,7 +40,7 @@ namespace IOB_WIN
|
||||
/// <summary>
|
||||
/// Definizione area memoria FANUC
|
||||
/// </summary>
|
||||
public class memAddressFanuc
|
||||
public class memAreaFanuc
|
||||
{
|
||||
/// <summary>
|
||||
/// Nome area memoria
|
||||
@@ -54,4 +55,82 @@ namespace IOB_WIN
|
||||
/// </summary>
|
||||
public int arraySize;
|
||||
}
|
||||
/// <summary>
|
||||
/// Definizione indirizzo memoria FANUC
|
||||
/// </summary>
|
||||
public class memAddressFanuc
|
||||
{
|
||||
/// <summary>
|
||||
/// Tipo memoria
|
||||
/// </summary>
|
||||
public FANUC.MemType mType;
|
||||
/// <summary>
|
||||
/// Posizione memoria
|
||||
/// </summary>
|
||||
public int mPos;
|
||||
/// <summary>
|
||||
/// Tipo valore
|
||||
/// </summary>
|
||||
public string vType;
|
||||
/// <summary>
|
||||
/// Inizializza da un formato stringa
|
||||
/// </summary>
|
||||
/// <param name="strFormat">Stringa TipoMem.Indice.DimMem (es D.1604.DW)</param>
|
||||
public memAddressFanuc(string strFormat)
|
||||
{
|
||||
string[] memComp = strFormat.Split('.');
|
||||
switch (memComp[0])
|
||||
{
|
||||
case "A":
|
||||
mType = FANUC.MemType.A;
|
||||
break;
|
||||
case "C":
|
||||
mType = FANUC.MemType.C;
|
||||
break;
|
||||
case "CM":
|
||||
mType = FANUC.MemType.CM;
|
||||
break;
|
||||
case "D":
|
||||
mType = FANUC.MemType.D;
|
||||
break;
|
||||
case "E":
|
||||
mType = FANUC.MemType.E;
|
||||
break;
|
||||
case "F":
|
||||
mType = FANUC.MemType.F;
|
||||
break;
|
||||
case "G":
|
||||
mType = FANUC.MemType.G;
|
||||
break;
|
||||
case "K":
|
||||
mType = FANUC.MemType.K;
|
||||
break;
|
||||
case "M":
|
||||
mType = FANUC.MemType.M;
|
||||
break;
|
||||
case "N":
|
||||
mType = FANUC.MemType.N;
|
||||
break;
|
||||
case "R":
|
||||
mType = FANUC.MemType.R;
|
||||
break;
|
||||
case "T":
|
||||
mType = FANUC.MemType.T;
|
||||
break;
|
||||
case "X":
|
||||
mType = FANUC.MemType.X;
|
||||
break;
|
||||
case "Y":
|
||||
mType = FANUC.MemType.Y;
|
||||
break;
|
||||
case "Z":
|
||||
mType = FANUC.MemType.Z;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
int.TryParse(memComp[1], out mPos);
|
||||
vType = memComp[2];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -14,7 +14,7 @@ pipeline {
|
||||
|
||||
/* calcolo numero versione... diverso x branch MASTER/DEVELOP */
|
||||
script {
|
||||
withEnv(['NEXT_BUILD_NUMBER=260']) {
|
||||
withEnv(['NEXT_BUILD_NUMBER=261']) {
|
||||
// env.versionNumber = VersionNumber(versionNumberString : '1.18.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true)
|
||||
env.versionNumber = VersionNumber(versionNumberString : '1.18.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
|
||||
env.APP_NAME = 'MAPO-IOB-WIN'
|
||||
|
||||
Reference in New Issue
Block a user