fix gestione lettura dati UT (PLC NON ancora configurato)
This commit is contained in:
@@ -915,27 +915,27 @@ Namespace CNC
|
||||
''' </summary>
|
||||
Public Structure UtData
|
||||
''' <summary>
|
||||
''' Vettore elenco UT (DB254.DBI280)
|
||||
''' Vettore elenco UT (DB254.DBW280)
|
||||
''' </summary>
|
||||
Public elencoUtMem As UShort()
|
||||
''' <summary>
|
||||
''' Tabella UT (DB253.DBI2500)
|
||||
''' Tabella UT (DB253.DBW2500)
|
||||
''' </summary>
|
||||
Public tabUt_UT As UShort()
|
||||
''' <summary>
|
||||
''' Tabella IdFamigliaUt (DB253.DBI2900)
|
||||
''' Tabella IdFamigliaUt (DB253.DBW2900)
|
||||
''' </summary>
|
||||
Public tabIdFamUt As UShort()
|
||||
''' <summary>
|
||||
''' Tabella Famiglie Utensili (DB253.DBI100)
|
||||
''' Tabella Famiglie Utensili (DB253.DBW100)
|
||||
''' </summary>
|
||||
Public tabFamUt As UShort()
|
||||
''' <summary>
|
||||
''' Tabella TIPO Vita Residua Famiglie Utensili (DB253.DBI1900)
|
||||
''' Tabella TIPO Vita Residua Famiglie Utensili (DB253.DBW1900)
|
||||
''' </summary>
|
||||
Public tabTipoVitaRes As UShort()
|
||||
''' <summary>
|
||||
''' Tabella Vita Residua Famiglie Utensili (DB253.DBI4300)
|
||||
''' Tabella Vita Residua Famiglie Utensili (DB253.DBW4300)
|
||||
''' </summary>
|
||||
Public tabVitaRes As UShort()
|
||||
|
||||
@@ -988,19 +988,17 @@ Namespace CNC
|
||||
''' </summary>
|
||||
''' <param name="numVal"></param>
|
||||
''' <returns></returns>
|
||||
Public Function getAllUtData(ByVal numVal As Short) As UtData
|
||||
Public Function getAllUtData(ByVal numVal As Short, ByVal numUt As Short) As UtData
|
||||
' RIFERIMENTO:
|
||||
' txt Giuseppe
|
||||
' vettori vb sono di dim n-1...
|
||||
numVal -= 1
|
||||
|
||||
ReDim itemRead(5)
|
||||
itemRead(0) = New Item("DB254.DBI280:[" & numVal & "]") 'elencoUtMem
|
||||
itemRead(1) = New Item("DB253.DBI2500:[" & numVal & "]") 'tabUt_UT
|
||||
itemRead(2) = New Item("DB253.DBI2900:[" & numVal & "]") 'IdFamigliaUt
|
||||
itemRead(3) = New Item("DB253.DBI100:[" & numVal & "]") 'tabFamUt
|
||||
itemRead(4) = New Item("DB253.DBI1900:[" & numVal & "]") 'tabTipoVitaRes
|
||||
itemRead(5) = New Item("DB253.DBI4300:[" & numVal & "]") 'tabVitaRes
|
||||
itemRead(0) = New Item("DB254.DBW280:[" & numUt & "]") 'elencoUtMem
|
||||
itemRead(1) = New Item("DB253.DBW2500:[" & numVal & "]") 'tabUt_UT
|
||||
itemRead(2) = New Item("DB253.DBW2900:[" & numVal & "]") 'IdFamigliaUt
|
||||
itemRead(3) = New Item("DB253.DBW100:[" & numVal & "]") 'tabFamUt
|
||||
itemRead(4) = New Item("DB253.DBW1900:[" & numVal & "]") 'tabTipoVitaRes
|
||||
itemRead(5) = New Item("DB253.DBD4300:[" & numVal & "]") 'tabVitaRes
|
||||
|
||||
Do
|
||||
Try
|
||||
@@ -1016,32 +1014,36 @@ Namespace CNC
|
||||
' variabili di appoggio
|
||||
Dim datiUT As New UtData
|
||||
|
||||
Dim _elencoUtMem(numVal) As UShort
|
||||
Dim _tabUt_UT(numVal) As UShort
|
||||
Dim _tabIdFamUt(numVal) As UShort
|
||||
Dim _tabFamUt(numVal) As UShort
|
||||
Dim _tabTipoVitaRes(numVal) As UShort
|
||||
Dim _tabVitaRes(numVal) As UShort
|
||||
Dim _elencoUtMem(numUt - 1) As UShort
|
||||
Dim _tabUt_UT(numVal - 1) As UShort
|
||||
Dim _tabIdFamUt(numVal - 1) As UShort
|
||||
Dim _tabFamUt(numVal - 1) As UShort
|
||||
Dim _tabTipoVitaRes(numVal - 1) As UShort
|
||||
Dim _tabVitaRes(numVal - 1) As UShort
|
||||
|
||||
' faccio copia valori!
|
||||
For i As Integer = 0 To numVal
|
||||
'_elencoUtMem(i) = itemRead(0).Value(i)
|
||||
_elencoUtMem(i) = UIntegerToSingle(itemRead(0).Value(i))
|
||||
For i As Integer = 0 To numUt - 1
|
||||
_elencoUtMem(i) = itemRead(0).Value(i)
|
||||
'_elencoUtMem(i) = UIntegerToSingle(itemRead(0).Value(i))
|
||||
Next i
|
||||
|
||||
'_tabUt_UT(i) = itemRead(1).Value(i)
|
||||
_tabUt_UT(i) = UIntegerToSingle(itemRead(1).Value(i))
|
||||
' faccio copia valori!
|
||||
For i As Integer = 0 To numVal - 1
|
||||
|
||||
'_tabIdFamUt(i) = itemRead(2).Value(i)
|
||||
_tabIdFamUt(i) = UIntegerToSingle(itemRead(2).Value(i))
|
||||
_tabUt_UT(i) = itemRead(1).Value(i)
|
||||
'_tabUt_UT(i) = UIntegerToSingle(itemRead(1).Value(i))
|
||||
|
||||
'_tabFamUt(i) = itemRead(3).Value(i)
|
||||
_tabFamUt(i) = UIntegerToSingle(itemRead(3).Value(i))
|
||||
_tabIdFamUt(i) = itemRead(2).Value(i)
|
||||
'_tabIdFamUt(i) = UIntegerToSingle(itemRead(2).Value(i))
|
||||
|
||||
'_tabTipoVitaRes(i) = itemRead(4).Value(i)
|
||||
_tabTipoVitaRes(i) = UIntegerToSingle(itemRead(4).Value(i))
|
||||
_tabFamUt(i) = itemRead(3).Value(i)
|
||||
'_tabFamUt(i) = UIntegerToSingle(itemRead(3).Value(i))
|
||||
|
||||
'_tabVitaRes(i) = itemRead(5).Value(i)
|
||||
_tabVitaRes(i) = UIntegerToSingle(itemRead(5).Value(i))
|
||||
_tabTipoVitaRes(i) = itemRead(4).Value(i)
|
||||
'_tabTipoVitaRes(i) = UIntegerToSingle(itemRead(4).Value(i))
|
||||
|
||||
_tabVitaRes(i) = itemRead(5).Value(i)
|
||||
'_tabVitaRes(i) = UIntegerToSingle(itemRead(5).Value(i))
|
||||
Next i
|
||||
|
||||
' copio in oggetto OUT...
|
||||
|
||||
@@ -3208,10 +3208,9 @@ namespace MTC_Adapter
|
||||
getAnalogDataFromPlc();
|
||||
// reload dati da file...
|
||||
reloadDataFromFile();
|
||||
|
||||
// commento( sim incastra)
|
||||
|
||||
// area gestione dati utensili... in base al num max di UnOp recupero i dati utensile... PROCEDURA AD HOC!!!
|
||||
//getDatiUt(currAdpConf.nUnOp);
|
||||
getDatiUt(currAdpConf.nUnOp);
|
||||
}
|
||||
/// <summary>
|
||||
/// recupero di TUTTI gli strobes/status attivi
|
||||
@@ -3620,7 +3619,7 @@ namespace MTC_Adapter
|
||||
{
|
||||
// variabili "Indice" utensile e famiglia da decodificare + utils
|
||||
int maxMemAddr = numMemUt;
|
||||
byte[] elencoUtMem = new byte[2 * maxNumOp];
|
||||
byte[] elencoUtMem = new byte[2 * 20];
|
||||
byte[] tabUt_UT = new byte[2 * maxMemAddr];
|
||||
byte[] tabFam_FamUt = new byte[2 * maxMemAddr];
|
||||
|
||||
|
||||
@@ -497,7 +497,7 @@ namespace MTC_Adapter
|
||||
if (utils.CRB("readAllTop"))
|
||||
{
|
||||
// copio la memoria allarmi dalla memoria top...
|
||||
Buffer.BlockCopy(MemBlockTop, memIndex, MemBlock, 0, MemBlock.Length);
|
||||
Buffer.BlockCopy(MemBlockTop, memIndex, MemBlock, 0, MemBlock.Length);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -947,8 +947,8 @@ namespace MTC_Adapter
|
||||
{
|
||||
// faccio un unica chiamata in blocco di TUTTE le aree che riguardano gli UT e le salvo in variabili locali siemens...
|
||||
inizio = DateTime.Now;
|
||||
//ValUT = SIEMENS_ref.getAllUtData(numMemUt);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-UT_ALL", numMemUt * 6 * 2), DateTime.Now.Subtract(inizio).Ticks);
|
||||
ValUT = SIEMENS_ref.getAllUtData(numMemUt, 20);
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-UT_ALL", numMemUt * 4 * 2 + numMemUt * 4 + 20 * 2), DateTime.Now.Subtract(inizio).Ticks);
|
||||
|
||||
// restituisco dati richiesti...
|
||||
int memIndex = 280;
|
||||
|
||||
Reference in New Issue
Block a user