contapezzi davvero parametrico
This commit is contained in:
@@ -59,8 +59,8 @@ BLINK_FILT=0
|
||||
;BLINK_FILT=28
|
||||
|
||||
[OPTPAR]
|
||||
;PZCOUNT_MODE=STD|BIT
|
||||
PZCOUNT_MODE=BIT
|
||||
;PZCOUNT_MODE=STD|BIT.indice
|
||||
PZCOUNT_MODE=BIT.X7.1
|
||||
PZ_CAD_MADDR=1602
|
||||
PZ_REQ_MADDR=1603
|
||||
PZ_DONE_MADDR=1604
|
||||
|
||||
@@ -59,8 +59,8 @@ BLINK_FILT=0
|
||||
;BLINK_FILT=28
|
||||
|
||||
[OPTPAR]
|
||||
;PZCOUNT_MODE=STD|BIT
|
||||
PZCOUNT_MODE=BIT
|
||||
;PZCOUNT_MODE=STD|BIT.indice
|
||||
PZCOUNT_MODE=BIT.X7.1
|
||||
PZ_CAD_MADDR=1602
|
||||
PZ_REQ_MADDR=1603
|
||||
PZ_DONE_MADDR=1604
|
||||
|
||||
@@ -60,7 +60,7 @@ BLINK_FILT=8
|
||||
|
||||
[OPTPAR]
|
||||
;PZCOUNT_MODE=STD|BIT
|
||||
PZCOUNT_MODE=STD
|
||||
PZCOUNT_MODE=STD.PAR.6711
|
||||
PZ_CAD_MADDR=1602
|
||||
PZ_REQ_MADDR=1603
|
||||
PZ_DONE_MADDR=1604
|
||||
|
||||
@@ -60,7 +60,7 @@ BLINK_FILT=8
|
||||
|
||||
[OPTPAR]
|
||||
;PZCOUNT_MODE=STD|BIT
|
||||
PZCOUNT_MODE=STD
|
||||
PZCOUNT_MODE=STD.PAR.6711
|
||||
PZ_CAD_MADDR=1602
|
||||
PZ_REQ_MADDR=1603
|
||||
PZ_DONE_MADDR=1604
|
||||
|
||||
+21
-5
@@ -227,7 +227,7 @@ 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"] == "STD")
|
||||
if (currIobConf.optPar["PZCOUNT_MODE"].StartsWith("STD"))
|
||||
{
|
||||
// legge da IO server ULTIMO valore CONTPEZZI al riavvio...
|
||||
lgInfo("Lettura contapezzi dall'url {0}", urlGetPzCount);
|
||||
@@ -471,8 +471,6 @@ namespace IOB_WIN
|
||||
// controllo se è passato intervallo minimo tra 2 controlli/elaborazioni x distanziare invio e ridurre letture
|
||||
if (DateTime.Now >= lastPzCountSend.AddMilliseconds(pzCountDelay))
|
||||
{
|
||||
// resetto timer...
|
||||
lastPzCountSend = DateTime.Now;
|
||||
// verifico se variato contapezzi in area STD PAR6711... e se passato ritardo minimo...
|
||||
if (lastCountCNC > contapezzi)
|
||||
{
|
||||
@@ -489,6 +487,8 @@ namespace IOB_WIN
|
||||
}
|
||||
// invio a server contapezzi (aggiornato)
|
||||
utils.callUrl(urlSetPzCount + contapezzi.ToString());
|
||||
// resetto timer...
|
||||
lastPzCountSend = DateTime.Now;
|
||||
}
|
||||
}
|
||||
else // area "normale" byte.bit
|
||||
@@ -545,7 +545,20 @@ namespace IOB_WIN
|
||||
B_input += 1 << i;
|
||||
}
|
||||
}
|
||||
|
||||
// verifico se si tratta di un segnale contapezzo... nel qual caso conteggio ed invio...
|
||||
if(currIobConf.optPar["PZCOUNT_MODE"].StartsWith("BIT"))
|
||||
{
|
||||
// salvo nuovo contapezzi (incremento di 1...)
|
||||
contapezzi++;
|
||||
// invio a server contapezzi (aggiornato)
|
||||
utils.callUrl(urlSetPzCount + contapezzi.ToString());
|
||||
lgInfo("Aggiornato contapezzi: {0}", contapezzi);
|
||||
// resetto timer...
|
||||
lastPzCountSend = DateTime.Now;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
// log opzionale!
|
||||
@@ -626,12 +639,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"] == "STD")
|
||||
if (currIobConf.optPar["PZCOUNT_MODE"].StartsWith("STD"))
|
||||
{
|
||||
object output = new object();
|
||||
// recupero parametro...
|
||||
int cntAddr = 6711;
|
||||
int.TryParse(currIobConf.optPar["PZCOUNT_MODE"].Replace("STD.PAR.", ""), out cntAddr);
|
||||
// processo parametro contapezzi (lavorati)
|
||||
stopwatch.Restart();
|
||||
FANUC_ref.F_RW_Param_Integer(false, 6711, 3, ref output);
|
||||
FANUC_ref.F_RW_Param_Integer(false, cntAddr, 3, ref output);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(currIobConf.codIOB, string.Format("R{0}-PAR", 4), stopwatch.ElapsedTicks);
|
||||
// salvo ultimo conteggio rilevato
|
||||
Int32.TryParse(output.ToString(), out lastCountCNC);
|
||||
|
||||
@@ -581,7 +581,7 @@ 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"] == "STD")
|
||||
if (currIobConf.optPar["PZCOUNT_MODE"].StartsWith("STD"))
|
||||
{
|
||||
object output = new object();
|
||||
// deve usare F_RW_Param_Integer
|
||||
@@ -600,7 +600,7 @@ namespace IOB_WIN
|
||||
// output!
|
||||
|
||||
}
|
||||
else if (currIobConf.optPar["PZCOUNT_MODE"] == "BIT")
|
||||
else if (currIobConf.optPar["PZCOUNT_MODE"].startsWith("BIT"))
|
||||
{
|
||||
// posizioni DWord
|
||||
//1602:543809: NUM PEZZI x ciclo (6408..6411)
|
||||
|
||||
Reference in New Issue
Block a user