diff --git a/.vs/CMS_CORE/v15/.suo b/.vs/CMS_CORE/v15/.suo index 966a979..723629f 100644 Binary files a/.vs/CMS_CORE/v15/.suo and b/.vs/CMS_CORE/v15/.suo differ diff --git a/CMS_CORE.sln b/CMS_CORE.sln index 7c322fe..831b59b 100644 --- a/CMS_CORE.sln +++ b/CMS_CORE.sln @@ -1,9 +1,12 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.27004.2005 +VisualStudioVersion = 15.0.26730.16 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CMS_CORE_Application", "CMS_CORE_Application\CMS_CORE_Application.csproj", "{EEB0C188-6EFA-4ABB-9E6F-4D423006428C}" + ProjectSection(ProjectDependencies) = postProject + {4ABF8EEF-2B23-483E-ACDC-53214FE28681} = {4ABF8EEF-2B23-483E-ACDC-53214FE28681} + EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CMS_CORE_Library", "CMS_CORE_Library\CMS_CORE_Library.csproj", "{4ABF8EEF-2B23-483E-ACDC-53214FE28681}" EndProject diff --git a/CMS_CORE_Application/Form1.cs b/CMS_CORE_Application/Form1.cs index 4e508bc..56049df 100644 --- a/CMS_CORE_Application/Form1.cs +++ b/CMS_CORE_Application/Form1.cs @@ -33,10 +33,14 @@ namespace CMS_CORE_Application vv.Key = ss; Boolean tt= vv.IsValid; - Nc N = new Nc_Osai("192.168.157.2", 8080, 2); + Nc N = new Nc_Osai("192.168.157.2", 8080, 5); try { - N.Connect(); + N.NC_Connect(); + + byte byteValue = 0; + N.MEM_RWByte(false, 1, Nc.MEMORY_Type.Osai_MW, 0, 0, ref byteValue); + } catch(Nc_Exception e) { @@ -55,13 +59,13 @@ namespace CMS_CORE_Application { Nc_Demo nc_Demo = new Nc_Demo("localhost", 8080); - nc_Demo.Connect(); + nc_Demo.NC_Connect(); DateTime testDateTime = new DateTime(); - nc_Demo.R_NCDateTime(ref testDateTime); + nc_Demo.NC_RDateTime(ref testDateTime); byte byteValue = 0; - nc_Demo.RW_Byte(false, 1, Nc.MEMORY_Type.NullVariable, 0, 0, ref byteValue); + nc_Demo.MEM_RWByte(false, 1, Nc.MEMORY_Type.Null, 0, 0, ref byteValue); MessageBox.Show("First byte: " + byteValue.ToString() + "\nDateTime: " + testDateTime.ToString()); } catch (Nc_Exception ex) diff --git a/CMS_CORE_Application/bin/x86/Debug/CMS_CORE_Application.exe b/CMS_CORE_Application/bin/x86/Debug/CMS_CORE_Application.exe index 4f867ae..423e623 100644 Binary files a/CMS_CORE_Application/bin/x86/Debug/CMS_CORE_Application.exe and b/CMS_CORE_Application/bin/x86/Debug/CMS_CORE_Application.exe differ diff --git a/CMS_CORE_Application/obj/x86/Debug/CMS_CORE_Application.csproj.FileListAbsolute.txt b/CMS_CORE_Application/obj/x86/Debug/CMS_CORE_Application.csproj.FileListAbsolute.txt index 057c988..a7d624f 100644 --- a/CMS_CORE_Application/obj/x86/Debug/CMS_CORE_Application.csproj.FileListAbsolute.txt +++ b/CMS_CORE_Application/obj/x86/Debug/CMS_CORE_Application.csproj.FileListAbsolute.txt @@ -29,3 +29,19 @@ C:\Workspace\CMS_CORE_LIBRARY\CMS_CORE_Application\obj\x86\Debug\CMS_CORE_Applic C:\Workspace\CMS_CORE_LIBRARY\CMS_CORE_Application\obj\x86\Debug\CMS_CORE_Application.csproj.CoreCompileInputs.cache C:\Workspace\CMS_CORE_LIBRARY\CMS_CORE_Application\obj\x86\Debug\CMS_CORE_Application.exe C:\Workspace\CMS_CORE_LIBRARY\CMS_CORE_Application\obj\x86\Debug\CMS_CORE_Application.pdb +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Application\bin\x86\Debug\CMS_CORE_Application.exe.config +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Application\bin\x86\Debug\CMS_CORE_Application.exe +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Application\bin\x86\Debug\CMS_CORE_Application.pdb +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Application\bin\x86\Debug\CMS_CORE_Library.dll +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Application\bin\x86\Debug\SKGL.dll +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Application\bin\x86\Debug\CndexLinkDotNet.dll +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Application\bin\x86\Debug\CMS_CORE_Library.pdb +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Application\bin\x86\Debug\CMS_CORE_Library.xml +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Application\bin\x86\Debug\CMS_CORE_Library.dll.config +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Application\obj\x86\Debug\CMS_CORE_Application.csprojResolveAssemblyReference.cache +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Application\obj\x86\Debug\CMS_CORE_Application.Form1.resources +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Application\obj\x86\Debug\CMS_CORE_Application.Properties.Resources.resources +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Application\obj\x86\Debug\CMS_CORE_Application.csproj.GenerateResource.Cache +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Application\obj\x86\Debug\CMS_CORE_Application.csproj.CoreCompileInputs.cache +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Application\obj\x86\Debug\CMS_CORE_Application.exe +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Application\obj\x86\Debug\CMS_CORE_Application.pdb diff --git a/CMS_CORE_Application/obj/x86/Debug/CMS_CORE_Application.csproj.GenerateResource.Cache b/CMS_CORE_Application/obj/x86/Debug/CMS_CORE_Application.csproj.GenerateResource.Cache index 91d5056..8d5ecfc 100644 Binary files a/CMS_CORE_Application/obj/x86/Debug/CMS_CORE_Application.csproj.GenerateResource.Cache and b/CMS_CORE_Application/obj/x86/Debug/CMS_CORE_Application.csproj.GenerateResource.Cache differ diff --git a/CMS_CORE_Application/obj/x86/Debug/CMS_CORE_Application.csprojResolveAssemblyReference.cache b/CMS_CORE_Application/obj/x86/Debug/CMS_CORE_Application.csprojResolveAssemblyReference.cache index 4b1537e..5c45fbc 100644 Binary files a/CMS_CORE_Application/obj/x86/Debug/CMS_CORE_Application.csprojResolveAssemblyReference.cache and b/CMS_CORE_Application/obj/x86/Debug/CMS_CORE_Application.csprojResolveAssemblyReference.cache differ diff --git a/CMS_CORE_Application/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache b/CMS_CORE_Application/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache index 47d3554..bfe5141 100644 Binary files a/CMS_CORE_Application/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache and b/CMS_CORE_Application/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/CMS_CORE_Library/Demo/Nc_Demo.cs b/CMS_CORE_Library/Demo/Nc_Demo.cs index c7ae126..7c358ba 100644 --- a/CMS_CORE_Library/Demo/Nc_Demo.cs +++ b/CMS_CORE_Library/Demo/Nc_Demo.cs @@ -12,6 +12,7 @@ using CMS_CORE.Demo.Models; using CMS_CORE.Exceptions; using CMS_CORE_Library.Demo.Models; using Nc_Demo_Application.Server.Service; +using CMS_CORE_Library; namespace CMS_CORE.Demo { @@ -31,7 +32,7 @@ namespace CMS_CORE.Demo Port = RemotePort; } - public override void Connect() + public override void NC_Connect() { // Create new connection to the demo server String url = "http://" + Ip + ":" + Port + "/api"; @@ -45,7 +46,7 @@ namespace CMS_CORE.Demo Connected = true; } - public override void Disconnect() + public override void NC_Disconnect() { cf.Close(); Connected = false; @@ -56,7 +57,7 @@ namespace CMS_CORE.Demo /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #region High level methods - public override void R_NCDateTime(ref DateTime ActualTime) + public override void NC_RDateTime(ref DateTime ActualTime) { //Check if the NC Demo is Connected CheckConnection(); @@ -75,7 +76,7 @@ namespace CMS_CORE.Demo } } - public override void R_NCSerialNumber(ref String SN) + public override void NC_RSerialNumber(ref String SN) { //Check if the NC Demo is Connected CheckConnection(); @@ -92,7 +93,7 @@ namespace CMS_CORE.Demo } //Get the NC model Name - public override void R_NCModelName(ref string ModelName) + public override void NC_RModelName(ref string ModelName) { //Check if the NC Demo is Connected CheckConnection(); @@ -107,7 +108,7 @@ namespace CMS_CORE.Demo } } - public override void R_NCSoftwareVersion(ref String SWV) + public override void NC_RSoftwareVersion(ref String SWV) { //Check if the NC Demo is Connected CheckConnection(); @@ -123,7 +124,7 @@ namespace CMS_CORE.Demo } } - public override void R_NCMachineNumber(ref string MachNumber) + public override void NC_RMachineNumber(ref string MachNumber) { //Check if the NC Demo is Connected CheckConnection(); @@ -139,7 +140,7 @@ namespace CMS_CORE.Demo } } - public override void R_NCProcessesNum(ref ushort ProcNumber) + public override void NC_RProcessesNum(ref ushort ProcNumber) { //Check if the NC Demo is Connected CheckConnection(); @@ -153,7 +154,7 @@ namespace CMS_CORE.Demo ThrowNCException(ex); } } - public override void R_NCLanguage(ref CultureInfo Language) + public override void NC_RLanguage(ref CultureInfo Language) { //Check if the NC Demo is Connected CheckConnection(); @@ -176,7 +177,7 @@ namespace CMS_CORE.Demo /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #region PLC High-level data - public override void R_PLCActiveAlarms(ref List Alarms) + public override void PLC_RActiveAlarms(ref List Alarms) { // Check if the NC Demo is Connected CheckConnection(); @@ -204,7 +205,7 @@ namespace CMS_CORE.Demo /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #region PROCESS (PATH) High-level data - public override void R_PROCStatus(ushort ProcNumber, ref PROC_Status Status) + public override void PROC_RStatus(ushort ProcNumber, ref PROC_Status Status) { // Check if the NC Demo is Connected CheckConnection(); @@ -222,7 +223,7 @@ namespace CMS_CORE.Demo } } - public override void R_PROCMode(ushort ProcNumber, ref PROC_Mode Mode) + public override void PROC_RMode(ushort ProcNumber, ref PROC_Mode Mode) { // Check if the NC Demo is Connected CheckConnection(); @@ -240,7 +241,7 @@ namespace CMS_CORE.Demo } } - public override void R_PROCActiveAlarms(ushort ProcNumber, ref List Alarms) + public override void PROC_RActiveAlarms(ushort ProcNumber, ref List Alarms) { // Check if the NC Demo is Connected CheckConnection(); @@ -264,7 +265,7 @@ namespace CMS_CORE.Demo /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #region PROCESS-AXES (PATH) High-level data - public override void R_PROCAxis_InterpPosition(ushort ProcNumber, ref Dictionary Axes) + public override void AXES_RInterpPosition(ushort ProcNumber, ref Dictionary Axes) { // Check if the NC Demo is Connected CheckConnection(); @@ -286,7 +287,7 @@ namespace CMS_CORE.Demo } } - public override void R_PROCAxis_ProgrPosition(ushort ProcNumber, ref Dictionary Axes) + public override void AXES_RProgrPosition(ushort ProcNumber, ref Dictionary Axes) { // Check if the NC Demo is Connected CheckConnection(); @@ -307,7 +308,7 @@ namespace CMS_CORE.Demo } } - public override void R_PROCAxis_MachinePosition(ushort ProcNumber, ref Dictionary Axes) + public override void AXES_RMachinePosition(ushort ProcNumber, ref Dictionary Axes) { // Check if the NC Demo is Connected CheckConnection(); @@ -329,7 +330,7 @@ namespace CMS_CORE.Demo } } - public override void R_PROCAxis_FollError(ushort ProcNumber, ref Dictionary Axes) + public override void AXES_RFollowingError(ushort ProcNumber, ref Dictionary Axes) { // Check if the NC Demo is Connected CheckConnection(); @@ -350,7 +351,7 @@ namespace CMS_CORE.Demo } } - public override void R_PROCAxis_DistToGo(ushort ProcNumber, ref Dictionary Axes) + public override void AXES_RDistanceToGo(ushort ProcNumber, ref Dictionary Axes) { // Check if the NC Demo is Connected CheckConnection(); @@ -375,7 +376,7 @@ namespace CMS_CORE.Demo /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #region NC Low-level function: single valiable in memory - public override void RW_Boolean(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, int MemBit, ref bool Value) + public override void MEM_RWBoolean(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, int MemBit, ref bool Value) { // Check if the NC Demo is Connected CheckConnection(); @@ -401,7 +402,7 @@ namespace CMS_CORE.Demo } } - public override void RW_Byte(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, int MemByte, ref byte Value) + public override void MEM_RWByte(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, int MemByte, ref byte Value) { // Check if the NC Demo is Connected CheckConnection(); @@ -427,7 +428,7 @@ namespace CMS_CORE.Demo } } - public override void RW_Word(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, ref ushort Value) + public override void MEM_RWWord(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, ref ushort Value) { // Check if the NC Demo is Connected CheckConnection(); @@ -452,7 +453,7 @@ namespace CMS_CORE.Demo } } - public override void RW_Short(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, ref short Value) + public override void MEM_RWShort(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, ref short Value) { // Check if the NC Demo is Connected CheckConnection(); @@ -477,7 +478,7 @@ namespace CMS_CORE.Demo } } - public override void RW_DWord(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, ref uint Value) + public override void MEM_RWDWord(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, ref uint Value) { // Check if the NC Demo is Connected CheckConnection(); @@ -502,7 +503,7 @@ namespace CMS_CORE.Demo } } - public override void RW_Integer(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, ref int Value) + public override void MEM_RWInteger(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, ref int Value) { // Check if the NC Demo is Connected CheckConnection(); @@ -532,7 +533,7 @@ namespace CMS_CORE.Demo /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #region NC Low-level function: variables List in memory - public override void RW_Byte_List(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, int MemByteStart, int Number, ref List Value) + public override void MEM_RWByteList(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, int MemByteStart, int Number, ref List Value) { // Check if the NC Demo is Connected CheckConnection(); @@ -557,7 +558,7 @@ namespace CMS_CORE.Demo } } - public override void RW_Word_List(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, int Number, ref List Value) + public override void MEM_RWWordList(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, int Number, ref List Value) { // Check if the NC Demo is Connected CheckConnection(); @@ -582,7 +583,7 @@ namespace CMS_CORE.Demo } } - public override void RW_Short_List(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, int Number, ref List Value) + public override void MEM_RWShortList(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, int Number, ref List Value) { // Check if the NC Demo is Connected CheckConnection(); @@ -607,7 +608,7 @@ namespace CMS_CORE.Demo } } - public override void RW_Integer_List(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, int Number, ref List Value) + public override void MEM_RWIntegerList(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, int Number, ref List Value) { // Check if the NC Demo is Connected CheckConnection(); @@ -632,7 +633,7 @@ namespace CMS_CORE.Demo } } - public override void RW_DWord_List(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, int Number, ref List Value) + public override void MEM_RWDWordList(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, int Number, ref List Value) { // Check if the NC Demo is Connected CheckConnection(); @@ -662,27 +663,27 @@ namespace CMS_CORE.Demo #region NC Low-level function: Parameters - public override void R_NCParam(short Index, short Bit, ref bool Value) + public override void NC_RParam(short Index, short Bit, ref bool Value) { throw new Nc_Exception(getError(FUNC_NOTALL_NC_ERROR)); } - public override void R_NCParam(short Index, ref byte Value) + public override void NC_RParam(short Index, ref byte Value) { throw new Nc_Exception(getError(FUNC_NOTALL_NC_ERROR)); } - public override void R_NCParam(short Index, ref short Value) + public override void NC_RParam(short Index, ref short Value) { throw new Nc_Exception(getError(FUNC_NOTALL_NC_ERROR)); } - public override void R_NCParam(short Index, ref int Value) + public override void NC_RParam(short Index, ref int Value) { throw new Nc_Exception(getError(FUNC_NOTALL_NC_ERROR)); } - public override void R_NCParam(short Index, ref double Value) + public override void NC_RParam(short Index, ref double Value) { throw new Nc_Exception(getError(FUNC_NOTALL_NC_ERROR)); } @@ -691,22 +692,22 @@ namespace CMS_CORE.Demo /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #region File Management - public override void R_NCReadPartProgramToFile(string partProgramPath, string partProgramLocalName, ref FileStream localFile) + public override void FILES_RProgramToFile(string partProgramPath, string partProgramLocalName, ref FileStream localFile) { throw new NotImplementedException(); } - public override void W_NCWritePartProgramFromFile(string partProgramPath, FileStream localFile) + public override void FILES_WProgramFromFile(string partProgramPath, FileStream localFile) { throw new NotImplementedException(); } - public override void NCCopyPartProgram(string partProgramPath, string newPartProgramPath, bool failIfExist) + public override void FILES_CopyProgram(string partProgramPath, string newPartProgramPath, bool failIfExist) { throw new NotImplementedException(); } - public override void NCDeletePartProgram(string partProgramPath, string partProgramName) + public override void FILES_DeleteProgram(string partProgramPath, string partProgramName) { throw new NotImplementedException(); } @@ -719,7 +720,7 @@ namespace CMS_CORE.Demo //Check if NC is connected private void CheckConnection() { - if (!isConnected()) + if (!NC_IsConnected()) throw new Nc_Exception(getError(NOT_CONNECTED_ERROR)); } @@ -761,6 +762,7 @@ namespace CMS_CORE.Demo case FUNC_NOTALL_NC_ERROR: return ErrororOwner + "Function not allowed for this type of NC"; case BIT_NOT_IN_RANGE_ERROR: return ErrororOwner + "Bit-number must be between 0 and 7"; case INTERNAL_ERROR: return ErrororOwner + "Internal function error"; + case INCORRECT_PARAMETERS_ERROR: return ErrororOwner + "Incorrect Parameters error"; } } return ErrororOwner + "Generic Error On Function"; @@ -772,6 +774,7 @@ namespace CMS_CORE.Demo if (bitnum < 0 || bitnum > 7) throw new Nc_Exception(getError(BIT_NOT_IN_RANGE_ERROR)); } + #endregion diff --git a/CMS_CORE_Library/Fanuc/Nc_Fanuc.cs b/CMS_CORE_Library/Fanuc/Nc_Fanuc.cs index fcf2a96..e2c29ac 100644 --- a/CMS_CORE_Library/Fanuc/Nc_Fanuc.cs +++ b/CMS_CORE_Library/Fanuc/Nc_Fanuc.cs @@ -9,6 +9,7 @@ using System.Threading; using System.Threading.Tasks; using System.IO; using CMS_CORE.Utils; +using CMS_CORE_Library; #pragma warning disable 1591 @@ -56,7 +57,7 @@ namespace CMS_CORE.Fanuc //Connect Method - public override void Connect() + public override void NC_Connect() { short nReturn; short ActivePath; @@ -100,7 +101,7 @@ namespace CMS_CORE.Fanuc //Disconnect Method - public override void Disconnect() + public override void NC_Disconnect() { short nReturn; @@ -125,7 +126,7 @@ namespace CMS_CORE.Fanuc #region High level methods //Get the NC Language - public override void R_NCLanguage(ref CultureInfo Language) + public override void NC_RLanguage(ref CultureInfo Language) { //Check if the NC is Connected CheckConnection(); @@ -137,7 +138,7 @@ namespace CMS_CORE.Fanuc //Get the NC Serial Number - public override void R_NCSerialNumber(ref string SN) + public override void NC_RSerialNumber(ref string SN) { //Check if the NC is Connected CheckConnection(); @@ -149,7 +150,7 @@ namespace CMS_CORE.Fanuc //Get the NC Software Version - public override void R_NCSoftwareVersion(ref string SWV) + public override void NC_RSoftwareVersion(ref string SWV) { //Check if the NC is Connected CheckConnection(); @@ -161,7 +162,7 @@ namespace CMS_CORE.Fanuc //Get the NC model Name - public override void R_NCModelName(ref string ModelName) + public override void NC_RModelName(ref string ModelName) { //Check if the NC is Connected CheckConnection(); @@ -173,7 +174,7 @@ namespace CMS_CORE.Fanuc //Get the processes-count configurated - public override void R_NCProcessesNum(ref ushort ProcNumber) + public override void NC_RProcessesNum(ref ushort ProcNumber) { //Check if the NC is Connected CheckConnection(); @@ -185,7 +186,7 @@ namespace CMS_CORE.Fanuc //Get the NC Time - public override void R_NCDateTime(ref DateTime ActualTime) + public override void NC_RDateTime(ref DateTime ActualTime) { Focas1.IODBTIMER TimerDate = new Focas1.IODBTIMER(); Focas1.IODBTIMER TimerTime = new Focas1.IODBTIMER(); @@ -220,21 +221,21 @@ namespace CMS_CORE.Fanuc //Get the Machine Number - public override void R_NCMachineNumber(ref string MachNumber) + public override void NC_RMachineNumber(ref string MachNumber) { ushort Value = 0; //Check if the NC is Connected CheckConnection(); - RW_Word(R, UNDEF_PROC, MATR_MACCH_FANUC.MemType, MATR_MACCH_FANUC.Address, ref Value); + MEM_RWWord(R, UNDEF_PROC, MATR_MACCH_FANUC.MemType, MATR_MACCH_FANUC.Address, ref Value); MachNumber = Value.ToString(); } //Get the process status - public override void R_PROCStatus(ushort Number, ref PROC_Status Status) + public override void PROC_RStatus(ushort Number, ref PROC_Status Status) { Focas1.ODBST StatInfo = new Focas1.ODBST(); short nReturn; @@ -255,7 +256,7 @@ namespace CMS_CORE.Fanuc //Get the process Mode - public override void R_PROCMode(ushort Number, ref PROC_Mode Mode) + public override void PROC_RMode(ushort Number, ref PROC_Mode Mode) { Focas1.ODBST StatInfo = new Focas1.ODBST(); short nReturn=0; @@ -276,7 +277,7 @@ namespace CMS_CORE.Fanuc //Get the process message - public override void R_PROCActiveAlarms(ushort ProcNumber, ref List Alarms) + public override void PROC_RActiveAlarms(ushort ProcNumber, ref List Alarms) { Focas1.ODBALMMSG2 Messg = new Focas1.ODBALMMSG2(); short nReturn = 0; @@ -320,7 +321,7 @@ namespace CMS_CORE.Fanuc //Get the PMC Messages - public override void R_PLCActiveAlarms(ref List Alarms) + public override void PLC_RActiveAlarms(ref List Alarms) { Focas1.OPMSG3 Messg = new Focas1.OPMSG3(); short nReturn = 0; @@ -353,7 +354,7 @@ namespace CMS_CORE.Fanuc //Get the Inrpolated position - public override void R_PROCAxis_InterpPosition(ushort ProcNumber, ref Dictionary Axes) + public override void AXES_RInterpPosition(ushort ProcNumber, ref Dictionary Axes) { Focas1.ODBPOS axisFan = new Focas1.ODBPOS(); short nReturn; @@ -420,7 +421,7 @@ namespace CMS_CORE.Fanuc //Get the Machine position - public override void R_PROCAxis_MachinePosition(ushort ProcNumber, ref Dictionary Axes) + public override void AXES_RMachinePosition(ushort ProcNumber, ref Dictionary Axes) { Focas1.ODBPOS axisFan = new Focas1.ODBPOS(); short nReturn; @@ -487,7 +488,7 @@ namespace CMS_CORE.Fanuc //Get the Distance To Go - public override void R_PROCAxis_DistToGo(ushort ProcNumber, ref Dictionary Axes) + public override void AXES_RDistanceToGo(ushort ProcNumber, ref Dictionary Axes) { Focas1.ODBPOS axisFan = new Focas1.ODBPOS(); short nReturn; @@ -554,7 +555,7 @@ namespace CMS_CORE.Fanuc //Get the Programmed Position - public override void R_PROCAxis_ProgrPosition(ushort ProcNumber, ref Dictionary Axes) + public override void AXES_RProgrPosition(ushort ProcNumber, ref Dictionary Axes) { //In fanuc is not implemented, so i need to build it Dictionary ActualMach = new Dictionary(); @@ -562,8 +563,8 @@ namespace CMS_CORE.Fanuc KeyValuePair val; //Read the positions - R_PROCAxis_MachinePosition(ProcNumber, ref ActualMach); - R_PROCAxis_DistToGo(ProcNumber, ref ToGo); + AXES_RMachinePosition(ProcNumber, ref ActualMach); + AXES_RDistanceToGo(ProcNumber, ref ToGo); //If it has the same size if(ActualMach.Count == ToGo.Count) @@ -588,7 +589,7 @@ namespace CMS_CORE.Fanuc } - public override void R_PROCAxis_FollError(ushort ProcNumber, ref Dictionary Axes) + public override void AXES_RFollowingError(ushort ProcNumber, ref Dictionary Axes) { ThrowNCException(FUNC_NOTALL_NC_ERROR, 0); } @@ -605,7 +606,7 @@ namespace CMS_CORE.Fanuc // PARAMS //Get NC Bit Parameter - public override void R_NCParam(short Index, short Bit, ref Boolean Value) + public override void NC_RParam(short Index, short Bit, ref Boolean Value) { Focas1.IODBPSD_1 outpar = new Focas1.IODBPSD_1(); short nReturn; @@ -632,7 +633,7 @@ namespace CMS_CORE.Fanuc //Get NC Byte Parameter - public override void R_NCParam(short Index, ref byte Value) + public override void NC_RParam(short Index, ref byte Value) { Focas1.IODBPSD_1 outpar = new Focas1.IODBPSD_1(); short nReturn; @@ -655,7 +656,7 @@ namespace CMS_CORE.Fanuc //Get NC Word Parameter - public override void R_NCParam(short Index, ref short Value) + public override void NC_RParam(short Index, ref short Value) { Focas1.IODBPSD_1 outpar = new Focas1.IODBPSD_1(); short nReturn; @@ -678,7 +679,7 @@ namespace CMS_CORE.Fanuc //Get NC DWord Parameter - public override void R_NCParam(short Index, ref int Value) + public override void NC_RParam(short Index, ref int Value) { Focas1.IODBPSD_1 outpar = new Focas1.IODBPSD_1(); short nReturn; @@ -701,7 +702,7 @@ namespace CMS_CORE.Fanuc //Get NC Real Parameter - public override void R_NCParam(short Index, ref double Value) + public override void NC_RParam(short Index, ref double Value) { Focas1.IODBPSD_2 outpar = new Focas1.IODBPSD_2(); short nReturn; @@ -730,7 +731,7 @@ namespace CMS_CORE.Fanuc // BOOL (NC) <-> BOOL (.NET) ToDo //Read-Write a Boolean-Value inside the NC. - public override void RW_Boolean(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, int MemBit, ref bool Value) + public override void MEM_RWBoolean(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, int MemBit, ref bool Value) { byte ReadValue = 0; byte pow = (byte)Math.Pow(2, MemBit); @@ -738,11 +739,14 @@ namespace CMS_CORE.Fanuc //Check if the NC is Connected CheckConnection(); + //Check if the Memory area is corrected + CheckMemoryArea(MemType.ToString()); + //Check if the Bit Number is Correct CheckBitRange(MemBit); //Read the Byte where is the bit - RW_Byte(R, Process, MemType, MemIndex, 0, ref ReadValue); + MEM_RWByte(R, Process, MemType, MemIndex, 0, ref ReadValue); //If i have to read -> Read the Bit if (bWrite == R) @@ -757,7 +761,7 @@ namespace CMS_CORE.Fanuc else ReadValue = (byte)(ReadValue & ~(1 << MemBit)); - RW_Byte(W, Process, MemType, MemIndex,0, ref ReadValue); + MEM_RWByte(W, Process, MemType, MemIndex,0, ref ReadValue); } } @@ -766,15 +770,18 @@ namespace CMS_CORE.Fanuc // BYTE (NC) <-> BYTE (.NET) //Read-Write a Byte-Value inside the NC. In writing-mode the field "Number" is not required - public override void RW_Byte(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, int MemByte, ref byte Value) + public override void MEM_RWByte(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, int MemByte, ref byte Value) { List Values = new List() { Value }; //Check if the NC is Connected CheckConnection(); + //Check if the Memory area is corrected + CheckMemoryArea(MemType.ToString()); + //uses the List method with one-element list - RW_Byte_List(bWrite, Process, MemType, MemIndex, 0, 1, ref Values); + MEM_RWByteList(bWrite, Process, MemType, MemIndex, 0, 1, ref Values); Value = Values.First(); @@ -783,7 +790,7 @@ namespace CMS_CORE.Fanuc //Read-Write a Byte-Value-List inside the NC. In writing-mode the field "Number" is not required - public override void RW_Byte_List(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, int MemByteStart, int Number, ref List Value) + public override void MEM_RWByteList(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, int MemByteStart, int Number, ref List Value) { //The maximum number of variables readed/writed at the same time is 5 //I have to iterate it @@ -802,6 +809,9 @@ namespace CMS_CORE.Fanuc //Check if the NC is Connected CheckConnection(); + //Check if the Memory area is corrected + CheckMemoryArea(MemType.ToString()); + //Setup the 'Value' variable if (bWrite) Number = Value.Count(); @@ -866,22 +876,25 @@ namespace CMS_CORE.Fanuc // DWORD (NC) <-> INT (.NET) //Write a Int-Value inside the NC. In writing-mode the field "Number" is not required - public override void RW_Integer(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, ref int Value) + public override void MEM_RWInteger(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, ref int Value) { List ListValue = new List() { Value }; //Check if the NC is Connected CheckConnection(); + //Check if the Memory area is corrected + CheckMemoryArea(MemType.ToString()); + //uses the List method with one-element list - RW_Integer_List(bWrite, Process, MemType, MemIndex, 1, ref ListValue); + MEM_RWIntegerList(bWrite, Process, MemType, MemIndex, 1, ref ListValue); Value = ListValue.First(); } //Write a Int-Value-List inside the NC. In writing-mode the field "Number" is not required - public override void RW_Integer_List(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, int Number, ref List Value) + public override void MEM_RWIntegerList(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, int Number, ref List Value) { //The maximum number of variables readed/writed at the same time is 5 //I have to iterate it @@ -900,6 +913,9 @@ namespace CMS_CORE.Fanuc //Check if the NC is Connected CheckConnection(); + //Check if the Memory area is corrected + CheckMemoryArea(MemType.ToString()); + //Setup the 'Value' variable if (bWrite) Number = Value.Count(); @@ -964,15 +980,18 @@ namespace CMS_CORE.Fanuc // DWORD (NC) <-> UINT (.NET) //Write a DWord-Value inside the NC. In writing-mode the field "Number" is not required - public override void RW_DWord(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, ref uint Value) + public override void MEM_RWDWord(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, ref uint Value) { List ListValue = new List() { Value }; //Check if the NC is Connected CheckConnection(); + //Check if the Memory area is corrected + CheckMemoryArea(MemType.ToString()); + //uses the List method with one-element list - RW_DWord_List(bWrite, Process, MemType, MemIndex, 1, ref ListValue); + MEM_RWDWordList(bWrite, Process, MemType, MemIndex, 1, ref ListValue); Value = ListValue.First(); } @@ -980,19 +999,22 @@ namespace CMS_CORE.Fanuc //Write a DWord-Value-List inside the NC. In writing-mode the field "Number" is not required - public override void RW_DWord_List(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, int Number, ref List Values) + public override void MEM_RWDWordList(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, int Number, ref List Values) { List WordValues = new List(); //Check if the NC is Connected CheckConnection(); + //Check if the Memory area is corrected + CheckMemoryArea(MemType.ToString()); + //If i have to write convert the INT list into (2x) WORD if (bWrite) WordValues = Values.Select(i => (int)i).ToList(); //Exetute the function - RW_Integer_List(bWrite, Process, MemType, MemIndex, Number, ref WordValues); + MEM_RWIntegerList(bWrite, Process, MemType, MemIndex, Number, ref WordValues); //If i have to read, convert the WORD list into INT if (!bWrite) @@ -1006,15 +1028,18 @@ namespace CMS_CORE.Fanuc // WORD (NC) <-> SHORT (.NET) //Write a Short-Value inside the NC. In writing-mode the field "Number" is not required - public override void RW_Short(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, ref short Value) + public override void MEM_RWShort(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, ref short Value) { List ListValue = new List() { Value }; //Check if the NC is Connected CheckConnection(); + //Check if the Memory area is corrected + CheckMemoryArea(MemType.ToString()); + //uses the List method with one-element list - RW_Short_List(bWrite, Process, MemType, MemIndex, 1, ref ListValue); + MEM_RWShortList(bWrite, Process, MemType, MemIndex, 1, ref ListValue); Value = ListValue.First(); } @@ -1022,7 +1047,7 @@ namespace CMS_CORE.Fanuc //Write a Short-Value-List inside the NC. In writing-mode the field "Number" is not required - public override void RW_Short_List(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, int Number, ref List Value) + public override void MEM_RWShortList(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, int Number, ref List Value) { //The maximum number of variables readed/writed at the same time is 5 //I have to iterate it @@ -1041,6 +1066,9 @@ namespace CMS_CORE.Fanuc //Check if the NC is Connected CheckConnection(); + //Check if the Memory area is corrected + CheckMemoryArea(MemType.ToString()); + //Setup the 'Value' variable if (bWrite) Number = Value.Count(); @@ -1105,15 +1133,18 @@ namespace CMS_CORE.Fanuc // WORD (NC) <-> SHORT (.NET) //Write a Word-Value inside the NC. In writing-mode the field "Number" is not required - public override void RW_Word(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, ref ushort Value) + public override void MEM_RWWord(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, ref ushort Value) { List ListValue = new List() { Value }; //Check if the NC is Connected CheckConnection(); + //Check if the Memory area is corrected + CheckMemoryArea(MemType.ToString()); + //uses the List method with one-element list - RW_Word_List(bWrite, Process, MemType, MemIndex, 1, ref ListValue); + MEM_RWWordList(bWrite, Process, MemType, MemIndex, 1, ref ListValue); Value = ListValue.First(); } @@ -1121,19 +1152,22 @@ namespace CMS_CORE.Fanuc //Write a Word-Value-List inside the NC. In writing-mode the field "Number" is not required - public override void RW_Word_List(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, int Number, ref List Values) + public override void MEM_RWWordList(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, int Number, ref List Values) { List WordValues = new List(); //Check if the NC is Connected CheckConnection(); + //Check if the Memory area is corrected + CheckMemoryArea(MemType.ToString()); + //If i have to write convert the INT list into (2x) WORD if (bWrite) WordValues = Values.Select(i => (short)i).ToList(); //Exetute the function - RW_Short_List(bWrite, Process, MemType, MemIndex, Number, ref WordValues); + MEM_RWShortList(bWrite, Process, MemType, MemIndex, Number, ref WordValues); //If i have to read, convert the WORD list into INT if (!bWrite) @@ -1147,7 +1181,7 @@ namespace CMS_CORE.Fanuc /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #region File Management - public override void R_NCReadPartProgramToFile(string partProgramPath, string partProgramLocalName, ref FileStream localFile) + public override void FILES_RProgramToFile(string partProgramPath, string partProgramLocalName, ref FileStream localFile) { string partProgramContent = ""; @@ -1218,7 +1252,7 @@ namespace CMS_CORE.Fanuc partProgramContent = partProgramContent.Replace("\0", String.Empty); } - public override void W_NCWritePartProgramFromFile(string partProgramPath, FileStream localFile) + public override void FILES_WProgramFromFile(string partProgramPath, FileStream localFile) { string partProgramContent = ""; @@ -1263,7 +1297,7 @@ namespace CMS_CORE.Fanuc ErrorHandler(NC_PROD_ERROR, nReturn); } - public override void NCCopyPartProgram(string partProgramPath, string newPartProgramPath, bool failIfExist) + public override void FILES_CopyProgram(string partProgramPath, string newPartProgramPath, bool failIfExist) { //Check if the NC is Connected CheckConnection(); @@ -1298,7 +1332,7 @@ namespace CMS_CORE.Fanuc if (errorDetails.err_no == 4) { - NCDeletePartProgram(newPartProgramPath, ""); + FILES_DeleteProgram(newPartProgramPath, ""); nReturn = Focas1.cnc_pdf_copy(nLibHandle[0], partProgramPath, newPartProgramPath); @@ -1313,7 +1347,7 @@ namespace CMS_CORE.Fanuc } } - public override void NCDeletePartProgram(string partProgramPath, string partProgramName) + public override void FILES_DeleteProgram(string partProgramPath, string partProgramName) { //Check if the NC is Connected CheckConnection(); @@ -1464,7 +1498,7 @@ namespace CMS_CORE.Fanuc { //Read Language from NC PARAM - R_NCParam( (short) PARAM_LING_FANUC.Address, ref FanucLanguage); + NC_RParam( (short) PARAM_LING_FANUC.Address, ref FanucLanguage); //Execute the method nReturn = Focas1.cnc_sysinfo(nLibHandle[0], node); @@ -1499,7 +1533,7 @@ namespace CMS_CORE.Fanuc private void ThrowNCException(uint Owner, short exNum) { if (exNum == (short)Focas1.focas_ret.EW_SOCKET) - Disconnect(); + NC_Disconnect(); throw new Nc_Exception(getError(Owner,exNum)); } @@ -1509,9 +1543,18 @@ namespace CMS_CORE.Fanuc //Check if NC is connected private void CheckConnection() { - if (!isConnected()) + if (!NC_IsConnected()) throw new Nc_Exception(getError(NOT_CONNECTED_ERROR, 0)); } + + + + //Check if Memory Area is corrected + private void CheckMemoryArea(String AreaName) + { + if (!AreaName.StartsWith(FANUC_MEMTYPE) && !AreaName.StartsWith(UNDEFINED_MEMTYPE)) + throw new Nc_Exception(getError(INCORRECT_PARAMETERS_ERROR, 0)); + } @@ -1555,11 +1598,12 @@ namespace CMS_CORE.Fanuc ErrororOwner = "CMS-Core-Error: "; switch (CMSError) { - case NOT_CONNECTED_ERROR: return ErrororOwner + "Nc not Connected"; - case PROC_NOT_FOUND_ERROR: return ErrororOwner + "Process Id not found"; - case FUNC_NOTALL_NC_ERROR: return ErrororOwner + "Function not allowed for this type of NC"; - case BIT_NOT_IN_RANGE_ERROR: return ErrororOwner + "Bit-number must be between 0 and 7"; - case INTERNAL_ERROR: return ErrororOwner + "Internal function error"; + case NOT_CONNECTED_ERROR: return ErrororOwner + "Nc not Connected"; + case PROC_NOT_FOUND_ERROR: return ErrororOwner + "Process Id not found"; + case FUNC_NOTALL_NC_ERROR: return ErrororOwner + "Function not allowed for this type of NC"; + case BIT_NOT_IN_RANGE_ERROR: return ErrororOwner + "Bit-number must be between 0 and 7"; + case INTERNAL_ERROR: return ErrororOwner + "Internal function error"; + case INCORRECT_PARAMETERS_ERROR: return ErrororOwner + "Incorrect Parameters error"; } } else @@ -1603,6 +1647,7 @@ namespace CMS_CORE.Fanuc } return ErrororOwner + "Generic Error On Function"; } + #endregion diff --git a/CMS_CORE_Library/Nc.cs b/CMS_CORE_Library/Nc.cs index 314a9c2..4d0648a 100644 --- a/CMS_CORE_Library/Nc.cs +++ b/CMS_CORE_Library/Nc.cs @@ -1,4 +1,5 @@ -using System; +using CMS_CORE_Library; +using System; using System.Collections.Generic; using System.Globalization; using System.IO; @@ -8,74 +9,141 @@ using System.Threading.Tasks; namespace CMS_CORE { - public abstract partial class Nc + public abstract partial class Nc { //Private Global Variables - protected Boolean Connected; - protected String Ip; - protected ushort Port; - + internal Boolean Connected; + internal String Ip; + internal ushort Port; + internal Boolean UseProxy; + //Osai Variable + internal string OSAI_PlcMessagesPath = @"C:\CMS\OSAI\"; + internal string OSAI_WinNbiPath = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + @"\OSAI\WinNBI\"; /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - #region Global Methods - - /** - * - * Read Nc Status - * - * Compatibility: Fanuc | Osai - * - * - * Thrown when an internal or a library error occours - * */ - public Boolean isConnected() { return Connected; } + #region LIB Methods /** * * Get the NC IP-Address * - * Compatibility: Fanuc | Osai - * Thrown when an internal or a library error occours - * - * */ - public String getIpAddress() { return Ip; } - - /** - * - * Read Nc Port - * - * Compatibility: Fanuc | Osai + * Compatibility: Fanuc | Osai | Demo * * Thrown when an internal or a library error occours * * */ - public ushort getPort() { return Port; } + public String LIB_GetIpAddress() { return Ip; } - //General Methods /** * - * Connect the NC + * Set the NC IP-Address * - * Compatibility: Fanuc | Osai + * Compatibility: Fanuc | Osai | Demo * * Thrown when an internal or a library error occours * * */ - public abstract void Connect(); + public void LIB_SetIpAddress(String ip) { Ip = ip; } + /** * - * Disconnect the NC + * Get Nc Port * - * Compatibility: Fanuc | Osai + * Compatibility: Fanuc | Osai | Demo * * Thrown when an internal or a library error occours * * */ - public abstract void Disconnect(); + public ushort LIB_GetPort() { return Port; } + + + /** + * + * Set Nc Port + * + * Compatibility: Fanuc | Osai | Demo + * + * Thrown when an internal or a library error occours + * + * */ + public void LIB_SetPort(ushort port) { Port = port; } + + #endregion + #region LIB Methods (OSAI) + + /** + * + * Get if the library uses Windows proxy + * + * Compatibility: Osai + * + * Thrown when an internal or a library error occours + * + * */ + public Boolean LIB_GetWindowsProxy() { return UseProxy; } + + + /** + * + * Set if the library need to use Windows proxy + * + * Compatibility: Osai + * + * Thrown when an internal or a library error occours + * + * */ + public void LIB_SetWindowsProxy(Boolean proxy) { UseProxy = proxy; } + + + /** + * + * Get the path of PLC Messages Folder + * + * Compatibility: Osai + * + * Thrown when an internal or a library error occours + * + * */ + public string LIB_GetPlcMsgsPath() { return OSAI_PlcMessagesPath; } + + + /** + * + * Set the path of PLC Messages Folder + * + * Compatibility: Osai + * + * Thrown when an internal or a library error occours + * + * */ + public void LIB_SetPlcMsgsPath(string folder) { OSAI_PlcMessagesPath = folder; } + + + /** + * + * Get the path of Win-Nbi installation + * + * Compatibility: Osai + * + * Thrown when an internal or a library error occours + * + * */ + public string LIB_GetWinNbiPath() { return OSAI_WinNbiPath; } + + + /** + * + * Set the path of Win-Nbi installation + * + * Compatibility: Osai + * + * Thrown when an internal or a library error occours + * + * */ + public void LIB_SetWinNbiPath(string folder) { OSAI_WinNbiPath = folder; } #endregion @@ -83,427 +151,131 @@ namespace CMS_CORE /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #region NC High-level data (to override) + /** + * + * Connect the NC + * + * Compatibility: Fanuc | Osai | Demo + * + * Thrown when an internal or a library error occours + * + * */ + public abstract void NC_Connect(); + + + /** + * + * Disconnect the NC + * + * Compatibility: Fanuc | Osai | Demo + * + * Thrown when an internal or a library error occours + * + * */ + public abstract void NC_Disconnect(); + + + /** + * + * Read Nc Status + * + * Compatibility: Fanuc | Osai | Demo + * + * + * Thrown when an internal or a library error occours + * */ + public Boolean NC_IsConnected() { return Connected; } + /** * * Read actual time of the NC-Software (sometimes it can be different from NC-Operative-System) * - * Compatibility: Fanuc | Osai + * Compatibility: Fanuc | Osai | Demo * * * Thrown when an internal or a library error occours * Reference of a DateTime Variable where data will be saved * */ - public abstract void R_NCDateTime(ref DateTime ActualTime); + public abstract void NC_RDateTime(ref DateTime ActualTime); + /** * - * Read CMS Serial number of the NC + * Read Vendor NC Serial number * - * Compatibility: Fanuc | Osai + * Compatibility: Fanuc | Osai | Demo * * * Thrown when an internal or a library error occours * Reference of a String Variable where data will be saved * */ - public abstract void R_NCSerialNumber(ref String SN); + public abstract void NC_RSerialNumber(ref String SN); /** * * Read Model name of the NC * - * Compatibility: Fanuc | Osai + * Compatibility: Fanuc | Osai | Demo * * * Thrown when an internal or a library error occours * Reference of a String Variable where data will be saved * */ - public abstract void R_NCModelName(ref String ModelName); + public abstract void NC_RModelName(ref String ModelName); /** * * Read Software Version of the Nc * - * Compatibility: Fanuc | Osai + * Compatibility: Fanuc | Osai | Demo * * * Thrown when an internal or a library error occours * Reference of a String Variable where data will be saved * */ - public abstract void R_NCSoftwareVersion(ref String SWV); + public abstract void NC_RSoftwareVersion(ref String SWV); /** * * Read CMS Serial number of the Machine * - * Compatibility: Fanuc | Osai + * Compatibility: Fanuc | Osai | Demo * * * Thrown when an internal or a library error occours * Reference of a String Variable where data will be saved * */ - public abstract void R_NCMachineNumber(ref String MachNumber); + public abstract void NC_RMachineNumber(ref String MachNumber); /** * * Read number of configured Processes/Paths * - * Compatibility: Fanuc | Osai + * Compatibility: Fanuc | Osai | Demo * * * Thrown when an internal or a library error occours * Reference of a ushort Variable where data will be saved * */ - public abstract void R_NCProcessesNum(ref ushort ProcNumber); + public abstract void NC_RProcessesNum(ref ushort ProcNumber); /** * * Read the configured language of the NC * - * Compatibility: Fanuc | Osai + * Compatibility: Fanuc | Osai | Demo * * * Thrown when an internal or a library error occours * Reference of a CultureInfo Variable where data will be saved * */ - public abstract void R_NCLanguage(ref CultureInfo Language); - + public abstract void NC_RLanguage(ref CultureInfo Language); #endregion /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - #region PLC High-level data (to override) - - /** - * - * Read PMC active Alarms - * - * Compatibility: Fanuc | Osai - * - * - * Thrown when an internal or a library error occours - * Reference of a List of String Variables where data will be saved - * */ - public abstract void R_PLCActiveAlarms(ref List Alarms); - - //Read PROCESS High-level data (to override) - - - #endregion - - /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - #region PROCESS (PATH) High-level data (to override) - - /** - * - * Read the actual status of the Process "ProcNumber" - * See for information about the PROC_Status type - * - * Compatibility: Fanuc | Osai - * - * - * Thrown when an internal or a library error occours - * Process to execute the action - * Reference of a PROC_Status Variable where data will be saved - * */ - public abstract void R_PROCStatus(ushort ProcNumber, ref PROC_Status Status); - - /** - * - * Read the selected Mode Process "ProcNumber" - * See for information about the PROC_Status type - * - * Compatibility: Fanuc | Osai - * - * - * Thrown when an internal or a library error occours - * Process to execute the action - * Reference of a PROC_Mode Variable where data will be saved - * */ - public abstract void R_PROCMode(ushort ProcNumber, ref PROC_Mode Mode); - - - /** - * - * Read active alarms of the process "ProcNumber". For OSAI Nc the list can contain only one Message - * - * Compatibility: Fanuc | Osai - * - * - * Thrown when an internal or a library error occours - * Process to execute the action - * Reference of a List of String Variables where data will be saved - * */ - public abstract void R_PROCActiveAlarms(ushort ProcNumber, ref List Alarms); - - - #endregion - - /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - #region PROCESS-AXES (PATH) High-level data (to override) - - /** - * - * Read the Interpolated position of all axes in Process "ProcNumber" - * - * Compatibility: Fanuc | Osai - * - * - * Thrown when an internal or a library error occours - * Process to execute the action - * Reference of Dictionary "Key,Value" with: Key: Axis Name, Value: Position - * */ - public abstract void R_PROCAxis_InterpPosition(ushort ProcNumber, ref Dictionary Axes); - - /** - * - * Read the Programmed position of all axes in Process "ProcNumber". - * For Fanuc-Nc there's not "Programmed position" variables. Si it is calculated from Machine-Pos and Distance-to-go - * - * Compatibility: Fanuc | Osai - * - * - * Thrown when an internal or a library error occours - * Process to execute the action - * Reference of Dictionary "Key,Value" with: Key: Axis Name, Value: Position - * */ - public abstract void R_PROCAxis_ProgrPosition(ushort ProcNumber, ref Dictionary Axes); - - /** - * - * Read the Machine position of all axes in Process "ProcNumber" - * - * Compatibility: Fanuc | Osai - * - * - * Thrown when an internal or a library error occours - * Process to execute the action - * Reference of Dictionary "Key,Value" with: Key: Axis Name, Value: Position - * */ - public abstract void R_PROCAxis_MachinePosition(ushort ProcNumber, ref Dictionary Axes); - - /** - * - * Read the Following-Error of all axes in Process "ProcNumber" - * - * Compatibility: Osai - * - * - * Thrown when an internal or a library error occours - * Process to execute the action - * Reference of Dictionary "Key,Value" with: Key: Axis Name, Value: Position - * */ - public abstract void R_PROCAxis_FollError(ushort ProcNumber, ref Dictionary Axes); - - /** - * - * Read the Distance-to-go of all axes in Process "ProcNumber" - * - * Compatibility: Fanuc | Osai - * - * - * Thrown when an internal or a library error occours - * Process to execute the action - * Reference of Dictionary "Key,Value" with: Key: Axis Name, Value: Position - * */ - public abstract void R_PROCAxis_DistToGo(ushort ProcNumber, ref Dictionary Axes); - - - #endregion - - /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - #region NC Low-level function: single valiable in memory (to override) - - /** - * Read/Write Boolean variable from/into NC Memory Area - * - * Compatibility: Fanuc | Osai - * - * - * Thrown when an internal or a library error occours - * Set True to Write-operation (Also Allowed /) - * Process to perform operation (If the area is process-indipendent use 0 or ) - * Nc Memory Area. See - * Starting Index of Memory Area - * Set the Bit to Read-Write. (0..7) - * Reference to variable to read/Write - * */ - public abstract void RW_Boolean(Boolean bWrite, int Process, MEMORY_Type MemType, int MemIndex, int MemBit, ref Boolean Value); - - /** - * Read/Write Byte variable from/into NC Memory Area - * - * Compatibility: Fanuc | Osai - * - * - * Thrown when an internal or a library error occours - * Set True to Write-operation (Also Allowed /) - * Process to perform operation (If the area is process-indipendent use 0 or ) - * Nc Memory Area. See - * Starting Index of Memory Area - * Set to 1 if the Byte is the second of a WORD (only for OSAI Nc) - * Reference to variable to read/Write - * */ - public abstract void RW_Byte(Boolean bWrite, int Process, MEMORY_Type MemType, int MemIndex, int MemByte, ref Byte Value); - - /** - * Read/Write unsigned 2 Byte (NC: Word:, .NET: ushort) variable from/into NC Memory Area - * - * Compatibility: Fanuc | Osai - * - * - * Thrown when an internal or a library error occours - * Set True to Write-operation (Also Allowed /) - * Process to perform operation (If the area is process-indipendent use 0 or ) - * Nc Memory Area. See - * Starting Index of Memory Area - * Number of sequential data Read/Write. (Used only in Reading Operation) - * List of values to read/Write - * */ - public abstract void RW_Word(Boolean bWrite, int Process, MEMORY_Type MemType, int MemIndex, ref ushort Value); - - /** - * Read/Write signed 2 Byte (NC: Word:, .NET: short) variable from/into NC Memory Area - * - * Compatibility: Fanuc | Osai - * - * - * Thrown when an internal or a library error occours - * Set True to Write-operation (Also Allowed /) - * Process to perform operation (If the area is process-indipendent use 0 or ) - * Nc Memory Area. See - * Starting Index of Memory Area - * Number of sequential data Read/Write. (Used only in Reading Operation) - * List of values to read/Write - * */ - public abstract void RW_Short(Boolean bWrite, int Process, MEMORY_Type MemType, int MemIndex, ref short Value); - - /** - * Read/Write signed 4 Byte (NC: DWord:, .NET: uint) variable from/into NC Memory Area - * - * Compatibility: Fanuc | Osai - * uW - * - * Thrown when an internal or a library error occours - * Set True to Write-operation (Also Allowed /) - * Process to perform operation (If the area is process-indipendent use 0 or ) - * Nc Memory Area. See - * Starting Index of Memory Area - * Number of sequential data Read/Write. (Used only in Reading Operation) - * List of values to read/Write - * */ - public abstract void RW_DWord(Boolean bWrite, int Process, MEMORY_Type MemType, int MemIndex, ref uint Value); - - /** - * Read/Write signed 4 Byte (NC: DWord:, .NET: int) variable from/into NC Memory Area - * - * Compatibility: Fanuc | Osai - * - * - * Thrown when an internal or a library error occours - * Set True to Write-operation (Also Allowed /) - * Process to perform operation (If the area is process-indipendent use 0 or ) - * Nc Memory Area. See - * Starting Index of Memory Area - * Number of sequential data Read/Write. (Used only in Reading Operation) - * List of values to read/Write - * */ - public abstract void RW_Integer(Boolean bWrite, int Process, MEMORY_Type MemType, int MemIndex, ref int Value); - - - - #endregion - - /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - # region NC Low-level function: variables List in memory (to override) - - /** - * Read/Write List of Byte from/into NC Memory Area - * - * Compatibility: Fanuc | Osai - * - * - * Thrown when an internal or a library error occours - * Set True to Write-operation (Also Allowed /) - * Process to perform operation (If the area is process-indipendent use 0 or ) - * Nc Memory Area. See - * Starting Index of Memory Area - * Set to 1 if the starting Byte is the second of a WORD (only for OSAI Nc) - * Number of sequential data Read/Write. (Used only in Reading Operation) - * List of values to read/Write - * */ - public abstract void RW_Byte_List(Boolean bWrite, int Process, MEMORY_Type MemType, int MemIndex, int MemByteStart, int Number, ref List Value); - - /** - * Read/Write List of unsigned 2 Byte (NC: Word:, .NET: ushort) from/into NC Memory Area - * - * Compatibility: Fanuc | Osai - * - * - * Thrown when an internal or a library error occours - * Set True to Write-operation (Also Allowed /) - * Process to perform operation (If the area is process-indipendent use 0 or ) - * Nc Memory Area. See - * Starting Index of Memory Area - * Number of sequential data Read/Write. (Used only in Reading Operation) - * List of values to read/Write - * */ - public abstract void RW_Word_List(Boolean bWrite, int Process, MEMORY_Type MemType, int MemIndex, int Number, ref List Value); - - /** - * Read/Write List of signed 2 Byte (NC: Word:, .NET: short) from/into NC Memory Area - * - * Compatibility: Fanuc | Osai - * - * - * Thrown when an internal or a library error occours - * Set True to Write-operation (Also Allowed /) - * Process to perform operation (If the area is process-indipendent use 0 or ) - * Nc Memory Area. See - * Starting Index of Memory Area - * Number of sequential data Read/Write. (Used only in Reading Operation) - * List of values to read/Write - * */ - public abstract void RW_Short_List(Boolean bWrite, int Process, MEMORY_Type MemType, int MemIndex, int Number, ref List Value); - - /** - * Read/Write List of unsigned 4 Byte (NC: DWord:, .NET: uint) from/into NC Memory Area - * - * Compatibility: Fanuc | Osai - * - * - * Thrown when an internal or a library error occours - * Set True to Write-operation (Also Allowed /) - * Process to perform operation (If the area is process-indipendent use 0 or ) - * Nc Memory Area. See - * Starting Index of Memory Area - * Number of sequential data Read/Write. (Used only in Reading Operation) - * List of values to read/Write - * */ - public abstract void RW_DWord_List(Boolean bWrite, int Process, MEMORY_Type MemType, int MemIndex, int Number, ref List Value); - - /** - * Read/Write List of signed 4 Byte (NC: DWord:, .NET: int) from/into NC Memory Area - * - * Compatibility: Fanuc | Osai - * - * - * Thrown when an internal or a library error occours - * Set True to Write-operation (Also Allowed /) - * Process to perform operation (If the area is process-indipendent use 0 or Nc.) - * Nc Memory Area. See - * Starting Index of Memory Area - * Number of sequential data Read/Write. (Used only in Reading Operation) - * List of values to read/Write - * */ - public abstract void RW_Integer_List(Boolean bWrite, int Process, MEMORY_Type MemType, int MemIndex, int Number, ref List Value); - - - - #endregion - - /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - #region NC Low-level function: Parameters (to override) + #region NC Low-level data (to override) /** * Read Boolean Parameter Machine (Not compatible for Axis Parameter (Multiple values in a parameter) @@ -516,7 +288,7 @@ namespace CMS_CORE * Set the Bit to Read. (0..7) * Reference of a variable with Param values * */ - public abstract void R_NCParam(short Index, short Bit, ref Boolean Value); + public abstract void NC_RParam(short Index, short Bit, ref Boolean Value); /** * Read Byte Parameter Machine (Not compatible for Axis Parameter (Multiple values in a parameter) @@ -528,7 +300,7 @@ namespace CMS_CORE * Index of the parameter * Reference of a variable with Param values * */ - public abstract void R_NCParam(short Index, ref byte Value); + public abstract void NC_RParam(short Index, ref byte Value); /** * Read 2 Byte (Short) Parameter Machine (Not compatible for Axis Parameter (Multiple values in a parameter) @@ -540,7 +312,7 @@ namespace CMS_CORE * Index of the parameter * Reference of a variable with Param values * */ - public abstract void R_NCParam(short Index, ref short Value); + public abstract void NC_RParam(short Index, ref short Value); /** * Read 4 Byte (Integer) Parameter Machine (Not compatible for Axis Parameter (Multiple values in a parameter) @@ -552,7 +324,7 @@ namespace CMS_CORE * Index of the parameter * Reference of a variable with Param values * */ - public abstract void R_NCParam(short Index, ref int Value); + public abstract void NC_RParam(short Index, ref int Value); /** * Read Real Parameter Machine (Not compatible for Axis Parameter (Multiple values in a parameter) @@ -564,7 +336,331 @@ namespace CMS_CORE * Index of the parameter * Reference of a variable with Param values * */ - public abstract void R_NCParam(short Index, ref double Value); + public abstract void NC_RParam(short Index, ref double Value); + + #endregion + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + #region PLC High-level data (to override) + + /** + * + * Read PMC active Alarms + * + * Compatibility: Fanuc | Osai | Demo + * + * + * Thrown when an internal or a library error occours + * Reference of a List of String Variables where data will be saved + * */ + public abstract void PLC_RActiveAlarms(ref List Alarms); + + #endregion + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + #region PROCESS (PATH) data (to override) + + /** + * + * Read the actual status of the Process "ProcNumber" + * See for information about the PROC_Status type + * + * Compatibility: Fanuc | Osai | Demo + * + * + * Thrown when an internal or a library error occours + * Process to execute the action + * Reference of a PROC_Status Variable where data will be saved + * */ + public abstract void PROC_RStatus(ushort ProcNumber, ref PROC_Status Status); + + /** + * + * Read the selected Mode Process "ProcNumber" + * See for information about the PROC_Status type + * + * Compatibility: Fanuc | Osai | Demo + * + * + * Thrown when an internal or a library error occours + * Process to execute the action + * Reference of a PROC_Mode Variable where data will be saved + * */ + public abstract void PROC_RMode(ushort ProcNumber, ref PROC_Mode Mode); + + + /** + * + * Read active alarms of the process "ProcNumber". For OSAI Nc the list can contain only one Message + * + * Compatibility: Fanuc | Osai | Demo + * + * + * Thrown when an internal or a library error occours + * Process to execute the action + * Reference of a List of String Variables where data will be saved + * */ + public abstract void PROC_RActiveAlarms(ushort ProcNumber, ref List Alarms); + + + #endregion + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + #region AXES data (to override) + + /** + * + * Read the Interpolated position of all axes in Process "ProcNumber" + * + * Compatibility: Fanuc | Osai | Demo + * + * + * Thrown when an internal or a library error occours + * Process to execute the action + * Reference of Dictionary "Key,Value" with: Key: Axis Name, Value: Position + * */ + public abstract void AXES_RInterpPosition(ushort ProcNumber, ref Dictionary Axes); + + /** + * + * Read the Programmed position of all axes in Process "ProcNumber". + * For Fanuc-Nc there's not "Programmed position" variables. Si it is calculated from Machine-Pos and Distance-to-go + * + * Compatibility: Fanuc | Osai | Demo + * + * + * Thrown when an internal or a library error occours + * Process to execute the action + * Reference of Dictionary "Key,Value" with: Key: Axis Name, Value: Position + * */ + public abstract void AXES_RProgrPosition(ushort ProcNumber, ref Dictionary Axes); + + /** + * + * Read the Machine position of all axes in Process "ProcNumber" + * + * Compatibility: Fanuc | Osai | Demo + * + * + * Thrown when an internal or a library error occours + * Process to execute the action + * Reference of Dictionary "Key,Value" with: Key: Axis Name, Value: Position + * */ + public abstract void AXES_RMachinePosition(ushort ProcNumber, ref Dictionary Axes); + + /** + * + * Read the Following-Error of all axes in Process "ProcNumber" + * + * Compatibility: Osai | Demo + * + * + * Thrown when an internal or a library error occours + * Process to execute the action + * Reference of Dictionary "Key,Value" with: Key: Axis Name, Value: Position + * */ + public abstract void AXES_RFollowingError(ushort ProcNumber, ref Dictionary Axes); + + /** + * + * Read the Distance-to-go of all axes in Process "ProcNumber" + * + * Compatibility: Fanuc | Osai | Demo + * + * + * Thrown when an internal or a library error occours + * Process to execute the action + * Reference of Dictionary "Key,Value" with: Key: Axis Name, Value: Position + * */ + public abstract void AXES_RDistanceToGo(ushort ProcNumber, ref Dictionary Axes); + + + #endregion + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + #region MEMORY Low-level function: single valiable in memory (to override) + + /** + * Read/Write Boolean variable from/into NC Memory Area + * + * Compatibility: Fanuc | Osai | Demo + * + * + * Thrown when an internal or a library error occours + * Set True to Write-operation (Also Allowed /) + * Process to perform operation (If the area is process-indipendent use 0 or ) + * Nc Memory Area. See + * Starting Index of Memory Area + * Set the Bit to Read-Write. (0..7) + * Reference to variable to read/Write + * */ + public abstract void MEM_RWBoolean(Boolean bWrite, int Process, MEMORY_Type MemType, int MemIndex, int MemBit, ref Boolean Value); + + /** + * Read/Write Byte variable from/into NC Memory Area + * + * Compatibility: Fanuc | Osai | Demo + * + * + * Thrown when an internal or a library error occours + * Set True to Write-operation (Also Allowed /) + * Process to perform operation (If the area is process-indipendent use 0 or ) + * Nc Memory Area. See + * Starting Index of Memory Area + * Set to 1 if the Byte is the second of a WORD (only for OSAI Nc) + * Reference to variable to read/Write + * */ + public abstract void MEM_RWByte(Boolean bWrite, int Process, MEMORY_Type MemType, int MemIndex, int MemByte, ref Byte Value); + + /** + * Read/Write unsigned 2 Byte (NC: Word:, .NET: ushort) variable from/into NC Memory Area + * + * Compatibility: Fanuc | Osai | Demo + * + * + * Thrown when an internal or a library error occours + * Set True to Write-operation (Also Allowed /) + * Process to perform operation (If the area is process-indipendent use 0 or ) + * Nc Memory Area. See + * Starting Index of Memory Area + * Number of sequential data Read/Write. (Used only in Reading Operation) + * List of values to read/Write + * */ + public abstract void MEM_RWWord(Boolean bWrite, int Process, MEMORY_Type MemType, int MemIndex, ref ushort Value); + + /** + * Read/Write signed 2 Byte (NC: Word:, .NET: short) variable from/into NC Memory Area + * + * Compatibility: Fanuc | Osai | Demo + * + * + * Thrown when an internal or a library error occours + * Set True to Write-operation (Also Allowed /) + * Process to perform operation (If the area is process-indipendent use 0 or ) + * Nc Memory Area. See + * Starting Index of Memory Area + * Number of sequential data Read/Write. (Used only in Reading Operation) + * List of values to read/Write + * */ + public abstract void MEM_RWShort(Boolean bWrite, int Process, MEMORY_Type MemType, int MemIndex, ref short Value); + + /** + * Read/Write signed 4 Byte (NC: DWord:, .NET: uint) variable from/into NC Memory Area + * + * Compatibility: Fanuc | Osai | Demo + * uW + * + * Thrown when an internal or a library error occours + * Set True to Write-operation (Also Allowed /) + * Process to perform operation (If the area is process-indipendent use 0 or ) + * Nc Memory Area. See + * Starting Index of Memory Area + * Number of sequential data Read/Write. (Used only in Reading Operation) + * List of values to read/Write + * */ + public abstract void MEM_RWDWord(Boolean bWrite, int Process, MEMORY_Type MemType, int MemIndex, ref uint Value); + + /** + * Read/Write signed 4 Byte (NC: DWord:, .NET: int) variable from/into NC Memory Area + * + * Compatibility: Fanuc | Osai | Demo + * + * + * Thrown when an internal or a library error occours + * Set True to Write-operation (Also Allowed /) + * Process to perform operation (If the area is process-indipendent use 0 or ) + * Nc Memory Area. See + * Starting Index of Memory Area + * Number of sequential data Read/Write. (Used only in Reading Operation) + * List of values to read/Write + * */ + public abstract void MEM_RWInteger(Boolean bWrite, int Process, MEMORY_Type MemType, int MemIndex, ref int Value); + + #endregion + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + #region NC Low-level function: variables List in memory (to override) + + /** + * Read/Write List of Byte from/into NC Memory Area + * + * Compatibility: Fanuc | Osai | Demo + * + * + * Thrown when an internal or a library error occours + * Set True to Write-operation (Also Allowed /) + * Process to perform operation (If the area is process-indipendent use 0 or ) + * Nc Memory Area. See + * Starting Index of Memory Area + * Set to 1 if the starting Byte is the second of a WORD (only for OSAI Nc) + * Number of sequential data Read/Write. (Used only in Reading Operation) + * List of values to read/Write + * */ + public abstract void MEM_RWByteList(Boolean bWrite, int Process, MEMORY_Type MemType, int MemIndex, int MemByteStart, int Number, ref List Value); + + /** + * Read/Write List of unsigned 2 Byte (NC: Word:, .NET: ushort) from/into NC Memory Area + * + * Compatibility: Fanuc | Osai | Demo + * + * + * Thrown when an internal or a library error occours + * Set True to Write-operation (Also Allowed /) + * Process to perform operation (If the area is process-indipendent use 0 or ) + * Nc Memory Area. See + * Starting Index of Memory Area + * Number of sequential data Read/Write. (Used only in Reading Operation) + * List of values to read/Write + * */ + public abstract void MEM_RWWordList(Boolean bWrite, int Process, MEMORY_Type MemType, int MemIndex, int Number, ref List Value); + + /** + * Read/Write List of signed 2 Byte (NC: Word:, .NET: short) from/into NC Memory Area + * + * Compatibility: Fanuc | Osai | Demo + * + * + * Thrown when an internal or a library error occours + * Set True to Write-operation (Also Allowed /) + * Process to perform operation (If the area is process-indipendent use 0 or ) + * Nc Memory Area. See + * Starting Index of Memory Area + * Number of sequential data Read/Write. (Used only in Reading Operation) + * List of values to read/Write + * */ + public abstract void MEM_RWShortList(Boolean bWrite, int Process, MEMORY_Type MemType, int MemIndex, int Number, ref List Value); + + /** + * Read/Write List of unsigned 4 Byte (NC: DWord:, .NET: uint) from/into NC Memory Area + * + * Compatibility: Fanuc | Osai | Demo + * + * + * Thrown when an internal or a library error occours + * Set True to Write-operation (Also Allowed /) + * Process to perform operation (If the area is process-indipendent use 0 or ) + * Nc Memory Area. See + * Starting Index of Memory Area + * Number of sequential data Read/Write. (Used only in Reading Operation) + * List of values to read/Write + * */ + public abstract void MEM_RWDWordList(Boolean bWrite, int Process, MEMORY_Type MemType, int MemIndex, int Number, ref List Value); + + /** + * Read/Write List of signed 4 Byte (NC: DWord:, .NET: int) from/into NC Memory Area + * + * Compatibility: Fanuc | Osai | Demo + * + * + * Thrown when an internal or a library error occours + * Set True to Write-operation (Also Allowed /) + * Process to perform operation (If the area is process-indipendent use 0 or Nc.) + * Nc Memory Area. See + * Starting Index of Memory Area + * Number of sequential data Read/Write. (Used only in Reading Operation) + * List of values to read/Write + * */ + public abstract void MEM_RWIntegerList(Boolean bWrite, int Process, MEMORY_Type MemType, int MemIndex, int Number, ref List Value); #endregion @@ -572,93 +668,224 @@ namespace CMS_CORE #region File Management (To override) /** - * Read a Part Program by path and name + * Read a Part Program by path and name + * + * Compatibility: Fanuc | Osai | Demo + * * * Thrown when an internal or a library error occours * Path of the Part Program stored in the Nc * Name of the Part Program and name of new local file * Reference to the new local file where the NC Part Program data will be saved * */ - public abstract void R_NCReadPartProgramToFile(string partProgramPath, string partProgramLocalName, ref FileStream localFile); + public abstract void FILES_RProgramToFile(string partProgramPath, string partProgramLocalName, ref FileStream localFile); /** - * Write/Overwrite a Part Program by path and name + * Write/Overwrite a Part Program by path and name + * + * Compatibility: Fanuc | Osai | Demo + * * * Thrown when an internal or a library error occours * Path of the Part Program stored in the Nc * Reference to the local Part Program file * */ - public abstract void W_NCWritePartProgramFromFile(string partProgramPath, FileStream localFile); + public abstract void FILES_WProgramFromFile(string partProgramPath, FileStream localFile); /** - * Copy a Part Program into another path + * Copy a Part Program into another path + * + * Compatibility: Fanuc | Osai | Demo + * * * Thrown when an internal or a library error occours * Path where the Part Program is saved in the NC * Path of the copy Part Program destination * * */ - public abstract void NCCopyPartProgram(string partProgramPath, string newPartProgramPath, bool failIfExist); + public abstract void FILES_CopyProgram(string partProgramPath, string newPartProgramPath, bool failIfExist); /** - * Delete a Nc Part Program + * Delete a Nc Part Program + * + * Compatibility: Fanuc | Osai | Demo + * + * * Thrown when an internal or a library error occours * Path where the Nc Part Program is saved in the NC * Name of the Part Program file * */ - public abstract void NCDeletePartProgram(string partProgramPath, string partProgramName); + public abstract void FILES_DeleteProgram(string partProgramPath, string partProgramName); + #endregion /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #region CONSTANTS (Struct and Enum are Static for definition) // Read Write type + /** Write action */ public const Boolean W = true; + /** Read action */ public const Boolean R = false; + /** Not-Defined Process */ public const ushort UNDEF_PROC = 0; + - // min-time to read static data (Cached values) - protected const ushort NC_MIN_SEC_READ_STATIC_DATA = 10; - - // CMS Process Status - public enum PROC_Status : ushort { IDLE = 1, RUN = 2, HOLD = 3, ERROR = 4, RESET = 5, EMERG = 6 }; + /** Process-Status */ + public enum PROC_Status : ushort + { + /** Idle-Status */ + IDLE = 1, + /** Run-Status */ + RUN = 2, + /** Hold-Status */ + HOLD = 3, + /** Error-Status */ + ERROR = 4, + /** Reset-Status */ + RESET = 5, + /** Emergency-Status */ + EMERG = 6 + }; - // CMS Process mode - public enum PROC_Mode : ushort { AUTO = 1, EDIT = 2, MDI = 3, REMOTE = 4, TEACH = 5, REF = 6, JOG = 7, JOGINC = 8, RETPROF = 9, HANDLE = 10, RESTART = 11, ERROR = 12 }; + + /** CMS-Process-Mode */ + public enum PROC_Mode : ushort + { + /** Automatic-Mode */ + AUTO = 1, + /** Edit-Mode */ + EDIT = 2, + /** Mdi-Mode */ + MDI = 3, + /** Remote-Mode */ + REMOTE = 4, + /** Teach-Mode */ + TEACH = 5, + /** Ref-Mode */ + REF = 6, + /** Jog-Mode */ + JOG = 7, + /** Joginc-Mode */ + JOGINC = 8, + /** Ret_on_Profile-Mode */ + RETPROF = 9, + /** Handle-Mode */ + HANDLE = 10, + /** Restart-Mode */ + RESTART = 11, + /** Error-Mode */ + ERROR = 12 + }; // R-W MEMORY Type + + /** Nc Memory Type (Table) */ public enum MEMORY_Type { - NullVariable = -1, + /** Null Type */ + Null = -1, + + /////////////////////////////////////////////////////////////////// //Fanuc Memory Type - Fanuc_G = 0, Fanuc_F = 1, Fanuc_Y = 2, Fanuc_X = 3, Fanuc_A = 4, Fanuc_R = 5, Fanuc_T = 6, Fanuc_K = 7, Fanuc_C = 8, Fanuc_D = 9, Fanuc_M = 10, Fanuc_N = 11, Fanuc_E = 12, Fanuc_Z = 13, Fanuc_CM = 100, + /** Fanuc G Area */ + Fanuc_G = 0, + /** Fanuc F Area */ + Fanuc_F = 1, + /** Fanuc Y Area */ + Fanuc_Y = 2, + /** Fanuc X Area */ + Fanuc_X = 3, + /** Fanuc A Area */ + Fanuc_A = 4, + /** Fanuc R Area */ + Fanuc_R = 5, + /** Fanuc T Area */ + Fanuc_T = 6, + /** Fanuc K Area */ + Fanuc_K = 7, + /** Fanuc C Area */ + Fanuc_C = 8, + /** Fanuc D Area */ + Fanuc_D = 9, + /** Fanuc M Area */ + Fanuc_M = 10, + /** Fanuc N Area */ + Fanuc_N = 11, + /** Fanuc E Area */ + Fanuc_E = 12, + /** Fanuc Z Area */ + Fanuc_Z = 13, + /** Fanuc CM Area */ + Fanuc_CM = 100, + + /////////////////////////////////////////////////////////////////// //Osai Memory Type - Osai_I = 0, Osai_O = 1, Osai_MW = 20, Osai_GW = 21, Osai_SW = 22, Osai_PW = 62, Osai_UW = 63, Osai_MD = 40, Osai_GD = 41, Osai_SD = 42, Osai_PD = 43, Osai_UD = 44, Osai_L = 145, Osai_LS = 18, Osai_AA = 28, Osai_A = 45, Osai_SC = 50, Osai_SYMO = 102 + /** Osai I Area */ + Osai_I = 0, + /** Osai O Area */ + Osai_O = 1, + /** Osai MW Area */ + Osai_MW = 20, + /** Osai GW Area */ + Osai_GW = 21, + /** Osai SW Area */ + Osai_SW = 22, + /** Osai PW Area */ + Osai_PW = 62, + /** Osai UW Area */ + Osai_UW = 63, + /** Osai MD Area */ + Osai_MD = 40, + /** Osai GD Area */ + Osai_GD = 41, + /** Osai SD Area */ + Osai_SD = 42, + /** Osai PD Area */ + Osai_PD = 43, + /** Osai UD Area */ + Osai_UD = 44, + /** Osai L Area */ + Osai_L = 145, + /** Osai LS Area */ + Osai_LS = 18, + /** Osai AA Area */ + Osai_AA = 28, + /** Osai A Area */ + Osai_A = 45, + /** Osai SC Area */ + Osai_SC = 50, + /** Osai SYMO Area */ + Osai_SYMO = 102 }; - + + // NC Memory Type Name + internal const String FANUC_MEMTYPE = "Fanuc_"; + internal const String SIEMENS_MEMTYPE = "Siemens_"; + internal const String OSAI_MEMTYPE = "Osai_"; + internal const String DEMO_MEMTYPE = "Demo_"; + internal const String UNDEFINED_MEMTYPE = "Null"; + + // min-time to read static data (Cached values) + internal const ushort NC_MIN_SEC_READ_STATIC_DATA = 10; //Fanuc Variable & Const - protected const short FANUC_MAXNVAR = 5; - protected const short FANUC_MAXMSGCNC = 10; - protected const short FANUC_MAXMSGPMC = 5; - protected const short FANUC_ABSOLUTEPOS = 0; - protected const short FANUC_MACHINEPOS = 1; - protected const short FANUC_RELATIVEPOS = 2; - protected const short FANUC_DISTTOGO = 3; - protected const short FANUC_ALLPOS = -1; - protected enum FANUC_DType : short { BYTE = 0, WORD = 1, LONG = 2 }; - - //Osai Variable & Const - public string NC_OSAI_PLC_MESSAGES = @"C:\CMS\OSAI\"; - public string NC_OSAI_WINBI_PATH = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + @"\OSAI\WinNBI\"; - - protected const ushort OSAI_PROGRAMMEDPOS = 1; - protected const ushort OSAI_INTERPOLPOS = 2; - protected const ushort OSAI_TRANSDUCERPOS = 3; - protected const ushort OSAI_FOLLERROR = 4; - protected const ushort OSAI_DISTTOGO = 5; - protected const ushort OSAI_MACHINEPOS = 6; + internal const short FANUC_MAXNVAR = 5; + internal const short FANUC_MAXMSGCNC = 10; + internal const short FANUC_MAXMSGPMC = 5; + internal const short FANUC_ABSOLUTEPOS = 0; + internal const short FANUC_MACHINEPOS = 1; + internal const short FANUC_RELATIVEPOS = 2; + internal const short FANUC_DISTTOGO = 3; + internal const short FANUC_ALLPOS = -1; + internal enum FANUC_DType : short { BYTE = 0, WORD = 1, LONG = 2 }; + internal const ushort OSAI_PROGRAMMEDPOS = 1; + internal const ushort OSAI_INTERPOLPOS = 2; + internal const ushort OSAI_TRANSDUCERPOS = 3; + internal const ushort OSAI_FOLLERROR = 4; + internal const ushort OSAI_DISTTOGO = 5; + internal const ushort OSAI_MACHINEPOS = 6; #endregion @@ -666,7 +893,7 @@ namespace CMS_CORE #region Fixed memory area // R-W MEMORY Cell - protected struct MEMORY_Cell + internal struct MEMORY_Cell { public readonly MEMORY_Type MemType; public readonly int Address; @@ -680,11 +907,11 @@ namespace CMS_CORE } //Lingua CN - protected MEMORY_Cell PARAM_LING_FANUC = new MEMORY_Cell(MEMORY_Type.NullVariable, 3281); + internal MEMORY_Cell PARAM_LING_FANUC = new MEMORY_Cell(MEMORY_Type.Null, 3281); //Matricola Macchina - protected MEMORY_Cell MATR_MACCH_OSAI = new MEMORY_Cell(MEMORY_Type.Osai_MW , 3403 ); - protected MEMORY_Cell MATR_MACCH_FANUC = new MEMORY_Cell(MEMORY_Type.Fanuc_D , 4018 ); + internal MEMORY_Cell MATR_MACCH_OSAI = new MEMORY_Cell(MEMORY_Type.Osai_MW , 3403 ); + internal MEMORY_Cell MATR_MACCH_FANUC = new MEMORY_Cell(MEMORY_Type.Fanuc_D , 4018 ); #endregion @@ -692,13 +919,14 @@ namespace CMS_CORE /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #region Error Codes - protected const uint NC_PROD_ERROR = 0; - protected const uint NOT_CONNECTED_ERROR = 1; - protected const uint PROC_NOT_FOUND_ERROR = 2; - protected const uint FUNC_NOTALL_NC_ERROR = 3; - protected const uint BIT_NOT_IN_RANGE_ERROR = 4; - protected const uint BYTE_NOT_IN_RANGE_ERROR = 5; - protected const uint INTERNAL_ERROR = 6; + internal const uint NC_PROD_ERROR = 0; + internal const uint NOT_CONNECTED_ERROR = 1; + internal const uint PROC_NOT_FOUND_ERROR = 2; + internal const uint FUNC_NOTALL_NC_ERROR = 3; + internal const uint BIT_NOT_IN_RANGE_ERROR = 4; + internal const uint BYTE_NOT_IN_RANGE_ERROR = 5; + internal const uint INTERNAL_ERROR = 6; + internal const uint INCORRECT_PARAMETERS_ERROR = 7; #endregion diff --git a/CMS_CORE_Library/Osai/Nc_Osai.cs b/CMS_CORE_Library/Osai/Nc_Osai.cs index 469c728..2fdc634 100644 --- a/CMS_CORE_Library/Osai/Nc_Osai.cs +++ b/CMS_CORE_Library/Osai/Nc_Osai.cs @@ -32,7 +32,6 @@ namespace CMS_CORE.Osai private DateTime Last_Static_Read; private String OsaiLanguages; private ushort timeOutConn; - private Boolean UseProxy; private EndpointAddress endPointAddress; private BasicHttpBinding HttpBinding; @@ -70,7 +69,7 @@ namespace CMS_CORE.Osai //Connect Method - public override void Connect() + public override void NC_Connect() { uint errorClass, errorNum; @@ -112,7 +111,7 @@ namespace CMS_CORE.Osai //Disconnect Method - public override void Disconnect() + public override void NC_Disconnect() { //Set Connected to FALSE and close the session OpenNC.Close(); @@ -127,7 +126,7 @@ namespace CMS_CORE.Osai #region High-level Methods //Get the NC Language - public override void R_NCLanguage(ref CultureInfo Language) + public override void NC_RLanguage(ref CultureInfo Language) { //Check if the NC is Connected CheckConnection(); @@ -138,7 +137,7 @@ namespace CMS_CORE.Osai //Get the NC Serial Number - public override void R_NCSerialNumber(ref string SN) + public override void NC_RSerialNumber(ref string SN) { //Check if the NC is Connected CheckConnection(); @@ -151,7 +150,7 @@ namespace CMS_CORE.Osai //Get the NC Software Version - public override void R_NCSoftwareVersion(ref string SWV) + public override void NC_RSoftwareVersion(ref string SWV) { //Check if the NC is Connected CheckConnection(); @@ -164,7 +163,7 @@ namespace CMS_CORE.Osai //Get the NC model Name - public override void R_NCModelName(ref string ModelName) + public override void NC_RModelName(ref string ModelName) { //Check if the NC is Connected CheckConnection(); @@ -176,7 +175,7 @@ namespace CMS_CORE.Osai //Get the NC Time - public override void R_NCDateTime(ref DateTime ActualTime) + public override void NC_RDateTime(ref DateTime ActualTime) { uint errorClass, errorNum; ushort nReturn; @@ -210,7 +209,7 @@ namespace CMS_CORE.Osai //Get the Machine Number - public override void R_NCMachineNumber(ref string MachNumber) + public override void NC_RMachineNumber(ref string MachNumber) { ushort mac = 0; @@ -218,7 +217,7 @@ namespace CMS_CORE.Osai CheckConnection(); //Exetute the function - RW_Word(R, UNDEF_PROC, MATR_MACCH_OSAI.MemType, MATR_MACCH_OSAI.Address, ref mac); + MEM_RWWord(R, UNDEF_PROC, MATR_MACCH_OSAI.MemType, MATR_MACCH_OSAI.Address, ref mac); MachNumber = mac.ToString(); } @@ -226,7 +225,7 @@ namespace CMS_CORE.Osai //Get the PLC Active Alarms - public override void R_PLCActiveAlarms(ref List Alarms) + public override void PLC_RActiveAlarms(ref List Alarms) { List lista = new List(); BitArray Bits; @@ -237,7 +236,7 @@ namespace CMS_CORE.Osai CheckConnection(); //Execute the method - RW_Word_List(R, 0, MEMORY_Type.Osai_MW, 12000, 47, ref lista); + MEM_RWWordList(R, 0, MEMORY_Type.Osai_MW, 12000, 47, ref lista); //Elaborates the Messages for (int i=0; i Alarms) + public override void PROC_RActiveAlarms(ushort Number, ref List Alarms) { String ActMSG = ""; uint errorClass, errorNum; @@ -419,7 +418,7 @@ namespace CMS_CORE.Osai //Get a dictionary with the Actual position of the axes in Process - public override void R_PROCAxis_InterpPosition(ushort Process, ref Dictionary Axes) + public override void AXES_RInterpPosition(ushort Process, ref Dictionary Axes) { uint errorClass, errorNum; ushort nReturn; @@ -471,7 +470,7 @@ namespace CMS_CORE.Osai //Get a dictionary with the Programmed position of the axes in Process - public override void R_PROCAxis_ProgrPosition(ushort Process, ref Dictionary Axes) + public override void AXES_RProgrPosition(ushort Process, ref Dictionary Axes) { uint errorClass, errorNum; ushort nReturn; @@ -522,7 +521,7 @@ namespace CMS_CORE.Osai //Get a dictionary with the Machine position of the axes in Process - public override void R_PROCAxis_MachinePosition(ushort Process, ref Dictionary Axes) + public override void AXES_RMachinePosition(ushort Process, ref Dictionary Axes) { uint errorClass, errorNum; ushort nReturn; @@ -573,7 +572,7 @@ namespace CMS_CORE.Osai //Get a dictionary with the Following Error of the axes in Process - public override void R_PROCAxis_FollError(ushort Process, ref Dictionary Axes) + public override void AXES_RFollowingError(ushort Process, ref Dictionary Axes) { uint errorClass, errorNum; ushort nReturn; @@ -624,7 +623,7 @@ namespace CMS_CORE.Osai //Get a dictionary with the Distance To Go of the axes in Process - public override void R_PROCAxis_DistToGo(ushort Process, ref Dictionary Axes) + public override void AXES_RDistanceToGo(ushort Process, ref Dictionary Axes) { uint errorClass, errorNum; ushort nReturn; @@ -683,7 +682,7 @@ namespace CMS_CORE.Osai // BOOLEAN (NC) <-> BOOLEAN (.NET) ToDo //Read-Write a Boolean-Value inside the NC. - public override void RW_Boolean(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, int MemBit, ref bool Value) + public override void MEM_RWBoolean(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, int MemBit, ref bool Value) { ushort WordValue = 0; byte pow = (byte)Math.Pow(2, MemBit); @@ -691,11 +690,14 @@ namespace CMS_CORE.Osai //Check if the NC is Connected CheckConnection(); + //Check if the Memory area is corrected + CheckMemoryArea(MemType.ToString()); + //Check if the Bit Number is Correct CheckBitRange(MemBit); //Read the Byte where is the bit - RW_Word(R, Process, MemType, MemIndex, ref WordValue); + MEM_RWWord(R, Process, MemType, MemIndex, ref WordValue); //If i have to read -> Read the Bit if (bWrite == R) @@ -710,7 +712,7 @@ namespace CMS_CORE.Osai else WordValue = (byte)(WordValue & ~(1 << MemBit)); - RW_Word(W, Process, MemType, MemIndex, ref WordValue); + MEM_RWWord(W, Process, MemType, MemIndex, ref WordValue); } } @@ -720,19 +722,22 @@ namespace CMS_CORE.Osai // BYTE (NC) <-> BYTE (.NET) ToDo //Read-Write a Byte-Value inside the NC. In writing-mode the field "Number" is not required - public override void RW_Byte(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, int MemByte, ref byte Value) + public override void MEM_RWByte(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, int MemByte, ref byte Value) { ushort WordValue = 0; ushort WordToWrite = 0; //Check if the NC is Connected CheckConnection(); + + //Check if the Memory area is corrected + CheckMemoryArea(MemType.ToString()); //Check if the Bit Number is Correct CheckByteRange(MemByte); //Read the Byte where is the bit - RW_Word(R, Process, MemType, MemIndex, ref WordValue); + MEM_RWWord(R, Process, MemType, MemIndex, ref WordValue); //If i have to read -> Read the Bit if (bWrite == R) @@ -759,14 +764,14 @@ namespace CMS_CORE.Osai WordToWrite = (ushort)(WordToWrite | WordValue); //Write to the NC - RW_Word(W, Process, MemType, MemIndex, ref WordToWrite); + MEM_RWWord(W, Process, MemType, MemIndex, ref WordToWrite); } } //Read-Write a Byte-Value-List inside the NC. In writing-mode the field "Number" is not required - public override void RW_Byte_List(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, int MemByteStart, int Number, ref List Values) + public override void MEM_RWByteList(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, int MemByteStart, int Number, ref List Values) { int index = 0; byte TempVal = 0; @@ -776,6 +781,9 @@ namespace CMS_CORE.Osai //Check if the NC is Connected CheckConnection(); + //Check if the Memory area is corrected + CheckMemoryArea(MemType.ToString()); + //Check if the Bit Number is Correct CheckByteRange(MemByteStart); @@ -791,7 +799,7 @@ namespace CMS_CORE.Osai for (int i = 0; i < Values.Count; i++) { TempVal = Values[i]; - RW_Byte(W, Process, MemType, MemIndexTemp, index, ref TempVal); + MEM_RWByte(W, Process, MemType, MemIndexTemp, index, ref TempVal); if (index == 1) { index = 0; @@ -808,7 +816,7 @@ namespace CMS_CORE.Osai Values.Clear(); for (int i = 0; i < Number; i++) { - RW_Byte(W, Process, MemType, MemIndexTemp, index, ref TempVal); + MEM_RWByte(W, Process, MemType, MemIndexTemp, index, ref TempVal); Values.Add(TempVal); if (index == 1) { @@ -828,22 +836,25 @@ namespace CMS_CORE.Osai // WORD (NC) <-> USHORT (.NET) //Write a Word-Value inside the NC. In writing-mode the field "Number" is not required - public override void RW_Word(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, ref ushort Value) + public override void MEM_RWWord(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, ref ushort Value) { List ListValue = new List() { Value }; //Check if the NC is Connected CheckConnection(); + //Check if the Memory area is corrected + CheckMemoryArea(MemType.ToString()); + //uses the List method with one-element list - RW_Word_List(bWrite, Process, MemType, MemIndex, 1, ref ListValue); + MEM_RWWordList(bWrite, Process, MemType, MemIndex, 1, ref ListValue); Value = ListValue.First(); } //Write a Word-Value-List inside the NC. In writing-mode the field "Number" is not required - public override void RW_Word_List(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, int Number, ref List Values) + public override void MEM_RWWordList(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, int Number, ref List Values) { uint errorClass, errorNum; ushort nReturn; @@ -852,6 +863,9 @@ namespace CMS_CORE.Osai //Check if the NC is Connected CheckConnection(); + //Check if the Memory area is corrected + CheckMemoryArea(MemType.ToString()); + //Try to get information try { @@ -895,24 +909,27 @@ namespace CMS_CORE.Osai //-------------------------------------------------------------------------------------------------------------------------- // WORD (NC) <-> SHORT (.NET) - public override void RW_Short(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, ref short Value) + public override void MEM_RWShort(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, ref short Value) { List ListValue = new List() { Value }; //Check if the NC is Connected CheckConnection(); + //Check if the Memory area is corrected + CheckMemoryArea(MemType.ToString()); + //uses the List method with one-element list - RW_Short_List(bWrite, Process, MemType, MemIndex, 1, ref ListValue); + MEM_RWShortList(bWrite, Process, MemType, MemIndex, 1, ref ListValue); Value = ListValue.First(); } - public override void RW_Short_List(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, int Number, ref List Value) + public override void MEM_RWShortList(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, int Number, ref List Value) { List ShortValue = Value.ConvertAll(x => (ushort) x); - RW_Word_List(bWrite, Process, MemType, MemIndex, 1, ref ShortValue); + MEM_RWWordList(bWrite, Process, MemType, MemIndex, 1, ref ShortValue); } @@ -922,34 +939,40 @@ namespace CMS_CORE.Osai //Write a Word-Value inside the NC. In writing-mode the field "Number" is not required - public override void RW_DWord(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, ref uint Value) + public override void MEM_RWDWord(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, ref uint Value) { List ListValue = new List() { Value }; //Check if the NC is Connected CheckConnection(); + //Check if the Memory area is corrected + CheckMemoryArea(MemType.ToString()); + //uses the List method with one-element list - RW_DWord_List(bWrite, Process, MemType, MemIndex, 1, ref ListValue); + MEM_RWDWordList(bWrite, Process, MemType, MemIndex, 1, ref ListValue); Value = ListValue.First(); } //Write a Word-Value-List inside the NC. In writing-mode the field "Number" is not required - public override void RW_DWord_List(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, int Number, ref List Values) + public override void MEM_RWDWordList(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, int Number, ref List Values) { List WordValues = new List(); //Check if the NC is Connected CheckConnection(); + //Check if the Memory area is corrected + CheckMemoryArea(MemType.ToString()); + //If i have to write convert the UINT list into (2x) WORD if (bWrite) WordValues = Nc_Utils.UIntTOWordList(Values); //Exetute the function - RW_Word_List(bWrite, Process, MemType, MemIndex, (Number * 2), ref WordValues); + MEM_RWWordList(bWrite, Process, MemType, MemIndex, (Number * 2), ref WordValues); //If i have to read convert the (2x) WORD list into UINT if (!bWrite) @@ -963,7 +986,7 @@ namespace CMS_CORE.Osai //Write a Int-Value inside the NC. In writing-mode the field "Number" is not required - public override void RW_Integer(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, ref int Value) + public override void MEM_RWInteger(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, ref int Value) { List ListValue = new List() { Value }; @@ -971,27 +994,33 @@ namespace CMS_CORE.Osai //Check if the NC is Connected CheckConnection(); + //Check if the Memory area is corrected + CheckMemoryArea(MemType.ToString()); + //uses the List method with one-element list - RW_Integer_List(bWrite, Process, MemType, MemIndex, 1, ref ListValue); + MEM_RWIntegerList(bWrite, Process, MemType, MemIndex, 1, ref ListValue); Value = ListValue.First(); } //Write a Int-Value-List inside the NC. In writing-mode the field "Number" is not required - public override void RW_Integer_List(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, int Number, ref List Values) + public override void MEM_RWIntegerList(bool bWrite, int Process, MEMORY_Type MemType, int MemIndex, int Number, ref List Values) { List WordValues = new List(); //Check if the NC is Connected CheckConnection(); + //Check if the Memory area is corrected + CheckMemoryArea(MemType.ToString()); + //If i have to write convert the INT list into (2x) WORD if (bWrite) WordValues = Nc_Utils.IntTOWordList(Values); //Exetute the function - RW_Word_List(bWrite, Process, MemType, MemIndex, (Number * 2), ref WordValues); + MEM_RWWordList(bWrite, Process, MemType, MemIndex, (Number * 2), ref WordValues); //If i have to read convert the (2x) WORD list into INT if (!bWrite) @@ -1004,27 +1033,27 @@ namespace CMS_CORE.Osai // PARAMS - public override void R_NCParam(short Index, short Bit, ref bool Value) + public override void NC_RParam(short Index, short Bit, ref bool Value) { throw new Nc_Exception(getError(FUNC_NOTALL_NC_ERROR, 0, 0)); } - public override void R_NCParam(short Index, ref byte Value) + public override void NC_RParam(short Index, ref byte Value) { throw new Nc_Exception(getError(FUNC_NOTALL_NC_ERROR, 0, 0)); } - public override void R_NCParam(short Index, ref short Value) + public override void NC_RParam(short Index, ref short Value) { throw new Nc_Exception(getError(FUNC_NOTALL_NC_ERROR, 0, 0)); } - public override void R_NCParam(short Index, ref int Value) + public override void NC_RParam(short Index, ref int Value) { throw new Nc_Exception(getError(FUNC_NOTALL_NC_ERROR, 0, 0)); } - public override void R_NCParam(short Index, ref double Value) + public override void NC_RParam(short Index, ref double Value) { throw new Nc_Exception(getError(FUNC_NOTALL_NC_ERROR, 0, 0)); } @@ -1036,7 +1065,7 @@ namespace CMS_CORE.Osai /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #region File Management - public override void R_NCReadPartProgramToFile(string partProgramPath, string partProgramLocalName, ref FileStream localFile) + public override void FILES_RProgramToFile(string partProgramPath, string partProgramLocalName, ref FileStream localFile) { string partProgramContent = ""; // Read NC part program content @@ -1079,7 +1108,7 @@ namespace CMS_CORE.Osai } } - public override void W_NCWritePartProgramFromFile(string partProgramPath, FileStream localFile) + public override void FILES_WProgramFromFile(string partProgramPath, FileStream localFile) { string partProgramContent = ""; @@ -1119,7 +1148,7 @@ namespace CMS_CORE.Osai } } - public override void NCCopyPartProgram(string partProgramPath, string newPartProgramPath, bool failIfExist) + public override void FILES_CopyProgram(string partProgramPath, string newPartProgramPath, bool failIfExist) { //Check if the NC is Connected CheckConnection(); @@ -1147,7 +1176,7 @@ namespace CMS_CORE.Osai } } - public override void NCDeletePartProgram(string partProgramPath, string partProgramName) + public override void FILES_DeleteProgram(string partProgramPath, string partProgramName) { //Check if the NC is Connected CheckConnection(); @@ -1176,6 +1205,7 @@ namespace CMS_CORE.Osai /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #region Subordinate Private Functions + //Setup the connection Binding private void setupConnection() { @@ -1203,11 +1233,21 @@ namespace CMS_CORE.Osai //Check if NC is connected private void CheckConnection() { - if (!isConnected()) + if (!NC_IsConnected()) throw new Nc_Exception(getError(NOT_CONNECTED_ERROR,0 , 0)); } + + //Check if Memory Area is corrected + private void CheckMemoryArea(String AreaName) + { + if (!AreaName.StartsWith(OSAI_MEMTYPE) && !AreaName.StartsWith(UNDEFINED_MEMTYPE)) + throw new Nc_Exception(getError(INCORRECT_PARAMETERS_ERROR, 0, 0)); + } + + + //Read Static Data private void readStaticNCData() { @@ -1272,7 +1312,7 @@ namespace CMS_CORE.Osai try { //Read From Files - ConfigLines = File.ReadAllLines(NC_OSAI_WINBI_PATH + ConfigFile ); + ConfigLines = File.ReadAllLines(OSAI_WinNbiPath + ConfigFile ); //Find the first line that contains "ID_LANGUAGE" String LangLine = ConfigLines.FirstOrDefault(X => X.ToUpper().Contains("ID_LANGUAGE")); @@ -1280,10 +1320,7 @@ namespace CMS_CORE.Osai //Check if i found it if (String.IsNullOrEmpty(LangLine)) throw new Nc_Exception("'ID_LANGUAGE' Line in Osai Config File not Found"); - - //Check if i found it - if (String.IsNullOrEmpty(LangLine)) - throw new Nc_Exception("'ID_LANGUAGE' Line in Osai Config File not Found"); + //Split the string SPlitted = LangLine.Split('='); @@ -1296,7 +1333,7 @@ namespace CMS_CORE.Osai } catch (Exception ex) { - new Nc_Exception("Error in reading OSAI Configuration File:\n" + ex.Message); + throw new Nc_Exception("Error in reading OSAI Configuration File:\n" + ex.Message); } } @@ -1310,7 +1347,7 @@ namespace CMS_CORE.Osai try { //Setup the Path - Path = NC_OSAI_PLC_MESSAGES + @"Messaggi_" + OsaiLanguages + @".txt"; + Path = OSAI_PlcMessagesPath + @"Messaggi_" + OsaiLanguages + @".txt"; //Read From Files PlcMessages = File.ReadAllLines(Path); @@ -1325,7 +1362,7 @@ namespace CMS_CORE.Osai } catch (Exception ex) { - new Nc_Exception("Error in reading OSAI PLC Messages:\n" + ex.Message); + throw new Nc_Exception("Error in reading OSAI PLC Messages:\n" + ex.Message); } } @@ -1415,6 +1452,8 @@ namespace CMS_CORE.Osai } + + // Convert the internal error in a readable-String error private String getError(uint CMSError, uint Class, uint Num) { @@ -1431,6 +1470,7 @@ namespace CMS_CORE.Osai case BIT_NOT_IN_RANGE_ERROR: return ErrororOwner + "Bit-number must be between 0 and 7"; case BYTE_NOT_IN_RANGE_ERROR: return ErrororOwner + "Byte-number must be between 0 and 1"; case INTERNAL_ERROR: return ErrororOwner + "Internal function error"; + case INCORRECT_PARAMETERS_ERROR:return ErrororOwner + "Incorrect Parameters error"; } } else @@ -1610,7 +1650,7 @@ namespace CMS_CORE.Osai } return ErrororOwner + "Generic Error On Function"; } - + #endregion } diff --git a/CMS_CORE_Library/bin/Debug2/CMS_CORE_Library.dll b/CMS_CORE_Library/bin/Debug2/CMS_CORE_Library.dll index 699a948..4e38ddb 100644 Binary files a/CMS_CORE_Library/bin/Debug2/CMS_CORE_Library.dll and b/CMS_CORE_Library/bin/Debug2/CMS_CORE_Library.dll differ diff --git a/CMS_CORE_Library/bin/Debug2/CMS_CORE_Library.pdb b/CMS_CORE_Library/bin/Debug2/CMS_CORE_Library.pdb index 8325bf8..6cd47dc 100644 Binary files a/CMS_CORE_Library/bin/Debug2/CMS_CORE_Library.pdb and b/CMS_CORE_Library/bin/Debug2/CMS_CORE_Library.pdb differ diff --git a/CMS_CORE_Library/bin/Debug2/CMS_CORE_Library.xml b/CMS_CORE_Library/bin/Debug2/CMS_CORE_Library.xml index b708520..68c2be9 100644 --- a/CMS_CORE_Library/bin/Debug2/CMS_CORE_Library.xml +++ b/CMS_CORE_Library/bin/Debug2/CMS_CORE_Library.xml @@ -14,141 +14,286 @@ Send/Recieve timeout connection - + - Read Nc Status + Get the NC IP-Address - Compatibility: Fanuc | Osai - - - Thrown when an internal or a library error occours - - - - - - Read Nc Port - - Compatibility: Fanuc | Osai + Compatibility: Fanuc | Osai | Demo Thrown when an internal or a library error occours - + + + Set the NC IP-Address + + Compatibility: Fanuc | Osai | Demo + + Thrown when an internal or a library error occours + + + + + + Get Nc Port + + Compatibility: Fanuc | Osai | Demo + + Thrown when an internal or a library error occours + + + + + + Set Nc Port + + Compatibility: Fanuc | Osai | Demo + + Thrown when an internal or a library error occours + + + + + + Get if the library uses Windows proxy + + Compatibility: Osai + + Thrown when an internal or a library error occours + + + + + + Set if the library need to use Windows proxy + + Compatibility: Osai + + Thrown when an internal or a library error occours + + + + + + Get the path of PLC Messages Folder + + Compatibility: Osai + + Thrown when an internal or a library error occours + + + + + + Set the path of PLC Messages Folder + + Compatibility: Osai + + Thrown when an internal or a library error occours + + + + + + Get the path of Win-Nbi installation + + Compatibility: Osai + + Thrown when an internal or a library error occours + + + + + + Set the path of Win-Nbi installation + + Compatibility: Osai + + Thrown when an internal or a library error occours + + + + Connect the NC - Compatibility: Fanuc | Osai + Compatibility: Fanuc | Osai | Demo Thrown when an internal or a library error occours - + Disconnect the NC - Compatibility: Fanuc | Osai + Compatibility: Fanuc | Osai | Demo Thrown when an internal or a library error occours - + + + Read Nc Status + + Compatibility: Fanuc | Osai | Demo + + + Thrown when an internal or a library error occours + + + Read actual time of the NC-Software (sometimes it can be different from NC-Operative-System) - Compatibility: Fanuc | Osai + Compatibility: Fanuc | Osai | Demo Thrown when an internal or a library error occours Reference of a DateTime Variable where data will be saved - + - Read CMS Serial number of the NC + Read Vendor NC Serial number - Compatibility: Fanuc | Osai + Compatibility: Fanuc | Osai | Demo Thrown when an internal or a library error occours Reference of a String Variable where data will be saved - + Read Model name of the NC - Compatibility: Fanuc | Osai + Compatibility: Fanuc | Osai | Demo Thrown when an internal or a library error occours Reference of a String Variable where data will be saved - + Read Software Version of the Nc - Compatibility: Fanuc | Osai + Compatibility: Fanuc | Osai | Demo Thrown when an internal or a library error occours Reference of a String Variable where data will be saved - + Read CMS Serial number of the Machine - Compatibility: Fanuc | Osai + Compatibility: Fanuc | Osai | Demo Thrown when an internal or a library error occours Reference of a String Variable where data will be saved - + Read number of configured Processes/Paths - Compatibility: Fanuc | Osai + Compatibility: Fanuc | Osai | Demo Thrown when an internal or a library error occours Reference of a ushort Variable where data will be saved - + Read the configured language of the NC - Compatibility: Fanuc | Osai + Compatibility: Fanuc | Osai | Demo Thrown when an internal or a library error occours Reference of a CultureInfo Variable where data will be saved - + + Read Boolean Parameter Machine (Not compatible for Axis Parameter (Multiple values in a parameter) + + Compatibility: Fanuc + + + Thrown when an internal or a library error occours + Index of the parameter + Set the Bit to Read. (0..7) + Reference of a variable with Param values + + + + Read Byte Parameter Machine (Not compatible for Axis Parameter (Multiple values in a parameter) + + Compatibility: Fanuc + + + Thrown when an internal or a library error occours + Index of the parameter + Reference of a variable with Param values + + + + Read 2 Byte (Short) Parameter Machine (Not compatible for Axis Parameter (Multiple values in a parameter) + + Compatibility: Fanuc + + + Thrown when an internal or a library error occours + Index of the parameter + Reference of a variable with Param values + + + + Read 4 Byte (Integer) Parameter Machine (Not compatible for Axis Parameter (Multiple values in a parameter) + + Compatibility: Fanuc + + + Thrown when an internal or a library error occours + Index of the parameter + Reference of a variable with Param values + + + + Read Real Parameter Machine (Not compatible for Axis Parameter (Multiple values in a parameter) + + Compatibility: Fanuc + + + Thrown when an internal or a library error occours + Index of the parameter + Reference of a variable with Param values + + + Read PMC active Alarms - Compatibility: Fanuc | Osai + Compatibility: Fanuc | Osai | Demo Thrown when an internal or a library error occours Reference of a List of String Variables where data will be saved - + Read the actual status of the Process "ProcNumber" See for information about the PROC_Status type - Compatibility: Fanuc | Osai + Compatibility: Fanuc | Osai | Demo Thrown when an internal or a library error occours @@ -156,12 +301,12 @@ Reference of a PROC_Status Variable where data will be saved - + Read the selected Mode Process "ProcNumber" See for information about the PROC_Status type - Compatibility: Fanuc | Osai + Compatibility: Fanuc | Osai | Demo Thrown when an internal or a library error occours @@ -169,11 +314,11 @@ Reference of a PROC_Mode Variable where data will be saved - + Read active alarms of the process "ProcNumber". For OSAI Nc the list can contain only one Message - Compatibility: Fanuc | Osai + Compatibility: Fanuc | Osai | Demo Thrown when an internal or a library error occours @@ -181,11 +326,11 @@ Reference of a List of String Variables where data will be saved - + Read the Interpolated position of all axes in Process "ProcNumber" - Compatibility: Fanuc | Osai + Compatibility: Fanuc | Osai | Demo Thrown when an internal or a library error occours @@ -193,12 +338,12 @@ Reference of Dictionary "Key,Value" with: Key: Axis Name, Value: Position - + Read the Programmed position of all axes in Process "ProcNumber". For Fanuc-Nc there's not "Programmed position" variables. Si it is calculated from Machine-Pos and Distance-to-go - Compatibility: Fanuc | Osai + Compatibility: Fanuc | Osai | Demo Thrown when an internal or a library error occours @@ -206,11 +351,11 @@ Reference of Dictionary "Key,Value" with: Key: Axis Name, Value: Position - + Read the Machine position of all axes in Process "ProcNumber" - Compatibility: Fanuc | Osai + Compatibility: Fanuc | Osai | Demo Thrown when an internal or a library error occours @@ -218,11 +363,11 @@ Reference of Dictionary "Key,Value" with: Key: Axis Name, Value: Position - + Read the Following-Error of all axes in Process "ProcNumber" - Compatibility: Osai + Compatibility: Osai | Demo Thrown when an internal or a library error occours @@ -230,11 +375,11 @@ Reference of Dictionary "Key,Value" with: Key: Axis Name, Value: Position - + Read the Distance-to-go of all axes in Process "ProcNumber" - Compatibility: Fanuc | Osai + Compatibility: Fanuc | Osai | Demo Thrown when an internal or a library error occours @@ -242,10 +387,10 @@ Reference of Dictionary "Key,Value" with: Key: Axis Name, Value: Position - + Read/Write Boolean variable from/into NC Memory Area - Compatibility: Fanuc | Osai + Compatibility: Fanuc | Osai | Demo Thrown when an internal or a library error occours @@ -257,10 +402,10 @@ Reference to variable to read/Write - + Read/Write Byte variable from/into NC Memory Area - Compatibility: Fanuc | Osai + Compatibility: Fanuc | Osai | Demo Thrown when an internal or a library error occours @@ -272,10 +417,10 @@ Reference to variable to read/Write - + Read/Write unsigned 2 Byte (NC: Word:, .NET: ushort) variable from/into NC Memory Area - Compatibility: Fanuc | Osai + Compatibility: Fanuc | Osai | Demo Thrown when an internal or a library error occours @@ -287,10 +432,10 @@ List of values to read/Write - + Read/Write signed 2 Byte (NC: Word:, .NET: short) variable from/into NC Memory Area - Compatibility: Fanuc | Osai + Compatibility: Fanuc | Osai | Demo Thrown when an internal or a library error occours @@ -302,10 +447,10 @@ List of values to read/Write - + Read/Write signed 4 Byte (NC: DWord:, .NET: uint) variable from/into NC Memory Area - Compatibility: Fanuc | Osai + Compatibility: Fanuc | Osai | Demo uW Thrown when an internal or a library error occours @@ -317,10 +462,10 @@ List of values to read/Write - + Read/Write signed 4 Byte (NC: DWord:, .NET: int) variable from/into NC Memory Area - Compatibility: Fanuc | Osai + Compatibility: Fanuc | Osai | Demo Thrown when an internal or a library error occours @@ -332,10 +477,10 @@ List of values to read/Write - + Read/Write List of Byte from/into NC Memory Area - Compatibility: Fanuc | Osai + Compatibility: Fanuc | Osai | Demo Thrown when an internal or a library error occours @@ -348,10 +493,10 @@ List of values to read/Write - + Read/Write List of unsigned 2 Byte (NC: Word:, .NET: ushort) from/into NC Memory Area - Compatibility: Fanuc | Osai + Compatibility: Fanuc | Osai | Demo Thrown when an internal or a library error occours @@ -363,10 +508,10 @@ List of values to read/Write - + Read/Write List of signed 2 Byte (NC: Word:, .NET: short) from/into NC Memory Area - Compatibility: Fanuc | Osai + Compatibility: Fanuc | Osai | Demo Thrown when an internal or a library error occours @@ -378,10 +523,10 @@ List of values to read/Write - + Read/Write List of unsigned 4 Byte (NC: DWord:, .NET: uint) from/into NC Memory Area - Compatibility: Fanuc | Osai + Compatibility: Fanuc | Osai | Demo Thrown when an internal or a library error occours @@ -393,10 +538,10 @@ List of values to read/Write - + Read/Write List of signed 4 Byte (NC: DWord:, .NET: int) from/into NC Memory Area - Compatibility: Fanuc | Osai + Compatibility: Fanuc | Osai | Demo Thrown when an internal or a library error occours @@ -408,81 +553,34 @@ List of values to read/Write - - Read Boolean Parameter Machine (Not compatible for Axis Parameter (Multiple values in a parameter) + + Read a Part Program by path and name - Compatibility: Fanuc + Compatibility: Fanuc | Osai | Demo Thrown when an internal or a library error occours - Index of the parameter - Set the Bit to Read. (0..7) - Reference of a variable with Param values - - - - Read Byte Parameter Machine (Not compatible for Axis Parameter (Multiple values in a parameter) - - Compatibility: Fanuc - - - Thrown when an internal or a library error occours - Index of the parameter - Reference of a variable with Param values - - - - Read 2 Byte (Short) Parameter Machine (Not compatible for Axis Parameter (Multiple values in a parameter) - - Compatibility: Fanuc - - - Thrown when an internal or a library error occours - Index of the parameter - Reference of a variable with Param values - - - - Read 4 Byte (Integer) Parameter Machine (Not compatible for Axis Parameter (Multiple values in a parameter) - - Compatibility: Fanuc - - - Thrown when an internal or a library error occours - Index of the parameter - Reference of a variable with Param values - - - - Read Real Parameter Machine (Not compatible for Axis Parameter (Multiple values in a parameter) - - Compatibility: Fanuc - - - Thrown when an internal or a library error occours - Index of the parameter - Reference of a variable with Param values - - - - Read a Part Program by path and name - - Thrown when an internal or a library error occours Path of the Part Program stored in the Nc Name of the Part Program and name of new local file Reference to the new local file where the NC Part Program data will be saved - - Write/Overwrite a Part Program by path and name + + Write/Overwrite a Part Program by path and name + + Compatibility: Fanuc | Osai | Demo + Thrown when an internal or a library error occours Path of the Part Program stored in the Nc Reference to the local Part Program file - - Copy a Part Program into another path + + Copy a Part Program into another path + + Compatibility: Fanuc | Osai | Demo + Thrown when an internal or a library error occours Path where the Part Program is saved in the NC @@ -490,13 +588,191 @@ - - Delete a Nc Part Program + + Delete a Nc Part Program + + Compatibility: Fanuc | Osai | Demo + + Thrown when an internal or a library error occours Path where the Nc Part Program is saved in the NC Name of the Part Program file + + Write action + + + Read action + + + Not-Defined Process + + + Process-Status + + + Idle-Status + + + Run-Status + + + Hold-Status + + + Error-Status + + + Reset-Status + + + Emergency-Status + + + CMS-Process-Mode + + + Automatic-Mode + + + Edit-Mode + + + Mdi-Mode + + + Remote-Mode + + + Teach-Mode + + + Ref-Mode + + + Jog-Mode + + + Joginc-Mode + + + Ret_on_Profile-Mode + + + Handle-Mode + + + Restart-Mode + + + Error-Mode + + + Nc Memory Type (Table) + + + Null Type + + + Fanuc G Area + + + Fanuc F Area + + + Fanuc Y Area + + + Fanuc X Area + + + Fanuc A Area + + + Fanuc R Area + + + Fanuc T Area + + + Fanuc K Area + + + Fanuc C Area + + + Fanuc D Area + + + Fanuc M Area + + + Fanuc N Area + + + Fanuc E Area + + + Fanuc Z Area + + + Fanuc CM Area + + + Osai I Area + + + Osai O Area + + + Osai MW Area + + + Osai GW Area + + + Osai SW Area + + + Osai PW Area + + + Osai UW Area + + + Osai MD Area + + + Osai GD Area + + + Osai SD Area + + + Osai PD Area + + + Osai UD Area + + + Osai L Area + + + Osai LS Area + + + Osai AA Area + + + Osai A Area + + + Osai SC Area + + + Osai SYMO Area + Instantiate The NC-Osai Class diff --git a/CMS_CORE_Library/bin/Debug2/CndexLinkDotNet.dll b/CMS_CORE_Library/bin/Debug2/CndexLinkDotNet.dll index 14f023f..7b69fd3 100644 Binary files a/CMS_CORE_Library/bin/Debug2/CndexLinkDotNet.dll and b/CMS_CORE_Library/bin/Debug2/CndexLinkDotNet.dll differ diff --git a/CMS_CORE_Library/obj/Debug2/CMS_CORE_Library.csproj.FileListAbsolute.txt b/CMS_CORE_Library/obj/Debug2/CMS_CORE_Library.csproj.FileListAbsolute.txt index 5357d03..73761ff 100644 --- a/CMS_CORE_Library/obj/Debug2/CMS_CORE_Library.csproj.FileListAbsolute.txt +++ b/CMS_CORE_Library/obj/Debug2/CMS_CORE_Library.csproj.FileListAbsolute.txt @@ -17,3 +17,12 @@ C:\Workspace\CMS_CORE_LIBRARY\CMS_CORE_Library\obj\Debug2\CMS_CORE_Library.cspro C:\Workspace\CMS_CORE_LIBRARY\CMS_CORE_Library\obj\Debug2\CMS_CORE_Library.csproj.CoreCompileInputs.cache C:\Workspace\CMS_CORE_LIBRARY\CMS_CORE_Library\obj\Debug2\CMS_CORE_Library.dll C:\Workspace\CMS_CORE_LIBRARY\CMS_CORE_Library\obj\Debug2\CMS_CORE_Library.pdb +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Library\obj\Debug2\CMS_CORE_Library.csproj.CoreCompileInputs.cache +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Library\obj\Debug2\CMS_CORE_Library.dll +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Library\obj\Debug2\CMS_CORE_Library.pdb +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Library\bin\Debug2\CMS_CORE_Library.dll.config +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Library\bin\Debug2\CMS_CORE_Library.xml +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Library\bin\Debug2\CMS_CORE_Library.dll +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Library\bin\Debug2\CMS_CORE_Library.pdb +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Library\bin\Debug2\CndexLinkDotNet.dll +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Library\bin\Debug2\SKGL.dll diff --git a/CMS_CORE_Library/obj/Debug2/CMS_CORE_Library.dll b/CMS_CORE_Library/obj/Debug2/CMS_CORE_Library.dll index 699a948..4e38ddb 100644 Binary files a/CMS_CORE_Library/obj/Debug2/CMS_CORE_Library.dll and b/CMS_CORE_Library/obj/Debug2/CMS_CORE_Library.dll differ diff --git a/CMS_CORE_Library/obj/Debug2/CMS_CORE_Library.pdb b/CMS_CORE_Library/obj/Debug2/CMS_CORE_Library.pdb index 8325bf8..6cd47dc 100644 Binary files a/CMS_CORE_Library/obj/Debug2/CMS_CORE_Library.pdb and b/CMS_CORE_Library/obj/Debug2/CMS_CORE_Library.pdb differ diff --git a/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/bin/Debug/Nc_Demo_Application.exe b/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/bin/Debug/Nc_Demo_Application.exe index 9cb8b54..4532b44 100644 Binary files a/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/bin/Debug/Nc_Demo_Application.exe and b/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/bin/Debug/Nc_Demo_Application.exe differ diff --git a/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/bin/Debug/Nc_Demo_Application.pdb b/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/bin/Debug/Nc_Demo_Application.pdb index 1f75809..28b008c 100644 Binary files a/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/bin/Debug/Nc_Demo_Application.pdb and b/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/bin/Debug/Nc_Demo_Application.pdb differ diff --git a/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/obj/Debug/CMS_Core_Nc_Demo_Application.csproj.FileListAbsolute.txt b/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/obj/Debug/CMS_Core_Nc_Demo_Application.csproj.FileListAbsolute.txt index 3d3eaf6..938e3b3 100644 --- a/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/obj/Debug/CMS_Core_Nc_Demo_Application.csproj.FileListAbsolute.txt +++ b/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/obj/Debug/CMS_Core_Nc_Demo_Application.csproj.FileListAbsolute.txt @@ -39,3 +39,24 @@ C:\Workspace\CMS_CORE_LIBRARY\CMS_CORE_Nc_Demo_Application\Nc_Demo_Application\o C:\Workspace\CMS_CORE_LIBRARY\CMS_CORE_Nc_Demo_Application\Nc_Demo_Application\obj\Debug\Nc_Demo_Application.pdb C:\Workspace\CMS_CORE_LIBRARY\CMS_CORE_Nc_Demo_Application\Nc_Demo_Application\obj\Debug\Nc_Demo_Application.DemoApplicationForm.resources C:\Workspace\CMS_CORE_LIBRARY\CMS_CORE_Nc_Demo_Application\Nc_Demo_Application\obj\Debug\Nc_Demo_Application.StartupForm.resources +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Nc_Demo_Application\Nc_Demo_Application\bin\Debug\Nc_Demo_Application.exe.config +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Nc_Demo_Application\Nc_Demo_Application\bin\Debug\Nc_Demo_Application.exe +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Nc_Demo_Application\Nc_Demo_Application\bin\Debug\Nc_Demo_Application.pdb +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Nc_Demo_Application\Nc_Demo_Application\bin\Debug\EntityFramework.dll +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Nc_Demo_Application\Nc_Demo_Application\bin\Debug\EntityFramework.SqlServer.dll +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Nc_Demo_Application\Nc_Demo_Application\bin\Debug\System.Data.SQLite.dll +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Nc_Demo_Application\Nc_Demo_Application\bin\Debug\System.Data.SQLite.EF6.dll +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Nc_Demo_Application\Nc_Demo_Application\bin\Debug\System.Data.SQLite.Linq.dll +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Nc_Demo_Application\Nc_Demo_Application\bin\Debug\System.ServiceModel.Primitives.dll +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Nc_Demo_Application\Nc_Demo_Application\bin\Debug\EntityFramework.xml +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Nc_Demo_Application\Nc_Demo_Application\bin\Debug\EntityFramework.SqlServer.xml +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Nc_Demo_Application\Nc_Demo_Application\bin\Debug\System.Data.SQLite.xml +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Nc_Demo_Application\Nc_Demo_Application\bin\Debug\System.Data.SQLite.dll.config +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Nc_Demo_Application\Nc_Demo_Application\obj\Debug\CMS_Core_Nc_Demo_Application.csprojResolveAssemblyReference.cache +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Nc_Demo_Application\Nc_Demo_Application\obj\Debug\Nc_Demo_Application.DemoApplicationForm.resources +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Nc_Demo_Application\Nc_Demo_Application\obj\Debug\Nc_Demo_Application.Properties.Resources.resources +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Nc_Demo_Application\Nc_Demo_Application\obj\Debug\Nc_Demo_Application.StartupForm.resources +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Nc_Demo_Application\Nc_Demo_Application\obj\Debug\CMS_Core_Nc_Demo_Application.csproj.GenerateResource.Cache +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Nc_Demo_Application\Nc_Demo_Application\obj\Debug\CMS_Core_Nc_Demo_Application.csproj.CoreCompileInputs.cache +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Nc_Demo_Application\Nc_Demo_Application\obj\Debug\Nc_Demo_Application.exe +C:\Users\carminatini\Documents\Visual Studio 2017\SVN Projects\CMS_CORE_Library\CMS_CORE_Nc_Demo_Application\Nc_Demo_Application\obj\Debug\Nc_Demo_Application.pdb diff --git a/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/obj/Debug/CMS_Core_Nc_Demo_Application.csproj.GenerateResource.Cache b/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/obj/Debug/CMS_Core_Nc_Demo_Application.csproj.GenerateResource.Cache index 886b0d8..d97ee13 100644 Binary files a/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/obj/Debug/CMS_Core_Nc_Demo_Application.csproj.GenerateResource.Cache and b/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/obj/Debug/CMS_Core_Nc_Demo_Application.csproj.GenerateResource.Cache differ diff --git a/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/obj/Debug/CMS_Core_Nc_Demo_Application.csprojResolveAssemblyReference.cache b/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/obj/Debug/CMS_Core_Nc_Demo_Application.csprojResolveAssemblyReference.cache index 2c7870a..c4dd9c3 100644 Binary files a/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/obj/Debug/CMS_Core_Nc_Demo_Application.csprojResolveAssemblyReference.cache and b/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/obj/Debug/CMS_Core_Nc_Demo_Application.csprojResolveAssemblyReference.cache differ diff --git a/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/obj/Debug/Nc_Demo_Application.exe b/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/obj/Debug/Nc_Demo_Application.exe index 9cb8b54..4532b44 100644 Binary files a/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/obj/Debug/Nc_Demo_Application.exe and b/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/obj/Debug/Nc_Demo_Application.exe differ diff --git a/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/obj/Debug/Nc_Demo_Application.pdb b/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/obj/Debug/Nc_Demo_Application.pdb index 1f75809..28b008c 100644 Binary files a/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/obj/Debug/Nc_Demo_Application.pdb and b/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/obj/Debug/Nc_Demo_Application.pdb differ