Salvo LASCO + test SAET
This commit is contained in:
@@ -21,13 +21,13 @@ CMDIOB2CALL=/IOB/getIob2call?GWIP=
|
||||
;STARTLIST=WPS
|
||||
|
||||
;SAET TEMPRA
|
||||
;STARTLIST=VL20
|
||||
STARTLIST=VL20
|
||||
|
||||
;COMUR DENTA
|
||||
;STARTLIST=VL21
|
||||
|
||||
;LASCO
|
||||
STARTLIST=VL22
|
||||
;STARTLIST=VL22
|
||||
|
||||
;PRESSOIL CEI
|
||||
;STARTLIST=VL23
|
||||
|
||||
@@ -9,7 +9,7 @@ VENDOR=SAET
|
||||
MODEL=FornoTemprainduzione_105B08
|
||||
|
||||
[CNC]
|
||||
IP=192.168.214.20
|
||||
IP=192.168.213.20
|
||||
CPUTYPE=S71500
|
||||
RACK=0
|
||||
SLOT=0
|
||||
@@ -28,7 +28,8 @@ CMDREBO=/sendReboot.aspx?idxMacchina=
|
||||
ADDR_READ=DB1275.DBB0
|
||||
ADDR_WRITE=DB1275.DBB92
|
||||
SIZE_READ=92
|
||||
SIZE_WRITE=56
|
||||
; SIZE_WRITE=56
|
||||
SIZE_WRITE=2
|
||||
;BIT0=CONN
|
||||
;BIT1=DB60.DBB1
|
||||
;BIT2=PZCOUNT.STD.DB700.DBW22
|
||||
|
||||
+16
-16
@@ -64,22 +64,22 @@ PZCOUNT_MODE=STD.DB1001.DBDW2
|
||||
DISABLE_PZCOUNT=TRUE
|
||||
ENABLE_DYN_DATA=TRUE
|
||||
FORCE_DYN_DATA=TRUE
|
||||
TSVC_RamPosition=MAX:5
|
||||
TSVC_LowerEjectorPosition=MAX:5
|
||||
TSVC_UpperTool=MAX:5
|
||||
TSVC_TempMainMotorU=MAX:5
|
||||
TSVC_TempMainMotorV=MAX:5
|
||||
TSVC_TempMainMotorW=MAX:5
|
||||
TSVC_TempSpindleNut=MAX:5
|
||||
TSVC_TempMotoModule=MAX:5
|
||||
TSVC_TempOilCirculation=MAX:5
|
||||
TSVC_TempHydraulicUnit=MAX:5
|
||||
TSVC_PressHydraulicPump=MAX:5
|
||||
TSVC_PressHydraulicAccumulator=MAX:5
|
||||
TSVC_PressCounterforceOil=MAX:5
|
||||
TSVC_PressCounterforceGas=MAX:5
|
||||
TSVC_ForcePressureActual=MAX:5
|
||||
TSVC_ForceOnBushing=MAX:5
|
||||
TSVC_RamPosition=MAX:10
|
||||
TSVC_LowerEjectorPosition=MAX:10
|
||||
TSVC_UpperTool=MAX:10
|
||||
TSVC_TempMainMotorU=MAX:10
|
||||
TSVC_TempMainMotorV=MAX:10
|
||||
TSVC_TempMainMotorW=MAX:10
|
||||
TSVC_TempSpindleNut=MAX:10
|
||||
TSVC_TempMotoModule=MAX:10
|
||||
TSVC_TempOilCirculation=MAX:10
|
||||
TSVC_TempHydraulicUnit=MAX:10
|
||||
TSVC_PressHydraulicPump=MAX:10
|
||||
TSVC_PressHydraulicAccumulator=MAX:10
|
||||
TSVC_PressCounterforceOil=MAX:10
|
||||
TSVC_PressCounterforceGas=MAX:10
|
||||
TSVC_ForcePressureActual=MAX:10
|
||||
TSVC_ForceOnBushing=MAX:10
|
||||
|
||||
[BRANCH]
|
||||
NAME=master
|
||||
+61
-113
@@ -12,15 +12,14 @@ namespace IOB_WIN
|
||||
public class IobSiemensLasco : IobSiemens
|
||||
{
|
||||
/* --------------------------------------------------------------------------------
|
||||
* Controlli SIEMENS SAET (impianti ad induzione in VALVITAL)
|
||||
* Controlli SIEMENS LASCO (Pressa principale in VALVITAL)
|
||||
* - basasto su SIEMENS
|
||||
* - S7 vers 1500
|
||||
*
|
||||
* STRUTTURA MEMORIA DB1275: primi 92 byte lettura, poi 56 byte scrittura, vedere doc allegato
|
||||
* G:\Drive condivisi\30_Clienti\Valvital\Comunicazione PLC\SAET (forno e tempra)
|
||||
*
|
||||
* Si intende tutto con DB1275.DBxx
|
||||
* STRUTTURA MEMORIA DB1001 READ: 68 byte lettura, DB1002 68 byte byte scrittura, vedere doc allegato
|
||||
* G:\Drive condivisi\30_Clienti\Valvital\Comunicazione PLC\LASCO
|
||||
*
|
||||
* !!!RISCRIVERE!!!
|
||||
* - parametri processo
|
||||
* - DBD00: Watchdog INT SAET Alive ( 1-9999 )
|
||||
*
|
||||
@@ -223,9 +222,6 @@ namespace IOB_WIN
|
||||
{
|
||||
try
|
||||
{
|
||||
//string valore = currProdData[keyProd];
|
||||
//string valore = currProdData[keyProd].PadRight(20,' ');
|
||||
//string valore = currProdData[keyProd].PadLeft(20, ' ');
|
||||
byte[] stringPar = new byte[2];
|
||||
string valore = currProdData[keyProd];
|
||||
byte[] strByte = S7.Net.Types.String.ToByteArray(valore);
|
||||
@@ -237,25 +233,6 @@ namespace IOB_WIN
|
||||
Buffer.BlockCopy(stringPar, 0, MemBlock, startPos, 2);
|
||||
Buffer.BlockCopy(strByte, 0, MemBlock, startPos + 2, byteLen);
|
||||
var verifica = S7.Net.Types.String.FromByteArray(MemBlock);
|
||||
|
||||
//byte[] strByte = S7.Net.Types.String.ToByteArray(currProdData[keyProd]);
|
||||
//int byteLen = strByte.Length <= totLen ? strByte.Length : totLen;
|
||||
//// forzo primi 2 byte 40 / 232
|
||||
//byte[] startByte = new byte[2];
|
||||
//startByte[0] = 40;
|
||||
//startByte[1] = 232;
|
||||
//Buffer.BlockCopy(startByte, 0, MemBlock, 2, 2);
|
||||
//Buffer.BlockCopy(strByte, 0, MemBlock, 4, byteLen);
|
||||
|
||||
|
||||
//byte[] strByte = S7.Net.Types.DInt.ToByteArray(1234);
|
||||
//int byteLen = strByte.Length <= totLen ? strByte.Length : totLen;
|
||||
//// forzo primi 2 byte 40 / 232
|
||||
//byte[] startByte = new byte[2];
|
||||
//startByte[0] = 40;
|
||||
//startByte[1] = 232;
|
||||
//Buffer.BlockCopy(startByte, 0, MemBlock, 2, 2);
|
||||
//Buffer.BlockCopy(strByte, 0, MemBlock, 4, byteLen);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
@@ -276,42 +253,11 @@ namespace IOB_WIN
|
||||
#if true
|
||||
try
|
||||
{
|
||||
/* --------------------------------------------------------------------------------
|
||||
* Controlli SIEMENS SAET (impianti ad induzione in VALVITAL)
|
||||
*
|
||||
* STRUTTURA MEMORIA DB1275: primi 92 byte lettura, poi 56 byte scrittura, vedere doc allegato
|
||||
* G:\Drive condivisi\30_Clienti\Valvital\Comunicazione PLC\SAET (forno e tempra)
|
||||
*
|
||||
* PartCounter DINT 4.0 Conteggio Parziale di pezzi "OK" prodotti dalla macchina
|
||||
* NumberCode String [12] 8.0 Valore numerico associato alla ricetta di produzione attualmente utilizzata dalla macchina
|
||||
* NewCode INT 22.0 "1= Avvenuta ricezione del segnale ""richiesta nuovo ordine di produzione (NEW CODE)"" ricevuto dal server,impostabile su 1 solo quando la macchina NON è in produzione attiva"
|
||||
* Potenza utilizzata ST.1 REAL 24 Potenza utilizzata dalla stazione di riscaldo 1 [kW]
|
||||
* Potenza utilizzata ST.2 REAL 28 Potenza utilizzata dalla stazione di riscaldo 2 [kW]
|
||||
* Potenza utilizzata ST.3 REAL 32 Potenza utilizzata dalla stazione di riscaldo 3 [kW]
|
||||
* Potenza utilizzata ST.4 REAL 36 Potenza utilizzata dalla stazione di riscaldo 4 [kW]
|
||||
* Lettura Pirometro ST.1 REAL 40 Lettura Pirometro della stazione di riscaldo 1 [°C]
|
||||
* Lettura Pirometro ST.2 REAL 44 Lettura Pirometro della stazione di riscaldo 2 [°C]
|
||||
* Lettura Pirometro ST.3 REAL 48 Lettura Pirometro della stazione di riscaldo 3 [°C]
|
||||
* Lettura Pirometro ST.4 REAL 52 Lettura Pirometro della stazione di riscaldo 4 [°C]
|
||||
* Temperatura Acqua Raff Conv. ST.1 REAL 56 Temperarura Acqua di Raffreddamento Convertitore Stazione di Riscaldo 1 [°C]
|
||||
* Temperatura Acqua Raff Conv. ST.2 REAL 60 Temperarura Acqua di Raffreddamento Convertitore Stazione di Riscaldo 2 [°C]
|
||||
* Temperatura Acqua Raff Conv. ST.3 REAL 64 Temperarura Acqua di Raffreddamento Convertitore Stazione di Riscaldo 3 [°C]
|
||||
* Temperatura Acqua Raff Conv. ST.4 REAL 68 Temperarura Acqua di Raffreddamento Convertitore Stazione di Riscaldo 4 [°C]
|
||||
* Part_Status ST.1 INT 72 Stato Pezzo Stazione di Riscaldo 1 (0=Assente 1=Grezzo 10=OK 11=NOK)
|
||||
* Part_Status ST.2 INT 74 Stato Pezzo Stazione di Riscaldo 2 (0=Assente 1=Grezzo 10=OK 11=NOK)
|
||||
* Part_Status ST.3 INT 76 Stato Pezzo Stazione di Riscaldo 3 (0=Assente 1=Grezzo 10=OK 11=NOK)
|
||||
* Part_Status ST.4 INT 78 Stato Pezzo Stazione di Riscaldo 4 (0=Assente 1=Grezzo 10=OK 11=NOK)
|
||||
|
||||
* -------------------------------------------------------------------------------- */
|
||||
|
||||
/* ----------------------------------------------------------
|
||||
* DB60.DBD6: pressione camera filtrante (salvataggio del MAX ogni minuto) | var testVal = S7.Net.Types.Double.FromByteArray(memByteRead.Skip(0).Take(4).ToArray());
|
||||
* DB60.DBD10: pressione linea utenze (salvataggio del MAX ogni minuto)
|
||||
* DB60.DBD14: temperatura acqua pulita (salvataggio del MAX ogni minuto)
|
||||
* */
|
||||
int RamPosition = S7.Net.Types.Int.FromByteArray(RawInput.Skip(18).Take(2).ToArray());
|
||||
int LowerEjectorPosition = S7.Net.Types.Int.FromByteArray(RawInput.Skip(20).Take(2).ToArray());
|
||||
int UpperTool = S7.Net.Types.Int.FromByteArray(RawInput.Skip(22).Take(2).ToArray());
|
||||
// le 3 posizioni sono in 1/10 mm x cui vanno divise x 10... x avere MM
|
||||
double RamPosition = S7.Net.Types.Int.FromByteArray(RawInput.Skip(18).Take(2).ToArray())/10;
|
||||
double LowerEjectorPosition = S7.Net.Types.Int.FromByteArray(RawInput.Skip(20).Take(2).ToArray())/10;
|
||||
double UpperTool = S7.Net.Types.Int.FromByteArray(RawInput.Skip(22).Take(2).ToArray())/10;
|
||||
// temp in °C
|
||||
int TempMainMotorU = S7.Net.Types.Int.FromByteArray(RawInput.Skip(24).Take(2).ToArray());
|
||||
int TempMainMotorV = S7.Net.Types.Int.FromByteArray(RawInput.Skip(26).Take(2).ToArray());
|
||||
int TempMainMotorW = S7.Net.Types.Int.FromByteArray(RawInput.Skip(28).Take(2).ToArray());
|
||||
@@ -319,15 +265,15 @@ namespace IOB_WIN
|
||||
int TempMotoModule = S7.Net.Types.Int.FromByteArray(RawInput.Skip(32).Take(2).ToArray());
|
||||
int TempOilCirculation = S7.Net.Types.Int.FromByteArray(RawInput.Skip(34).Take(2).ToArray());
|
||||
int TempHydraulicUnit = S7.Net.Types.Int.FromByteArray(RawInput.Skip(36).Take(2).ToArray());
|
||||
// press in BAR
|
||||
int PressHydraulicPump = S7.Net.Types.Int.FromByteArray(RawInput.Skip(38).Take(2).ToArray());
|
||||
int PressHydraulicAccumulator = S7.Net.Types.Int.FromByteArray(RawInput.Skip(40).Take(2).ToArray());
|
||||
int PressCounterforceOil = S7.Net.Types.Int.FromByteArray(RawInput.Skip(42).Take(2).ToArray());
|
||||
int PressCounterforceGas = S7.Net.Types.Int.FromByteArray(RawInput.Skip(44).Take(2).ToArray());
|
||||
// forze in kN (10^3 Newton)
|
||||
int ForcePressureActual = S7.Net.Types.DInt.FromByteArray(RawInput.Skip(46).Take(4).ToArray());
|
||||
int ForceOnBushing = S7.Net.Types.Int.FromByteArray(RawInput.Skip(50).Take(2).ToArray());
|
||||
|
||||
// !!!FIXME: i dati di lasco sono da dividere per 10 (CREDO) perché sono int ma hanno virgola (1 pos) --> impostare un fattore x tutte le var TSVC (default a 1, gestito da classe TSVC?)
|
||||
|
||||
if (utils.CRB("enableTSVC"))
|
||||
{
|
||||
bool[] scaduti = new bool[16];
|
||||
@@ -368,43 +314,50 @@ namespace IOB_WIN
|
||||
PressCounterforceGas = getVal_TSVC_int("PressCounterforceGas", scaduti[13]);
|
||||
ForcePressureActual = getVal_TSVC_int("ForcePressureActual", scaduti[14]);
|
||||
ForceOnBushing = getVal_TSVC_int("ForceOnBushing", scaduti[15]);
|
||||
outVal.Add("DYNDATA", $"RamPosition {RamPosition:N2} | TempMainMotorV {TempMainMotorV:N2} | TempOilCirculation {TempOilCirculation:N2} | PressCounterforceGas {PressCounterforceGas}");
|
||||
outVal.Add("RamPosition", $"{RamPosition:N2}");
|
||||
outVal.Add("LowerEjectorPosition", $"{LowerEjectorPosition:N2}");
|
||||
outVal.Add("UpperTool", $"{UpperTool:N2}");
|
||||
outVal.Add("TempMainMotorU", $"{TempMainMotorU:N2}");
|
||||
outVal.Add("TempMainMotorV", $"{TempMainMotorV:N2}");
|
||||
outVal.Add("TempMainMotorW", $"{TempMainMotorW:N2}");
|
||||
outVal.Add("TempSpindleNut", $"{TempSpindleNut:N2}");
|
||||
outVal.Add("TempMotoModule", $"{TempMotoModule:N2}");
|
||||
outVal.Add("TempOilCirculation", $"{TempOilCirculation:N2}");
|
||||
outVal.Add("TempHydraulicUnit", $"{TempHydraulicUnit:N2}");
|
||||
outVal.Add("PressHydraulicPump", $"{PressHydraulicPump:N2}");
|
||||
outVal.Add("PressHydraulicAccumulator", $"{PressHydraulicAccumulator:N2}");
|
||||
outVal.Add("PressCounterforceOil", $"{PressCounterforceOil:N2}");
|
||||
outVal.Add("PressCounterforceGas", $"{PressCounterforceGas:N2}");
|
||||
//outVal.Add("DYNDATA", $"RamPosition {RamPosition:N2} | TempMainMotorV {TempMainMotorV:N2} | TempOilCirculation {TempOilCirculation:N2} | PressCounterforceGas {PressCounterforceGas}");
|
||||
outVal.Add("RamPosition", $"{RamPosition:N1}");
|
||||
outVal.Add("LowerEjectorPosition", $"{LowerEjectorPosition:N1}");
|
||||
outVal.Add("UpperTool", $"{UpperTool:N1}");
|
||||
outVal.Add("TempMainMotorU", $"{TempMainMotorU}");
|
||||
outVal.Add("TempMainMotorV", $"{TempMainMotorV}");
|
||||
outVal.Add("TempMainMotorW", $"{TempMainMotorW}");
|
||||
outVal.Add("TempSpindleNut", $"{TempSpindleNut}");
|
||||
outVal.Add("TempMotoModule", $"{TempMotoModule}");
|
||||
outVal.Add("TempOilCirculation", $"{TempOilCirculation}");
|
||||
outVal.Add("TempHydraulicUnit", $"{TempHydraulicUnit}");
|
||||
outVal.Add("PressHydraulicPump", $"{PressHydraulicPump}");
|
||||
outVal.Add("PressHydraulicAccumulator", $"{PressHydraulicAccumulator}");
|
||||
outVal.Add("PressCounterforceOil", $"{PressCounterforceOil}");
|
||||
outVal.Add("PressCounterforceGas", $"{PressCounterforceGas}");
|
||||
outVal.Add("ForcePressureActual", $"{ForcePressureActual}");
|
||||
outVal.Add("ForceOnBushing", $"{ForceOnBushing}");
|
||||
|
||||
|
||||
//!!!FIXME!!! controllare che NON MI PARE sia ok...
|
||||
|
||||
// salvo!
|
||||
LastTSVC["pressCamFilt"] = RamPosition;
|
||||
LastTSVC["pressLinUt"] = TempMainMotorV;
|
||||
LastTSVC["tempH2O"] = TempOilCirculation;
|
||||
LastTSVC["RamPosition"] = RamPosition;
|
||||
LastTSVC["LowerEjectorPosition"] = LowerEjectorPosition;
|
||||
LastTSVC["UpperTool"] = UpperTool;
|
||||
LastTSVC["TempMainMotorU"] = TempMainMotorU;
|
||||
LastTSVC["TempMainMotorV"] = TempMainMotorV;
|
||||
LastTSVC["TempMainMotorW"] = TempMainMotorW;
|
||||
LastTSVC["TempSpindleNut"] = TempSpindleNut;
|
||||
LastTSVC["TempMotoModule"] = TempMotoModule;
|
||||
LastTSVC["TempOilCirculation"] = TempOilCirculation;
|
||||
LastTSVC["TempHydraulicUnit"] = TempHydraulicUnit;
|
||||
LastTSVC["PressHydraulicPump"] = PressHydraulicPump;
|
||||
LastTSVC["PressHydraulicAccumulator"] = PressHydraulicAccumulator;
|
||||
LastTSVC["PressCounterforceOil"] = PressCounterforceOil;
|
||||
LastTSVC["PressCounterforceGas"] = PressCounterforceGas;
|
||||
LastTSVC["ForcePressureActual"] = ForcePressureActual;
|
||||
LastTSVC["ForceOnBushing"] = ForceOnBushing;
|
||||
}
|
||||
else
|
||||
{
|
||||
outVal.Add("DYNDATA", $"pressCamFilt {LastTSVC["pressCamFilt"]:N6} | pressLinUt {LastTSVC["pressLinUt"]:N6} | tempH2O {LastTSVC["tempH2O"]:N3}");
|
||||
outVal.Add("DYNDATA", $"RamPosition {LastTSVC["RamPosition"]:N1} | ForcePressureActual {LastTSVC["ForcePressureActual"]} | ForceOnBushing {LastTSVC["ForceOnBushing"]}");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
outVal.Add("pressCamFilt", $"{RamPosition:N6}");
|
||||
outVal.Add("pressLinUt", $"{TempMainMotorV:N6}");
|
||||
outVal.Add("tempH2O", $"{TempOilCirculation:N3}");
|
||||
outVal.Add("DYNDATA", $"pressCamFilt {RamPosition:N3} | pressLinUt {TempMainMotorV:N3} | tempH2O {TempOilCirculation:N3}");
|
||||
outVal.Add("DYNDATA", $"RamPosition {LastTSVC["RamPosition"]:N1} | ForcePressureActual {LastTSVC["ForcePressureActual"]} | ForceOnBushing {LastTSVC["ForceOnBushing"]}");
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
@@ -434,11 +387,12 @@ namespace IOB_WIN
|
||||
*
|
||||
*
|
||||
* - BIT di stato
|
||||
* - DBX2.0: macchina accesa
|
||||
* - DBX2.1: CICLO AUTO = NON HO ANOMALIE/ALLARMI (0 --> allarme)
|
||||
* - DBX2.2: contapezzi
|
||||
* - DBX2.3: MACCHINA IN CICLO AUTO = LAVORA
|
||||
* - DBX2.4: ERRORE tra part code MES/SAET (blu)
|
||||
* - DBX0.0: RUN STATE
|
||||
* - DBX0.1: CYCLE
|
||||
* - DBX0.2: MANUAL MODE
|
||||
* - DBX0.3: GENERAL ALARM
|
||||
* - DBX0.4: ESTOP (1=OK, 0 = emergency)
|
||||
* - DBX0.5: SAFETY DOORS
|
||||
----------------------------------------------------- */
|
||||
|
||||
byte mainData = RawInput[2];
|
||||
@@ -449,37 +403,31 @@ namespace IOB_WIN
|
||||
{
|
||||
byteSignals += (1 << 0);
|
||||
}
|
||||
if ((mainData & (1 << 3)) == 1)
|
||||
if ((mainData & (1 << 0)) == 1)
|
||||
{
|
||||
byteSignals += (1 << 1);
|
||||
}
|
||||
|
||||
// controllo il bit MAIN dello status
|
||||
if ((mainData & (1 << 1)) == 1)
|
||||
// EMERGENZA
|
||||
if ((mainData & (1 << 5)) == 1)
|
||||
{
|
||||
byteSignals += (1 << 5);
|
||||
}
|
||||
// ALLARME
|
||||
if ((mainData & (1 << 3)) == 1)
|
||||
{
|
||||
byteSignals += (1 << 3);
|
||||
}
|
||||
|
||||
// considero come MANUALE l'errore part code...
|
||||
if ((mainData & (1 << 4)) == 0)
|
||||
// MANUALE ...
|
||||
if ((mainData & (1 << 2)) == 1)
|
||||
{
|
||||
byteSignals += (1 << 4);
|
||||
}
|
||||
|
||||
// salvo!
|
||||
B_input = byteSignals;
|
||||
|
||||
#if false
|
||||
// processo il watchdog!
|
||||
counterPlc2Mes = S7.Net.Types.Int.FromByteArray(RawInput.Skip(0).Take(2).ToArray());
|
||||
// ogni 60 registro...
|
||||
if (Math.Abs(counterPlc2Mes - counterPlc2MesWrote) > 60)
|
||||
{
|
||||
lgInfo($"WatchDog da PLC: {counterPlc2Mes}");
|
||||
counterPlc2MesWrote = counterPlc2Mes;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
// log opzionale!
|
||||
if (verboseLog)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user