Compare commits

...

3 Commits

Author SHA1 Message Date
Nicola Pievani 3cfc7276c9 Gestione scrittura valore FeedHold letto da configurazione 2023-04-18 15:53:28 +02:00
Nicola Pievani 4e8925515d Corretto il valore di ritorno di alcune funzioni 2023-04-18 12:37:42 +02:00
Nicola Pievani 659405c52f Testato codice con controllo FANUC 2023-04-12 12:07:04 +02:00
11 changed files with 232 additions and 118 deletions
+10
View File
@@ -46,6 +46,13 @@
Public Const K_THREADSLEEP As String = "ThreadSleep"
Public Const K_PHOTODELEY As String = "PhotoDeley"
Public Const S_NCFANUC As String = "NcFanuc"
Public Const K_SETNCMODE As String = "SetNcMode"
Public Const K_BASEADDRINT As String = "BaseAddrInt"
Public Const K_BASEADDRBIT As String = "BaseAddrBit"
Public Const K_NUMVARINT As String = "NumVarInt"
Public Const K_NUMVARBIT As String = "NumVarBit"
Public Const S_EXECLUA As String = "ExecLua"
Public Const K_FILESCRIPT_LUA As String = "FileScript"
@@ -78,6 +85,7 @@
Public Const K_TABLEDOWN As String = "TableDown"
Public Const K_MANUAL As String = "Manual"
Public Const K_DOORCLOSED As String = "DoorClosed"
Public Const K_DOOROPENDED As String = "DoorOpened"
Public Const K_LIMITZ As String = "LimitZ"
Public Const K_POWEROVR As String = "PowerOvr"
Public Const K_PARKING As String = "Parking"
@@ -112,6 +120,7 @@
Public Const K_FEEDHOLD As String = "FeedHold"
Public Const K_SPOTLIGHT1 As String = "SpotLight1"
Public Const K_SPOTLIGHT2 As String = "SpotLight2"
Public Const K_NAXES As String = "nAxes"
' Nuove variabili
Public Const K_SPEEDHOLD As String = "SpeedHold"
Public Const K_XYJOG As String = "XYJog"
@@ -270,6 +279,7 @@
Public Const S_MACH_PROBING As String = "Probing"
Public Const K_PROBINGSTATEVAR As String = "ProbingStateVar"
Public Const K_SAWDIAMETER As String = "SawDiameter"
Public Const K_TOOLLENGTH As String = "ToolLength"
Public Const K_RAWTHICKNESS As String = "RawThickness"
Public Const K_ENABLERAWPROBE As String = "EnableRawProbe"
+20 -12
View File
@@ -260,38 +260,34 @@ Public Class ControlsMachineButtonUC
Dim DoorOpenedButton As ThreeStateButton = Nothing
For Each MachineButton As MachineButton In m_ButtonList
If MachineButton.StateFlag = K_DOORCLOSED Then
'If TypeOf MachineButton Is NoStateButton Then
' DoorClosedButton = DirectCast(MachineButton, NoStateButton)
'ElseIf TypeOf MachineButton Is TwoStateButton Then
' DoorClosedButton = DirectCast(MachineButton, TwoStateButton)
'ElseIf TypeOf MachineButton Is ThreeStateButton Then
' DoorClosedButton = DirectCast(MachineButton, ThreeStateButton)
'ElseIf TypeOf MachineButton Is DoubleCommandButton Then
' DoorClosedButton = DirectCast(MachineButton, DoubleCommandButton)
'ElseIf TypeOf MachineButton Is PressedCommandButton Then
' DoorClosedButton = DirectCast(MachineButton, PressedCommandButton)
'End If
DoorClosedButton = MachineButton
End If
If MachineButton.StateFlag = "DoorOpened" Then
If MachineButton.StateFlag = K_DOOROPENDED Then
DoorOpenedButton = MachineButton
End If
Next
' Chiusura porte (gesrtione comando Three/Two state
If Not IsNothing(DoorClosedButton) Then
Select Case DoorClosedState
Case 0
' porta aperta
DoorClosedButton.Background = Application.Current.FindResource("OmagCut_Red")
Case 1, 2
' porta in movimento/aperta
DoorClosedButton.Background = Application.Current.FindResource("OmagCut_LightGray")
End Select
End If
' Chiusura porte (gesrtione comando Three/Two state
If Not IsNothing(DoorOpenedButton) Then
Select Case DoorClosedState
Case 0
' porta aperta
DoorOpenedButton.Background = Application.Current.FindResource("OmagCut_LightGray")
Case 1
' porta in movimento
DoorOpenedButton.Background = Application.Current.FindResource("OmagCut_Yellow")
Case 2
' porta chiusa
DoorOpenedButton.Background = Application.Current.FindResource("OmagCut_Green")
End Select
End If
@@ -577,7 +573,19 @@ Public MustInherit Class MachineButton
Return
Case 4
' ------------------------------------ FANUC ------------------------------------
' eventuale scrittura di linea di comando MDI
If Not String.IsNullOrEmpty(CmdString) Then
' attivo mpdalità MDI
m_CN.DGeneralFunctions_WriteCncMode(2)
System.Threading.Thread.Sleep(100)
' salvo la stringa di comando ricevuta dal file lua
m_CN.sz_ManualDataInput = CmdString
' esguo la funzione che ha il compito di scrivere il comando MDI
m_CN.MDI_command()
End If
' attivo modalità AUTO
m_CN.DGeneralFunctions_WriteCncMode(7)
System.Threading.Thread.Sleep(100)
If String.IsNullOrEmpty(EValue) Then
' EActive: impulsivo "D#####"
m_CN.NC_pulse_bit(ENumber)
+6 -2
View File
@@ -215,7 +215,7 @@ Public Class DirectCutPageUC
m_ControlsMachineButton.SetValue(Grid.RowProperty, 1)
m_NewMachineButtonsType = m_ControlsMachineButton.GetPrivateProfileMachineButtons(S_CONTROLMACHBUTTONS, "Button1", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, m_MainWindow.GetMachIniFile())
MachineButtonGrid.Children.Add(m_ControlsMachineButton)
'm_ActiveControl = Controls.MachineButtonUC
m_ActiveControl = Controls.MachineButtonUC
If VacuumMachineBtn.IsChecked Then
MachineButtonGrid.Children.Remove(m_VacuumMachineButton)
VacuumMachineBtn.IsChecked = False
@@ -228,7 +228,7 @@ Public Class DirectCutPageUC
Private Sub VacuumMachineBtn_Click(sender As Object, e As RoutedEventArgs) Handles VacuumMachineBtn.Click
If VacuumMachineBtn.IsChecked Then
MachineButtonGrid.Children.Add(m_VacuumMachineButton)
'm_ActiveControl = Controls.VacuumButtonUC
m_ActiveControl = Controls.VacuumButtonUC
If ControlsMachineBtn.IsChecked Then
MachineButtonGrid.Children.Remove(m_ControlsMachineButton)
ControlsMachineBtn.IsChecked = False
@@ -452,8 +452,12 @@ Public Class DirectCutPageUC
m_ControlsDirectCutUC1.DirectCutPage_Unloaded(Nothing, Nothing)
Case Controls.MachineButtonUC
MachineButtonGrid.Children.Remove(m_ControlsMachineButton)
MachineButtonGrid.Children.Remove(m_ControlsDirectCutUC)
MachineButtonGrid.Children.Remove(m_ControlsDirectCutUC1)
ControlsMachineBtn.IsChecked = False
Case Controls.VacuumButtonUC
MachineButtonGrid.Children.Remove(m_ControlsMachineButton)
MachineButtonGrid.Children.Remove(m_ControlsDirectCutUC)
MachineButtonGrid.Children.Remove(m_VacuumMachineButton)
VacuumMachineBtn.IsChecked = False
End Select
+32 -2
View File
@@ -275,13 +275,26 @@ Public Class MachineButtonsUC
' CONTROLLO FANUC
Case 4
' ------------------------------------ FANUC ------------------------------------
' eventuale scrittura di linea di comando MDI
If Not String.IsNullOrEmpty(CmdString) Then
' attivo mpdalità MDI
m_CN.DGeneralFunctions_WriteCncMode(2)
System.Threading.Thread.Sleep(100)
' salvo la stringa di comando ricevuta dal file lua
m_CN.sz_ManualDataInput = CmdString
' esguo la funzione che ha il compito di scrivere il comando MDI
m_CN.MDI_command()
End If
' attivo modalità AUTO
m_CN.DGeneralFunctions_WriteCncMode(7)
System.Threading.Thread.Sleep(100)
If String.IsNullOrEmpty(EValue) Then
' EActive: impulsivo "D#####"
m_CN.NC_pulse_bit(ENumber)
EgtOutLog("Fanuc_DNumber= " & ENumber)
Else
' EActive + EValue: scrittura comando invariabile Short oppure Bit
If EValue.Contains(".") Then
If ENumber.Contains(".") Then
' D#####.#
Dim bEValue As Boolean
If EValue.Trim = "1" Then bEValue = True
@@ -292,7 +305,24 @@ Public Class MachineButtonsUC
End If
EgtOutLog("Fanuc_DNumber= " & ENumber & " DValue= " & EValue)
End If
' eventale caricamento seconda variabile
If String.IsNullOrEmpty(EValue2) Then
' EActive: impulsivo "D#####"
m_CN.NC_pulse_bit(ENumber2)
EgtOutLog("Fanuc_DNumber= " & ENumber2)
Else
' EActive + EValue: scrittura comando invariabile Short oppure Bit
If ENumber2.Contains(".") Then
' D#####.#
Dim bEValue2 As Boolean
If EValue2.Trim = "1" Then bEValue2 = True
m_CN.NC_write_var_bit(ENumber2, CBool(EValue2))
Else
' D#####
m_CN.NC_write_var_short(ENumber2, CShort(EValue2))
End If
EgtOutLog("Fanuc_DNumber2= " & ENumber2 & " DValue2= " & EValue2)
End If
Return
End Select
End If
+4
View File
@@ -1286,6 +1286,10 @@ Public Class AlarmsPageUC
Dim bRead As Boolean = False
Dim SawDiameterNameVar As String = String.Empty
GetPrivateProfileString(S_MACH_PROBING, K_SAWDIAMETER, "", SawDiameterNameVar, m_MainWindow.GetMachIniFile())
' Se utensile non lama, allora la variabile in cui leggo il dato potrebbe essere differente
If Not ToolForProbing.m_IsSaw Then
GetPrivateProfileString(S_MACH_PROBING, K_TOOLLENGTH, SawDiameterNameVar, SawDiameterNameVar, m_MainWindow.GetMachIniFile())
End If
m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 0
For I As Integer = 0 To 20
' Devo rileggere la variabile ad ogni ciclo
+23
View File
@@ -1351,6 +1351,29 @@ Public Class CurrentMachine
m_nEnableBarCodeReader = GetPrivateProfileInt(S_MACH_BARCODEREADER, K_ENABLEBCR, 0, sMachIniFile)
End Sub
' Per il controllo FANUC al momento dell'inizializzazione del CN devono essere lette alcune variabili
Public Sub InitFANUC(CN_Generic As CN_generico)
' Leggo ritardo tra reset e send per NUM
m_nResetSendDelay = GetPrivateProfileInt(S_NCFANUC, K_RESETSENDDELAY, 1000, sMachIniFile)
' Leggo ritardo tra reset e send per NUM
m_nThreadSleep = GetPrivateProfileInt(S_NCFANUC, K_THREADSLEEP, 150, sMachIniFile)
' Leggo i dati strettamente correlati alla comunicazione NC-PC
Dim CN As CN_generico = CN_Generic
' Leggo l'indirizzo in cui scrivere lo stato macchina
Dim dAddNcMode As String = CN.s_addr_set_nc_mode
GetPrivateProfileString(S_NCFANUC, K_SETNCMODE, CN.s_addr_set_nc_mode, CN.s_addr_set_nc_mode, sMachIniFile)
' Leggo primo indirizzo libero delle variabili di tipo intero
CN.n_Base_addr_int_vars = GetPrivateProfileInt(S_NCFANUC, K_BASEADDRINT, CN.n_Base_addr_int_vars, sMachIniFile)
' Leggo primo indirizzo libero delle variabili di tipo bit
CN.n_Base_addr_byte_for_bits_vars = GetPrivateProfileInt(S_NCFANUC, K_BASEADDRBIT, CN.n_Base_addr_byte_for_bits_vars, sMachIniFile)
' Leggo numero di variabili di tipo intero
CN.n_num_var_int_to_read = CShort(GetPrivateProfileInt(S_NCFANUC, K_NUMVARINT, CInt(CN.n_num_var_int_to_read), sMachIniFile))
' Leggo numero di varibili di tipo bit
CN.n_num_var_byte_for_bits_to_read = CShort(GetPrivateProfileInt(S_NCFANUC, K_NUMVARBIT, CInt(CN.n_num_var_byte_for_bits_to_read), sMachIniFile))
' Leggo variabile abilitata alla gestione di FeedHold
GetPrivateProfileString(S_NCFANUC, K_SETNCMODE, CN.s_addr_feedhold, CN.s_addr_feedhold, sMachIniFile)
End Sub
Public Sub LoadWJMaterial(Optional bIsStart As Boolean = False)
Dim TempCurrMat As Material = CurrMat
' Svuoto l'attuale lista di materiali
+1 -1
View File
@@ -62,7 +62,7 @@
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<Button Name="StartBtn" Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
<Button Name="StartBtn" Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
<Button Name="StopBtn" Grid.Column="1"
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
<Button Name="ResetBtn" Grid.Column="2"
+30 -30
View File
@@ -252,6 +252,8 @@ Public Class CNCommunication
Case 4
' Fanuc
m_CN = New Fanuc.Fanuc
' proveddo a sovrscrivere i datti di comunicazione PC-NC settati di default nella classe CN_Generico
m_MainWindow.m_CurrentMachine.InitFANUC(m_CN)
End Select
' Recupero la stringa di inizializzazione della comunicazione
@@ -384,6 +386,11 @@ Public Class CNCommunication
If Not String.IsNullOrEmpty(sVal) Then m_CN.SetCnDataVar(CN_generico.CnData.Remote, sVal)
End If
' Solo per controllo FANUNC
GetPrivateProfileString(S_NCDATA, K_NAXES, "", sVal, m_MainWindow.GetMachIniFile())
m_CN.SetCnDataVar(CN_generico.CnData.nAxes, sVal)
' Inizializzo la comunicazione
m_CN.Init()
@@ -1150,11 +1157,19 @@ Public Class CNCommunication
EgtOutLog(TimeSpanEnd())
' Attesa opportuna
System.Threading.Thread.Sleep(100)
ElseIf m_nNCType = 4 Then
' FANUC: imposto modalità EDIT
bOk = bOk AndAlso (m_CN.DGeneralFunctions_WriteCncMode(1) = 0)
' Attesa opportuna
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nThreadSleep)
End If
EgtOutLog("Download_NC_prog(sCncPath, sNumProg)")
' -------------- START DOWNLOAD --------------
TimeSpanInit()
bOk = bOk AndAlso (m_CN.Download_NC_prog(sCncPath, sNumProg) = 0)
' provo a generare un file 901 vuoto da aspedire, attivare e quindi riprovare a spedire il file 900
' Attesa opportuna
System.Threading.Thread.Sleep(100)
' FANUC: genero un file 901 vuoto da aspedire, attivare; poi rispedisco il file 900
If m_nNCType = 4 And Not bOk Then
bOk = True
Dim sCncPath1 As String = m_MainWindow.GetCncDir() & "\PlaceHolder" & m_MainWindow.m_CurrentMachine.sIsoFileExt
@@ -1165,61 +1180,46 @@ Public Class CNCommunication
fs.Close()
bOk = bOk AndAlso (m_CN.Download_NC_prog(sCncPath1, "901") = 0)
' Attesa opportuna
System.Threading.Thread.Sleep(100)
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nThreadSleep)
If bActivate Then
' Imposto modalità EDIT
bOk = bOk AndAlso (m_CN.DGeneralFunctions_WriteCncMode(1) = 0)
' Attesa opportuna
System.Threading.Thread.Sleep(100)
' Attivazione programma 901
bOk = bOk AndAlso (m_CN.ActivateProgram("901") = 0)
' Attesa opportuna
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nThreadSleep)
End If
' riprovo ad eseguire il programma 900
bOk = True
bOk = bOk AndAlso (m_CN.Download_NC_prog(sCncPath, sNumProg) = 0)
' Attesa opportuna
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nThreadSleep)
End If
EgtOutLog("Nc Type : " & m_nNCType.ToString)
'EgtOutLog("IsDripFeed : " & DirectCast(m_CN, NumNCOld).bIsDripFeed)
' AXIUM (NUM OLD): se DripFeed non esegluo attivazione programma)
If m_nNCType = 1 AndAlso TypeOf m_CN Is NumNCOld AndAlso DirectCast(m_CN, NumNCOld).bIsDripFeed Then
' eventauli cambi di stato sono trattati all'interno della funzione
' eventauli cambi di stato sono trattati all'interno della funzione DownLoad_NC_prog
Return True
End If
EgtOutLog(TimeSpanEnd())
' Attesa opportuna
System.Threading.Thread.Sleep(100)
' -------------- END DOWNLOAD --------------
' -------------- START ACTIVATE --------------
' Se richiesta attivazione
If bActivate Then
' Attivazione programma
EgtOutLog("ActivateProgram(nNumProg)")
TimeSpanInit()
' Se controllo FANUC attivo la modalità EDIT prima di attivare il programma
If m_nNCType = 4 Then
bOk = bOk AndAlso (m_CN.DGeneralFunctions_WriteCncMode(1) = 0)
' Attesa opportuna
System.Threading.Thread.Sleep(100)
End If
bOk = bOk AndAlso (m_CN.ActivateProgram(nNumProg) = 0)
EgtOutLog(TimeSpanEnd())
' Attesa opportuna
System.Threading.Thread.Sleep(100)
' Se controllo FANUC attivo la modalità AUTO prima per preparar il cyclo start
If m_nNCType = 4 Then
bOk = bOk AndAlso (m_CN.DGeneralFunctions_WriteCncMode(0) = 0)
' Attesa opportuna
System.Threading.Thread.Sleep(100)
End If
' Attivo la modalità AUTO prima per preparar il cyclo start
bOk = bOk AndAlso (m_CN.DGeneralFunctions_WriteCncMode(0) = 0)
' Attesa opportuna
System.Threading.Thread.Sleep(100)
' Modalità automatica
EgtOutLog("DGeneralFunctions_WriteCncMode(0)")
TimeSpanInit()
' Se controllo di verso da FANUC provvedo a mandare in modo AUTO il controllo
If m_nNCType <> 4 Then
bOk = bOk AndAlso (m_CN.DGeneralFunctions_WriteCncMode(0) = 0)
End If
EgtOutLog(TimeSpanEnd())
End If
' -------------- END ACTIVATE --------------
' Messaggio con risultato
If bOk Then
m_CurrProjPage.SetInfoMessage(EgtMsg(90317)) 'Programma CN trasmesso con successo
+70 -63
View File
@@ -8,7 +8,7 @@ Public MustInherit Class CN_generico
Public Const MAX_VAR As Short = 100
Public Const MAX_VALUES As Short = 9 ' Max. index to read the data from the FXServer array
Public Const MAX_TOOLS As Short = 100
Public Const NUM_DATA = 55 ' Numero di dati del CN (Speed,Feed,...)
Public Const NUM_DATA = 56 ' Numero di dati del CN (Speed,Feed,...)
Public m_NewVariable As Boolean = False ' per scrittura delle vairbaili Apllication del PLC
@@ -70,16 +70,18 @@ Public MustInherit Class CN_generico
Parking = 52
EnableZone = 53
EnablePC = 54
nAxes = 55
End Enum
Public Enum Type As Short
TBoolean = 0
TInteger = 1
TLong = 2
TDouble = 3
TString = 4
Public Enum Type As Short
TBoolean = 0
TInteger = 1
TLong = 2
TDouble = 3
TString = 4
End Enum
End Enum
#End Region
#Region " Struct"
@@ -217,47 +219,52 @@ Public MustInherit Class CN_generico
Public bFeedHold As Boolean
Public bSpeedHold As Boolean
' Nuovi di bottoni -------------------------------------------
Public bXYJog As Boolean
Public bZCJog As Boolean
Public bZBCJog As Boolean
' Nuovi di bottoni -------------------------------------------
Public bXYJog As Boolean
Public bZCJog As Boolean
Public bZBCJog As Boolean
Public bPowerON As Boolean
Public bRemote As Boolean
' Nuovi di bottoni -------------------------------------------
Public bPowerON As Boolean
Public bRemote As Boolean
' Nuovi di bottoni -------------------------------------------
Public nMachineMode As Integer
' usato nel FANUC per leggere lo stato macchina se 5 assi attivo
Public b5AxesActive As Boolean
Public m_szCnDataVar(NUM_DATA - 1) As String
'
' nuovi dal 29-III-2023 per Fanuc
'
Public n_Base_addr_int_vars As Integer
Public n_Base_addr_byte_for_bits_vars As Integer
Public n_num_var_int_to_read As Short
Public n_num_var_byte_for_bits_to_read As Short
'
' Eventi
'
Public Event NewPositionData(ByVal sender As Object)
Public Event NewPosDeltaData(ByVal sender As Object)
Public Event NewVarChanged(ByVal sender As Object)
Public nMachineMode As Integer
Protected Overridable Sub OnNewPositionData()
RaiseEvent NewPositionData(0)
End Sub
Protected Overridable Sub OnNewPosDeltaData()
RaiseEvent NewPosDeltaData(0)
End Sub
Protected Overridable Sub OnNewVarChanged()
RaiseEvent NewVarChanged(0)
End Sub
Public m_szCnDataVar(NUM_DATA - 1) As String
'
' nuovi dal 29-III-2023 per Fanuc
'
Public n_Base_addr_int_vars As Integer = 59800
Public n_Base_addr_byte_for_bits_vars As Integer = 59820
Public n_num_var_int_to_read As Short = 10
Public n_num_var_byte_for_bits_to_read As Short = 30
Public s_addr_set_nc_mode As String = "D59825"
Public s_addr_feedhold As String = "D59850.6"
'
' Eventi
'
Public Event NewPositionData(ByVal sender As Object)
Public Event NewPosDeltaData(ByVal sender As Object)
Public Event NewVarChanged(ByVal sender As Object)
Protected Overridable Sub OnNewPositionData()
RaiseEvent NewPositionData(0)
End Sub
Protected Overridable Sub OnNewPosDeltaData()
RaiseEvent NewPosDeltaData(0)
End Sub
Protected Overridable Sub OnNewVarChanged()
RaiseEvent NewVarChanged(0)
End Sub
#End Region
#Region " Metodi pubblici"
Public MustOverride Function Init() As Boolean
Public MustOverride Function Init() As Boolean
Public MustOverride Function Stop_Connection() As Boolean
@@ -311,8 +318,8 @@ Public MustInherit Class CN_generico
Public MustOverride Function DTool_set_read_range(n_start As Short, n_stop As Short) As Short
Public MustOverride Function DTool_write_tool(n_tool_number As Short, Length_X As Double, Radius As Double, TipRadius_Z As Double, _
DLength_X As Double, DTipRadius_Z As Double, _
Public MustOverride Function DTool_write_tool(n_tool_number As Short, Length_X As Double, Radius As Double, TipRadius_Z As Double,
DLength_X As Double, DTipRadius_Z As Double,
nDirection As Short, nType As Short, nH As Integer) As Short
Public Overridable Function SetProgramMainOrSub(bMain As Boolean) As Boolean
@@ -360,32 +367,32 @@ Public MustInherit Class CN_generico
#Region " Nuovi metodi pubblici"
Public Overridable Function NC_read_var_short(VarAddr As String, ByRef value As Short) As Boolean
Return False
End Function
Public Overridable Function NC_read_var_short(VarAddr As String, ByRef value As Short) As Boolean
Return False
End Function
Public Overridable Function NC_read_var_short_range(VarStartAddr As String, VarEndAddr As String, ByRef values() As Short) As Boolean
Return False
End Function
Public Overridable Function NC_read_var_short_range(VarStartAddr As String, VarEndAddr As String, ByRef values() As Short) As Boolean
Return False
End Function
Public Overridable Function NC_write_var_short(VarAddr As String, ByRef value As Short) As Boolean
Return False
End Function
Public Overridable Function NC_write_var_short(VarAddr As String, ByRef value As Short) As Boolean
Return False
End Function
Public Overridable Function NC_read_var_bit(VarAddr As String, ByRef value As Boolean) As Boolean
Return False
End Function
Public Overridable Function NC_read_var_bit(VarAddr As String, ByRef value As Boolean) As Boolean
Return False
End Function
Public Overridable Function NC_write_var_bit(VarAddr As String, ByRef value As Boolean) As Boolean
Return False
End Function
Public Overridable Function NC_write_var_bit(VarAddr As String, ByRef value As Boolean) As Boolean
Return False
End Function
Public Overridable Function NC_pulse_bit(VarAddr As String) As Boolean
Return False
End Function
Public Overridable Function Geppo() As Boolean
Return False
End Function
Public Overridable Function NC_pulse_bit(VarAddr As String) As Boolean
Return False
End Function
Public Overridable Function Geppo() As Boolean
Return False
End Function
#End Region
+22 -8
View File
@@ -128,7 +128,7 @@ Namespace Fanuc
End Select
Dim bret As Boolean = NC_write_var_short("D59825", CShort(n_mode))
Dim bret As Boolean = NC_write_var_short(s_addr_set_nc_mode, CShort(n_mode))
If Not bret Then
EgtOutLog("Error in set_NC_mode(" & n_mode.ToString() & ")")
@@ -225,8 +225,11 @@ Namespace Fanuc
Dim nret As Int16 = -1
If NC_pulse_bit(s_addr_feedhold) Then
nret = 0
End If
'nret = StopNC(n_portNC)
Return nret
End Function
@@ -243,7 +246,10 @@ Namespace Fanuc
' is G24 active ?
'
Public Overrides Function Is_G24_active() As Boolean
Return (0)
' leggo lo stato di una variabile caricata dall'elenco NcData del file ini macchina
Return b5AxesActive
End Function
#End Region
@@ -549,11 +555,11 @@ Namespace Fanuc
Private Sub Init_NC_var_structures()
' STAI ATTENTO !!!
n_Base_addr_int_vars = 59800
n_Base_addr_byte_for_bits_vars = 59820
n_num_var_int_to_read = 10
n_num_var_byte_for_bits_to_read = 30
' n_Base_addr_int_vars = 59800
' n_Base_addr_byte_for_bits_vars = 59820
' n_num_var_int_to_read = 10
' n_num_var_byte_for_bits_to_read = 30
' s_addr_set_nc_mode = "D59825"
Dim sz_t As String, sz_data_type As String = "", n_address As Integer, n_bit As Integer
@@ -788,6 +794,9 @@ Namespace Fanuc
Case CnData.Parking ' (52)
bParkingState = b_temp
Case CnData.nAxes ' (55)
b5AxesActive = b_temp
End Select
Next
@@ -941,6 +950,8 @@ Namespace Fanuc
MyBase.OnNewPosDeltaData()
End If
Return 0
End Function
#End Region
@@ -1269,6 +1280,9 @@ Namespace Fanuc
Case "D"
Return PMCAreaType.D_AREA
Case Else
Return -1
End Select
End Function
+14
View File
@@ -567,6 +567,11 @@ Public Class SimulationPageUC
End Sub
Private Sub GenerateXPIUC_Click(sender As Object, e As RoutedEventArgs)
' se il bottone Shift è premuto apro il file CadCut1 nel programma NotePad
Dim IsPressedShiftKey As Boolean = False
If Keyboard.Modifiers And ModifierKeys.Shift Then
IsPressedShiftKey = True
End If
Dim bOk As Boolean = True
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
' Elimino eventuale attrezzaggio da OmagOFFICE
@@ -669,6 +674,15 @@ Public Class SimulationPageUC
Else
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
End If
' procedo all'apertura del file CadCut1 apenna generato (solo se generazione corretta)
If bOk And IsPressedShiftKey Then
Try
Process.Start("Notepad.exe", sCncPath)
Catch ex As Exception
EgtOutLog(ex.ToString)
End Try
End If
End Sub
Private Function ProcessEvents(nProg As Integer, nPause As Integer) As Integer