OmagCUT :

- correzione scrittura variabili booleane su Fanuc
- modificata gestione Power per Fanuc (ora gestisce anche Short senza segno fino a 65535 quindi 65.535 Ampere).
This commit is contained in:
Dario Sassi
2026-03-27 11:12:11 +01:00
parent 55bb27e40f
commit d962c43e0c
5 changed files with 625 additions and 617 deletions
+583 -585
View File
File diff suppressed because it is too large Load Diff
+36 -29
View File
@@ -106,46 +106,53 @@ Module VarMdiCommand
System.Threading.Thread.Sleep(100)
' salvo la stringa di comando ricevuta dal file lua
CurrCN.sz_ManualDataInput = CmdString
' esguo la funzione che ha il compito di scrivere il comando MDI
' eseguo la funzione che ha il compito di scrivere il comando MDI
CurrCN.MDI_command()
End If
' attivo modalità Manuale
CurrCN.DGeneralFunctions_WriteCncMode(7)
System.Threading.Thread.Sleep(100)
If String.IsNullOrWhiteSpace(sEValue) Then
' EActive: impulsivo "D#####"
CurrCN.NC_pulse_bit(sENumber)
EgtOutLog("Fanuc : DNumber=" & sENumber)
Else
' EActive + EValue: scrittura comando invariabile Short oppure Bit
If sENumber.Contains(".") Then
' D#####.#
Dim bEValue As Boolean
If sEValue.Trim = "0" Then bEValue = False
CurrCN.NC_write_var_bit(sENumber, bEValue)
' eventuale caricamento prima variabile
If Not String.IsNullOrEmpty(sENumber) Then
If String.IsNullOrWhiteSpace(sEValue) Then
' EActive: impulsivo "D#####"
CurrCN.NC_pulse_bit(sENumber)
EgtOutLog("Fanuc : DNumber=" & sENumber)
Else
' D#####
CurrCN.NC_write_var_short(sENumber, CShort(sEValue))
' EActive + EValue: scrittura comando invariabile Short oppure Bit
If sENumber.Contains(".") Then
' D#####.#
Dim bEValue As Boolean = ( sEValue.Trim <> "0")
CurrCN.NC_write_var_bit(sENumber, bEValue)
Else
' D#####
CurrCN.NC_write_var_short(sENumber, CShort(sEValue))
End If
EgtOutLog("Fanuc : DNumber=" & sENumber & " DValue=" & sEValue)
End If
EgtOutLog("Fanuc : DNumber=" & sENumber & " DValue=" & sEValue)
Else
EgtOutLog("Fanuc : DNumber=NullOrEmpty")
End If
' eventale caricamento seconda variabile
If String.IsNullOrWhiteSpace(sEValue2) Then
' EActive: impulsivo "D#####"
CurrCN.NC_pulse_bit(sENumber2)
EgtOutLog("Fanuc : DNumber2=" & sENumber2)
Else
' EActive + EValue: scrittura comando invariabile Short oppure Bit
If sENumber2.Contains(".") Then
' D#####.#
Dim bEValue2 As Boolean
If sEValue2.Trim = "0" Then bEValue2 = False
CurrCN.NC_write_var_bit(sENumber2, bEValue2)
If Not String.IsNullOrEmpty(sENumber2) Then
If String.IsNullOrWhiteSpace(sEValue2) Then
' EActive: impulsivo "D#####"
CurrCN.NC_pulse_bit(sENumber2)
EgtOutLog("Fanuc : DNumber2=" & sENumber2)
Else
' D#####
CurrCN.NC_write_var_short(sENumber2, CShort(sEValue2))
' EActive + EValue: scrittura comando invariabile Short oppure Bit
If sENumber2.Contains(".") Then
' D#####.#
Dim bEValue2 As Boolean = ( sEValue2.Trim <> "0")
CurrCN.NC_write_var_bit(sENumber2, bEValue2)
Else
' D#####
CurrCN.NC_write_var_short(sENumber2, CShort(sEValue2))
End If
EgtOutLog("Fanuc : DNumber2=" & sENumber2 & " DValue2=" & sEValue2)
End If
EgtOutLog("Fanuc : DNumber2=" & sENumber2 & " DValue2=" & sEValue2)
Else
EgtOutLog("Fanuc : DNumber2=NullOrEmpty")
End If
Return
Case Else ' Demo
+1 -1
View File
@@ -351,7 +351,7 @@ Public Class AlarmsPageUC
' Flag per nesting automatico
AutomaticChBx.IsChecked = (GetPrivateProfileInt(S_NEST, K_AUTOMATICOPTIMIZE, 0, m_MainWindow.GetIniFile()) <> 0)
AdjustGhigliottinaTextOnAutomaticOrCompleteCuts()
' Flag per inserire la puasa dopo la sgrossatura delle cornici
' Flag per inserire la pausa dopo la sgrossatura delle cornici
If m_CurrentMachine.bSawRoughing Then
FrameGpBx.Visibility = Visibility.Visible
FramePauseChBx.IsChecked = (GetPrivateProfileInt(S_MACH_FRAME, K_MACH_PAUSE, 1, m_MainWindow.GetMachIniFile()) <> 0)
+4 -1
View File
@@ -648,8 +648,11 @@ Namespace Fanuc
d_spindle_eff(0) = CDbl(n_temp)
Case CnData.SpeedOvr ' (5) Potenziom. speed = ...
n_spindle_override(0) = n_temp
Case CnData.Power ' (6) Ampère = * 0.01
Case CnData.Power ' (6) Ampère = * 0.001
d_spindle_power = CDbl(n_temp)
If d_spindle_power < 0 Then
d_spindle_power = 65536 + d_spindle_power
End If
b_spindle_power_changed = True
Case CnData.PowerOvr ' (10) valore assorbimento massimo mandrino con l'utensile corrente
bPowerOvr = CDbl(n_temp)
+1 -1
View File
@@ -439,7 +439,7 @@ Public Class CurrentProjectPageUC
m_dRawHeight = 0
UpdateHeightTxBx()
' prima di parcheggiare svuoto dei pezzi in parcheggio sia vuota
m_MainWindow.m_CadCutPageUC.m_NestPage.ResetListOfGruopInPark()
m_MainWindow.m_CadCutPageUC.m_NestPage.ResetListOfGroupInPark()
' Parcheggio correttamente i pezzi precedentemente salvati
Dim nIdList As New List(Of Integer)
Dim nStatList As New List(Of Integer)