inizio ad aggiungere area R

This commit is contained in:
Samuele E. Locatelli
2018-04-23 16:12:32 +02:00
parent ccb4974e95
commit f19461d093
3 changed files with 97 additions and 7 deletions
+9 -4
View File
@@ -23,18 +23,23 @@ CMDREBO=/sendReboot.aspx?idxMacchina=
[MEMORY]
AREAG_SIZE=48
AREAR_SIZE=24
AREAX_SIZE=8
AREAY_SIZE=8
; Red: Y0.2 | Yellow: Y1.2 | Green Y2.6
; Red: Y0.2 | Yellow: Y1.2 | Green Y2.6 | PZCount R10.5 / R22.4
;BIT0=CONN
BIT1=Y2.6
BIT2=X5.2
BIT2=R10.5
BIT3=Y0.2
BIT4=Y1.2
AREAD_START=0
AREAD_SIZE=9999
AREAD_SIZE=0
AREAR_START=0
AREAR_SIZE=24
AREAX_START=0
AREAX_SIZE=0
AREAY_START=0
AREAY_SIZE=64
AREAY_SIZE=0
[BLINK]
;MAX_COUNTER_BLINK = 30
+87 -2
View File
@@ -26,6 +26,10 @@ namespace IOB_WIN
/// </summary>
protected byte[] MemBlockG = new byte[2];
/// <summary>
/// Area memoria R (copia)
/// </summary>
protected byte[] MemBlockR = new byte[2];
/// <summary>
/// Area memoria X (copia)
/// </summary>
protected byte[] MemBlockX = new byte[2];
@@ -104,13 +108,17 @@ namespace IOB_WIN
/// </summary>
protected memAddressFanuc areaD;
/// <summary>
/// Dati dell'area Y
/// Dati dell'area R
/// </summary>
protected memAddressFanuc areaY;
protected memAddressFanuc areaR;
/// <summary>
/// Dati dell'area X
/// </summary>
protected memAddressFanuc areaX;
/// <summary>
/// Dati dell'area Y
/// </summary>
protected memAddressFanuc areaY;
/// <summary>
/// estende l'init della classe base...
@@ -130,10 +138,12 @@ namespace IOB_WIN
IniFile fIni = new IniFile(IOBConf.iniFileName);
// inizializzo aree di memoria correnti...
MemBlockG = new byte[fIni.ReadInteger("MEMORY", "AREAG_SIZE", 8)];
MemBlockR = new byte[fIni.ReadInteger("MEMORY", "AREAR_SIZE", 8)];
MemBlockX = new byte[fIni.ReadInteger("MEMORY", "AREAX_SIZE", 8)];
MemBlockY = new byte[fIni.ReadInteger("MEMORY", "AREAY_SIZE", 8)];
// loggo aree di memoria avviate...
lgInfo(string.Format("Avviare area di memoria MemBlockG: {0} byte", MemBlockG.Length));
lgInfo(string.Format("Avviare area di memoria MemBlockR: {0} byte", MemBlockR.Length));
lgInfo(string.Format("Avviare area di memoria MemBlockX: {0} byte", MemBlockX.Length));
lgInfo(string.Format("Avviare area di memoria MemBlockY: {0} byte", MemBlockY.Length));
@@ -144,6 +154,12 @@ namespace IOB_WIN
startIdx = fIni.ReadInteger("MEMORY", "AREAD_START", 0),
arraySize = fIni.ReadInteger("MEMORY", "AREAD_SIZE", 0)
};
areaR = new memAddressFanuc
{
areaName = "AreaR",
startIdx = fIni.ReadInteger("MEMORY", "AREAR_START", 0),
arraySize = fIni.ReadInteger("MEMORY", "AREAR_SIZE", 0)
};
areaX = new memAddressFanuc
{
areaName = "AreaX",
@@ -157,6 +173,7 @@ namespace IOB_WIN
arraySize = fIni.ReadInteger("MEMORY", "AREAY_SIZE", 0)
};
lgInfo(string.Format("Salvata area di memoria: {0}, da {1} per {2} byte", areaD.areaName, areaD.startIdx, areaD.arraySize));
lgInfo(string.Format("Salvata area di memoria: {0}, da {1} per {2} byte", areaR.areaName, areaR.startIdx, areaR.arraySize));
lgInfo(string.Format("Salvata area di memoria: {0}, da {1} per {2} byte", areaX.areaName, areaX.startIdx, areaX.arraySize));
lgInfo(string.Format("Salvata area di memoria: {0}, da {1} per {2} byte", areaY.areaName, areaY.startIdx, areaY.arraySize));
@@ -755,6 +772,74 @@ namespace IOB_WIN
{
dump_MemAreaY(tipo, areaY.startIdx, areaY.arraySize);
}
// se l'area ha una size > 0...
if (areaR.arraySize > 0)
{
dump_MemArea(tipo, FANUC.MemType.R, areaR.startIdx, areaR.arraySize);
}
}
/// <summary>
/// Dump area D della memoria
/// </summary>
/// <param name="tipo">tipo di DUMP: START (sovrascrivendo) / SAMPLE (salva tanti campionamenti)</param>
/// <param name="tipoMem">tipo memoria</param>
/// <param name="memIndex">area memoria di partenza</param>
/// <param name="memSizeByte">dimensione memoria</param>
private void dump_MemArea(dumpType tipo, FANUC.MemType tipoMem, int memIndex, int memSizeByte)
{
DateTime adesso = DateTime.Now;
string nomeFileB = "";
string nomeFileW = "";
string nomeFileDW = "";
Dictionary<string, string> mappaValori = new Dictionary<string, string>();
// per sicurezza verifico < 9999 byte
if (memSizeByte > 9999) memSizeByte = 9999;
// leggo TUTTI i (MAX 9999) byte della memoria D...
byte[] MemBlockCurr = new byte[memSizeByte];
if (verboseLog) lgInfo("START MemDump", tipoMem);
stopwatch.Restart();
FanucMemRW(R, tipoMem, memIndex, ref MemBlockCurr);
if (utils.CRB("recTime")) TimingData.addResult(currIobConf.codIOB, string.Format("R{0}-{1}", MemBlockCurr.Length, tipoMem), stopwatch.ElapsedTicks);
if (verboseLog) lgInfo("END MemDump",tipoMem);
// seconda del tipo di lettura definisco i nomi delle variabili...
if (tipo == dumpType.SAMPLE)
{
nomeFileB = string.Format(@"{0}\SAMPLES\{1}_{2}_Byte_{3:yyyyMMdd_HHmmss}.dat", utils.dataDatDir, currIobConf.codIOB, tipoMem, adesso);
nomeFileW = string.Format(@"{0}\SAMPLES\{1}_{2}_W_{3:yyyyMMdd_HHmmss}.dat", utils.dataDatDir, currIobConf.codIOB, tipoMem, adesso);
nomeFileDW = string.Format(@"{0}\SAMPLES\{1}_{2}_DW_{3:yyyyMMdd_HHmmss}.dat", utils.dataDatDir, currIobConf.codIOB, tipoMem, adesso);
}
else
{
// salvo in file i dati letti come BYTE
nomeFileB = string.Format(@"{0}\{1}_{2}_Byte.dat", utils.dataDatDir, currIobConf.codIOB, tipoMem);
nomeFileW = string.Format(@"{0}\{1}_{2}_W.dat", utils.dataDatDir, currIobConf.codIOB, tipoMem);
nomeFileDW = string.Format(@"{0}\{1}_{2}_DW.dat", utils.dataDatDir, currIobConf.codIOB, tipoMem);
}
// salvo in file i dati letti come BYTE
mappaValori = new Dictionary<string, string>();
for (int i = 0; i < MemBlockCurr.Length; i++)
{
mappaValori.Add(i.ToString("0000"), MemBlockCurr[i].ToString());
}
utils.WritePlain(mappaValori, nomeFileB);
// salvo in file i dati letti come Word (2byte)
mappaValori = new Dictionary<string, string>();
for (int i = 0; i < MemBlockCurr.Length / 2; i++)
{
mappaValori.Add(i.ToString("0000"), BitConverter.ToUInt16(MemBlockCurr, i * 2).ToString());
}
utils.WritePlain(mappaValori, nomeFileW);
// salvo in file i dati letti come DWord (4byte)
mappaValori = new Dictionary<string, string>();
for (int i = 0; i < MemBlockCurr.Length / 4; i++)
{
mappaValori.Add(i.ToString("0000"), BitConverter.ToUInt32(MemBlockCurr, i * 4).ToString());
}
utils.WritePlain(mappaValori, nomeFileDW);
}
/// <summary>
/// Dump area D della memoria
Vendored
+1 -1
View File
@@ -14,7 +14,7 @@ pipeline {
/* calcolo numero versione... diverso x branch MASTER/DEVELOP */
script {
withEnv(['NEXT_BUILD_NUMBER=249']) {
withEnv(['NEXT_BUILD_NUMBER=251']) {
// 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'