OmagCUT 3.1e1 :
- aggiunta modalità trasmissione del programma CN a step per debug con Siemens One (in Ini di OmagCUT [General] StepByStepSend=1).
This commit is contained in:
@@ -35,6 +35,7 @@ Module ConstIni
|
|||||||
Public Const K_IMAGEDIR As String = "ImageDir"
|
Public Const K_IMAGEDIR As String = "ImageDir"
|
||||||
Public Const K_CAMERALINK As String = "CameraLink"
|
Public Const K_CAMERALINK As String = "CameraLink"
|
||||||
Public Const K_CNLINK As String = "CNLink"
|
Public Const K_CNLINK As String = "CNLink"
|
||||||
|
Public Const K_STEPBYSTEPSEND As String = "StepByStepSend"
|
||||||
Public Const K_TESTINGPAGE As String = "TestingPage"
|
Public Const K_TESTINGPAGE As String = "TestingPage"
|
||||||
Public Const K_SHOWTIPAXES As String = "ShowTipAxes"
|
Public Const K_SHOWTIPAXES As String = "ShowTipAxes"
|
||||||
Public Const K_LASTPROJFINISHED As String = "LastProjFinished"
|
Public Const K_LASTPROJFINISHED As String = "LastProjFinished"
|
||||||
|
|||||||
+2
-2
@@ -369,8 +369,8 @@ Class MainWindow
|
|||||||
' Verifico abilitazione nesting automatico
|
' Verifico abilitazione nesting automatico
|
||||||
m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey)
|
m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey)
|
||||||
' Recupero opzioni della chiave
|
' Recupero opzioni della chiave
|
||||||
Dim bKey As Boolean = EgtGetKeyLevel(9423, 3104, 1, m_nKeyLevel) And
|
Dim bKey As Boolean = EgtGetKeyLevel(9423, 3105, 1, m_nKeyLevel) And
|
||||||
EgtGetKeyOptions(9423, 3104, 1, m_nKeyOptions)
|
EgtGetKeyOptions(9423, 3105, 1, m_nKeyOptions)
|
||||||
' Verifico abilitazione prodotto
|
' Verifico abilitazione prodotto
|
||||||
Dim bProd As Boolean = GetKeyOption(KEY_OPT.CUT_BASE)
|
Dim bProd As Boolean = GetKeyOption(KEY_OPT.CUT_BASE)
|
||||||
' Impostazione per programma OnlyFrame: solo se CUT_BASE non attivo
|
' Impostazione per programma OnlyFrame: solo se CUT_BASE non attivo
|
||||||
|
|||||||
@@ -62,5 +62,5 @@ Imports System.Windows
|
|||||||
' by using the '*' as shown below:
|
' by using the '*' as shown below:
|
||||||
' <Assembly: AssemblyVersion("1.0.*")>
|
' <Assembly: AssemblyVersion("1.0.*")>
|
||||||
|
|
||||||
<Assembly: AssemblyVersion("3.1.4.2")>
|
<Assembly: AssemblyVersion("3.1.5.1")>
|
||||||
<Assembly: AssemblyFileVersion("3.1.4.2")>
|
<Assembly: AssemblyFileVersion("3.1.5.1")>
|
||||||
|
|||||||
@@ -21,6 +21,9 @@ Public Class CNCommunication
|
|||||||
' Variabile per tipologia CN
|
' Variabile per tipologia CN
|
||||||
Friend m_nNCType As Integer
|
Friend m_nNCType As Integer
|
||||||
|
|
||||||
|
' Modalità invio programmi step a step (attualmente solo per Siemens)
|
||||||
|
Private m_bStepByStepSend As Boolean = False
|
||||||
|
|
||||||
' Modalità speciale invio programmi (attualmente solo per Fanuc, fino a 4 programmi)
|
' Modalità speciale invio programmi (attualmente solo per Fanuc, fino a 4 programmi)
|
||||||
Private m_nSpecialSend As Integer = -1
|
Private m_nSpecialSend As Integer = -1
|
||||||
Friend Property SpecialSend As Integer
|
Friend Property SpecialSend As Integer
|
||||||
@@ -116,6 +119,9 @@ Public Class CNCommunication
|
|||||||
|
|
||||||
EgtOutLog("NcLink=" & m_MainWindow.m_bNCLink.ToString & " type=" & m_nNCType)
|
EgtOutLog("NcLink=" & m_MainWindow.m_bNCLink.ToString & " type=" & m_nNCType)
|
||||||
|
|
||||||
|
' Leggo flag invio programma a step per debug (da Ini di OmagCUT)
|
||||||
|
m_bStepByStepSend = (GetPrivateProfileInt(S_GENERAL, K_STEPBYSTEPSEND, 0, m_MainWindow.GetIniFile()) = 1)
|
||||||
|
|
||||||
' Leggo flag invio speciale programma di lavoro
|
' Leggo flag invio speciale programma di lavoro
|
||||||
Dim nTemp As Integer = GetPrivateProfileInt(S_NUMERICALCONTROL, K_SPECIALSEND, -1, m_MainWindow.GetMachIniFile())
|
Dim nTemp As Integer = GetPrivateProfileInt(S_NUMERICALCONTROL, K_SPECIALSEND, -1, m_MainWindow.GetMachIniFile())
|
||||||
m_nSpecialSend = Math.Max( Math.Min( nTemp, 1), -1)
|
m_nSpecialSend = Math.Max( Math.Min( nTemp, 1), -1)
|
||||||
@@ -128,9 +134,9 @@ Public Class CNCommunication
|
|||||||
' Se CN Siemens leggo dati programma intermedio di comunicazione
|
' Se CN Siemens leggo dati programma intermedio di comunicazione
|
||||||
If m_nNCType = 3 Then
|
If m_nNCType = 3 Then
|
||||||
Dim sExeName As String = String.Empty
|
Dim sExeName As String = String.Empty
|
||||||
GetPrivateProfileString(S_NCSIEMENS, K_COMM_NAME, "", sExeName, m_MainWindow.m_CurrentMachine.sMachIniFile)
|
GetPrivateProfileString(S_NCSIEMENS, K_COMM_NAME, "", sExeName, m_MainWindow.GetMachIniFile())
|
||||||
m_sCNSiemensPath = m_MainWindow.GetExeRootDir() & "\" & sExeName
|
m_sCNSiemensPath = m_MainWindow.GetExeRootDir() & "\" & sExeName
|
||||||
GetPrivateProfileString(S_NCSIEMENS, K_PATH_HMI, "", m_sCNSiemensHMIPath, m_MainWindow.m_CurrentMachine.sMachIniFile)
|
GetPrivateProfileString(S_NCSIEMENS, K_PATH_HMI, "", m_sCNSiemensHMIPath, m_MainWindow.GetMachIniFile())
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' Inizializzo la connessione
|
' Inizializzo la connessione
|
||||||
@@ -339,7 +345,7 @@ Public Class CNCommunication
|
|||||||
|
|
||||||
#End Region ' ver 2.7h2 nuova gestione
|
#End Region ' ver 2.7h2 nuova gestione
|
||||||
|
|
||||||
Private Sub KillSimensCom(sProcessName As String)
|
Private Sub KillSiemensCom(sProcessName As String)
|
||||||
Dim sAppName As String = Path.GetFileNameWithoutExtension(sProcessName)
|
Dim sAppName As String = Path.GetFileNameWithoutExtension(sProcessName)
|
||||||
Dim pList() As System.Diagnostics.Process = System.Diagnostics.Process.GetProcesses
|
Dim pList() As System.Diagnostics.Process = System.Diagnostics.Process.GetProcesses
|
||||||
For Each proc As System.Diagnostics.Process In pList
|
For Each proc As System.Diagnostics.Process In pList
|
||||||
@@ -555,7 +561,7 @@ Public Class CNCommunication
|
|||||||
|
|
||||||
' !!!!!!!!!!!!!! FORZO LA SIMULAZIONE DELLA LETTURA DELLE VARIBILI E SIEMENS !!!!!!!!!!!!!!
|
' !!!!!!!!!!!!!! FORZO LA SIMULAZIONE DELLA LETTURA DELLE VARIBILI E SIEMENS !!!!!!!!!!!!!!
|
||||||
EgtOutLog("ProcessStart : " & """" & m_sCNSiemensHMIPath & """" & " " & sArg)
|
EgtOutLog("ProcessStart : " & """" & m_sCNSiemensHMIPath & """" & " " & sArg)
|
||||||
KillSimensCom(m_sCNSiemensHMIPath)
|
KillSiemensCom(m_sCNSiemensHMIPath)
|
||||||
Process.Start(m_sCNSiemensHMIPath, sArg)
|
Process.Start(m_sCNSiemensHMIPath, sArg)
|
||||||
' !!!!!!!!!!!!!! FORZO LA SIMULAZIONE DELLA LETTURA DELLE VARIBILI E SIEMENS !!!!!!!!!!!!!!
|
' !!!!!!!!!!!!!! FORZO LA SIMULAZIONE DELLA LETTURA DELLE VARIBILI E SIEMENS !!!!!!!!!!!!!!
|
||||||
|
|
||||||
@@ -680,7 +686,7 @@ Public Class CNCommunication
|
|||||||
Next
|
Next
|
||||||
' Attraverso la funzione "RefreshNoEvents" rileggo i dati caricati
|
' Attraverso la funzione "RefreshNoEvents" rileggo i dati caricati
|
||||||
|
|
||||||
' Recupero il perocorso delle variabili PLC
|
' Recupero il percorso delle variabili PLC
|
||||||
GetPrivateProfileString(S_NCSIEMENS, K_DBVARPATH, "", m_CN.m_DbVarPath, m_MainWindow.GetMachIniFile)
|
GetPrivateProfileString(S_NCSIEMENS, K_DBVARPATH, "", m_CN.m_DbVarPath, m_MainWindow.GetMachIniFile)
|
||||||
|
|
||||||
ElseIf m_CN.m_IsActiveModeSubscription Then
|
ElseIf m_CN.m_IsActiveModeSubscription Then
|
||||||
@@ -1605,7 +1611,7 @@ Public Class CNCommunication
|
|||||||
Else
|
Else
|
||||||
sNumProg = nNumProg.ToString()
|
sNumProg = nNumProg.ToString()
|
||||||
End If
|
End If
|
||||||
' Se Fanuc con trasmissione speciale come copia
|
' Se Fanuc con trasmissione speciale come copia in un direttorio opportuno
|
||||||
If m_nNCType = 4 AndAlso m_nSpecialSend = 1 AndAlso m_nSpecialAreas = 0 Then
|
If m_nNCType = 4 AndAlso m_nSpecialSend = 1 AndAlso m_nSpecialAreas = 0 Then
|
||||||
bOk = SpecialSendCopyProgram(sCncPath)
|
bOk = SpecialSendCopyProgram(sCncPath)
|
||||||
If bOk Then
|
If bOk Then
|
||||||
@@ -1628,6 +1634,10 @@ Public Class CNCommunication
|
|||||||
End If
|
End If
|
||||||
' Attesa opportuna
|
' Attesa opportuna
|
||||||
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nResetSendDelay)
|
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nResetSendDelay)
|
||||||
|
' Se modalità invio a step per debug di Siemens
|
||||||
|
If m_bStepByStepSend And m_nNCType = 3 Then
|
||||||
|
MessageBox.Show( "Reset Done, Press Ok to Continue", "Send Program Step by Step")
|
||||||
|
End If
|
||||||
If m_nNCType = 1 Then
|
If m_nNCType = 1 Then
|
||||||
' Cancellazione eventuale file già presente con lo stesso nome (ignoro eventuale errore)
|
' Cancellazione eventuale file già presente con lo stesso nome (ignoro eventuale errore)
|
||||||
EgtOutLog("Delete_NC_prog(sNumProg)")
|
EgtOutLog("Delete_NC_prog(sNumProg)")
|
||||||
@@ -1653,6 +1663,10 @@ Public Class CNCommunication
|
|||||||
bOk = bOk AndAlso (m_CN.Download_NC_prog(sCncPath, sNumProg) = 0)
|
bOk = bOk AndAlso (m_CN.Download_NC_prog(sCncPath, sNumProg) = 0)
|
||||||
' Attesa opportuna
|
' Attesa opportuna
|
||||||
System.Threading.Thread.Sleep(100)
|
System.Threading.Thread.Sleep(100)
|
||||||
|
' Se modalità invio a step per debug di Siemens
|
||||||
|
If m_bStepByStepSend And m_nNCType = 3 Then
|
||||||
|
MessageBox.Show( "Download NC Prog Done, Press Ok to Continue", "Send Program Step by Step")
|
||||||
|
End If
|
||||||
' FANUC: genero un file 901 vuoto da spedire, attivare; poi rispedisco il file 900
|
' FANUC: genero un file 901 vuoto da spedire, attivare; poi rispedisco il file 900
|
||||||
If m_nNCType = 4 And Not bOk Then
|
If m_nNCType = 4 And Not bOk Then
|
||||||
bOk = True
|
bOk = True
|
||||||
@@ -1694,10 +1708,18 @@ Public Class CNCommunication
|
|||||||
EgtOutLog(TimeSpanEnd())
|
EgtOutLog(TimeSpanEnd())
|
||||||
' Attesa opportuna
|
' Attesa opportuna
|
||||||
System.Threading.Thread.Sleep(100)
|
System.Threading.Thread.Sleep(100)
|
||||||
|
' Se modalità invio a step per debug di Siemens
|
||||||
|
If m_bStepByStepSend And m_nNCType = 3 Then
|
||||||
|
MessageBox.Show( "ActivateProgram Done, Press Ok to Continue", "Send Program Step by Step")
|
||||||
|
End If
|
||||||
' Attivo la modalità AUTO prima per preparare il cyclo start
|
' Attivo la modalità AUTO prima per preparare il cyclo start
|
||||||
bOk = bOk AndAlso (m_CN.DGeneralFunctions_WriteCncMode(0) = 0)
|
bOk = bOk AndAlso (m_CN.DGeneralFunctions_WriteCncMode(0) = 0)
|
||||||
' Attesa opportuna
|
' Attesa opportuna
|
||||||
System.Threading.Thread.Sleep(100)
|
System.Threading.Thread.Sleep(100)
|
||||||
|
' Se modalità invio a step per debug di Siemens
|
||||||
|
If m_bStepByStepSend And m_nNCType = 3 Then
|
||||||
|
MessageBox.Show( "AUTO Mode Setting Done, Press Ok to Continue", "Send Program Step by Step")
|
||||||
|
End If
|
||||||
' Modalità automatica
|
' Modalità automatica
|
||||||
EgtOutLog("DGeneralFunctions_WriteCncMode(0)")
|
EgtOutLog("DGeneralFunctions_WriteCncMode(0)")
|
||||||
TimeSpanInit()
|
TimeSpanInit()
|
||||||
@@ -1790,9 +1812,9 @@ Public Class CNCommunication
|
|||||||
' Solo per Fanuc
|
' Solo per Fanuc
|
||||||
If m_nNCType <> 4 Then Return False
|
If m_nNCType <> 4 Then Return False
|
||||||
' Creo path destinazione
|
' Creo path destinazione
|
||||||
Dim sDestProg As String = m_CurrProjPage.GetCurrentProjectTitle()
|
|
||||||
Dim sDestPath As String = m_sSpecialDest & "\" & sDestProg & ".cnc"
|
|
||||||
Try
|
Try
|
||||||
|
Dim sDestProg As String = m_CurrProjPage.GetCurrentProjectTitle() & ".cnc"
|
||||||
|
Dim sDestPath As String = My.Computer.FileSystem.CombinePath(m_sSpecialDest, sDestProg)
|
||||||
My.Computer.FileSystem.CopyFile(sz_PC_filename, sDestPath, True)
|
My.Computer.FileSystem.CopyFile(sz_PC_filename, sDestPath, True)
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
Return False
|
Return False
|
||||||
|
|||||||
@@ -839,9 +839,9 @@ Public Class CurrentProjectPageUC
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Friend Function GetCurrentProjectTitle() As String
|
Friend Function GetCurrentProjectTitle() As String
|
||||||
Dim CurrProjName As String = String.Empty
|
Dim CurrProjName As String = ""
|
||||||
GetPrivateProfileString(S_GENERAL, K_LASTNAMEPROJ, "", CurrProjName, m_MainWindow.GetIniFile())
|
GetPrivateProfileString(S_GENERAL, K_LASTNAMEPROJ, "", CurrProjName, m_MainWindow.GetIniFile())
|
||||||
If String.IsNullOrEmpty(CurrProjName) Then
|
If String.IsNullOrWhiteSpace(CurrProjName) Then
|
||||||
CurrProjName = Math.Abs(m_nCurrProj).ToString("D4")
|
CurrProjName = Math.Abs(m_nCurrProj).ToString("D4")
|
||||||
End If
|
End If
|
||||||
Return CurrProjName
|
Return CurrProjName
|
||||||
|
|||||||
Reference in New Issue
Block a user