ULteriori fix x SIEMENS
This commit is contained in:
@@ -909,6 +909,21 @@ Namespace CNC
|
||||
|
||||
End Structure
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Struttura dati MANDRINO
|
||||
''' </summary>
|
||||
Public Structure UnOpData
|
||||
''' <summary>
|
||||
''' Carico Asse
|
||||
''' </summary>
|
||||
Public Load As Single
|
||||
''' <summary>
|
||||
''' Speed asse
|
||||
''' </summary>
|
||||
Public Speed As Single
|
||||
End Structure
|
||||
|
||||
''' <summary>
|
||||
''' Struttura dati asse
|
||||
''' </summary>
|
||||
@@ -926,10 +941,6 @@ Namespace CNC
|
||||
''' </summary>
|
||||
Public PosTgt As Single
|
||||
''' <summary>
|
||||
''' Velocità asse
|
||||
''' </summary>
|
||||
Public Speed As Single
|
||||
''' <summary>
|
||||
''' Feed asse
|
||||
''' </summary>
|
||||
Public Feed As Single
|
||||
@@ -937,7 +948,6 @@ Namespace CNC
|
||||
''' Feed Override asse
|
||||
''' </summary>
|
||||
Public FeedOver As Single
|
||||
|
||||
End Structure
|
||||
''' <summary>
|
||||
''' Struttura dati UT
|
||||
@@ -970,24 +980,18 @@ Namespace CNC
|
||||
|
||||
End Structure
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Restituisce tutti i dati assi insieme
|
||||
''' Restituisce tutti i dati UnOp
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Function getAllAxisPos() As AxData()
|
||||
Public Function getAllUnOpData() As UnOpData()
|
||||
' RIFERIMENTO:
|
||||
' txt Giuseppe
|
||||
' PLC interface
|
||||
|
||||
ReDim itemRead(5)
|
||||
itemRead(0) = New Item("DB241.DBD0:[16]") 'Posizione attuale
|
||||
itemRead(1) = New Item("DB254.DBW140:[20]") 'Speed effettiva
|
||||
itemRead(2) = New Item("DB254.DBB180:[20]") 'Carico effettivo
|
||||
itemRead(3) = New Item("/Channel/MachineAxis/toolBaseDistToGo[u1,1,16]")
|
||||
'itemRead(3) = New Item("DB241.DBD0:[16]") 'Posizione Target !!!FARE!!! è altra variabile?!? AA_IM
|
||||
itemRead(4) = New Item("/Channel/MachineAxis/actFeedRate[u1,1,16]") ' param manual NC, pg21 legge la feed... da salvare in valore assolulto...
|
||||
itemRead(5) = New Item("/Channel/MachineAxis/feedRateOvr[u1,1,16]") ' param manual NC, pg215 legge la feedOver...
|
||||
|
||||
'/Channel/MachineAxis/feedRateOvr[u1, 1,16]
|
||||
ReDim itemRead(1)
|
||||
itemRead(0) = New Item("DB254.DBB180:[20]") 'Carico effettivo MANDRINO
|
||||
itemRead(1) = New Item("DB254.DBW140:[20]") 'Speed effettiva MANDRINO
|
||||
|
||||
Do
|
||||
Try
|
||||
@@ -1000,19 +1004,62 @@ Namespace CNC
|
||||
End Try
|
||||
Loop
|
||||
|
||||
Dim datiAssi(19) As AxData
|
||||
Dim datiAssi(19) As UnOpData
|
||||
|
||||
|
||||
' faccio copia valori!
|
||||
For i As Integer = 0 To 19
|
||||
datiAssi(i).Load = UIntegerToSingle(itemRead(0).Value(i))
|
||||
datiAssi(i).Speed = UIntegerToSingle(itemRead(1).Value(i))
|
||||
Next i
|
||||
|
||||
Return datiAssi
|
||||
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Restituisce tutti i dati assi insieme
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Function getAllAxisData() As AxData()
|
||||
' RIFERIMENTO:
|
||||
' txt Giuseppe
|
||||
|
||||
ReDim itemRead(4)
|
||||
itemRead(0) = New Item("DB241.DBD0:[16]") 'Posizione attuale
|
||||
itemRead(1) = New Item("/Channel/MachineAxis/actFeedRate[u1,1,16]") ' param manual NC, pg21 legge la feed... da salvare in valore assolulto...
|
||||
itemRead(2) = New Item("/Channel/MachineAxis/feedRateOvr[u1,1,16]") ' param manual NC, pg215 legge la feedOver...
|
||||
itemRead(3) = New Item("/Channel/MachineAxis/toolBaseDistToGo[u1,1,16]")
|
||||
itemRead(4) = New Item("/Channel/MachineAxis/aaLoad[u1,1,16]") ' param manual NC, pg426 legge carico effettivo asse PRIFIdrive in %... da sempre zero
|
||||
|
||||
'/Channel/MachineAxis/speedOvr[u1,1,16] speed override asse NON VA - errore-eccezione
|
||||
'/Channel/NckSpindle/driveLoad[u1,1,16] carico effettivo asse NON VA - errore-eccezione
|
||||
'/Channel/MachineAxis/aaLoad[u1,1,16] pg426 carico effettivo asse DA SEMPRE ZERO
|
||||
'/Channel/MachineAxis/vaLoad[u1,1,16] DA SEMPRE ZERO
|
||||
'/Channel/MachineAxis/vaCurr[u1,1,16] DA SEMPRE ZERO
|
||||
'
|
||||
|
||||
Do
|
||||
Try
|
||||
m_DataSvcRW.Read(itemRead)
|
||||
Exit Do
|
||||
Catch ex As DataSvcBusyException
|
||||
Debug.Print(ex.Message)
|
||||
Catch ex As DataSvcException
|
||||
Throw New CmsNcException("ERR GetStaticData CNC.SIEMENS DataSvcException", ex)
|
||||
End Try
|
||||
Loop
|
||||
|
||||
Dim datiAssi(15) As AxData
|
||||
|
||||
' faccio copia valori!
|
||||
For i As Integer = 0 To 15
|
||||
'datiAssi(i).PosAct = itemRead(0).Value(i)
|
||||
datiAssi(i).PosAct = UIntegerToSingle(itemRead(0).Value(i))
|
||||
datiAssi(i).Feed = Math.Abs(Convert.ToSingle(itemRead(1).Value(i)))
|
||||
datiAssi(i).FeedOver = Math.Abs(Convert.ToSingle(itemRead(2).Value(i)))
|
||||
datiAssi(i).PosTgt = Convert.ToSingle(itemRead(3).Value(i))
|
||||
datiAssi(i).Feed = Math.Abs(Convert.ToSingle(itemRead(4).Value(i)))
|
||||
datiAssi(i).FeedOver = Math.Abs(Convert.ToSingle(itemRead(5).Value(i)))
|
||||
Next i
|
||||
For i As Integer = 0 To 19
|
||||
datiAssi(i).Speed = UIntegerToSingle(itemRead(1).Value(i))
|
||||
datiAssi(i).Load = UIntegerToSingle(itemRead(2).Value(i))
|
||||
datiAssi(i).Load = UIntegerToSingle(itemRead(4).Value(i))
|
||||
Next i
|
||||
|
||||
Return datiAssi
|
||||
|
||||
@@ -968,9 +968,9 @@ namespace MTC_Adapter
|
||||
return memIndex;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Processo dati di path
|
||||
/// </summary>
|
||||
public override void getPath()
|
||||
{
|
||||
base.getPath();
|
||||
@@ -982,7 +982,6 @@ namespace MTC_Adapter
|
||||
if (utils.CRB("recTime")) TimingData.addResult("R-GCodModal", DateTime.Now.Subtract(inizio).Ticks);
|
||||
|
||||
|
||||
|
||||
#if false
|
||||
|
||||
inizio = DateTime.Now;
|
||||
@@ -1055,7 +1054,7 @@ namespace MTC_Adapter
|
||||
|
||||
// recupero in blocco dati assi...
|
||||
inizio = DateTime.Now;
|
||||
SIEMENS.AxData[] ValAssi = SIEMENS_ref.getAllAxisPos();
|
||||
SIEMENS.AxData[] ValAssi = SIEMENS_ref.getAllAxisData();
|
||||
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-AXIS_ALL", ValAssi.Length * 4 * 2), DateTime.Now.Subtract(inizio).Ticks);
|
||||
|
||||
|
||||
@@ -1071,9 +1070,10 @@ namespace MTC_Adapter
|
||||
|
||||
// imposto feed "generale" per asse... si potrebbe usare velocità del singolo asse... !!!FARE!!! verificare
|
||||
vettAxis[i].mAxFeedAct.Value = ValAssi[i].Feed;// FeedRate;
|
||||
//vettAxis[i].mAxFeedAct.Value= ValAssi[i].Speed;
|
||||
vettAxis[i].mAxFeedOver.Value = ValAssi[i].FeedOver; // FeedRateOver;
|
||||
|
||||
vettAxis[i].mAxLoad.Value = ValAssi[i].Load;
|
||||
|
||||
// verifica pos TGT... NON E' orrettamente letta lato area memoria...
|
||||
vettAxis[i].mAxPosTgt.Value = ValAssi[i].PosTgt;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user