Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
Samuele E. Locatelli
2018-08-01 09:12:48 +02:00
8 changed files with 202 additions and 14 deletions
+62
View File
@@ -0,0 +1,62 @@
;Configurazione IOB-WIN
[IOB]
CNCTYPE=SIEMENS_TORRI
[MACHINE]
VENDOR=TORRI
MODEL=GHIRINGHELLI M200
[CNC]
; Siemens Torri (GHIRINGHELLI M200)
IP=192.168.0.55
CPUTYPE=S7300
RACK=0
SLOT=2
[SERVER]
MPIP=http://192.168.1.7
MPURL=/MP/IO
CMDBASE=/IOB/input/
CMDFLOG=/IOB/flog/
CMDALIVE=/IOB
CMDENABLED=/IOB/enabled/
CMDADV1=?valore=
CMDREBO=/sendReboot.aspx?idxMacchina=
[MEMORY]
ADDR_READ=DB700.DBB0
ADDR_WRITE=DB701.DBB0
SIZE_READ=52
SIZE_WRITE=138
;BIT0=CONN
BIT1=DB700.DBB1
;BIT2=PZCOUNT.STD.DB700.DBW22
BIT3=DB700.DBB3
BIT4=DB700.DBB4
[BLINK]
;MAX_COUNTER_BLINK = 30
MAX_COUNTER_BLINK = 15
;bit0 = 0
;bit1 = 0
;bit2 = 1
;bit3 = 1
;bit4 = 1
;bit5 = 0
;bit6 = 0
;bit7 = 0
BLINK_FILT=0
;BLINK_FILT=28
[OPTPAR]
;PZCOUNT_MODE=STD.[PAR/MEM].info|BIT.indice
; attenzione memoria sempre base BYTE (1604 DW --> 6416...)
PZCOUNT_MODE=STD.DB700.DBW22
;PZ_CAD_MADDR=1602
;PZ_REQ_MADDR=1603
;PZ_DONE_MADDR=1604
;PZ_GTOT_MADDR=1605
[BRANCH]
NAME=develop
+1 -1
View File
@@ -11,6 +11,6 @@ CMDREBO=/IOB/sendRebootGateway?GWIP=
CMDIOB2CALL=/IOB/getIob2call?GWIP=
[IOB]
STARTLIST=3011
STARTLIST=3013
MAXCNC=4
;STARTLIST=3001,3002,3003,3004,3005
+9
View File
@@ -23,6 +23,15 @@
018|AUTO_POWER_OFF |BYTE
019|OVR_FEED |BYTE
020|OVR_SPEED |BYTE
# CURR MODE diviso in BIT:
# B0 (01) = AUTO
# B1 (02) = MDI
# B2 (04) = JOG
# B3 (08) = TeachIN (associato a MDI --> 10)
# B4 (16) = Repos (associato a JOG --> 20)
# B5 (32) = RefPoint (associato a Jog --> 36)
# B6 (64) = Incr1 (associato a Jog --> 68)
# B7 (128) = Incr10 (associato a Jog --> -124 / 132 se UInt)
021|CURR_MODE |BYTE
# valori word come UINT 16bit/Word 32bit/DWord
022|COUNT_TOT |WORD
+3
View File
@@ -188,6 +188,9 @@
<None Include="DATA\CONF\3001.ini">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\3013.ini">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\3011.ini">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
+20 -4
View File
@@ -121,6 +121,7 @@ namespace IOB_WIN
// gestione invio ritardato contapezzi
pzCountDelay = utils.CRI("pzCountDelay");
lastPzCountSend = DateTime.Now;
lastWarnODL = DateTime.Now;
// inizializzo correttamente aree memoria secondo CONF - iniFileName
IniFile fIni = new IniFile(IOBConf.iniFileName);
@@ -443,7 +444,19 @@ namespace IOB_WIN
// se l'area è PZCOUNT... processo PUNTUALMENTE il CONTAPEZZI...
if (bVal.StartsWith("PZCOUNT"))
{
string currODL = utils.callUrl(urlGetCurrODL);
string currODL = "";
try
{
currODL = utils.callUrl(urlGetCurrODL);
}
catch (Exception exc)
{
if (DateTime.Now.Subtract(lastWarnODL).TotalSeconds > 15)
{
lgError(exc, "Errore in fase di chiamata URL x ODL corrente | URL chiamato: {0}", urlGetCurrODL);
lastWarnODL = DateTime.Now;
}
}
if (currODL != null && currODL != "")
{
// controllo se è passato intervallo minimo tra 2 controlli/elaborazioni x distanziare invio e ridurre letture
@@ -481,9 +494,12 @@ namespace IOB_WIN
}
else
{
lgInfo(string.Format("Attenzione: mancanza ODL non procedo con gestione contapezzi. Contapezzi FANUC: {0} | Contapezzi interno {1}", lastCountCNC, contapezzi));
// resetto timer...
lastPzCountSend = DateTime.Now;
if (DateTime.Now >= lastPzCountSend.AddMilliseconds(pzCountDelay))
{
lgInfo(string.Format("Attenzione: mancanza ODL non procedo con gestione contapezzi. Contapezzi FANUC: {0} | Contapezzi interno {1}", lastCountCNC, contapezzi));
// resetto timer...
lastPzCountSend = DateTime.Now;
}
}
}
else // area "normale" byte.bit
+4
View File
@@ -31,6 +31,10 @@ namespace IOB_WIN
/// </summary>
protected DateTime lastPzCountSend;
/// <summary>
/// Ultima registrazione warning x ODL mancante (x scrivere solo ogni 15 secondi)
/// </summary>
protected DateTime lastWarnODL;
/// <summary>
/// Ritardo minimo x invio contapezzi
/// </summary>
protected int pzCountDelay;
+102 -8
View File
@@ -85,7 +85,7 @@ namespace IOB_WIN
}
string titolo = string.Format("READ BLOCK MEM BYTE: {0} --> {1} byte", parametri.memAddrRead, numByte);
if (verboseLog) lgInfo(titolo);
string contenuto = "";
string contenuto = string.Format("Contenuto area memoria aquisita{0}", Environment.NewLine);
string byteVal = "";
for (int i = 0; i < memByteRead.Length; i++)
{
@@ -162,6 +162,7 @@ namespace IOB_WIN
// gestione invio ritardato contapezzi
pzCountDelay = utils.CRI("pzCountDelay");
lastPzCountSend = DateTime.Now;
lastWarnODL = DateTime.Now;
// init conf
_IOBConf = IOBConf;
// inizializzo parametri...
@@ -512,9 +513,16 @@ namespace IOB_WIN
public override Dictionary<string, string> getOverrides()
{
Dictionary<string, string> outVal = new Dictionary<string, string>();
uint valDW = 0;
// !!!FARE!!! recuperare da conf memoria, ora HARD CODED
outVal.Add("FEED_OVER", RawInput[19].ToString());
outVal.Add("RAPID_OVER", RawInput[20].ToString());
outVal.Add("CURR_MODE", decodeCurrMode(RawInput[21]));
// recupero RPM pezzo/mola !!!FARE!!! cambio nome da config, qui sono 01:conduttrice e 02:operatrice (3013), mentre sono pezzo/mola nella V100
valDW = S7.Net.Types.DWord.FromByteArray(RawInput.Skip(24).Take(4).ToArray());
outVal.Add("RPM_01", valDW.ToString());
valDW = S7.Net.Types.DWord.FromByteArray(RawInput.Skip(28).Take(4).ToArray());
outVal.Add("RPM_02", valDW.ToString());
return outVal;
}
@@ -530,14 +538,85 @@ namespace IOB_WIN
byte[] MemBlock = new byte[parametri.memSizeRead];
bool fatto = S7ReadBB(ref MemBlock);
Buffer.BlockCopy(MemBlock, 0, RawInput, 0, parametri.memSizeRead);
if (verboseLog) lgInfo(string.Format("RawInput: {0}", utils.binaryForm((int)RawInput[0])));
if (verboseLog) lgInfo(string.Format("RawInput[0]: {0}", utils.binaryForm((int)RawInput[0])));
// salvo il solo BYTE dell'input decifrando il semaforo...
decodeToBitmap();
decodeToBaseBitmap();
decodeOtherData();
}
/// <summary>
/// decodifica da bitmap il CURRENT MODE del controllo
/// </summary>
/// <param name="currModeBitmap"></param>
/// <returns></returns>
protected string decodeCurrMode(byte currModeBitmap)
{
string answ = "";
if (verboseLog) lgInfo(string.Format("CURR_MODE raw data: {0}", utils.binaryForm((int)currModeBitmap)));
// decodifica del MODO... B21
/*
* CURR MODE diviso in BIT:
* B0 (01) = AUTO
* B1 (02) = MDI
* B2 (04) = JOG
* B3 (08) = TeachIN (associato a MDI --> 10)
* B4 (16) = Repos (associato a JOG --> 20)
* B5 (32) = RefPoint (associato a Jog --> 36)
* B6 (64) = Incr1 (associato a Jog --> 68)
* B7 (128) = Incr10 (associato a Jog --> -124 / 132 se UInt)
* */
// modi principali
if (currModeBitmap.SelectBit(0))
{
answ = "AUTO";
}
else if (currModeBitmap.SelectBit(1))
{
answ = "MDI";
}
else if (currModeBitmap.SelectBit(2))
{
answ = "JOG";
}
// modi accessori
if (currModeBitmap.SelectBit(3))
{
answ += " | TEACH-IN";
}
if (currModeBitmap.SelectBit(4))
{
answ += " | REPOS";
}
if (currModeBitmap.SelectBit(5))
{
answ += " | REF-POINT";
}
if (currModeBitmap.SelectBit(6))
{
answ += " | INCR-1";
}
if (currModeBitmap.SelectBit(7))
{
answ += " | INCR-10";
}
return answ;
}
/// <summary>
/// Decodifica il resto dell'area TORRI x i dati accessori (allarmi, ...)
/// </summary>
private void decodeOtherData()
{
if (verboseLog)
{
}
}
/// <summary>
/// Effettua decodifica aree memoria alla bitmap usata x MAPO
/// </summary>
private void decodeToBitmap()
private void decodeToBaseBitmap()
{
// init a zero...
B_input = 0;
@@ -552,7 +631,19 @@ namespace IOB_WIN
B_input = byteSem;
string currODL = utils.callUrl(urlGetCurrODL);
string currODL = "";
try
{
currODL = utils.callUrl(urlGetCurrODL);
}
catch (Exception exc)
{
if (DateTime.Now.Subtract(lastWarnODL).TotalSeconds > 15)
{
lgError(exc, "Errore in fase di chiamata URL x ODL corrente | URL chiamato: {0}", urlGetCurrODL);
lastWarnODL = DateTime.Now;
}
}
if (currODL != null && currODL != "")
{
// ora processo il contapezzi...
@@ -591,9 +682,12 @@ namespace IOB_WIN
}
else
{
lgInfo(string.Format("Attenzione: mancanza ODL non procedo con gestione contapezzi. Contapezzi SIEMENST-TORRI: {0} | Contapezzi interno {1}", lastCountCNC, contapezzi));
// resetto timer...
lastPzCountSend = DateTime.Now;
if (DateTime.Now >= lastPzCountSend.AddMilliseconds(pzCountDelay))
{
lgInfo(string.Format("Attenzione: mancanza ODL non procedo con gestione contapezzi. Contapezzi SIEMENST-TORRI: {0} | Contapezzi interno {1}", lastCountCNC, contapezzi));
// resetto timer...
lastPzCountSend = DateTime.Now;
}
}
#if false
Vendored
+1 -1
View File
@@ -14,7 +14,7 @@ pipeline {
/* calcolo numero versione... diverso x branch MASTER/DEVELOP */
script {
withEnv(['NEXT_BUILD_NUMBER=275']) {
withEnv(['NEXT_BUILD_NUMBER=284']) {
// 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'