diff --git a/DirectCuts/ControlsMachineButtonUC.xaml.vb b/DirectCuts/ControlsMachineButtonUC.xaml.vb index 949c8f9..828fedc 100644 --- a/DirectCuts/ControlsMachineButtonUC.xaml.vb +++ b/DirectCuts/ControlsMachineButtonUC.xaml.vb @@ -475,7 +475,7 @@ Public MustInherit Class MachineButton If m_CN.m_NewVariable And m_MainWindow.m_CNCommunication.m_nNCType = 2 Then ' solo per Flexium m_CN.DPlcVariables_WriteVariables(ENumber, EValue) - If Not IsNothing(ENumber2) And Not IsNothing(EValue2) Then + If Not String.IsNullOrEmpty(ENumber2) And Not String.IsNullOrEmpty(EValue2) Then m_CN.DPlcVariables_WriteVariables(ENumber2, EValue2) End If ' altrimenti scrittura delle variabili E diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index 16e9762..ff00a98 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -62,5 +62,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + diff --git a/NcComm/M_Num.vb b/NcComm/M_Num.vb index 0a1f50e..08c7416 100644 --- a/NcComm/M_Num.vb +++ b/NcComm/M_Num.vb @@ -1578,6 +1578,13 @@ Namespace Num End Sub Public Overrides Sub DPlcVariables_WriteVariables(sz_var_names As String, sz_values As String) + Try + Dim shortNumber As Short = CShort(sz_values) + Catch ex As Exception + EgtOutLog("Errore di conversione dato: " & sz_var_names) + EgtOutLog(ex.ToString) + Return + End Try Dim _ret As Short = objDPlcVariables.WriteVariables(sz_var_names, CShort(sz_values)) If _ret <> 0 Then EgtOutLog("Scrittura " & sz_var_names & " fallita")