Aggiunta siemens aprochim x test Jetco

This commit is contained in:
Samuele E. Locatelli
2019-04-24 14:28:13 +02:00
parent cd6889f647
commit 62f2f4e4db
4 changed files with 101 additions and 78 deletions
+63
View File
@@ -0,0 +1,63 @@
;Configurazione IOB-WIN
[IOB]
;Macchina filtraggio fanghi Aprochim x Jetco
CNCTYPE=SIEMENS_APROCHIM
PING_MS_TIMEOUT=500
[MACHINE]
VENDOR=Aprochim
MODEL=Micro4000
[CNC]
IP=192.168.0.60
CPUTYPE=S71500
RACK=0
SLOT=0
[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=DB550.DBB0
ADDR_WRITE=DB701.DBB0
SIZE_READ=1
SIZE_WRITE=0
;BIT0=CONN
BIT1=DB550.DBB1
;BIT2=PZCOUNT.STD.DB700.DBW22
BIT3=DB550.DBB3
BIT4=DB550.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.DB550.DBDW0
;PZ_CAD_MADDR=1602
;PZ_REQ_MADDR=1603
;PZ_DONE_MADDR=1604
;PZ_GTOT_MADDR=1605
[BRANCH]
NAME=develop
+3
View File
@@ -204,6 +204,9 @@
<None Include="DATA\CONF\3015.ini">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\3017.ini">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\SIMUL_08.ini">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
+5 -7
View File
@@ -41,7 +41,6 @@ namespace IOB_WIN
lgInfo("NEW IOB SIEMENS versione APROCHIM");
}
#if false
#region area principale adapter
/// <summary>
@@ -98,7 +97,7 @@ namespace IOB_WIN
#endregion
#region Metodi specifici (da verificare/completare in implementazione)
/// <summary>
@@ -116,9 +115,9 @@ namespace IOB_WIN
{
Dictionary<string, string> outVal = new Dictionary<string, string>();
ushort valStatus = S7.Net.Types.Word.FromByteArray(RawInput.Skip(0).Take(2).ToArray());
ushort valPosit = S7.Net.Types.Word.FromByteArray(RawInput.Skip(2).Take(2).ToArray());
//ushort valPosit = S7.Net.Types.Word.FromByteArray(RawInput.Skip(2).Take(2).ToArray());
outVal.Add("CURR_STATO", ((statoMacchina)valStatus).ToString());
outVal.Add("CURR_POSIT", ((posizioneSequenza)valPosit).ToString());
//outVal.Add("CURR_POSIT", ((posizioneSequenza)valPosit).ToString());
return outVal;
}
@@ -131,9 +130,9 @@ namespace IOB_WIN
B_input = 0;
// FAPE: leggo i primi 2 WORD x decodifica stato e posizione...
ushort valStatus = S7.Net.Types.Word.FromByteArray(RawInput.Skip(0).Take(2).ToArray());
ushort valPosit = S7.Net.Types.Word.FromByteArray(RawInput.Skip(2).Take(2).ToArray());
//ushort valPosit = S7.Net.Types.Word.FromByteArray(RawInput.Skip(2).Take(2).ToArray());
statoMacchina _stMacch = ((statoMacchina)valStatus);
posizioneSequenza _posSeq = ((posizioneSequenza)valPosit);
//posizioneSequenza _posSeq = ((posizioneSequenza)valPosit);
/* -----------------------------------------------------
* bitmap MAPO
@@ -267,6 +266,5 @@ namespace IOB_WIN
}
#endregion
#endif
}
}
+30 -71
View File
@@ -11,26 +11,21 @@ namespace IOB_WIN
public class IobWPS : IobGeneric
{
/* --------------------------------------------------------------------------------
* Controlli SIEMENS Aprochim (impianti filtrazione in Jetco, gruppo macDermid)
* - basasto su SIEMENS
* - S7 vers 1500
* Controlli dotati di GENERICA pagina WEB in cui cercare e recuperare informazioni
*
*
*
* - abilitata 1 area in lettura DB15 ed 1 in scrittura DB16 (NON la usano)
* - x poter funzionare --> protezione: meccanismi di collegamento / consenti put/get
* - lettura/scrittura primi 48 byte (240 max x le due DB)
*
* LETTURA seguenti byte:
* - B0, WORD, Stato Macchina Generale
* - B2, WORD, Posizione sequenza contatore
* - B4, WORD, contatore cicli eseguiti per lubrifica
* - B40, DWORD, contapezzi azzerabile da operatore
* - B44, DWORD, contapezzi ASSOLUTO
* - il file di conf deve contenere l'URL di base
* - il file di conf deve contenere COSA cercare (es il "contenitore" del dato da estrarre)
*
* -------------------------------------------------------------------------------- */
/// <summary>
/// Pagina web da scaricare
/// </summary>
protected string baseUri = "192.168.1.55";
/// <summary>
/// Array di configurazione degli oggetti da cercare x decodifica e recupero info
/// </summary>
protected Dictionary<string, string> dataLocatorLUT;
/// <summary>
/// Estende l'init della classe base...
@@ -47,13 +42,30 @@ namespace IOB_WIN
// init connessione
setConnection();
// test completo funzionalità kawasaki, da TOGLIERE in prod...
// test completo funzionalità, da TOGLIERE in prod...
#if DEBUG
kawasakiFullTest();
wpsFullTest();
#endif
#endif
}
/// <summary>
/// Test funzioni WebPageScraping
/// </summary>
private void wpsFullTest()
{
// faccio un try-catch di test vari...
try
{
// faccio download preliminare pagina
// salvo la pagina completa
}
catch (Exception exc)
{
lgError(exc, "Eccezioen durante wpsFullTest");
}
}
#if false
/// <summary>
@@ -134,60 +146,7 @@ namespace IOB_WIN
/// </summary>
protected string lastMissRobot;
/// <summary>
/// Test completo funzioni kawasaki
/// </summary>
private void kawasakiFullTest()
{
// faccio un try-catch di test vari...
try
{
//string connPar = string.Format("TCP {0}", cIobConf.cncIpAddr);
//KAWASAKI_ref = new KRcc.Commu(connPar);
//KAWASAKI_ref = new KRcc.Commu("TCP 192.168.0.92");
if (KAWASAKI_ref.IsConnected)
{
// connect ok
resDataArray = KAWASAKI_ref.command("where", 3000);
// WHERE [RET]
// Console.WriteLine(resDataArray[1]);
// [0] = 0
// [1] = JT1 JT2 JT3 JT4 JT5 JT6
// -23.205 - 39.967 - 13.176 95.663 71.402 - 21.512
// X[mm] Y[mm] Z[mm] O[deg] A[deg] T[deg]
// - 489.620 693.940 1564.733 92.612 131.285 7.482
threadOk = commThreadOk;
macName = machineName;
cStatus = currBitmapStatus;
cSignals = currBitmapSignals;
lastCountCNC = pzCounter;
numPzPrel = pzPrelevati;
lastRecTC = lastTC;
lastMissRobot = lastMission;
}
// test contapezzi
#if false
// leggo i pezzi
int currCount = pzCounter;
// imposto a 100
pzCounter = 100;
// rileggo x verifica
int newCount = pzCounter;
// reimposto corretti
pzCounter = currCount;
#endif
// test gest programmi
#if true
//saveProgram("prog", "default");
sendProgram("prog", "default2");
#endif
}
catch (Exception e)
{ // e.Message = "can't connect TCP/IP" or // "can't login"
Console.WriteLine(e.Message);
}
}
/// <summary>
/// Imposto connessione