diff --git a/CVCncLib/ApplicationEvents.vb b/CVCncLib/ApplicationEvents.vb
new file mode 100644
index 00000000..5f282702
--- /dev/null
+++ b/CVCncLib/ApplicationEvents.vb
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/CVCncLib/CVCncLib.vbproj b/CVCncLib/CVCncLib.vbproj
new file mode 100644
index 00000000..c012923e
--- /dev/null
+++ b/CVCncLib/CVCncLib.vbproj
@@ -0,0 +1,788 @@
+
+
+
+ Debug
+ AnyCPU
+ 9.0.30729
+ 2.0
+ {DC6B309E-F8E9-4BA2-A621-4F617C072533}
+ WinExe
+ testSam.My.MyApplication
+ testSam
+ testSam
+ 512
+ WindowsForms
+ v4.0
+ On
+ Binary
+ Off
+ On
+ arstcomm.ico
+ My Project\app.manifest
+ publish\
+ true
+ Disk
+ false
+ Foreground
+ 7
+ Days
+ false
+ false
+ true
+ 0
+ 1.0.0.%2a
+ false
+ false
+ true
+
+
+
+
+ 3.5
+ Client
+
+
+ true
+ full
+ true
+ true
+ .\
+ testSam.xml
+ 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355
+ x86
+
+
+ pdbonly
+ false
+ true
+ true
+ .\
+ testSam.xml
+ 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355
+
+
+ true
+ true
+ true
+ .\
+ testSam.xml
+ 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355
+ full
+ x86
+ MinimumRecommendedRules.ruleset
+
+
+ true
+ bin\x86\Release\
+ testSam.xml
+ true
+ 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355
+ pdbonly
+ x86
+ MinimumRecommendedRules.ruleset
+
+
+
+ .\CndexLinkDotNet.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 3.5
+
+
+ 3.5
+
+
+ 3.5
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Form
+
+
+ FrmMain.vb
+ Form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ True
+ Application.myapp
+
+
+ True
+ True
+ Resources.resx
+
+
+ True
+ Settings.settings
+ True
+
+
+ True
+ True
+ Reference.svcmap
+
+
+ True
+ True
+ Reference.map
+
+
+
+
+ FrmMain.vb
+ Designer
+
+
+ VbMyResourcesResXFileCodeGenerator
+ Resources.Designer.vb
+ My.Resources
+ Designer
+
+
+
+
+ Designer
+
+
+
+ MyApplicationCodeGenerator
+ Application.Designer.vb
+
+
+ SettingsSingleFileGenerator
+ My
+ Settings.Designer.vb
+ Designer
+
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.svcmap
+
+
+ Reference.map
+
+
+ Reference.map
+
+
+ Reference.map
+
+
+ Reference.map
+
+
+ Reference.map
+
+
+ Reference.map
+
+
+ Reference.map
+
+
+ Reference.map
+
+
+ Reference.map
+
+
+ Reference.map
+
+
+ Reference.map
+
+
+ Reference.map
+
+
+ Reference.map
+
+
+ Reference.map
+
+
+ Reference.map
+
+
+ Reference.map
+
+
+ Reference.map
+
+
+ Reference.map
+
+
+ Reference.map
+
+
+
+ Reference.map
+
+
+ Reference.map
+
+
+ Reference.map
+
+
+ MSDiscoCodeGenerator
+ Reference.vb
+
+
+ Reference.map
+
+
+ Reference.map
+
+
+ Reference.map
+
+
+ Reference.map
+
+
+ Reference.map
+
+
+
+
+ False
+ .NET Framework Client Profile
+ false
+
+
+ False
+ .NET Framework 2.0 %28x86%29
+ false
+
+
+ False
+ .NET Framework 3.0 %28x86%29
+ false
+
+
+ False
+ .NET Framework 3.5
+ false
+
+
+ False
+ .NET Framework 3.5 SP1
+ true
+
+
+ False
+ Windows Installer 3.1
+ true
+
+
+
+
+
+ WCF Proxy Generator
+ Reference.vb
+ Designer
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Dynamic
+ Web References\WebReference\
+ http://192.168.0.1:8080/%3fwsdl
+
+
+
+
+ MySettings
+ d_prod_WebReference_OPENcontrol
+
+
+
+
+
\ No newline at end of file
diff --git a/CVCncLib/Config/testSam.INI b/CVCncLib/Config/testSam.INI
new file mode 100644
index 00000000..628938a2
--- /dev/null
+++ b/CVCncLib/Config/testSam.INI
@@ -0,0 +1,107 @@
+
+[General]
+
+Program path =M:\Cnc\DDF\doo2\Skinned.ddf
+allowed ext = .ddf
+temp path = c:\door_pro\temp
+w7 = true
+
+[Debug]
+
+'!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+debug = false
+
+
+verbose = true
+test_nc = false
+
+[Log]
+enabled = true
+Log file = c:\door_pro\temp\log
+
+[NC]
+No WinNBI = false
+name = 192.168.157.2
+NC state = 29
+Prog1 ok = 350
+Prog2 ok = 351
+
+OpenControl= true
+
+program_to_send = 1
+
+;;;;default_path = c:\Users\carlo\Documents\Projects\vs2008\door_pro\door_pro\temp
+
+;;default_path = PROGRA1\\
+
+;;default_path = UPP\UPP\PROGRA1
+
+default_path = C:\door_pro\temp
+
+ODD_name = P1000
+EVEN_name = P2000
+
+[BarCode]
+fields = 1
+MASK = 111111111111111xxxxxx
+PreProcessing = "="
+
+
+[SerialBarCodeReader]
+enabled = false
+Port = 1
+Settings=9600,None,8,1
+
+[UsbBarCodeReader]
+enabled = true
+
+[Table]
+enabled = false
+file = c:\door_pro\table.dat
+
+
+[Direct]
+enabled = false
+pre = C:\door_pro\programs\
+post = .cnc
+
+[Select]
+enabled = true
+p_arguments = " 2"
+c_arguments = " 2"
+
+L var 1 = 916
+L var 2 = 919
+
+L value 1 on = 1
+L value 1 off = 0
+L value 2 on = 2
+L value 2 off = 2
+
+timeout = 600
+
+NC probe file path = m:\Cnc\DDF\
+NC probe file ext = dat
+
+fixed probe file = true
+NC_probe_file = UPP\PROGRA1\data.prb
+read DDF file = true
+prop1 = properties:
+prop2 = skinned
+
+
+[CAM]
+enabled = false
+program = "c:\Program Files (x86)\Egaltech\EgtCAM5\EgtCAM5R32.exe"
+datapath = "m:\cnc\ddf"
+dataext = ".ddf"
+arguments = " 2"
+return_file_ext = txt
+probe_file_ext = prb
+
+
+[Key]
+
+Customer=CARLO
+regkey =0292-9BE9-0369-D384
+regkey2=CD20-3DD6-006D-0383
diff --git a/CVCncLib/FrmMain.Designer.vb b/CVCncLib/FrmMain.Designer.vb
new file mode 100644
index 00000000..a550c775
--- /dev/null
+++ b/CVCncLib/FrmMain.Designer.vb
@@ -0,0 +1,426 @@
+
+Partial Class FrmMain
+ Inherits System.Windows.Forms.Form
+
+ 'Form overrides dispose to clean up the component list.
+
+ Protected Overrides Sub Dispose(ByVal disposing As Boolean)
+ Try
+ If disposing AndAlso components IsNot Nothing Then
+ components.Dispose()
+ End If
+ Finally
+ MyBase.Dispose(disposing)
+ End Try
+ End Sub
+
+ 'Required by the Windows Form Designer
+ Private components As System.ComponentModel.IContainer
+
+ 'NOTE: The following procedure is required by the Windows Form Designer
+ 'It can be modified using the Windows Form Designer.
+ 'Do not modify it using the code editor.
+
+ Private Sub InitializeComponent()
+ Me.components = New System.ComponentModel.Container()
+ Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FrmMain))
+ Me.LblConnected = New System.Windows.Forms.Label()
+ Me.BtnExit = New System.Windows.Forms.Button()
+ Me.Tmr_Main = New System.Windows.Forms.Timer(Me.components)
+ Me.FolderBrowserDialog1 = New System.Windows.Forms.FolderBrowserDialog()
+ Me.BtnSim0 = New System.Windows.Forms.Button()
+ Me.BtnSim1 = New System.Windows.Forms.Button()
+ Me.BtnSim2 = New System.Windows.Forms.Button()
+ Me.BtnSim3 = New System.Windows.Forms.Button()
+ Me.BtnSim4 = New System.Windows.Forms.Button()
+ Me.BtnSim5 = New System.Windows.Forms.Button()
+ Me.LblSimPrgSent1 = New System.Windows.Forms.Label()
+ Me.LblSimPrgSent2 = New System.Windows.Forms.Label()
+ Me.LblNcStatus = New System.Windows.Forms.Label()
+ Me.LblCurrentProgram = New System.Windows.Forms.Label()
+ Me.LblProgramName = New System.Windows.Forms.Label()
+ Me.LblMachineStatus = New System.Windows.Forms.Label()
+ Me.LblMachState = New System.Windows.Forms.Label()
+ Me.BtnReadOldOsai = New System.Windows.Forms.Button()
+ Me.LblReadOldOsai = New System.Windows.Forms.Label()
+ Me.BtnWrite1OldOsai = New System.Windows.Forms.Button()
+ Me.BtnWrite2OldOsai = New System.Windows.Forms.Button()
+ Me.BtnWrite3OldOsai = New System.Windows.Forms.Button()
+ Me.BtnWrite4OldOsai = New System.Windows.Forms.Button()
+ Me.BtnWrite5OldOsai = New System.Windows.Forms.Button()
+ Me.Btn_test_file = New System.Windows.Forms.Button()
+ Me.OpenFileDialog1 = New System.Windows.Forms.OpenFileDialog()
+ Me.Lbl_sw_phase = New System.Windows.Forms.Label()
+ Me.Label1 = New System.Windows.Forms.Label()
+ Me.LblMapoIOB = New System.Windows.Forms.Label()
+ Me.SuspendLayout()
+ '
+ 'LblConnected
+ '
+ Me.LblConnected.AllowDrop = True
+ Me.LblConnected.AutoSize = True
+ Me.LblConnected.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
+ Me.LblConnected.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+ Me.LblConnected.Location = New System.Drawing.Point(4, 355)
+ Me.LblConnected.Name = "LblConnected"
+ Me.LblConnected.Size = New System.Drawing.Size(37, 15)
+ Me.LblConnected.TabIndex = 8
+ Me.LblConnected.Text = " "
+ Me.LblConnected.Visible = False
+ '
+ 'BtnExit
+ '
+ Me.BtnExit.Location = New System.Drawing.Point(4, 400)
+ Me.BtnExit.Name = "BtnExit"
+ Me.BtnExit.Size = New System.Drawing.Size(11, 14)
+ Me.BtnExit.TabIndex = 5
+ Me.BtnExit.Text = "Exit"
+ Me.BtnExit.UseVisualStyleBackColor = True
+ Me.BtnExit.Visible = False
+ '
+ 'Tmr_Main
+ '
+ Me.Tmr_Main.Interval = 1000
+ '
+ 'BtnSim0
+ '
+ Me.BtnSim0.Location = New System.Drawing.Point(6, 447)
+ Me.BtnSim0.Name = "BtnSim0"
+ Me.BtnSim0.Size = New System.Drawing.Size(18, 20)
+ Me.BtnSim0.TabIndex = 13
+ Me.BtnSim0.Text = "0"
+ Me.BtnSim0.UseVisualStyleBackColor = True
+ Me.BtnSim0.Visible = False
+ '
+ 'BtnSim1
+ '
+ Me.BtnSim1.Location = New System.Drawing.Point(26, 447)
+ Me.BtnSim1.Name = "BtnSim1"
+ Me.BtnSim1.Size = New System.Drawing.Size(18, 20)
+ Me.BtnSim1.TabIndex = 14
+ Me.BtnSim1.Text = "1"
+ Me.BtnSim1.UseVisualStyleBackColor = True
+ Me.BtnSim1.Visible = False
+ '
+ 'BtnSim2
+ '
+ Me.BtnSim2.Location = New System.Drawing.Point(46, 447)
+ Me.BtnSim2.Name = "BtnSim2"
+ Me.BtnSim2.Size = New System.Drawing.Size(18, 20)
+ Me.BtnSim2.TabIndex = 15
+ Me.BtnSim2.Text = "2"
+ Me.BtnSim2.UseVisualStyleBackColor = True
+ Me.BtnSim2.Visible = False
+ '
+ 'BtnSim3
+ '
+ Me.BtnSim3.Location = New System.Drawing.Point(66, 447)
+ Me.BtnSim3.Name = "BtnSim3"
+ Me.BtnSim3.Size = New System.Drawing.Size(18, 20)
+ Me.BtnSim3.TabIndex = 16
+ Me.BtnSim3.Text = "3"
+ Me.BtnSim3.UseVisualStyleBackColor = True
+ Me.BtnSim3.Visible = False
+ '
+ 'BtnSim4
+ '
+ Me.BtnSim4.Location = New System.Drawing.Point(86, 447)
+ Me.BtnSim4.Name = "BtnSim4"
+ Me.BtnSim4.Size = New System.Drawing.Size(18, 20)
+ Me.BtnSim4.TabIndex = 17
+ Me.BtnSim4.Text = "4"
+ Me.BtnSim4.UseVisualStyleBackColor = True
+ Me.BtnSim4.Visible = False
+ '
+ 'BtnSim5
+ '
+ Me.BtnSim5.Location = New System.Drawing.Point(106, 447)
+ Me.BtnSim5.Name = "BtnSim5"
+ Me.BtnSim5.Size = New System.Drawing.Size(18, 20)
+ Me.BtnSim5.TabIndex = 18
+ Me.BtnSim5.Text = "5"
+ Me.BtnSim5.UseVisualStyleBackColor = True
+ Me.BtnSim5.UseWaitCursor = True
+ Me.BtnSim5.Visible = False
+ '
+ 'LblSimPrgSent1
+ '
+ Me.LblSimPrgSent1.AllowDrop = True
+ Me.LblSimPrgSent1.AutoSize = True
+ Me.LblSimPrgSent1.BackColor = System.Drawing.Color.Blue
+ Me.LblSimPrgSent1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
+ Me.LblSimPrgSent1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+ Me.LblSimPrgSent1.Location = New System.Drawing.Point(130, 452)
+ Me.LblSimPrgSent1.Name = "LblSimPrgSent1"
+ Me.LblSimPrgSent1.Size = New System.Drawing.Size(16, 15)
+ Me.LblSimPrgSent1.TabIndex = 14
+ Me.LblSimPrgSent1.Text = "1"
+ Me.LblSimPrgSent1.Visible = False
+ '
+ 'LblSimPrgSent2
+ '
+ Me.LblSimPrgSent2.AllowDrop = True
+ Me.LblSimPrgSent2.AutoSize = True
+ Me.LblSimPrgSent2.BackColor = System.Drawing.Color.Blue
+ Me.LblSimPrgSent2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
+ Me.LblSimPrgSent2.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+ Me.LblSimPrgSent2.Location = New System.Drawing.Point(152, 451)
+ Me.LblSimPrgSent2.Name = "LblSimPrgSent2"
+ Me.LblSimPrgSent2.Size = New System.Drawing.Size(16, 15)
+ Me.LblSimPrgSent2.TabIndex = 19
+ Me.LblSimPrgSent2.Text = "2"
+ Me.LblSimPrgSent2.Visible = False
+ '
+ 'LblNcStatus
+ '
+ Me.LblNcStatus.AllowDrop = True
+ Me.LblNcStatus.AutoSize = True
+ Me.LblNcStatus.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+ Me.LblNcStatus.Location = New System.Drawing.Point(250, 328)
+ Me.LblNcStatus.Name = "LblNcStatus"
+ Me.LblNcStatus.Size = New System.Drawing.Size(35, 13)
+ Me.LblNcStatus.TabIndex = 26
+ Me.LblNcStatus.Text = " "
+ Me.LblNcStatus.Visible = False
+ '
+ 'LblCurrentProgram
+ '
+ Me.LblCurrentProgram.AllowDrop = True
+ Me.LblCurrentProgram.AutoSize = True
+ Me.LblCurrentProgram.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+ Me.LblCurrentProgram.Location = New System.Drawing.Point(4, 300)
+ Me.LblCurrentProgram.Name = "LblCurrentProgram"
+ Me.LblCurrentProgram.Size = New System.Drawing.Size(155, 16)
+ Me.LblCurrentProgram.TabIndex = 12
+ Me.LblCurrentProgram.Text = "Currently machining : "
+ Me.LblCurrentProgram.TextAlign = System.Drawing.ContentAlignment.MiddleRight
+ Me.LblCurrentProgram.Visible = False
+ '
+ 'LblProgramName
+ '
+ Me.LblProgramName.AllowDrop = True
+ Me.LblProgramName.AutoSize = True
+ Me.LblProgramName.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+ Me.LblProgramName.Location = New System.Drawing.Point(166, 300)
+ Me.LblProgramName.Name = "LblProgramName"
+ Me.LblProgramName.Size = New System.Drawing.Size(53, 16)
+ Me.LblProgramName.TabIndex = 13
+ Me.LblProgramName.Text = "---------"
+ Me.LblProgramName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
+ Me.LblProgramName.Visible = False
+ '
+ 'LblMachineStatus
+ '
+ Me.LblMachineStatus.AllowDrop = True
+ Me.LblMachineStatus.AutoSize = True
+ Me.LblMachineStatus.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+ Me.LblMachineStatus.Location = New System.Drawing.Point(4, 326)
+ Me.LblMachineStatus.Name = "LblMachineStatus"
+ Me.LblMachineStatus.Size = New System.Drawing.Size(125, 16)
+ Me.LblMachineStatus.TabIndex = 14
+ Me.LblMachineStatus.Text = "Machine Status : "
+ Me.LblMachineStatus.TextAlign = System.Drawing.ContentAlignment.MiddleRight
+ Me.LblMachineStatus.Visible = False
+ '
+ 'LblMachState
+ '
+ Me.LblMachState.AllowDrop = True
+ Me.LblMachState.AutoSize = True
+ Me.LblMachState.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+ Me.LblMachState.Location = New System.Drawing.Point(166, 326)
+ Me.LblMachState.Name = "LblMachState"
+ Me.LblMachState.Size = New System.Drawing.Size(53, 16)
+ Me.LblMachState.TabIndex = 15
+ Me.LblMachState.Text = "---------"
+ Me.LblMachState.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
+ Me.LblMachState.Visible = False
+ '
+ 'BtnReadOldOsai
+ '
+ Me.BtnReadOldOsai.Location = New System.Drawing.Point(173, 446)
+ Me.BtnReadOldOsai.Name = "BtnReadOldOsai"
+ Me.BtnReadOldOsai.Size = New System.Drawing.Size(71, 20)
+ Me.BtnReadOldOsai.TabIndex = 32
+ Me.BtnReadOldOsai.Text = "Read var 251"
+ Me.BtnReadOldOsai.UseVisualStyleBackColor = True
+ Me.BtnReadOldOsai.Visible = False
+ '
+ 'LblReadOldOsai
+ '
+ Me.LblReadOldOsai.AllowDrop = True
+ Me.LblReadOldOsai.AutoSize = True
+ Me.LblReadOldOsai.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
+ Me.LblReadOldOsai.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+ Me.LblReadOldOsai.Location = New System.Drawing.Point(250, 450)
+ Me.LblReadOldOsai.Name = "LblReadOldOsai"
+ Me.LblReadOldOsai.Size = New System.Drawing.Size(44, 15)
+ Me.LblReadOldOsai.TabIndex = 33
+ Me.LblReadOldOsai.Text = "12345"
+ Me.LblReadOldOsai.Visible = False
+ '
+ 'BtnWrite1OldOsai
+ '
+ Me.BtnWrite1OldOsai.Location = New System.Drawing.Point(8, 421)
+ Me.BtnWrite1OldOsai.Name = "BtnWrite1OldOsai"
+ Me.BtnWrite1OldOsai.Size = New System.Drawing.Size(38, 20)
+ Me.BtnWrite1OldOsai.TabIndex = 34
+ Me.BtnWrite1OldOsai.Text = "Write1 "
+ Me.BtnWrite1OldOsai.UseVisualStyleBackColor = True
+ Me.BtnWrite1OldOsai.Visible = False
+ '
+ 'BtnWrite2OldOsai
+ '
+ Me.BtnWrite2OldOsai.Location = New System.Drawing.Point(41, 421)
+ Me.BtnWrite2OldOsai.Name = "BtnWrite2OldOsai"
+ Me.BtnWrite2OldOsai.Size = New System.Drawing.Size(38, 20)
+ Me.BtnWrite2OldOsai.TabIndex = 35
+ Me.BtnWrite2OldOsai.Text = "Write2"
+ Me.BtnWrite2OldOsai.UseVisualStyleBackColor = True
+ Me.BtnWrite2OldOsai.Visible = False
+ '
+ 'BtnWrite3OldOsai
+ '
+ Me.BtnWrite3OldOsai.Location = New System.Drawing.Point(74, 421)
+ Me.BtnWrite3OldOsai.Name = "BtnWrite3OldOsai"
+ Me.BtnWrite3OldOsai.Size = New System.Drawing.Size(38, 20)
+ Me.BtnWrite3OldOsai.TabIndex = 36
+ Me.BtnWrite3OldOsai.Text = "Write3"
+ Me.BtnWrite3OldOsai.UseVisualStyleBackColor = True
+ Me.BtnWrite3OldOsai.Visible = False
+ '
+ 'BtnWrite4OldOsai
+ '
+ Me.BtnWrite4OldOsai.Location = New System.Drawing.Point(108, 420)
+ Me.BtnWrite4OldOsai.Name = "BtnWrite4OldOsai"
+ Me.BtnWrite4OldOsai.Size = New System.Drawing.Size(38, 20)
+ Me.BtnWrite4OldOsai.TabIndex = 37
+ Me.BtnWrite4OldOsai.Text = "Write4"
+ Me.BtnWrite4OldOsai.UseVisualStyleBackColor = True
+ Me.BtnWrite4OldOsai.Visible = False
+ '
+ 'BtnWrite5OldOsai
+ '
+ Me.BtnWrite5OldOsai.Location = New System.Drawing.Point(140, 421)
+ Me.BtnWrite5OldOsai.Name = "BtnWrite5OldOsai"
+ Me.BtnWrite5OldOsai.Size = New System.Drawing.Size(38, 20)
+ Me.BtnWrite5OldOsai.TabIndex = 38
+ Me.BtnWrite5OldOsai.Text = "Write5"
+ Me.BtnWrite5OldOsai.UseVisualStyleBackColor = True
+ Me.BtnWrite5OldOsai.Visible = False
+ '
+ 'Btn_test_file
+ '
+ Me.Btn_test_file.Location = New System.Drawing.Point(188, 420)
+ Me.Btn_test_file.Name = "Btn_test_file"
+ Me.Btn_test_file.Size = New System.Drawing.Size(56, 20)
+ Me.Btn_test_file.TabIndex = 39
+ Me.Btn_test_file.Text = "send file"
+ Me.Btn_test_file.UseVisualStyleBackColor = True
+ Me.Btn_test_file.Visible = False
+ '
+ 'OpenFileDialog1
+ '
+ Me.OpenFileDialog1.FileName = "OpenFileDialog1"
+ '
+ 'Lbl_sw_phase
+ '
+ Me.Lbl_sw_phase.AllowDrop = True
+ Me.Lbl_sw_phase.AutoSize = True
+ Me.Lbl_sw_phase.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+ Me.Lbl_sw_phase.Location = New System.Drawing.Point(92, 355)
+ Me.Lbl_sw_phase.Name = "Lbl_sw_phase"
+ Me.Lbl_sw_phase.Size = New System.Drawing.Size(35, 13)
+ Me.Lbl_sw_phase.TabIndex = 44
+ Me.Lbl_sw_phase.Text = " "
+ Me.Lbl_sw_phase.Visible = False
+ '
+ 'Label1
+ '
+ Me.Label1.AutoSize = True
+ Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+ Me.Label1.ForeColor = System.Drawing.SystemColors.Highlight
+ Me.Label1.Location = New System.Drawing.Point(6, 29)
+ Me.Label1.Name = "Label1"
+ Me.Label1.Size = New System.Drawing.Size(127, 15)
+ Me.Label1.TabIndex = 45
+ Me.Label1.Text = "BITMAP IOB MAPO"
+ '
+ 'LblMapoIOB
+ '
+ Me.LblMapoIOB.AutoSize = True
+ Me.LblMapoIOB.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+ Me.LblMapoIOB.ForeColor = System.Drawing.SystemColors.Highlight
+ Me.LblMapoIOB.Location = New System.Drawing.Point(12, 54)
+ Me.LblMapoIOB.Name = "LblMapoIOB"
+ Me.LblMapoIOB.Size = New System.Drawing.Size(19, 15)
+ Me.LblMapoIOB.TabIndex = 46
+ Me.LblMapoIOB.Text = "..."
+ '
+ 'FrmMain
+ '
+ Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
+ Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
+ Me.ClientSize = New System.Drawing.Size(302, 476)
+ Me.Controls.Add(Me.LblMapoIOB)
+ Me.Controls.Add(Me.Label1)
+ Me.Controls.Add(Me.Lbl_sw_phase)
+ Me.Controls.Add(Me.Btn_test_file)
+ Me.Controls.Add(Me.BtnWrite5OldOsai)
+ Me.Controls.Add(Me.BtnWrite4OldOsai)
+ Me.Controls.Add(Me.BtnWrite3OldOsai)
+ Me.Controls.Add(Me.BtnWrite2OldOsai)
+ Me.Controls.Add(Me.BtnWrite1OldOsai)
+ Me.Controls.Add(Me.LblReadOldOsai)
+ Me.Controls.Add(Me.BtnReadOldOsai)
+ Me.Controls.Add(Me.LblMachState)
+ Me.Controls.Add(Me.LblNcStatus)
+ Me.Controls.Add(Me.LblMachineStatus)
+ Me.Controls.Add(Me.LblProgramName)
+ Me.Controls.Add(Me.LblCurrentProgram)
+ Me.Controls.Add(Me.LblConnected)
+ Me.Controls.Add(Me.LblSimPrgSent2)
+ Me.Controls.Add(Me.LblSimPrgSent1)
+ Me.Controls.Add(Me.BtnSim5)
+ Me.Controls.Add(Me.BtnSim4)
+ Me.Controls.Add(Me.BtnSim3)
+ Me.Controls.Add(Me.BtnSim2)
+ Me.Controls.Add(Me.BtnSim1)
+ Me.Controls.Add(Me.BtnSim0)
+ Me.Controls.Add(Me.BtnExit)
+ Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
+ Me.Name = "FrmMain"
+ Me.Text = "Door Pro"
+ Me.ResumeLayout(False)
+ Me.PerformLayout()
+
+ End Sub
+ Friend WithEvents BtnExit As System.Windows.Forms.Button
+ Friend WithEvents LblConnected As System.Windows.Forms.Label
+ Friend WithEvents Tmr_Main As System.Windows.Forms.Timer
+ Friend WithEvents FolderBrowserDialog1 As System.Windows.Forms.FolderBrowserDialog
+ Friend WithEvents BtnSim0 As System.Windows.Forms.Button
+ Friend WithEvents BtnSim1 As System.Windows.Forms.Button
+ Friend WithEvents BtnSim2 As System.Windows.Forms.Button
+ Friend WithEvents BtnSim3 As System.Windows.Forms.Button
+ Friend WithEvents BtnSim4 As System.Windows.Forms.Button
+ Friend WithEvents BtnSim5 As System.Windows.Forms.Button
+ Friend WithEvents LblSimPrgSent1 As System.Windows.Forms.Label
+ Friend WithEvents LblSimPrgSent2 As System.Windows.Forms.Label
+ Friend WithEvents LblNcStatus As System.Windows.Forms.Label
+ Friend WithEvents LblCurrentProgram As System.Windows.Forms.Label
+ Friend WithEvents LblProgramName As System.Windows.Forms.Label
+ Friend WithEvents LblMachineStatus As System.Windows.Forms.Label
+ Friend WithEvents LblMachState As System.Windows.Forms.Label
+ Friend WithEvents BtnReadOldOsai As Button
+ Friend WithEvents LblReadOldOsai As Label
+ Friend WithEvents BtnWrite1OldOsai As Button
+ Friend WithEvents BtnWrite2OldOsai As Button
+ Friend WithEvents BtnWrite3OldOsai As Button
+ Friend WithEvents BtnWrite4OldOsai As Button
+ Friend WithEvents BtnWrite5OldOsai As Button
+ Friend WithEvents Btn_test_file As Button
+ Friend WithEvents OpenFileDialog1 As OpenFileDialog
+ Friend WithEvents Lbl_sw_phase As Label
+ Friend WithEvents Label1 As Label
+ Friend WithEvents LblMapoIOB As Label
+End Class
diff --git a/CVCncLib/FrmMain.resx b/CVCncLib/FrmMain.resx
new file mode 100644
index 00000000..4c5975c8
--- /dev/null
+++ b/CVCncLib/FrmMain.resx
@@ -0,0 +1,150 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ 121, 17
+
+
+ 226, 17
+
+
+ 397, 17
+
+
+ 72
+
+
+
+
+ AAABAAEAICAQAAAAAADoAgAAFgAAACgAAAAgAAAAQAAAAAEABAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAwMDAAICAgAAAAP8AAP8AAAD//wD/AAAA/wD/AP//
+ AAD///8A/////4iIiIj//////////////4gAAAAIiP////////////gAERiAAAiP//////////+AERE4
+ gxAAj//////////4ARF3u7uzAIj/////////gBF3u7u7u3AI////////+AEfu7u7O7u3CP////////AR
+ +7uzu7u7uwj///////+AH7u7u7u7O7sIj///////AXu7u7uzu7u/MI///////wF7u7u7i7uz/zCP////
+ //8Lu7u7uLODP/+wiIj/////C7u7u4s4+P//cAEYj/////C7u7uzj4iP//MAAYj////wu7u7uPiIi//7
+ u7GI/////wu7u7v4iLs/9zu7D/////8Lu7u7v4uz+P8wAA//////8Au7u7u7P4iPCI/////////wC7u7
+ u/iIAQCP//////////AAALu/gRgQiP////////////8Lu7CBgQj/////////////8Lu7CBgAj///////
+ //////C7+wCBEI//////////////AAD/ARgI//////////////////CBGI//////////////////ARCI
+ //////////////////ARCIj/////////////////ARCIj/////////////////AQAAD/////////////
+ ////AAAA//////////////////AAAP//////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQ==
+
+
+
\ No newline at end of file
diff --git a/CVCncLib/FrmMain.vb b/CVCncLib/FrmMain.vb
new file mode 100644
index 00000000..b6ff588f
--- /dev/null
+++ b/CVCncLib/FrmMain.vb
@@ -0,0 +1,367 @@
+Imports System
+Imports System.IO
+Imports System.Collections
+Imports Microsoft.VisualBasic
+
+Public Class FrmMain
+
+
+ Public Const VERSION_ID = "1"
+
+ Public b_timer_busy As Boolean
+ Public n_simulated_index As Integer = 0
+
+ Public sz_usb_barcode_string As String
+
+
+ Dim b_exit_busy As Boolean = False
+
+
+ Public Sub New()
+
+ ' This call is required by the Windows Form Designer.
+ InitializeComponent()
+
+ End Sub
+
+ Private Sub My_initialize() Handles Me.Load
+
+ Call CheckForExistingInstance()
+
+ Me.Show()
+
+ ' read ini file & init global variables
+ Call IniRead.Ini_read()
+
+ ' read messages
+ Call Message.init()
+
+ ' init logger on file
+ Call Log.init(IniRead.szLogFileName)
+
+ Call Log.write("-----------START PROGRAM test Sam -------------------")
+
+
+ ' init modules
+ Call Init_Modules()
+
+ ' Init NC connection
+ Call M_cn_connection.StartConnection()
+
+ ' check NC connection reading a ver and waiting
+ Call M_cn_connection.CheckConnection()
+
+ ' timer enable
+ Call Timer_enable()
+
+ End Sub
+
+#Region " Closing...."
+
+ Private Sub Dispose_form(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Me.Disposed
+
+ Call Terminate_properly()
+
+ End Sub
+
+ Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
+
+ Call Terminate_properly()
+
+ End Sub 'Form1_Closing
+
+ Sub Terminate_properly()
+
+ If Not b_exit_busy Then
+
+ b_exit_busy = True
+
+ Timer_disable()
+
+ System.Threading.Thread.Sleep(SLEEP_TIME)
+
+ If (Not IniRead.b_debug) Then
+
+ If Not (CnOsai Is Nothing) Then
+ CnOsai.CloseSession()
+ End If
+
+ End If
+
+
+ Application.Exit()
+
+ End If ' busy
+
+ End Sub
+
+#End Region
+
+#Region " Buttons"
+
+
+
+ Private Sub BtnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnExit.Click
+
+ Call Terminate_properly()
+
+ End Sub
+
+
+
+
+
+
+#End Region
+
+#Region " Init routines"
+
+ Private Sub Init_Modules()
+
+ Call M_state_machine.init()
+
+ Call M_aspect.init()
+
+ End Sub
+
+ Public Sub CheckForExistingInstance()
+ '~~> Get number of processes of you program
+ If Process.GetProcessesByName(Process.GetCurrentProcess.ProcessName).Length > 1 Then
+ MessageBox.Show("Another copy of this program is already running",
+ "More than 1 copy not allowed", MessageBoxButtons.OK,
+ MessageBoxIcon.Exclamation)
+
+ Application.Exit()
+ End If
+ End Sub
+
+#End Region
+
+#Region " Timer"
+
+ ' -------------------------------------------------------------------------------
+ ' ---- Enable Timer
+ ' -------------------------------------------------------------------------------
+ Private Sub Timer_enable()
+
+ ' set timer interval
+ Tmr_Main.Interval = IniRead.lTimerInterval
+
+ ' Enable Timer
+ Tmr_Main.Enabled = True
+
+ End Sub
+
+ ' -------------------------------------------------------------------------------
+ ' ---- DisAble timer
+ ' -------------------------------------------------------------------------------
+ Private Sub Timer_disable()
+
+ Tmr_Main.Enabled = False
+
+ End Sub
+
+ '_____________________________________________________________________________
+
+ ' -------------------------------------------------------------------------------
+ ' ---- Tick timer d,... ------
+ ' -------------------------------------------------------------------------------
+ Private Sub Tmr_Main_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Tmr_Main.Tick
+
+ If Not b_timer_busy Then
+
+ b_timer_busy = True
+ Tmr_Main.Enabled = False
+
+ Call M_state_machine.go()
+
+
+ b_timer_busy = False
+ Tmr_Main.Enabled = True
+ End If
+
+ End Sub
+
+#End Region
+
+#Region " Simulation "
+
+ Private Sub BtnSim0_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnSim0.Click
+ n_simulated_index = 0
+ Call gray_them_all()
+ BtnSim0.BackColor = Color.LightCoral
+ End Sub
+ Private Sub BtnSim1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnSim1.Click
+ n_simulated_index = 1
+ Call gray_them_all()
+ BtnSim1.BackColor = Color.LightCoral
+ End Sub
+ Private Sub BtnSim2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnSim2.Click
+ n_simulated_index = 2
+ Call gray_them_all()
+ BtnSim2.BackColor = Color.LightCoral
+ End Sub
+ Private Sub BtnSim3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnSim3.Click
+ n_simulated_index = 3
+ Call gray_them_all()
+ BtnSim3.BackColor = Color.LightCoral
+ End Sub
+ Private Sub BtnSim4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnSim4.Click
+ n_simulated_index = 4
+ Call gray_them_all()
+ BtnSim4.BackColor = Color.LightCoral
+ End Sub
+ Private Sub BtnSim5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnSim5.Click
+ n_simulated_index = 5
+ Call gray_them_all()
+ BtnSim5.BackColor = Color.LightCoral
+ End Sub
+
+ Private Sub gray_them_all()
+ BtnSim0.BackColor = Color.LightGray
+ BtnSim1.BackColor = Color.LightGray
+ BtnSim2.BackColor = Color.LightGray
+ BtnSim3.BackColor = Color.LightGray
+ BtnSim4.BackColor = Color.LightGray
+ BtnSim5.BackColor = Color.LightGray
+ End Sub
+
+ Private Sub LblSimPrgSent1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LblSimPrgSent1.Click
+ LblSimPrgSent1.BackColor = Color.Azure
+ End Sub
+ Private Sub LblSimPrgSent2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LblSimPrgSent2.Click
+ LblSimPrgSent2.BackColor = Color.Azure
+ End Sub
+
+ Private Sub BtnReadOldOsai_Click(sender As Object, e As EventArgs) Handles BtnReadOldOsai.Click
+ Dim Var_tmp As ComCNOsai.stVAR
+
+ Var_tmp.nAddress = IniRead.nVar_NC_state
+ Var_tmp.nBit = 0 ' solo x evitare warning ...
+ Var_tmp.nNumCn = 1 ' solo x evitare warning ...
+ Var_tmp.szVarName = "" ' solo x evitare warning ...
+
+
+ LblReadOldOsai.Text = CnOsai.ReadShortVar(Var_tmp).ToString
+
+ End Sub
+
+ Private Sub BtnWrite1OldOsai_Click(sender As Object, e As EventArgs) Handles BtnWrite1OldOsai.Click
+ Dim Var_tmp As ComCNOsai.stVAR
+
+ Var_tmp.nAddress = IniRead.nVar_NC_state
+ Var_tmp.nBit = 0 ' solo x evitare warning ...
+ Var_tmp.nNumCn = 1 ' solo x evitare warning ...
+ Var_tmp.szVarName = "" ' solo x evitare warning ...
+
+ CnOsai.WriteShortVar(Var_tmp, 1)
+
+ End Sub
+ Private Sub BtnWrite2OldOsai_Click(sender As Object, e As EventArgs) Handles BtnWrite2OldOsai.Click
+ Dim Var_tmp As ComCNOsai.stVAR
+
+ Var_tmp.nAddress = IniRead.nVar_NC_state
+ Var_tmp.nBit = 0 ' solo x evitare warning ...
+ Var_tmp.nNumCn = 1 ' solo x evitare warning ...
+ Var_tmp.szVarName = "" ' solo x evitare warning ...
+
+ CnOsai.WriteShortVar(Var_tmp, 2)
+ End Sub
+ Private Sub BtnWrite3OldOsai_Click(sender As Object, e As EventArgs) Handles BtnWrite3OldOsai.Click
+ Dim Var_tmp As ComCNOsai.stVAR
+
+ Var_tmp.nAddress = IniRead.nVar_NC_state
+ Var_tmp.nBit = 0 ' solo x evitare warning ...
+ Var_tmp.nNumCn = 1 ' solo x evitare warning ...
+ Var_tmp.szVarName = "" ' solo x evitare warning ...
+
+ CnOsai.WriteShortVar(Var_tmp, 3)
+ End Sub
+ Private Sub BtnWrite4OldOsai_Click(sender As Object, e As EventArgs) Handles BtnWrite4OldOsai.Click
+ Dim Var_tmp As ComCNOsai.stVAR
+
+ Var_tmp.nAddress = IniRead.nVar_NC_state
+ Var_tmp.nBit = 0 ' solo x evitare warning ...
+ Var_tmp.nNumCn = 1 ' solo x evitare warning ...
+ Var_tmp.szVarName = "" ' solo x evitare warning ...
+
+ CnOsai.WriteShortVar(Var_tmp, 4)
+ End Sub
+ Private Sub BtnWrite5OldOsai_Click(sender As Object, e As EventArgs) Handles BtnWrite5OldOsai.Click
+ Dim Var_tmp As ComCNOsai.stVAR
+
+ Var_tmp.nAddress = IniRead.nVar_NC_state
+ Var_tmp.nBit = 0 ' solo x evitare warning ...
+ Var_tmp.nNumCn = 1 ' solo x evitare warning ...
+ Var_tmp.szVarName = "" ' solo x evitare warning ...
+
+ CnOsai.WriteShortVar(Var_tmp, 5)
+ End Sub
+
+ Private Sub Btn_test_file_Click(sender As Object, e As EventArgs) Handles Btn_test_file.Click
+
+ Dim sz_geppo_filename As String = IniRead.sz_temporary_path & "\geppo.cn"
+ Dim sz_NC_program_name As String
+
+ If (IniRead.b_send_file) Then
+
+ sz_geppo_filename = Ask_file()
+ sz_NC_program_name = Path.GetFileNameWithoutExtension(sz_geppo_filename)
+ sz_NC_program_name = IniRead.szDefaultPathNC & "\" & sz_NC_program_name
+ my_f_____copy_file_to_nc(sz_geppo_filename, sz_NC_program_name)
+
+ Else
+
+ ' crea un filettino e lo manda
+ Dim Writer As New StreamWriter(sz_geppo_filename) ' Opens stream and begins writing
+
+ Writer.WriteLine("; ")
+ Writer.WriteLine("; Ciao Mamma !")
+ Writer.WriteLine("; ")
+ Writer.WriteLine("; saluti da Geppo")
+ Writer.WriteLine("G00")
+ Writer.WriteLine("M00")
+
+ Writer.Close()
+
+ Call CnOsai.CopyFileToNC("", sz_geppo_filename, "GEPPO")
+
+ System.IO.File.Delete(sz_geppo_filename) ' sempre per non far nulla ....
+
+ End If
+
+
+ End Sub
+
+ Function Ask_file() As String
+
+ Dim sz_filename As String = ""
+
+ Try
+ With OpenFileDialog1
+
+ If .ShowDialog() = Windows.Forms.DialogResult.OK Then
+
+ sz_filename = .FileName
+ End If
+
+ End With
+ Catch ex As Exception
+ MsgBox(ex.Message, MsgBoxStyle.Exclamation, Me.Text)
+ End Try
+
+ Return sz_filename
+
+ End Function
+
+#End Region
+
+
+
+
+
+
+
+End Class
+
+
diff --git a/CVCncLib/Messages/testSam.msg b/CVCncLib/Messages/testSam.msg
new file mode 100644
index 00000000..0e952f6e
--- /dev/null
+++ b/CVCncLib/Messages/testSam.msg
@@ -0,0 +1,131 @@
+(0) - Message file !!!!
+Impossible to find the '
+(2)
+(3)
+(4)
+(5)
+(6)
+(7)
+ connecting to
+(9)
+Nc connection
+NOT CONNECTED
+NC connect ok
+CANNOT CONNECT (2)
+(14)
+(15)
+(16)
+(17)
+(18)
+(19)
+d_prod - composing programs
+Exit
+Clear
+Start !
+STOP !
+Select DDF File
+No Probing -
+Basic Probing -
+Advanced Probing -
+(29)
+(30)
+(31)
+(32)
+waiting for end probing
+Program queue
+Job List
+Currently machining :
+Machine Status :
+Next program :
+processing
+sending
+selecting
+creating probing path
+Creating
+Copying probe data
+waiting machine to get ready......
+Not Ready
+Ready
+end machining
+machining
+(50)
+(51)
+(52)
+(53)
+(54)
+(55)
+(56)
+(57)
+(58)
+(59)
+missing code
+code
+ not found in table
+file
+file not found
+Clear program queue
+Are you sure ?
+removing program :
+ not found
+Program :
+(70)
+(71)
+(72)
+Problem activating MAINAUTO program
+Please stop the running program !!
+Problem copying
+program
+Please deactivate the running program !!
+(78)
+(79)
+(80)
+(81)
+(82)
+(83)
+(84)
+(85)
+(86)
+(87)
+(88)
+(89)
+Ok
+Cancel
+(92)
+(93)
+(94)
+(95)
+(96)
+(97)
+(98)
+(99)
+(100)
+(101)
+(102)
+(103)
+(104)
+(105)
+(106)
+(107)
+(108)
+(109)
+(110)
+(111)
+(112)
+(113)
+(114)
+(115)
+(116)
+Yes
+No
+(119)
+(120)
+(121)
+(122)
+(123)
+(124)
+(125)
+(126)
+(127)
+(128)
+(129)
+
diff --git a/CVCncLib/Modules/CndexLinkUserVB6.vb b/CVCncLib/Modules/CndexLinkUserVB6.vb
new file mode 100644
index 00000000..cc852aaf
--- /dev/null
+++ b/CVCncLib/Modules/CndexLinkUserVB6.vb
@@ -0,0 +1,717 @@
+Option Strict Off
+Option Explicit On
+
+Module CndexLinkUserVB6
+ ' OSAI S.p.A. Barone Canavese (Torino) Italy
+ '
+ ' file: CndexLinkUser.BAS
+ ' version: 3.0
+ '
+ '
+ ' Errors management
+ '
+ ' The DLL CndexLink uses the return code of the function and two double words
+ ' for the error management. The double words are the class of the error and
+ ' the error code.
+ ' The return code of the functions is always a boolean. True means that the
+ ' function has been executed without error, False means error during function
+ ' execution.
+ ' When the return code is False the parameters ErrClass and ErrNum report the
+ ' codes related to the error
+ '
+ ' The errors has been organized using classes to avoid error codes overlap
+ ' Each class identify a level in the hierarchy of the modules used to
+ ' communicate with the CNC
+ ' For the error classes and error codes error definition please refer to the
+ ' Cndex server interface documentation.
+ ' The following codes could be not updated to last Cndex server version.
+ '
+ '
+ ' The classes are the following:
+ '
+ ' COM Class (class 1)
+ ' The errors belonging to this class are generated by the COM interface
+ ' that is used to carry out the calls to Cndex server.
+ '
+ ' CNDEX SERVER Class (class 2)
+ ' The errors belonging to this class can be generated either by the preliminary
+ ' checks done by Cndex server on the called functions parameters or by internal
+ ' errors of the server.
+ '
+ ' NETBIOS Class (class 3)
+ ' The errors belonging to this class depend by anomalies or errors during
+ ' data exchange between Cndex server and the managed CNC connected through
+ ' local network.
+ '
+ ' CNC Class (class 4)
+ ' The errors belonging to this class are generated by the elaboration of the
+ ' commads by the CNC connected to Cndex.
+ '
+ ' CNDEX INTERFACE Class (class 10)
+ ' The errors belonging to this class are generated by CndexInterface DLL that
+ ' is used to interface Cndex server.
+ '
+ '
+ ' Error codes for COM classe (class 1)
+ '
+ ' Questo e ' un elenco degli errori COM piu' comuni
+ '
+ ' CO_E_SERVER_EXEC_FAILURE 0x80080005
+ ' Su Windows 95/98 il server non puo' essere lanciato automaticamente ma bisogna
+ ' metterlo in esecuzione manualmente, ricordando che quando non c'e' piu' nessuna
+ ' applicazione attiva il server viene terminato automaticamente.
+ '
+ ' RPC_S_SERVER_UNAVAILABLE 0x800706ba
+ ' · assicurarsi che nel registry il valore del parametro sia Y
+ ' · aggiungere o attivare il protocollo TCP/IP nella configurazione di rete
+ '
+ ' E_ACCESSDENIED 0x80070005
+ ' Su Windows NT/2000 lanciare l'utility dcomcnfg.exe e selezionare
+ ' o nella sezione identity dell'applicazione cndex,
+ ' ed nella sezione di launch permission
+ '
+ ' REGDB_E_CLASSNOTREG 0x80040154
+ ' Il server Cndex non e' stato registrato nel registry di Windows. Registrarlo con
+ ' questo comando da eseguire in un DOS shell : cndex.exe /regserver
+ '
+ ' CO_S_NOTALLINTERFACES 0x00080012
+ ' La DLL proxy del server Cndex non e' stata registrata nel registry di Windows.
+ ' Registrarla con questo comando da eseguire in un DOS shell : regsvr32 cndexps.dll
+ '
+ '
+ '
+ ' Error codes for CNDEX SERVER classe (class 2)
+ '
+ ' 1 No memory for dynamic memory allocation
+ ' 2 Error creating syncronization events
+ ' 3 Session aborted. It can not be used anymore.
+ ' 4 Session not opened
+ ' 5 It is not possible to allocate a network channel
+ ' 6 It has been activated a function for an unexisting CNC process.
+ ' 7 Broadcasting command aborted
+ ' 8 User output buffer too small
+ ' 9 Session already opened
+ ' 10 Broadcasting list not valid
+ ' 11 Realtime command aborted
+ ' 12 The function is already active
+ ' 13 The function is not active yet
+ ' 14 Reciving thread terminated
+ ' 15 Time-out. No answer (after an establish time) to the command sent to CNC.
+ ' 16 The software release of the connected CNC is not compatible with the Cndex server protocol
+ ' 17 The given session identifier is not valid
+ ' 18 It is not possible to create the real-time thread
+ ' 19 No network session channels available anymore
+ ' 20 Error loading CNC symbols
+ ' 23 It is not possible to create an instance of the session object
+ ' 24 It is not possible to create the broadcasting thread
+ ' 25 The function can not be executed during this phase of the CNC boot
+ ' 26 Wrong parameter
+ ' 27 Buffer not valid
+ ' 29 The UserSession parameter is not valid (there is not a correspondig session)
+ ' 31 The UserSession parameter is either not valid or the corrisponding session has
+ ' automatically been closed by Cndex server.
+ '
+ '
+ ' Error codes for NETBIOS class (class 3)
+ '
+ ' 0x0001 Illegal buffer length
+ ' 0x0003 Illegal command
+ ' 0x0005 Command timed out
+ ' 0x0006 Message incomplete, issue another command
+ ' 0x0007 Illegal buffer address
+ ' 0x0008 Session number out of range
+ ' 0x0009 No resource available
+ ' 0x000a Session closed
+ ' 0x000b Command cancelled
+ ' 0x000d Duplicate name
+ ' 0x000e Name table full
+ ' 0x000f No deletions, name has active sessions
+ ' 0x0011 Local session table full
+ ' 0x0012 Remote session table full
+ ' 0x0013 Illegal name number
+ ' 0x0014 No callname
+ ' 0x0015 Cannot put * in NCB_NAME
+ ' 0x0016 Name in use on remote adapter
+ ' 0x0017 Name deleted
+ ' 0x0018 Session ended abnormally
+ ' 0x0019 Name conflict detected
+ ' 0x0021 Interface busy, IRET before retrying
+ ' 0x0022 Too many commands outstanding, retry later
+ ' 0x0023 Ncb_lana_num field invalid
+ ' 0x0024 Command completed while cancel occurring
+ ' 0x0026 Command not valid to cancel
+ ' 0x0030 Name defined by anther local process
+ ' 0x0034 Environment undefined. RESET required
+ ' 0x0035 Required OS resources exhausted
+ ' 0x0036 Max number of applications exceeded
+ ' 0x0037 No saps available for netbios
+ ' 0x0038 Requested resources are not available
+ ' 0x0039 Invalid ncb address or length > segment
+ ' 0x003B Invalid NCB DDID
+ ' 0x003C Lock of user area failed
+ ' 0x003f NETBIOS not loaded
+ ' 0x0040 System error
+ '
+ '
+ '
+ ' Error codes for CNC class (class 4)
+ '
+ ' For the error codes related to this class please refer to
+ ' "MINI-DNC ETHERNET Functions Library" and "USER MANUAL" of the
+ ' 10/Series CNC
+ '
+ '
+ '
+ ' Error codes for CNDEX INTERFACE class (class 10)
+ '
+ ' 1 ERR_SERVER_ALREADY_CREATED CNDEX server already created
+ ' 2 ERR_CREATING_SERVER_OBJECT Error creating CNDEX server
+ ' 3 ERR_SERVER_NOT_CREATED CNDEX server never created or already released
+ ' 4 ERR_INVALID_PARAMETER Invalid value for one or more parameters
+ ' 5 ERR_OPTION_NOT_ENABLED The COMMUNICATION option is not enabled for connected CNC
+
+ Public Const ON_ As Short = 1
+ Public Const OFF_ As Short = 0
+
+ 'Boot phase
+ Public Const EMERG_SWITCH_PHASE As Short = 1
+ Public Const HW_BOOT_PHASE As Short = 2
+ Public Const SW_BOOT_PHASE As Short = 3
+ Public Const SYSTEM_UP_PHASE As Short = 4
+ Public Const SERVER_MODE_PHASE As Short = 5
+ Public Const REMOTE_SETUP_PHASE As Short = 6
+
+ ' Classes of the Process Variables
+ Public Const E_VAR_CLASS As Short = 1
+ Public Const SN_VAR_CLASS As Short = 2
+ Public Const SC_VAR_CLASS As Short = 255
+
+ ' 10 Series modes
+ Public Const MDI As Short = 1
+ 'UPGRADE_NOTE: AUTO è stato aggiornato a AUTO_Renamed. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
+ Public Const AUTO_Renamed As Short = 2
+ Public Const SEMI As Short = 3
+ Public Const MANJOG As Short = 4
+ Public Const INCJOG As Short = 5
+ Public Const PROFILE As Short = 6
+ Public Const HOME As Short = 7
+
+ ' 10 Series Status
+ Public Const IDLE_ As Short = 1
+ Public Const CYCLE_ As Short = 2
+ Public Const HOLDA_ As Short = 3
+ Public Const RUNH_ As Short = 4
+ Public Const HRUN_ As Short = 5
+ Public Const ERRO_ As Short = 6
+ Public Const WAIT_ As Short = 7
+ Public Const RESET_ As Short = 8
+ Public Const EMERG_ As Short = 9
+ Public Const INPUT_ As Short = 10
+
+ ' 10 Series SubStatus
+ Public Const MAS As Short = 6
+ Public Const MBR As Short = 4
+
+ Public Const NUM_ELEM_SEL_AXI As Short = 9
+
+ ' Axes Position type selector
+ Public Const PROGPOS As Short = 1 ' Programmed positions
+ Public Const IntPos As Short = 2 ' Interpolated positions
+ Public Const TRANSDPOS As Short = 3 ' Transducer Position
+ Public Const ERRPOS As Short = 4 ' Following Errors
+
+ Public Const MAIN_PROGR_NAME_LEN As Short = 55
+
+ ' Logic variables identifier
+ ' boolean variables
+ Public Const I_CODE As Short = 0
+ Public Const O_CODE As Short = 1
+ Public Const M_CODE As Short = 2
+ Public Const G_CODE As Short = 3
+ Public Const S_CODE As Short = 4
+ Public Const P_CODE As Short = 7
+ Public Const U_CODE As Short = 8
+ ' WORD variables
+ Public Const MW_CODE As Short = 20
+ Public Const GW_CODE As Short = 21
+ Public Const SW_CODE As Short = 22
+ Public Const PW_CODE As Short = 62
+ Public Const UW_CODE As Short = 63
+ 'DOUBLE variables
+ Public Const MD_CODE As Short = 40
+ Public Const GD_CODE As Short = 41
+ Public Const PD_CODE As Short = 43
+ Public Const UD_CODE As Short = 44
+
+
+ ' Tables identifiers
+ Public Const AXIS_TABLE_ID As Short = 1 ' AXIS TABLE identifier
+ Public Const TOOL_TABLE_ID As Short = 2 ' TOOL TABLE identifier
+ Public Const OFFSET_TABLE_ID As Short = 3 ' OFFSET TABLE identifier
+ Public Const USER_TABLE_ID As Short = 4 ' USER TABLE identifier
+
+
+ ' Logical directory identifiers
+ Public Const PPDIR_PROGRAM As Short = 0 ' PROGRAM directory
+ Public Const PPDIR_USER As Short = 1 ' USER directory
+ Public Const PPDIR_SYSTEM As Short = 2 ' SYSTEM directory
+ Public Const PPDIR_OEM As Short = 3 ' OEM directory
+
+
+ Structure GETINTDATA
+ Dim AxisName As Byte
+ Dim Mode As Byte
+ Dim Position As Double
+ Dim TotalOffset As Double
+ End Structure
+
+
+ Structure PROCDATA
+ Dim Mode As Short
+ Dim status As Short
+ Dim substatus As Short
+ End Structure
+
+
+ Structure GetInfo1Data
+ Dim status As Byte ' process status
+ Dim substatus As Byte ' process substatus
+ Dim mode_select As Byte ' selected mode
+ Dim jog_dir As Byte ' 1 = negative 0 = positive
+ Dim speed_ov As Short ' speed override
+ Dim feed_ov As Short ' feed override
+ Dim rap_feed_ov As Short ' rapid feed override
+ Dim man_feed_ov As Short ' manual feed override
+ Dim jog_incr As Double ' incremental jog value
+ Dim num_ax_sel As Byte ' number of selected axes
+ Dim ax_sel() As Byte 'array of selected axes
+ Dim actual_tool As Double ' actual active tool number
+ Dim progr_tool As Double ' programmed tool number
+ Dim actual_tool_off As Short ' actual tool offset number
+ Dim progr_tool_off As Short ' programmed tool offset number
+ Dim real_speed As Double ' real spindle feed
+ Dim progr_speed As Double ' programmed spindle feed
+ Dim progr_feed As Double ' programmed feed
+ Dim rapid_feed As Double ' rapid feed
+ Dim real_feed As Double ' real feed
+ Dim feed_mis_unit As Short ' misure unit of feed
+ 'UPGRADE_WARNING: La dimensione della stringa di lunghezza fissa deve essere contenuta nel buffer. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="3C1E4426-0B80-443E-B943-0627CD55D48B"'
+ Public main_progr_name() As Char ' active main part program name
+ Dim dry_run As Byte ' 1 = dry run modality active
+ Dim rapid_override As Byte ' 1 = rapid ovverride enable
+ Dim disable_slashed_blk As Byte ' 1 = slashed block disable
+ Dim optional_stop As Byte ' 1 = M00 stop enable
+ Dim force_rapid_feed As Byte ' 1 = rapid feed forced
+ Dim auto_jog_ret As Byte ' 1 = automatic jog return mode
+ Dim block_retrace As Byte ' 1 = multi block retrace active
+ Dim last_nc_error As Short ' last NC error. 0 = no error
+ Dim free() As Byte ' free
+
+ 'UPGRADE_TODO: "Initialize" deve essere chiamato per inizializzare istanze di questa struttura. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="B4BFF9E0-8631-45CF-910E-62AB3970F27B"'
+ Public Sub Initialize()
+ ReDim ax_sel(NUM_ELEM_SEL_AXI)
+ ReDim free(22)
+ End Sub
+ End Structure
+
+
+ Structure GetInfo2Data
+ Dim StatusWord As Short
+ Dim Urp As Double
+ Dim ActTool As Double
+ Dim ActOffset As Short
+ Dim ProgTool As Double
+ Dim ProgOffset As Short
+ Dim M_Status As Short
+ Dim M_Value() As Short
+ Dim Ax1Name As Byte
+ Dim Ax1Offset As Double
+ Dim Ax2Name As Byte
+ Dim Ax2Offset As Double
+ Dim Radius As Double
+
+ 'UPGRADE_TODO: "Initialize" deve essere chiamato per inizializzare istanze di questa struttura. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="B4BFF9E0-8631-45CF-910E-62AB3970F27B"'
+ Public Sub Initialize()
+ ReDim M_Value(15)
+ End Sub
+ End Structure
+
+
+ Structure GETBLKNUMDATA
+ Dim ppActNum As Short
+ Dim MainActBlk As Integer
+ Dim Sbr1ActBlk As Integer
+ Dim Sbr2ActBlk As Integer
+ Dim Sbr3ActBlk As Integer
+ Dim Sbr4ActBlk As Integer
+ End Structure
+
+
+ ' Axis Table Descriptor
+ Structure AXIS_TABLE
+ Dim owner As Short ' ambient owner
+ Dim name As Short ' ascii axis name
+ Dim orig As Double ' actual origin
+ Dim free1 As Double ' FREE FIELD
+ Dim ofg92 As Double ' offset G92
+ Dim toff As Double ' actual tool offset
+ Dim free2 As Double ' FREE FIELD
+ Dim Offset As Double ' axis total offset
+ Dim orig1 As Double ' origin 1
+ Dim orig2 As Double ' origin 2
+ Dim orig3 As Double ' origin 3
+ Dim orig4 As Double ' origin 4
+ Dim orig5 As Double ' origin 5
+ Dim orig6 As Double ' origin 6
+ Dim orig7 As Double ' origin 7
+ Dim orig8 As Double ' origin 8
+ Dim orig9 As Double ' origin 9
+ Dim orig10 As Double ' origin 10
+ Dim reserved1 As Short ' reserved
+ Dim reserved2 As Short ' reserved
+ End Structure
+
+
+ ' Tool table descriptor
+ Structure TOOL_TABLE
+ Dim Tcode As Double ' tool code
+ Dim pocket As Short ' pocket position
+ Dim tfamcol As Short ' random family
+ Dim tclass As Short ' tool class
+ Dim tstatus As Short ' status word
+ Dim tcntrl As Short ' control word
+ Dim maxtime As Double ' start life
+ Dim remtime As Double ' actual life
+ Dim tuser1 As Double ' user parameter 1
+ Dim tuser2 As Double ' user parameter 2
+ Dim tuser3 As Double ' user parameter 3
+ Dim tuser4 As Double ' user parameter 4
+ Dim tolfnr As Short ' offset number
+ End Structure
+
+
+ ' Offset table descriptor
+ Structure OFFSET_TABLE
+ Dim tactl1 As Double ' actual tool lenght 1
+ Dim tcmaxl1 As Double ' max change lenght 1
+ Dim tcactl1 As Double ' actual change lenght 1
+ Dim tactl2 As Double ' actual tool lenght 2
+ Dim tcmaxl2 As Double ' max change lenght 2
+ Dim tcactl2 As Double ' actual change lenght 2
+ Dim tdiameter As Double ' diameter (ex radius)
+ Dim tcacdiam As Double ' diameter wear (ex tangle)
+ Dim torient As Short ' orientation
+ End Structure
+
+
+ ' User table descriptor
+ Structure USER_TABLE
+ Dim user1 As Double ' user variable 1
+ Dim User2 As Double ' user variable 2
+ Dim user3 As Double ' user variable 3
+ Dim user4 As Double ' user variable 4
+ End Structure
+
+
+ Structure ERR_MSG
+ 'UPGRADE_WARNING: La dimensione della stringa di lunghezza fissa deve essere contenuta nel buffer. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="3C1E4426-0B80-443E-B943-0627CD55D48B"'
+ Public Msg1() As Char
+ 'UPGRADE_WARNING: La dimensione della stringa di lunghezza fissa deve essere contenuta nel buffer. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="3C1E4426-0B80-443E-B943-0627CD55D48B"'
+ 'UPGRADE_NOTE: MSG2 è stato aggiornato a MSG2_Renamed. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
+ Public MSG2_Renamed() As Char
+ 'UPGRADE_WARNING: La dimensione della stringa di lunghezza fissa deve essere contenuta nel buffer. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="3C1E4426-0B80-443E-B943-0627CD55D48B"'
+ 'UPGRADE_NOTE: MSG3 è stato aggiornato a MSG3_Renamed. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
+ Public MSG3_Renamed() As Char
+ 'UPGRADE_WARNING: La dimensione della stringa di lunghezza fissa deve essere contenuta nel buffer. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="3C1E4426-0B80-443E-B943-0627CD55D48B"'
+ Public Msg4() As Char
+ End Structure
+
+
+ Structure PLVARDESC
+ Dim Code As Short
+ Dim Index As Short
+ Dim Bit As Short
+ End Structure
+
+
+ Structure EMCY_TYPE
+ Dim usEmcyErrCode As Short
+ Dim usEmcyErrorReg As Byte
+ Dim SpecErrField As Integer
+ Dim reserved As Byte
+ End Structure
+
+ ''''''' CNDEX SERVER FUNCTIONS PROTOTYPES '''''''
+
+ Declare Function ConnectServer_C Lib "CndexLink.DLL" (ByVal ServerAddress As String, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function ReleaseServer_C Lib "CndexLink.DLL" (ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+
+ ''''''' NET SESSION FUNCTIONS PROTOTYPES '''''''
+
+ Declare Function OpenSession_C Lib "CndexLink.DLL" (ByVal RemoteName As String, ByRef UserSession As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function CloseSession_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+
+ Declare Function IsSessionOpened_C Lib "CndexLink.DLL" (ByVal UserSession As Short) As Short
+
+
+ ''''''' CNC BOOT FUNCTIONS PROTOTYPES '''''''
+
+ Declare Function BootPhaseEnquiry_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByRef Phase As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+
+ Declare Function BootReboot_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+
+ Declare Function BootShutDown_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+
+ Declare Function BootMode_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal Mode As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+
+
+ ''''''' GENERAL FUNCTIONS PROTOTYPES '''''''
+
+ Declare Function GetCodeNumber_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal CodeNumber As String, ByVal SwVersion As String, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+
+ 'UPGRADE_NOTE: Second è stato aggiornato a Second_Renamed. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
+ 'UPGRADE_NOTE: Minute è stato aggiornato a Minute_Renamed. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
+ 'UPGRADE_NOTE: Hour è stato aggiornato a Hour_Renamed. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
+ 'UPGRADE_NOTE: Day è stato aggiornato a Day_Renamed. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
+ 'UPGRADE_NOTE: Month è stato aggiornato a Month_Renamed. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
+ 'UPGRADE_NOTE: Year è stato aggiornato a Year_Renamed. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
+ Declare Function GetDateTime_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByRef Year_Renamed As Short, ByRef Month_Renamed As Short, ByRef Day_Renamed As Short, ByRef Hour_Renamed As Short, ByRef Minute_Renamed As Short, ByRef Second_Renamed As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+
+ 'UPGRADE_NOTE: Second è stato aggiornato a Second_Renamed. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
+ 'UPGRADE_NOTE: Minute è stato aggiornato a Minute_Renamed. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
+ 'UPGRADE_NOTE: Hour è stato aggiornato a Hour_Renamed. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
+ 'UPGRADE_NOTE: Day è stato aggiornato a Day_Renamed. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
+ 'UPGRADE_NOTE: Month è stato aggiornato a Month_Renamed. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
+ 'UPGRADE_NOTE: Year è stato aggiornato a Year_Renamed. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
+ Declare Function SetDateTime_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal Year_Renamed As Short, ByVal Month_Renamed As Short, ByVal Day_Renamed As Short, ByVal Hour_Renamed As Short, ByVal Minute_Renamed As Short, ByVal Second_Renamed As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+
+ Declare Function PPInsertName_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal LogicalName As String, ByVal LogicalExt As String, ByVal LogicalDir As Short, ByVal PhysicalName As String, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function PPDeleteName_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal LogicalName As String, ByVal LogicalExt As String, ByVal LogicalDir As Short, ByRef NumberOfFilesDeleted As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function PPGetLogicalName_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal PhysicalName As String, ByVal LogicalName As String, ByVal LogicalExt As String, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function PPGetPhysicalName_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal LogicalName As String, ByVal LogicalExt As String, ByVal LogicalDir As Short, ByVal PhysicalName As String, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function PPGetLogicalDir_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal LogicalName As String, ByVal LogicalExt As String, ByRef LogicalDir As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function PPUpdate_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal LogicalName As String, ByVal LogicalExt As String, ByVal LogicalDir As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+
+
+ ''''''' PROCESS FUNCTIONS PROTOTYPES '''''''
+
+ Declare Function Cycle_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal Cmd As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function SyncroCycle_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function Reset_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function Hold_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal Cmd As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function SetFeedManOver_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal FeedManOver As Short, ByVal Direction As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function SetFeedRateOver_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal FeedRateOver As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function SetFeedRapidOver_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal FeedRapidOver As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function SetSpeedRateOver_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal SpeedRateOver As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function SetManMovDirection_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal Direction As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function SetMdiString_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal MdiString As String, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function SetProcessMode_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal Mode As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function SelectProcess_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function GetSelectedProcess_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByRef ProcNum As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function SelectProcAxis_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal AxisName As Byte, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function SelectPartProgram_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal PartProgramName As String, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ 'UPGRADE_WARNING: La struttura GETINTDATA potrebbe richiedere attributi di marshalling da passare come argomento a questa istruzione Declare. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
+ Declare Function GetAxesPosition_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal AxisName As Byte, ByVal Selector As Short, ByRef NumAxis As Short, ByRef IntPos As GETINTDATA, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ 'UPGRADE_WARNING: La struttura GetInfo1Data potrebbe richiedere attributi di marshalling da passare come argomento a questa istruzione Declare. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
+ Declare Function GetNcInfo1_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByRef GetInfo1Data As GetInfo1Data, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ 'UPGRADE_WARNING: La struttura GetInfo2Data potrebbe richiedere attributi di marshalling da passare come argomento a questa istruzione Declare. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
+ Declare Function GetNcInfo2_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByRef GetInfo2Data As GetInfo2Data, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ 'UPGRADE_WARNING: La struttura PROCDATA potrebbe richiedere attributi di marshalling da passare come argomento a questa istruzione Declare. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
+ Declare Function GetProcessStatus_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByRef NewMode As PROCDATA, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ 'UPGRADE_WARNING: La struttura GETBLKNUMDATA potrebbe richiedere attributi di marshalling da passare come argomento a questa istruzione Declare. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
+ Declare Function GetBlkNum_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByRef BlkNum As GETBLKNUMDATA, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function AxesRef_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal NumAx As Short, ByRef AxisName As Byte, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function GetVarE_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal Index As Short, ByRef Num As Short, ByRef Values As Double, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function GetVarSN_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal Index As Short, ByRef Num As Short, ByRef Values As Double, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function GetVarSC_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal Index As Short, ByRef Num As Short, ByVal text As String, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function GetVarJOG_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByRef Value As Double, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function GetVarRCM_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByRef Value As Byte, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function SetVarE_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal Index As Short, ByVal Num As Short, ByRef Values As Double, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function SetVarSN_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal Index As Short, ByVal Num As Short, ByRef Value As Double, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function SetVarSC_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal Index As Short, ByVal Num As Short, ByVal text As String, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function SetVarJOG_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal Value As Double, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function SetVarUAS_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal Mode As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function SetVarRCM_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal Mode As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ 'UPGRADE_WARNING: La struttura ERR_MSG potrebbe richiedere attributi di marshalling da passare come argomento a questa istruzione Declare. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
+ Declare Function ReadErrMsg_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByRef SysErrMsg As ERR_MSG, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function ReadPartProgramMsg_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal PartProgramMsg As String, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function GetGCode_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByRef GCode As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function GetMCode_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByRef MCode As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function SkipPProgBlock_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal NumOfBlocks As Integer, ByVal Direction As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function Ese_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal BlockNum As Integer, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+
+
+
+ ''''''' PLC FUNCTIONS PROTOTYPES '''''''
+
+ 'UPGRADE_WARNING: La struttura PLVARDESC potrebbe richiedere attributi di marshalling da passare come argomento a questa istruzione Declare. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
+ Declare Function GetPLVarWord_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal NumVar As Short, ByRef VarDesc As PLVARDESC, ByRef Values As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+ Declare Function GetPLVarWord_M_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal NumVar As Short, ByRef VarDesc As PLVARDESC, ByRef Values() As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ 'UPGRADE_WARNING: La struttura PLVARDESC potrebbe richiedere attributi di marshalling da passare come argomento a questa istruzione Declare. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
+ Declare Function SetPLVarWord_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal NumVar As Short, ByRef VarDesc As PLVARDESC, ByRef Values As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ 'UPGRADE_WARNING: La struttura PLVARDESC potrebbe richiedere attributi di marshalling da passare come argomento a questa istruzione Declare. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
+ Declare Function GetPLVarDouble_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal NumVar As Short, ByRef VarDesc As PLVARDESC, ByRef Values As Double, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ 'UPGRADE_WARNING: La struttura PLVARDESC potrebbe richiedere attributi di marshalling da passare come argomento a questa istruzione Declare. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
+ Declare Function SetPLVarDouble_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal NumVar As Short, ByRef VarDesc As PLVARDESC, ByRef Values As Double, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function GetPLVarAscii_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal Index As Short, ByVal Value As String, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function SetPLVarAscii_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal Index As Short, ByRef Value As String, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function GetPLStreamWord_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal NumVar As Short, ByVal Code As Short, ByVal StartIndex As Short, ByRef Values As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function GetPLStreamDouble_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal NumVar As Short, ByVal Code As Short, ByVal StartIndex As Short, ByRef Values As Double, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function SetPLStreamWord_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal NumVar As Short, ByVal Code As Short, ByVal StartIndex As Short, ByRef Values As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function SetPLStreamDouble_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal NumVar As Short, ByVal Code As Short, ByVal StartIndex As Short, ByRef Values As Double, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function ReadWarningMsg_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal WarningMsg As String, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function CANReadSDO_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal DevNum As Short, ByVal idNode As Byte, ByVal Index As Short, ByVal subIndex As Byte, ByVal timeout As Short, ByVal Sync As Byte, ByRef data As Byte, ByRef DataLen As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function CANWriteSDO_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal DevNum As Short, ByVal idNode As Byte, ByVal Index As Short, ByVal subIndex As Byte, ByVal timeout As Short, ByVal Sync As Byte, ByRef data As Byte, ByRef DataLen As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function CANNMT_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal DevNum As Short, ByVal idNode As Byte, ByVal Cmd As Short, ByVal timeout As Short, ByVal Sync As Byte, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+
+ Declare Function CANSync_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal DevNum As Short, ByVal timeout As Short, ByVal Sync As Byte, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+
+ Declare Function CANInit_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal DevNum As Short, ByVal TickNr As Short, ByVal Inp1 As Short, ByVal Inp2 As Short, ByVal Out1 As Short, ByVal Out2 As Short, ByVal OffsDiagn As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+
+ 'UPGRADE_WARNING: La struttura EMCY_TYPE potrebbe richiedere attributi di marshalling da passare come argomento a questa istruzione Declare. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
+ Declare Function CANGetEmergency_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal DevNum As Short, ByVal idNode As Byte, ByVal timeout As Short, ByVal Sync As Byte, ByRef NodeStatus As Short, ByRef AddInfo As Short, ByRef ProfNum As Short, ByRef NodeStateNG As Short, ByRef ActualErr As Short, ByRef EmcyLen As Short, ByRef EmcyData As EMCY_TYPE, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+
+ Declare Function CANBoard_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal DevNum As Short, ByVal Cmd As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+
+ Declare Function CANConsoleCfg_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal DevNum As Short, ByVal idNode As Byte, ByVal InpOffs As Short, ByVal OutOffs As Short, ByVal timeout As Short, ByVal Sync As Byte, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+
+
+ ''''''' TABLES RELATED FUNCTIONS PROTOTYPES '''''''
+
+ 'UPGRADE_WARNING: La struttura AXIS_TABLE potrebbe richiedere attributi di marshalling da passare come argomento a questa istruzione Declare. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
+ Declare Function GetAxisTabRecord_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal RecordNum As Short, ByRef Record As AXIS_TABLE, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ 'UPGRADE_WARNING: La struttura TOOL_TABLE potrebbe richiedere attributi di marshalling da passare come argomento a questa istruzione Declare. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
+ Declare Function GetToolTabRecord_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal RecordNum As Short, ByRef Record As TOOL_TABLE, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ 'UPGRADE_WARNING: La struttura OFFSET_TABLE potrebbe richiedere attributi di marshalling da passare come argomento a questa istruzione Declare. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
+ Declare Function GetOffsetTabRecord_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal RecordNum As Short, ByRef Record As OFFSET_TABLE, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ 'UPGRADE_WARNING: La struttura USER_TABLE potrebbe richiedere attributi di marshalling da passare come argomento a questa istruzione Declare. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
+ Declare Function GetUserTabRecord_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal RecordNum As Short, ByRef Record As USER_TABLE, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function GetTabFieldDouble_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal TableNum As Short, ByVal RecordNum As Short, ByVal FieldNum As Short, ByRef Value As Double, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function GetTabFieldShort_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal TableNum As Short, ByVal RecordNum As Short, ByVal FieldNum As Short, ByRef Value As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ 'UPGRADE_WARNING: La struttura AXIS_TABLE potrebbe richiedere attributi di marshalling da passare come argomento a questa istruzione Declare. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
+ Declare Function SetAxisTabRecord_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal RecordNum As Short, ByRef Record As AXIS_TABLE, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ 'UPGRADE_WARNING: La struttura TOOL_TABLE potrebbe richiedere attributi di marshalling da passare come argomento a questa istruzione Declare. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
+ Declare Function SetToolTabRecord_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal RecordNum As Short, ByRef Record As TOOL_TABLE, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ 'UPGRADE_WARNING: La struttura OFFSET_TABLE potrebbe richiedere attributi di marshalling da passare come argomento a questa istruzione Declare. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
+ Declare Function SetOffsetTabRecord_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal RecordNum As Short, ByRef Record As OFFSET_TABLE, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ 'UPGRADE_WARNING: La struttura USER_TABLE potrebbe richiedere attributi di marshalling da passare come argomento a questa istruzione Declare. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="C429C3A5-5D47-4CD9-8F51-74A1616405DC"'
+ Declare Function SetUserTabRecord_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal RecordNum As Short, ByRef RecordBuff As USER_TABLE, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function SetTabFieldDouble_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal TableNum As Short, ByVal RecordNum As Short, ByVal FieldNum As Short, ByVal Value As Double, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function SetTabFieldShort_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal TableNum As Short, ByVal RecordNum As Short, ByVal FieldNum As Short, ByVal Value As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function SetTabSem_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal TableNum As Short, ByVal SemStatus As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function TabSemInfo_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByRef SemStatus As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function TabSearchDouble_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal TabNum As Short, ByVal FieldNum As Short, ByVal StartIndex As Short, ByVal StopIndex As Short, ByVal Value As Double, ByRef MatchIndex As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function TabSearchShort_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal TabNum As Short, ByVal FieldNum As Short, ByVal StartIndex As Short, ByVal StopIndex As Short, ByVal Value As Short, ByVal Mask As Short, ByRef MatchIndex As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+
+
+ ''''''' O.S. FUNCTIONS PROTOTYPES '''''''
+
+ 'UPGRADE_ISSUE: La dichiarazione di un parametro 'As Any' non è supportata. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="FAE78A8D-8978-4FD4-8208-5B7324A8F795"'
+ Declare Function GRead_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal MemId As Short, ByVal Offset As Short, ByVal Length As Short, ByRef Buffer As Object, ByRef BufferLength As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ 'UPGRADE_ISSUE: La dichiarazione di un parametro 'As Any' non è supportata. Fare clic per ulteriori informazioni: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="FAE78A8D-8978-4FD4-8208-5B7324A8F795"'
+ Declare Function GWrite_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal MemId As Short, ByVal Offset As Short, ByVal Length As Short, ByRef Buffer As Object, ByRef BufferLength As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+
+
+ ''''''' ACTIVE PART PROGRAM DOWNLOAD FUNCTIONS PROTOTYPES '''''''
+
+ Declare Function DncInit_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal PathName As String, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function DncData_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByVal data As String, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function DncEof_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+ Declare Function DncStop_C Lib "CndexLink.DLL" (ByVal UserSession As Short, ByVal ProcNum As Short, ByRef ErrClass As Integer, ByRef ErrNum As Integer) As Short
+
+End Module
diff --git a/CVCncLib/Modules/ComCNOsai.vb b/CVCncLib/Modules/ComCNOsai.vb
new file mode 100644
index 00000000..c3db93e5
--- /dev/null
+++ b/CVCncLib/Modules/ComCNOsai.vb
@@ -0,0 +1,1893 @@
+'
+' libreria : VBlib
+' file : ComCNOsai
+'
+' funzioni : connessione con CN OSAI come classe v1.1
+'
+' copyright 2008-2017 C.Viviani
+'
+Imports Microsoft.Win32
+
+Public Class ComCNOsai
+
+#Region "STRUCT CN"
+
+ ' ----------------------------------------------------------------------------
+ ' Struttura dati utilizzata per gestione lettura e scrittura variabili su CN
+ ' ----------------------------------------------------------------------------
+ Public Structure stVAR
+
+ Dim szVarName As String
+ Dim nAddress As Integer
+ Dim nBit As Integer
+ Dim nNumCn As Integer
+
+ End Structure
+#End Region
+
+#Region "VARIABILI ISTANZA"
+
+
+ ' -----------------------
+ ' Dichiarazione costanti
+ ' -----------------------
+ Public Const ERRORVALUE = -9999 ' valore assegnato alla variabile in caso di errore durante la lettura
+
+ ' funzione boot enquiry : BootPhaseEnquiry_C
+
+ Public Const EMERG_SWITCH_PHASE As Short = 1
+ Public Const HW_BOOT_PHASE As Short = 2
+ Public Const SW_BOOT_PHASE As Short = 3
+ Public Const SYSTEM_UP_PHASE As Short = 4
+ Public Const SERVER_MODE_PHASE As Short = 5
+ Public Const REMOTE_SETUP_PHASE As Short = 6
+ Public Const SERVICE_MODE_PHASE As Short = 7
+ Public Const AX_PARAM_VERIFY_PHASE As Short = 8
+
+ ' error codes
+ Public Const AB_NO_ERROR = &H0
+ Public Const AB_INIT_ERROR = &H101
+ Public Const AB_CHANNEL_NOT_OPENED = &H102
+ Public Const AB_WRONG_SESSION_NUMBER = &H103
+ Public Const AB_TOO_MANY_OPENED_SESSION = &H104
+ Public Const AB_REMOTE_CNC_ERROR = &H105
+ Public Const AB_NAME_TOO_LONG = &H106
+ Public Const AB_COMMAND_IN_EXECUTION = &H107
+ Public Const AB_CHANNELS_BUSY = &H108
+ Public Const AB_WRONG_PROCESS_NUMBER = &H109
+ Public Const AB_WRONG_SELECT_MODE = &H10A
+ Public Const AB_PARAM_OUT_OF_RANGE = &H10B
+ Public Const AB_CALLBACK_MUST_BE_NULL = &H10C
+ Public Const AB_WRONG_SYNC_CODE = &H10D
+ Public Const AB_BUFFER_SIZE_ERROR = &H10E
+ ' netbios error codes
+ Public Const AB_NETB_NETWORK_ERROR = &H200
+ Public Const AB_NETB_DUP_LOCAL_NAME = &H201
+ Public Const AB_NETB_NAME_TABLE_FULL = &H202
+ Public Const AB_NETB_LOCAL_SESS_TAB_FULL = &H203
+ Public Const AB_NETB_NO_BODY_LISTENING = &H204
+ Public Const AB_NETB_NO_ASW_FROM_REMOTE = &H205
+ Public Const AB_NETB_NAME_USED_ON_REMOTE = &H206
+ Public Const AB_NETB_NAME_DELETED = &H207
+ Public Const AB_NETB_NAME_CONFLICT = &H208
+ Public Const AB_NETB_INCOMPAT_REMOTE_DEV = &H209
+ Public Const AB_NETB_TIMEOUT = &H20A
+ Public Const AB_NETB_SESSION_ERR = &H20B ' Session closed
+
+ Public Const AB_USER_ERROR = &H300
+
+ Public Const NO_WAIT_CNC_ANSWER = 1
+ Public Const WAIT_CNC_ANSWER = 2
+
+ Public Const ON_ = 1
+ Public Const OFF_ = 0
+
+ ' 10 Series modes
+ Public Const MDI = 1
+ Public Const AUTO = 2
+ Public Const SEMI = 3
+ Public Const MANJOG = 4
+ Public Const INCJOG = 5
+ Public Const PROFILE = 6
+ Public Const HOME = 7
+
+ ' 10 Series Status
+ Public Const IDLE_ As Byte = 1
+ Public Const CYCLE_ As Byte = 2
+ Public Const HOLDA_ As Byte = 3
+ Public Const RUNH_ As Byte = 4
+ Public Const HRUN_ As Byte = 5
+ Public Const ERRO_ As Byte = 6
+ Public Const WAIT_ As Byte = 7
+ Public Const RESET_ As Byte = 8
+ Public Const EMERG_ As Byte = 9
+ Public Const INPUT_ As Byte = 10
+
+ ' 10 Series SubStatus
+ Public Const MAS = 6
+ Public Const MBR = 4
+
+
+ Public Const NUM_ELEM_SEL_AXI = 9
+
+ ' Axes Position type selector
+ Public Const PROGPOS = 1 ' Programmed positions
+ Public Const INTPOS = 2 ' Interpolated positions
+ Public Const TRANSDPOS = 3 ' Transducer Position
+ Public Const ERRPOS = 4 ' Following Errors
+
+ Public Const MAIN_PROGR_NAME_LEN = 55
+
+ Protected Const ERRORE_OSAI = 0
+
+ ' ---------------------
+ ' Variabili di Istanza
+ ' ---------------------
+
+ Protected mConnected As Boolean ' Indica se il Cn è connesso o meno
+ Protected mSessionOpened As Short ' Indica il numero di sessione aperta
+ Protected mNomeCN As String ' Indica il nome del cn da aprire
+ Protected mDebug As Boolean ' Indica se la connessione è debug o meno
+ Protected mVersion As Short ' indica la versione del Cn
+
+
+ Protected mErrClass As Long ' Indice della classe d'errore
+ Protected mErrNum As Long ' Indice della classe d'errore
+
+ Protected mErrMsg As String ' Stringa per gestione messaggi errore
+ Protected mCommunicationError as Boolean ' Boolean che indica se è avvenuto un errore di comunicazione
+
+ Private Server As New CndexLinkDotNet.Cndex() ' Istanza del server per comunicazione con CN
+
+#End Region
+
+#Region "COSTRUTTORE"
+
+ '-------------------------
+ ' Definizione Costruttore
+ '-------------------------
+ Public Sub New(ByVal szCN As String, ByVal bIsDebug As Boolean, Optional ByVal sVersion As Short = 2)
+
+ ' Inizializzazione variabili
+ Connected = False
+ SessionOpened = -1
+ ErrClass = 0
+ ErrNum = 0
+ ErrMsg = ""
+
+ ' Set variabili da parametri
+ NomeCn = szCN
+ Debug = bIsDebug
+ Version = sVersion
+ End Sub
+
+#End Region
+
+#Region "PROPRIETA"
+
+ ' ----------------------------------
+ ' Indica se il CN è connesso o meno
+ ' ----------------------------------
+ Public Property Connected() As Boolean
+ Get
+ Return mConnected
+ End Get
+ Set(ByVal value As Boolean)
+ mConnected = value
+ End Set
+
+ End Property
+
+ ' -----------------------------
+ ' Indice della classe d'errore
+ ' -----------------------------
+ Public Property ErrClass() As Long
+ Get
+ Return mErrClass
+ End Get
+ Set(ByVal value As Long)
+ mErrClass = value
+ End Set
+ End Property
+
+ ' ---------------------------
+ ' Indice del numero d'errore
+ ' ---------------------------
+ Public Property ErrNum() As Long
+ Get
+ Return mErrNum
+ End Get
+ Set(ByVal value As Long)
+ mErrNum = value
+ End Set
+ End Property
+
+ ' ---------------------------------------
+ ' Indica il numero della sessione aperta
+ ' ---------------------------------------
+ Public Property SessionOpened() As Short
+ Get
+ Return mSessionOpened
+ End Get
+ Set(ByVal value As Short)
+ mSessionOpened = value
+ End Set
+ End Property
+
+ ' ---------------------------------
+ ' Indica la stringa di connessione
+ ' ---------------------------------
+ Public Property NomeCn() As String
+ Get
+ Return mNomeCN
+ End Get
+ Set(ByVal value As String)
+ mNomeCN = value
+ End Set
+ End Property
+
+ ' --------------------------------
+ ' Indica se la connesione è Debug
+ ' --------------------------------
+ Public Property Debug() As Boolean
+ Get
+ Return mDebug
+ End Get
+ Set(ByVal value As Boolean)
+ mDebug = value
+ End Set
+ End Property
+
+ ' --------------------------------
+ ' Indica la versione Osai
+ ' 1 = Prima di versione WinNbi 3.0 (Gasper,Nasi,ABB etc)
+ ' 2 = Versione WinNbi > 3.0 con OS XP
+ ' 3 = Versione WinNbi > 3.0 con OS 7
+ ' 4 = Open Control
+ ' --------------------------------
+ Public Property Version() As Short
+ Get
+ Return mVersion
+ End Get
+ Set(ByVal value As Short)
+ mVersion = value
+ End Set
+ End Property
+ ' --------------------------------
+ ' Stringa per gestione errori
+ ' --------------------------------
+ Public Property ErrMsg() As String
+ Get
+ Return mErrMsg
+ End Get
+ Set(ByVal value As String)
+ mErrMsg = value
+ End Set
+ End Property
+
+ ' ------------------------------------------------------------
+ ' Boolean che indica se c'è stato un errore di comunicazione
+ ' ------------------------------------------------------------
+ Public Property Communication() As Boolean
+ Get
+ Return mCommunicationError
+ End Get
+ Set(ByVal value As Boolean)
+ mCommunicationError = value
+ End Set
+ End Property
+
+#End Region
+
+#Region "METODI - Open/close connection"
+
+ '------------------------------
+ ' Lettura messaggio DIS
+ '------------------------------
+ Public Overridable Function ReadDisMsg(Optional ByVal nProcess As Integer = 1, Optional ByVal nMac As Integer = 1) As String
+
+ Dim szResult As String = "" ' Stringa risultato
+
+ Dim n_ret_state As Short
+
+ ' se macchina collegata e non in debug
+ If (Not (Debug)) Then
+
+ n_ret_state = Server.ReadPartProgramMsg_C(SessionOpened, nProcess, szResult, ErrClass, ErrNum)
+
+ If (n_ret_state = ERRORE_OSAI) Then
+
+ ErrMsg = "Error on reading DIS Messages " & vbCrLf & what_happened()
+ 'MsgBox(ErrMsg)
+ Return CShort(ERRORVALUE).ToString ' In uscita setto variabile a ERRORVALUE errore
+
+ Else
+ ' return con il valore letto
+ Return szResult
+
+ End If
+ End If
+
+ Return szResult
+ End Function
+
+
+ ' ------------------------------
+ ' Apertura sessione con CN Osai
+ ' ------------------------------
+ Public Overridable Function OpenSession() As Boolean
+
+ Dim nSession As Short = 0
+
+ Select Case Debug
+
+ Case False ' Se non sono in Debug = 0
+
+ nSession = Server.OpenSession_C(NomeCn, SessionOpened, ErrClass, ErrNum) ' Apro la sessione
+
+ If (nSession <> ERRORE_OSAI) Then
+ Connected = True ' Setto connesso = true
+ Else
+ Connected = False ' Setto connesso = false
+ ErrMsg = "Error on open session" & vbCrLf & what_happened()
+ End If
+
+
+ Case True ' Se sono in Debug = 1
+
+ Connected = True ' Connessione sempre OK
+
+ End Select
+
+ Return Connected
+
+ End Function
+
+ ' ------------------------------
+ ' Chiusura sessione con CN Osai
+ ' ------------------------------
+ Public Overridable Function CloseSession() As Boolean
+
+ Dim nSession As Short
+ Dim bOk As Boolean
+
+ Select Case Debug
+
+ Case False ' Se non sono in Debug = 0
+
+ nSession = Server.CloseSession_C(SessionOpened, ErrClass, ErrNum) ' Chiudo la sessione
+
+ If (nSession <> ERRORE_OSAI) Then
+ bOk = True
+ Else
+ ErrMsg = "Error on closing session" & vbCrLf & what_happened()
+ bOk = False
+ End If
+
+ Case True ' Se sono in Debug = 1
+
+ bOk = True
+
+ End Select
+
+ Connected = False
+
+ Return bOk
+
+ End Function
+
+ ' ------------------------------
+ ' Verifica che il CN sia running
+ ' ------------------------------
+ Public Overridable Function Is_NC_running() As Boolean
+
+ Dim n_ret_state As Short
+ Dim n_boot_Phase As Short
+
+ n_ret_state = Server.BootPhaseEnquiry_C(SessionOpened, n_boot_Phase, ErrClass, ErrNum)
+
+ If (n_ret_state = ERRORE_OSAI) Then
+ ErrMsg = "Error on BootPhaseEnquiry_C" & vbCrLf & "Class: " & Str(ErrClass) & " Number: 0x" & Hex(ErrNum)
+ Return False
+ Exit Function
+ End If
+
+ If n_boot_Phase <> SYSTEM_UP_PHASE Then
+ Return False
+ Else
+ Return (True)
+ End If
+
+ End Function
+
+ ' ------------------------------
+ ' START PartProgram
+ ' ------------------------------
+ Public Overridable Function StartPP() As Boolean
+
+ Dim n_ret_state As Short
+ Dim bOk As Boolean
+
+ Select Case Debug
+
+ Case False ' Se non sono in Debug = 0
+
+ n_ret_state = Server.Cycle_C(SessionOpened, 1, 1, ErrClass, ErrNum) ' Chiudo la sessione
+
+ If (n_ret_state = ERRORE_OSAI) Then
+
+ ErrMsg = "Error on Cycle_C" & vbCrLf & vbCrLf & what_happened()
+ bOk = False
+ Else
+ bOk = True
+ End If
+
+ Case True ' Se sono in Debug = 1
+
+ bOk = True
+
+ End Select
+
+ Return bOk
+
+ End Function
+
+#End Region
+
+#Region "METODI - NC copy post Vista ...."
+
+ '------------------------------
+ ' Copia file da Pc a Cn post Vista .... ritorna zero in caso di errore.
+ '------------------------------
+ Public Overridable Function CopyFileToNC(ByVal sz_logical_drive As String,
+ ByVal sz_source_filename As String,
+ ByVal sz_dest_filename As String) As Short
+
+ Dim n_ret_state As Short
+
+ Select Case Debug
+
+ Case False ' Se non sono in Debug = 0
+
+ n_ret_state = Server.LogFSTransferFileW_C(sz_logical_drive, sz_source_filename, NomeCn, sz_dest_filename, ErrClass, ErrNum)
+
+ If (n_ret_state > 0) Then ' ritorna zero in caso di errore.
+ Else
+ ErrMsg = "Error on CopyFileToNC" & vbCrLf & what_happened()
+ MsgBox(ErrMsg)
+
+ End If
+
+ Case True ' Se sono in Debug = 1
+
+ n_ret_state = 1 ' Connessione sempre OK
+
+ End Select
+
+ Return n_ret_state
+
+ End Function
+
+ '------------------------------
+ ' Copia file da Cn a PC post Vista ....
+ '------------------------------
+ Public Overridable Function CopyFileFromNc(ByVal sz_logical_drive As String,
+ ByVal sz_source_filename As String,
+ ByVal sz_dest_filename As String) As Short
+
+ Dim n_ret_state As Short
+
+ Select Case Debug
+
+ Case False ' Se non sono in Debug = 0
+
+
+ n_ret_state = Server.LogFSTransferFileW_C(NomeCn, sz_source_filename, sz_logical_drive, sz_dest_filename, ErrClass, ErrNum)
+
+ If (n_ret_state > 0) Then
+ Else
+ ErrMsg = "Error on CopyFileFromNc" & vbCrLf & what_happened()
+ MsgBox(ErrMsg)
+
+ End If
+
+
+ Case True ' Se sono in Debug = 1
+
+ n_ret_state = 1 ' Connessione sempre OK
+
+ End Select
+
+ Return n_ret_state
+
+ End Function
+
+ '------------------------------
+ ' Delete file su Cn post Vista ....
+ '------------------------------
+ Public Overridable Function DeleteFileOnNC(ByVal sz_pathname As String, ByVal sz_filename As String) As Short
+
+ Dim n_ret_state As Short
+
+ Dim n_hidden_drives As Long
+ Dim n_user_drives As Long
+ Dim n As Short
+ Dim sz_drive_name As String
+ Dim sz_drive_path As String
+
+ Select Case Debug
+
+ Case False ' Se non sono in Debug = 0
+
+ n_ret_state = Server.LogFSGetNumDrive_C(SessionOpened, n_hidden_drives, n_user_drives, ErrClass, ErrNum)
+
+ sz_drive_name = ""
+ sz_drive_path = ""
+ n = 0
+
+ 'n_ret_state = Server.LogFSGetDriveList_C(SessionOpened, sz_drive_name, n, ErrClass, ErrNum)
+
+ 'n_ret_state = Server.LogFSSetSecurityLevel_C(SessionOpened, "OEM", CndexLinkDotNet.Cndex.SECURITY_LEVEL_C.SECURITY_LEV_OEM_ADMIN_C, n, ErrClass, ErrNum)
+
+ 'n_ret_state = Server.LogFSGetDrivePath_C(SessionOpened, sz_drive_name, sz_drive_path, CndexLinkDotNet.Cndex.SECURITY_LEVEL_C.SECURITY_LEV_OEM_ADMIN_C, ErrClass, ErrNum)
+
+ n_ret_state = Server.LogFSRemoveFile_C(SessionOpened, sz_pathname, sz_filename, ErrClass, ErrNum)
+
+ If (n_ret_state > 0) Then
+ Else
+ ErrMsg = "Error on DeleteFileOnNC" & vbCrLf & what_happened()
+ MsgBox(ErrMsg)
+
+ End If
+
+ Case True ' Se sono in Debug = 1
+
+ n_ret_state = 1 ' Connessione sempre OK
+
+ End Select
+
+ Return n_ret_state
+
+ End Function
+
+#End Region
+
+#Region "METODI - Lettura/scrittura variabili CN"
+
+ '------------------------------
+ ' Lettura variabile Bool su Cn
+ '------------------------------
+ Public Overridable Function ReadBoolVar(ByVal szVar As stVAR, Optional ByVal nProcess As Integer = 1) As Short
+
+ Dim nValues(0) As Short ' Array (lo vuole la libreria Osai) che conterrà il valore letto
+ Dim nComOk As Short ' Se 1 lettura OK Se 0 lettura KO
+ Dim nNumVarToBeReaded As Integer = 1 ' Numero di variabili da leggere (fisso a 1)
+
+
+ ' se macchina collegata e non in debug
+ If (Not (Debug)) Then
+
+ nValues(0) = 0
+
+ nComOk = Server.ReadVarWord_C(SessionOpened, CndexLinkDotNet.Cndex.GW_CODE, nProcess, szVar.nAddress, nNumVarToBeReaded, nValues, ErrClass, ErrNum)
+
+ If (nComOk = ERRORE_OSAI) Then
+
+ ErrMsg = "Error on reading bool variable" & vbCrLf & "Class: " & Str(ErrClass) & " Number: 0x" & Hex(ErrNum)
+ Return CShort(ERRORVALUE) ' In uscita setto variabile a ERRORVALUE errore
+
+ Else
+
+ If ((nValues(0) And (2 ^ szVar.nBit)) <> 0) Then ' Maschera per controllare solo il bit che mi interessa
+ nValues(0) = 1
+ Else
+ nValues(0) = 0
+ End If
+
+ ' return con il valore letto
+ Return nValues(0)
+
+ End If
+
+
+ Else ' gestione se debug
+
+ ' ritorno valore fittzio
+ Return 1
+
+ End If
+
+ End Function
+
+ ' -------------------------------
+ ' Scrittura variabile Bool su Cn
+ '---------------------------------
+ Public Overridable Function WriteBoolVar(ByVal szVar As stVAR, ByVal nValue As Short, Optional ByVal nProcess As Integer = 1) As Boolean
+
+ Dim nComOk As Short ' Se 1 scrittura OK Se 0 lettura KO
+
+ ' se macchina collegata e non in debug
+ If (Not (Debug)) Then
+
+ nComOk = Server.WriteVarWordBit_C(SessionOpened, CndexLinkDotNet.Cndex.GW_CODE, nProcess, szVar.nAddress, szVar.nBit, nValue, ErrClass, ErrNum)
+
+ If (nComOk = ERRORE_OSAI) Then
+
+ ErrMsg = "Error on writing bool variable" & vbCrLf & "Class: " & Str(ErrClass) & " Number: 0x" & Hex(ErrNum)
+ Return False ' In uscita setto variabile a ERRORVALUE errore
+
+ Else
+
+ Return True
+
+ End If
+
+ ' se sono in debug
+ Else
+
+ Return True
+
+ End If ' Endif gestione macchina collegata
+
+ End Function
+
+ '------------------------------
+ ' Lettura variabile Short su Cn
+ '------------------------------
+ Public Overridable Function ReadShortVar(ByVal szVar As stVAR, Optional ByVal nProcess As Integer = 1) As Short
+
+ Dim nValues(0) As Short ' Array (lo vuole la libreria Osai) che conterrà il valore letto
+ Dim nComOk As Short ' Se 1 lettura OK Se 0 lettura KO
+ Dim nNumVarToBeReaded As Integer = 1 ' Numero di variabili da leggere (fisso a 1)
+
+ ' se macchina collegata e non in debug
+ If (Not (Debug)) Then
+
+ nValues(0) = 0
+
+ nComOk = Server.ReadVarWord_C(SessionOpened, CndexLinkDotNet.Cndex.GW_CODE, nProcess, szVar.nAddress, nNumVarToBeReaded, nValues, ErrClass, ErrNum)
+
+ If (nComOk = ERRORE_OSAI) Then
+
+ ErrMsg = "Error on ReadVarWord_C" & vbCrLf & what_happened()
+ Return CShort(ERRORVALUE) ' In uscita setto variabile a ERRORVALUE errore
+
+ Else
+
+ ' return con il valore letto
+ Return nValues(0)
+
+ End If
+
+ Else ' gestione se debug
+
+ ' ritorno true
+ Return 1
+
+ End If
+
+ End Function
+
+ ' -------------------------------
+ ' Scrittura variabile Short su Cn
+ '---------------------------------
+ Public Overridable Function WriteShortVar(ByVal szVar As stVAR, ByVal nValue As Short, Optional ByVal nProcess As Integer = 1) As Boolean
+
+ Dim nComOk As Short ' Se 1 scritt. OK Se 0 lettura KO
+ Dim nValues(0) As Short ' Array (lo vuole la libreria Osai) che conterrà il valore letto
+ Dim nNumVarToBeWrited As Integer = 1 ' Numero di variabili da leggere (fisso a 1)
+
+
+ nValues(0) = nValue
+
+ ' se macchina collegata e non in debug
+ If (Not (Debug)) Then
+
+ nComOk = Server.WriteVarWord_C(SessionOpened, CndexLinkDotNet.Cndex.GW_CODE, nProcess, szVar.nAddress, nNumVarToBeWrited, nValues, ErrClass, ErrNum)
+
+ If (nComOk = ERRORE_OSAI) Then
+
+ ErrMsg = "Error on writing short variable" & vbCrLf & what_happened()
+ Return False ' In uscita setto variabile a ERRORVALUE errore
+
+ Else
+
+ Return True
+
+ End If
+
+ ' se sono in debug
+ Else
+
+ Return True
+
+ End If ' Endif gestione macchina collegata
+
+ End Function
+
+ '--------------------------------
+ ' Lettura variabile G Double su Cn
+ '--------------------------------
+ Public Overridable Function ReadDoubleVar(ByVal szVar As stVAR, Optional ByVal nProcess As Integer = 1) As Double
+
+ Dim nValues(0) As Double ' Array (lo vuole la libreria Osai) che conterrà il valore letto
+ Dim nComOk As Short ' Se 1 lettura OK Se 0 lettura KO
+ Dim nNumVarToBeReaded As Integer = 1 ' Numero di variabili da leggere (fisso a 1)
+
+ ' se macchina collegata e non in debug
+ If (Not (Debug)) Then
+
+ nValues(0) = 0
+
+ nComOk = Server.ReadVarDouble_C(SessionOpened, CndexLinkDotNet.Cndex.GD_CODE, nProcess, szVar.nAddress, nNumVarToBeReaded, nValues, ErrClass, ErrNum)
+
+ If (nComOk = ERRORE_OSAI) Then
+
+ ErrMsg = "Error on reading double variable" & vbCrLf & what_happened()
+ Return CDbl(ERRORVALUE) ' In uscita setto variabile a ERRORVALUE errore
+
+ Else
+
+ ' return con il valore letto
+ Return nValues(0)
+
+ End If
+
+
+ Else ' gestione se debug
+
+ ' ritorno true
+ Return 1.0
+
+ End If
+
+ End Function
+
+ ' ---------------------------------
+ ' Scrittura variabile G Double su Cn
+ '----------------------------------
+ Public Overridable Function WriteDoubleVar(ByVal szVar As stVAR, ByVal nValue As Double, Optional ByVal nProcess As Integer = 1) As Boolean
+
+ Dim nComOk As Short ' Se 1 scritt. OK Se 0 lettura KO
+ Dim nValues(0) As Double ' Array (lo vuole la libreria Osai) che conterrà il valore letto
+ Dim nNumVarToBeWrited As Integer = 1 ' Numero di variabili da leggere (fisso a 1)
+
+
+ nValues(0) = nValue
+
+ ' se macchina collegata e non in debug
+ If (Not (Debug)) Then
+
+ nComOk = Server.WriteVarDouble_C(SessionOpened, CndexLinkDotNet.Cndex.GD_CODE, nProcess, szVar.nAddress, nNumVarToBeWrited, nValues, ErrClass, ErrNum)
+
+ If (nComOk = ERRORE_OSAI) Then
+
+ ErrMsg = "Error on writing double variable" & vbCrLf & what_happened()
+ Return False ' In uscita setto variabile a ERRORVALUE errore
+
+ Else
+
+ Return True
+
+ End If
+
+ ' se sono in debug
+ Else
+
+ Return True
+
+ End If ' Endif gestione macchina collegata
+
+ End Function
+
+ '-----------------------------------
+ ' Lettura variabile E (Double) su Cn
+ '-----------------------------------
+ Public Overridable Function ReadVarE(ByVal szVar As stVAR, Optional ByVal nProcess As Integer = 1) As Double
+
+ Dim nValues(0) As Double ' Array (lo vuole la libreria Osai) che conterrà il valore letto
+ Dim nComOk As Short ' Se 1 lettura OK Se 0 lettura KO
+ Dim nNumVarToBeReaded As Integer = 1 ' Numero di variabili da leggere (fisso a 1)
+
+ ' se macchina collegata e non in debug
+ If (Not (Debug)) Then
+
+ nValues(0) = 0
+
+ nComOk = Server.ReadVarDouble_C(SessionOpened, CndexLinkDotNet.Cndex.E_CODE, nProcess, szVar.nAddress, nNumVarToBeReaded, nValues, ErrClass, ErrNum)
+
+ If (nComOk = ERRORE_OSAI) Then
+
+ ErrMsg = "Error on reading double variable" & vbCrLf & what_happened()
+ Return CDbl(ERRORVALUE) ' In uscita setto variabile a ERRORVALUE errore
+
+ Else
+
+ ' return con il valore letto
+ Return nValues(0)
+
+ End If
+
+
+ Else ' gestione se debug
+
+ ' ritorno valore fittizio
+ Return 1.0
+
+ End If
+
+ End Function
+
+ ' ---------------------------------
+ ' Scrittura variabile E (Double) su Cn
+ '----------------------------------
+ Public Overridable Function WriteVarE(ByVal szVar As stVAR, ByVal nValue As Double, Optional ByVal nProcess As Integer = 1) As Boolean
+
+ Dim nComOk As Short ' Se 1 scr. OK ; Se 0 scrittura KO
+ Dim nValues(0) As Double ' Array (lo vuole la libreria Osai) che conterrà il valore letto
+ Dim nNumVarToBeWrited As Integer = 1 ' Numero di variabili da leggere (fisso a 1)
+
+
+ nValues(0) = nValue
+
+ ' se macchina collegata e non in debug
+ If (Not (Debug)) Then
+
+ nComOk = Server.WriteVarDouble_C(SessionOpened, CndexLinkDotNet.Cndex.E_CODE, nProcess, szVar.nAddress, nNumVarToBeWrited, nValues, ErrClass, ErrNum)
+
+ If (nComOk = ERRORE_OSAI) Then
+
+ ErrMsg = "Error on writing double variable" & vbCrLf & what_happened()
+ Return False ' In uscita setto variabile a ERRORVALUE errore
+
+ Else
+
+ Return True
+
+ End If
+
+ ' se sono in debug
+ Else
+
+ Return True
+
+ End If ' Endif gestione macchina collegata
+
+ End Function
+
+ '-----------------------------------
+ ' Lettura variabile L (Double) su Cn
+ '-----------------------------------
+ Public Overridable Function ReadVarL(ByVal szVar As stVAR, Optional ByVal nProcess As Integer = 1) As Double
+
+ ' sulla serie 10 per leggere una variabile L occorre leggere un record della USER TABLE
+
+ Dim nComOk As Short ' Se 1 lettura OK ; Se 0 lettura KO
+
+ Dim UserRecord As CndexLinkDotNet.Cndex.USER_TABLE = Nothing
+ Dim nRecNumber As Short ' da 1 a 100
+ Dim nRecIndex As Short ' da 1 a 4 all interno del record
+ Dim value As Double
+
+
+ ' se macchina collegata e non in debug
+ If (Not (Debug)) Then
+
+ nRecNumber = (szVar.nAddress / 4) + 1
+ nRecIndex = (szVar.nAddress Mod 4) + 1
+
+ nComOk = Server.GetUserTabRecord_C(SessionOpened, nRecNumber, UserRecord, ErrClass, ErrNum)
+
+ If (nComOk = ERRORE_OSAI) Then
+
+ ErrMsg = "Error on reading L variable" & vbCrLf & what_happened()
+ Return -99999.99 ' In uscita setto variabile a ERRORVALUE errore
+
+ Else
+ Select Case nRecIndex
+ Case 1
+ value = UserRecord.user1
+ Case 2
+ value = UserRecord.user2
+ Case 3
+ value = UserRecord.user3
+ Case 4
+ value = UserRecord.user4
+
+ End Select
+
+ Return value
+
+ End If
+
+ ' se sono in debug
+ Else
+
+ Return 0.0
+
+ End If '
+
+
+ End Function
+
+ ' ---------------------------------
+ ' Scrittura variabile L (Double) su Cn
+ '----------------------------------
+ Public Overridable Function WriteVarL(ByVal szVar As stVAR, ByVal nValue As Double, Optional ByVal nProcess As Integer = 1) As Boolean
+
+ ' sulla serie 10 per scrivere una variabile L occorre leggere un record della USER TABLE, sostituire il valore e riscrivere il record
+
+ Dim nComOk As Short ' Se 1 lettura OK ; Se 0 lettura KO
+
+ Dim UserRecord As CndexLinkDotNet.Cndex.USER_TABLE = Nothing
+ Dim nRecNumber As Short ' da 1 a 100
+ Dim nRecIndex As Short ' da 1 a 4 all interno del record
+
+ ' se macchina collegata e non in debug
+ If (Not (Debug)) Then
+
+ nRecNumber = (szVar.nAddress / 4) + 1
+ nRecIndex = (szVar.nAddress Mod 4) + 1
+
+ nComOk = Server.GetUserTabRecord_C(SessionOpened, nRecNumber, UserRecord, ErrClass, ErrNum)
+
+ If (nComOk = ERRORE_OSAI) Then
+
+ ErrMsg = "Error on read L variable" & vbCrLf & what_happened()
+ Return False ' In uscita setto variabile a ERRORVALUE errore
+
+ Else
+ Select Case nRecIndex
+ Case 1
+ UserRecord.user1 = nValue
+ Case 2
+ UserRecord.user2 = nValue
+ Case 3
+ UserRecord.user3 = nValue
+ Case 4
+ UserRecord.user4 = nValue
+
+ End Select
+
+ nComOk = Server.SetUserTabRecord_C(SessionOpened, nRecNumber, UserRecord, ErrClass, ErrNum)
+ If (nComOk = ERRORE_OSAI) Then
+
+ ErrMsg = "Error on writing L variable" & vbCrLf & what_happened()
+ Return False ' In uscita setto variabile a ERRORVALUE errore
+
+ Else
+ Return True
+ End If
+
+ End If
+
+ Else ' se sono in debug
+ Return True
+ End If '
+
+ End Function
+
+ '--------------------------------
+ ' Lettura variabile SC su Cn
+ '--------------------------------
+ Public Overridable Function ReadSCVar(ByVal nIndex As Integer, ByVal nNumChar As Integer, Optional ByVal nProcess As Integer = 1) As String
+
+ Dim szValue As String = ""
+ Dim nComOk As Short ' Se 1 lettura OK Se 0 lettura KO
+ Dim szText As String = ""
+
+
+ ' se macchina collegata e non in debug
+ If (Not (Debug)) Then
+
+ nComOk = Server.ReadVarText_C(SessionOpened, CndexLinkDotNet.Cndex.SC_CODE, nProcess, nIndex, nNumChar, szValue, ErrClass, ErrNum)
+
+ If (nComOk = ERRORE_OSAI) Then
+
+ ErrMsg = "Error on reading SC variable" & vbCrLf & what_happened()
+ Return "" ' In uscita setto variabile a ERRORVALUE errore
+
+ Else
+
+ ' return con il valore letto
+ Return szValue
+
+ End If
+
+
+ Else ' gestione se debug
+
+ ' ritorno true
+ Return "SC VAR - DEBUG"
+
+ End If
+
+
+ End Function
+
+ ' ---------------------------------
+ ' Scrittura variabile SC su Cn
+ '----------------------------------
+ Public Overridable Function WriteSCVar(ByVal nIndex As Integer, ByVal nNumChar As Integer, ByVal szText As String, Optional ByVal nProcess As Integer = 1) As Boolean
+
+ Dim nComOk As Short ' Se 1 scritt. OK Se 0 lettura KO
+
+ ' se macchina collegata e non in debug
+ If (Not (Debug)) Then
+
+ nComOk = Server.WriteVarText_C(SessionOpened, CndexLinkDotNet.Cndex.SC_CODE, nProcess, nIndex, nNumChar, szText, ErrClass, ErrNum)
+
+ If (nComOk = ERRORE_OSAI) Then
+
+ ErrMsg = "Error on writing SC variable" & vbCrLf & what_happened()
+ Return False ' In uscita setto variabile a ERRORVALUE errore
+
+ Else
+
+ Return True
+
+ End If
+
+ ' se sono in debug
+ Else
+
+ Return True
+
+ End If ' Endif gestione macchina collegata
+
+ End Function
+
+ '--------------------------------
+ ' Lettura variabile MW ( word ) su Cn
+ '--------------------------------
+ Public Overridable Function ReadVarMW(ByVal szVar As stVAR, Optional ByVal nProcess As Integer = 1) As UShort
+
+ Dim nValues(0) As Short ' Array (lo vuole la libreria Osai) che conterrà  il valore letto
+ Dim nComOk As Short ' Se 1 scr. OK Se 0 lettura KO
+ Dim nNumVarToRead As Short = 1 ' Numero di variabili da leggere (fisso a 1)
+
+ ' se macchina collegata e non in debug
+ If (Not (Debug)) Then
+
+ nValues(0) = 0
+
+ nComOk = Server.ReadVarWord_C(SessionOpened, CndexLinkDotNet.Cndex.MW_CODE, nProcess, szVar.nAddress, nNumVarToRead, nValues, ErrClass, ErrNum)
+
+ If (nComOk = ERRORE_OSAI) Then
+
+ ErrMsg = "Error on reading MW variable" & vbCrLf & what_happened()
+ Return (9999) ' In uscita setto variabile a ERRORVALUE errore
+
+ Else
+
+ ' return con il valore letto
+ Return nValues(0)
+
+ End If
+
+
+ Else ' gestione se debug
+
+ ' ritorno true
+ Return 1
+
+ End If
+
+ End Function
+
+ '--------------------------------
+ ' Lettura multi variabile MW su Cn
+ '--------------------------------
+ Public Overridable Function ReadMultipleVarMW(ByVal nAddress As Integer, ByRef nValues() As Short, ByVal nNumVarToRead As Short, Optional ByVal nProcess As Integer = 1) As Boolean
+
+ Dim nComOk As Short ' Se 1 scr. OK Se 0 lettura KO
+
+ ' se macchina collegata e non in debug
+ If (Not (Debug)) Then
+
+ nValues(0) = 0
+
+ nComOk = Server.ReadVarWord_C(SessionOpened, CndexLinkDotNet.Cndex.MW_CODE, nProcess, nAddress, nNumVarToRead, nValues, ErrClass, ErrNum)
+
+ If (nComOk = ERRORE_OSAI) Then
+
+ ErrMsg = "Error on reading multiple MW variable" & vbCrLf & what_happened()
+ Return False ' In uscita setto variabile a ERRORVALUE errore
+
+ Else
+ Return True
+ End If
+
+ Else ' gestione se debug
+ Return True
+ End If
+
+ End Function
+
+
+#End Region
+
+#Region "METODI - Info da CN e varie"
+
+ ' ---------------------------------
+ ' Lettura Warning Msg
+ '----------------------------------
+ Public Overridable Function ReadWarning(ByRef szText As String) As Boolean
+
+ Dim nComOk As Short ' Se 1 lettura OK Se 0 lettura KO
+
+ ' se macchina collegata e non in debug
+ If (Not (Debug)) Then
+
+ nComOk = Server.ReadWarningMsg_C(SessionOpened, szText, ErrClass, ErrNum)
+
+ If (nComOk = ERRORE_OSAI) Then
+
+ ErrMsg = "Error on reading Warning Messages" & vbCrLf & what_happened()
+ Return False ' In uscita setto variabile a ERRORVALUE errore
+
+ Else
+
+ Return True
+
+ End If
+
+ ' se sono in debug
+ Else
+
+ Return True
+
+ End If ' Endif gestione macchina collegata
+
+ End Function
+
+ ' ---------------------------------
+ ' Lettura programma corrente
+ '----------------------------------
+ Public Overridable Function GetActiveProgram(ByVal nProcess As Integer) As String
+ Dim szMainPrg As String = ""
+ Dim szSubProgram As String = ""
+ Dim nComOk As Short ' Se 1 lettura OK Se 0 lettura KO
+
+
+ ' se macchina collegata e non in debug
+ If (Not (Debug)) Then
+
+ nComOk = Server.GetActivePartProgram_C(SessionOpened, nProcess, 1, szMainPrg, szSubProgram, ErrClass, ErrNum)
+
+ If (nComOk = ERRORE_OSAI) Then
+
+ ErrMsg = "Error on GetActivePartProgram_C" & vbCrLf & what_happened()
+ Return "Error" ' In uscita setto variabile a ERRORVALUE errore
+
+ Else
+
+ szMainPrg = Replace(szMainPrg, vbNullChar, "") ' Pulisco i caratteri farlocchi ...
+ Return szMainPrg
+
+ End If
+
+ ' se sono in debug
+ Else
+
+ Return "OK"
+
+ End If ' Endif gestione macchina collegata
+
+ End Function
+
+ ' ---------------------------------------------------------------
+ ' Ritorna True se lo stato del CN è IDLE
+ '----------------------------------------------------------------
+ Public Overridable Function IsResetStatus(Optional ByVal nProcess As Integer = 1) As Boolean
+ Dim RetVal As Short
+ Dim ncInfo As New CndexLinkDotNet.Cndex.GETINFO1DATA
+
+ RetVal = Server.GetNcInfo1_C(SessionOpened, nProcess, ncInfo, ErrClass, ErrNum)
+
+ If RetVal > 0 Then
+
+ If ncInfo.mode_select = 0 Then
+ Return True
+ Else
+ Return False
+ End If
+
+ Else
+ 'MsgBox("Error in IsResetStatus" & vbCrLf & "Class: " & Str(ErrClass) & " Number: 0x" & Hex(ErrNum))
+ Return 0
+ End If
+
+ End Function
+
+ ' ---------------------------------
+ ' Lettura info CN 1
+ '----------------------------------
+ Public Overridable Function NcInfo1(ByRef ncInfo As CndexLinkDotNet.Cndex.GETINFO1DATA, Optional ByVal nProcess As Integer = 1) As Boolean
+
+ Dim nComOk As Short ' Se 1 lettura OK Se 0 lettura KO
+
+ ' se macchina collegata e non in debug
+ If (Not (Debug)) Then
+
+ nComOk = Server.GetNcInfo1_C(SessionOpened, nProcess, ncInfo, ErrClass, ErrNum)
+
+ If (nComOk = ERRORE_OSAI) Then
+
+ ErrMsg = "Error on reading NcInfo1" & vbCrLf & what_happened()
+ Return False ' In uscita setto variabile a ERRORVALUE errore
+
+ Else
+
+ Return True
+
+ End If
+
+ ' se sono in debug
+ Else
+
+ Return True
+
+ End If ' Endif gestione macchina collegata
+
+ End Function
+
+ ' ---------------------------------
+ ' Lettura info CN 2
+ '----------------------------------
+ Public Overridable Function NcInfo2(ByRef ncInfo As CndexLinkDotNet.Cndex.GETINFO2DATA, Optional ByVal nProcess As Integer = 1) As Boolean
+
+ Dim nComOk As Short ' Se 1 lettura OK Se 0 lettura KO
+
+ ' se macchina collegata e non in debug
+ If (Not (Debug)) Then
+
+ nComOk = Server.GetNcInfo2_C(SessionOpened, nProcess, ncInfo, ErrClass, ErrNum)
+
+ If (nComOk = ERRORE_OSAI) Then
+
+ ErrMsg = "Error on reading NcInfo2" & vbCrLf & what_happened()
+ Return False ' In uscita setto variabile a ERRORVALUE errore
+
+ Else
+
+ Return True
+
+ End If
+
+ ' se sono in debug
+ Else
+
+ Return True
+
+ End If ' Endif gestione macchina collegata
+
+ End Function
+
+ '------------------------------
+ ' Lettura process stato info Cn
+ '------------------------------
+ '
+ ' ha causato molto dispiacere il fatto che se uso la Server.GetProcessStatus_C con winnbi < 3.1.1
+ ' dà una UNRESOLVED a run time della GetProcessStatus_C8 ( notare l' "8" finale ) nella CNDEXLINK.DLL
+ '
+ ' soluzione : con Win Nbi recenti, uso Server.GetProcessStatus_C ; con Winnbi vecchi, faccio override
+ ' di questa funzione USANDO LA STRUTTURA NUOVA CndexLinkDotNet.Cndex.PROCDATA ( altrimenti non è possibile
+ ' fare override; ma poi uso una variabile locale tipo vecchio ( PROCDATA ) e in caso di esito positivo,
+ ' copio i dati risultanti.
+ '
+ ' Attenzione : si ha lo stesso problema anche con la Server.GetNcInfo1_C ma curiosamente non con le funzioni
+ ' di lettura scrittura variabili CN .... boh !!
+ Public Overridable Function NcProcessStatus(ByRef ncInfo As CndexLinkDotNet.Cndex.PROCDATA, Optional ByVal nProcess As Integer = 1) As Boolean
+
+ Dim nComOk As Short ' Se 1 lettura OK Se 0 lettura KO
+
+ ' se macchina collegata e non in debug
+ If (Not (Debug)) Then
+
+ nComOk = Server.GetProcessStatus_C(SessionOpened, nProcess, ncInfo, ErrClass, ErrNum)
+
+ If (nComOk = ERRORE_OSAI) Then
+
+ ErrMsg = "Error on GetProcessStatus_C" & vbCrLf & what_happened()
+ Return False ' In uscita setto variabile a ERRORVALUE errore
+
+ Else
+
+ Return True
+
+ End If
+
+ ' se sono in debug
+ Else
+
+ Return True
+
+ End If ' Endif gestione macchina collegata
+
+ End Function
+
+ ' ---------------------------------
+ ' Lettura dati assi
+ '----------------------------------
+ Public Overridable Function GetAxesValue(ByRef AxesData() As CndexLinkDotNet.Cndex.GETINTDATA, ByVal AsciiNameAxe As Byte, ByVal nTypeCoord As Integer, Optional ByVal nProcess As Integer = 1) As Boolean
+
+ Dim nComOk As Short ' Se 1 lettura OK Se 0 lettura KO
+
+ ' se macchina collegata e non in debug
+ If (Not (Debug)) Then
+
+ nComOk = Server.GetAxesPosition_C(SessionOpened, nProcess, AsciiNameAxe, nTypeCoord, 1, AxesData, ErrClass, ErrNum)
+
+ If (nComOk = ERRORE_OSAI) Then
+
+ ErrMsg = "Error on reading Axes Data" & vbCrLf & what_happened()
+ Return False ' In uscita setto variabile a ERRORVALUE errore
+
+ Else
+
+ Return True
+
+ End If
+
+ ' se sono in debug
+ Else
+
+ Return True
+
+ End If ' Endif gestione macchina collegata
+
+ End Function
+
+ ' -------------------------------------------------
+ ' Lettura stato macchina su processo passato per parametro
+ '--------------------------------------------------
+ Public Overridable Function GetMachineStatus(Optional ByVal nProcess As Integer = 1) As Byte
+ Dim RetVal As Short
+ Dim ncInfo As New CndexLinkDotNet.Cndex.GETINFO1DATA
+ ' se macchina collegata e non in debug
+
+ If (Not (Debug)) Then
+
+ RetVal = Server.GetNcInfo1_C(SessionOpened, nProcess, ncInfo, ErrClass, ErrNum)
+ If RetVal > 0 Then
+ Return ncInfo.status
+
+ Else
+ ErrMsg = "Error on reading Machine Status" & vbCrLf & what_happened()
+ Return 0
+ End If
+ ' se sono in debug
+ Else
+ Return True
+ End If
+ End Function
+
+ ' -------------------------------------------------
+ ' Lettura modalità  macchina su processo passato per parametro
+ '--------------------------------------------------
+ Public Overridable Function GetModeSelected(Optional ByVal nProcess As Integer = 1) As Byte
+ Dim RetVal As Short
+ Dim ncInfo As New CndexLinkDotNet.Cndex.GETINFO1DATA
+
+ ' se macchina collegata e non in debug
+ If (Not (Debug)) Then
+
+ RetVal = Server.GetNcInfo1_C(SessionOpened, nProcess, ncInfo, ErrClass, ErrNum)
+ If RetVal > 0 Then
+ Return ncInfo.mode_select
+
+ Else
+ ErrMsg = "Error on reading Machine Mode" & vbCrLf & what_happened()
+ Return 0
+ End If
+ ' se sono in debug
+ Else
+ Return True
+ End If
+ End Function
+
+ ' ---------------------------------
+ ' CN in modalità  AUTO
+ '----------------------------------
+ Public Overridable Function SetAutoMode(Optional ByVal nProcess As Integer = 1) As Boolean
+
+ Dim nComOk As Short ' Se 1 OK ; Se 0 KO
+
+ ' se macchina collegata e non in debug
+ If (Not (Debug)) Then
+
+ nComOk = Server.SetProcessMode_C(SessionOpened, nProcess, 2, ErrClass, ErrNum)
+
+ If (nComOk = ERRORE_OSAI) Then
+
+ ErrMsg = "Error on SetAutoMode" & vbCrLf & what_happened()
+ Return False ' In uscita setto variabile a ERRORVALUE errore
+
+ Else
+
+ Return True
+
+ End If
+
+ ' se sono in debug
+ Else
+ Return True
+ End If ' Endif gestione macchina collegata
+
+ End Function
+
+ ' ---------------------------------
+ ' Seleziona part program da rendere attivo
+ '----------------------------------
+ Public Overridable Function ActivateProgramOnNC(ByRef szNamePrg As String, Optional ByVal nProcess As Integer = 1) As Boolean
+
+ ' returns TRUE if activate OK
+
+ Dim nComOk As Short
+
+ ' se macchina collegata e non in debug
+ If (Not (Debug)) Then
+
+ nComOk = Server.SelectPartProgram_C(SessionOpened, nProcess, szNamePrg, ErrClass, ErrNum)
+
+ If (nComOk = ERRORE_OSAI) Then
+
+ ErrMsg = Message.msg(112) & szNamePrg & vbCrLf & what_happened()
+ Return False ' In uscita setto variabile a ERRORVALUE errore
+
+ Else
+
+ Return True
+
+ End If
+
+ ' se sono in debug
+ Else
+ Return True
+ End If ' Endif gestione macchina collegata
+
+ End Function
+
+ Public Overridable Function ActivatePP(ByVal szPartPrg As String, Optional ByVal nProcess As UShort = 1) As Short
+ Return ActivateProgramOnNC(szPartPrg, nProcess)
+ End Function
+
+ ' ---------------------------------
+ ' Setta modalità CN Edit, Auto, MDI, ....
+ '----------------------------------
+ Public Overridable Function SetMode(ByVal nMode As Short, Optional ByVal nProcess As Integer = 1) As Boolean
+
+ Dim nComOk As Short ' Se 1 lettura OK Se 0 lettura KO
+
+ ' se macchina collegata e non in debug
+ If (Not (Debug)) Then
+
+ nComOk = Server.SetProcessMode_C(SessionOpened, nProcess, nMode, ErrClass, ErrNum)
+
+ If (nComOk = ERRORE_OSAI) Then
+
+ ErrMsg = Message.msg(119) & vbCrLf & "Class: " & Str(ErrClass) & " Number: 0x" & Hex(ErrNum)
+ Return False ' In uscita setto variabile a ERRORVALUE errore
+
+ Else
+
+ Return True
+
+ End If
+
+ ' se sono in debug
+ Else
+
+ Return True
+
+ End If ' Endif gestione macchina collegata
+
+ End Function
+
+ ' ---------------------------------
+ ' Stringa MDI da eseguire
+ '----------------------------------
+ Public Overridable Function SetMdiString(ByRef szString As String, Optional ByVal nProcess As Integer = 1) As Boolean
+
+ Dim nComOk As Short ' Se 1 lettura OK Se 0 lettura KO
+
+ ' se macchina collegata e non in debug
+ If (Not (Debug)) Then
+
+ nComOk = Server.SetMdiString_C(SessionOpened, nProcess, szString, ErrClass, ErrNum)
+
+ If (nComOk = ERRORE_OSAI) Then
+
+ ErrMsg = Message.msg(120) & vbCrLf & "Class: " & Str(ErrClass) & " Number: 0x" & Hex(ErrNum)
+ Return False ' In uscita setto variabile a ERRORVALUE errore
+
+ Else
+
+ Return True
+
+ End If
+
+ ' se sono in debug
+ Else
+
+ Return True
+
+ End If ' Endif gestione macchina collegata
+
+ End Function
+
+#End Region
+
+#Region " funzione nuove per open series, qui vuote"
+
+
+
+ Public Overridable Function GetActualTool(Optional ByVal nProcess As Integer = 1) As Double
+ Return 0
+ End Function
+
+ Public Overridable Function GetActualCorr(Optional ByVal nProcess As Integer = 1) As UShort
+ Return 0
+ End Function
+
+ Public Overridable Function GetFeedOverride(Optional ByVal nProcess As Integer = 1) As UShort
+ Return 0
+ End Function
+
+ Public Overridable Function GetRapidOverride(Optional ByVal nProcess As Integer = 1) As UShort
+ Return 0
+ End Function
+
+ Public Overridable Function GetSpeedOverride(Optional ByVal nProcess As Integer = 1) As UShort
+ Return 0
+ End Function
+
+ Public Overridable Function GetProgrammedRapid(Optional ByVal nProcess As Integer = 1) As Double
+ Return 0.0
+ End Function
+
+ Public Overridable Function GetProgrammedFeed(Optional ByVal nProcess As Integer = 1) As Double
+ Return 0.0
+ End Function
+
+ Public Overridable Function GetProgrammedSpeed(Optional ByVal nProcess As Integer = 1) As Double
+ Return 0.0
+ End Function
+
+ Public Overridable Function GetActualFeed(Optional ByVal nProcess As Integer = 1) As Double
+ Return 0.0
+ End Function
+
+ Public Overridable Function GetActualSpeed(Optional ByVal nProcess As Integer = 1) As Double
+ Return 0.0
+ End Function
+
+ Public Overridable Function GetActualToolLen(ByVal nRecord As UInteger) As Double
+
+ Dim n_ret As Short
+ Dim pRecordBuff As CndexLinkDotNet.Cndex.OFFSET_TABLE
+
+ If (Not (Debug)) Then
+
+ n_ret = Server.GetOffsetTabRecord_C(SessionOpened, nRecord, pRecordBuff, ErrClass, ErrNum)
+
+ If (n_ret = ERRORE_OSAI) Then
+ ErrMsg = Message.msg(120) & vbCrLf & "Class: " & Str(ErrClass) & " Number: 0x" & Hex(ErrNum)
+ Return -999998.999 ' In uscita setto variabile a ERRORVALUE errore
+ Else
+ Return pRecordBuff.tactl1
+ End If
+ Else ' se sono in debug
+ Return 10.0
+ End If ' Endif gestione macchina collegata
+
+ End Function
+
+ Public Overridable Function GetActualToolDiam(ByVal nRecord As UInteger) As Double
+
+ Dim n_ret As Short
+ Dim pRecordBuff As CndexLinkDotNet.Cndex.OFFSET_TABLE
+
+ If (Not (Debug)) Then
+
+ n_ret = Server.GetOffsetTabRecord_C(SessionOpened, nRecord, pRecordBuff, ErrClass, ErrNum)
+
+ If (n_ret = ERRORE_OSAI) Then
+ ErrMsg = Message.msg(120) & vbCrLf & "Class: " & Str(ErrClass) & " Number: 0x" & Hex(ErrNum)
+ Return -999997.999 ' In uscita setto variabile a ERRORVALUE errore
+ Else
+ Return pRecordBuff.tdiameter
+ End If
+ Else ' se sono in debug
+ Return 20.0
+ End If ' Endif gestione macchina collegata
+
+ End Function
+
+ Public Overridable Function GetActualToolDiam2(ByVal nRecord As UInteger) As Double
+
+ Dim n_ret As Short
+ Dim pRecordBuff As CndexLinkDotNet.Cndex.OFFSET_TABLE
+
+ If (Not (Debug)) Then
+
+ n_ret = Server.GetOffsetTabRecord_C(SessionOpened, nRecord, pRecordBuff, ErrClass, ErrNum)
+
+ If (n_ret = ERRORE_OSAI) Then
+ ErrMsg = Message.msg(120) & vbCrLf & "Class: " & Str(ErrClass) & " Number: 0x" & Hex(ErrNum)
+ Return -999997.999 ' In uscita setto variabile a ERRORVALUE errore
+ Else
+ Return pRecordBuff.tcacdiam
+
+ End If
+ Else ' se sono in debug
+ Return 20.0
+ End If ' Endif gestione macchina collegata
+
+ End Function
+
+ Public Overridable Function PutFile(ByRef szPathFile As String, ByVal szTargetPath As String, ByRef nErrClass As UInteger, ByRef nErrNum As UInteger, ByRef FileSize As Integer) As Integer
+ Return 0
+ End Function
+
+ Public Overridable Function ReadPPLines(ByVal nProcess As Integer, ByRef EightLines() As String, ByRef nErrClass As UInteger, ByRef nErrNum As UInteger) As Boolean
+ Return True
+ End Function
+
+#End Region
+
+#Region "Controllo win Nbi"
+
+ '''
+ ''' Verifica se è installata la WINNBI e se è una versione compatibile con .NET
+ '''
+ ''' Versione compatibile con framework .NET
+ Shared Function GetWinnbi(Optional ByRef DotNet As Boolean = False) As Boolean
+
+ Dim DotNetMinVersion As New System.Version("3.1.1")
+ Dim readValue() As String
+ Dim Ver As System.Version
+ Dim key As RegistryKey
+ Dim b_ret As Boolean
+
+ b_ret = False
+
+ Try
+
+ 'leggo le versioni installate
+ key = Registry.LocalMachine.OpenSubKey("SOFTWARE\OSAI\WinNBI")
+ readValue = key.GetSubKeyNames
+ 'verifico che ci sia al massimo una versione installata
+ If readValue.Count > 1 Then
+ MessageBox.Show("more versions of WinNBI found." & vbNewLine &
+ "Please ckeck keys in HKEY_LOCAL_MACHINE\SOFTWARE\OSAI\WinNBI",
+ "Error on GetWinnbi", MessageBoxButtons.OK, MessageBoxIcon.Error)
+ End If
+
+ 'MsgBox("readValue(0) = " & readValue(0) & vbCrLf & "readValue.Count = " & readValue.Count.ToString)
+
+ ' in XP la 4.0.1 mi ritorna 3.2 ....errore di lunghezza
+
+ If readValue(0).Length < 4 Then
+ readValue(0) = readValue(0) & "0"
+ End If
+
+ 'La precisione di Osai nel rilasciare le versioni !!
+ ' If readValue(0) = "3.05" Then readValue(0) = "3.0.5"
+ ' If readValue(0) = "3.03" Then readValue(0) = "3.0.3"
+
+ If (readValue(0).Substring(0, 3) = "3.0") And (readValue(0).Substring(3, 1) <> ".") Then
+ readValue(0) = Replace(readValue(0), "3.0", "3.0.")
+ End If
+
+
+ For Each szVersion As String In readValue
+ Ver = New System.Version(szVersion)
+
+ 'se versione compatibile con framework .NET
+ If Ver >= DotNetMinVersion Then
+ DotNet = True
+ End If
+
+ 'se entro almeno una volta ho trovato almeno una versione installata
+ b_ret = True
+
+ Next
+
+
+ 'DotNet = False '!!
+
+ Catch e As Exception
+
+ If Not b_force_S10WLK32 Then
+ MsgBox("Unable to get WinNbi version... " & e.ToString, MsgBoxStyle.Critical, "error in GetWinnbi")
+ End If
+
+ b_ret = False
+
+
+ End Try
+
+ Return b_ret
+
+ End Function
+
+ '''
+ ''' restituisce la versione installata di WINNBI
+ '''
+ Shared Function GetWinnbi_version() As String
+
+ Dim readValue() As String
+ Dim key As RegistryKey
+
+ Try
+ 'leggo le versioni installate
+ key = Registry.LocalMachine.OpenSubKey("SOFTWARE\OSAI\WinNBI")
+ readValue = key.GetSubKeyNames
+
+ 'La precisione di Osai nel rilasciare le versioni !!
+ If readValue(0) = "3.05" Then readValue(0) = "3.0.5"
+ If readValue(0) = "3.03" Then readValue(0) = "3.0.3"
+ Return readValue(0)
+
+ Catch e As Exception
+ MsgBox("Unable to get WinNbi version... " & e.ToString, "error in GetWinnbi_version")
+
+ Return "0.9.99"
+
+ End Try
+
+
+
+
+ End Function
+
+#End Region
+
+#Region "Explain what happened"
+
+ ' Error codes for NETBIOS class (class 3)
+ '
+ ' 0x0001 Illegal buffer length
+ ' 0x0003 Illegal command
+ ' 0x0005 Command timed out
+ ' 0x0006 Message incomplete, issue another command
+ ' 0x0007 Illegal buffer address
+ ' 0x0008 Session number out of range
+ ' 0x0009 No resource available
+ ' 0x000a Session closed
+ ' 0x000b Command cancelled
+ ' 0x000d Duplicate name
+ ' 0x000e Name table full
+ ' 0x000f No deletions, name has active sessions
+ ' 0x0011 Local session table full
+ ' 0x0012 Remote session table full
+ ' 0x0013 Illegal name number
+ ' 0x0014 No callname
+ ' 0x0015 Cannot put * in NCB_NAME
+ ' 0x0016 Name in use on remote adapter
+ ' 0x0017 Name deleted
+ ' 0x0018 Session ended abnormally
+ ' 0x0019 Name conflict detected
+ ' 0x0021 Interface busy, IRET before retrying
+ ' 0x0022 Too many commands outstanding, retry later
+ ' 0x0023 Ncb_lana_num field invalid
+ ' 0x0024 Command completed while cancel occurring
+ ' 0x0026 Command not valid to cancel
+ ' 0x0030 Name defined by anther local process
+ ' 0x0034 Environment undefined. RESET required
+ ' 0x0035 Required OS resources exhausted
+ ' 0x0036 Max number of applications exceeded
+ ' 0x0037 No saps available for netbios
+ ' 0x0038 Requested resources are not available
+ ' 0x0039 Invalid ncb address or length > segment
+ ' 0x003B Invalid NCB DDID
+ ' 0x003C Lock of user area failed
+ ' 0x003f NETBIOS not loaded
+ ' 0x0040 System error
+
+ Const NETBIOS_class As Integer = 3
+
+ Const No_callname_err As Integer = 20 ' 0x0014 No callname
+
+ Const CNC_Error_class As Integer = 4
+
+ Const CL4_Syntax_error As Integer = 1
+ Const CL4_Format_error As Integer = 8
+ Const CL4_Undefined_symbol As Integer = 9
+ Const CL4_Duplicated_label As Integer = 53
+ Const CL4_Label_too_long As Integer = 55
+ Const CL4_Sub_Table_overflow As Integer = 56
+ Const CL4_Label_Table_overflow As Integer = 57
+ Const CL4_Part_program_handling_error As Integer = 65
+ Const CL4_Part_program_not_found As Integer = 66
+
+ Const CNDEX_INTERFACE_class As Integer = 10
+
+ Const ERR_SERVER_ALREADY_CREATED As Integer = 1 ' CNDEX server already created
+ Const ERR_CREATING_SERVER_OBJECT As Integer = 2 ' Error creating CNDEX server
+ Const ERR_SERVER_NOT_CREATED As Integer = 3 ' CNDEX server never created or already released
+ Const ERR_INVALID_PARAMETER As Integer = 4 ' Invalid value for one or more parameters
+ Const ERR_OPTION_NOT_ENABLED As Integer = 5 ' The COMMUNICATION option is not enabled for connected CNC
+
+
+ Function what_happened() As String
+ Dim sz_return As String
+
+ sz_return = "Class: " & Str(ErrClass) & " Number: 0x" & Hex(ErrNum)
+
+ Select Case ErrClass
+
+ Case NETBIOS_class ' --------------------------- class3 - NETBIOS -----------------
+
+ Select Case ErrNum
+ Case No_callname_err
+ sz_return = "Please verify connection ( cable etc. )" & vbCrLf & vbCrLf & "( No call name - Class 3 err 0x14 )"
+
+ End Select
+
+ Case CNC_Error_class ' --------------------------- class4 - CNC_Error -----------------
+
+ Select Case ErrNum
+ Case CL4_Syntax_error
+ sz_return = "Syntax error" & vbCrLf & vbCrLf & "( Class 4 err 1 )"
+
+ Case CL4_Format_error
+ sz_return = "Format error" & vbCrLf & vbCrLf & "( Class 4 err 8 )"
+
+ Case CL4_Undefined_symbol
+ sz_return = "Undefined symbol" & vbCrLf & vbCrLf & "( Class 4 err 9 )"
+
+ Case CL4_Duplicated_label
+ sz_return = "Duplicated label" & vbCrLf & vbCrLf & "( Class 4 err 53 )"
+
+ Case CL4_Label_too_long
+ sz_return = "Label too long" & vbCrLf & vbCrLf & "( Class 4 err 55 )"
+
+ Case CL4_Sub_Table_overflow
+ sz_return = "Subroutine Table overflow" & vbCrLf & vbCrLf & "( Class 4 err 56 )"
+
+ Case CL4_Label_Table_overflow
+ sz_return = "Label Table overflow" & vbCrLf & vbCrLf & "( Class 4 err 57 )"
+
+ Case CL4_Part_program_handling_error
+ sz_return = "Part_program_handling_error" & vbCrLf & vbCrLf & "( Class 4 err 65 )"
+
+ Case CL4_Part_program_not_found
+ sz_return = "Part_program_not_found" & vbCrLf & vbCrLf & "( Class 4 err 66 )"
+
+ End Select ' class4 - CNC_Error
+
+
+
+ Case CNDEX_INTERFACE_class ' --------------------------- class 10 - CNDEX_INTERFACE -----------------
+
+ Select Case ErrNum
+ Case ERR_SERVER_ALREADY_CREATED
+ sz_return = "CNDEX server already created ( Class 10 err 1 )"
+
+ Case ERR_CREATING_SERVER_OBJECT
+ sz_return = "Error creating CNDEX server ( Class 10 err 2 )"
+
+ Case ERR_SERVER_NOT_CREATED
+ sz_return = "CNDEX server never created or already released ( Class 10 err 3 )"
+
+ Case ERR_INVALID_PARAMETER
+ sz_return = "Invalid value for one or more parameters ( Class 10 err 4 )"
+
+ Case ERR_OPTION_NOT_ENABLED
+ sz_return = vbCrLf & "The 'A06 CndexLink communication' option is not enabled on connected CNC ( Class 10 err 5 )"
+ End Select
+
+ End Select
+
+
+ Return sz_return
+
+ End Function
+
+#End Region
+
+End Class
+
diff --git a/CVCncLib/Modules/ComCNOsaiVB6.vb b/CVCncLib/Modules/ComCNOsaiVB6.vb
new file mode 100644
index 00000000..d6f57e44
--- /dev/null
+++ b/CVCncLib/Modules/ComCNOsaiVB6.vb
@@ -0,0 +1,377 @@
+'
+' libreria : VBlib
+' file : ComCNOsaiVB6
+'
+' funzioni : connessione con CN OSAI come classe - override metodi per vecchie versioni WinNbi
+'
+' copyright 2008-2016 C.Viviani
+'
+Imports Microsoft.Win32
+
+Public Class ComCNOSAIVB6
+
+ Inherits ComCNOsai
+
+ Public Sub New(ByRef szRemoteName As String, ByRef b_debug As Boolean)
+
+ MyBase.New(szRemoteName, b_debug)
+
+ End Sub
+
+ Public Overrides Function OpenSession() As Boolean
+
+ Dim nReturn As Short
+
+ 'mi connetto al server Cndex
+ nReturn = ConnectServer_C("", mErrClass, mErrNum)
+
+ If nReturn = ERRORE_OSAI Then
+ Connected = False
+ ErrMsg = "Error on ConnectServer_C" & vbCrLf & "Class: " & Str(ErrClass) & " Number: 0x" & Hex(ErrNum)
+ Else
+ 'apro una sessione col CN
+ Connected = True
+ nReturn = OpenSession_C(NomeCn, SessionOpened, mErrClass, mErrNum)
+
+ If nReturn = ERRORE_OSAI Then
+ Connected = False
+ ErrMsg = "Error on OpenSession_C" & vbCrLf & "Class: " & Str(ErrClass) & " Number: 0x" & Hex(ErrNum)
+ End If
+ End If
+
+ Return Connected
+
+ End Function
+
+ Public Overrides Function CloseSession() As Boolean
+ Dim nReturn As Short
+ Dim bOk As Boolean
+
+ bOk = True
+
+ 'chiudo la sessione
+ nReturn = CloseSession_C(SessionOpened, mErrClass, mErrNum)
+ If nReturn = ERRORE_OSAI Then
+ ErrMsg = "Error on CloseSession_C" & vbCrLf & "Class: " & Str(ErrClass) & " Number: 0x" & Hex(ErrNum)
+ Connected = False
+ bOk = False
+ Else
+ Connected = False
+ End If
+
+ 'rilascio il server Cndex
+ nReturn = ReleaseServer_C(mErrClass, mErrNum)
+ If nReturn = ERRORE_OSAI Then
+ ErrMsg = "Error on ReleaseServer_C" & vbCrLf & "Class: " & Str(ErrClass) & " Number: 0x" & Hex(ErrNum)
+ Connected = False
+ bOk = False
+ Else
+ Connected = False
+ End If
+
+ Return bOk
+
+ End Function
+
+ '------------------------------
+ ' Lettura variabile Short su Cn
+ '------------------------------
+ Public Overrides Function ReadShortVar(ByVal szVar As stVAR, Optional ByVal nProcess As Integer = 1) As Short
+
+ Dim nValues As Short
+ Dim pVar As PLVARDESC
+ Dim nComOk As Short ' Se 1 lettura OK Se 0 lettura KO
+ Dim nNumVarToBeReaded As Integer = 1 ' Numero di variabili da leggere (fisso a 1)
+
+ pVar.Code = CndexLinkUserVB6.GW_CODE
+ pVar.Index = szVar.nAddress
+
+ ' se macchina collegata e non in debug
+ If (Not (Debug)) Then
+
+ nComOk = GetPLVarWord_C(SessionOpened, nNumVarToBeReaded, pVar, nValues, ErrClass, ErrNum)
+
+ If (nComOk = ERRORE_OSAI) Then
+
+ ErrMsg = "Error on GetPLVarWord_C" & vbCrLf & "Class: " & Str(ErrClass) & " Number: 0x" & Hex(ErrNum)
+ Return CShort(ERRORVALUE) ' In uscita setto variabile a ERRORVALUE errore
+
+ Else
+
+ ' return con il valore letto
+ Return nValues
+
+ End If
+
+
+ Else ' gestione se debug
+
+ ' ritorno true
+ Return 1
+
+ End If
+
+ End Function
+
+ '--------------------------------
+ ' Lettura multi variabile MW su Cn
+ '--------------------------------
+ Public Overrides Function ReadMultipleVarMW(ByVal nAddress As Integer, ByRef nValues() As Short, ByVal nNumVarToRead As Short, Optional ByVal nProcess As Integer = 1) As Boolean
+
+ Dim pVar As PLVARDESC
+ Dim nComOk As Short ' Se 1 lettura OK Se 0 lettura KO
+
+ pVar.Code = CndexLinkUserVB6.MW_CODE
+ pVar.Index = nAddress
+
+ ' se macchina collegata e non in debug
+ If (Not (Debug)) Then
+
+ nComOk = GetPLVarWord_M_C(SessionOpened, nNumVarToRead, pVar, nValues, ErrClass, ErrNum)
+
+ If (nComOk = ERRORE_OSAI) Then
+
+ ErrMsg = "Error on GetPLVarWord_M_C" & vbCrLf & "Class: " & Str(ErrClass) & " Number: 0x" & Hex(ErrNum)
+ Return False
+
+ Else
+
+ ' return con il valore letto
+ Return True
+
+ End If
+
+
+ Else ' gestione se debug
+
+ ' ritorno true
+ Return True
+
+ End If
+
+ End Function
+
+ ' -------------------------------
+ ' Scrittura variabile Short su Cn
+ '---------------------------------
+ Public Overrides Function WriteShortVar(ByVal szVar As stVAR, ByVal nValue As Short, Optional ByVal nProcess As Integer = 1) As Boolean
+
+ Dim pVar As PLVARDESC
+ Dim nComOk As Short ' Se 1 scritt. OK Se 0 lettura KO
+ Dim nNumVarToBeWrited As Integer = 1 ' Numero di variabili da leggere (fisso a 1)
+
+ If (Not (Debug)) Then ' Se macchina collegata
+
+ pVar.Bit = szVar.nBit
+ pVar.Code = CndexLinkUserVB6.GW_CODE
+ pVar.Index = szVar.nAddress
+ nComOk = SetPLVarWord_C(SessionOpened, nNumVarToBeWrited, pVar, nValue, ErrClass, ErrNum)
+
+ If (nComOk = ERRORE_OSAI) Then
+
+ ErrMsg = "Error on SetPLVarWord_C" & vbCrLf & "Class: " & Str(ErrClass) & " Number: 0x" & Hex(ErrNum)
+ Return False
+
+ Else
+
+ Return True
+
+ End If
+
+ Else ' gestione in debug
+
+ Return True
+
+ End If
+
+
+ End Function
+
+ '--------------------------------
+ ' Lettura variabile SC su Cn
+ '--------------------------------
+ Public Overrides Function ReadSCVar(ByVal nIndex As Integer, ByVal nNumChar As Integer, Optional ByVal nProcess As Integer = 1) As String
+
+ Dim szValue As String = " "
+ Dim nComOk As Short ' Se 1 lettura OK Se 0 lettura KO
+
+ ' se macchina collegata e non in debug
+ If (Not (Debug)) Then
+
+ nComOk = GetVarSC_C(SessionOpened, nProcess, nIndex, nNumChar, szValue, ErrClass, ErrNum)
+
+ If (nComOk = ERRORE_OSAI) Then
+ ErrMsg = "Error on reading SC variable" & vbCrLf & "Class: " & Str(ErrClass) & " Number: 0x" & Hex(ErrNum)
+ Return "" ' In uscita setto variabile a ERRORVALUE errore
+ Else
+ ' return con il valore letto
+ Return szValue
+ End If
+
+
+ Else ' gestione se debug
+
+ ' ritorno true
+ Return "SC VAR - DEBUG"
+
+ End If
+
+
+ End Function
+
+ ' ---------------------------------
+ ' Scrittura variabile SC su Cn
+ '----------------------------------
+ Public Overrides Function WriteSCVar(ByVal nIndex As Integer, ByVal nNumChar As Integer, ByVal szText As String, Optional ByVal nProcess As Integer = 1) As Boolean
+
+ Dim nComOk As Short ' Se 1 scrittura OK Se 0 scrittura KO
+
+ ' se macchina collegata e non in debug
+ If (Not (Debug)) Then
+
+ nComOk = SetVarSC_C(SessionOpened, nProcess, nIndex, nNumChar, szText, ErrClass, ErrNum)
+
+ If (nComOk = ERRORE_OSAI) Then
+
+ ErrMsg = "Error on writing SC variable" & vbCrLf & "Class: " & Str(ErrClass) & " Number: 0x" & Hex(ErrNum)
+ Return False ' In uscita setto variabile a ERRORVALUE errore
+
+ Else
+
+ Return True
+
+ End If
+
+ ' se sono in debug
+ Else
+
+ Return True
+
+ End If ' Endif gestione macchina collegata
+
+ End Function
+
+ '------------------------------
+ ' Lettura variabile E su Cn
+ '------------------------------
+ Public Overrides Function ReadVarE(ByVal szVar As stVAR, Optional ByVal nProcess As Integer = 1) As Double
+
+ Dim dValues As Double
+ Dim pVar As PLVARDESC
+ Dim nComOk As Short ' Se 1 lettura OK Se 0 lettura KO
+ Dim nNumVarToBeReaded As Integer = 1 ' Numero di variabili da leggere (fisso a 1)
+
+ pVar.Code = CndexLinkUserVB6.GW_CODE
+ pVar.Index = szVar.nAddress
+
+ ' se macchina collegata e non in debug
+ If (Not (Debug)) Then
+
+ nComOk = GetVarE_C(SessionOpened, nProcess, szVar.nAddress, nNumVarToBeReaded, dValues, ErrClass, ErrNum)
+
+ If (nComOk = ERRORE_OSAI) Then
+
+ ErrMsg = "Error on GetVarE_C" & vbCrLf & "Class: " & Str(ErrClass) & " Number: 0x" & Hex(ErrNum)
+ Return CShort(ERRORVALUE) ' In uscita setto variabile a ERRORVALUE errore
+
+ Else
+
+ ' return con il valore letto
+ Return dValues
+
+ End If
+
+
+ Else ' gestione se debug
+
+ ' ritorno true
+ Return 1
+
+ End If
+
+ End Function
+
+
+ '------------------------------
+ ' Lettura process stato info Cn
+ '------------------------------
+ '
+ ' ha causato molto dispiacere il fatto che se uso la Server.GetProcessStatus_C con winnbi < 3.1.1
+ ' dà una UNRESOLVED a run time della GetProcessStatus_C8 ( notare l' "8" finale ) nella CNDEXLINK.DLL
+ '
+ ' soluzione : con Win Nbi recenti, uso Server.GetProcessStatus_C ; con Winnbi vecchi, faccio override
+ ' di questa funzione USANDO LA STRUTTURA NUOVA CndexLinkDotNet.Cndex.PROCDATA ( altrimenti non è possibile
+ ' fare override; uso una variabile locale tipo vecchio ( PROCDATA ) e in caso di esito positivo,
+ ' copio i dati risultanti.
+ '
+ ' Attenzione : si ha lo stesso problema anche con la Server.GetNcInfo1_C ma curiosamente non con le funzioni
+ ' di lettura scrittura variabili CN .... boh !!
+
+ Public Overrides Function NcProcessStatus(ByRef ncInfo As CndexLinkDotNet.Cndex.PROCDATA, Optional ByVal nProcess As Integer = 1) As Boolean
+
+ Dim nComOk As Short ' Se 1 lettura OK Se 0 lettura KO
+ Dim geppodata As PROCDATA ' trucco sporchissimo : la versione dotnet richiede un altro tipo di dati...
+
+ ' se macchina collegata e non in debug
+ If (Not (Debug)) Then
+
+ nComOk = GetProcessStatus_C(SessionOpened, nProcess, geppodata, ErrClass, ErrNum)
+
+ If (nComOk = ERRORE_OSAI) Then
+
+ ErrMsg = "Error on GetProcessStatus_C" & vbCrLf & "Class: " & Str(ErrClass) & " Number: 0x" & Hex(ErrNum)
+ Return False ' In uscita setto variabile a ERRORVALUE errore
+
+ Else
+ ncInfo.Status = geppodata.status
+ ncInfo.SubStatus = geppodata.substatus
+
+ Return True
+
+ End If
+
+ ' se sono in debug
+ Else
+
+ Return True
+
+ End If ' Endif gestione macchina collegata
+
+ End Function
+
+ ' -------------------------------------------------
+ ' Lettura stato macchina su processo passato per parametro
+ '--------------------------------------------------
+ Public Overrides Function GetMachineStatus(Optional ByVal nProcess As Integer = 1) As Byte
+ '
+ ' se non andasse, usare NcProcessStatus e prendere solo lo stato......
+
+ Dim RetVal As Short
+
+ Dim geppodata As PROCDATA ' trucco sporchissimo : la versione dotnet richiede un altro tipo di dati...
+
+ ' se macchina collegata e non in debug
+ If (Not (Debug)) Then
+
+ RetVal = GetProcessStatus_C(SessionOpened, nProcess, geppodata, ErrClass, ErrNum)
+
+ If RetVal > 0 Then
+ Return Convert.ToByte(geppodata.status)
+
+ Else
+ ErrMsg = "Error on GetMachineStatus" & vbCrLf & what_happened()
+ Return 255
+
+ End If
+ ' se sono in debug
+ Else
+ Return True
+ End If
+
+
+ End Function
+
+
+
+End Class
+
diff --git a/CVCncLib/Modules/ComCnOsaiOpen_Series.vb b/CVCncLib/Modules/ComCnOsaiOpen_Series.vb
new file mode 100644
index 00000000..9c94cac3
--- /dev/null
+++ b/CVCncLib/Modules/ComCnOsaiOpen_Series.vb
@@ -0,0 +1,1253 @@
+'
+' libreria : VBlib
+' file : ComCNOsaiOpen_Series.vb
+'
+' funzioni : connessione con CN OSAI open come classe - override metodi per nuovo CN
+'
+' copyright 2008-2016 C.Viviani
+'
+Imports System.Collections
+Imports System.Collections.Generic
+Imports System.Data
+Imports System.Diagnostics
+Imports System.Runtime.InteropServices
+
+Public Class Open_Series
+ Inherits ComCNOsai
+
+ Dim OsaiServer As OpenControl.OPENcontrolPortTypeClient
+
+ Public Const L_CODE As Integer = 145
+
+ Private Const NO_ERROR As UShort = 1
+
+ Private PhaseCN As Integer
+ Private ProcessCN As Integer
+
+#Region "COSTRUTTORE"
+
+ Public Sub New(ByVal szAddress As String, ByVal bIsDebug As Boolean, Optional ByVal sVersion As Short = 2)
+
+ MyBase.New(szAddress, bIsDebug, sVersion)
+
+ End Sub
+
+
+#End Region
+
+#Region "METODI"
+
+
+#Region "METODI - Open/close connection"
+
+ ' ------------------------------
+ ' Apertura sessione con CN Osai
+ ' ------------------------------
+ ' Public Overrides Function OpenSession(ByVal szNomeCn As String) As ULong
+ Public Overrides Function OpenSession() As Boolean
+
+ Connected = False
+
+
+ OsaiServer = New OpenControl.OPENcontrolPortTypeClient("OPENcontrol", "http://" & NomeCn & ":8080")
+
+ If OsaiServer.State = ServiceModel.CommunicationState.Created Then
+ Try
+ O_BootPhaseEnquiry(PhaseCN, ErrClass, ErrNum)
+
+ Catch ex As Exception
+ MsgBox("Controllo non connesso !!!" & vbCrLf & ex.Message) '!!!!!!!!!!!!!!!!!!!!!!!!!!
+ End Try
+ ' Lettura processo CN
+ If PhaseCN = SYSTEM_UP_PHASE Then
+ Connected = True
+ Else
+ MsgBox("Boot phase " & ErrNum)
+ End If
+
+ End If
+
+ Return Connected
+
+
+ End Function
+
+ Private Function O_BootPhaseEnquiry(ByRef Phase As Integer, ByRef nErrClass As UShort, ByRef nErrNum As UShort) As Integer
+ Dim oBootPhaseInquiry As New OpenControl.BootPhaseEnquiry
+ Dim retBootPhaseInquiry As OpenControl.BootPhaseEnquiryR
+
+ retBootPhaseInquiry = OsaiServer.BootPhaseEnquiry(oBootPhaseInquiry)
+
+ nErrClass = retBootPhaseInquiry.ErrClass
+ nErrNum = retBootPhaseInquiry.ErrNum
+ Phase = retBootPhaseInquiry.Phase
+
+ O_BootPhaseEnquiry = retBootPhaseInquiry.retval
+
+ End Function
+
+ Public Overrides Function CloseSession() As Boolean
+
+
+ End Function
+
+
+#End Region
+
+#Region "METODI - Lettura/scrittura variabili CN"
+
+ '------------------------------
+ ' Lettura / scittura variabili SC su Cn
+ '------------------------------
+ Public Overrides Function ReadSCVar(ByVal nIndex As Integer, ByVal nNumChar As Integer, Optional ByVal nProcess As Integer = 1) As String
+
+ Dim InputStruct As New OpenControl.ReadVarText
+ Dim RetVal As OpenControl.ReadVarTextR
+
+ If (Not (Debug)) Then ' se macchina collegata e non in debug
+
+ InputStruct.Code = CndexLinkDotNet.Cndex.SC_CODE ' 50
+ InputStruct.Index = nIndex
+ InputStruct.Size = nNumChar
+ InputStruct.Process = nProcess
+
+ RetVal = OsaiServer.ReadVarText(InputStruct)
+ If (RetVal.retval > 0) Then
+ Return RetVal.Text
+ Else
+ ErrClass = RetVal.ErrClass
+ ErrNum = RetVal.ErrNum
+ ErrMsg = "Error on reading string variable" & vbCrLf & what_happened()
+ Return "?????????????????????"
+ End If
+ ' se sono in debug
+ Else
+ Return "OK"
+ End If ' Endif gestione macchina collegata
+
+ End Function
+
+ Public Overrides Function WriteSCVar(ByVal nIndex As Integer, ByVal nNumChar As Integer, ByVal szText As String, Optional ByVal nProcess As Integer = 1) As Boolean
+
+ Dim InputStruct As New OpenControl.WriteVarText
+ Dim RetVal As OpenControl.WriteVarTextR
+
+
+ If (Not (Debug)) Then ' se macchina collegata e non in debug
+
+ InputStruct.Code = CndexLinkDotNet.Cndex.SC_CODE ' 50
+ InputStruct.Index = nIndex
+ InputStruct.Len = nNumChar
+ InputStruct.Process = nProcess
+ InputStruct.Text = szText
+
+ RetVal = OsaiServer.WriteVarText(InputStruct)
+
+ If (RetVal.retval > 0) Then
+ Return True
+ Else
+ ErrClass = RetVal.ErrClass
+ ErrNum = RetVal.ErrNum
+ ErrMsg = "Error on writing string variable" & vbCrLf & what_happened()
+ Return False
+ End If
+ ' se sono in debug
+ Else
+ Return True
+ End If ' Endif gestione macchina collegata
+
+ End Function
+
+ '------------------------------
+ ' Lettura variabile Bool su Cn
+ '------------------------------
+ Public Overrides Function ReadBoolVar(ByVal szVar As stVAR, Optional ByVal nProcess As Integer = 1) As Short
+ Dim InputStruct As New OpenControl.ReadVarWord
+ Dim RetVal As OpenControl.ReadVarWordR
+ Dim nValues(0) As Short ' Array (lo vuole la libreria Osai) che conterrà il valore letto
+
+ InputStruct.NumVar = 1
+ InputStruct.Process = nProcess
+ InputStruct.Code = CndexLinkDotNet.Cndex.GW_CODE ' 21
+ InputStruct.Index = szVar.nAddress
+
+ RetVal = OsaiServer.ReadVarWord(InputStruct)
+ If (RetVal.retval > 0) Then
+ nValues(0) = RetVal.Value(0)
+ If ((nValues(0) And (2 ^ szVar.nBit)) <> 0) Then ' Maschera per controllare solo il bit che mi interessa
+ nValues(0) = 1
+ Else
+ nValues(0) = 0
+ End If
+
+ ' return con il valore letto
+ Return nValues(0)
+
+ Else
+ 'MsgBox("Error on reading bool variable" & vbCrLf & "Class: " & Str(ErrClass) & " Number: 0x" & Hex(ErrNum))
+ Return CShort(ERRORVALUE) ' In uscita setto variabile a ERRORVALUE errore
+
+ End If
+
+ End Function
+
+ '------------------------------
+ ' Lettura variabile G Short su Cn
+ '------------------------------
+ Public Overrides Function ReadShortVar(ByVal szVar As stVAR, Optional ByVal nProcess As Integer = 1) As Short
+ Dim nValue(0) As Short
+
+ Dim nNumVar As UShort = 1
+ Dim nIndex As UShort = 1
+ Dim sValue() As UShort = {}
+ Dim InputStruct As New OpenControl.ReadVarWord
+ Dim RetVal As OpenControl.ReadVarWordR
+
+ InputStruct.Code = CndexLinkDotNet.Cndex.GW_CODE ' 21
+ InputStruct.Index = szVar.nAddress
+ InputStruct.NumVar = 1
+ InputStruct.Process = nProcess
+
+ RetVal = OsaiServer.ReadVarWord(InputStruct)
+ If (RetVal.retval > 0) Then
+ Return UShortToShort(RetVal.Value(0))
+ Else
+ 'MsgBox("Error on reading Short variable" & vbCrLf & "Class: " & Str(ErrClass) & " Number: 0x" & Hex(ErrNum))
+ Return CShort(ERRORVALUE) ' In uscita setto variabile a ERRORVALUE errore
+ End If
+
+ End Function
+
+ '------------------------------
+ ' Lettura variabile G Double su Cn
+ '------------------------------
+ Public Overrides Function ReadDoubleVar(ByVal szVar As stVAR, Optional ByVal nProcess As Integer = 1) As Double
+ 'Dim nValue(0) As Short
+
+ Dim nNumVar As UShort = 1
+ Dim nIndex As UShort = 1
+ Dim dResult As Double = 0.0
+ Dim InputStruct As New OpenControl.ReadVarDouble
+ Dim RetVal As OpenControl.ReadVarDoubleR
+
+ InputStruct.Code = CndexLinkDotNet.Cndex.GD_CODE ' 41
+ InputStruct.Index = szVar.nAddress
+ InputStruct.NumVar = 1
+ InputStruct.Process = nProcess
+
+ RetVal = OsaiServer.ReadVarDouble(InputStruct)
+ If (RetVal.retval > 0) Then
+ dResult = RetVal.Value(0)
+ Return dResult
+ Else
+ 'MsgBox("Error on reading Short variable" & vbCrLf & "Class: " & Str(ErrClass) & " Number: 0x" & Hex(ErrNum))
+ Return CShort(ERRORVALUE) ' In uscita setto variabile a ERRORVALUE errore
+ End If
+
+ End Function
+
+ '------------------------------
+ ' Lettura variabile E ( double ) su Cn
+ '------------------------------
+ Public Overrides Function ReadVarE(ByVal szVar As stVAR, Optional ByVal nProcess As Integer = 1) As Double
+
+ Dim nValue(0) As Short
+ Dim nNumVar As UShort = 1
+ Dim InputStruct As New OpenControl.ReadVarDouble
+ Dim RetVal As OpenControl.ReadVarDoubleR
+
+ InputStruct.Code = CndexLinkDotNet.Cndex.E_CODE ' 46
+
+ InputStruct.Index = szVar.nAddress
+ InputStruct.NumVar = 1
+ InputStruct.Process = nProcess
+
+ RetVal = OsaiServer.ReadVarDouble(InputStruct)
+ If (RetVal.retval > 0) Then
+ Return RetVal.Value(0)
+ Else
+ 'MsgBox("Error on reading E variable" & vbCrLf & "Class: " & Str(ErrClass) & " Number: 0x" & Hex(ErrNum))
+ Return CDbl(ERRORVALUE) ' In uscita setto variabile a ERRORVALUE errore
+ End If
+
+ End Function
+
+ '------------------------------
+ ' Lettura variabile L ( double ) su Cn
+ '------------------------------
+ Public Overrides Function ReadVarL(ByVal szVar As stVAR, Optional ByVal nProcess As Integer = 1) As Double
+
+ Dim nValue(0) As Short
+ Dim nNumVar As UShort = 1
+ Dim InputStruct As New OpenControl.ReadVarDouble
+ Dim RetVal As OpenControl.ReadVarDoubleR
+
+ InputStruct.Code = L_CODE ' 145
+
+ InputStruct.Index = szVar.nAddress
+ InputStruct.NumVar = 1
+ InputStruct.Process = nProcess
+
+ RetVal = OsaiServer.ReadVarDouble(InputStruct)
+ If (RetVal.retval > 0) Then
+ Return RetVal.Value(0)
+ Else
+ 'MsgBox("Error on reading L variable" & vbCrLf & "Class: " & Str(ErrClass) & " Number: 0x" & Hex(ErrNum))
+ Return CDbl(ERRORVALUE) ' In uscita setto variabile a ERRORVALUE errore
+ End If
+
+ End Function
+
+ '------------------------------
+ ' Lettura variabile MW su Cn
+ '------------------------------
+ Public Overrides Function ReadVarMW(ByVal szVar As stVAR, Optional ByVal nProcess As Integer = 1) As UShort
+
+ Dim nNumVar As UShort = 1
+ Dim InputStruct As New OpenControl.ReadVarWord
+ Dim RetVal As OpenControl.ReadVarWordR
+
+ InputStruct.Code = CndexLinkDotNet.Cndex.MW_CODE ' 20
+ InputStruct.Index = szVar.nAddress
+ InputStruct.NumVar = 1
+ InputStruct.Process = nProcess
+
+ RetVal = OsaiServer.ReadVarWord(InputStruct)
+ If (RetVal.retval > 0) Then
+
+ Return (RetVal.Value(0))
+ Else
+ 'MsgBox("Error on reading MW variable" & vbCrLf & "Class: " & Str(ErrClass) & " Number: 0x" & Hex(ErrNum))
+ Return CUShort(-ERRORVALUE) ' In uscita setto variabile a ERRORVALUE errore
+ End If
+
+ End Function
+
+ ' -------------------------------
+ ' Scrittura variabile bool su Cn
+ '---------------------------------
+ Public Overrides Function WriteBoolVar(ByVal szVar As stVAR, ByVal nValue As Short, Optional ByVal nProcess As Integer = 1) As Boolean
+
+ Dim nValues(0) As Short ' Array (lo vuole la libreria Osai) che conterrà il valore letto
+ Dim nNumVarToBeWrited As Integer = 1 ' Numero di variabili da leggere (fisso a 1)
+ Dim nResult As Integer = -1
+ Dim InputStruct As New OpenControl.WriteVarWordBit
+ Dim RetVal As OpenControl.WriteVarWordBitR
+
+ nValues(0) = nValue
+
+ ' se macchina collegata e non in debug
+ If (Not (Debug)) Then
+
+ InputStruct.Code = CndexLinkDotNet.Cndex.GW_CODE ' 21
+ InputStruct.Process = nProcess
+ InputStruct.Index = szVar.nAddress
+ InputStruct.BitIndex = szVar.nBit
+ InputStruct.BitValue = nValue
+ RetVal = OsaiServer.WriteVarWordBit(InputStruct)
+
+ If (RetVal.retval <= 0) Then
+ ErrClass = RetVal.ErrClass
+ ErrNum = RetVal.ErrNum
+ ErrMsg = "Error on writing bool variable" & vbCrLf & what_happened()
+ Return False '
+ Else
+ Return True
+ End If
+
+ ' se sono in debug
+ Else
+ Return True
+ End If ' Endif gestione macchina collegata
+
+ End Function
+
+ ' -------------------------------
+ ' Scrittura variabile G Short su Cn
+ '---------------------------------
+ Public Overrides Function WriteShortVar(ByVal szVar As stVAR, ByVal nValue As Short, Optional ByVal nProcess As Integer = 1) As Boolean
+
+ Dim nValues(0) As Short ' Array (lo vuole la libreria Osai) che conterrà il valore letto
+ Dim nNumVarToBeWrited As Integer = 1 ' Numero di variabili da leggere (fisso a 1)
+ Dim nResult As Integer = -1
+ Dim InputStruct As New OpenControl.WriteVarWord
+ Dim RetVal As OpenControl.WriteVarWordR
+
+ nValues(0) = nValue
+
+ ' se macchina collegata e non in debug
+ If (Not (Debug)) Then
+
+ InputStruct.Code = CndexLinkDotNet.Cndex.GW_CODE ' 21
+ InputStruct.NumVar = 1
+ InputStruct.Process = nProcess
+ InputStruct.Index = szVar.nAddress
+ ReDim InputStruct.Value(0)
+ InputStruct.Value(0) = ShortToUShort(nValues(0))
+
+ RetVal = OsaiServer.WriteVarWord(InputStruct)
+
+ If (RetVal.retval <= 0) Then
+ ErrClass = RetVal.ErrClass
+ ErrNum = RetVal.ErrNum
+ ErrMsg = "Error on writing short variable" & vbCrLf & what_happened()
+ Return False ' In uscita setto variabile a ERRORVALUE errore
+ Else
+
+ Return True
+
+ End If
+
+ ' se sono in debug
+ Else
+
+ Return True
+
+ End If ' Endif gestione macchina collegata
+
+ End Function
+
+ ' -------------------------------
+ ' Scrittura variabile G Double su Cn
+ '---------------------------------
+ Public Overrides Function WriteDoubleVar(ByVal szVar As stVAR, ByVal dValue As Double, Optional ByVal nProcess As Integer = 1) As Boolean
+
+ Dim dValues(0) As Double ' Array (lo vuole la libreria Osai) che conterrà il valore letto
+ Dim nNumVarToBeWrited As Integer = 1 ' Numero di variabili da leggere (fisso a 1)
+ Dim nResult As Integer = -1
+ Dim InputStruct As New OpenControl.WriteVarWord
+ Dim RetVal As OpenControl.WriteVarWordR
+
+ dValues(0) = dValue
+
+ ' se macchina collegata e non in debug
+ If (Not (Debug)) Then
+
+ InputStruct.Code = CndexLinkDotNet.Cndex.GD_CODE ' 41
+ InputStruct.NumVar = 1
+ InputStruct.Process = nProcess
+ InputStruct.Index = szVar.nAddress
+ ReDim InputStruct.Value(0)
+ InputStruct.Value(0) = dValues(0)
+
+ RetVal = OsaiServer.WriteVarWord(InputStruct)
+
+ If (RetVal.retval <= 0) Then
+ ErrClass = RetVal.ErrClass
+ ErrNum = RetVal.ErrNum
+ ErrMsg = "Error on writing G DoubleVar " & vbCrLf & what_happened()
+ Return False ' In uscita setto variabile a ERRORVALUE errore
+ Else
+
+ Return True
+
+ End If
+
+ ' se sono in debug
+ Else
+
+ Return True
+
+ End If ' Endif gestione macchina collegata
+
+ End Function
+
+ ' -------------------------------
+ ' Scrittura variabile E su Cn
+ '---------------------------------
+ Public Overrides Function WriteVarE(ByVal szVar As stVAR, ByVal nValue As Double, Optional ByVal nProcess As Integer = 1) As Boolean
+
+ Dim nValues(0) As Double ' Array (lo vuole la libreria Osai) che conterrà il valore letto
+ Dim nNumVarToBeWrited As Integer = 1 ' Numero di variabili da leggere (fisso a 1)
+ Dim nResult As Integer = -1
+ Dim InputStruct As New OpenControl.WriteVarDouble
+ Dim RetVal As OpenControl.WriteVarDoubleR
+
+ nValues(0) = nValue
+
+ If (Not (Debug)) Then ' se macchina collegata e non in debug
+
+ InputStruct.Code = CndexLinkDotNet.Cndex.E_CODE ' 46
+ InputStruct.NumVar = 1
+ InputStruct.Process = nProcess
+ InputStruct.Index = szVar.nAddress
+ ReDim InputStruct.Value(0)
+ InputStruct.Value(0) = nValues(0)
+
+ RetVal = OsaiServer.WriteVarDouble(InputStruct)
+
+ If (RetVal.retval <= 0) Then
+ ErrClass = RetVal.ErrClass
+ ErrNum = RetVal.ErrNum
+ ErrMsg = "Error on writing Write E DoubleVar variable" & vbCrLf & what_happened()
+ Return False ' In uscita setto variabile a ERRORVALUE errore
+ Else
+ Return True
+ End If
+
+ ' se sono in debug
+ Else
+ Return True
+ End If ' Endif gestione macchina collegata
+
+ End Function
+ ' -------------------------------
+ ' Scrittura variabile L su Cn
+ '---------------------------------
+ Public Overrides Function WriteVarL(ByVal szVar As stVAR, ByVal nValue As Double, Optional ByVal nProcess As Integer = 1) As Boolean
+
+ Dim nValues(0) As Double ' Array (lo vuole la libreria Osai) che conterrà il valore letto
+ Dim nNumVarToBeWrited As Integer = 1 ' Numero di variabili da leggere (fisso a 1)
+ Dim nResult As Integer = -1
+ Dim InputStruct As New OpenControl.WriteVarDouble
+ Dim RetVal As OpenControl.WriteVarDoubleR
+
+ nValues(0) = nValue
+
+ If (Not (Debug)) Then ' se macchina collegata e non in debug
+
+ InputStruct.Code = L_CODE ' 145
+ InputStruct.NumVar = 1
+ InputStruct.Process = nProcess
+ InputStruct.Index = szVar.nAddress
+ ReDim InputStruct.Value(0)
+ InputStruct.Value(0) = nValues(0)
+
+ RetVal = OsaiServer.WriteVarDouble(InputStruct)
+
+ If (RetVal.retval <= 0) Then
+ ErrClass = RetVal.ErrClass
+ ErrNum = RetVal.ErrNum
+ ErrMsg = "Error on writing Write L DoubleVar variable" & vbCrLf & what_happened()
+ Return False ' In uscita setto variabile a ERRORVALUE errore
+ Else
+ Return True
+ End If
+
+ ' se sono in debug
+ Else
+ Return True
+ End If ' Endif gestione macchina collegata
+
+ End Function
+
+#End Region
+
+#Region "METODI - Modo CN / PP"
+
+ ' ---------------------------------------------------------------
+ ' Attivazione del modo Auto
+ '----------------------------------------------------------------
+ Public Overrides Function SetAutoMode(Optional ByVal nProcess As Integer = 1) As Boolean
+ Dim RetVal As New OpenControl.SetProcessModeR
+ Dim Mode As New OpenControl.SetProcessMode
+
+ Mode.Mode = 2
+ Mode.ProcNum = nProcess
+
+ RetVal = OsaiServer.SetProcessMode(Mode)
+ If RetVal.retval > 0 Then
+ Return RetVal.retval
+
+ Else
+ 'MsgBox("Error on activating Auto mode " & vbCrLf & "Class: " & Str(ErrClass) & " Number: 0x" & Hex(ErrNum))
+ Return RetVal.retval
+ End If
+ End Function
+
+ ' ---------------------------------------------------------------
+ ' Lettura modalità selezionata su processo passato per parametro
+ '----------------------------------------------------------------
+ Public Overrides Function GetModeSelected(Optional ByVal nProcess As Integer = 1) As Byte
+ Dim InputStruct As New OpenControl.GetNcInfo1
+ Dim RetVal As OpenControl.GetNcInfo1R
+
+ InputStruct.ProcNum = nProcess
+ RetVal = OsaiServer.GetNcInfo1(InputStruct)
+
+ If RetVal.retval > 0 Then
+ Return RetVal.GetInfo.modeselect
+
+ Else
+ 'MsgBox("Error on reading Mode Selected" & vbCrLf & "Class: " & Str(ErrClass) & " Number: 0x" & Hex(ErrNum))
+ Return 0
+ End If
+
+ End Function
+
+ ' ---------------------------------------------------------------
+ ' Attivazione del pp passato per parametro
+ '----------------------------------------------------------------
+ Public Overrides Function ActivatePP(ByVal szPartPrg As String, Optional ByVal nProcess As UShort = 1) As Short
+ Dim RetVal As New OpenControl.SelectPartProgramFromDriveR
+ Dim InputStruct As New OpenControl.SelectPartProgramFromDrive
+
+ InputStruct.PPName = szPartPrg
+ InputStruct.ProcNum = nProcess
+
+ RetVal = OsaiServer.SelectPartProgramFromDrive(InputStruct)
+ If RetVal.retval > 0 Then ' > 0 ok
+ Return RetVal.retval
+
+ Else ' = 0 errore
+ mErrMsg = "Error on activating part-program "
+ mErrClass = RetVal.ErrClass
+ mErrNum = RetVal.ErrNum
+ Return RetVal.retval
+
+ End If
+ End Function
+
+ ' ---------------------------------
+ ' Lettura Programma corrente
+ '----------------------------------
+ Public Function GetActivePP(ByVal nProcess As Integer) As String
+ Dim InputStruct As New OpenControl.GetActivePartProgram
+ Dim RetVal As OpenControl.GetActivePartProgramR
+
+ InputStruct.ProcNum = nProcess
+ RetVal = OsaiServer.GetActivePartProgram(InputStruct)
+
+ If RetVal.retval > 0 Then
+ Return RetVal.Main
+
+ Else
+ mErrMsg = "Error on reading Active Program "
+ mErrClass = RetVal.ErrClass
+ mErrNum = RetVal.ErrNum
+ Return CShort(ERRORVALUE) ' In uscita setto variabile a ERRORVALUE errore
+ End If
+
+ End Function
+
+ ' ---------------------------------------------------------------
+ ' Lettura informazioni CN
+ '----------------------------------------------------------------
+ Public Function NcInfo1Open(ByRef ncInfo As OpenControl.GetNcInfo1R, Optional ByVal nProcess As Integer = 1) As OpenControl.GetNcInfo1R
+ Dim InputStruct As New OpenControl.GetNcInfo1
+ Dim RetVal As OpenControl.GetNcInfo1R
+
+ InputStruct.ProcNum = nProcess
+ RetVal = OsaiServer.GetNcInfo1(InputStruct)
+
+ If RetVal.retval > 0 Then
+ Return RetVal
+
+ Else
+ mErrMsg = "Error on reading NcInfo "
+ mErrClass = RetVal.ErrClass
+ mErrNum = RetVal.ErrNum
+ Return RetVal
+ End If
+ End Function
+
+ ' ---------------------------------
+ ' Lettura info CN 1
+ '----------------------------------
+ Public Overrides Function NcInfo1(ByRef ncInfo As CndexLinkDotNet.Cndex.GETINFO1DATA, Optional ByVal nProcess As Integer = 1) As Boolean
+
+ Dim InputStruct As New OpenControl.GetNcInfo1
+ Dim RetVal As OpenControl.GetNcInfo1R
+
+
+ InputStruct.ProcNum = nProcess
+ RetVal = OsaiServer.GetNcInfo1(InputStruct)
+
+ If RetVal.retval > 0 Then
+
+ ' ncInfo = RetVal.GetInfo
+ ' Assegno 1:1 variabili...
+
+ ncInfo.actual_tool = RetVal.GetInfo.actualtool
+ ncInfo.actual_tool_off = RetVal.GetInfo.actualtooloff
+ ncInfo.auto_jog_ret = RetVal.GetInfo.autojogret
+ ncInfo.ax_sel = RetVal.GetInfo.axsel
+
+ ncInfo.block_retrace = RetVal.GetInfo.blockretrace
+
+ ncInfo.disable_slashed_blk = RetVal.GetInfo.disableslashedblk
+ ncInfo.dry_run = RetVal.GetInfo.dryrun
+
+ ncInfo.feed_mis_unit = RetVal.GetInfo.feedmisunit
+ ncInfo.feed_ov = RetVal.GetInfo.feedov
+ ncInfo.force_rapid_feed = RetVal.GetInfo.forcerapidfeed
+
+ ncInfo.jog_dir = RetVal.GetInfo.jogdir
+ ncInfo.jog_incr = RetVal.GetInfo.jogincr
+
+ ncInfo.last_nc_error = RetVal.GetInfo.lastncerror
+
+ ncInfo.main_progr_name = System.Text.Encoding.ASCII.GetBytes(RetVal.GetInfo.mainprogrname)
+
+ ncInfo.man_feed_ov = RetVal.GetInfo.manfeedov
+ ncInfo.mode_select = RetVal.GetInfo.modeselect
+
+ ncInfo.num_ax_sel = RetVal.GetInfo.numaxsel
+
+ ncInfo.optional_stop = RetVal.GetInfo.optionalstop
+
+ ncInfo.progr_feed = RetVal.GetInfo.progrfeed
+ ncInfo.progr_speed = RetVal.GetInfo.progrspeed
+ ncInfo.progr_tool = RetVal.GetInfo.progrtool
+ ncInfo.progr_tool_off = RetVal.GetInfo.progrtooloff
+
+ ncInfo.rapid_feed = RetVal.GetInfo.rapidfeed
+ ncInfo.rapid_override = RetVal.GetInfo.rapidoverride
+ ncInfo.rap_feed_ov = RetVal.GetInfo.rapfeedov
+ ncInfo.real_feed = RetVal.GetInfo.realfeed
+ ncInfo.real_speed = RetVal.GetInfo.realspeed
+
+ ncInfo.speed_ov = RetVal.GetInfo.speedov
+ ncInfo.status = RetVal.GetInfo.status
+ ncInfo.substatus = RetVal.GetInfo.substatus
+
+ Return True
+
+ Else
+ mErrMsg = "Error on reading NcInfo "
+ mErrClass = RetVal.ErrClass
+ mErrNum = RetVal.ErrNum
+ Return False
+ End If
+
+ End Function
+
+
+
+
+
+
+
+
+
+ ' ---------------------------------------------------------------
+ ' Ritorna True se lo stato del CN è IDLE
+ '----------------------------------------------------------------
+ Public Overrides Function IsResetStatus(Optional ByVal nProcess As Integer = 1) As Boolean
+ Dim InputStruct As New OpenControl.GetNcInfo1
+ Dim RetVal As OpenControl.GetNcInfo1R
+
+ InputStruct.ProcNum = nProcess
+ RetVal = OsaiServer.GetNcInfo1(InputStruct)
+
+ If RetVal.retval > 0 Then
+
+ If RetVal.GetInfo.modeselect = 0 Then
+ Return True
+ Else
+ Return False
+ End If
+
+ Else
+ mErrMsg = "Error in IsResetStatus"
+ mErrClass = RetVal.ErrClass
+ mErrNum = RetVal.ErrNum
+
+ Return False
+ End If
+
+ End Function
+
+ ' -------------------------------------------------
+ ' Lettura stato macchina su processo passato per parametro
+ '--------------------------------------------------
+ Public Overrides Function GetMachineStatus(Optional ByVal nProcess As Integer = 1) As Byte
+ Dim InputStruct As New OpenControl.GetNcInfo1
+ Dim RetVal As OpenControl.GetNcInfo1R
+
+ InputStruct.ProcNum = nProcess
+ RetVal = OsaiServer.GetNcInfo1(InputStruct)
+ If RetVal.retval > 0 Then
+ Return RetVal.GetInfo.status
+
+ Else
+ mErrMsg = "Error on reading Machine Status"
+ mErrClass = RetVal.ErrClass
+ mErrNum = RetVal.ErrNum
+ Return 0
+ End If
+
+ End Function
+
+
+#End Region
+
+#Region "METODI - Utensili / correttori"
+
+ ' ---------------------------------------------------------------
+ ' Lettura utensile corrente su processo passato per parametro
+ '----------------------------------------------------------------
+ Public Overrides Function GetActualTool(Optional ByVal nProcess As Integer = 1) As Double
+ Dim InputStruct As New OpenControl.GetNcInfo1
+ Dim RetVal As OpenControl.GetNcInfo1R
+
+ InputStruct.ProcNum = nProcess
+ RetVal = OsaiServer.GetNcInfo1(InputStruct)
+
+ If RetVal.retval > 0 Then
+ Return RetVal.GetInfo.progrtool
+
+ Else
+ 'MsgBox("Error on reading Mode Selected" & vbCrLf & "Class: " & Str(ErrClass) & " Number: 0x" & Hex(ErrNum))
+ Return 0
+ End If
+
+ End Function
+
+ ' ---------------------------------------------------------------
+ ' Lettura correttore corrente su processo passato per parametro
+ '----------------------------------------------------------------
+ Public Overrides Function GetActualCorr(Optional ByVal nProcess As Integer = 1) As UShort
+ Dim InputStruct As New OpenControl.GetNcInfo1
+ Dim RetVal As OpenControl.GetNcInfo1R
+
+ InputStruct.ProcNum = nProcess
+ RetVal = OsaiServer.GetNcInfo1(InputStruct)
+
+ If RetVal.retval > 0 Then
+ Return RetVal.GetInfo.actualtooloff
+
+ Else
+ 'MsgBox("Error on reading Mode Selected" & vbCrLf & "Class: " & Str(ErrClass) & " Number: 0x" & Hex(ErrNum))
+ Return 0
+ End If
+
+ End Function
+
+ ' ---------------------------------------------------------------
+ ' Lettura lunghezza correttore corrente su processo passato per parametro
+ '----------------------------------------------------------------
+ Public Overrides Function GetActualToolLen(ByVal nRecord As UInteger) As Double
+ Dim InputStruct As New OpenControl.GetOffsetTabRecordII
+ Dim RetVal As OpenControl.GetOffsetTabRecordIIR
+ Dim Len() As OpenControl.OFFSETVALII
+
+ InputStruct.RecordNum = nRecord
+ RetVal = OsaiServer.GetOffsetTabRecordII(InputStruct)
+
+ If RetVal.retval > 0 Then
+ Len = RetVal.RecordBuff.LenVal
+ Return Len(0).ValOrig
+
+ Else
+ 'MsgBox("Error on reading actual tool length" & vbCrLf & "Class: " & Str(ErrClass) & " Number: 0x" & Hex(ErrNum))
+ Return 0
+ End If
+
+ End Function
+
+ ' ---------------------------------------------------------------
+ ' Lettura Diametro correttore corrente su processo passato per parametro
+ '----------------------------------------------------------------
+ Public Overrides Function GetActualToolDiam(ByVal nRecord As UInteger) As Double
+ Dim InputStruct As New OpenControl.GetOffsetTabRecordII
+ Dim RetVal As OpenControl.GetOffsetTabRecordIIR
+ Dim Len() As OpenControl.OFFSETVALII
+
+ InputStruct.RecordNum = nRecord
+ RetVal = OsaiServer.GetOffsetTabRecordII(InputStruct)
+
+ If RetVal.retval > 0 Then
+ Len = RetVal.RecordBuff.DiaVal
+ Return Len(0).ValOrig
+
+ Else
+ 'MsgBox("Error on reading actual tool diameter" & vbCrLf & "Class: " & Str(ErrClass) & " Number: 0x" & Hex(ErrNum))
+ Return 0
+ End If
+
+ End Function
+ ' ---------------------------------------------------------------
+ ' Lettura Diametro correttore corrente 2 su processo passato per parametro
+ '----------------------------------------------------------------
+ Public Overrides Function GetActualToolDiam2(ByVal nRecord As UInteger) As Double
+ Dim InputStruct As New OpenControl.GetOffsetTabRecordII
+ Dim RetVal As OpenControl.GetOffsetTabRecordIIR
+ Dim Len() As OpenControl.OFFSETVALII
+
+ InputStruct.RecordNum = nRecord
+ RetVal = OsaiServer.GetOffsetTabRecordII(InputStruct)
+
+ If RetVal.retval > 0 Then
+ Len = RetVal.RecordBuff.DiaVal
+
+ Return Len(0).ActChangeVal
+
+ Else
+ 'MsgBox("Error on reading actual tool diameter2" & vbCrLf & "Class: " & Str(ErrClass) & " Number: 0x" & Hex(ErrNum))
+ Return 0
+ End If
+
+ End Function
+
+#End Region
+
+#Region "METODI - Feed / Speed"
+
+ ' ---------------------------------------------------------------
+ ' Lettura Feed Override su processo passato per parametro
+ '----------------------------------------------------------------
+ Public Overrides Function GetFeedOverride(Optional ByVal nProcess As Integer = 1) As UShort
+ Dim InputStruct As New OpenControl.GetNcInfo1
+ Dim RetVal As OpenControl.GetNcInfo1R
+
+ InputStruct.ProcNum = nProcess
+ RetVal = OsaiServer.GetNcInfo1(InputStruct)
+
+ If RetVal.retval > 0 Then
+ Return RetVal.GetInfo.feedov / 100
+
+ Else
+ ' MsgBox("Error on reading Feed Override" & vbCrLf & "Class: " & Str(ErrClass) & " Number: 0x" & Hex(ErrNum))
+ Return 0
+ End If
+
+ End Function
+
+ ' ---------------------------------------------------------------
+ ' Lettura Rapid Override su processo passato per parametro
+ '----------------------------------------------------------------
+ Public Overrides Function GetRapidOverride(Optional ByVal nProcess As Integer = 1) As UShort
+ Dim InputStruct As New OpenControl.GetNcInfo1
+ Dim RetVal As OpenControl.GetNcInfo1R
+
+ InputStruct.ProcNum = nProcess
+ RetVal = OsaiServer.GetNcInfo1(InputStruct)
+
+ If RetVal.retval > 0 Then
+ Return RetVal.GetInfo.rapfeedov / 100
+
+ Else
+ 'MsgBox("Error on reading Rapid Override" & vbCrLf & "Class: " & Str(ErrClass) & " Number: 0x" & Hex(ErrNum))
+ Return 0
+ End If
+
+ End Function
+
+ ' ---------------------------------------------------------------
+ ' Lettura Speed Override su processo passato per parametro
+ '----------------------------------------------------------------
+ Public Overrides Function GetSpeedOverride(Optional ByVal nProcess As Integer = 1) As UShort
+ Dim InputStruct As New OpenControl.GetNcInfo1
+ Dim RetVal As OpenControl.GetNcInfo1R
+
+ InputStruct.ProcNum = nProcess
+ RetVal = OsaiServer.GetNcInfo1(InputStruct)
+
+ If RetVal.retval > 0 Then
+ Return RetVal.GetInfo.speedov / 100
+
+ Else
+ 'MsgBox("Error on reading Speed Override" & vbCrLf & "Class: " & Str(ErrClass) & " Number: 0x" & Hex(ErrNum))
+ Return 0
+ End If
+ End Function
+
+ ' ---------------------------------------------------------------
+ ' Lettura velocità rapido programmata su processo passato per parametro
+ '----------------------------------------------------------------
+ Public Overrides Function GetProgrammedRapid(Optional ByVal nProcess As Integer = 1) As Double
+ Dim InputStruct As New OpenControl.GetNcInfo1
+ Dim RetVal As OpenControl.GetNcInfo1R
+
+ InputStruct.ProcNum = nProcess
+ RetVal = OsaiServer.GetNcInfo1(InputStruct)
+
+ If RetVal.retval > 0 Then
+ Return RetVal.GetInfo.rapidfeed
+
+ Else
+ 'MsgBox("Error on reading Programmed Rapid " & vbCrLf & "Class: " & Str(ErrClass) & " Number: 0x" & Hex(ErrNum))
+ Return 0
+ End If
+ End Function
+
+ ' ---------------------------------------------------------------
+ ' Lettura Feed programmata su processo passato per parametro
+ '----------------------------------------------------------------
+ Public Overrides Function GetProgrammedFeed(Optional ByVal nProcess As Integer = 1) As Double
+ Dim InputStruct As New OpenControl.GetNcInfo1
+ Dim RetVal As OpenControl.GetNcInfo1R
+
+ InputStruct.ProcNum = nProcess
+ RetVal = OsaiServer.GetNcInfo1(InputStruct)
+
+ If RetVal.retval > 0 Then
+ Return RetVal.GetInfo.progrfeed
+
+ Else
+ 'MsgBox("Error on reading Programmed Feed " & vbCrLf & "Class: " & Str(ErrClass) & " Number: 0x" & Hex(ErrNum))
+ Return 0
+ End If
+ End Function
+
+ ' ---------------------------------------------------------------
+ ' Lettura Speed programmata su processo passato per parametro
+ '----------------------------------------------------------------
+ Public Overrides Function GetProgrammedSpeed(Optional ByVal nProcess As Integer = 1) As Double
+ Dim InputStruct As New OpenControl.GetNcInfo1
+ Dim RetVal As OpenControl.GetNcInfo1R
+
+ InputStruct.ProcNum = nProcess
+ RetVal = OsaiServer.GetNcInfo1(InputStruct)
+
+ If RetVal.retval > 0 Then
+ Return RetVal.GetInfo.progrspeed
+
+ Else
+ 'MsgBox("Error on reading Programmed Feed " & vbCrLf & "Class: " & Str(ErrClass) & " Number: 0x" & Hex(ErrNum))
+ Return ErrMsg
+ End If
+ End Function
+
+ ' ---------------------------------------------------------------
+ ' Lettura Feed reale su processo passato per parametro
+ '----------------------------------------------------------------
+ Public Overrides Function GetActualFeed(Optional ByVal nProcess As Integer = 1) As Double
+ Dim InputStruct As New OpenControl.GetNcInfo1
+ Dim RetVal As OpenControl.GetNcInfo1R
+
+ InputStruct.ProcNum = nProcess
+ RetVal = OsaiServer.GetNcInfo1(InputStruct)
+
+ If RetVal.retval > 0 Then
+ Return RetVal.GetInfo.realfeed
+
+ Else
+ 'MsgBox("Error on reading Actual Feed " & vbCrLf & "Class: " & Str(ErrClass) & " Number: 0x" & Hex(ErrNum))
+ Return 0
+ End If
+ End Function
+
+ ' ---------------------------------------------------------------
+ ' Lettura Speed reale su processo passato per parametro
+ '----------------------------------------------------------------
+ Public Overrides Function GetActualSpeed(Optional ByVal nProcess As Integer = 1) As Double
+ Dim InputStruct As New OpenControl.GetNcInfo1
+ Dim RetVal As OpenControl.GetNcInfo1R
+
+ InputStruct.ProcNum = nProcess
+ RetVal = OsaiServer.GetNcInfo1(InputStruct)
+
+ If RetVal.retval > 0 Then
+ Return RetVal.GetInfo.realspeed
+
+ Else
+ 'MsgBox("Error on reading Actual Speed " & vbCrLf & "Class: " & Str(ErrClass) & " Number: 0x" & Hex(ErrNum))
+ Return 0
+ End If
+ End Function
+
+#End Region
+
+#Region "METODI - copia files"
+
+ Public Overrides Function CopyFileToNC(ByVal sz_logical_drive As String,
+ ByVal sz_source_filename As String,
+ ByVal sz_dest_filename As String) As Short
+
+ Return PutFile(sz_source_filename, "PROGRAMS" & "\\" & sz_dest_filename, ErrClass, ErrNum, 0)
+
+ End Function
+
+
+ 'utilizzabile per la copia di file verso cnc
+
+ Public Overrides Function PutFile(ByRef szPathFile As String, ByVal szTargetPath As String, ByRef nErrClass As UInteger, ByRef nErrNum As UInteger, ByRef FileSize As Integer) As Integer
+ Dim oPutFile As New OpenControl.PutFile
+ Dim retPutFile As New OpenControl.PutFileR
+ Dim szData As String
+
+ oPutFile.PathName = szTargetPath
+
+ szData = ""
+
+ 'apro il file in szPathFile
+ szData = My.Computer.FileSystem.ReadAllText(szPathFile, System.Text.Encoding.UTF8)
+
+ oPutFile.Data = szData
+ oPutFile.Size = FileSize
+
+ 'calcolo la dimensione in byte e la metto in oPutFile.Size
+ oPutFile.Size = szData.Length
+
+ retPutFile = OsaiServer.PutFile(oPutFile)
+
+ nErrClass = retPutFile.ErrClass
+ nErrNum = retPutFile.ErrNum
+
+ PutFile = retPutFile.retval
+
+
+ End Function
+
+#End Region
+
+ ' ----------------------------------------------------------------------------------------------------------------------------
+ ' Lettura Errori CN
+ ' ----------------------------------------------------------------------------------------------------------------------------
+ 'Public Function ReadCurrentErrorMsg(ByVal nProcess As Integer, ByRef MessaggioErr() As String, ByRef nErrClass As UInteger, ByRef nErrNum As UInteger) As Integer
+
+ ' Dim oReadCurrentErrorMsg As New OpenControl.ReadCurrentErrorMsg
+ ' Dim retReadCurrentErrorMsg As New OpenControl.ReadCurrentErrorMsgR
+
+ ' oReadCurrentErrorMsg.Process = nProcess
+ ' retReadCurrentErrorMsg = OsaiServer.ReadCurrentErrorMsg(oReadCurrentErrorMsg)
+ ' 'SOAP function call
+ ' Dim datoErr As New CndexLinkDotNet.Cndex.MSG_ERROR
+
+ ' Try
+ ' datoErr.BootID = CUInt(retReadCurrentErrorMsg.Data.BootID)
+ ' datoErr.UnIdSeq = CUInt(retReadCurrentErrorMsg.Data.UnIdSeq)
+ ' datoErr.Code_Err = CUInt(retReadCurrentErrorMsg.Data.CodeErr)
+ ' datoErr.Comando = CByte(retReadCurrentErrorMsg.Data.Comando)
+ ' datoErr.FormatTxt = retReadCurrentErrorMsg.Data.FormatTxt
+ ' datoErr.Process = retReadCurrentErrorMsg.Data.Process
+ ' datoErr.SubCom = CByte(retReadCurrentErrorMsg.Data.SubCom)
+
+ ' Dim text2 As MESSAGE_TEXT
+ ' text2.Line1 = ""
+ ' text2.Line2 = ""
+ ' text2.Line3 = ""
+ ' text2.Line4 = ""
+
+ ' 'Invoke native function TranslateErrorMsg() in library OSAI_ErrorMgr.dll
+ ' TranslateErrorMsg(datoErr, text2)
+
+ ' ReDim MessaggioErr(4)
+
+ ' 'Display error message text
+ ' MessaggioErr(1) = text2.Line1
+ ' MessaggioErr(2) = text2.Line2
+ ' MessaggioErr(3) = text2.Line3
+ ' MessaggioErr(4) = text2.Line4
+ ' Catch ex As Exception
+
+ ' Return 0
+ ' 'Dim text2 As MESSAGE_TEXT
+ ' 'text2.Line1 = ""
+ ' 'text2.Line2 = ""
+ ' 'text2.Line3 = ""
+ ' 'text2.Line4 = ""
+
+ ' ''Invoke native function TranslateErrorMsg() in library OSAI_ErrorMgr.dll
+ ' 'TranslateErrorMsg(datoErr, text2)
+
+ ' 'ReDim MessaggioErr(4)
+
+ ' ''Display error message text
+ ' 'MessaggioErr(1) = text2.Line1
+ ' 'MessaggioErr(2) = text2.Line2
+ ' 'MessaggioErr(3) = text2.Line3
+ ' 'MessaggioErr(4) = text2.Line4
+ ' End Try
+
+
+ ' ReadCurrentErrorMsg = retReadCurrentErrorMsg.retval
+
+ 'End Function
+
+ '------------------------------
+ ' Lettura messaggio DIS
+ '------------------------------
+
+ Public Overrides Function ReadDisMsg(Optional ByVal nProcess As Integer = 1, Optional ByVal nMac As Integer = 1) As String
+ Dim InputStruct As New OpenControl.ReadPartProgramMsg
+ Dim RetVal As OpenControl.ReadPartProgramMsgR
+
+ InputStruct.ProcNum = nProcess
+ RetVal = OsaiServer.ReadPartProgramMsg(InputStruct)
+
+ If RetVal.retval > 0 Then
+ Return RetVal.PartProgramMsg
+
+ Else
+ mErrMsg = "Error on reading DIS messages"
+ mErrClass = RetVal.ErrClass
+ mErrNum = RetVal.ErrNum
+ Return ""
+ End If
+
+ End Function
+
+ ' -------------------------------------------------
+ ' Lettura Linee programma corrente
+ '--------------------------------------------------
+ Public Overrides Function ReadPPLines(ByVal nProcess As Integer, ByRef EightLines() As String, ByRef nErrClass As UInteger, ByRef nErrNum As UInteger) As Boolean
+ Dim InputStruct As New OpenControl.GetPartProgramLines
+ Dim RetVal As OpenControl.GetPartProgramLinesR
+
+ InputStruct.ProcNum = nProcess
+ RetVal = OsaiServer.GetPartProgramLines(InputStruct)
+
+ If RetVal.retval > 0 Then
+ EightLines(0) = RetVal.PPLine1
+ EightLines(1) = RetVal.PPLine2
+ EightLines(2) = RetVal.PPLine3
+ EightLines(3) = RetVal.PPLine4
+ EightLines(4) = RetVal.PPLine5
+ EightLines(5) = RetVal.PPLine6
+ EightLines(6) = RetVal.PPLine7
+ EightLines(7) = RetVal.PPLine8
+
+ Return True
+
+ Else
+ mErrMsg = "Error on reading PP Lines"
+ mErrClass = RetVal.ErrClass
+ mErrNum = RetVal.ErrNum
+
+ Return False
+ End If
+ End Function
+
+#Region "METODI - funz. aux ( short <> ushort), ..."
+
+ ' ----------------------------------------
+ ' Trasforma un Unsigned Short in un Short
+ ' ----------------------------------------
+ Public Function UShortToShort(ByVal usValue As UShort) As Short
+ Dim dValue As Double
+ Dim numBit As Byte
+
+ 'numero bit tipo di dato (short -> 16 bit, integer -> 32 bit, long -> 64bit)
+ numBit = 16
+
+ If usValue > (2 ^ (numBit - 1) - 1) Then
+ dValue = CDbl(usValue)
+ dValue = dValue - CDbl(2 ^ numBit)
+ UShortToShort = CShort(dValue)
+ Else
+ UShortToShort = CShort(usValue)
+ End If
+
+ Return UShortToShort
+ End Function
+
+ ' ----------------------------------------
+ ' Trasforma uno Short in un UnisignedShort
+ ' ----------------------------------------
+ Public Function ShortToUShort(ByVal sValue As Short) As UShort
+ Dim dValue As Double
+ Dim numBit As Byte
+
+ 'numero bit tipo di dato (short -> 16 bit, integer -> 32 bit, long -> 64bit)
+ numBit = 16
+
+ If sValue < 0 Then
+ dValue = CDbl(sValue)
+ dValue = dValue + CDbl(2 ^ numBit)
+ ShortToUShort = CUShort(dValue)
+ Else
+ ShortToUShort = CUShort(sValue)
+ End If
+
+ Return ShortToUShort
+
+ End Function
+
+#End Region
+
+#End Region
+
+End Class
\ No newline at end of file
diff --git a/CVCncLib/Modules/IniRead.vb b/CVCncLib/Modules/IniRead.vb
new file mode 100644
index 00000000..fa2d7375
--- /dev/null
+++ b/CVCncLib/Modules/IniRead.vb
@@ -0,0 +1,464 @@
+Public Module IniRead
+
+ Public Const OVERWRITE As Boolean = True
+ Public Const APPEND As Boolean = True
+ Public Const DO_NOT_APPEND As Boolean = False
+
+ Public sz_ini_file_name As String
+
+ Public sz_program_path As String
+ Public sz_temporary_path As String
+ Public sz_allowed_extension As String
+
+ Public b_debug As Boolean
+ Public b_verbose As Boolean
+ Public b_test_nc As Boolean
+ Public b_send_file As Boolean
+
+ Public b_log_enabled As Boolean
+ Public szLogFileName As String
+
+ Public b_win7 As Boolean
+
+ Public b_open_control As Boolean
+ Public b_force_S10WLK32 As Boolean
+ Public b_no_WinNBI As Boolean
+
+ Public szNameNC As String
+ Public nVar_NC_state As Integer ' @STATUS_PRG PLC var number ( GW ) : Nc program state
+
+ Public nVar_prg_1_ok As Integer
+ Public nVar_prg_2_ok As Integer
+
+ Public sz_ODD_program_name As String
+ Public sz_EVEN_program_name As String
+
+ Public sz_AUTO_program_name As String
+
+ Public n_program_to_send As Short
+
+ Public szDefaultNameNC As String
+ Public szDefaultPathNC As String
+
+ Public lTimerInterval As Long
+
+ Public b_SerialBarCodeReader_enabled As Boolean
+ Public n_SerialBarCodeReader_comm_port As Int16
+ Public sz_SerialBarCodeReader_settings As String
+
+ Public b_UsbBarCodeReader_enabled As String
+
+ Public b_BarCodeInput_enabled As Boolean
+
+ Public b_FileInputMode_enabled As Boolean
+ Public sz_FileInputName As String
+
+
+ Public n_num_barcode_fields As Short
+ Public sz_barcode_mask As String
+ Public sz_barcode_preprocessing As String
+
+ Public b_Table_enabled As Boolean
+ Public sz_table_filename As String
+ Public b_reload_table As Boolean
+
+ Public b_ext_program_enabled As Boolean
+ Public sz_ext_program_filename As String
+ Public sz_ext_return_filename As String
+ Public sz_ext_temp_filename As String
+
+ Public b_CAM_program_enabled As Boolean
+ Public sz_CAM_program_exefilename As String
+ Public sz_CAM_data_path As String
+ Public sz_CAM_data_ext As String
+ Public sz_CAM_arguments As String
+ Public sz_CAM_return_ext As String
+ Public sz_CAM_Probe_ext As String
+
+ Public b_direct_mode_enabled As Boolean
+ Public sz_direct_prefix As String
+ Public sz_direct_suffix As String
+
+ Public b_select_mode_enabled As Boolean
+ Public sz_probe_arguments As String
+ Public sz_cn_arguments As String
+
+ Public n_L_var_1 As Int16
+ Public n_L_var_2 As Int16
+
+ Public n_L_value_1_on As Int16
+ Public n_L_value_1_off As Int16
+ Public n_L_value_2_on As Int16
+ Public n_L_value_2_off As Int16
+ Public n_timeout As Int16
+
+ Public sz_nc_probe_path As String
+ Public sz_nc_probe_ext As String
+ Public b_fixed_probe_file As Boolean
+ Public sz_nc_fixed_probe_file As String
+ Public b_read_DDF_file As Boolean
+ Public sz_property_1 As String
+ Public sz_property_2 As String
+
+ Public b_toolcomp_update As Boolean
+ Public n_toolcomp_number As Int16
+ Public sz_toolcomp_file As String
+ Public sz_toolcomp_command As String
+
+#Region "registration"
+
+ 'Questo campo e' il campo di referenza serve a creare la relativa KEy di sblocco
+ Public developerKey As String
+
+ 'Richiede solo numeri interi
+ Public regTry As Integer
+
+ 'Flag per identificare la registrazione del programma
+ Public pRegistered As Boolean
+
+ Public PC_serial_number As Long
+ Public sPC_serial_number As String
+ Public SW_version As String
+ Public registered_key As String
+ Public registered_key2 As String
+ Public registered_key3 As String
+ Public registered_customer As String
+
+#End Region
+
+#Region "example of INI file"
+
+ ' file door_pro.ini
+ '[General]
+
+
+ 'Program path = c:\Users\carlo\Documents\Projects\vs2008\door_pro\door_pro\programs
+ 'allowed ext = .anc .TXT
+ 'temp path = c:\Users\carlo\Documents\Projects\vs2008\door_pro\door_pro\temp
+ '
+ 'w7 = true
+ 'timer = 1000
+
+ '[Debug]
+ 'debug = true
+ 'verbose = false
+
+ '[Log]
+ 'enabled = true
+ 'Log file = c:\Users\carlo\Documents\Projects\vs2008\door_pro\door_pro\temp\log
+
+ '[NC]
+ 'name = NC9000
+ 'NC state = 230
+ 'Prog1 ok = 232
+ 'Prog2 ok = 233
+
+ 'default_name = MAIN
+ 'default_path = Y:\UPP\
+
+ 'ODD_name = 1000
+ 'EVEN_name = 2000
+ 'AUTO_name = UPP\MAINAUTO
+ 'program_to_send = 4
+
+ '[BarCode]
+ 'fields = 1
+ 'MASK = xx11111xxx223333xx44xxxxxx
+ 'PreProcessing = "1-2"
+
+ '[SerialBarCodeReader]
+ 'enabled = true
+ 'Port = 4
+ 'Settings=9600,n,8,1
+
+ '[UsbBarCodeReader]
+ 'enabled = false
+
+ '[Table]
+ 'enabled = true
+ 'file = c:\pro_d\pro_d\prg\worklist.aut
+
+ '[CAM]
+ 'enabled = true
+ 'program = C:\abc\ww.exe
+ 'datapath
+ 'arguments
+ 'return_file_ext = txt
+
+ '[Direct]
+ 'enabled = true
+ 'pre = C:\door_pro\programs\
+ 'post = .cnc
+
+ '[Key]
+ ' regkey = 12345
+ ' regkey2 = 2345
+ ' regkey3 = 2345
+ ' customer = qwe
+
+#End Region
+
+ Sub Ini_read()
+
+ sz_ini_file_name = Application.StartupPath & "\config\" & Application.ProductName & ".ini"
+
+ Dim ini As New IniReader(sz_ini_file_name)
+
+ ini.Section = "General" '-----------------------------------------------------
+
+ sz_program_path = clear_ending_bar(ini.ReadString("Program path"))
+ sz_temporary_path = clear_ending_bar(ini.ReadString("temp path"))
+ sz_allowed_extension = clear_starting_point(ini.ReadString("allowed ext").ToLower)
+
+ lTimerInterval = ini.ReadLong("timer", 1000)
+
+ b_win7 = ini.ReadBoolean("w7", False)
+
+ ini.Section = "Debug" '-----------------------------------------------------
+
+ b_debug = ini.ReadBoolean("debug", False)
+ b_verbose = ini.ReadBoolean("verbose", False)
+ b_test_nc = ini.ReadBoolean("test_nc", False)
+
+ b_send_file = ini.ReadBoolean("send_file", False)
+
+ ini.Section = "Log" '-----------------------------------------------------
+
+ b_log_enabled = ini.ReadBoolean("enabled", False)
+ szLogFileName = ini.ReadString("Log file")
+
+ ini.Section = "NC" '-----------------------------------------------------
+
+
+ b_open_control = ini.ReadBoolean("OpenControl", False)
+ b_force_S10WLK32 = ini.ReadBoolean("S10WLK32", False)
+ b_no_WinNBI = ini.ReadBoolean("No WinNBI", False)
+
+ szNameNC = ini.ReadString("name")
+ nVar_NC_state = ini.ReadInteger("NC state")
+ nVar_prg_1_ok = ini.ReadInteger("Prog1 ok")
+ nVar_prg_2_ok = ini.ReadInteger("Prog2 ok")
+
+ szDefaultNameNC = ini.ReadString("default_name")
+ szDefaultPathNC = clear_ending_bar(ini.ReadString("default_path"))
+
+ sz_ODD_program_name = ini.ReadString("ODD_name")
+ sz_EVEN_program_name = ini.ReadString("EVEN_name")
+
+ n_program_to_send = ini.ReadInteger("program_to_send", 1)
+
+ ini.Section = "BarCode" '-----------------------------------------------------
+
+ '[BarCode]
+ 'fields = 1
+ 'MASK = xx11111xxx223333xx44xxxxxx
+ 'PreProcessing = "1-2"
+
+ n_num_barcode_fields = ini.ReadInteger("fields", 1)
+ sz_barcode_mask = ini.ReadString(ini.Section, "MASK", "11111111")
+ sz_barcode_preprocessing = ini.ReadString(ini.Section, "PreProcessing", "=")
+
+ ini.Section = "SerialBarCodeReader" '-----------------------------------------------------
+
+ '[SerialBarCodeReader]
+ 'enabled = true
+ 'Port = 4
+ 'Settings=9600,n,8,1
+
+ b_SerialBarCodeReader_enabled = ini.ReadBoolean("enabled", False)
+ n_SerialBarCodeReader_comm_port = ini.ReadInteger("Port", 1)
+ sz_SerialBarCodeReader_settings = ini.ReadString(ini.Section, "Settings", "9600,None,8,1")
+
+ ini.Section = "UsbBarCodeReader" '-----------------------------------------------------
+
+ '[UsbBarCodeReader]
+ 'enabled = true
+
+ b_UsbBarCodeReader_enabled = ini.ReadBoolean("enabled", False)
+
+ If b_UsbBarCodeReader_enabled And b_SerialBarCodeReader_enabled Then
+ Log.write_and_messagebox(" Both USB and serial bar code reader enabled - please disable one ... ", 34)
+ End
+ End If
+
+ b_BarCodeInput_enabled = b_UsbBarCodeReader_enabled Or b_SerialBarCodeReader_enabled
+
+
+ ini.Section = "FileInput" '-----------------------------------------------------
+
+ '[FileInput]
+ 'enabled = true
+ 'InputFile = C:\input\data.txt
+
+ b_FileInputMode_enabled = ini.ReadBoolean("enabled", False)
+ sz_FileInputName = ini.ReadString(ini.Section, "InputFile", "")
+
+ If b_BarCodeInput_enabled And b_FileInputMode_enabled Then
+ Log.write_and_messagebox(" Both file input and bar code mode enabled - please disable one ... ", 35)
+ End
+ End If
+
+ If (Not b_BarCodeInput_enabled) And (Not b_FileInputMode_enabled) Then
+ Log.write_and_messagebox(" No file input mode nor bar code mode enabled - please enable one ... ", 36)
+ End
+ End If
+
+ ini.Section = "Table" '-----------------------------------------------------
+
+ '[Table]
+ 'enabled = true
+ 'file = c:\pro_d\pro_d\prg\worklist.aut
+
+ b_Table_enabled = ini.ReadBoolean("enabled", False)
+ sz_table_filename = ini.ReadString("file")
+ b_reload_table = ini.ReadBoolean("reload", False)
+
+ ini.Section = "EXT" '-----------------------------------------------------
+
+ '[EXT]
+ 'enabled = true
+ 'program = C:\abc\ww.exe
+ 'return_file = c:\pro_d\pro_d\prg\worklist.aut
+
+ b_ext_program_enabled = ini.ReadBoolean("enabled", False)
+ sz_ext_program_filename = ini.ReadString("program")
+ sz_ext_return_filename = ini.ReadString("return_file")
+ sz_ext_temp_filename = ini.ReadString("temp_file")
+
+ ini.Section = "CAM" '-----------------------------------------------------
+
+ '[CAM]
+ 'enabled = true
+ 'program = C:\abc\ww.exe
+ 'datapath
+ 'arguments
+ 'return_file_ext = c:\pro_d\pro_d\prg\worklist.aut
+
+ b_CAM_program_enabled = ini.ReadBoolean("enabled", False)
+ sz_CAM_program_exefilename = ini.ReadString("program")
+
+ sz_CAM_data_path = (ini.ReadString("datapath"))
+ sz_CAM_data_path = sz_CAM_data_path.Replace("""", "")
+ sz_CAM_data_path = clear_ending_bar(sz_CAM_data_path)
+
+ sz_CAM_data_ext = clear_starting_point(ini.ReadString("dataext"))
+
+ sz_CAM_arguments = ini.ReadString("arguments")
+ sz_CAM_return_ext = clear_starting_point(ini.ReadString("return_file_ext"))
+ sz_CAM_Probe_ext = clear_starting_point(ini.ReadString("probe_file_ext"))
+
+ ini.Section = "Direct" '-----------------------------------------------------
+
+ '[Direct]
+ 'enabled = true
+ 'pre = C:\abc\ww\
+ 'post = .cnc
+
+ b_direct_mode_enabled = ini.ReadBoolean("enabled", False)
+ sz_direct_prefix = ini.ReadString("pre")
+ sz_direct_suffix = ini.ReadString("post")
+
+ ini.Section = "Select" '-----------------------------------------------------
+
+ '[Select]
+ 'enabled = true
+ 'p_arguments = " 3"
+ 'c_arguments = " 4"
+ 'L var 1 = 916
+ 'L var 2 = 919
+ 'L value 1 on = 1
+ 'L value 1 off = 0
+ 'L value 2 on = 2
+ 'L value 2 off = 2
+ 'timeout = 300
+ ' NC probe file path = m: \Cnc\DDF\
+ ' NC probe file ext = dat
+ ' fixed probe file = true
+ ' NC_probe_file = UPP\PROGRA1\Data.prb
+ ' read file = true
+ ' prop1 = properties:
+ ' prop2 = skinned
+
+ b_select_mode_enabled = ini.ReadBoolean("enabled", False)
+ sz_probe_arguments = ini.ReadString("p_arguments")
+ sz_cn_arguments = ini.ReadString("c_arguments")
+
+ n_L_var_1 = ini.ReadInteger("L var 1")
+ n_L_var_2 = ini.ReadInteger("L var 2")
+
+ n_L_value_1_on = ini.ReadInteger("L value 1 on")
+ n_L_value_1_off = ini.ReadInteger("L value 1 off")
+ n_L_value_2_on = ini.ReadInteger("L value 2 on")
+ n_L_value_2_off = ini.ReadInteger("L value 2 off")
+ n_timeout = ini.ReadInteger("timeout")
+
+ sz_nc_probe_path = ini.ReadString("NC probe file path")
+ sz_nc_probe_path = clear_ending_bar(sz_nc_probe_path)
+
+ sz_nc_probe_ext = clear_starting_point(ini.ReadString("NC probe file ext"))
+
+ b_fixed_probe_file = ini.ReadBoolean("fixed probe file", False)
+ sz_nc_fixed_probe_file = Trim(ini.ReadString("NC_probe_file"))
+
+ b_read_DDF_file = ini.ReadBoolean("read DDF file", False)
+
+ sz_property_1 = Trim(ini.ReadString("prop1"))
+ sz_property_2 = Trim(ini.ReadString("prop2"))
+
+
+ '----------- check that only one method is enabled
+
+ Dim n_methods As Short = 0
+
+ If b_Table_enabled Then n_methods = n_methods + 1
+ If b_ext_program_enabled Then n_methods = n_methods + 1
+ If b_CAM_program_enabled Then n_methods = n_methods + 1
+ If b_direct_mode_enabled Then n_methods = n_methods + 1
+ If b_select_mode_enabled Then n_methods = n_methods + 1
+
+ If n_methods > 1 Then
+ Log.write_and_messagebox(" Too many input modes enabled .. - please enable only one ... ", 38)
+ End
+ End If
+
+ If n_methods < 1 Then
+ Log.write_and_messagebox(" No input mode enabled ( CAM / Table / external / direct /.. - please enable one ... ", 40)
+ End
+ End If
+
+ ini.Section = "Key" '-----------------------------------------------------
+
+ ' [Key]
+ ' regkey = 12345
+ ' regkey2 = 2345
+ ' customer = qwe
+
+ registered_key = UCase$(ini.ReadString("regkey"))
+ registered_key2 = UCase$(ini.ReadString("regkey2"))
+ registered_key3 = UCase$(ini.ReadString("regkey3"))
+
+ registered_customer = ini.ReadString("Customer")
+
+ End Sub
+ Sub write_customer(ByVal sz_customer As String)
+
+ Dim ini As New IniReader(sz_ini_file_name)
+
+ ini.Write("Key", "Customer", sz_customer)
+
+ End Sub
+
+ Sub write_Program_path(ByVal sz_data_file_name As String)
+
+ Dim ini As New IniReader(sz_ini_file_name)
+
+ ini.Write("General", "Program path", sz_data_file_name)
+
+ End Sub
+
+#Region "fuffa"
+
+
+#End Region
+
+End Module
diff --git a/CVCncLib/Modules/IniReader.vb b/CVCncLib/Modules/IniReader.vb
new file mode 100644
index 00000000..e053c6e1
--- /dev/null
+++ b/CVCncLib/Modules/IniReader.vb
@@ -0,0 +1,454 @@
+'
+' IniReader class
+
+Imports System
+Imports System.Text
+Imports System.Collections
+Imports System.Runtime.InteropServices
+Imports Microsoft.VisualBasic
+
+
+ '''
+ ''' The INIReader class can read keys from and write keys to an INI file.
+ '''
+ '''
+ ''' This class uses several Win32 API functions to read from and write to INI files. It will not work on Linux or FreeBSD.
+ '''
+
+ Public Class IniReader
+
+ '''
+ ''' The GetPrivateProfileInt function retrieves an integer associated with a key in the specified section of an initialization file.
+ '''
+ ''' Pointer to a null-terminated string specifying the name of the section in the initialization file.
+ ''' Pointer to the null-terminated string specifying the name of the key whose value is to be retrieved. This value is in the form of a string; the GetPrivateProfileInt function converts the string into an integer and returns the integer.
+ ''' Specifies the default value to return if the key name cannot be found in the initialization file.
+ ''' Pointer to a null-terminated string that specifies the name of the initialization file. If this parameter does not contain a full path to the file, the system searches for the file in the Windows directory.
+ ''' The return value is the integer equivalent of the string following the specified key name in the specified initialization file. If the key is not found, the return value is the specified default value. If the value of the key is less than zero, the return value is zero.
+
+ Private Declare Ansi Function GetPrivateProfileInt Lib "kernel32.dll" Alias "GetPrivateProfileIntA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal nDefault As Integer, ByVal lpFileName As String) As Integer
+
+ '''
+ ''' The WritePrivateProfileString function copies a string into the specified section of an initialization file.
+ '''
+ ''' Pointer to a null-terminated string containing the name of the section to which the string will be copied. If the section does not exist, it is created. The name of the section is case-independent; the string can be any combination of uppercase and lowercase letters.
+ ''' Pointer to the null-terminated string containing the name of the key to be associated with a string. If the key does not exist in the specified section, it is created. If this parameter is NULL, the entire section, including all entries within the section, is deleted.
+ ''' Pointer to a null-terminated string to be written to the file. If this parameter is NULL, the key pointed to by the lpKeyName parameter is deleted.
+ ''' Pointer to a null-terminated string that specifies the name of the initialization file.
+ ''' If the function successfully copies the string to the initialization file, the return value is nonzero; if the function fails, or if it flushes the cached version of the most recently accessed initialization file, the return value is zero.
+
+ Private Declare Ansi Function WritePrivateProfileString Lib "kernel32.dll" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpString As String, ByVal lpFileName As String) As Integer
+
+ '''
+ ''' The GetPrivateProfileString function retrieves a string from the specified section in an initialization file.
+ '''
+ ''' Pointer to a null-terminated string that specifies the name of the section containing the key name. If this parameter is NULL, the GetPrivateProfileString function copies all section names in the file to the supplied buffer.
+ ''' Pointer to the null-terminated string specifying the name of the key whose associated string is to be retrieved. If this parameter is NULL, all key names in the section specified by the lpAppName parameter are copied to the buffer specified by the lpReturnedString parameter.
+ ''' Pointer to a null-terminated default string. If the lpKeyName key cannot be found in the initialization file, GetPrivateProfileString copies the default string to the lpReturnedString buffer. This parameter cannot be NULL.
Avoid specifying a default string with trailing blank characters. The function inserts a null character in the lpReturnedString buffer to strip any trailing blanks.
+ ''' Pointer to the buffer that receives the retrieved string.
+ ''' Specifies the size, in TCHARs, of the buffer pointed to by the lpReturnedString parameter.
+ ''' Pointer to a null-terminated string that specifies the name of the initialization file. If this parameter does not contain a full path to the file, the system searches for the file in the Windows directory.
+ ''' The return value is the number of characters copied to the buffer, not including the terminating null character.
+
+ Private Declare Ansi Function GetPrivateProfileString Lib "kernel32.dll" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As StringBuilder, ByVal nSize As Integer, ByVal lpFileName As String) As Integer
+
+ '''
+ ''' The GetPrivateProfileSectionNames function retrieves the names of all sections in an initialization file.
+ '''
+ ''' Pointer to a buffer that receives the section names associated with the named file. The buffer is filled with one or more null-terminated strings; the last string is followed by a second null character.
+ ''' Specifies the size, in TCHARs, of the buffer pointed to by the lpszReturnBuffer parameter.
+ ''' Pointer to a null-terminated string that specifies the name of the initialization file. If this parameter is NULL, the function searches the Win.ini file. If this parameter does not contain a full path to the file, the system searches for the file in the Windows directory.
+ ''' The return value specifies the number of characters copied to the specified buffer, not including the terminating null character. If the buffer is not large enough to contain all the section names associated with the specified initialization file, the return value is equal to the length specified by nSize minus two.
+
+ Private Declare Ansi Function GetPrivateProfileSectionNames Lib "kernel32" Alias "GetPrivateProfileSectionNamesA" (ByVal lpszReturnBuffer() As Byte, ByVal nSize As Integer, ByVal lpFileName As String) As Integer
+
+ '''
+ ''' The WritePrivateProfileSection function replaces the keys and values for the specified section in an initialization file.
+ '''
+ ''' Pointer to a null-terminated string specifying the name of the section in which data is written. This section name is typically the name of the calling application.
+ ''' Pointer to a buffer containing the new key names and associated values that are to be written to the named section.
+ ''' Pointer to a null-terminated string containing the name of the initialization file. If this parameter does not contain a full path for the file, the function searches the Windows directory for the file. If the file does not exist and lpFileName does not contain a full path, the function creates the file in the Windows directory. The function does not create a file if lpFileName contains the full path and file name of a file that does not exist.
+ ''' If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero.
+
+ Private Declare Ansi Function WritePrivateProfileSection Lib "kernel32.dll" Alias "WritePrivateProfileSectionA" (ByVal lpAppName As String, ByVal lpString As String, ByVal lpFileName As String) As Integer
+
+ ''' Constructs a new IniReader instance.
+ ''' Specifies the full path to the INI file (the file doesn't have to exist).
+
+ Public Sub New(ByVal file As String)
+ Filename = file
+ End Sub
+
+ ''' Gets or sets the full path to the INI file.
+ ''' A String representing the full path to the INI file.
+ '''
+
+ Public Property Filename() As String
+ Get
+ Return m_Filename
+ End Get
+ Set(ByVal Value As String)
+ m_Filename = Value
+ End Set
+ End Property
+
+ ''' Gets or sets the section you're working in. (aka 'the active section')
+ ''' A String representing the section you're working in.
+ '''
+
+ Public Property Section() As String
+ Get
+ Return m_Section
+ End Get
+ Set(ByVal Value As String)
+ m_Section = Value
+ End Set
+ End Property
+
+ ''' Reads an Integer from the specified key of the specified section.
+ ''' The section to search in.
+ ''' The key from which to return the value.
+ ''' The value to return if the specified key isn't found.
+ ''' Returns the value of the specified section/key pair, or returns the default value if the specified section/key pair isn't found in the INI file.
+
+ Public Function ReadInteger(ByVal section As String, ByVal key As String, ByVal defVal As Integer) As Integer
+ Return GetPrivateProfileInt(section, key, defVal, Filename)
+ End Function
+
+ ''' Reads an Integer from the specified key of the specified section.
+ ''' The section to search in.
+ ''' The key from which to return the value.
+ ''' Returns the value of the specified section/key pair, or returns 0 if the specified section/key pair isn't found in the INI file.
+
+ Public Function ReadInteger(ByVal section As String, ByVal key As String) As Integer
+ Return ReadInteger(section, key, 0)
+ End Function
+
+ ''' Reads an Integer from the specified key of the active section.
+ ''' The key from which to return the value.
+ ''' The section to search in.
+ ''' Returns the value of the specified Key, or returns the default value if the specified Key isn't found in the active section of the INI file.
+
+ Public Function ReadInteger(ByVal key As String, ByVal defVal As Integer) As Integer
+ Return ReadInteger(Section, key, defVal)
+ End Function
+
+ ''' Reads an Integer from the specified key of the active section.
+ ''' The key from which to return the value.
+ ''' Returns the value of the specified key, or returns 0 if the specified key isn't found in the active section of the INI file.
+
+ Public Function ReadInteger(ByVal key As String) As Integer
+ Return ReadInteger(key, 0)
+ End Function
+
+ ''' Reads a String from the specified key of the specified section.
+ ''' The section to search in.
+ ''' The key from which to return the value.
+ ''' The value to return if the specified key isn't found.
+ ''' Returns the value of the specified section/key pair, or returns the default value if the specified section/key pair isn't found in the INI file.
+
+ Public Function ReadString(ByVal section As String, ByVal key As String, ByVal defVal As String) As String
+ Dim sb As New StringBuilder(MAX_ENTRY)
+ Dim Ret As Integer = GetPrivateProfileString(section, key, defVal, sb, MAX_ENTRY, Filename)
+ Return sb.ToString()
+ End Function
+
+ ''' Reads a String from the specified key of the specified section.
+ ''' The section to search in.
+ ''' The key from which to return the value.
+ ''' Returns the value of the specified section/key pair, or returns an empty String if the specified section/key pair isn't found in the INI file.
+
+ Public Function ReadString(ByVal section As String, ByVal key As String) As String
+ Return ReadString(section, key, "")
+ End Function
+
+ ''' Reads a String from the specified key of the active section.
+ ''' The key from which to return the value.
+ ''' Returns the value of the specified key, or returns an empty String if the specified key isn't found in the active section of the INI file.
+
+ Public Function ReadString(ByVal key As String) As String
+ Return ReadString(Section, key)
+ End Function
+
+ ''' Reads a Long from the specified key of the specified section.
+ ''' The section to search in.
+ ''' The key from which to return the value.
+ ''' The value to return if the specified key isn't found.
+ ''' Returns the value of the specified section/key pair, or returns the default value if the specified section/key pair isn't found in the INI file.
+
+ Public Function ReadLong(ByVal section As String, ByVal key As String, ByVal defVal As Long) As Long
+ Return Long.Parse(ReadString(section, key, defVal.ToString()))
+ End Function
+
+ ''' Reads a Long from the specified key of the specified section.
+ ''' The section to search in.
+ ''' The key from which to return the value.
+ ''' Returns the value of the specified section/key pair, or returns 0 if the specified section/key pair isn't found in the INI file.
+
+ Public Function ReadLong(ByVal section As String, ByVal key As String) As Long
+ Return ReadLong(section, key, 0)
+ End Function
+
+ ''' Reads a Long from the specified key of the active section.
+ ''' The key from which to return the value.
+ ''' The section to search in.
+ ''' Returns the value of the specified key, or returns the default value if the specified key isn't found in the active section of the INI file.
+
+ Public Function ReadLong(ByVal key As String, ByVal defVal As Long) As Long
+ Return ReadLong(Section, key, defVal)
+ End Function
+
+ ''' Reads a Long from the specified key of the active section.
+ ''' The key from which to return the value.
+ ''' Returns the value of the specified Key, or returns 0 if the specified Key isn't found in the active section of the INI file.
+
+ Public Function ReadLong(ByVal key As String) As Long
+ Return ReadLong(key, 0)
+ End Function
+
+ ''' Reads a Byte array from the specified key of the specified section.
+ ''' The section to search in.
+ ''' The key from which to return the value.
+ ''' Returns the value of the specified section/key pair, or returns null (Nothing in VB.NET) if the specified section/key pair isn't found in the INI file.
+
+ Public Function ReadByteArray(ByVal section As String, ByVal key As String) As Byte()
+ Try
+ Return Convert.FromBase64String(ReadString(section, key))
+ Catch
+ End Try
+ Return Nothing
+ End Function
+
+ ''' Reads a Byte array from the specified key of the active section.
+ ''' The key from which to return the value.
+ ''' Returns the value of the specified key, or returns null (Nothing in VB.NET) if the specified key pair isn't found in the active section of the INI file.
+
+ Public Function ReadByteArray(ByVal key As String) As Byte()
+ Return ReadByteArray(Section, key)
+ End Function
+
+ ''' Reads a Boolean from the specified key of the specified section.
+ ''' The section to search in.
+ ''' The key from which to return the value.
+ ''' The value to return if the specified key isn't found.
+ ''' Returns the value of the specified section/key pair, or returns the default value if the specified section/key pair isn't found in the INI file.
+
+ Public Function ReadBoolean(ByVal section As String, ByVal key As String, ByVal defVal As Boolean) As Boolean
+
+ Dim b_ret As Boolean = False
+
+ Try
+ b_ret = Boolean.Parse(ReadString(section, key, defVal.ToString()))
+ Catch
+ b_ret = False
+ End Try
+ Return b_ret
+ End Function
+
+ ''' Reads a Boolean from the specified key of the specified section.
+ ''' The section to search in.
+ ''' The key from which to return the value.
+ ''' Returns the value of the specified section/key pair, or returns false if the specified section/key pair isn't found in the INI file.
+
+ Public Function ReadBoolean(ByVal section As String, ByVal key As String) As Boolean
+ Return ReadBoolean(section, key, False)
+ End Function
+
+ ''' Reads a Boolean from the specified key of the specified section.
+ ''' The key from which to return the value.
+ ''' The value to return if the specified key isn't found.
+ ''' Returns the value of the specified key pair, or returns the default value if the specified key isn't found in the active section of the INI file.
+
+ Public Function ReadBoolean(ByVal key As String, ByVal defVal As Boolean) As Boolean
+ Return ReadBoolean(Section, key, defVal)
+ End Function
+
+ ''' Reads a Boolean from the specified key of the specified section.
+ ''' The key from which to return the value.
+ ''' Returns the value of the specified key, or returns false if the specified key isn't found in the active section of the INI file.
+
+ Public Function ReadBoolean(ByVal key As String) As Boolean
+ Return ReadBoolean(Section, key)
+ End Function
+
+ ''' Writes an Integer to the specified key in the specified section.
+ ''' The section to write in.
+ ''' The key to write to.
+ ''' The value to write.
+ ''' Returns true if the function succeeds, false otherwise.
+
+ Public Function Write(ByVal section As String, ByVal key As String, ByVal value As Integer) As Boolean
+ Return Write(section, key, value.ToString())
+ End Function
+
+ ''' Writes an Integer to the specified key in the active section.
+ ''' The key to write to.
+ ''' The value to write.
+ ''' Returns true if the function succeeds, false otherwise.
+
+ Public Function Write(ByVal key As String, ByVal value As Integer) As Boolean
+ Return Write(Section, key, value)
+ End Function
+
+ ''' Writes a String to the specified key in the specified section.
+ ''' Specifies the section to write in.
+ ''' Specifies the key to write to.
+ ''' Specifies the value to write.
+ ''' Returns true if the function succeeds, false otherwise.
+
+ Public Function Write(ByVal section As String, ByVal key As String, ByVal value As String) As Boolean
+ Return (WritePrivateProfileString(section, key, value, Filename) <> 0)
+ End Function
+
+ ''' Writes a String to the specified key in the active section.
+ ''' The key to write to.
+ ''' The value to write.
+ ''' Returns true if the function succeeds, false otherwise.
+
+ Public Function Write(ByVal key As String, ByVal value As String) As Boolean
+ Return Write(Section, key, value)
+ End Function
+
+ ''' Writes a Long to the specified key in the specified section.
+ ''' The section to write in.
+ ''' The key to write to.
+ ''' The value to write.
+ ''' Returns true if the function succeeds, false otherwise.
+
+ Public Function Write(ByVal section As String, ByVal key As String, ByVal value As Long) As Boolean
+ Return Write(section, key, value.ToString())
+ End Function
+
+ ''' Writes a Long to the specified key in the active section.
+ ''' The key to write to.
+ ''' The value to write.
+ ''' Returns true if the function succeeds, false otherwise.
+
+ Public Function Write(ByVal key As String, ByVal value As Long) As Boolean
+ Return Write(Section, key, value)
+ End Function
+
+ ''' Writes a Byte array to the specified key in the specified section.
+ ''' The section to write in.
+ ''' The key to write to.
+ ''' The value to write.
+ ''' Returns true if the function succeeds, false otherwise.
+
+ Public Function Write(ByVal section As String, ByVal key As String, ByVal value() As Byte) As Boolean
+ If value Is Nothing Then
+ Return Write(section, key, CType(Nothing, String))
+ Else
+ Return Write(section, key, value, 0, value.Length)
+ End If
+ End Function
+
+ ''' Writes a Byte array to the specified key in the active section.
+ ''' The key to write to.
+ ''' The value to write.
+ ''' Returns true if the function succeeds, false otherwise.
+
+ Public Function Write(ByVal key As String, ByVal value() As Byte) As Boolean
+ Return Write(Section, key, value)
+ End Function
+
+ ''' Writes a Byte array to the specified key in the specified section.
+ ''' The section to write in.
+ ''' The key to write to.
+ ''' The value to write.
+ ''' An offset in value.
+ ''' The number of elements of value to convert.
+ ''' Returns true if the function succeeds, false otherwise.
+
+ Public Function Write(ByVal section As String, ByVal key As String, ByVal value() As Byte, ByVal offset As Integer, ByVal length As Integer) As Boolean
+ If value Is Nothing Then
+ Return Write(section, key, CType(Nothing, String))
+ Else
+ Return Write(section, key, Convert.ToBase64String(value, offset, length))
+ End If
+ End Function
+
+ ''' Writes a Boolean to the specified key in the specified section.
+ ''' The section to write in.
+ ''' The key to write to.
+ ''' The value to write.
+ ''' Returns true if the function succeeds, false otherwise.
+
+ Public Function Write(ByVal section As String, ByVal key As String, ByVal value As Boolean) As Boolean
+ Return Write(section, key, value.ToString())
+ End Function
+
+ ''' Writes a Boolean to the specified key in the active section.
+ ''' The key to write to.
+ ''' The value to write.
+ ''' Returns true if the function succeeds, false otherwise.
+
+ Public Function Write(ByVal key As String, ByVal value As Boolean) As Boolean
+ Return Write(Section, key, value)
+ End Function
+
+ ''' Deletes a key from the specified section.
+ ''' The section to delete from.
+ ''' The key to delete.
+ ''' Returns true if the function succeeds, false otherwise.
+
+ Public Function DeleteKey(ByVal section As String, ByVal key As String) As Boolean
+ Return (WritePrivateProfileString(section, key, Nothing, Filename) <> 0)
+ End Function
+
+ ''' Deletes a key from the active section.
+ ''' The key to delete.
+ ''' Returns true if the function succeeds, false otherwise.
+ '''
+
+ Public Function DeleteKey(ByVal key As String) As Boolean
+ Return (WritePrivateProfileString(Section, key, Nothing, Filename) <> 0)
+ End Function
+
+ ''' Deletes a section from an INI file.
+ ''' The section to delete.
+ ''' Returns true if the function succeeds, false otherwise.
+
+ Public Function DeleteSection(ByVal section As String) As Boolean
+ Return WritePrivateProfileSection(section, Nothing, Filename) <> 0
+ End Function
+
+ '''
+ ''' Retrieves a list of all available sections in the INI file.
+ '''
+ '''
+ ''' Returns an ArrayList with all available sections.
+ '''
+
+ Public Function GetSectionNames() As ArrayList
+ Try
+ Dim buffer(MAX_ENTRY) As Byte
+ GetPrivateProfileSectionNames(buffer, MAX_ENTRY, Filename)
+ Dim parts() As String = Encoding.ASCII.GetString(buffer).Trim(ControlChars.NullChar).Split(ControlChars.NullChar)
+ Return New ArrayList(parts)
+ Catch
+ End Try
+ Return Nothing
+ End Function
+
+ 'Private variables and constants
+
+ '''
+ ''' Holds the full path to the INI file.
+ '''
+
+ Private m_Filename As String
+
+ '''
+ ''' Holds the active section name
+ '''
+
+ Private m_Section As String
+
+ '''
+ ''' The maximum number of bytes in a section buffer.
+ '''
+
+ Private Const MAX_ENTRY As Integer = 32768
+
+ End Class
+
diff --git a/CVCncLib/Modules/L_File_aux.vb b/CVCncLib/Modules/L_File_aux.vb
new file mode 100644
index 00000000..b9ad03cc
--- /dev/null
+++ b/CVCncLib/Modules/L_File_aux.vb
@@ -0,0 +1,60 @@
+'
+' libreria : VBlib
+' file : L_File_aux
+'
+' funzioni : routines aux sui nomi file
+'
+' copyright 2008-2015 C.Viviani
+'
+Module L_File_aux
+
+ Function clear_ending_bar(ByVal a As String) As String ' clear the eventual ending "\" in a directory name
+ a = Trim(a)
+ If (Right$(a, 1) = "\") Then
+ a = Left$(a, Len(a) - 1)
+ End If
+ clear_ending_bar = a
+ End Function
+
+ Function add_ending_bar (ByVal s As String) As String
+ If Len(s) > 0 Then
+ If Right$(s, 1) <> "\" Then
+ add_ending_bar = s + "\"
+ Else
+ add_ending_bar = s
+ End If
+ Else
+ add_ending_bar = "\"
+ End If
+ End Function
+
+ Function clear_starting_point(ByVal a As String) As String ' clear the eventual starting "." in a file ext
+ a = Trim(a)
+ If (Left$(a, 1) = ".") Then
+ a = Right$(a, Len(a) - 1)
+ End If
+ clear_starting_point = a
+ End Function
+
+ Function true_false_from_yes_no(ByVal a As String) As Boolean
+ a = UCase$(a)
+ true_false_from_yes_no = False
+ If InStr(a, "Y") Then true_false_from_yes_no = True
+ If InStr(a, "S") Then true_false_from_yes_no = True
+ End Function
+
+ Function clear_starting_forward_bar(ByVal a As String) As String ' clear the eventual initial "/"
+ a = Trim(a)
+ If (Left$(a, 1) = "/") Then
+ a = Right$(a, Len(a) - 1)
+ End If
+ clear_starting_forward_bar = a
+ End Function
+
+ Function trim_to_n_char(ByVal a As String, ByVal n As Integer) As String
+ a = Trim(a)
+ If Len(a) > n Then a = Left$(a, n)
+ trim_to_n_char = a
+ End Function
+
+End Module
diff --git a/CVCncLib/Modules/Log.vb b/CVCncLib/Modules/Log.vb
new file mode 100644
index 00000000..a0c61844
--- /dev/null
+++ b/CVCncLib/Modules/Log.vb
@@ -0,0 +1,47 @@
+'
+' libreria : VBlib
+' file : Log.vb
+'
+' funzioni : gestione log file
+'
+' copyright 2008-2017 C.Viviani
+'
+Imports System.IO
+Imports Microsoft.VisualBasic
+
+Public Module Log
+
+ Const MAX_LOG_FILE As Long = 1000000
+
+ Dim fs As FileStream
+ Dim szInternalFilename As String
+
+ Public Sub init(ByVal szLogFileName As String)
+
+
+
+ End Sub
+
+ Sub finish()
+
+ End Sub
+
+ Sub write(ByRef sz_arg As String)
+
+
+
+ End Sub
+
+ Sub write_and_messagebox(ByRef sz_arg As String, n_error As Integer)
+
+
+ End Sub
+
+ Private Sub ll_write(ByRef sz_arg As String)
+
+
+
+ End Sub
+
+End Module
+
diff --git a/CVCncLib/Modules/M_aspect.vb b/CVCncLib/Modules/M_aspect.vb
new file mode 100644
index 00000000..584ac863
--- /dev/null
+++ b/CVCncLib/Modules/M_aspect.vb
@@ -0,0 +1,126 @@
+Module M_aspect
+
+ Const BUTTON_TOP As Integer = 380
+ Const BUTTON_WIDTH As Integer = 75
+ Const BUTTON_HEIGHT As Integer = 40
+
+ Sub init()
+ With FrmMain
+
+ ' -------------- positions ----------------
+
+ Call Button_init()
+
+ ' -------------- clear labels ----------------
+
+ .LblProgramName.Text = "---------"
+
+ ' ------------ messages -------------------------
+
+
+ .LblCurrentProgram.Text = Message.msg(36) ' Currently machining :
+ .LblMachineStatus.Text = Message.msg(37) ' Machine Status :
+ ' .LblNextProgram.Text = Message.msg(38) ' Next program :
+
+
+ Call button_text()
+
+ ' -------------- visibilities ------------------
+
+ Call button_visibility()
+
+ .LblConnected.Visible = True
+ .LblProgramName.Visible = True
+
+ .LblMachineStatus.Visible = True
+ .LblMachState.Visible = True
+
+
+ .LblCurrentProgram.Visible = True
+ .LblNcStatus.Visible = True
+
+ If (IniRead.b_BarCodeInput_enabled Or IniRead.b_FileInputMode_enabled) And pRegistered Then
+
+ ' Call M_serial_barcode.set_textbox(.TxtBarCode)
+ End If
+
+
+
+
+ ' -------------- size -------------------------
+
+ ' -------------- simulation ------------------
+
+ If IniRead.b_debug Then ' simulation stuff
+
+ .BtnSim0.Visible = True
+ .BtnSim1.Visible = True
+ .BtnSim2.Visible = True
+ .BtnSim3.Visible = True
+ .BtnSim4.Visible = True
+ .BtnSim5.Visible = True
+ .LblSimPrgSent1.Visible = True
+ .LblSimPrgSent2.Visible = True
+
+ End If
+
+ ' ---------------- old osai
+
+ If (IniRead.b_force_S10WLK32 And IniRead.b_verbose) Or (IniRead.b_test_nc) Then
+ .BtnReadOldOsai.Visible = True
+ .BtnWrite1OldOsai.Visible = True
+ .BtnWrite2OldOsai.Visible = True
+ .BtnWrite3OldOsai.Visible = True
+ .BtnWrite4OldOsai.Visible = True
+ .BtnWrite5OldOsai.Visible = True
+ .LblReadOldOsai.Visible = True
+
+ .BtnReadOldOsai.Text = "R var " & IniRead.nVar_NC_state.ToString
+ .BtnWrite1OldOsai.Text = "W1"
+ .BtnWrite2OldOsai.Text = "W2"
+ .BtnWrite3OldOsai.Text = "W3"
+ .BtnWrite4OldOsai.Text = "W4"
+ .BtnWrite5OldOsai.Text = "W5"
+ End If
+
+
+ If (IniRead.b_win7 And IniRead.b_test_nc) Or (IniRead.b_send_file) Then
+ .Btn_test_file.Visible = True
+ End If
+
+ End With
+
+ End Sub
+
+ Private Sub Button_init()
+
+ With FrmMain
+
+
+ .BtnExit.Top = BUTTON_TOP
+ .BtnExit.Width = BUTTON_WIDTH
+ .BtnExit.Height = BUTTON_HEIGHT
+ .BtnExit.Left = 220
+
+
+ End With
+ End Sub
+
+ Private Sub button_visibility()
+ With FrmMain
+ .BtnExit.Visible = True
+
+ End With
+
+ End Sub
+
+ Private Sub button_text()
+ With FrmMain
+
+ .BtnExit.Text = Message.msg(21) ' Exit
+ End With
+
+ End Sub
+
+
+End Module
diff --git a/CVCncLib/Modules/M_cn_connection.vb b/CVCncLib/Modules/M_cn_connection.vb
new file mode 100644
index 00000000..4dc4e8f6
--- /dev/null
+++ b/CVCncLib/Modules/M_cn_connection.vb
@@ -0,0 +1,458 @@
+Imports System.IO
+
+Module M_cn_connection
+
+#Region "ENUM States and Local Constants"
+
+#End Region
+
+#Region "Global Constants"
+
+ Public Const SLEEP_TIME As Integer = 150 ' attesa connessione CN
+ Public Const MAX_RETRY As Integer = 10 ' numero tentativi connessione CN
+
+#End Region
+
+#Region "Global Vars"
+
+ ' oggetto Serie per connessione PC / CN
+ Public CnOsai As ComCNOsai
+
+#End Region
+
+#Region "local vars "
+
+ Private b_first_time As Boolean
+
+ Private nret As Int16
+
+ ' Private send_mode As e_send_mode = e_send_mode.SM_SIMPLE
+
+ Private b_even As Boolean = False
+
+ Private n_prev_Value_NC_running As Byte
+ Private sz_NC_Program_Name As String
+
+ ' Private Start_time As DateTime
+ ' Private Stop_time As DateTime
+
+
+#End Region
+
+
+ ' ---------------------------------------------------------
+ ' ---- Procedura per inizializzare connessione con CN -----
+ ' ---------------------------------------------------------
+ ' ---------------------------------------------------------
+ Sub StartConnection()
+
+ Dim szCmdLink As String = ""
+ Dim b_DotNet As Boolean
+ Dim b_ok As Boolean = False
+
+ FrmMain.Show()
+
+ ' se non in debug
+ If (Not IniRead.b_debug) Then
+
+ FrmMain.LblConnected.Visible = True ' !!
+ FrmMain.LblConnected.Text = "Step 1....." ' !!
+
+ If IniRead.b_verbose Then
+ Log.write(FrmMain.LblConnected.Text & " " & IniRead.szNameNC)
+ FrmMain.LblConnected.Text = Message.msg(8) & IniRead.szNameNC
+ ' MsgBox(Message.msg(8) & IniRead.szNameNC) ' connecting to
+ End If
+
+ ' istanzio l'oggetto CN
+
+
+ If IniRead.b_force_S10WLK32 Or IniRead.b_open_control Or IniRead.b_no_WinNBI Then
+ b_ok = True
+ Else
+ b_ok = ComCNOsai.GetWinnbi(b_DotNet)
+ End If
+
+ If b_ok Then
+
+ If IniRead.b_open_control Then ' osai serie open ?
+ CnOsai = New Open_Series(IniRead.szNameNC, IniRead.b_debug)
+ Else
+
+ If IniRead.b_force_S10WLK32 Then ' vecchissimi cn serie 10 non winnbi ?
+ 'CnOsai = New ComCNOSAI_S10WLK32(IniRead.szNameNC, False)
+ Else
+ If IniRead.b_no_WinNBI Then ' forzo versione non .NET
+ CnOsai = New ComCNOSAIVB6(IniRead.szNameNC, False)
+ Else
+ If b_DotNet Then ' win nbi con .Net
+ CnOsai = New ComCNOsai(IniRead.szNameNC, False)
+ Else
+ CnOsai = New ComCNOSAIVB6(IniRead.szNameNC, False)
+ End If ' win nbi con .Net
+
+ End If ' forzo versione non .NET
+ End If ' vecchissimi cn serie 10 non winnbi
+ End If ' osai serie open
+
+ If IniRead.b_verbose And Not IniRead.b_force_S10WLK32 And Not IniRead.b_open_control And Not IniRead.b_no_WinNBI Then
+ FrmMain.LblConnected.Text = "Win nbi v." & ComCNOsai.GetWinnbi_version() & "New : " & b_DotNet.ToString
+ Log.write("Win nbi v." & ComCNOsai.GetWinnbi_version() & "New : " & b_DotNet.ToString)
+
+ ' MsgBox(ComCNOsai.GetWinnbi_version() & vbCrLf & "Nuova : " & b_DotNet.ToString, , "Win nbi version")
+ End If
+
+
+ b_ok = CnOsai.OpenSession()
+
+ FrmMain.LblConnected.Visible = True
+
+ ' connessione non ok
+ If (CnOsai.Connected = False) Then
+
+ FrmMain.LblConnected.Text = Message.msg(11) ' "NOT CONNECTED"
+ FrmMain.LblConnected.ForeColor = Color.Red
+ MsgBox(CnOsai.ErrMsg, MsgBoxStyle.Critical, Message.msg(10)) ' Nc connection
+ Log.write(" Error connecting " & IniRead.szNameNC & " " & CnOsai.ErrMsg)
+ Else
+
+ FrmMain.LblConnected.Text = Message.msg(12) ' "NC connect ok "
+ FrmMain.LblConnected.ForeColor = Color.Blue
+
+ If IniRead.b_open_control Then ' if open control
+ Else
+
+ Do While Not CnOsai.Is_NC_running
+
+ System.Threading.Thread.Sleep(SLEEP_TIME)
+
+ Loop
+ End If ' if open control
+
+ End If ' connessione non ok
+
+ Log.write(FrmMain.LblConnected.Text)
+
+ Else
+ MsgBox("Missing Win NBI", MsgBoxStyle.Critical, "Missing Win NBI") ' Nc connection
+
+ End If
+
+
+ Else ' se in debug
+
+ FrmMain.LblConnected.Text = "DEBUG"
+ FrmMain.LblConnected.ForeColor = Color.Orange
+
+ End If
+
+ End Sub
+
+ Sub CheckConnection()
+
+ ' un po' di letture per vedere se funziona
+
+ Dim b_timeout As Boolean = False
+ Dim n_retry As Integer
+ Dim n_temp As Integer
+ Dim Var_tmp As ComCNOsai.stVAR
+
+
+
+ ' ' effetuo net use di sicurezza per evitare che il collegamento non sia stato ancora avvenuto
+ ' szCmdLink = "net use " & Ini.DiskCn & " \\" & IniRead.szNameNc & "\PROGRA1"
+ ' Shell(szCmdLink)
+ ' System.Threading.Thread.Sleep(100)
+
+
+ n_retry = 0
+
+
+ Var_tmp.nAddress = nVar_NC_state
+ Var_tmp.nBit = 0 ' solo x evitare warning ...
+ Var_tmp.nNumCn = 1 ' solo x evitare warning ...
+ Var_tmp.szVarName = "" ' solo x evitare warning ...
+
+ If (Not IniRead.b_debug) Then
+
+ System.Threading.Thread.Sleep(SLEEP_TIME)
+
+ If IniRead.b_verbose Then Log.write(" Check NC connection 1") '
+
+ If IniRead.b_force_S10WLK32 Then ' vecchissimi cn serie 10 non winnbi ?
+
+ If IniRead.b_verbose Then Log.write("b_force_S10WLK32") '
+
+ Else
+
+ b_timeout = True
+
+ Do While n_retry < MAX_RETRY
+
+ System.Threading.Thread.Sleep(SLEEP_TIME)
+
+ Try
+
+ n_temp = CnOsai.ReadShortVar(Var_tmp)
+
+ Catch ex As Exception
+
+ MsgBox(ex.Message,, "check connection ")
+
+ End Try
+
+
+ If n_temp <> ComCNOsai.ERRORVALUE Then
+ b_timeout = False
+ Exit Do
+
+ End If
+ n_retry = n_retry + 1
+
+ If IniRead.b_verbose Then Log.write(" Check NC connection 2 : " & FrmMain.LblConnected.Text)
+
+
+ If Not (CnOsai Is Nothing) Then
+ CnOsai.CloseSession()
+ End If
+
+ FrmMain.LblConnected.Text = Str(n_retry)
+ If IniRead.b_verbose Then Log.write(" Check NC connection 3 : " & FrmMain.LblConnected.Text)
+
+
+ System.Threading.Thread.Sleep(SLEEP_TIME)
+ CnOsai.OpenSession()
+
+ If CnOsai.Connected Then
+ Else
+ FrmMain.LblConnected.Text = Str(n_retry) & " -- " & CnOsai.ErrMsg
+ If IniRead.b_verbose Then Log.write(" Check NC connection 4 ( bad ) : " & FrmMain.LblConnected.Text)
+
+ End If
+
+ Loop
+ End If
+
+
+ If b_timeout Then
+
+ FrmMain.LblConnected.Text = Message.msg(13) ' " CANNOT CONNECT (2)"
+ FrmMain.LblConnected.ForeColor = Color.OrangeRed
+ MsgBox(CnOsai.ErrMsg, MsgBoxStyle.Critical, Message.msg(13)) ' CANNOT CONNECT (2)
+ Log.write(Message.msg(13) & " - " & CnOsai.ErrMsg)
+
+ End
+
+ Else
+
+ ' Imposto Label Connected con il nome del Channel utilizzato
+ FrmMain.LblConnected.Text = FrmMain.LblConnected.Text + " (" + IniRead.szNameNC + ")"
+ FrmMain.LblConnected.ForeColor = Color.DarkGreen
+
+ Log.write(FrmMain.LblConnected.Text)
+
+ End If
+
+
+
+ End If
+
+ End Sub
+ ' -------------------------------------------------------------------------------
+ ' ---- interfaccia con simulazione della scrittura variabili CN -----------------
+ ' -------------------------------------------------------------------------------
+ Sub Write_NC_var(ByVal n_var As Integer, ByVal n_value As Integer)
+
+ Dim Var_tmp As ComCNOsai.stVAR
+
+ If Not IniRead.b_debug Then ' effettiva scrittura su CN
+
+ Var_tmp.nAddress = n_var
+ Var_tmp.nBit = 0 ' solo x evitare warning ...
+ Var_tmp.nNumCn = 1 ' solo x evitare warning ...
+ Var_tmp.szVarName = "" ' solo x evitare warning ...
+
+ Call CnOsai.WriteShortVar(Var_tmp, n_value)
+
+ Else ' simulation
+ If n_var = IniRead.nVar_prg_1_ok Then
+
+ If n_value = 0 Then
+ FrmMain.LblSimPrgSent1.BackColor = Color.Azure
+ Else
+ FrmMain.LblSimPrgSent1.BackColor = Color.LawnGreen
+ End If
+ End If
+
+ If n_var = IniRead.nVar_prg_2_ok Then
+ If n_value = 0 Then
+ FrmMain.LblSimPrgSent2.BackColor = Color.Azure
+ Else
+ FrmMain.LblSimPrgSent2.BackColor = Color.LawnGreen
+ End If
+ End If
+ End If
+
+ End Sub
+ ' -------------------------------------------------------------------------------
+ ' ---- interfaccia con simulazione della lettura variabili CN -------------------
+ ' -------------------------------------------------------------------------------
+ Function Read_Nc_var(ByVal n_var As Integer) As Short
+
+ Dim Var_tmp As ComCNOsai.stVAR
+
+ Dim n_temp As Short
+
+ If Not IniRead.b_debug Then ' effettiva lettura da CN
+
+ Var_tmp.nAddress = n_var
+ Var_tmp.nBit = 0 ' solo x evitare warning ...
+ Var_tmp.nNumCn = 1 ' solo x evitare warning ...
+ Var_tmp.szVarName = "" ' solo x evitare warning ...
+
+ n_temp = CnOsai.ReadShortVar(Var_tmp)
+
+ Else ' simulation
+ n_temp = FrmMain.n_simulated_index ' read the state of the buttons ....
+ End If
+
+ Return n_temp
+
+ End Function
+
+ Sub Write_NC_L_var(ByVal n_var As Integer, ByVal d_value As Double)
+
+ Dim Var_tmp As ComCNOsai.stVAR
+
+ If Not IniRead.b_debug Then ' effettiva scrittura su CN
+
+ Var_tmp.nAddress = n_var
+ Var_tmp.nBit = 0 ' solo x evitare warning ...
+ Var_tmp.nNumCn = 1 ' solo x evitare warning ...
+ Var_tmp.szVarName = "" ' solo x evitare warning ...
+
+ Call CnOsai.WriteVarL(Var_tmp, d_value)
+
+ Else ' simulation
+ End If
+
+ End Sub
+
+ Function Read_Nc_L_var(ByVal n_var) As Double
+
+ Dim Var_tmp As ComCNOsai.stVAR
+
+ Dim d_temp As Double
+
+ If Not IniRead.b_debug Then ' effettiva lettura da CN
+
+ Var_tmp.nAddress = n_var
+ Var_tmp.nBit = 0 ' solo x evitare warning ...
+ Var_tmp.nNumCn = 1 ' solo x evitare warning ...
+ Var_tmp.szVarName = "" ' solo x evitare warning ...
+
+ d_temp = CnOsai.ReadVarL(Var_tmp)
+
+ Else ' simulation
+ d_temp = 0.1234
+ End If
+
+ Return d_temp
+
+ End Function
+
+ ' -------------------------------------------------------------------------------
+ ' ---- Controlla se CN è in RUN -------------------------------------------------
+ ' -------------------------------------------------------------------------------
+ Function Check_NC_running() As Boolean
+
+ Dim info1 As CndexLinkDotNet.Cndex.GETINFO1DATA
+ Dim ProcStat As CndexLinkDotNet.Cndex.PROCDATA
+
+ Dim n_NC_status As Byte
+ ' Dim n_NC_status_bis As Byte
+
+
+ info1.rap_feed_ov = 0 ' per placare i warning ma non sembra funzionare....
+
+ Check_NC_running = True
+
+ ' If (CnOsai.NcInfo1(info1)) Then
+ ' n_NC_status = info1.status
+
+ If (CnOsai.NcProcessStatus(ProcStat)) Then
+
+
+ n_NC_status = ProcStat.Status
+
+ Select Case n_NC_status
+
+ Case ComCNOsai.EMERG_
+ Check_NC_running = False
+
+ Case ComCNOsai.ERRO_
+ Check_NC_running = False
+
+ Case ComCNOsai.RESET_
+ Check_NC_running = False
+
+ Case ComCNOsai.IDLE_
+ Check_NC_running = False
+
+ Case ComCNOsai.CYCLE_
+ Check_NC_running = True
+
+ Case ComCNOsai.HOLDA_
+ Case ComCNOsai.RUNH_
+ Case ComCNOsai.HRUN_
+
+
+ End Select
+
+ End If
+
+ Return Check_NC_running
+
+ End Function
+
+ ' -------------------------------------------------------------------------------
+ ' ---- Get NC status -------------------------------------------------
+ ' -------------------------------------------------------------------------------
+ Function Get_NC_status(ByRef n_NC_sub_status As Short) As Short
+
+ Dim info1 As CndexLinkDotNet.Cndex.GETINFO1DATA
+ Dim ProcStat As CndexLinkDotNet.Cndex.PROCDATA
+
+ Dim n_NC_status As Short
+
+ info1.rap_feed_ov = 0 ' per placare i warning ma non sembra funzionare....
+
+
+ If (CnOsai.NcProcessStatus(ProcStat)) Then
+ n_NC_status = ProcStat.Status
+ n_NC_sub_status = ProcStat.SubStatus
+ Else
+ MsgBox(CnOsai.ErrMsg)
+ End If
+
+ Return n_NC_status
+
+ End Function
+
+
+
+
+ Function CN_error_class() As Long
+
+ Return CnOsai.ErrClass
+
+ End Function
+
+ Function CN_error_num() As Long
+
+ Return CnOsai.ErrNum
+
+ End Function
+
+
+End Module
diff --git a/CVCncLib/Modules/M_machine.vb b/CVCncLib/Modules/M_machine.vb
new file mode 100644
index 00000000..deb429e1
--- /dev/null
+++ b/CVCncLib/Modules/M_machine.vb
@@ -0,0 +1,21 @@
+Module M_machine
+
+ Sub get_machine_state()
+
+ machine_state = Read_Nc_var(IniRead.nVar_NC_state)
+
+ End Sub
+
+ Sub set_var_prg_1_ok(ByVal state As Integer)
+
+ Write_NC_var(IniRead.nVar_prg_1_ok, state)
+
+ End Sub
+
+ Sub set_var_prg_2_ok(ByVal state As Integer)
+
+ Write_NC_var(IniRead.nVar_prg_2_ok, state)
+
+ End Sub
+
+End Module
diff --git a/CVCncLib/Modules/M_state_machine.vb b/CVCncLib/Modules/M_state_machine.vb
new file mode 100644
index 00000000..b3b63636
--- /dev/null
+++ b/CVCncLib/Modules/M_state_machine.vb
@@ -0,0 +1,375 @@
+Imports System.IO
+
+Module M_state_machine
+
+
+#Region "Global Constants"
+
+ Public Const ODD As Integer = 1
+ Public Const EVEN As Integer = 0 ' was 2 , changed to 0 for zero based arrays
+
+ Public Const ERR_RET As Short = 0
+ Public Const OK_RET As Short = 1
+
+#End Region
+
+#Region "ENUM States"
+
+ Public Enum mach_state_Type
+ T_RESET = 0
+ T_READY = 1
+ T_MACHINING_1 = 2
+ T_END_MACHINING_1 = 3
+ T_MACHINING_2 = 4
+ T_END_MACHINING_2 = 5
+ T_BAD_PART = 8
+ End Enum
+
+#End Region
+
+#Region "Global Vars"
+
+ Public machine_state As mach_state_Type
+ Public sim_machine_state As mach_state_Type
+
+ Public b_restarting As Boolean
+ Public sz_start_datetime(2) As String
+
+ Public b_running As Boolean
+ Public sz_next_program As String
+
+#End Region
+
+#Region "local variables "
+
+ Private prev_machine_state As mach_state_Type
+ Private entry_state As Boolean
+ Private b_check_new_program As Boolean
+
+
+
+ Private b_machining_odd_prog As Boolean
+
+ Private sz_dest As String
+ Private sz_source As String
+ Private sz_source_s(10) As String
+
+
+#End Region
+
+ Sub init()
+
+ b_running = True
+
+ machine_state = mach_state_Type.T_RESET
+ prev_machine_state = mach_state_Type.T_RESET
+
+ b_restarting = False
+
+ entry_state = True
+
+ b_check_new_program = False
+
+ ' set the fist machining to be ODD
+ Call set_b_machining_odd_prog(True)
+
+
+
+ End Sub
+ '
+ ' the real main state machine
+ '
+ Sub go()
+
+ 'If Not b_running Then Exit Sub
+
+ '' Call Display_machine_data()
+
+ 'Call M_machine.get_machine_state()
+
+ 'If entry_state Then FrmMain.LblMachState.Text = Message.msg(45) ' waiting machine to get ready......
+
+
+ Dim ncInfo As CndexLinkDotNet.Cndex.GETINFO1DATA
+ ncInfo = Nothing
+
+
+ Dim machineStatus As Byte
+ Dim modeSelected As Byte
+
+ ' modi/stati vedere CncOSAI riga 85
+
+ machineStatus = CnOsai.GetMachineStatus()
+ modeSelected = CnOsai.GetModeSelected()
+
+
+ ' valore bitmap dello statup IOB
+ Dim status As Short = 0
+
+ ' power on
+ If CnOsai.Connected Then
+ status += 1
+ End If
+
+ ' RUN mode
+ If (machineStatus = ComCNOsai.CYCLE_ And modeSelected = ComCNOsai.AUTO) Then
+ status += 2
+ End If
+
+ ' Allarme
+ If (machineStatus = ComCNOsai.ERRO_) Then
+ status += 8
+ End If
+
+ ' Manuale
+ If (modeSelected <> ComCNOsai.AUTO) Then
+ status += 16
+ End If
+
+ ' Allarme
+ If (machineStatus = ComCNOsai.EMERG_) Then
+ status += 32
+ End If
+
+
+ ' compongo i bit di status...
+ Dim IobBitmap As String
+ IobBitmap = "--------------" + vbCrLf
+ IobBitmap += "Bitmap IOB:" + vbCrLf
+ IobBitmap += status.ToString() + vbCrLf
+ IobBitmap += "--------------" + vbCrLf + vbCrLf
+
+ ' per leggere variabili dichiaro la struttura
+ Dim temp As ComCNOsai.stVAR
+ temp.nAddress = nVar_NC_state ' da conf che vale 352 da
+ temp.nBit = 0
+ temp.nNumCn = 1
+ temp.szVarName = ""
+
+ Dim risultato As Short
+ risultato = CnOsai.ReadShortVar(temp)
+
+ IobBitmap += vbCrLf
+ IobBitmap += "Variabile " + nVar_NC_state.ToString() + ": " + risultato.ToString()
+
+
+ FrmMain.LblMapoIOB.Text = IobBitmap
+
+
+
+ 'CnOsai.NcInfo1(ncInfo)
+
+ FrmMain.LblMachState.Text = "Status:" + machineStatus.ToString() + " / Mode: " + modeSelected.ToString()
+
+ '' wait for state 0 or 1 at beginning
+
+ 'If entry_state And (machine_state = mach_state_Type.T_MACHINING_1) Then Exit Sub
+ 'If entry_state And (machine_state = mach_state_Type.T_MACHINING_2) Then Exit Sub
+ 'If entry_state And (machine_state = mach_state_Type.T_END_MACHINING_1) Then Exit Sub
+ 'If entry_state And (machine_state = mach_state_Type.T_END_MACHINING_2) Then Exit Sub
+
+ 'entry_state = False
+
+ 'Select Case machine_state
+
+ ' ' _______________________ T_RESET STATE ____________________
+
+ ' Case mach_state_Type.T_RESET
+ ' FrmMain.LblMachState.Text = Message.msg(46) ' Not Ready
+
+ ' '_______________________ T_READY STATE ____________________
+
+ ' Case mach_state_Type.T_READY
+ ' FrmMain.LblMachState.Text = Message.msg(47) ' Ready
+ ' FrmMain.LblProgramName.Text = "------"
+
+ ' If prev_machine_state <> mach_state_Type.T_READY Then ' state change ??
+ ' b_check_new_program = True ' enable 1 run only after state change
+ ' End If ' cambio di stato
+
+ ' If b_check_new_program Then '
+ ' If get_next_item_no_qty() Then
+ ' Call start_machining()
+ ' b_check_new_program = False
+ ' End If
+ ' End If ' controllo programmi disponibili abilitato
+
+ ' '_______________________ T_MACHINING_1 STATE ____________________
+
+ ' Case mach_state_Type.T_MACHINING_1
+
+ ' FrmMain.LblMachState.Text = Message.msg(49) ' machining
+
+ ' If prev_machine_state <> mach_state_Type.T_MACHINING_1 Then ' state change ??
+
+ ' If prev_machine_state = mach_state_Type.T_MACHINING_2 Then ' skipped end machining 2 ??
+
+
+ ' End If ' skipped end machining 2
+
+ ' b_check_new_program = True ' enable 1 run only after state change
+
+ ' ' save start time
+
+ ' sz_start_datetime(ODD) = Now.ToString
+ ' Debug.Print(" Start time " & sz_start_datetime(ODD) & " odd/even " & Str(ODD))
+ ' Call Log.write("Start time" & sz_start_datetime(ODD) & " odd/even " & Str(ODD))
+
+ ' ' here change in queue display drawing if any
+ ' ' here change in drawing if any
+ ' ' Call M_wmf.picture_send(True)
+
+
+
+ ' End If ' state change
+
+ ' Call check_and_start()
+
+ ' '_______________________ T_END_MACHINING_1 STATE ____________________
+
+ ' Case mach_state_Type.T_END_MACHINING_1
+
+ ' FrmMain.LblMachState.Text = Message.msg(48) ' end machining
+ ' FrmMain.LblProgramName.Text = "------"
+
+ ' If prev_machine_state <> mach_state_Type.T_END_MACHINING_1 Then ' state change ??
+
+ ' ' here change in drawing if any
+
+ ' End If ' state change
+
+ ' Call check_and_start()
+
+ ' '_______________________ T_MACHINING_2 STATE ____________________
+
+ ' Case mach_state_Type.T_MACHINING_2
+
+ ' FrmMain.LblMachState.Text = Message.msg(49) ' machining
+
+ ' If prev_machine_state <> mach_state_Type.T_MACHINING_2 Then ' state change ??
+
+ ' If prev_machine_state = mach_state_Type.T_MACHINING_1 Then ' skipped end machining 1 ??
+
+
+ ' End If ' skipped end machining 1
+
+ ' b_check_new_program = True ' enable 1 run only after state change
+
+ ' ' save start time
+
+ ' sz_start_datetime(EVEN) = Now.ToString
+ ' Debug.Print(" Start time " & sz_start_datetime(EVEN) & " odd/even " & Str(EVEN))
+ ' Call Log.write("Start time" & sz_start_datetime(EVEN) & " odd/even " & Str(EVEN))
+
+ ' ' here change in queue display drawing if any
+ ' ' here change in drawing if any
+ ' ' Call M_wmf.picture_send(False)
+
+
+ ' End If ' state change
+
+ ' Call check_and_start()
+
+ ' '_______________________ T_END_MACHINING_2 STATE ____________________
+
+ ' Case mach_state_Type.T_END_MACHINING_2
+
+ ' FrmMain.LblMachState.Text = Message.msg(48) ' end machining
+ ' FrmMain.LblProgramName.Text = "------"
+
+ ' If prev_machine_state <> mach_state_Type.T_END_MACHINING_2 Then ' state change ??
+
+ ' ' here change in drawing if any
+
+ ' End If ' state change
+
+ ' Call check_and_start()
+
+ ' '__________________________________________
+
+ 'End Select
+
+ 'prev_machine_state = machine_state
+
+ End Sub
+
+ ' returns the next item from the queue ( if any )
+
+ Private Function get_next_item_no_qty() As Boolean
+
+ Dim b_ret As Boolean = False
+
+
+
+ Return b_ret
+
+ End Function
+
+ Private Sub check_and_start()
+
+ If b_check_new_program Then ' available programs check enabled ??
+ If get_next_item_no_qty() Then
+ Call start_machining()
+ b_check_new_program = False
+ End If
+ End If ' available programs check enabled
+
+ End Sub
+
+ ' some serious processing here ....
+
+ Private Sub start_machining()
+
+ End Sub
+
+ Private Sub crea_programma()
+
+
+ End Sub
+
+ Private Sub set_dest_program_name()
+
+
+
+ End Sub
+
+ Private Sub set_b_machining_odd_prog(ByVal b As Boolean)
+
+
+ End Sub
+
+ '-------------------------------------------------------------
+ '-------------------------------------------------------------
+
+#Region "my funny valentine"
+ '
+ ' ritorna 1 ( OK_RET ) se ok ; 0 ( ERR_RET ) se in errore
+ '
+ Function my_f_____copy_file_to_nc(ByVal sz_Pc_file_name As String, ByVal sz_Nc_file_name As String) As Short
+
+
+
+ End Function
+
+ Sub my_f_____File_Delete(ByVal sz_to_delete As String)
+
+ End Sub
+
+ '
+ ' ritorna 1 ( OK_RET ) se ok ; 0 ( ERR_RET ) se in errore
+ '
+ Function my_f_____copy_file_from_nc(ByVal sz_Nc_file_name As String, ByVal sz_Pc_file_name As String) As Short
+
+
+ End Function
+
+
+
+#End Region
+
+ Private Sub Display_machine_data()
+
+
+ End Sub
+
+End Module
diff --git a/CVCncLib/Modules/Message.vb b/CVCncLib/Modules/Message.vb
new file mode 100644
index 00000000..08abc60e
--- /dev/null
+++ b/CVCncLib/Modules/Message.vb
@@ -0,0 +1,36 @@
+'
+' libreria : VBlib
+' file : Message
+'
+' funzioni : gestione messaggi
+'
+' copyright 2008-2015 C.Viviani
+'
+Imports System
+Imports System.IO
+Imports System.IO.File
+
+Public Module Message
+
+ Public msg() As String
+
+ Sub init()
+
+ Dim sz_filename As String
+
+ sz_filename = Application.StartupPath & "\messages\" & Application.ProductName & ".msg"
+
+ If File.Exists(sz_filename) Then '
+ Try
+ msg = System.IO.File.ReadAllLines(sz_filename)
+ Catch e As Exception
+ MsgBox(e.Message, MsgBoxStyle.Critical, "Error !")
+ End
+ End Try
+ Else
+ MsgBox(" Missing message file :" & vbCrLf & sz_filename, MsgBoxStyle.Critical, "Error 3 :")
+ End
+ End If
+ End Sub
+
+End Module
diff --git a/CVCncLib/My Project/Application.Designer.vb b/CVCncLib/My Project/Application.Designer.vb
new file mode 100644
index 00000000..2086b57e
--- /dev/null
+++ b/CVCncLib/My Project/Application.Designer.vb
@@ -0,0 +1,38 @@
+'------------------------------------------------------------------------------
+'
+' Il codice è stato generato da uno strumento.
+' Versione runtime:4.0.30319.42000
+'
+' Le modifiche apportate a questo file possono provocare un comportamento non corretto e andranno perse se
+' il codice viene rigenerato.
+'
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+
+
+Namespace My
+
+ 'NOTA: il file è generato automaticamente e non può essere modificato direttamente. Per apportare modifiche
+ ' o se vengono rilevati errori di compilazione nel file, passare a Progettazione progetti
+ ' (aprire le proprietà del progetto o fare doppio clic sul nodo Progetto in
+ ' Esplora soluzioni) e apportare le modifiche nella scheda Applicazione.
+ '
+ Partial Friend Class MyApplication
+
+ _
+ Public Sub New()
+ MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows)
+ Me.IsSingleInstance = false
+ Me.EnableVisualStyles = true
+ Me.SaveMySettingsOnExit = true
+ Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses
+ End Sub
+
+ _
+ Protected Overrides Sub OnCreateMainForm()
+ Me.MainForm = Global.testSam.FrmMain
+ End Sub
+ End Class
+End Namespace
diff --git a/CVCncLib/My Project/Application.myapp b/CVCncLib/My Project/Application.myapp
new file mode 100644
index 00000000..8f84d6b0
--- /dev/null
+++ b/CVCncLib/My Project/Application.myapp
@@ -0,0 +1,10 @@
+
+
+ true
+ FrmMain
+ false
+ 0
+ true
+ 0
+ true
+
\ No newline at end of file
diff --git a/CVCncLib/My Project/AssemblyInfo.vb b/CVCncLib/My Project/AssemblyInfo.vb
new file mode 100644
index 00000000..3a0ff5bb
--- /dev/null
+++ b/CVCncLib/My Project/AssemblyInfo.vb
@@ -0,0 +1,35 @@
+Imports System
+Imports System.Reflection
+Imports System.Runtime.InteropServices
+
+' General Information about an assembly is controlled through the following
+' set of attributes. Change these attribute values to modify the information
+' associated with an assembly.
+
+' Review the values of the assembly attributes
+
+
+
+
+
+
+
+
+
+
+'The following GUID is for the ID of the typelib if this project is exposed to COM
+
+
+' Version information for an assembly consists of the following four values:
+'
+' Major Version
+' Minor Version
+' Build Number
+' Revision
+'
+' You can specify all the values or you can default the Build and Revision Numbers
+' by using the '*' as shown below:
+'
+
+
+
diff --git a/CVCncLib/My Project/Resources.Designer.vb b/CVCncLib/My Project/Resources.Designer.vb
new file mode 100644
index 00000000..e7db4b4d
--- /dev/null
+++ b/CVCncLib/My Project/Resources.Designer.vb
@@ -0,0 +1,63 @@
+'------------------------------------------------------------------------------
+'
+' Il codice è stato generato da uno strumento.
+' Versione runtime:4.0.30319.42000
+'
+' Le modifiche apportate a questo file possono provocare un comportamento non corretto e andranno perse se
+' il codice viene rigenerato.
+'
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+
+Imports System
+
+Namespace My.Resources
+
+ 'Questa classe è stata generata automaticamente dalla classe StronglyTypedResourceBuilder.
+ 'tramite uno strumento quale ResGen o Visual Studio.
+ 'Per aggiungere o rimuovere un membro, modificare il file con estensione ResX ed eseguire nuovamente ResGen
+ 'con l'opzione /str oppure ricompilare il progetto VS.
+ '''
+ ''' Classe di risorse fortemente tipizzata per la ricerca di stringhe localizzate e così via.
+ '''
+ _
+ Friend Module Resources
+
+ Private resourceMan As Global.System.Resources.ResourceManager
+
+ Private resourceCulture As Global.System.Globalization.CultureInfo
+
+ '''
+ ''' Restituisce l'istanza di ResourceManager nella cache utilizzata da questa classe.
+ '''
+ _
+ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
+ Get
+ If Object.ReferenceEquals(resourceMan, Nothing) Then
+ Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("testSam.Resources", GetType(Resources).Assembly)
+ resourceMan = temp
+ End If
+ Return resourceMan
+ End Get
+ End Property
+
+ '''
+ ''' Esegue l'override della proprietà CurrentUICulture del thread corrente per tutte le
+ ''' ricerche di risorse eseguite utilizzando questa classe di risorse fortemente tipizzata.
+ '''
+ _
+ Friend Property Culture() As Global.System.Globalization.CultureInfo
+ Get
+ Return resourceCulture
+ End Get
+ Set
+ resourceCulture = value
+ End Set
+ End Property
+ End Module
+End Namespace
diff --git a/CVCncLib/My Project/Resources.resx b/CVCncLib/My Project/Resources.resx
new file mode 100644
index 00000000..af7dbebb
--- /dev/null
+++ b/CVCncLib/My Project/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/CVCncLib/My Project/Settings.Designer.vb b/CVCncLib/My Project/Settings.Designer.vb
new file mode 100644
index 00000000..fb4c174b
--- /dev/null
+++ b/CVCncLib/My Project/Settings.Designer.vb
@@ -0,0 +1,93 @@
+'------------------------------------------------------------------------------
+'
+' Il codice è stato generato da uno strumento.
+' Versione runtime:4.0.30319.42000
+'
+' Le modifiche apportate a questo file possono provocare un comportamento non corretto e andranno perse se
+' il codice viene rigenerato.
+'
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+
+
+Namespace My
+
+ _
+ Partial Friend NotInheritable Class MySettings
+ Inherits Global.System.Configuration.ApplicationSettingsBase
+
+ Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
+
+#Region "Funzionalità di salvataggio automatico My.Settings"
+#If _MyType = "WindowsForms" Then
+ Private Shared addedHandler As Boolean
+
+ Private Shared addedHandlerLockObject As New Object
+
+ _
+ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
+ If My.Application.SaveMySettingsOnExit Then
+ My.Settings.Save()
+ End If
+ End Sub
+#End If
+#End Region
+
+ Public Shared ReadOnly Property [Default]() As MySettings
+ Get
+
+#If _MyType = "WindowsForms" Then
+ If Not addedHandler Then
+ SyncLock addedHandlerLockObject
+ If Not addedHandler Then
+ AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
+ addedHandler = True
+ End If
+ End SyncLock
+ End If
+#End If
+ Return defaultInstance
+ End Get
+ End Property
+
+ _
+ Public ReadOnly Property door_pro_WebReference_OPENcontrol() As String
+ Get
+ Return CType(Me("door_pro_WebReference_OPENcontrol"),String)
+ End Get
+ End Property
+
+ _
+ Public ReadOnly Property d_prod_WebReference_OPENcontrol() As String
+ Get
+ Return CType(Me("d_prod_WebReference_OPENcontrol"),String)
+ End Get
+ End Property
+ End Class
+End Namespace
+
+Namespace My
+
+ _
+ Friend Module MySettingsProperty
+
+ _
+ Friend ReadOnly Property Settings() As Global.testSam.My.MySettings
+ Get
+ Return Global.testSam.My.MySettings.Default
+ End Get
+ End Property
+ End Module
+End Namespace
diff --git a/CVCncLib/My Project/Settings.settings b/CVCncLib/My Project/Settings.settings
new file mode 100644
index 00000000..631b5669
--- /dev/null
+++ b/CVCncLib/My Project/Settings.settings
@@ -0,0 +1,12 @@
+
+
+
+
+
+ http://192.168.20.2:8080
+
+
+ http://192.168.20.2:8080
+
+
+
\ No newline at end of file
diff --git a/CVCncLib/My Project/app.manifest b/CVCncLib/My Project/app.manifest
new file mode 100644
index 00000000..4c249cd2
--- /dev/null
+++ b/CVCncLib/My Project/app.manifest
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/CVCncLib/Service References/OPENcontrol.wsdl b/CVCncLib/Service References/OPENcontrol.wsdl
new file mode 100644
index 00000000..1a05dbcb
--- /dev/null
+++ b/CVCncLib/Service References/OPENcontrol.wsdl
@@ -0,0 +1,5895 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Service definition of function ns__BootPhaseEnquiry
+
+
+
+
+ Service definition of function ns__BootReboot
+
+
+
+
+ Service definition of function ns__BootShutDown
+
+
+
+
+ Service definition of function ns__BootMode
+
+
+
+
+ Service definition of function ns__GetHWKey
+
+
+
+
+ Service definition of function ns__ReadVarWord
+
+
+
+
+ Service definition of function ns__ReadVarDouble
+
+
+
+
+ Service definition of function ns__WriteVarWord
+
+
+
+
+ Service definition of function ns__WriteVarWordBit
+
+
+
+
+ Service definition of function ns__WriteVarDouble
+
+
+
+
+ Service definition of function ns__ReadVarText
+
+
+
+
+ Service definition of function ns__WriteVarText
+
+
+
+
+ Service definition of function ns__ReadWarningMsg
+
+
+
+
+ Service definition of function ns__ResetSingleTableII
+
+
+
+
+ Service definition of function ns__LockTableII
+
+
+
+
+ Service definition of function ns__UnLockTableII
+
+
+
+
+ Service definition of function ns__GetOriginTabRecordII
+
+
+
+
+ Service definition of function ns__SetOriginTabRecordII
+
+
+
+
+ Service definition of function ns__GetToolTabRecordII
+
+
+
+
+ Service definition of function ns__SetToolTabRecordII
+
+
+
+
+ Service definition of function ns__GetOffsetTabRecordII
+
+
+
+
+ Service definition of function ns__SetOffsetTabRecordII
+
+
+
+
+ Service definition of function ns__GetUserTabRecordII
+
+
+
+
+ Service definition of function ns__SetUserTabRecordII
+
+
+
+
+ Service definition of function ns__SaveTables
+
+
+
+
+ Service definition of function ns__RestoreSingleTable
+
+
+
+
+ Service definition of function ns__SaveSingleTable
+
+
+
+
+ Service definition of function ns__SaveBackupMemory
+
+
+
+
+ Service definition of function ns__RestoreBackupMemory
+
+
+
+
+ Service definition of function ns__Cycle
+
+
+
+
+ Service definition of function ns__SyncroCycle
+
+
+
+
+ Service definition of function ns__Reset
+
+
+
+
+ Service definition of function ns__Hold
+
+
+
+
+ Service definition of function ns__SetFeedManOver
+
+
+
+
+ Service definition of function ns__SetFeedRateOver
+
+
+
+
+ Service definition of function ns__SetFeedRapidOver
+
+
+
+
+ Service definition of function ns__SetSpeedRateOver
+
+
+
+
+ Service definition of function ns__SetManMovDirection
+
+
+
+
+ Service definition of function ns__GetVarJOG
+
+
+
+
+ Service definition of function ns__SetVarJOG
+
+
+
+
+ Service definition of function ns__SetVarUAS
+
+
+
+
+ Service definition of function ns__GetVarRCM
+
+
+
+
+ Service definition of function ns__SetVarRCM
+
+
+
+
+ Service definition of function ns__GetProcVarWord
+
+
+
+
+ Service definition of function ns__SetProcVarWord
+
+
+
+
+ Service definition of function ns__GetProcVarDouble
+
+
+
+
+ Service definition of function ns__SetProcVarDouble
+
+
+
+
+ Service definition of function ns__SetMdiString
+
+
+
+
+ Service definition of function ns__SetProcessMode
+
+
+
+
+ Service definition of function ns__SelectProcess
+
+
+
+
+ Service definition of function ns__GetSelectedProcess
+
+
+
+
+ Service definition of function ns__SelectProcAxis
+
+
+
+
+ Service definition of function ns__SelectPartProgram
+
+
+
+
+ Service definition of function ns__SelectPartProgramFromDrive
+
+
+
+
+ Service definition of function ns__GetActivePartProgram
+
+
+
+
+ Service definition of function ns__GetPartProgramLines
+
+
+
+
+ Service definition of function ns__GetAxOriginNum
+
+
+
+
+ Service definition of function ns__GetAxesPosition
+
+
+
+
+ Service definition of function ns__GetNcInfo1
+
+
+
+
+ Service definition of function ns__GetNcInfo2
+
+
+
+
+ Service definition of function ns__GetToolNames
+
+
+
+
+ Service definition of function ns__GetProcessStatus
+
+
+
+
+ Service definition of function ns__GetBlkNum
+
+
+
+
+ Service definition of function ns__ReadErrMsg
+
+
+
+
+ Service definition of function ns__ReadPartProgramMsg
+
+
+
+
+ Service definition of function ns__GetGCode
+
+
+
+
+ Service definition of function ns__GetMCode
+
+
+
+
+ Service definition of function ns__SkipPProgBlock
+
+
+
+
+ Service definition of function ns__Ese
+
+
+
+
+ Service definition of function ns__EseEx
+
+
+
+
+ Service definition of function ns__Exe
+
+
+
+
+ Service definition of function ns__AxesRef
+
+
+
+
+ Service definition of function ns__DncInit
+
+
+
+
+ Service definition of function ns__DncData
+
+
+
+
+ Service definition of function ns__DncEof
+
+
+
+
+ Service definition of function ns__DncStop
+
+
+
+
+ Service definition of function ns__GetAxesInfo3
+
+
+
+
+ Service definition of function ns__GetCodeNumber
+
+
+
+
+ Service definition of function ns__GetOptions
+
+
+
+
+ Service definition of function ns__GetDateTime
+
+
+
+
+ Service definition of function ns__SetDateTime
+
+
+
+
+ Service definition of function ns__GetSerialNumber
+
+
+
+
+ Service definition of function ns__PutFile
+
+
+
+
+ Service definition of function ns__GetFile
+
+
+
+
+ Service definition of function ns__PutBinaryFile
+
+
+
+
+ Service definition of function ns__GetBinaryFile
+
+
+
+
+ Service definition of function ns__LogFSSetSecurityLevel
+
+
+
+
+ Service definition of function ns__LogFSGetSecurityLevel
+
+
+
+
+ Service definition of function ns__LogFSLongFileNames
+
+
+
+
+ Service definition of function ns__LogFSGetNumDrive
+
+
+
+
+ Service definition of function ns__LogFSGetDriveList
+
+
+
+
+ Service definition of function ns__LogFSGetHiddenDriveList
+
+
+
+
+ Service definition of function ns__LogFSGetDrivePath
+
+
+
+
+ Service definition of function ns__LogFSAddDrive
+
+
+
+
+ Service definition of function ns__LogFSRemoveDrive
+
+
+
+
+ Service definition of function ns__LogFSReloadDriveList
+
+
+
+
+ Service definition of function ns__LogFSCreateDir
+
+
+
+
+ Service definition of function ns__LogFSCreateFile
+
+
+
+
+ Service definition of function ns__LogFSGetFileSize
+
+
+
+
+ Service definition of function ns__LogFSGetFileAttrib
+
+
+
+
+ Service definition of function ns__LogFSSetFileAttrib
+
+
+
+
+ Service definition of function ns__LogFSChangeFileAttrib
+
+
+
+
+ Service definition of function ns__LogFSFindFirst
+
+
+
+
+ Service definition of function ns__LogFSFindNext
+
+
+
+
+ Service definition of function ns__LogFSFindClose
+
+
+
+
+ Service definition of function ns__LogFSRemoveFile
+
+
+
+
+ Service definition of function ns__LogFSRemoveDir
+
+
+
+
+ Service definition of function ns__LogFSRename
+
+
+
+
+ Service definition of function ns__LogFSCopyFile
+
+
+
+
+ Service definition of function ns__LogFSGetInfo
+
+
+
+
+ Service definition of function ns__GetAvailableCustomEvents
+
+
+
+
+ Service definition of function ns__GetSysTick
+
+
+
+
+ Service definition of function ns__GetProcessConfNum
+
+
+
+
+ Service definition of function ns__MonOpenChannel
+
+
+
+
+ Service definition of function ns__MonCloseChannel
+
+
+
+
+ Service definition of function ns__MonAddVariable
+
+
+
+
+ Service definition of function ns__MonDeleteVariable
+
+
+
+
+ Service definition of function ns__MonStartSampling
+
+
+
+
+ Service definition of function ns__MonStopSampling
+
+
+
+
+ Service definition of function ns__MonGetVariable
+
+
+
+
+ Service definition of function ns__CheckHistory
+
+
+
+
+ Service definition of function ns__ReadHistoryEmergMsg
+
+
+
+
+ Service definition of function ns__ReadHistoryErrorMsg
+
+
+
+
+ Service definition of function ns__ReadHistoryLogMsg
+
+
+
+
+ Service definition of function ns__ReadHistoryAnomalyMsg
+
+
+
+
+ Service definition of function ns__ReadCurrentErrorMsg
+
+
+
+
+ Service definition of function ns__ReadCurrentEmergMsg
+
+
+
+
+ Service definition of function ns__ReadCurrentAnomalyMsg
+
+
+
+
+ Service definition of function ns__GetPTechSizes
+
+
+
+
+ Service definition of function ns__LoadPTech
+
+
+
+
+ Service definition of function ns__GetMarkerInfo
+
+
+
+
+ Service definition of function ns__ManagePartProgram
+
+
+
+
+ Service definition of function ns__LogFSOpenFile
+
+
+
+
+ Service definition of function ns__LogFSCloseFile
+
+
+
+
+ Service definition of function ns__LogFSWriteRecord
+
+
+
+
+ Service definition of function ns__LogFSReadRecord
+
+
+
+
+ Service definition of function ns__ReadRemapDefinitions
+
+
+
+
+ Service definition of function ns__WriteRemapDefinitions
+
+
+
+
+ Service definition of function ns__GetServoPar
+
+
+
+
+ Service definition of function ns__SetServoPar
+
+
+
+
+ Service definition of function ns__GetCNCRegKey
+
+
+
+
+ Service definition of function ns__SetIpAddress
+
+
+
+
+ Service definition of function ns__GetProcInInput
+
+
+
+
+ Service definition of function ns__SndProcInpData
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ OPENcontrol Web Services Definition
+
+
+
+
+
\ No newline at end of file
diff --git a/CVCncLib/Service References/OpenControl/OPENcontrol.wsdl b/CVCncLib/Service References/OpenControl/OPENcontrol.wsdl
new file mode 100644
index 00000000..478497aa
--- /dev/null
+++ b/CVCncLib/Service References/OpenControl/OPENcontrol.wsdl
@@ -0,0 +1,5895 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Service definition of function ns__BootPhaseEnquiry
+
+
+
+
+ Service definition of function ns__BootReboot
+
+
+
+
+ Service definition of function ns__BootShutDown
+
+
+
+
+ Service definition of function ns__BootMode
+
+
+
+
+ Service definition of function ns__GetHWKey
+
+
+
+
+ Service definition of function ns__ReadVarWord
+
+
+
+
+ Service definition of function ns__ReadVarDouble
+
+
+
+
+ Service definition of function ns__WriteVarWord
+
+
+
+
+ Service definition of function ns__WriteVarWordBit
+
+
+
+
+ Service definition of function ns__WriteVarDouble
+
+
+
+
+ Service definition of function ns__ReadVarText
+
+
+
+
+ Service definition of function ns__WriteVarText
+
+
+
+
+ Service definition of function ns__ReadWarningMsg
+
+
+
+
+ Service definition of function ns__ResetSingleTableII
+
+
+
+
+ Service definition of function ns__LockTableII
+
+
+
+
+ Service definition of function ns__UnLockTableII
+
+
+
+
+ Service definition of function ns__GetOriginTabRecordII
+
+
+
+
+ Service definition of function ns__SetOriginTabRecordII
+
+
+
+
+ Service definition of function ns__GetToolTabRecordII
+
+
+
+
+ Service definition of function ns__SetToolTabRecordII
+
+
+
+
+ Service definition of function ns__GetOffsetTabRecordII
+
+
+
+
+ Service definition of function ns__SetOffsetTabRecordII
+
+
+
+
+ Service definition of function ns__GetUserTabRecordII
+
+
+
+
+ Service definition of function ns__SetUserTabRecordII
+
+
+
+
+ Service definition of function ns__SaveTables
+
+
+
+
+ Service definition of function ns__RestoreSingleTable
+
+
+
+
+ Service definition of function ns__SaveSingleTable
+
+
+
+
+ Service definition of function ns__SaveBackupMemory
+
+
+
+
+ Service definition of function ns__RestoreBackupMemory
+
+
+
+
+ Service definition of function ns__Cycle
+
+
+
+
+ Service definition of function ns__SyncroCycle
+
+
+
+
+ Service definition of function ns__Reset
+
+
+
+
+ Service definition of function ns__Hold
+
+
+
+
+ Service definition of function ns__SetFeedManOver
+
+
+
+
+ Service definition of function ns__SetFeedRateOver
+
+
+
+
+ Service definition of function ns__SetFeedRapidOver
+
+
+
+
+ Service definition of function ns__SetSpeedRateOver
+
+
+
+
+ Service definition of function ns__SetManMovDirection
+
+
+
+
+ Service definition of function ns__GetVarJOG
+
+
+
+
+ Service definition of function ns__SetVarJOG
+
+
+
+
+ Service definition of function ns__SetVarUAS
+
+
+
+
+ Service definition of function ns__GetVarRCM
+
+
+
+
+ Service definition of function ns__SetVarRCM
+
+
+
+
+ Service definition of function ns__GetProcVarWord
+
+
+
+
+ Service definition of function ns__SetProcVarWord
+
+
+
+
+ Service definition of function ns__GetProcVarDouble
+
+
+
+
+ Service definition of function ns__SetProcVarDouble
+
+
+
+
+ Service definition of function ns__SetMdiString
+
+
+
+
+ Service definition of function ns__SetProcessMode
+
+
+
+
+ Service definition of function ns__SelectProcess
+
+
+
+
+ Service definition of function ns__GetSelectedProcess
+
+
+
+
+ Service definition of function ns__SelectProcAxis
+
+
+
+
+ Service definition of function ns__SelectPartProgram
+
+
+
+
+ Service definition of function ns__SelectPartProgramFromDrive
+
+
+
+
+ Service definition of function ns__GetActivePartProgram
+
+
+
+
+ Service definition of function ns__GetPartProgramLines
+
+
+
+
+ Service definition of function ns__GetAxOriginNum
+
+
+
+
+ Service definition of function ns__GetAxesPosition
+
+
+
+
+ Service definition of function ns__GetNcInfo1
+
+
+
+
+ Service definition of function ns__GetNcInfo2
+
+
+
+
+ Service definition of function ns__GetToolNames
+
+
+
+
+ Service definition of function ns__GetProcessStatus
+
+
+
+
+ Service definition of function ns__GetBlkNum
+
+
+
+
+ Service definition of function ns__ReadErrMsg
+
+
+
+
+ Service definition of function ns__ReadPartProgramMsg
+
+
+
+
+ Service definition of function ns__GetGCode
+
+
+
+
+ Service definition of function ns__GetMCode
+
+
+
+
+ Service definition of function ns__SkipPProgBlock
+
+
+
+
+ Service definition of function ns__Ese
+
+
+
+
+ Service definition of function ns__EseEx
+
+
+
+
+ Service definition of function ns__Exe
+
+
+
+
+ Service definition of function ns__AxesRef
+
+
+
+
+ Service definition of function ns__DncInit
+
+
+
+
+ Service definition of function ns__DncData
+
+
+
+
+ Service definition of function ns__DncEof
+
+
+
+
+ Service definition of function ns__DncStop
+
+
+
+
+ Service definition of function ns__GetAxesInfo3
+
+
+
+
+ Service definition of function ns__GetCodeNumber
+
+
+
+
+ Service definition of function ns__GetOptions
+
+
+
+
+ Service definition of function ns__GetDateTime
+
+
+
+
+ Service definition of function ns__SetDateTime
+
+
+
+
+ Service definition of function ns__GetSerialNumber
+
+
+
+
+ Service definition of function ns__PutFile
+
+
+
+
+ Service definition of function ns__GetFile
+
+
+
+
+ Service definition of function ns__PutBinaryFile
+
+
+
+
+ Service definition of function ns__GetBinaryFile
+
+
+
+
+ Service definition of function ns__LogFSSetSecurityLevel
+
+
+
+
+ Service definition of function ns__LogFSGetSecurityLevel
+
+
+
+
+ Service definition of function ns__LogFSLongFileNames
+
+
+
+
+ Service definition of function ns__LogFSGetNumDrive
+
+
+
+
+ Service definition of function ns__LogFSGetDriveList
+
+
+
+
+ Service definition of function ns__LogFSGetHiddenDriveList
+
+
+
+
+ Service definition of function ns__LogFSGetDrivePath
+
+
+
+
+ Service definition of function ns__LogFSAddDrive
+
+
+
+
+ Service definition of function ns__LogFSRemoveDrive
+
+
+
+
+ Service definition of function ns__LogFSReloadDriveList
+
+
+
+
+ Service definition of function ns__LogFSCreateDir
+
+
+
+
+ Service definition of function ns__LogFSCreateFile
+
+
+
+
+ Service definition of function ns__LogFSGetFileSize
+
+
+
+
+ Service definition of function ns__LogFSGetFileAttrib
+
+
+
+
+ Service definition of function ns__LogFSSetFileAttrib
+
+
+
+
+ Service definition of function ns__LogFSChangeFileAttrib
+
+
+
+
+ Service definition of function ns__LogFSFindFirst
+
+
+
+
+ Service definition of function ns__LogFSFindNext
+
+
+
+
+ Service definition of function ns__LogFSFindClose
+
+
+
+
+ Service definition of function ns__LogFSRemoveFile
+
+
+
+
+ Service definition of function ns__LogFSRemoveDir
+
+
+
+
+ Service definition of function ns__LogFSRename
+
+
+
+
+ Service definition of function ns__LogFSCopyFile
+
+
+
+
+ Service definition of function ns__LogFSGetInfo
+
+
+
+
+ Service definition of function ns__GetAvailableCustomEvents
+
+
+
+
+ Service definition of function ns__GetSysTick
+
+
+
+
+ Service definition of function ns__GetProcessConfNum
+
+
+
+
+ Service definition of function ns__MonOpenChannel
+
+
+
+
+ Service definition of function ns__MonCloseChannel
+
+
+
+
+ Service definition of function ns__MonAddVariable
+
+
+
+
+ Service definition of function ns__MonDeleteVariable
+
+
+
+
+ Service definition of function ns__MonStartSampling
+
+
+
+
+ Service definition of function ns__MonStopSampling
+
+
+
+
+ Service definition of function ns__MonGetVariable
+
+
+
+
+ Service definition of function ns__CheckHistory
+
+
+
+
+ Service definition of function ns__ReadHistoryEmergMsg
+
+
+
+
+ Service definition of function ns__ReadHistoryErrorMsg
+
+
+
+
+ Service definition of function ns__ReadHistoryLogMsg
+
+
+
+
+ Service definition of function ns__ReadHistoryAnomalyMsg
+
+
+
+
+ Service definition of function ns__ReadCurrentErrorMsg
+
+
+
+
+ Service definition of function ns__ReadCurrentEmergMsg
+
+
+
+
+ Service definition of function ns__ReadCurrentAnomalyMsg
+
+
+
+
+ Service definition of function ns__GetPTechSizes
+
+
+
+
+ Service definition of function ns__LoadPTech
+
+
+
+
+ Service definition of function ns__GetMarkerInfo
+
+
+
+
+ Service definition of function ns__ManagePartProgram
+
+
+
+
+ Service definition of function ns__LogFSOpenFile
+
+
+
+
+ Service definition of function ns__LogFSCloseFile
+
+
+
+
+ Service definition of function ns__LogFSWriteRecord
+
+
+
+
+ Service definition of function ns__LogFSReadRecord
+
+
+
+
+ Service definition of function ns__ReadRemapDefinitions
+
+
+
+
+ Service definition of function ns__WriteRemapDefinitions
+
+
+
+
+ Service definition of function ns__GetServoPar
+
+
+
+
+ Service definition of function ns__SetServoPar
+
+
+
+
+ Service definition of function ns__GetCNCRegKey
+
+
+
+
+ Service definition of function ns__SetIpAddress
+
+
+
+
+ Service definition of function ns__GetProcInInput
+
+
+
+
+ Service definition of function ns__SndProcInpData
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ OPENcontrol Web Services Definition
+
+
+
+
+
\ No newline at end of file
diff --git a/CVCncLib/Service References/OpenControl/Reference.svcmap b/CVCncLib/Service References/OpenControl/Reference.svcmap
new file mode 100644
index 00000000..73204471
--- /dev/null
+++ b/CVCncLib/Service References/OpenControl/Reference.svcmap
@@ -0,0 +1,30 @@
+
+
+
+ false
+ true
+
+ false
+ false
+ false
+
+
+ true
+ Auto
+ true
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/CVCncLib/Service References/OpenControl/Reference.vb b/CVCncLib/Service References/OpenControl/Reference.vb
new file mode 100644
index 00000000..e642a24e
--- /dev/null
+++ b/CVCncLib/Service References/OpenControl/Reference.vb
@@ -0,0 +1,29126 @@
+'------------------------------------------------------------------------------
+'
+' Il codice è stato generato da uno strumento.
+' Versione runtime:4.0.30319.42000
+'
+' Le modifiche apportate a questo file possono provocare un comportamento non corretto e andranno perse se
+' il codice viene rigenerato.
+'
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+
+
+Namespace OpenControl
+
+ _
+ Public Interface OPENcontrolPortType
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione BootPhaseEnquiry non è RPC né incapsulata da documenti.
+ _
+ Function BootPhaseEnquiry(ByVal request As OpenControl.BootPhaseEnquiryRequest) As OpenControl.BootPhaseEnquiryResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione BootReboot non è RPC né incapsulata da documenti.
+ _
+ Function BootReboot(ByVal request As OpenControl.BootRebootRequest) As OpenControl.BootRebootResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione BootShutDown non è RPC né incapsulata da documenti.
+ _
+ Function BootShutDown(ByVal request As OpenControl.BootShutDownRequest) As OpenControl.BootShutDownResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione BootMode non è RPC né incapsulata da documenti.
+ _
+ Function BootMode(ByVal request As OpenControl.BootModeRequest) As OpenControl.BootModeResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione GetHWKey non è RPC né incapsulata da documenti.
+ _
+ Function GetHWKey(ByVal request As OpenControl.GetHWKeyRequest) As OpenControl.GetHWKeyResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione ReadVarWord non è RPC né incapsulata da documenti.
+ _
+ Function ReadVarWord(ByVal request As OpenControl.ReadVarWordRequest) As OpenControl.ReadVarWordResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione ReadVarDouble non è RPC né incapsulata da documenti.
+ _
+ Function ReadVarDouble(ByVal request As OpenControl.ReadVarDoubleRequest) As OpenControl.ReadVarDoubleResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione WriteVarWord non è RPC né incapsulata da documenti.
+ _
+ Function WriteVarWord(ByVal request As OpenControl.WriteVarWordRequest) As OpenControl.WriteVarWordResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione WriteVarWordBit non è RPC né incapsulata da documenti.
+ _
+ Function WriteVarWordBit(ByVal request As OpenControl.WriteVarWordBitRequest) As OpenControl.WriteVarWordBitResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione WriteVarDouble non è RPC né incapsulata da documenti.
+ _
+ Function WriteVarDouble(ByVal request As OpenControl.WriteVarDoubleRequest) As OpenControl.WriteVarDoubleResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione ReadVarText non è RPC né incapsulata da documenti.
+ _
+ Function ReadVarText(ByVal request As OpenControl.ReadVarTextRequest) As OpenControl.ReadVarTextResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione WriteVarText non è RPC né incapsulata da documenti.
+ _
+ Function WriteVarText(ByVal request As OpenControl.WriteVarTextRequest) As OpenControl.WriteVarTextResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione ReadWarningMsg non è RPC né incapsulata da documenti.
+ _
+ Function ReadWarningMsg(ByVal request As OpenControl.ReadWarningMsgRequest) As OpenControl.ReadWarningMsgResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione ResetSingleTableII non è RPC né incapsulata da documenti.
+ _
+ Function ResetSingleTableII(ByVal request As OpenControl.ResetSingleTableIIRequest) As OpenControl.ResetSingleTableIIResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione LockTableII non è RPC né incapsulata da documenti.
+ _
+ Function LockTableII(ByVal request As OpenControl.LockTableIIRequest) As OpenControl.LockTableIIResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione UnLockTableII non è RPC né incapsulata da documenti.
+ _
+ Function UnLockTableII(ByVal request As OpenControl.UnLockTableIIRequest) As OpenControl.UnLockTableIIResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione GetOriginTabRecordII non è RPC né incapsulata da documenti.
+ _
+ Function GetOriginTabRecordII(ByVal request As OpenControl.GetOriginTabRecordIIRequest) As OpenControl.GetOriginTabRecordIIResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione SetOriginTabRecordII non è RPC né incapsulata da documenti.
+ _
+ Function SetOriginTabRecordII(ByVal request As OpenControl.SetOriginTabRecordIIRequest) As OpenControl.SetOriginTabRecordIIResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione GetToolTabRecordII non è RPC né incapsulata da documenti.
+ _
+ Function GetToolTabRecordII(ByVal request As OpenControl.GetToolTabRecordIIRequest) As OpenControl.GetToolTabRecordIIResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione SetToolTabRecordII non è RPC né incapsulata da documenti.
+ _
+ Function SetToolTabRecordII(ByVal request As OpenControl.SetToolTabRecordIIRequest) As OpenControl.SetToolTabRecordIIResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione GetOffsetTabRecordII non è RPC né incapsulata da documenti.
+ _
+ Function GetOffsetTabRecordII(ByVal request As OpenControl.GetOffsetTabRecordIIRequest) As OpenControl.GetOffsetTabRecordIIResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione SetOffsetTabRecordII non è RPC né incapsulata da documenti.
+ _
+ Function SetOffsetTabRecordII(ByVal request As OpenControl.SetOffsetTabRecordIIRequest) As OpenControl.SetOffsetTabRecordIIResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione GetUserTabRecordII non è RPC né incapsulata da documenti.
+ _
+ Function GetUserTabRecordII(ByVal request As OpenControl.GetUserTabRecordIIRequest) As OpenControl.GetUserTabRecordIIResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione SetUserTabRecordII non è RPC né incapsulata da documenti.
+ _
+ Function SetUserTabRecordII(ByVal request As OpenControl.SetUserTabRecordIIRequest) As OpenControl.SetUserTabRecordIIResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione SaveTables non è RPC né incapsulata da documenti.
+ _
+ Function SaveTables(ByVal request As OpenControl.SaveTablesRequest) As OpenControl.SaveTablesResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione RestoreSingleTable non è RPC né incapsulata da documenti.
+ _
+ Function RestoreSingleTable(ByVal request As OpenControl.RestoreSingleTableRequest) As OpenControl.RestoreSingleTableResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione SaveSingleTable non è RPC né incapsulata da documenti.
+ _
+ Function SaveSingleTable(ByVal request As OpenControl.SaveSingleTableRequest) As OpenControl.SaveSingleTableResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione SaveBackupMemory non è RPC né incapsulata da documenti.
+ _
+ Function SaveBackupMemory(ByVal request As OpenControl.SaveBackupMemoryRequest) As OpenControl.SaveBackupMemoryResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione RestoreBackupMemory non è RPC né incapsulata da documenti.
+ _
+ Function RestoreBackupMemory(ByVal request As OpenControl.RestoreBackupMemoryRequest) As OpenControl.RestoreBackupMemoryResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione Cycle non è RPC né incapsulata da documenti.
+ _
+ Function Cycle(ByVal request As OpenControl.CycleRequest) As OpenControl.CycleResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione SyncroCycle non è RPC né incapsulata da documenti.
+ _
+ Function SyncroCycle(ByVal request As OpenControl.SyncroCycleRequest) As OpenControl.SyncroCycleResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione Reset non è RPC né incapsulata da documenti.
+ _
+ Function Reset(ByVal request As OpenControl.ResetRequest) As OpenControl.ResetResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione Hold non è RPC né incapsulata da documenti.
+ _
+ Function Hold(ByVal request As OpenControl.HoldRequest) As OpenControl.HoldResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione SetFeedManOver non è RPC né incapsulata da documenti.
+ _
+ Function SetFeedManOver(ByVal request As OpenControl.SetFeedManOverRequest) As OpenControl.SetFeedManOverResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione SetFeedRateOver non è RPC né incapsulata da documenti.
+ _
+ Function SetFeedRateOver(ByVal request As OpenControl.SetFeedRateOverRequest) As OpenControl.SetFeedRateOverResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione SetFeedRapidOver non è RPC né incapsulata da documenti.
+ _
+ Function SetFeedRapidOver(ByVal request As OpenControl.SetFeedRapidOverRequest) As OpenControl.SetFeedRapidOverResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione SetSpeedRateOver non è RPC né incapsulata da documenti.
+ _
+ Function SetSpeedRateOver(ByVal request As OpenControl.SetSpeedRateOverRequest) As OpenControl.SetSpeedRateOverResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione SetManMovDirection non è RPC né incapsulata da documenti.
+ _
+ Function SetManMovDirection(ByVal request As OpenControl.SetManMovDirectionRequest) As OpenControl.SetManMovDirectionResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione GetVarJOG non è RPC né incapsulata da documenti.
+ _
+ Function GetVarJOG(ByVal request As OpenControl.GetVarJOGRequest) As OpenControl.GetVarJOGResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione SetVarJOG non è RPC né incapsulata da documenti.
+ _
+ Function SetVarJOG(ByVal request As OpenControl.SetVarJOGRequest) As OpenControl.SetVarJOGResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione SetVarUAS non è RPC né incapsulata da documenti.
+ _
+ Function SetVarUAS(ByVal request As OpenControl.SetVarUASRequest) As OpenControl.SetVarUASResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione GetVarRCM non è RPC né incapsulata da documenti.
+ _
+ Function GetVarRCM(ByVal request As OpenControl.GetVarRCMRequest) As OpenControl.GetVarRCMResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione SetVarRCM non è RPC né incapsulata da documenti.
+ _
+ Function SetVarRCM(ByVal request As OpenControl.SetVarRCMRequest) As OpenControl.SetVarRCMResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione GetProcVarWord non è RPC né incapsulata da documenti.
+ _
+ Function GetProcVarWord(ByVal request As OpenControl.GetProcVarWordRequest) As OpenControl.GetProcVarWordResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione SetProcVarWord non è RPC né incapsulata da documenti.
+ _
+ Function SetProcVarWord(ByVal request As OpenControl.SetProcVarWordRequest) As OpenControl.SetProcVarWordResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione GetProcVarDouble non è RPC né incapsulata da documenti.
+ _
+ Function GetProcVarDouble(ByVal request As OpenControl.GetProcVarDoubleRequest) As OpenControl.GetProcVarDoubleResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione SetProcVarDouble non è RPC né incapsulata da documenti.
+ _
+ Function SetProcVarDouble(ByVal request As OpenControl.SetProcVarDoubleRequest) As OpenControl.SetProcVarDoubleResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione SetMdiString non è RPC né incapsulata da documenti.
+ _
+ Function SetMdiString(ByVal request As OpenControl.SetMdiStringRequest) As OpenControl.SetMdiStringResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione SetProcessMode non è RPC né incapsulata da documenti.
+ _
+ Function SetProcessMode(ByVal request As OpenControl.SetProcessModeRequest) As OpenControl.SetProcessModeResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione SelectProcess non è RPC né incapsulata da documenti.
+ _
+ Function SelectProcess(ByVal request As OpenControl.SelectProcessRequest) As OpenControl.SelectProcessResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione GetSelectedProcess non è RPC né incapsulata da documenti.
+ _
+ Function GetSelectedProcess(ByVal request As OpenControl.GetSelectedProcessRequest) As OpenControl.GetSelectedProcessResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione SelectProcAxis non è RPC né incapsulata da documenti.
+ _
+ Function SelectProcAxis(ByVal request As OpenControl.SelectProcAxisRequest) As OpenControl.SelectProcAxisResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione SelectPartProgram non è RPC né incapsulata da documenti.
+ _
+ Function SelectPartProgram(ByVal request As OpenControl.SelectPartProgramRequest) As OpenControl.SelectPartProgramResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione SelectPartProgramFromDrive non è RPC né incapsulata da documenti.
+ _
+ Function SelectPartProgramFromDrive(ByVal request As OpenControl.SelectPartProgramFromDriveRequest) As OpenControl.SelectPartProgramFromDriveResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione GetActivePartProgram non è RPC né incapsulata da documenti.
+ _
+ Function GetActivePartProgram(ByVal request As OpenControl.GetActivePartProgramRequest) As OpenControl.GetActivePartProgramResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione GetPartProgramLines non è RPC né incapsulata da documenti.
+ _
+ Function GetPartProgramLines(ByVal request As OpenControl.GetPartProgramLinesRequest) As OpenControl.GetPartProgramLinesResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione GetAxOriginNum non è RPC né incapsulata da documenti.
+ _
+ Function GetAxOriginNum(ByVal request As OpenControl.GetAxOriginNumRequest) As OpenControl.GetAxOriginNumResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione GetAxesPosition non è RPC né incapsulata da documenti.
+ _
+ Function GetAxesPosition(ByVal request As OpenControl.GetAxesPositionRequest) As OpenControl.GetAxesPositionResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione GetNcInfo1 non è RPC né incapsulata da documenti.
+ _
+ Function GetNcInfo1(ByVal request As OpenControl.GetNcInfo1Request) As OpenControl.GetNcInfo1Response
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione GetNcInfo2 non è RPC né incapsulata da documenti.
+ _
+ Function GetNcInfo2(ByVal request As OpenControl.GetNcInfo2Request) As OpenControl.GetNcInfo2Response
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione GetToolNames non è RPC né incapsulata da documenti.
+ _
+ Function GetToolNames(ByVal request As OpenControl.GetToolNamesRequest) As OpenControl.GetToolNamesResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione GetProcessStatus non è RPC né incapsulata da documenti.
+ _
+ Function GetProcessStatus(ByVal request As OpenControl.GetProcessStatusRequest) As OpenControl.GetProcessStatusResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione GetBlkNum non è RPC né incapsulata da documenti.
+ _
+ Function GetBlkNum(ByVal request As OpenControl.GetBlkNumRequest) As OpenControl.GetBlkNumResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione ReadErrMsg non è RPC né incapsulata da documenti.
+ _
+ Function ReadErrMsg(ByVal request As OpenControl.ReadErrMsgRequest) As OpenControl.ReadErrMsgResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione ReadPartProgramMsg non è RPC né incapsulata da documenti.
+ _
+ Function ReadPartProgramMsg(ByVal request As OpenControl.ReadPartProgramMsgRequest) As OpenControl.ReadPartProgramMsgResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione GetGCode non è RPC né incapsulata da documenti.
+ _
+ Function GetGCode(ByVal request As OpenControl.GetGCodeRequest) As OpenControl.GetGCodeResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione GetMCode non è RPC né incapsulata da documenti.
+ _
+ Function GetMCode(ByVal request As OpenControl.GetMCodeRequest) As OpenControl.GetMCodeResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione SkipPProgBlock non è RPC né incapsulata da documenti.
+ _
+ Function SkipPProgBlock(ByVal request As OpenControl.SkipPProgBlockRequest) As OpenControl.SkipPProgBlockResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione Ese non è RPC né incapsulata da documenti.
+ _
+ Function Ese(ByVal request As OpenControl.EseRequest) As OpenControl.EseResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione EseEx non è RPC né incapsulata da documenti.
+ _
+ Function EseEx(ByVal request As OpenControl.EseExRequest) As OpenControl.EseExResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione Exe non è RPC né incapsulata da documenti.
+ _
+ Function Exe(ByVal request As OpenControl.ExeRequest) As OpenControl.ExeResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione AxesRef non è RPC né incapsulata da documenti.
+ _
+ Function AxesRef(ByVal request As OpenControl.AxesRefRequest) As OpenControl.AxesRefResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione DncInit non è RPC né incapsulata da documenti.
+ _
+ Function DncInit(ByVal request As OpenControl.DncInitRequest) As OpenControl.DncInitResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione DncData non è RPC né incapsulata da documenti.
+ _
+ Function DncData(ByVal request As OpenControl.DncDataRequest) As OpenControl.DncDataResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione DncEof non è RPC né incapsulata da documenti.
+ _
+ Function DncEof(ByVal request As OpenControl.DncEofRequest) As OpenControl.DncEofResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione DncStop non è RPC né incapsulata da documenti.
+ _
+ Function DncStop(ByVal request As OpenControl.DncStopRequest) As OpenControl.DncStopResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione GetAxesInfo3 non è RPC né incapsulata da documenti.
+ _
+ Function GetAxesInfo3(ByVal request As OpenControl.GetAxesInfo3Request) As OpenControl.GetAxesInfo3Response
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione GetCodeNumber non è RPC né incapsulata da documenti.
+ _
+ Function GetCodeNumber(ByVal request As OpenControl.GetCodeNumberRequest) As OpenControl.GetCodeNumberResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione GetOptions non è RPC né incapsulata da documenti.
+ _
+ Function GetOptions(ByVal request As OpenControl.GetOptionsRequest) As OpenControl.GetOptionsResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione GetDateTime non è RPC né incapsulata da documenti.
+ _
+ Function GetDateTime(ByVal request As OpenControl.GetDateTimeRequest) As OpenControl.GetDateTimeResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione SetDateTime non è RPC né incapsulata da documenti.
+ _
+ Function SetDateTime(ByVal request As OpenControl.SetDateTimeRequest) As OpenControl.SetDateTimeResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione GetSerialNumber non è RPC né incapsulata da documenti.
+ _
+ Function GetSerialNumber(ByVal request As OpenControl.GetSerialNumberRequest) As OpenControl.GetSerialNumberResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione PutFile non è RPC né incapsulata da documenti.
+ _
+ Function PutFile(ByVal request As OpenControl.PutFileRequest) As OpenControl.PutFileResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione GetFile non è RPC né incapsulata da documenti.
+ _
+ Function GetFile(ByVal request As OpenControl.GetFileRequest) As OpenControl.GetFileResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione PutBinaryFile non è RPC né incapsulata da documenti.
+ _
+ Function PutBinaryFile(ByVal request As OpenControl.PutBinaryFileRequest) As OpenControl.PutBinaryFileResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione GetBinaryFile non è RPC né incapsulata da documenti.
+ _
+ Function GetBinaryFile(ByVal request As OpenControl.GetBinaryFileRequest) As OpenControl.GetBinaryFileResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione LogFSSetSecurityLevel non è RPC né incapsulata da documenti.
+ _
+ Function LogFSSetSecurityLevel(ByVal request As OpenControl.LogFSSetSecurityLevelRequest) As OpenControl.LogFSSetSecurityLevelResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione LogFSGetSecurityLevel non è RPC né incapsulata da documenti.
+ _
+ Function LogFSGetSecurityLevel(ByVal request As OpenControl.LogFSGetSecurityLevelRequest) As OpenControl.LogFSGetSecurityLevelResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione LogFSLongFileNames non è RPC né incapsulata da documenti.
+ _
+ Function LogFSLongFileNames(ByVal request As OpenControl.LogFSLongFileNamesRequest) As OpenControl.LogFSLongFileNamesResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione LogFSGetNumDrive non è RPC né incapsulata da documenti.
+ _
+ Function LogFSGetNumDrive(ByVal request As OpenControl.LogFSGetNumDriveRequest) As OpenControl.LogFSGetNumDriveResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione LogFSGetDriveList non è RPC né incapsulata da documenti.
+ _
+ Function LogFSGetDriveList(ByVal request As OpenControl.LogFSGetDriveListRequest) As OpenControl.LogFSGetDriveListResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione LogFSGetHiddenDriveList non è RPC né incapsulata da documenti.
+ _
+ Function LogFSGetHiddenDriveList(ByVal request As OpenControl.LogFSGetHiddenDriveListRequest) As OpenControl.LogFSGetHiddenDriveListResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione LogFSGetDrivePath non è RPC né incapsulata da documenti.
+ _
+ Function LogFSGetDrivePath(ByVal request As OpenControl.LogFSGetDrivePathRequest) As OpenControl.LogFSGetDrivePathResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione LogFSAddDrive non è RPC né incapsulata da documenti.
+ _
+ Function LogFSAddDrive(ByVal request As OpenControl.LogFSAddDriveRequest) As OpenControl.LogFSAddDriveResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione LogFSRemoveDrive non è RPC né incapsulata da documenti.
+ _
+ Function LogFSRemoveDrive(ByVal request As OpenControl.LogFSRemoveDriveRequest) As OpenControl.LogFSRemoveDriveResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione LogFSReloadDriveList non è RPC né incapsulata da documenti.
+ _
+ Function LogFSReloadDriveList(ByVal request As OpenControl.LogFSReloadDriveListRequest) As OpenControl.LogFSReloadDriveListResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione LogFSCreateDir non è RPC né incapsulata da documenti.
+ _
+ Function LogFSCreateDir(ByVal request As OpenControl.LogFSCreateDirRequest) As OpenControl.LogFSCreateDirResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione LogFSCreateFile non è RPC né incapsulata da documenti.
+ _
+ Function LogFSCreateFile(ByVal request As OpenControl.LogFSCreateFileRequest) As OpenControl.LogFSCreateFileResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione LogFSGetFileSize non è RPC né incapsulata da documenti.
+ _
+ Function LogFSGetFileSize(ByVal request As OpenControl.LogFSGetFileSizeRequest) As OpenControl.LogFSGetFileSizeResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione LogFSGetFileAttrib non è RPC né incapsulata da documenti.
+ _
+ Function LogFSGetFileAttrib(ByVal request As OpenControl.LogFSGetFileAttribRequest) As OpenControl.LogFSGetFileAttribResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione LogFSSetFileAttrib non è RPC né incapsulata da documenti.
+ _
+ Function LogFSSetFileAttrib(ByVal request As OpenControl.LogFSSetFileAttribRequest) As OpenControl.LogFSSetFileAttribResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione LogFSChangeFileAttrib non è RPC né incapsulata da documenti.
+ _
+ Function LogFSChangeFileAttrib(ByVal request As OpenControl.LogFSChangeFileAttribRequest) As OpenControl.LogFSChangeFileAttribResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione LogFSFindFirst non è RPC né incapsulata da documenti.
+ _
+ Function LogFSFindFirst(ByVal request As OpenControl.LogFSFindFirstRequest) As OpenControl.LogFSFindFirstResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione LogFSFindNext non è RPC né incapsulata da documenti.
+ _
+ Function LogFSFindNext(ByVal request As OpenControl.LogFSFindNextRequest) As OpenControl.LogFSFindNextResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione LogFSFindClose non è RPC né incapsulata da documenti.
+ _
+ Function LogFSFindClose(ByVal request As OpenControl.LogFSFindCloseRequest) As OpenControl.LogFSFindCloseResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione LogFSRemoveFile non è RPC né incapsulata da documenti.
+ _
+ Function LogFSRemoveFile(ByVal request As OpenControl.LogFSRemoveFileRequest) As OpenControl.LogFSRemoveFileResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione LogFSRemoveDir non è RPC né incapsulata da documenti.
+ _
+ Function LogFSRemoveDir(ByVal request As OpenControl.LogFSRemoveDirRequest) As OpenControl.LogFSRemoveDirResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione LogFSRename non è RPC né incapsulata da documenti.
+ _
+ Function LogFSRename(ByVal request As OpenControl.LogFSRenameRequest) As OpenControl.LogFSRenameResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione LogFSCopyFile non è RPC né incapsulata da documenti.
+ _
+ Function LogFSCopyFile(ByVal request As OpenControl.LogFSCopyFileRequest) As OpenControl.LogFSCopyFileResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione LogFSGetInfo non è RPC né incapsulata da documenti.
+ _
+ Function LogFSGetInfo(ByVal request As OpenControl.LogFSGetInfoRequest) As OpenControl.LogFSGetInfoResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione GetAvailableCustomEvents non è RPC né incapsulata da documenti.
+ _
+ Function GetAvailableCustomEvents(ByVal request As OpenControl.GetAvailableCustomEventsRequest) As OpenControl.GetAvailableCustomEventsResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione GetSysTick non è RPC né incapsulata da documenti.
+ _
+ Function GetSysTick(ByVal request As OpenControl.GetSysTickRequest) As OpenControl.GetSysTickResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione GetProcessConfNum non è RPC né incapsulata da documenti.
+ _
+ Function GetProcessConfNum(ByVal request As OpenControl.GetProcessConfNumRequest) As OpenControl.GetProcessConfNumResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione MonOpenChannel non è RPC né incapsulata da documenti.
+ _
+ Function MonOpenChannel(ByVal request As OpenControl.MonOpenChannelRequest) As OpenControl.MonOpenChannelResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione MonCloseChannel non è RPC né incapsulata da documenti.
+ _
+ Function MonCloseChannel(ByVal request As OpenControl.MonCloseChannelRequest) As OpenControl.MonCloseChannelResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione MonAddVariable non è RPC né incapsulata da documenti.
+ _
+ Function MonAddVariable(ByVal request As OpenControl.MonAddVariableRequest) As OpenControl.MonAddVariableResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione MonDeleteVariable non è RPC né incapsulata da documenti.
+ _
+ Function MonDeleteVariable(ByVal request As OpenControl.MonDeleteVariableRequest) As OpenControl.MonDeleteVariableResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione MonStartSampling non è RPC né incapsulata da documenti.
+ _
+ Function MonStartSampling(ByVal request As OpenControl.MonStartSamplingRequest) As OpenControl.MonStartSamplingResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione MonStopSampling non è RPC né incapsulata da documenti.
+ _
+ Function MonStopSampling(ByVal request As OpenControl.MonStopSamplingRequest) As OpenControl.MonStopSamplingResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione MonGetVariable non è RPC né incapsulata da documenti.
+ _
+ Function MonGetVariable(ByVal request As OpenControl.MonGetVariableRequest) As OpenControl.MonGetVariableResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione CheckHistory non è RPC né incapsulata da documenti.
+ _
+ Function CheckHistory(ByVal request As OpenControl.CheckHistoryRequest) As OpenControl.CheckHistoryResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione ReadHistoryEmergMsg non è RPC né incapsulata da documenti.
+ _
+ Function ReadHistoryEmergMsg(ByVal request As OpenControl.ReadHistoryEmergMsgRequest) As OpenControl.ReadHistoryEmergMsgResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione ReadHistoryErrorMsg non è RPC né incapsulata da documenti.
+ _
+ Function ReadHistoryErrorMsg(ByVal request As OpenControl.ReadHistoryErrorMsgRequest) As OpenControl.ReadHistoryErrorMsgResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione ReadHistoryLogMsg non è RPC né incapsulata da documenti.
+ _
+ Function ReadHistoryLogMsg(ByVal request As OpenControl.ReadHistoryLogMsgRequest) As OpenControl.ReadHistoryLogMsgResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione ReadHistoryAnomalyMsg non è RPC né incapsulata da documenti.
+ _
+ Function ReadHistoryAnomalyMsg(ByVal request As OpenControl.ReadHistoryAnomalyMsgRequest) As OpenControl.ReadHistoryAnomalyMsgResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione ReadCurrentErrorMsg non è RPC né incapsulata da documenti.
+ _
+ Function ReadCurrentErrorMsg(ByVal request As OpenControl.ReadCurrentErrorMsgRequest) As OpenControl.ReadCurrentErrorMsgResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione ReadCurrentEmergMsg non è RPC né incapsulata da documenti.
+ _
+ Function ReadCurrentEmergMsg(ByVal request As OpenControl.ReadCurrentEmergMsgRequest) As OpenControl.ReadCurrentEmergMsgResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione ReadCurrentAnomalyMsg non è RPC né incapsulata da documenti.
+ _
+ Function ReadCurrentAnomalyMsg(ByVal request As OpenControl.ReadCurrentAnomalyMsgRequest) As OpenControl.ReadCurrentAnomalyMsgResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione GetPTechSizes non è RPC né incapsulata da documenti.
+ _
+ Function GetPTechSizes(ByVal request As OpenControl.GetPTechSizesRequest) As OpenControl.GetPTechSizesResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione LoadPTech non è RPC né incapsulata da documenti.
+ _
+ Function LoadPTech(ByVal request As OpenControl.LoadPTechRequest) As OpenControl.LoadPTechResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione GetMarkerInfo non è RPC né incapsulata da documenti.
+ _
+ Function GetMarkerInfo(ByVal request As OpenControl.GetMarkerInfoRequest) As OpenControl.GetMarkerInfoResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione ManagePartProgram non è RPC né incapsulata da documenti.
+ _
+ Function ManagePartProgram(ByVal request As OpenControl.ManagePartProgramRequest) As OpenControl.ManagePartProgramResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione LogFSOpenFile non è RPC né incapsulata da documenti.
+ _
+ Function LogFSOpenFile(ByVal request As OpenControl.LogFSOpenFileRequest) As OpenControl.LogFSOpenFileResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione LogFSCloseFile non è RPC né incapsulata da documenti.
+ _
+ Function LogFSCloseFile(ByVal request As OpenControl.LogFSCloseFileRequest) As OpenControl.LogFSCloseFileResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione LogFSWriteRecord non è RPC né incapsulata da documenti.
+ _
+ Function LogFSWriteRecord(ByVal request As OpenControl.LogFSWriteRecordRequest) As OpenControl.LogFSWriteRecordResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione LogFSReadRecord non è RPC né incapsulata da documenti.
+ _
+ Function LogFSReadRecord(ByVal request As OpenControl.LogFSReadRecordRequest) As OpenControl.LogFSReadRecordResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione ReadRemapDefinitions non è RPC né incapsulata da documenti.
+ _
+ Function ReadRemapDefinitions(ByVal request As OpenControl.ReadRemapDefinitionsRequest) As OpenControl.ReadRemapDefinitionsResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione WriteRemapDefinitions non è RPC né incapsulata da documenti.
+ _
+ Function WriteRemapDefinitions(ByVal request As OpenControl.WriteRemapDefinitionsRequest) As OpenControl.WriteRemapDefinitionsResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione GetServoPar non è RPC né incapsulata da documenti.
+ _
+ Function GetServoPar(ByVal request As OpenControl.GetServoParRequest) As OpenControl.GetServoParResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione SetServoPar non è RPC né incapsulata da documenti.
+ _
+ Function SetServoPar(ByVal request As OpenControl.SetServoParRequest) As OpenControl.SetServoParResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione GetCNCRegKey non è RPC né incapsulata da documenti.
+ _
+ Function GetCNCRegKey(ByVal request As OpenControl.GetCNCRegKeyRequest) As OpenControl.GetCNCRegKeyResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione SetIpAddress non è RPC né incapsulata da documenti.
+ _
+ Function SetIpAddress(ByVal request As OpenControl.SetIpAddressRequest) As OpenControl.SetIpAddressResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione GetProcInInput non è RPC né incapsulata da documenti.
+ _
+ Function GetProcInInput(ByVal request As OpenControl.GetProcInInputRequest) As OpenControl.GetProcInInputResponse
+
+ 'CODEGEN: Generazione di un contratto di messaggio perché l'operazione SndProcInpData non è RPC né incapsulata da documenti.
+ _
+ Function SndProcInpData(ByVal request As OpenControl.SndProcInpDataRequest) As OpenControl.SndProcInpDataResponse
+ End Interface
+
+ '''
+ _
+ Partial Public Class BootPhaseEnquiry
+ Inherits Object
+ Implements System.ComponentModel.INotifyPropertyChanged
+
+ Public Event PropertyChanged As System.ComponentModel.PropertyChangedEventHandler Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged
+
+ Protected Sub RaisePropertyChanged(ByVal propertyName As String)
+ Dim propertyChanged As System.ComponentModel.PropertyChangedEventHandler = Me.PropertyChangedEvent
+ If (Not (propertyChanged) Is Nothing) Then
+ propertyChanged(Me, New System.ComponentModel.PropertyChangedEventArgs(propertyName))
+ End If
+ End Sub
+ End Class
+
+ '''
+ _
+ Partial Public Class DEFRAME
+ Inherits Object
+ Implements System.ComponentModel.INotifyPropertyChanged
+
+ Private rowField As UShort
+
+ Private colField As UShort
+
+ Private lenField As UShort
+
+ Private textField() As Byte
+
+ '''
+ _
+ Public Property row() As UShort
+ Get
+ Return Me.rowField
+ End Get
+ Set
+ Me.rowField = value
+ Me.RaisePropertyChanged("row")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property col() As UShort
+ Get
+ Return Me.colField
+ End Get
+ Set
+ Me.colField = value
+ Me.RaisePropertyChanged("col")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property len() As UShort
+ Get
+ Return Me.lenField
+ End Get
+ Set
+ Me.lenField = value
+ Me.RaisePropertyChanged("len")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property text() As Byte()
+ Get
+ Return Me.textField
+ End Get
+ Set
+ Me.textField = value
+ Me.RaisePropertyChanged("text")
+ End Set
+ End Property
+
+ Public Event PropertyChanged As System.ComponentModel.PropertyChangedEventHandler Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged
+
+ Protected Sub RaisePropertyChanged(ByVal propertyName As String)
+ Dim propertyChanged As System.ComponentModel.PropertyChangedEventHandler = Me.PropertyChangedEvent
+ If (Not (propertyChanged) Is Nothing) Then
+ propertyChanged(Me, New System.ComponentModel.PropertyChangedEventArgs(propertyName))
+ End If
+ End Sub
+ End Class
+
+ '''
+ _
+ Partial Public Class DEFIELDCONTROL
+ Inherits Object
+ Implements System.ComponentModel.INotifyPropertyChanged
+
+ Private strmatchField() As Byte
+
+ Private rangebyteField() As Byte
+
+ Private rangeintField() As Short
+
+ Private rangelongField() As Long
+
+ Private rangeuintField() As UShort
+
+ Private rangeulongField() As ULong
+
+ Private rangefloatField() As Double
+
+ Private rangedoubleField() As Double
+
+ '''
+ _
+ Public Property strmatch() As Byte()
+ Get
+ Return Me.strmatchField
+ End Get
+ Set
+ Me.strmatchField = value
+ Me.RaisePropertyChanged("strmatch")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property rangebyte() As Byte()
+ Get
+ Return Me.rangebyteField
+ End Get
+ Set
+ Me.rangebyteField = value
+ Me.RaisePropertyChanged("rangebyte")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property rangeint() As Short()
+ Get
+ Return Me.rangeintField
+ End Get
+ Set
+ Me.rangeintField = value
+ Me.RaisePropertyChanged("rangeint")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property rangelong() As Long()
+ Get
+ Return Me.rangelongField
+ End Get
+ Set
+ Me.rangelongField = value
+ Me.RaisePropertyChanged("rangelong")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property rangeuint() As UShort()
+ Get
+ Return Me.rangeuintField
+ End Get
+ Set
+ Me.rangeuintField = value
+ Me.RaisePropertyChanged("rangeuint")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property rangeulong() As ULong()
+ Get
+ Return Me.rangeulongField
+ End Get
+ Set
+ Me.rangeulongField = value
+ Me.RaisePropertyChanged("rangeulong")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property rangefloat() As Double()
+ Get
+ Return Me.rangefloatField
+ End Get
+ Set
+ Me.rangefloatField = value
+ Me.RaisePropertyChanged("rangefloat")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property rangedouble() As Double()
+ Get
+ Return Me.rangedoubleField
+ End Get
+ Set
+ Me.rangedoubleField = value
+ Me.RaisePropertyChanged("rangedouble")
+ End Set
+ End Property
+
+ Public Event PropertyChanged As System.ComponentModel.PropertyChangedEventHandler Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged
+
+ Protected Sub RaisePropertyChanged(ByVal propertyName As String)
+ Dim propertyChanged As System.ComponentModel.PropertyChangedEventHandler = Me.PropertyChangedEvent
+ If (Not (propertyChanged) Is Nothing) Then
+ propertyChanged(Me, New System.ComponentModel.PropertyChangedEventArgs(propertyName))
+ End If
+ End Sub
+ End Class
+
+ '''
+ _
+ Partial Public Class DEFIELDCHECK
+ Inherits Object
+ Implements System.ComponentModel.INotifyPropertyChanged
+
+ Private convField As Byte
+
+ Private valueField As DEFIELDCONTROL
+
+ '''
+ _
+ Public Property conv() As Byte
+ Get
+ Return Me.convField
+ End Get
+ Set
+ Me.convField = value
+ Me.RaisePropertyChanged("conv")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property value() As DEFIELDCONTROL
+ Get
+ Return Me.valueField
+ End Get
+ Set
+ Me.valueField = value
+ Me.RaisePropertyChanged("value")
+ End Set
+ End Property
+
+ Public Event PropertyChanged As System.ComponentModel.PropertyChangedEventHandler Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged
+
+ Protected Sub RaisePropertyChanged(ByVal propertyName As String)
+ Dim propertyChanged As System.ComponentModel.PropertyChangedEventHandler = Me.PropertyChangedEvent
+ If (Not (propertyChanged) Is Nothing) Then
+ propertyChanged(Me, New System.ComponentModel.PropertyChangedEventArgs(propertyName))
+ End If
+ End Sub
+ End Class
+
+ '''
+ _
+ Partial Public Class DEFIELD
+ Inherits Object
+ Implements System.ComponentModel.INotifyPropertyChanged
+
+ Private rowField As UShort
+
+ Private colField As UShort
+
+ Private typeField As Byte
+
+ Private myIdField As Byte
+
+ Private sizeField As UShort
+
+ Private disSizeField As UShort
+
+ Private checkField As DEFIELDCHECK
+
+ '''
+ _
+ Public Property row() As UShort
+ Get
+ Return Me.rowField
+ End Get
+ Set
+ Me.rowField = value
+ Me.RaisePropertyChanged("row")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property col() As UShort
+ Get
+ Return Me.colField
+ End Get
+ Set
+ Me.colField = value
+ Me.RaisePropertyChanged("col")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property type() As Byte
+ Get
+ Return Me.typeField
+ End Get
+ Set
+ Me.typeField = value
+ Me.RaisePropertyChanged("type")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property myId() As Byte
+ Get
+ Return Me.myIdField
+ End Get
+ Set
+ Me.myIdField = value
+ Me.RaisePropertyChanged("myId")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property size() As UShort
+ Get
+ Return Me.sizeField
+ End Get
+ Set
+ Me.sizeField = value
+ Me.RaisePropertyChanged("size")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property disSize() As UShort
+ Get
+ Return Me.disSizeField
+ End Get
+ Set
+ Me.disSizeField = value
+ Me.RaisePropertyChanged("disSize")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property check() As DEFIELDCHECK
+ Get
+ Return Me.checkField
+ End Get
+ Set
+ Me.checkField = value
+ Me.RaisePropertyChanged("check")
+ End Set
+ End Property
+
+ Public Event PropertyChanged As System.ComponentModel.PropertyChangedEventHandler Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged
+
+ Protected Sub RaisePropertyChanged(ByVal propertyName As String)
+ Dim propertyChanged As System.ComponentModel.PropertyChangedEventHandler = Me.PropertyChangedEvent
+ If (Not (propertyChanged) Is Nothing) Then
+ propertyChanged(Me, New System.ComponentModel.PropertyChangedEventArgs(propertyName))
+ End If
+ End Sub
+ End Class
+
+ '''
+ _
+ Partial Public Class DEKEY
+ Inherits Object
+ Implements System.ComponentModel.INotifyPropertyChanged
+
+ Private abortField() As Byte
+
+ Private confirm1Field() As Byte
+
+ Private confirm2Field() As Byte
+
+ Private confirm3Field() As Byte
+
+ Private resetField() As Byte
+
+ Private incresField() As Byte
+
+ '''
+ _
+ Public Property abort() As Byte()
+ Get
+ Return Me.abortField
+ End Get
+ Set
+ Me.abortField = value
+ Me.RaisePropertyChanged("abort")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property confirm1() As Byte()
+ Get
+ Return Me.confirm1Field
+ End Get
+ Set
+ Me.confirm1Field = value
+ Me.RaisePropertyChanged("confirm1")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property confirm2() As Byte()
+ Get
+ Return Me.confirm2Field
+ End Get
+ Set
+ Me.confirm2Field = value
+ Me.RaisePropertyChanged("confirm2")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property confirm3() As Byte()
+ Get
+ Return Me.confirm3Field
+ End Get
+ Set
+ Me.confirm3Field = value
+ Me.RaisePropertyChanged("confirm3")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property reset() As Byte()
+ Get
+ Return Me.resetField
+ End Get
+ Set
+ Me.resetField = value
+ Me.RaisePropertyChanged("reset")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property incres() As Byte()
+ Get
+ Return Me.incresField
+ End Get
+ Set
+ Me.incresField = value
+ Me.RaisePropertyChanged("incres")
+ End Set
+ End Property
+
+ Public Event PropertyChanged As System.ComponentModel.PropertyChangedEventHandler Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged
+
+ Protected Sub RaisePropertyChanged(ByVal propertyName As String)
+ Dim propertyChanged As System.ComponentModel.PropertyChangedEventHandler = Me.PropertyChangedEvent
+ If (Not (propertyChanged) Is Nothing) Then
+ propertyChanged(Me, New System.ComponentModel.PropertyChangedEventArgs(propertyName))
+ End If
+ End Sub
+ End Class
+
+ '''
+ _
+ Partial Public Class USERINPTAB
+ Inherits Object
+ Implements System.ComponentModel.INotifyPropertyChanged
+
+ Private myIdField As Short
+
+ Private iniRowField As Byte
+
+ Private iniColField As Byte
+
+ Private totRowField As Byte
+
+ Private totColField As Byte
+
+ Private myTypeField As Byte
+
+ Private helpField() As Byte
+
+ Private totFrameField As Byte
+
+ Private totFieldField As Byte
+
+ Private keyField As DEKEY
+
+ Private fldField() As DEFIELD
+
+ Private frmField() As DEFRAME
+
+ Private strDef1Field() As Byte
+
+ Private strDef2Field() As Byte
+
+ Private strDef3Field() As Byte
+
+ Private strDef4Field() As Byte
+
+ Private strDef5Field() As Byte
+
+ Private strDef6Field() As Byte
+
+ Private strDef7Field() As Byte
+
+ Private strDef8Field() As Byte
+
+ Private decolorField() As ULong
+
+ '''
+ _
+ Public Property myId() As Short
+ Get
+ Return Me.myIdField
+ End Get
+ Set
+ Me.myIdField = value
+ Me.RaisePropertyChanged("myId")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property iniRow() As Byte
+ Get
+ Return Me.iniRowField
+ End Get
+ Set
+ Me.iniRowField = value
+ Me.RaisePropertyChanged("iniRow")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property iniCol() As Byte
+ Get
+ Return Me.iniColField
+ End Get
+ Set
+ Me.iniColField = value
+ Me.RaisePropertyChanged("iniCol")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property totRow() As Byte
+ Get
+ Return Me.totRowField
+ End Get
+ Set
+ Me.totRowField = value
+ Me.RaisePropertyChanged("totRow")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property totCol() As Byte
+ Get
+ Return Me.totColField
+ End Get
+ Set
+ Me.totColField = value
+ Me.RaisePropertyChanged("totCol")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property myType() As Byte
+ Get
+ Return Me.myTypeField
+ End Get
+ Set
+ Me.myTypeField = value
+ Me.RaisePropertyChanged("myType")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property help() As Byte()
+ Get
+ Return Me.helpField
+ End Get
+ Set
+ Me.helpField = value
+ Me.RaisePropertyChanged("help")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property totFrame() As Byte
+ Get
+ Return Me.totFrameField
+ End Get
+ Set
+ Me.totFrameField = value
+ Me.RaisePropertyChanged("totFrame")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property totField() As Byte
+ Get
+ Return Me.totFieldField
+ End Get
+ Set
+ Me.totFieldField = value
+ Me.RaisePropertyChanged("totField")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property key() As DEKEY
+ Get
+ Return Me.keyField
+ End Get
+ Set
+ Me.keyField = value
+ Me.RaisePropertyChanged("key")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property fld() As DEFIELD()
+ Get
+ Return Me.fldField
+ End Get
+ Set
+ Me.fldField = value
+ Me.RaisePropertyChanged("fld")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property frm() As DEFRAME()
+ Get
+ Return Me.frmField
+ End Get
+ Set
+ Me.frmField = value
+ Me.RaisePropertyChanged("frm")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property strDef1() As Byte()
+ Get
+ Return Me.strDef1Field
+ End Get
+ Set
+ Me.strDef1Field = value
+ Me.RaisePropertyChanged("strDef1")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property strDef2() As Byte()
+ Get
+ Return Me.strDef2Field
+ End Get
+ Set
+ Me.strDef2Field = value
+ Me.RaisePropertyChanged("strDef2")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property strDef3() As Byte()
+ Get
+ Return Me.strDef3Field
+ End Get
+ Set
+ Me.strDef3Field = value
+ Me.RaisePropertyChanged("strDef3")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property strDef4() As Byte()
+ Get
+ Return Me.strDef4Field
+ End Get
+ Set
+ Me.strDef4Field = value
+ Me.RaisePropertyChanged("strDef4")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property strDef5() As Byte()
+ Get
+ Return Me.strDef5Field
+ End Get
+ Set
+ Me.strDef5Field = value
+ Me.RaisePropertyChanged("strDef5")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property strDef6() As Byte()
+ Get
+ Return Me.strDef6Field
+ End Get
+ Set
+ Me.strDef6Field = value
+ Me.RaisePropertyChanged("strDef6")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property strDef7() As Byte()
+ Get
+ Return Me.strDef7Field
+ End Get
+ Set
+ Me.strDef7Field = value
+ Me.RaisePropertyChanged("strDef7")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property strDef8() As Byte()
+ Get
+ Return Me.strDef8Field
+ End Get
+ Set
+ Me.strDef8Field = value
+ Me.RaisePropertyChanged("strDef8")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property decolor() As ULong()
+ Get
+ Return Me.decolorField
+ End Get
+ Set
+ Me.decolorField = value
+ Me.RaisePropertyChanged("decolor")
+ End Set
+ End Property
+
+ Public Event PropertyChanged As System.ComponentModel.PropertyChangedEventHandler Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged
+
+ Protected Sub RaisePropertyChanged(ByVal propertyName As String)
+ Dim propertyChanged As System.ComponentModel.PropertyChangedEventHandler = Me.PropertyChangedEvent
+ If (Not (propertyChanged) Is Nothing) Then
+ propertyChanged(Me, New System.ComponentModel.PropertyChangedEventArgs(propertyName))
+ End If
+ End Sub
+ End Class
+
+ '''
+ _
+ Partial Public Class INPUTINFO
+ Inherits Object
+ Implements System.ComponentModel.INotifyPropertyChanged
+
+ Private processField As UShort
+
+ Private isInInputField As Byte
+
+ Private dataField As USERINPTAB
+
+ '''
+ _
+ Public Property Process() As UShort
+ Get
+ Return Me.processField
+ End Get
+ Set
+ Me.processField = value
+ Me.RaisePropertyChanged("Process")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property isInInput() As Byte
+ Get
+ Return Me.isInInputField
+ End Get
+ Set
+ Me.isInInputField = value
+ Me.RaisePropertyChanged("isInInput")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property Data() As USERINPTAB
+ Get
+ Return Me.dataField
+ End Get
+ Set
+ Me.dataField = value
+ Me.RaisePropertyChanged("Data")
+ End Set
+ End Property
+
+ Public Event PropertyChanged As System.ComponentModel.PropertyChangedEventHandler Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged
+
+ Protected Sub RaisePropertyChanged(ByVal propertyName As String)
+ Dim propertyChanged As System.ComponentModel.PropertyChangedEventHandler = Me.PropertyChangedEvent
+ If (Not (propertyChanged) Is Nothing) Then
+ propertyChanged(Me, New System.ComponentModel.PropertyChangedEventArgs(propertyName))
+ End If
+ End Sub
+ End Class
+
+ '''
+ _
+ Partial Public Class REMAPDEF
+ Inherits Object
+ Implements System.ComponentModel.INotifyPropertyChanged
+
+ Private varTypeField As Byte
+
+ Private physAddrField As UShort
+
+ Private physBitField As Byte
+
+ Private logicAddrField As UShort
+
+ Private logicBitField As Byte
+
+ Private modeField As Byte
+
+ Private riseTimeField As UInteger
+
+ Private fallTimeField As UInteger
+
+ Private valueField As UInteger
+
+ Private iOMsgIdField As UInteger
+
+ Private iOClassField As Byte
+
+ Private currPhysValueField As UInteger
+
+ Private currLogicValueField As UInteger
+
+ '''
+ _
+ Public Property VarType() As Byte
+ Get
+ Return Me.varTypeField
+ End Get
+ Set
+ Me.varTypeField = value
+ Me.RaisePropertyChanged("VarType")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property PhysAddr() As UShort
+ Get
+ Return Me.physAddrField
+ End Get
+ Set
+ Me.physAddrField = value
+ Me.RaisePropertyChanged("PhysAddr")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property PhysBit() As Byte
+ Get
+ Return Me.physBitField
+ End Get
+ Set
+ Me.physBitField = value
+ Me.RaisePropertyChanged("PhysBit")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property LogicAddr() As UShort
+ Get
+ Return Me.logicAddrField
+ End Get
+ Set
+ Me.logicAddrField = value
+ Me.RaisePropertyChanged("LogicAddr")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property LogicBit() As Byte
+ Get
+ Return Me.logicBitField
+ End Get
+ Set
+ Me.logicBitField = value
+ Me.RaisePropertyChanged("LogicBit")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property Mode() As Byte
+ Get
+ Return Me.modeField
+ End Get
+ Set
+ Me.modeField = value
+ Me.RaisePropertyChanged("Mode")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property RiseTime() As UInteger
+ Get
+ Return Me.riseTimeField
+ End Get
+ Set
+ Me.riseTimeField = value
+ Me.RaisePropertyChanged("RiseTime")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property FallTime() As UInteger
+ Get
+ Return Me.fallTimeField
+ End Get
+ Set
+ Me.fallTimeField = value
+ Me.RaisePropertyChanged("FallTime")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property Value() As UInteger
+ Get
+ Return Me.valueField
+ End Get
+ Set
+ Me.valueField = value
+ Me.RaisePropertyChanged("Value")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property IOMsgId() As UInteger
+ Get
+ Return Me.iOMsgIdField
+ End Get
+ Set
+ Me.iOMsgIdField = value
+ Me.RaisePropertyChanged("IOMsgId")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property IOClass() As Byte
+ Get
+ Return Me.iOClassField
+ End Get
+ Set
+ Me.iOClassField = value
+ Me.RaisePropertyChanged("IOClass")
+ End Set
+ End Property
+
+ '''
+ _
+ Public Property CurrPhysValue() As UInteger
+ Get
+ Return Me.currPhysValueField
+ End Get
+ Set
+ Me.currPhysValueField = value
+ Me.RaisePropertyChanged("CurrPhysValue")
+ End Set
+ End Property
+
+ '''