Files
cms-core-active/CMS_CORE_Library/Nc.cs
T
2018-05-10 15:46:19 +00:00

1539 lines
68 KiB
C#

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Reflection;
using static CMS_CORE_Library.DataStructures;
namespace CMS_CORE
{
public abstract partial class Nc
{
//Private Global Variables
internal Boolean Connected;
internal String Ip;
internal ushort Port;
internal Boolean UseProxy;
internal String LibName = "CMS_CORE_Library.dll";
//Osai Variable
internal string OSAI_PlcMessagesPath = @"C:\CMS\OSAI\";
internal string OSAI_WinNbiPath = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + @"\OSAI\WinNBI\";
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#region LIB Methods
/**
* <summary>
* Get the NC IP-Address
* <para>
* Compatibility: Fanuc | Osai | Demo
* </para>
* </summary>
* */
public String LIB_GetIpAddress()
{
return Ip;
}
/**
* <summary>
* Set the NC IP-Address
* <para>
* Compatibility: Fanuc | Osai | Demo
* </para>
* </summary>
* */
public void LIB_SetIpAddress(String ip)
{
Ip = ip;
}
/**
* <summary>
* Get Nc Port
* <para>
* Compatibility: Fanuc | Osai | Demo
* </para>
* </summary>
* */
public ushort LIB_GetPort()
{
return Port;
}
/**
* <summary>
* Set Nc Port
* <para>
* Compatibility: Fanuc | Osai | Demo
* </para>
* </summary>
* */
public void LIB_SetPort(ushort port)
{
Port = port;
}
/**
* <summary>
* Get Library Version
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* </summary>
* */
public String LIB_GetLibraryVersion()
{
return FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).ProductVersion.ToString();
}
#endregion LIB Methods
#region LIB Methods (OSAI)
/**
* <summary>
* Get if the library uses Windows proxy
* <para>
* Compatibility: Osai
* </para>
* </summary>
* */
public Boolean LIB_GetWindowsProxy()
{
return UseProxy;
}
/**
* <summary>
* Set if the library need to use Windows proxy
* <para>
* Compatibility: Osai
* </para>
* </summary>
* */
public void LIB_SetWindowsProxy(Boolean proxy)
{
UseProxy = proxy;
}
/**
* <summary>
* Get the path of PLC Messages Folder
* <para>
* Compatibility: Osai
* </para>
* </summary>
* */
public string LIB_GetPlcMsgsPath()
{
return OSAI_PlcMessagesPath;
}
/**
* <summary>
* Set the path of PLC Messages Folder
* <para>
* Compatibility: Osai
* </para>
* </summary>
* */
public void LIB_SetPlcMsgsPath(string folder)
{
OSAI_PlcMessagesPath = folder;
}
/**
* <summary>
* Get the path of Win-Nbi installation
* <para>
* Compatibility: Osai
* </para>
* </summary>
* */
public string LIB_GetWinNbiPath()
{
return OSAI_WinNbiPath;
}
/**
* <summary>
* Set the path of Win-Nbi installation
* <para>
* Compatibility: Osai
* </para>
* </summary>
* */
public void LIB_SetWinNbiPath(string folder)
{
OSAI_WinNbiPath = folder;
}
#endregion LIB Methods (OSAI)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#region NC High-level data (to override)
/**
* <summary>
* Connect the NC
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* </summary>
* */
public abstract CmsError NC_Connect();
/**
* <summary>
* Disconnect the NC
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* </summary>
* */
public abstract CmsError NC_Disconnect();
/**
* <summary>
* Read Nc Status
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* */
public Boolean NC_IsConnected()
{
return Connected;
}
/**
* <summary>
* Read actual time of the NC-Software (sometimes it can be different from NC-Operative-System)
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="ActualTime">Reference of a DateTime Variable where data will be saved</param>
* */
public abstract CmsError NC_RDateTime(ref DateTime ActualTime);
/**
* <summary>
* Read Vendor NC Serial number
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="SN">Reference of a String Variable where data will be saved</param>
* */
public abstract CmsError NC_RSerialNumber(ref String SN);
/**
* <summary>
* Read Model name of the NC
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="ModelName">Reference of a String Variable where data will be saved</param>
* */
public abstract CmsError NC_RModelName(ref String ModelName);
/**
* <summary>
* Read Software Version of the Nc
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="SWV">Reference of a String Variable where data will be saved</param>
* */
public abstract CmsError NC_RSoftwareVersion(ref String SWV);
/**
* <summary>
* Read CMS Serial number of the Machine
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="MachNumber">Reference of a String Variable where data will be saved</param>
* */
public abstract CmsError NC_RMachineNumber(ref String MachNumber);
/**
* <summary>
* Read number of configured Processes/Paths
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="ProcNumber">Reference of a ushort Variable where data will be saved</param>
* */
public abstract CmsError NC_RProcessesNum(ref ushort ProcNumber);
/**
* <summary>
* Read the configured language of the NC
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="Language">Reference of a CultureInfo Variable where data will be saved</param>
* */
public abstract CmsError NC_RLanguage(ref CultureInfo Language);
/**
* <summary>
* Read active alarms of the NC (Nc-Process indipendent). For OSAI Nc the list can contain only one Message
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="ProcNumber">Process to execute the action</param>
* <param name="alarms">Reference of a List of String Variables where data will be saved</param>
* */
public abstract CmsError NC_RActiveAlarms(ref List<AlarmModel> alarms);
/**
* <summary>
* Check if the NC is in running state
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="running">Reference to boolean where running state will be saved</param>
* */
public abstract CmsError NC_RIsRunning(ref bool running);
public abstract CmsError NC_GetTranslatedPlcMessages(string language, ref Dictionary<int, string> messages);
#endregion NC High-level data (to override)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#region NC Low-level data (to override)
/**
* <summary>Read Boolean Parameter Machine (Not compatible for Axis Parameter (Multiple values in a parameter)
* <para>
* Compatibility: Fanuc
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="Index">Index of the parameter</param>
* <param name="Bit">Set the Bit to Read. (0..7)</param>
* <param name="Value">Reference of a variable with Param values</param>
* */
public abstract CmsError NC_RParam(short Index, short Bit, ref Boolean Value);
/**
* <summary>Read Byte Parameter Machine (Not compatible for Axis Parameter (Multiple values in a parameter)
* <para>
* Compatibility: Fanuc
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="Index">Index of the parameter</param>
* <param name="Value">Reference of a variable with Param values</param>
* */
public abstract CmsError NC_RParam(short Index, ref byte Value);
/**
* <summary>Read 2 Byte (Short) Parameter Machine (Not compatible for Axis Parameter (Multiple values in a parameter)
* <para>
* Compatibility: Fanuc
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="Index">Index of the parameter</param>
* <param name="Value">Reference of a variable with Param values</param>
* */
public abstract CmsError NC_RParam(short Index, ref short Value);
/**
* <summary>Read 4 Byte (Integer) Parameter Machine (Not compatible for Axis Parameter (Multiple values in a parameter)
* <para>
* Compatibility: Fanuc
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="Index">Index of the parameter</param>
* <param name="Value">Reference of a variable with Param values</param>
* */
public abstract CmsError NC_RParam(short Index, ref int Value);
/**
* <summary>Read Real Parameter Machine (Not compatible for Axis Parameter (Multiple values in a parameter)
* <para>
* Compatibility: Fanuc
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="Index">Index of the parameter</param>
* <param name="Value">Reference of a variable with Param values</param>
* */
public abstract CmsError NC_RParam(short Index, ref double Value);
#endregion NC Low-level data (to override)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#region PLC High-level data (to override)
/**
* <summary>
* Read PMC active Messages
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="Alarms">Reference of a List of String Variables where data will be saved</param>
* */
public abstract CmsError PLC_RActiveMessages(ref List<PlcAlarmModel> Alarms);
/**
* <summary>
* Start refresh message procedure
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="id">Alarm id to refresh</param>
* * */
public abstract CmsError PLC_WRefreshMessage(uint id);
public abstract CmsError PLC_WRefreshAllMessages();
/**
* <summary>
* Start restore message procedure
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="id">Alarm id to restore</param>
*
* */
public abstract CmsError PLC_WRestoreMessage(uint id);
/**
* <summary>
* Read the status of the Power on data ( Pre-Power-On / Post-Power-On )
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* </summary>
* <param name="powerOnModel"> Reference to the structure where the power on data will be saved</param>
**/
public abstract CmsError PLC_RPowerOnData(ref PreAndPostPowerOnModel powerOnModel);
/**
* <summary>
* Write PowerOn data and status ( Pre-Power-On / Post-Power-On )
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* </summary>
* <param name="id"> Id of the edited power on data </param>
* <param name="value"> Reference to the value of the power on data</param>
**/
public abstract CmsError PLC_WPowerOnData(uint id, bool value);
/**
* <summary>
* Read the status of the UI functionality from PLC
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* </summary>
**/
public abstract CmsError PLC_RFunctionAccess(ref List<FunctionalityModel> functions);
/**
* <summary>
* Read axes reset procedure data from PLC
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="functions">Reference to the axes reset procedure data</param>
* </summary>
**/
public abstract CmsError PLC_RAxesResetData(ref AxisResetDataModel axisResetData);
/**
* <summary>
* Read machine counters value from PLC
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="counters">Reference to the counters data</param>
* </summary>
**/
public abstract CmsError PLC_RMachineCounters(ref List<CounterModel> counters);
/**
* <summary>
* Read nc softkeys values from PLC
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="softKeys">Reference to the nc softkey data</param>
* </summary>
**/
public abstract CmsError PLC_RNcSoftKeys(ref List<SoftKeysModel> ncSoftKeys);
/**
* <summary>
* Read user softkeys values from PLC
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="softKeys">Reference to the softkey data</param>
* </summary>
**/
public abstract CmsError PLC_RUserSoftKeys(ref List<SoftKeysModel> softKeys);
/**
* <summary>
* Write Nc softkey interaction into PLC
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* <returns cref="CmsError">Returns an when an internal or a library error occours</returns>
* <param name="id">Nc softkey id</param>
* </summary>
**/
public abstract CmsError PLC_WNcSoftKey(uint id);
/**
* <summary>
* Write user softkey interaction into PLC
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="id">User softkey id</param>
* </summary>
**/
public abstract CmsError PLC_WUserSoftKey(uint id);
/**
* <summary>
* Read heads data from PLC
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="heads">Recerence to the heads data</param>
* <param name="number">Number of heads data that are read</param>
* </summary>
**/
public abstract CmsError PLC_RHeadsData(List<HeadDataModel> heads, int number);
/**
* <summary>
* Write head override sign into PLC
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="id">Head id</param>
* <param name="sign">Type of increment of the override</param>
* </summary>
**/
public abstract CmsError PLC_WHeadOverride(uint id, HEAD_OVERRIDE_SIGN sign);
#endregion PLC High-level data (to override)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#region PROCESS (PATH, CHANNEL) data (to override)
/**
* <summary>
* Read the actual status of the Process "ProcNumber"
* <para>See <see cref="Nc.PROC_STATUS"/> for information about the PROC_Status type</para>
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="ProcNumber">Process number which the data refer</param>
* <param name="Status">Reference of a PROC_Status Variable where data will be saved</param>
* */
public abstract CmsError PROC_RStatus(ushort ProcNumber, ref PROC_STATUS Status);
/**
* <summary>
* Read the selected Mode Process "ProcNumber"
* <para>See <see cref="Nc.PROC_MODE"/> for information about the PROC_Status type</para>
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="ProcNumber">Process number which the data refer</param>
* <param name="Mode">Reference of a PROC_Mode Variable where data will be saved</param>
* */
public abstract CmsError PROC_RMode(ushort ProcNumber, ref PROC_MODE Mode);
/**
* <summary>
* Read active alarms of the process "ProcNumber". For OSAI Nc the list can contain only one Message
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="ProcNumber">Process number which the data refer</param>
* <param name="Alarms">Reference of a List of String Variables where data will be saved</param>
* */
public abstract CmsError PROC_RActiveAlarms(ushort procNumber, ref List<AlarmModel> alarms);
/**
* <summary>
* Read actual & Next Lines of active PP
* <para>
* Compatibility: Fanuc | Osai | Siemens
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="procNumber">Process number which the data refer</param>
* <param name="Lines">Reference of a List of String Variables where data will be saved</param>
* */
public abstract CmsError PROC_RPPLines(ushort procNumber, ref List<String> Lines);
/**
* <summary>
* Read active PP Name
* <para>
* Compatibility: Fanuc | Osai | Siemens
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="procNumber">Process number which the data refer</param>
* <param name="Name">Reference of a String Variables where data will be saved</param>
* */
public abstract CmsError PROC_RPPName(ushort procNumber, ref String Name);
/**
*<summary>
* Read active PP and generic data
* <para>
* Compatibility: Fanuc | Osai | Siemens
* </para>
* <param name="procNumber">Process number which the data refer</param>
* <param name="processData">Reference to part program data structure</param>
* </summary>
**/
public abstract CmsError PROC_RStatusAndData(ushort procNumber, ref ProcessDataModel processData);
/**
*<summary>
* Read selected process
* <para>
* Compatibility: Fanuc | Osai | Siemens
* </para>
* <param name="procNumber">Reference to the process number selected</param>
* </summary>
**/
public abstract CmsError PROC_RSelectedProcess(ref ushort procNumber);
/**
*<summary>
* Change the selected process
* <para>
* Compatibility: Fanuc | Osai | Siemens
* </para>
* <param name="procNumber">New selected process number</param>
* </summary>
**/
public abstract CmsError PROC_WSelectProcess(ushort procNumber);
#endregion PROCESS (PATH, CHANNEL) data (to override)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#region AXES data (to override)
/**
* <summary>
* Read the Interpolated position of all axes in Process "ProcNumber"
* <para>
* Compatibility: Fanuc | Osai | Demo
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="ProcNumber">Process to execute the action</param>
* <param name="Axes">Reference of Dictionary "Key,Value" with: Key: Axis Name, Value: Position</param>
* */
public abstract CmsError AXES_RInterpPosition(ushort ProcNumber, ref Dictionary<String, double> Axes);
/**
* <summary>
* 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
* <para>
* Compatibility: Fanuc | Osai | Demo
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="ProcNumber">Process to execute the action</param>
* <param name="Axes">Reference of Dictionary "Key,Value" with: Key: Axis Name, Value: Position</param>
* */
public abstract CmsError AXES_RProgrPosition(ushort ProcNumber, ref Dictionary<String, double> Axes);
/**
* <summary>
* Read the Machine position of all axes in Process "ProcNumber"
* <para>
* Compatibility: Fanuc | Osai | Demo
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="ProcNumber">Process to execute the action</param>
* <param name="Axes">Reference of Dictionary "Key,Value" with: Key: Axis Name, Value: Position</param>
* */
public abstract CmsError AXES_RMachinePosition(ushort ProcNumber, ref Dictionary<String, double> Axes);
/**
* <summary>
* Read the Following-Error of all axes in Process "ProcNumber"
* <para>
* Compatibility: Osai | Demo
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="ProcNumber">Process to execute the action</param>
* <param name="Axes">Reference of Dictionary "Key,Value" with: Key: Axis Name, Value: Position</param>
* */
public abstract CmsError AXES_RFollowingError(ushort ProcNumber, ref Dictionary<String, double> Axes);
/**
* <summary>
* Read the Distance-to-go of all axes in Process "ProcNumber"
* <para>
* Compatibility: Fanuc | Osai | Demo
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="ProcNumber">Process to execute the action</param>
* <param name="Axes">Reference of Dictionary "Key,Value" with: Key: Axis Name, Value: Position</param>
* */
public abstract CmsError AXES_RDistanceToGo(ushort ProcNumber, ref Dictionary<String, double> Axes);
public abstract CmsError AXES_RAxesNames(ushort process, ref List<AxisModel> axesData);
public abstract CmsError AXES_RSelectedAxis(ref byte axisId);
public abstract CmsError AXES_WSelectAxis(byte axisId);
#endregion AXES data (to override)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#region MEMORY Low-level function: single valiable in memory (to override)
/**
* <summary>Read/Write Boolean variable from/into NC Memory Area
* <para>
* Compatibility: Fanuc | Osai | Demo
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="bWrite">Set True to Write-operation (Also Allowed <see cref="Nc.W"/>/<see cref="Nc.R"/>)</param>
* <param name="Process">Process to perform operation (If the area is process-indipendent use 0 or <see cref="Nc.UNDEF_PROC"/>)</param>
* <param name="MemType">Nc Memory Area. See <see cref="Nc.MEMORY_TYPE"/></param>
* <param name="MemIndex">Starting Index of Memory Area</param>
* <param name="MemBit">Set the Bit to Read-Write. (0..7)</param>
* <param name="Value">Reference to variable to read/Write</param>
* */
public abstract CmsError MEM_RWBoolean(Boolean bWrite, int Process, MEMORY_TYPE MemType, int MemIndex, int MemBit, ref Boolean Value);
/**
* <summary>Read/Write Boolean variable from/into NC Memory Area (including Siemens Nc)
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="bWrite">Set True to Write-operation (Also Allowed <see cref="Nc.W"/>/<see cref="Nc.R"/>)</param>
* <param name="Process">Process to perform operation (If the area is process-indipendent use 0 or <see cref="Nc.UNDEF_PROC"/>)</param>
* <param name="MemType">Nc Memory Area. See <see cref="Nc.MEMORY_TYPE"/></param>
* <param name="MemTable">Siemens Memory Table (Used only in Siemens-Nc)</param>
* <param name="MemIndex">Starting Index of Memory Area</param>
* <param name="MemBit">Set the Bit to Read-Write. (0..7)</param>
* <param name="Value">Reference to variable to read/Write</param>
* */
public abstract CmsError MEM_RWBoolean(Boolean bWrite, int Process, MEMORY_TYPE MemType, int MemTable, int MemIndex, int MemBit, ref Boolean Value);
/**
* <summary>Read/Write Byte variable from/into NC Memory Area
* <para>
* Compatibility: Fanuc | Osai | Demo
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="bWrite">Set True to Write-operation (Also Allowed <see cref="Nc.W"/>/<see cref="Nc.R"/>)</param>
* <param name="Process">Process to perform operation (If the area is process-indipendent use 0 or <see cref="Nc.UNDEF_PROC"/>)</param>
* <param name="MemType">Nc Memory Area. See <see cref="Nc.MEMORY_TYPE"/></param>
* <param name="MemIndex">Starting Index of Memory Area</param>
* <param name="MemByteStart">Set to 1 if the Byte is the second of a WORD (only for OSAI Nc)</param>
* <param name="Value">Reference to variable to read/Write</param>
* */
public abstract CmsError MEM_RWByte(Boolean bWrite, int Process, MEMORY_TYPE MemType, int MemIndex, int MemByte, ref Byte Value);
/**
* <summary>Read/Write Byte variable from/into NC Memory Area (including Siemens Nc)
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="bWrite">Set True to Write-operation (Also Allowed <see cref="Nc.W"/>/<see cref="Nc.R"/>)</param>
* <param name="Process">Process to perform operation (If the area is process-indipendent use 0 or <see cref="Nc.UNDEF_PROC"/>)</param>
* <param name="MemType">Nc Memory Area. See <see cref="Nc.MEMORY_TYPE"/></param>
* <param name="MemTable">Siemens Memory Table (Used only in Siemens-Nc)</param>
* <param name="MemIndex">Starting Index of Memory Area</param>
* <param name="MemByteStart">Set to 1 if the Byte is the second of a WORD (only for OSAI Nc)</param>
* <param name="Value">Reference to variable to read/Write</param>
* */
public abstract CmsError MEM_RWByte(Boolean bWrite, int Process, MEMORY_TYPE MemType, int MemTable, int MemIndex, int MemByte, ref Byte Value);
/**
* <summary>Read/Write unsigned 2 Byte (NC: Word:, .NET: ushort) variable from/into NC Memory Area
* <para>
* Compatibility: Fanuc | Osai | Demo
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="bWrite">Set True to Write-operation (Also Allowed <see cref="Nc.W"/>/<see cref="Nc.R"/>)</param>
* <param name="Process">Process to perform operation (If the area is process-indipendent use 0 or <see cref="Nc.UNDEF_PROC"/>)</param>
* <param name="MemType">Nc Memory Area. See <see cref="Nc.MEMORY_TYPE"/></param>
* <param name="MemIndex">Starting Index of Memory Area</param>
* <param name="Number">Number of sequential data Read/Write. (Used only in Reading Operation)</param>
* <param name="Value">List of values to read/Write</param>
* */
public abstract CmsError MEM_RWWord(Boolean bWrite, int Process, MEMORY_TYPE MemType, int MemIndex, ref ushort Value);
/**
* <summary>Read/Write unsigned 2 Byte (NC: Word:, .NET: ushort) variable from/into NC Memory Area (including Siemens Nc)
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="bWrite">Set True to Write-operation (Also Allowed <see cref="Nc.W"/>/<see cref="Nc.R"/>)</param>
* <param name="Process">Process to perform operation (If the area is process-indipendent use 0 or <see cref="Nc.UNDEF_PROC"/>)</param>
* <param name="MemType">Nc Memory Area. See <see cref="Nc.MEMORY_TYPE"/></param>
* <param name="MemTable">Siemens Memory Table (Used only in Siemens-Nc)</param>
* <param name="MemIndex">Starting Index of Memory Area</param>
* <param name="Number">Number of sequential data Read/Write. (Used only in Reading Operation)</param>
* <param name="Value">List of values to read/Write</param>
* */
public abstract CmsError MEM_RWWord(Boolean bWrite, int Process, MEMORY_TYPE MemType, int MemTable, int MemIndex, ref ushort Value);
/**
* <summary>Read/Write signed 2 Byte (NC: Word:, .NET: short) variable from/into NC Memory Area
* <para>
* Compatibility: Fanuc | Osai | Demo
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="bWrite">Set True to Write-operation (Also Allowed <see cref="Nc.W"/>/<see cref="Nc.R"/>)</param>
* <param name="Process">Process to perform operation (If the area is process-indipendent use 0 or <see cref="Nc.UNDEF_PROC"/>)</param>
* <param name="MemType">Nc Memory Area. See <see cref="Nc.MEMORY_TYPE"/></param>
* <param name="MemIndex">Starting Index of Memory Area</param>
* <param name="Number">Number of sequential data Read/Write. (Used only in Reading Operation)</param>
* <param name="Value">List of values to read/Write</param>
* */
public abstract CmsError MEM_RWShort(Boolean bWrite, int Process, MEMORY_TYPE MemType, int MemIndex, ref short Value);
/**
* <summary>Read/Write signed 2 Byte (NC: Word:, .NET: short) variable from/into NC Memory Area (including Siemens Nc)
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="bWrite">Set True to Write-operation (Also Allowed <see cref="Nc.W"/>/<see cref="Nc.R"/>)</param>
* <param name="Process">Process to perform operation (If the area is process-indipendent use 0 or <see cref="Nc.UNDEF_PROC"/>)</param>
* <param name="MemType">Nc Memory Area. See <see cref="Nc.MEMORY_TYPE"/></param>
* <param name="MemTable">Siemens Memory Table (Used only in Siemens-Nc)</param>
* <param name="MemIndex">Starting Index of Memory Area</param>
* <param name="Number">Number of sequential data Read/Write. (Used only in Reading Operation)</param>
* <param name="Value">List of values to read/Write</param>
* */
public abstract CmsError MEM_RWShort(Boolean bWrite, int Process, MEMORY_TYPE MemType, int MemTable, int MemIndex, ref short Value);
/**
* <summary>Read/Write signed 4 Byte (NC: DWord:, .NET: uint) variable from/into NC Memory Area
* <para>
* Compatibility: Fanuc | Osai | Demo
* </para>uW
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="bWrite">Set True to Write-operation (Also Allowed <see cref="Nc.W"/>/<see cref="Nc.R"/>)</param>
* <param name="Process">Process to perform operation (If the area is process-indipendent use 0 or <see cref="Nc.UNDEF_PROC"/>)</param>
* <param name="MemType">Nc Memory Area. See <see cref="Nc.MEMORY_TYPE"/></param>
* <param name="MemIndex">Starting Index of Memory Area</param>
* <param name="Number">Number of sequential data Read/Write. (Used only in Reading Operation)</param>
* <param name="Value">List of values to read/Write</param>
* */
public abstract CmsError MEM_RWDWord(Boolean bWrite, int Process, MEMORY_TYPE MemType, int MemIndex, ref uint Value);
/**
* <summary>Read/Write signed 4 Byte (NC: DWord:, .NET: uint) variable from/into NC Memory Area (including Siemens Nc)
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>uW
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="bWrite">Set True to Write-operation (Also Allowed <see cref="Nc.W"/>/<see cref="Nc.R"/>)</param>
* <param name="Process">Process to perform operation (If the area is process-indipendent use 0 or <see cref="Nc.UNDEF_PROC"/>)</param>
* <param name="MemType">Nc Memory Area. See <see cref="Nc.MEMORY_TYPE"/></param>
* <param name="MemTable">Siemens Memory Table (Used only in Siemens-Nc)</param>
* <param name="MemIndex">Starting Index of Memory Area</param>
* <param name="Number">Number of sequential data Read/Write. (Used only in Reading Operation)</param>
* <param name="Value">List of values to read/Write</param>
* */
public abstract CmsError MEM_RWDWord(Boolean bWrite, int Process, MEMORY_TYPE MemType, int MemTable, int MemIndex, ref uint Value);
/**
* <summary>Read/Write signed 4 Byte (NC: DWord:, .NET: int) variable from/into NC Memory Area
* <para>
* Compatibility: Fanuc | Osai | Demo
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="bWrite">Set True to Write-operation (Also Allowed <see cref="Nc.W"/>/<see cref="Nc.R"/>)</param>
* <param name="Process">Process to perform operation (If the area is process-indipendent use 0 or <see cref="Nc.UNDEF_PROC"/>)</param>
* <param name="MemType">Nc Memory Area. See <see cref="Nc.MEMORY_TYPE"/></param>
* <param name="MemIndex">Starting Index of Memory Area</param>
* <param name="Number">Number of sequential data Read/Write. (Used only in Reading Operation)</param>
* <param name="Value">List of values to read/Write</param>
* */
public abstract CmsError MEM_RWInteger(Boolean bWrite, int Process, MEMORY_TYPE MemType, int MemIndex, ref int Value);
/**
* <summary>Read/Write signed 4 Byte (NC: DWord:, .NET: int) variable from/into NC Memory Area (including Siemens Nc)
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="bWrite">Set True to Write-operation (Also Allowed <see cref="Nc.W"/>/<see cref="Nc.R"/>)</param>
* <param name="Process">Process to perform operation (If the area is process-indipendent use 0 or <see cref="Nc.UNDEF_PROC"/>)</param>
* <param name="MemType">Nc Memory Area. See <see cref="Nc.MEMORY_TYPE"/></param>
* <param name="MemTable">Siemens Memory Table (Used only in Siemens-Nc)</param>
* <param name="MemIndex">Starting Index of Memory Area</param>
* <param name="Number">Number of sequential data Read/Write. (Used only in Reading Operation)</param>
* <param name="Value">List of values to read/Write</param>
* */
public abstract CmsError MEM_RWInteger(Boolean bWrite, int Process, MEMORY_TYPE MemType, int MemTable, int MemIndex, ref int Value);
#endregion MEMORY Low-level function: single valiable in memory (to override)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#region NC Low-level function: variables List in memory (to override)
/**
* <summary>Read/Write List of Byte from/into NC Memory Area
* <para>
* Compatibility: Fanuc | Osai | Demo
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="bWrite">Set True to Write-operation (Also Allowed <see cref="Nc.W"/>/<see cref="Nc.R"/>)</param>
* <param name="Process">Process to perform operation (If the area is process-indipendent use 0 or <see cref="Nc.UNDEF_PROC"/>)</param>
* <param name="MemType">Nc Memory Area. See <see cref="Nc.MEMORY_TYPE"/></param>
* <param name="MemIndex">Starting Index of Memory Area</param>
* <param name="MemByteStart">Set to 1 if the starting Byte is the second of a WORD (only for OSAI Nc)</param>
* <param name="Number">Number of sequential data Read/Write. (Used only in Reading Operation)</param>
* <param name="Value">List of values to read/Write</param>
* */
public abstract CmsError MEM_RWByteList(Boolean bWrite, int Process, MEMORY_TYPE MemType, int MemIndex, int MemByteStart, int Number, ref List<Byte> Value);
/**
* <summary>Read/Write List of Byte from/into NC Memory Area (including Siemens Nc)
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="bWrite">Set True to Write-operation (Also Allowed <see cref="Nc.W"/>/<see cref="Nc.R"/>)</param>
* <param name="Process">Process to perform operation (If the area is process-indipendent use 0 or <see cref="Nc.UNDEF_PROC"/>)</param>
* <param name="MemType">Nc Memory Area. See <see cref="Nc.MEMORY_TYPE"/></param>
* <param name="MemTable">Siemens Memory Table (Used only in Siemens-Nc)</param>
* <param name="MemIndex">Starting Index of Memory Area</param>
* <param name="MemByteStart">Set to 1 if the starting Byte is the second of a WORD (only for OSAI Nc)</param>
* <param name="Number">Number of sequential data Read/Write. (Used only in Reading Operation)</param>
* <param name="Value">List of values to read/Write</param>
* */
public abstract CmsError MEM_RWByteList(Boolean bWrite, int Process, MEMORY_TYPE MemType, int MemTable, int MemIndex, int MemByteStart, int Number, ref List<Byte> Value);
/**
* <summary>Read/Write List of unsigned 2 Byte (NC: Word:, .NET: ushort) from/into NC Memory Area
* <para>
* Compatibility: Fanuc | Osai | Demo
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="bWrite">Set True to Write-operation (Also Allowed <see cref="Nc.W"/>/<see cref="Nc.R"/>)</param>
* <param name="Process">Process to perform operation (If the area is process-indipendent use 0 or <see cref="Nc.UNDEF_PROC"/>)</param>
* <param name="MemType">Nc Memory Area. See <see cref="Nc.MEMORY_TYPE"/></param>
* <param name="MemIndex">Starting Index of Memory Area</param>
* <param name="Number">Number of sequential data Read/Write. (Used only in Reading Operation)</param>
* <param name="Value">List of values to read/Write</param>
* */
public abstract CmsError MEM_RWWordList(Boolean bWrite, int Process, MEMORY_TYPE MemType, int MemIndex, int Number, ref List<ushort> Value);
/**
* <summary>Read/Write List of unsigned 2 Byte (NC: Word:, .NET: ushort) from/into NC Memory Area (including Siemens Nc)
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="bWrite">Set True to Write-operation (Also Allowed <see cref="Nc.W"/>/<see cref="Nc.R"/>)</param>
* <param name="Process">Process to perform operation (If the area is process-indipendent use 0 or <see cref="Nc.UNDEF_PROC"/>)</param>
* <param name="MemType">Nc Memory Area. See <see cref="Nc.MEMORY_TYPE"/></param>
* <param name="MemTable">Siemens Memory Table (Used only in Siemens-Nc)</param>
* <param name="MemIndex">Starting Index of Memory Area</param>
* <param name="Number">Number of sequential data Read/Write. (Used only in Reading Operation)</param>
* <param name="Value">List of values to read/Write</param>
* */
public abstract CmsError MEM_RWWordList(Boolean bWrite, int Process, MEMORY_TYPE MemType, int MemTable, int MemIndex, int Number, ref List<ushort> Value);
/**
* <summary>Read/Write List of signed 2 Byte (NC: Word:, .NET: short) from/into NC Memory Area
* <para>
* Compatibility: Fanuc | Osai | Demo
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="bWrite">Set True to Write-operation (Also Allowed <see cref="Nc.W"/>/<see cref="Nc.R"/>)</param>
* <param name="Process">Process to perform operation (If the area is process-indipendent use 0 or <see cref="Nc.UNDEF_PROC"/>)</param>
* <param name="MemType">Nc Memory Area. See <see cref="Nc.MEMORY_TYPE"/></param>
* <param name="MemIndex">Starting Index of Memory Area</param>
* <param name="Number">Number of sequential data Read/Write. (Used only in Reading Operation)</param>
* <param name="Value">List of values to read/Write</param>
* */
public abstract CmsError MEM_RWShortList(Boolean bWrite, int Process, MEMORY_TYPE MemType, int MemIndex, int Number, ref List<short> Value);
/**
* <summary>Read/Write List of signed 2 Byte (NC: Word:, .NET: short) from/into NC Memory Area (including Siemens Nc)
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="bWrite">Set True to Write-operation (Also Allowed <see cref="Nc.W"/>/<see cref="Nc.R"/>)</param>
* <param name="Process">Process to perform operation (If the area is process-indipendent use 0 or <see cref="Nc.UNDEF_PROC"/>)</param>
* <param name="MemType">Nc Memory Area. See <see cref="Nc.MEMORY_TYPE"/></param>
* <param name="MemTable">Siemens Memory Table (Used only in Siemens-Nc)</param>
* <param name="MemIndex">Starting Index of Memory Area</param>
* <param name="Number">Number of sequential data Read/Write. (Used only in Reading Operation)</param>
* <param name="Value">List of values to read/Write</param>
* */
public abstract CmsError MEM_RWShortList(Boolean bWrite, int Process, MEMORY_TYPE MemType, int MemTable, int MemIndex, int Number, ref List<short> Value);
/**
* <summary>Read/Write List of unsigned 4 Byte (NC: DWord:, .NET: uint) from/into NC Memory Area
* <para>
* Compatibility: Fanuc | Osai | Demo
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="bWrite">Set True to Write-operation (Also Allowed <see cref="Nc.W"/>/<see cref="Nc.R"/>)</param>
* <param name="Process">Process to perform operation (If the area is process-indipendent use 0 or <see cref="Nc.UNDEF_PROC"/>)</param>
* <param name="MemType">Nc Memory Area. See <see cref="Nc.MEMORY_TYPE"/></param>
* <param name="MemIndex">Starting Index of Memory Area</param>
* <param name="Number">Number of sequential data Read/Write. (Used only in Reading Operation)</param>
* <param name="Value">List of values to read/Write</param>
* */
public abstract CmsError MEM_RWDWordList(Boolean bWrite, int Process, MEMORY_TYPE MemType, int MemIndex, int Number, ref List<uint> Value);
/**
* <summary>Read/Write List of unsigned 4 Byte (NC: DWord:, .NET: uint) from/into NC Memory Area (including Siemens Nc)
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="bWrite">Set True to Write-operation (Also Allowed <see cref="Nc.W"/>/<see cref="Nc.R"/>)</param>
* <param name="Process">Process to perform operation (If the area is process-indipendent use 0 or <see cref="Nc.UNDEF_PROC"/>)</param>
* <param name="MemType">Nc Memory Area. See <see cref="Nc.MEMORY_TYPE"/></param>
* <param name="MemTable">Siemens Memory Table (Used only in Siemens-Nc)</param>
* <param name="MemIndex">Starting Index of Memory Area</param>
* <param name="Number">Number of sequential data Read/Write. (Used only in Reading Operation)</param>
* <param name="Value">List of values to read/Write</param>
* */
public abstract CmsError MEM_RWDWordList(Boolean bWrite, int Process, MEMORY_TYPE MemType, int MemTable, int MemIndex, int Number, ref List<uint> Value);
/**
* <summary>Read/Write List of signed 4 Byte (NC: DWord:, .NET: int) from/into NC Memory Area
* <para>
* Compatibility: Fanuc | Osai | Demo
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="bWrite">Set True to Write-operation (Also Allowed <see cref="Nc.W"/>/<see cref="Nc.R"/>)</param>
* <param name="Process">Process to perform operation (If the area is process-indipendent use 0 or Nc.<see cref="Nc.UNDEF_PROC"/>)</param>
* <param name="MemType">Nc Memory Area. See <see cref="Nc.MEMORY_TYPE"/></param>
* <param name="MemIndex">Starting Index of Memory Area</param>
* <param name="Number">Number of sequential data Read/Write. (Used only in Reading Operation)</param>
* <param name="Value">List of values to read/Write</param>
* */
public abstract CmsError MEM_RWIntegerList(Boolean bWrite, int Process, MEMORY_TYPE MemType, int MemIndex, int Number, ref List<int> Value);
/**
* <summary>Read/Write List of signed 4 Byte (NC: DWord:, .NET: int) from/into NC Memory Area (including Siemens Nc)
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="bWrite">Set True to Write-operation (Also Allowed <see cref="Nc.W"/>/<see cref="Nc.R"/>)</param>
* <param name="Process">Process to perform operation (If the area is process-indipendent use 0 or Nc.<see cref="Nc.UNDEF_PROC"/>)</param>
* <param name="MemType">Nc Memory Area. See <see cref="Nc.MEMORY_TYPE"/></param>
* <param name="MemTable">Siemens Memory Table (Used only in Siemens-Nc)</param>
* <param name="MemIndex">Starting Index of Memory Area</param>
* <param name="Number">Number of sequential data Read/Write. (Used only in Reading Operation)</param>
* <param name="Value">List of values to read/Write</param>
* */
public abstract CmsError MEM_RWIntegerList(Boolean bWrite, int Process, MEMORY_TYPE MemType, int MemTable, int MemIndex, int Number, ref List<int> Value);
#endregion NC Low-level function: variables List in memory (to override)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#region File Management (To override)
/**
* <summary>Read a Part Program by path and name
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="partProgramPath">Path of the Part Program stored in the Nc</param>
* <param name="partProgramLocalName">Name of the Part Program and name of new local file</param>
* <param name="localFile">Reference to the new local file where the NC Part Program data will be saved</param>
* */
public abstract CmsError FILES_RProgramToFile(string partProgramPath, FileStream localFile);
/**
* <summary>Write/Overwrite a Part Program by path and name
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="partProgramPath">Path of the Part Program stored in the Nc</param>
* <param name="localFile">Reference to the local Part Program file</param>
* */
public abstract CmsError FILES_WProgramFromFile(string partProgramPath, FileStream localFile);
/**
* <summary>Copy a Part Program into another path
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="partProgramPath">Path where the Part Program is saved in the NC</param>
* <param name="newPartProgramPath">Path of the copy Part Program destination</param>
* <param name="failIfExist"></param>
* */
public abstract CmsError FILES_CopyProgram(string partProgramPath, string newPartProgramPath, bool failIfExist);
/**
* <summary>Delete a Nc Part Program
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="partProgramPath">Path where the Nc Part Program is saved in the NC</param>
* <param name="partProgramName">Name of the Part Program file</param>
* */
public abstract CmsError FILES_DeleteProgram(string partProgramPath, string partProgramName);
#endregion File Management (To override)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#region Tool Table
/**
* <summary>Read tool table configuration
* <para>
* Compatibility: Fanuc | Osai | Demo | Siemens
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="config">Reference to the tool table configuration data</param>
**/
public abstract CmsError TOOLS_RConfiguration(ref ToolTableConfiguration config);
/**
* <summary>Read tool table data
* <para>
* Compatibility: Siemens
* </para>
* </summary>
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
* <param name="config">Reference to the tool table data object</param>
**/
public abstract CmsError TOOLS_RToolsData(ref List<SiemensToolModel> toolTable);
public abstract CmsError TOOLS_RShanksData(ref List<ShankModel> shanksData);
public abstract CmsError TOOLS_RFamilyData(ref List<FamilyModel> families);
public abstract CmsError TOOLS_RMagazinePositions(ref List<PositionsModel> positions);
public abstract CmsError TOOLS_WAddTool(ref SiemensToolModel tool);
public abstract CmsError TOOLS_WAddFamily(ref FamilyModel family);
public abstract CmsError TOOLS_WAddShank(ref ShankModel shank);
public abstract CmsError TOOLS_WUpdateFamilyData(string oldName, string newName);
public abstract CmsError TOOLS_WUpdatePositions(PositionsModel position);
public abstract CmsError TOOLS_WUpdateTool(SiemensToolModel tool);
public abstract CmsError TOOLS_WDeleteTool(int id);
public abstract CmsError TOOLS_WDeleteShank(int id);
public abstract CmsError TOOLS_WDeleteFamily(string name);
public abstract CmsError TOOLS_WDeleteEdge(int toolId, int edgeId);
public abstract CmsError TOOLS_WAddEdge(int toolId, ref EdgeModel edge);
public abstract CmsError TOOLS_WUpdateEdge(int toolId, ref EdgeModel newEdge);
public abstract CmsError TOOLS_WUpdateShank(ref ShankModel shank);
public abstract CmsError TOOLS_RMagazineTools(int magazineId, ref List<MagazineAndToolModel> magazinePos);
public abstract CmsError TOOLS_RAvailableTools(ref List<MountedMultiToolModel> multiTools, ref List<MountedToolModel> tools);
public abstract CmsError TOOLS_WUpdateMagazineTools(int magazine, List<NewToolInMagazineModel> newMagazine);
#endregion Tool Table
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#region CONSTANTS (Struct and Enum are Static for definition)
// Read Write type
/** <summary>Write action</summary> */
public const Boolean W = true;
/** <summary>Read action</summary> */
public const Boolean R = false;
/** <summary>Not-Defined Process</summary> */
public const ushort UNDEF_PROC = 0;
// R-W MEMORY Type
/** <summary>Nc Memory Type (Table)</summary> */
public enum MEMORY_TYPE
{
/** <summary>Null Type</summary> */
Null = -1,
///////////////////////////////////////////////////////////////////
//Fanuc Memory Type
/** <summary>Fanuc G Area</summary> */
Fanuc_G = 0,
/** <summary>Fanuc F Area</summary> */
Fanuc_F = 1,
/** <summary>Fanuc Y Area</summary> */
Fanuc_Y = 2,
/** <summary>Fanuc X Area</summary> */
Fanuc_X = 3,
/** <summary>Fanuc A Area</summary> */
Fanuc_A = 4,
/** <summary>Fanuc R Area</summary> */
Fanuc_R = 5,
/** <summary>Fanuc T Area</summary> */
Fanuc_T = 6,
/** <summary>Fanuc K Area</summary> */
Fanuc_K = 7,
/** <summary>Fanuc C Area</summary> */
Fanuc_C = 8,
/** <summary>Fanuc D Area</summary> */
Fanuc_D = 9,
/** <summary>Fanuc M Area</summary> */
Fanuc_M = 10,
/** <summary>Fanuc N Area</summary> */
Fanuc_N = 11,
/** <summary>Fanuc E Area</summary> */
Fanuc_E = 12,
/** <summary>Fanuc Z Area</summary> */
Fanuc_Z = 13,
/** <summary>Fanuc CM Area</summary> */
Fanuc_CM = 100,
///////////////////////////////////////////////////////////////////
//Osai Memory Type
/** <summary>Osai I Area</summary> */
Osai_I = 0,
/** <summary>Osai O Area</summary> */
Osai_O = 1,
/** <summary>Osai MW Area</summary> */
Osai_MW = 20,
/** <summary>Osai GW Area</summary> */
Osai_GW = 21,
/** <summary>Osai SW Area</summary> */
Osai_SW = 22,
/** <summary>Osai PW Area</summary> */
Osai_PW = 62,
/** <summary>Osai UW Area</summary> */
Osai_UW = 63,
/** <summary>Osai MD Area</summary> */
Osai_MD = 40,
/** <summary>Osai GD Area</summary> */
Osai_GD = 41,
/** <summary>Osai SD Area</summary> */
Osai_SD = 42,
/** <summary>Osai PD Area</summary> */
Osai_PD = 43,
/** <summary>Osai UD Area</summary> */
Osai_UD = 44,
/** <summary>Osai L Area</summary> */
Osai_L = 145,
/** <summary>Osai LS Area</summary> */
Osai_LS = 18,
/** <summary>Osai AA Area</summary> */
Osai_AA = 28,
/** <summary>Osai A Area</summary> */
Osai_A = 45,
/** <summary>Osai SC Area</summary> */
Osai_SC = 50,
/** <summary>Osai SYMO Area</summary> */
Osai_SYMO = 102,
///////////////////////////////////////////////////////////////////
//Siemens Memory Type,
/** <summary>Siemens DB</summary> */
Siemens_DB = 0,
///////////////////////////////////////////////////////////////////
// Demo memory type
/**<summary>Demo default memory</summary> **/
Demo = 0
};
// 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
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 CONSTANTS (Struct and Enum are Static for definition)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#region Fixed memory area
//Lingua CN
internal MEMORY_CELL PARAM_LING_FANUC = new MEMORY_CELL(MEMORY_TYPE.Null, 3281, 0, 1);
//Matricola Macchina
internal MEMORY_CELL MATR_MACCH_OSAI = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 3403, 0, 1);
internal MEMORY_CELL MATR_MACCH_FANUC = new MEMORY_CELL(MEMORY_TYPE.Fanuc_D, 4018, 0, 1);
internal MEMORY_CELL MATR_MACCH_SIEMENS = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, 255, 0, 1);
//Messaggi PLC
internal MEMORY_CELL PLC_MESS_OSAI = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12000, 0, 64);
#endregion Fixed memory area
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#region Helper Function
internal void AddNcAlarmToList(uint id, string message, List<AlarmModel> alarms)
{
alarms.Add(new AlarmModel()
{
Id = id,
Message = message,
IsWarning = false,
Process = 0
});
}
internal void AddAlarmToList(uint id, string message, int process, List<AlarmModel> alarms)
{
alarms.Add(new AlarmModel()
{
Id = id,
Message = message,
IsWarning = false,
Process = process
});
}
internal void AddPlcAlarmsToList(uint id, bool isWaring, bool restorationIsActive, List<int> processes, List<PlcAlarmModel> alarms)
{
alarms.Add(new PlcAlarmModel()
{
Id = id,
IsWarning = isWaring,
RestorationIsActive = restorationIsActive,
Process = processes
});
}
#endregion Helper Function
}
}