diff --git a/M_MMFiles.vb b/M_MMFiles.vb index 830e8e2..d8cd45d 100644 --- a/M_MMFiles.vb +++ b/M_MMFiles.vb @@ -8,6 +8,7 @@ Imports Microsoft.Win32.SafeHandles Imports System.Runtime.ConstrainedExecution Imports System.Runtime.InteropServices Imports System.ComponentModel +Imports EgtUILib #End Region @@ -251,7 +252,7 @@ Module M_MMFiles End If Catch ex As Exception - + EgtOutLog("Errore nell'init dell'm_mmFiles") End Try End Sub @@ -294,7 +295,7 @@ Module M_MMFiles End If Catch ex As Exception - + EgtOutLog("Errore nella stop connection dell'm_mmFiles") End Try End Function @@ -303,131 +304,136 @@ Module M_MMFiles '---------------------------------------------------------------------------------------------------------- ' Function ActivateProgram(ByVal sz_part_program As String) As Short + EgtOutLog("ActivateProgram start dell'm_mmFiles") SiemensSend.n_Command = CMD.CMD_ActivateProgram SiemensSend.sz_string = sz_part_program Call execute_command() - + EgtOutLog("ActivateProgram end dell'm_mmFiles") Return SiemensRet.n_result End Function Function Delete_NC_prog(ByVal sz_filename As String) As Short + EgtOutLog("Delete_NC_prog start dell'm_mmFiles") SiemensSend.n_Command = CMD.CMD_Delete_NC_prog SiemensSend.sz_string = sz_filename Call execute_command() - + EgtOutLog("Delete_NC_prog end dell'm_mmFiles") Return SiemensRet.n_result End Function Function CycleStart() As Short + EgtOutLog("CycleStart start dell'm_mmFiles") SiemensSend.n_Command = CMD.CMD_CycleStart Call execute_command() - + EgtOutLog("CycleStart end dell'm_mmFiles") Return SiemensRet.n_result End Function Function FeedHold() As Short + EgtOutLog("FeedHold start dell'm_mmFiles") SiemensSend.n_Command = CMD.CMD_FeedHold Call execute_command() - + EgtOutLog("FeedHold end dell'm_mmFiles") Return SiemensRet.n_result End Function Function Reset() As Short + EgtOutLog("Reset start dell'm_mmFiles") SiemensSend.n_Command = CMD.CMD_Reset Call execute_command() - + EgtOutLog("Reset end dell'm_mmFiles") Return SiemensRet.n_result End Function Function WriteCncMode(ByVal nmode As Short) As Short - + EgtOutLog("WriteCncMode start dell'm_mmFiles") SiemensSend.n_Command = CMD.CMD_WriteCncMode SiemensSend.n_param1 = nmode Call execute_command() - + EgtOutLog("WriteCncMode end dell'm_mmFiles") Return SiemensRet.n_result End Function Function Download_NC_prog(ByVal sz_Pc_file_name As String, ByVal sz_NC_filen As String) As Short - + EgtOutLog("Download_NC_prog start dell'm_mmFiles") SiemensSend.n_Command = CMD.CMD_Download_NC_prog SiemensSend.sz_string = sz_Pc_file_name SiemensSend.sz_string_2 = sz_NC_filen Call execute_command() - + EgtOutLog("Download_NC_prog end dell'm_mmFiles") Return SiemensRet.n_result End Function Function DPOsition_ReadOnce() As Short - + EgtOutLog("DPOsition_ReadOnce single dell'm_mmFiles") End Function Function MDI_command(sz_command As String) As Short - + EgtOutLog("MDI_command start dell'm_mmFiles") SiemensSend.n_Command = CMD.CMD_MDI_command SiemensSend.sz_string = sz_command Call execute_command() - + EgtOutLog("MDI_command end dell'm_mmFiles") Return SiemensRet.n_result End Function Sub set_OP_OM(ByVal n As Short) - + EgtOutLog("set_OP_OM start dell'm_mmFiles") SiemensSend.n_Command = CMD.CMD_set_OP_OM SiemensSend.n_param1 = n Call execute_command() - + EgtOutLog("set_OP_OM end dell'm_mmFiles") End Sub Function read_active_mode() As Int16 - + EgtOutLog("read_active_mode start dell'm_mmFiles") SiemensSend.n_Command = CMD.CMD_read_active_mode Call execute_command() - + EgtOutLog("read_active_mode end dell'm_mmFiles") Return SiemensRet.n_result End Function Function Is_G24_active() As Boolean - + EgtOutLog("Is_G24_active single dell'm_mmFiles") End Function Function Is_G71_active() As Boolean - + EgtOutLog("Is_G71_active single dell'm_mmFiles") End Function Function Read_Nc_var(n_var As Short) As Short - + EgtOutLog("Read_Nc_var start dell'm_mmFiles") SiemensSend.n_Command = CMD.CMD_Read_Nc_var SiemensSend.n_param1 = n_var Call execute_command() m_MainWindow.m_CNCommunication.m_CN.d_DReadELS_value = SiemensRet.d_param1 - + EgtOutLog("Read_Nc_var end dell'm_mmFiles") Return SiemensRet.n_result End Function @@ -494,7 +500,7 @@ Module M_MMFiles End While Catch ex As Exception - MsgBox("Errore in M_MMFiles execute command") + EgtOutLog("Errore nell'esecuzione di un comando" & ex.ToString) End Try End Sub @@ -588,7 +594,7 @@ Module M_MMFiles End If Catch ex As Exception - + EgtOutLog("Errore nella lettura delle quote e simili variabili" & ex.ToString) End Try End Sub diff --git a/MachineStatusUC.xaml.vb b/MachineStatusUC.xaml.vb index a5a3b0a..207f4d5 100644 --- a/MachineStatusUC.xaml.vb +++ b/MachineStatusUC.xaml.vb @@ -129,7 +129,11 @@ Public Class MachineStatusUC End Sub Sub DisplaySpeed() - SpeedTxBx.Text = DoubleToString(m_CN.d_spindle_eff(0), 0) + If m_MainWindow.m_CNCommunication.m_nNCType = 3 Then 'se controllo Siemens + SpeedTxBx.Text = DoubleToString(m_CN.d_spindle_prog(0), 0) + Else + SpeedTxBx.Text = DoubleToString(m_CN.d_spindle_eff(0), 0) + End If SpeedOverrideTxBx.Text = DoubleToString(m_CN.n_spindle_override(0), 0) & "%" End Sub