using CMS_CORE_Library.Models; using System; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Reflection; using static CMS_CORE_Library.Models.DataStructures; using static CMS_CORE_Library.Nc; namespace CMS_CORE_Library { public abstract partial class NcThermo { //Private Global Variables internal bool Connected; internal string Ip; internal ushort Port; internal bool UseProxy; internal string LibName = "CMS_CORE_Library.dll"; /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #region LIB Methods /** * * Get the NC IP-Address * * Compatibility: Fanuc | Osai | Demo * * * */ public string LIB_GetIpAddress() { return Ip; } /** * * Set the NC IP-Address * * Compatibility: Fanuc | Osai | Demo * * * */ public void LIB_SetIpAddress(string ip) { Ip = ip; } /** * * Get Nc Port * * Compatibility: Fanuc | Osai | Demo * * * */ public ushort LIB_GetPort() { return Port; } /** * * Set Nc Port * * Compatibility: Fanuc | Osai | Demo * * * */ public void LIB_SetPort(ushort port) { Port = port; } /** * * Get Library Version * * Compatibility: Fanuc | Osai | Demo | Siemens * * * */ public string LIB_GetLibraryVersion() { return FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).ProductVersion.ToString(); } #endregion LIB Methods /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #region NC High-level data (to override) /** * * Connect the NC * * Compatibility: Fanuc | Osai | Demo | Siemens * * Returns an error when an internal or a library error occours * * */ public abstract CmsError NC_Connect(); /** * * Disconnect the NC * * Compatibility: Fanuc | Osai | Demo | Siemens * * Returns an error when an internal or a library error occours * * */ public abstract CmsError NC_Disconnect(); /** * * Read Nc Status * * Compatibility: Fanuc | Osai | Demo | Siemens * * * Returns an error when an internal or a library error occours * */ public bool NC_IsConnected() { return Connected; } /** * * Read actual time of the NC-Software (sometimes it can be different from NC-Operative-System) * * Compatibility: Fanuc | Osai | Demo | Siemens * * * Returns an error when an internal or a library error occours * Reference of a DateTime Variable where data will be saved * */ public abstract CmsError NC_RDateTime(ref DateTime ActualTime); /** * * Read Vendor NC Serial number * * Compatibility: Fanuc | Osai | Demo | Siemens * * * Returns an error when an internal or a library error occours * Reference of a String Variable where data will be saved * */ public abstract CmsError NC_RSerialNumber(ref string SN); /** * * Read Model name of the NC * * Compatibility: Fanuc | Osai | Demo | Siemens * * * Returns an error when an internal or a library error occours * Reference of a String Variable where data will be saved * */ public abstract CmsError NC_RModelName(ref string ModelName); /** * * Read Software Version of the Nc * * Compatibility: Fanuc | Osai | Demo | Siemens * * * Returns an error when an internal or a library error occours * Reference of a String Variable where data will be saved * */ public abstract CmsError NC_RSoftwareVersion(ref string SWV); /** * * Read CMS Serial number of the Machine * * Compatibility: Fanuc | Osai | Demo | Siemens * * * Returns an error when an internal or a library error occours * Reference of a String Variable where data will be saved * */ public abstract CmsError NC_RMachineNumber(bool hasLetters, ref string MachNumber); /** * * Read number of configured Processes/Paths * * Compatibility: Fanuc | Osai | Demo | Siemens * * * Returns an error when an internal or a library error occours * Reference of a ushort Variable where data will be saved * */ public abstract CmsError NC_RProcessesNum(ref ushort ProcNumber); /** * * Read the configured language of the NC * * Compatibility: Fanuc | Osai | Demo | Siemens * * * Returns an error when an internal or a library error occours * Reference of a CultureInfo Variable where data will be saved * */ public abstract CmsError NC_RLanguage(ref CultureInfo Language); /** * * Write the configured language of the NC * * Compatibility: Fanuc | Osai | Demo | Siemens * * * Returns an error when an internal or a library error occours * CultureInfo Variable with the new Language * */ public abstract CmsError NC_WLanguage(CultureInfo Language); /** * * Read active alarms of the NC (Nc-Process indipendent). For OSAI Nc the list can contain only one Message * * Compatibility: Fanuc | Osai | Demo | Siemens * * * Returns an error 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 CmsError NC_RActiveAlarms(ref List alarms); /** * * Check if the NC is in running state * * Compatibility: Fanuc | Osai | Demo | Siemens * * * Returns an error when an internal or a library error occours * Reference to boolean where running state will be saved * */ public abstract CmsError NC_RIsRunning(ref bool running); public abstract CmsError NC_GetTranslatedPlcMessages(string language, ref Dictionary messages); public abstract CmsError NC_GetTranslatedThermoLabels(string language, ref Dictionary messages); public abstract CmsError NC_GetAvailableLanguages(ref ICollection languages); /** * * Set the screen page visible of the NC * * Compatibility: Fanuc | Siemens * * * Returns an error when an internal or a library error occours * change the screen view in HMI application * */ public abstract CmsError NC_SetScreenVisible(SCREEN_PAGE screen); // Get NC unit of measure public abstract CmsError NC_RUnitOfMeasure(ref string unitOfMeasure); #endregion NC High-level data (to override) /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #region NC Low-level data (to override) /** * Read Boolean Parameter Machine (Not compatible for Axis Parameter (Multiple values in a parameter) * * Compatibility: Fanuc * * * Returns an error 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 * */ public abstract CmsError NC_RParam(short Index, short Bit, ref bool Value); /** * Read Byte Parameter Machine (Not compatible for Axis Parameter (Multiple values in a parameter) * * Compatibility: Fanuc * * * Returns an error when an internal or a library error occours * Index of the parameter * Reference of a variable with Param values * */ public abstract CmsError NC_RParam(short Index, ref byte Value); /** * Read 2 Byte (Short) Parameter Machine (Not compatible for Axis Parameter (Multiple values in a parameter) * * Compatibility: Fanuc * * * Returns an error when an internal or a library error occours * Index of the parameter * Reference of a variable with Param values * */ public abstract CmsError NC_RParam(short Index, ref short Value); /** * Read 4 Byte (Integer) Parameter Machine (Not compatible for Axis Parameter (Multiple values in a parameter) * * Compatibility: Fanuc * * * Returns an error when an internal or a library error occours * Index of the parameter * Reference of a variable with Param values * */ public abstract CmsError NC_RParam(short Index, ref int Value); /** * Read Real Parameter Machine (Not compatible for Axis Parameter (Multiple values in a parameter) * * Compatibility: Fanuc * * * Returns an error when an internal or a library error occours * Index of the parameter * Reference of a variable with Param values * */ public abstract CmsError NC_RParam(short Index, ref double Value); public abstract CmsError NC_WMDICommand(int processId, string mdiString); #endregion NC Low-level data (to override) /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #region PLC High-level data (to override) public abstract CmsError PLC_RWManageWatchdog(); /** * * Read PMC active Messages * * Compatibility: Fanuc | Osai | Demo | Siemens * * * Returns an error when an internal or a library error occours * Reference of a List of String Variables where data will be saved * */ public abstract CmsError PLC_RActiveMessages(ref List Alarms); /** * * Start refresh message procedure * * Compatibility: Fanuc | Osai | Demo | Siemens * * * Returns an error when an internal or a library error occours * Alarm id to refresh * * */ public abstract CmsError PLC_WRefreshMessage(uint id); public abstract CmsError PLC_WRefreshAllMessages(); /** * * Start restore message procedure * * Compatibility: Fanuc | Osai | Demo | Siemens * * * Returns an error when an internal or a library error occours * Alarm id to restore * * */ public abstract CmsError PLC_WRestoreMessage(uint id); /** * * Read the status of the Power on data ( Pre-Power-On / Post-Power-On ) * * Compatibility: Fanuc | Osai | Demo | Siemens * * Returns an error when an internal or a library error occours * * Reference to the structure where the power on data will be saved **/ public abstract CmsError PLC_RPowerOnData(ref PreAndPostPowerOnModel powerOnModel); /** * * Write PowerOn data and status ( Pre-Power-On / Post-Power-On ) * * Compatibility: Fanuc | Osai | Demo | Siemens * * Returns an error when an internal or a library error occours * * Id of the edited power on data * Reference to the value of the power on data **/ public abstract CmsError PLC_WPowerOnData(uint id, bool value); /** * * Read the status of the UI functionality from PLC * * Compatibility: Fanuc | Osai | Demo | Siemens * * Returns an error when an internal or a library error occours * **/ public abstract CmsError PLC_RFunctionAccess(ref List functions); /** * * Read axes reset procedure data from PLC * * Compatibility: Fanuc | Osai | Demo | Siemens * * Returns an error when an internal or a library error occours * Reference to the axes reset procedure data * **/ public abstract CmsError PLC_RAxesResetData(ref AxisResetDataModel axisResetData); /** * * Read machine counters value from PLC * * Compatibility: Fanuc | Osai | Demo | Siemens * * Returns an error when an internal or a library error occours * Reference to the counters data * **/ public abstract CmsError PLC_RMachineCounters(ref List counters); /** * * Reset single machine counter * * Compatibility: Fanuc | Osai | Demo | Siemens * * Returns an error when an internal or a library error occours * number of counter to be zeroed * **/ public abstract CmsError PLC_WResetMachineCounters(uint counter); /** * * Read user softkeys values from PLC * * Compatibility: Fanuc | Osai | Demo | Siemens * * Returns an error when an internal or a library error occours * Reference to the softkey data * **/ public abstract CmsError PLC_RUserSoftKeys(ref List softKeys); /** * * Write user softkey interaction into PLC * * Compatibility: Fanuc | Osai | Demo | Siemens * * Returns an error when an internal or a library error occours * User softkey id * **/ public abstract CmsError PLC_WUserSoftKey(uint id); /** * * Read heads data from PLC * * Compatibility: Fanuc | Osai | Demo | Siemens * * Returns an error when an internal or a library error occours * Recerence to the heads data * Number of heads data that are read * **/ public abstract CmsError PLC_RHeadsData(List heads, int number); /** * * Write head override sign into PLC * * Compatibility: Fanuc | Osai | Demo | Siemens * * Returns an error when an internal or a library error occours * Head id * Type of increment of the override * **/ public abstract CmsError PLC_WHeadOverride(uint id, HEAD_OVERRIDE_SIGN sign); public abstract CmsError PLC_ROperatorInputIsNeeded(ref List value); public abstract CmsError PLC_WOperatorInputResponse(int process, double responseVal); public abstract CmsError PLC_RM154Data(ref List value, ref bool MTCCmd); public abstract CmsError PLC_W154ManageAck(int processId); public abstract CmsError PLC_RM156Data(ref List value); public abstract CmsError PLC_WM156Response(int process, double responseVal); public abstract CmsError PLC_RScadaValue(string memIndex, SCADA_MEM_TYPE memType, ref object value); public abstract CmsError PLC_WScadaValue(string memIndex, SCADA_MEM_TYPE memType, object value); public abstract CmsError PLC_RScadaSiemens(ref List objects); public abstract CmsError PLC_RWorkedTimeHead(int head, ref uint time); public abstract CmsError PLC_WResetWorkedTimeHead(int head); public abstract CmsError PLC_RWorkedTimeMachine(ref uint time); public abstract CmsError PLC_WResetWorkedTimeMachine(uint time); public abstract CmsError PLC_RCandy(ref long value); public abstract CmsError PLC_WCandy(long value); public abstract CmsError PLC_RExpiredCandy(ref bool value); public abstract CmsError PLC_WExpiredCandy(bool value); public abstract CmsError PLC_RActiveClient(ref int clientId); public abstract CmsError PLC_RToolMovement(ref MovementBetweenMagazinesModel toolMovement); public abstract CmsError PLC_WTerminateMovementProcedure(MOVEMENT_RESPONSE resp); #endregion PLC High-level data (to override) /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #region THERMO high level data /// /// Process Status/command words /// /// public abstract CmsError PLC_RStatusCommand(ref List statusCmd); /// /// Process conf request for RISK data /// /// public abstract CmsError PLC_WAckConfRiskRequest(); /// /// Process conf request for FLIR picture request /// /// public abstract CmsError PLC_WAckFlirRequest(); /// /// Process conf request for RECIPE data /// /// public abstract CmsError PLC_WAckConfRecipeRequest(); /// /// Process production info update /// /// public abstract CmsError PLC_WAckProdUpdate(); /// /// Process start prod ack /// /// public abstract CmsError PLC_WAckPzProdStart(); /// /// Process end prod ack /// /// public abstract CmsError PLC_WAckPzProdEnd(); /// /// Process setpointHMI invalidated with ack /// /// public abstract CmsError PLC_WAckSetpointInvalidated(); /// /// Get current LOG Cycle data /// /// /// public abstract CmsError PLC_RLogCycleData(out List currLogCycle); /// /// Get current Axis RT data /// /// /// public abstract CmsError PLC_RAxisRTList(ref Dictionary currAxisRT); /// /// Get current Axis Info data /// /// /// public abstract CmsError PLC_RAxisInfoList(ref Dictionary currAxisInfo); /// /// Get current recipe parameter list /// /// updates only RT parameters (false = update all) /// /// public abstract CmsError PLC_RRecipeParamList(bool onlyRT, ref Dictionary currParamList); /// /// Write recipe updated MULTIPLE parameter /// /// Oggetto parametri da aggiornare (from HMI) /// num max parametri da scrivere singolarmente /// delay in scriottura multi parametri singoli /// public abstract CmsError PLC_WRecipeParameters(Dictionary newParameters, int nMaxParamWrite, int delayParamWrite); /// /// Confirm/Cancel recipe modifications /// /// true: HMI --> PLC, false: PLC --> HMI /// public abstract CmsError PLC_WRecipeEdit(bool confirmUpdate); /// /// Send axis command /// /// ID asse /// Comando (0..15) /// Indica se scrivere la TargetPos /// Posizione target /// public abstract CmsError PLC_WAxisCommand(int AxisNum, uint CommandBit, bool WritePos, double TargetPos); /// /// Send Axes Gen Control /// /// Boolean for advanced mode /// public abstract CmsError PLC_WAxisGeneralControl(bool AdvMode); /// /// Read Axes Gen Control /// /// Boolean for advanced mode /// public abstract CmsError PLC_RAxisGeneralStatus(ref bool AdvMode); /// /// Confirm FLIR image acquired and copied to PLC /// /// public abstract CmsError PLC_WStrFlirAcquired(); /// /// Get current Modules Block list /// /// updates only RT parameters (false = update all) /// /// public abstract CmsError PLC_RModulesBlockList(bool onlyRT, ref Dictionary currModulesBlockList); /// /// Get current Warmers ThermoCam Data /// /// /// public abstract CmsError PLC_RWarmerTCamData(out ThermoModels.ThermoCam currTCamData); /// /// Get current Warmers Channels list /// /// updates only READ parameters (false = update all data) /// /// public abstract CmsError PLC_RWarmerChannelList(bool useCache, ref Dictionary currWarmerChannelList); /// /// Set current Warmers Channels setpoints /// /// /// public abstract CmsError PLC_WWarmerChSetpHmi(Dictionary newData); /// /// Set current Warmers Channels Temperature Set as reference (°C) /// /// /// public abstract CmsError PLC_WWarmerChTCamTempSet(Dictionary newData); /// /// Set current Warmers Channels Thermocam LAST READ value (°C) /// /// /// public abstract CmsError PLC_WWarmerChTCamTempAct(Dictionary newData); /// /// Set current Warmers Channels as enabled/disabled for working with thermo camera data /// /// /// public abstract CmsError PLC_WWarmerChTCamEnab(Dictionary newData); /// /// Set ThermoCamera mode /// /// /// public abstract CmsError PLC_WTCamMode(bool enableTCam); /// /// Set ThermoCamera functionality Active (HMI) /// /// /// public abstract CmsError PLC_WTCamActiv(bool enableTCam); /// /// Set current Warmers Channels reflector's data /// /// /// public abstract CmsError PLC_WWarmerConfRefl(Dictionary newData); /// /// Get current Warmers VU min parameter /// /// /// public abstract CmsError PLC_RWarmerConfVUMin(ref ushort VUmin); /// /// Set current Warmers Channels min current's data /// /// /// public abstract CmsError PLC_WWarmerConfMinCurr(Dictionary newData); /// /// Set current Warmers board enabled /// /// /// public abstract CmsError PLC_WWarmerConfBoardEnabl(Dictionary newData); /// /// Read power gauge data /// /// Compatibility: S7Net /// /// Returns an error when an internal or a library error occours /// /// Reference to the value of the gauge data public abstract CmsError PLC_RGaugeData(ref ThermoModels.LiveProdDataModel gaugeData); /// /// Set Keyboard softkey ID /// /// Softkey ID of the first button /// Softkey ID of the second button /// public abstract CmsError PLC_WKeyboardSoftkey(ushort idKey1, ushort idKey2); /// /// Get current Production Info data /// /// /// public abstract CmsError PLC_RProdInfo(ref ThermoModels.ProdInfoModel currProdInfo); /// /// Set ProdInfo data /// /// Qty requested (target) /// Reset counter (actual counter) /// Number of pre-warm cycle requested /// public abstract CmsError PLC_WProdInfo(short numTarget, bool doReset, short preWarmCycle); /// /// Get current Production Cycle data /// /// /// public abstract CmsError PLC_RProdCycle(ref ThermoModels.ProdCycleModel currProdCycle); /// /// Request for mode selection via strobe /// /// 1: MAN, 2: AUTO, 3: SETUP /// public abstract CmsError PLC_WModeSel(int mode); /// /// Read PLC current IO Channels visibility (conf) /// /// Visibility status for all channels public abstract CmsError PLC_RIOChannelsConf(ref ThermoModels.ChanIOVis currThermoIOVis); /// /// Read PLC current IO Channels VALUES (actual + forced) /// /// Values for channels /// Indicates if values are forced by UI /// Values forced by UI public abstract CmsError PLC_RIOChannelsVal(ref ThermoModels.ChanIOVal currThermoIOVal, ref ThermoModels.ChanIOFor currThermoIOFor, ref ThermoModels.ChanIOValFor currThermoIOValFor); /// /// Write MULTIPLE Digital Out values (+ force) /// /// Oggetto valori da aggiornare (from HMI) /// num max parametri da scrivere singolarmente /// delay in scriottura multi parametri singoli /// public abstract CmsError PLC_W_IO_DO_Val(Dictionary newValues); /// /// Write MULTIPLE Analog Out values (+ force) /// /// Oggetto valori da aggiornare (from HMI) /// num max parametri da scrivere singolarmente /// delay in scriottura multi parametri singoli /// public abstract CmsError PLC_W_IO_AO_Val(Dictionary newValues); /// /// Reset MULTIPLE Digital Out FORCED Status (bitmap) /// /// Oggetto valori da aggiornare (from HMI) /// num max parametri da scrivere singolarmente /// delay in scriottura multi parametri singoli /// public abstract CmsError PLC_W_IO_DO_Reset(Dictionary newValues); /// /// Reset MULTIPLE Digital Out FORCED Status (bitmap) /// /// Oggetto valori da aggiornare (from HMI) /// num max parametri da scrivere singolarmente /// delay in scriottura multi parametri singoli /// public abstract CmsError PLC_W_IO_AO_Reset(Dictionary newValues); /// /// Reset ALL DO / AO forced bitmap /// /// public abstract CmsError PLC_W_IO_ResetAll(); #endregion THERMO high level data /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #region PROCESS (PATH, CHANNEL) data (to override) /** * * Read the actual status of the Process "ProcNumber" * See for information about the PROC_Status type * * Compatibility: Fanuc | Osai | Demo | Siemens * * * Returns an error when an internal or a library error occours * Process number which the data refer * Reference of a PROC_Status Variable where data will be saved * */ public abstract CmsError 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 | Siemens * * * Returns an error when an internal or a library error occours * Process number which the data refer * Reference of a PROC_Mode Variable where data will be saved * */ public abstract CmsError 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 | Siemens * * * Returns an error when an internal or a library error occours * Process number which the data refer * Reference of a List of String Variables where data will be saved * */ public abstract CmsError PROC_RActiveAlarms(ushort procNumber, ref List alarms); /** * * Read actual & Next Lines of active PP * * Compatibility: Fanuc | Osai | Siemens * * * Returns an error when an internal or a library error occours * Process number which the data refer * Reference of a List of String Variables where data will be saved * */ public abstract CmsError PROC_RPPLines(ushort procNumber, ref List Lines); /** * * Read active PP Name * * Compatibility: Fanuc | Osai | Siemens * * * Returns an error when an internal or a library error occours * Process number which the data refer * Reference of a String Variables where data will be saved * */ public abstract CmsError PROC_RSelectedPPName(ushort procNumber, ref string Name); /** * * Read active PP and generic data * * Compatibility: Fanuc | Osai | Siemens * * Process number which the data refer * Reference to part program data structure * **/ public abstract CmsError PROC_RStatusAndData(ushort procNumber, ref ProcessDataModel processData); /** * * Read selected process * * Compatibility: Fanuc | Osai | Siemens * * Reference to the process number selected * **/ public abstract CmsError PROC_RSelectedProcess(ref ushort procNumber); /** * * Change the selected process * * Compatibility: Fanuc | Osai | Siemens * * New selected process number * **/ public abstract CmsError PROC_WSelectProcess(ushort procNumber); /** * * Read additional data of the process * * Compatibility: Fanuc | Osai | Siemens * * Id of the process * **/ public abstract CmsError PROC_RSelectedProcessData(int processId, ref SelectedProcessData processData); /** * * Start assisted tooling * * Compatibility: Fanuc | Osai | Siemens * * **/ public abstract CmsError PLC_WAssistedToolingCmd(ushort toolId, ushort familyId, ushort shankId, ushort magazineId, ushort positionId, ASSISTED_TOOLING_ACTION action); /** * * Read the status of the assisted tooling procedure * * Compatibility: Fanuc | Osai | Siemens * * **/ public abstract CmsError PLC_RAssistedToolingData(ref AssistedToolingModel data); /** * * Manage ack-strobe in order to terminate the assisted tooling procedure * * Compatibility: Fanuc | Osai | Siemens * * **/ public abstract CmsError PLC_WTerminateAssistedToolingProcedure(); #endregion PROCESS (PATH, CHANNEL) data (to override) /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #region AXES data (to override) /// /// Get current Production Info data /// /// /// public abstract CmsError PLC_RAxesMov(ref ThermoModels.AxisRT currProdInfo); /** * * Read the Interpolated position of all axes in Process "ProcNumber" * * Compatibility: Fanuc | Osai | Demo * * * Returns an error 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 CmsError 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 * * * Returns an error 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 CmsError AXES_RProgrPosition(ushort ProcNumber, ref Dictionary Axes); /** * * Read the Machine position of all axes in Process "ProcNumber" * * Compatibility: Fanuc | Osai | Demo * * * Returns an error 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 CmsError AXES_RMachinePosition(ushort ProcNumber, ref Dictionary Axes); /** * * Read the Following-Error of all axes in Process "ProcNumber" * * Compatibility: Osai | Demo * * * Returns an error 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 CmsError AXES_RFollowingError(ushort ProcNumber, ref Dictionary Axes); /** * * Read the Distance-to-go of all axes in Process "ProcNumber" * * Compatibility: Fanuc | Osai | Siemens * * * Returns an error 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 CmsError AXES_RDistanceToGo(ushort ProcNumber, ref Dictionary Axes); /** * * Read the names of the axes in the process * * Compatibility: Fanuc | Osai | Siemens * * * Returns an error when an internal or a library error occours * Process to execute the action * List of data * */ public abstract CmsError AXES_RAxesNames(ushort process, ref List axesData); /** * * Read the selected axes in the selected process * * Compatibility: Fanuc | Osai | Siemens * * * Returns an error when an internal or a library error occours * Id of the selected axis * */ public abstract CmsError AXES_RSelectedAxis(ref byte axisId); /** * * Selected one axis on the selected process * * Compatibility: Fanuc | Osai | Siemens * * * Returns an error when an internal or a library error occours * Id of the axis to be selected * */ public abstract CmsError AXES_WSelectAxis(byte axisId); public abstract CmsError AXES_ROrigin(int numberOfAxes); #endregion AXES data (to override) /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #region MEMORY Low-level function: single valiable in memory (to override) ///Read/Write Boolean variable from/into NC Memory Area (including Siemens Nc) /// ///Compatibility: Fanuc | Osai | Demo | Siemens /// /// ///Returns an error when an internal or a library error occours ///Set True to Write-operation (Also Allowed /) ///Set True if endian swap fix needed ///Process to perform operation (If the area is process-indipendent use 0 or ) ///Nc Memory Area. See ///Siemens Memory Table (Used only in Siemens-Nc) ///Starting Index of Memory Area ///Set the Bit to Read-Write. (0..7) ///Reference to variable to read/Write public abstract CmsError MEM_RWBoolean(bool bWrite, bool fixEndian, int Process, MEMORY_TYPE MemType, int MemTable, int MemIndex, int MemBit, ref bool Value); /// /// Read-Write a SINGLE Byte inside the NC. In writing-mode the field "Number" is not required /// /// R/W mode /// fix endianness /// /// /// /// /// /// /// public abstract CmsError MEM_RWByte(bool bWrite, bool fixEndian, int Process, MEMORY_TYPE MemType, int MemTable, int MemIndex, int MemByte, ref byte Value); /** * Read/Write unsigned 2 Byte (NC: Word:, .NET: ushort) variable from/into NC Memory Area (including Siemens Nc) * * Compatibility: Fanuc | Osai | Demo | Siemens * * * Returns an error 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 * Siemens Memory Table (Used only in Siemens-Nc) * Starting Index of Memory Area * Number of sequential data Read/Write. (Used only in Reading Operation) * List of values to read/Write * */ public abstract CmsError MEM_RWWord(bool bWrite, int Process, MEMORY_TYPE MemType, int MemTable, int MemIndex, ref ushort Value); /** * Read/Write signed 2 Byte (NC: Word:, .NET: short) variable from/into NC Memory Area (including Siemens Nc) * * Compatibility: Fanuc | Osai | Demo | Siemens * * * Returns an error 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 * Siemens Memory Table (Used only in Siemens-Nc) * Starting Index of Memory Area * Number of sequential data Read/Write. (Used only in Reading Operation) * List of values to read/Write * */ public abstract CmsError MEM_RWShort(bool bWrite, int Process, MEMORY_TYPE MemType, int MemTable, int MemIndex, ref short Value); /** * Read/Write signed 4 Byte (NC: DWord:, .NET: uint) variable from/into NC Memory Area (including Siemens Nc) * * Compatibility: Fanuc | Osai | Demo | Siemens * uW * * Returns an error 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 * Siemens Memory Table (Used only in Siemens-Nc) * Starting Index of Memory Area * Number of sequential data Read/Write. (Used only in Reading Operation) * List of values to read/Write * */ public abstract CmsError MEM_RWDWord(bool bWrite, int Process, MEMORY_TYPE MemType, int MemTable, int MemIndex, ref uint Value); /** * Read/Write signed 4 Byte (NC: DWord:, .NET: int) variable from/into NC Memory Area (including Siemens Nc) * * Compatibility: Fanuc | Osai | Demo | Siemens * * * Returns an error 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 * Siemens Memory Table (Used only in Siemens-Nc) * Starting Index of Memory Area * Number of sequential data Read/Write. (Used only in Reading Operation) * List of values to read/Write * */ public abstract CmsError MEM_RWInteger(bool bWrite, int Process, MEMORY_TYPE MemType, int MemTable, int MemIndex, ref int Value); public abstract CmsError MEM_RWDouble(bool bWrite, int process, MEMORY_TYPE memType, int memTable, int memIndex, ref double value); #endregion MEMORY Low-level function: single valiable in memory (to override) /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #region NC Low-level function: variables List in memory (to override) /** * Read/Write List of Byte from/into NC Memory Area (including Siemens Nc) * * Compatibility: Fanuc | Osai | Demo | Siemens * * * Returns an error 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 * Siemens Memory Table (Used only in Siemens-Nc) * 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 CmsError MEM_RWByteList(bool bWrite, int Process, MEMORY_TYPE MemType, int MemTable, 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 (including Siemens Nc) * * Compatibility: Fanuc | Osai | Demo | Siemens * * * Returns an error 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 * Siemens Memory Table (Used only in Siemens-Nc) * Starting Index of Memory Area * Number of sequential data Read/Write. (Used only in Reading Operation) * List of values to read/Write * */ public abstract CmsError MEM_RWWordList(bool bWrite, int Process, MEMORY_TYPE MemType, int MemTable, int MemIndex, int Number, ref List Value); /** * Read/Write List of signed 2 Byte (NC: Word:, .NET: short) from/into NC Memory Area (including Siemens Nc) * * Compatibility: Fanuc | Osai | Demo | Siemens * * * Returns an error 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 * Siemens Memory Table (Used only in Siemens-Nc) * Starting Index of Memory Area * Number of sequential data Read/Write. (Used only in Reading Operation) * List of values to read/Write * */ public abstract CmsError MEM_RWShortList(bool bWrite, int Process, MEMORY_TYPE MemType, int MemTable, int MemIndex, int Number, ref List Value); /** * Read/Write List of unsigned 4 Byte (NC: DWord:, .NET: uint) from/into NC Memory Area (including Siemens Nc) * * Compatibility: Fanuc | Osai | Demo | Siemens * * * Returns an error 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 * Siemens Memory Table (Used only in Siemens-Nc) * Starting Index of Memory Area * Number of sequential data Read/Write. (Used only in Reading Operation) * List of values to read/Write * */ public abstract CmsError MEM_RWDWordList(bool bWrite, int Process, MEMORY_TYPE MemType, int MemTable, int MemIndex, int Number, ref List Value); /** * Read/Write List of signed 4 Byte (NC: DWord:, .NET: int) from/into NC Memory Area (including Siemens Nc) * * Compatibility: Fanuc | Osai | Demo | Siemens * * * Returns an error 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 * Siemens Memory Table (Used only in Siemens-Nc) * Starting Index of Memory Area * Number of sequential data Read/Write. (Used only in Reading Operation) * List of values to read/Write * */ public abstract CmsError MEM_RWIntegerList(bool bWrite, int Process, MEMORY_TYPE MemType, int MemTable, int MemIndex, int Number, ref List Value); /** * Read/Write List of signed 4 Byte (NC: DWord:, .NET: int) from/into NC Memory Area (including Siemens Nc) * * Compatibility: Fanuc | Osai | Demo | Siemens * * * Returns an error 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 * Siemens Memory Table (Used only in Siemens-Nc) * Starting Index of Memory Area * Number of sequential data Read/Write. (Used only in Reading Operation) * List of values to read/Write * */ public virtual CmsError MEM_RWDoubleList(bool bWrite, int process, MEMORY_TYPE memType, int memTable, int memIndex, int Number, ref List value) { return FUNCTION_NOT_ALLOWED_ERROR; } #endregion NC Low-level function: variables List in memory (to override) /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #region File Management (To override) /** * Get file list of a specific path * * Compatibility: Fanuc | Osai | Demo | Siemens * * * Returns an error when an internal or a library error occours * Directory path to read file list * */ public abstract CmsError FILES_RGetFileList(string directoryPath, ref List files); /** * Get file generic informations * * Compatibility: Fanuc | Osai | Demo | Siemens * * * Returns an error when an internal or a library error occours * File path to read file data * */ public abstract CmsError FILES_RGetFileInfo(string filePath, ref InfoFile fileInfo); /** * Set a program, stored in the NC, as active for the process * * Compatibility: Fanuc | Osai | Demo | Siemens * * * Returns an error when an internal or a library error occours * Process where the program is going to be activated * Path of the part program * */ public abstract CmsError FILES_WSetActiveProgram(int processId, string filePath, ref ActiveProgramDataModel data); /** * Deactivate active program on * * Compatibility: Fanuc | Osai | Demo | Siemens * * * Process where the program is going to be deactivated * */ public abstract CmsError FILES_WDeactivateProgram(int processId); /** * Upload program into the NC memory * * Compatibility: Fanuc | Osai | Demo | Siemens * * * Local path of the program * New name of the program once has been saved * Path of the program on the Nc memory * */ public abstract CmsError FILES_UploadPartProgram(string localPath, string name, ref string newFilePath); /** * Read active program on data * * Compatibility: Fanuc | Osai | Demo | Siemens * * * Id of the process * */ public abstract CmsError FILES_RActiveProgramData(int processId, ref ActiveProgramDataModel data); /** * Read a Part Program by path and name * * Compatibility: Fanuc | Osai | Demo | Siemens * * * Returns an error 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 CmsError FILES_RProgramToFile(string partProgramPath, FileStream localFile); /** * Write/Overwrite a Part Program by path and name * * Compatibility: Fanuc | Osai | Demo | Siemens * * * Returns an error 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 CmsError FILES_WProgramFromFile(string partProgramPath, FileStream localFile); /** * Copy a Part Program into another path * * Compatibility: Fanuc | Osai | Demo | Siemens * * * Returns an error when an internal or a library error occours * Path where the part program is going to be stored in the NC * Path of the copy Part Program destination * * : Return an error if file exists. * * : Overwrite file if exists * * */ public abstract CmsError FILES_CopyProgram(string partProgramPath, string newPartProgramPath, bool failIfExist); /** * Delete a Nc Part Program * * Compatibility: Fanuc | Osai | Demo | Siemens * * * Returns an error 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 CmsError FILES_DeleteProgram(string partProgramPath, string partProgramName); public abstract CmsError FILES_RQueueData(ref List statusList); public abstract CmsError FILES_RQueueDataByProcess(ref QueueStatusModel status, int processId); public abstract CmsError FILES_WStartQueue(); public abstract CmsError FILES_WStopQueue(); public abstract CmsError FILES_WLoadNextPartProgram(string localPath, string ncFileName); public abstract CmsError FILES_WUploadJobFilesAndActivate(int processId, string jobExtractedPath, string fileToActivate); public abstract CmsError FILES_RGetProgramType(ref PROGRAM_TYPE_ENUM programType); public abstract CmsError FILES_WCleanUploadFolder(); public abstract CmsError FILES_WUploadCustomMainProgramAndActivate(int processId, string customPartProgramContent, ref ActiveProgramDataModel activeData); #endregion File Management (To override) /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #region Tool Table Siemens /** * Read Adatpive Path Step * * Compatibility: Siemens * * * Returns an error when an internal or a library error occours * Reference to the tool table configuration data **/ public abstract CmsError TOOLS_RAdatpivePathStep(ref Byte step); /** * Write Adatpive Path Step * * Compatibility: Siemens * * * Returns an error when an internal or a library error occours * Reference to the tool table configuration data **/ public abstract CmsError TOOLS_WAdatpivePathStep(Byte step); /** * Read tool table configuration * * Compatibility: Siemens * * * Returns an error when an internal or a library error occours * Reference to the tool table configuration data **/ public abstract CmsError TOOLS_RConfiguration(ref ToolTableConfiguration config); /** * Read tools data from NC * * Compatibility: Siemens * * * Returns an error when an internal or a library error occours * Reference to the tools list data object **/ public abstract CmsError TOOLS_RToolsData(ref List toolsData); /** * Read shanks data from NC * * Compatibility: Siemens * * * Returns an error when an internal or a library error occours * Reference to the shank list data object **/ public abstract CmsError TOOLS_RShanksData(ref List shanksData); /** * Read families data * * Compatibility: Siemens * * * Returns an error when an internal or a library error occours * Reference to the tools families data object **/ public abstract CmsError TOOLS_RFamilyData(ref List families); /** * Read magazines positions data from NC * * Compatibility: Siemens * * * Returns an error when an internal or a library error occours * Reference to the tools list data object **/ public abstract CmsError TOOLS_RMagazinePositions(ref List positions); /** * Add a new tool * * Compatibility: Siemens * * * Returns an error when an internal or a library error occours **/ public abstract CmsError TOOLS_WAddTool(ref SiemensToolModel tool); /** * Add a new family * * Compatibility: Siemens * * * Returns an error when an internal or a library error occours **/ public abstract CmsError TOOLS_WAddFamily(ref FamilyModel family); /** * Add a new shank * * Compatibility: Siemens * * * Returns an error when an internal or a library error occours **/ public abstract CmsError TOOLS_WAddShank(ref ShankModel shank); /** * Update family name * * Compatibility: Siemens * * * Returns an error when an internal or a library error occours * Family identifier * New family name value **/ public abstract CmsError TOOLS_WUpdateFamilyData(string oldName, string newName); /** * Update magazine position data * * Compatibility: Siemens * * * Returns an error when an internal or a library error occours * New position data **/ public abstract CmsError TOOLS_WUpdatePosition(PositionModel positionData); /** * Update tool data * * Compatibility: Siemens * * * Returns an error when an internal or a library error occours * New tool data **/ public abstract CmsError TOOLS_WUpdateTool(ref SiemensToolModel toolData); /** * Delete tool * * Compatibility: Siemens * * * Returns an error when an internal or a library error occours * Tool identifier **/ public abstract CmsError TOOLS_WDeleteTool(int id); /** * Delete shank * * Compatibility: Siemens * * * Returns an error when an internal or a library error occours * Shank id **/ public abstract CmsError TOOLS_WDeleteShank(int id); /** * Delete family * * Compatibility: Siemens * * * Returns an error when an internal or a library error occours * Family identifier **/ public abstract CmsError TOOLS_WDeleteFamily(string name); /** * Delete edge * * Compatibility: Siemens * * * Returns an error when an internal or a library error occours * Tool id * Edge id **/ public abstract CmsError TOOLS_WDeleteEdge(int toolId, int edgeId); /** * Add a new edge to tool * * Compatibility: Siemens * * * Returns an error when an internal or a library error occours * Tool id **/ public abstract CmsError TOOLS_WAddEdge(int toolId, ref EdgeModel edge); /** * Update edge * * Compatibility: Siemens * * * Returns an error when an internal or a library error occours * Tool id * New edge data **/ public abstract CmsError TOOLS_WUpdateEdge(int toolId, ref EdgeModel newEdge); /** * Update shank * * Compatibility: Siemens * * * Returns an error when an internal or a library error occours * New shank data **/ public abstract CmsError TOOLS_WUpdateShank(ref ShankModel shankData); /** * Read mounted tool in magazine * * Compatibility: Siemens * * * Returns an error when an internal or a library error occours * Magazine id **/ public abstract CmsError TOOLS_RMountedTools(int magazineId, ref List magazinePos); /** * Read available tools/multitools (not mounted) * * Compatibility: Siemens * * * Returns an error when an internal or a library error occours * Magazine id **/ public abstract CmsError TOOLS_RAvailableTools(ref List multitools, ref List tools); /** * Load a tool in magazine * * Compatibility: Siemens * * * Returns an error when an internal or a library error occours * Magazine id * Object that contains references to position id and tool id **/ public abstract CmsError TOOLS_WLoadToolInMagazine(int magazineId, NewToolInMagazineModel newMagazineTool, ref MountedToolModel newMountedTool); /** * Unload tool from magazine * * Compatibility: Siemens * * * Returns an error when an internal or a library error occours * Magazine id * Position id **/ public abstract CmsError TOOLS_WUnloadToolFromMagazine(int magazineId, int positionId); /** * Load tool into shank * * Compatibility: Siemens * * * Returns an error when an internal or a library error occours * Shank id * Position id * Tool id **/ public abstract CmsError TOOLS_WLoadToolIntoShank(int shankId, int positionId, int toolId); /** * Unload tool from shank * * Compatibility: Siemens * * * Returns an error when an internal or a library error occours * Shank id * Position id **/ public abstract CmsError TOOLS_WUnloadToolFromShank(int shankId, int positionId); /** * Get actual magazine status * * Compatibility: Siemens * * * Returns an error when an internal or a library error occours **/ public abstract CmsError TOOLS_RMagazineAction(ref MagazineActionModel magazineAction); public abstract CmsError TOOLS_WStartTDILoading(ushort magazineId, ushort positionId); public abstract CmsError TOOLS_WStartTDIUnloading(ushort magazineId, ushort positionId, ushort toolId); public abstract CmsError TOOLS_WEmptyBallufTablet(SiemensToolModel tool); public abstract CmsError TOOLS_WEmptyBallufTabletAdditionalData(SiemensToolModel tool); public abstract CmsError TOOLS_WAbortBallufTablet(); #endregion Tool Table Siemens /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #region Nc Tool Manager public abstract CmsError TOOLS_WOptions(ToolManagerOptionsModel options); public abstract CmsError TOOLS_ROffset(short offsetId, ref OffsetModel offset); public abstract CmsError TOOLS_WOffset(short offsetId, ref OffsetModel offset); public abstract CmsError TOOLS_WStartEditData(); public abstract CmsError TOOLS_WStopEditData(); public abstract CmsError TOOLS_WUpdateTools(List list); public abstract CmsError TOOLS_WUpdateFamilies(List list); public abstract CmsError TOOLS_WUpdateShanks(List list); public abstract CmsError TOOLS_WUpdateMagazinePositions(List list); public abstract CmsError TOOLS_WStartEditTooling(int magazineId); public abstract CmsError TOOLS_WStopEditTooling(int magazineId); public abstract CmsError TOOLS_WRestoreBackup(); public abstract CmsError TOOLS_RMagazineConfig(ref List config); public abstract CmsError TOOLS_RUpdatedToolsData(ref Dictionary updatedStatus, ref Dictionary updatedLives, ref Dictionary updatedPresetting, ref Dictionary updatedDressing); public abstract CmsError TOOLS_RStoredData(ref List tools, ref List families, ref List shanks); public abstract CmsError TOOLS_RMagazineBlock(ref List ids); public abstract CmsError TOOLS_WFreeMagazines(); public abstract CmsError TOOLS_RMagazineStatus(ref Dictionary magazineStatus); #endregion Nc Tool Manager /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #region CONSTANTS (Struct and Enum are Static for definition) public const int REFRESH_ALL_ALARMS_SFKEY_INDEX = 2; // Read Write type /** Write action */ public const bool W = true; /** Read action */ public const bool R = false; /** Not-Defined Process */ public const ushort UNDEF_PROC = 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"; internal const string CUSTOM_MAIN_PROGRAM = "ACTIVE_LOADER_{0}"; // 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 = 1024; 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; /** Nc Screen */ public enum SCREEN_PAGE { //Siemens Siemens_Machine = 100, Siemens_Parameter = 101, Siemens_Program = 102, Siemens_ProgramManager = 103, Siemens_Diagnostics = 104, Siemens_Setup = 105, //Fanuc Fanuc_Pos = 200, Fanuc_Prog = 201, Fanuc_Offset = 202, Fanuc_System = 203, Fanuc_Message = 204, Fanuc_MGI = 205, Fanuc_Graph = 206, Fanuc_Custom2 = 207, } #endregion CONSTANTS (Struct and Enum are Static for definition) /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #region Fixed memory area // TODO REMOVE //Lingua CN internal MEMORY_CELL PARAM_LING_FANUC = new MEMORY_CELL(MEMORY_TYPE.Null, 3281, 0, 1); internal MEMORY_CELL PARAM_LING_FANUC_W = new MEMORY_CELL(MEMORY_TYPE.Fanuc_G, 581, 0, 1); #endregion Fixed memory area /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #region Helper Function internal void AddNcAlarmToList(uint id, string message, DateTime dateTime, List alarms) { alarms.Add(new AlarmModel() { Id = id, Message = message, IsWarning = false, Process = 0, DateTime = dateTime }); } internal void AddAlarmToList(int id, short axisId, string message, int process, DateTime dateTime, List alarms) { alarms.Add(new AlarmModel() { Id = Convert.ToUInt32((id & 0xffff) | (axisId << 24)), // Set last byte with axisId in order to have unique ids Message = message, IsWarning = false, Process = process, DateTime = dateTime }); } internal void AddAlarmToList(uint id, string message, int process, List alarms) { alarms.Add(new AlarmModel() { Id = id, Message = message, IsWarning = false, Process = process }); } internal void AddPlcAlarmsToList(uint id, bool isWaring, bool restorationIsActive, List processes, List alarms) { alarms.Add(new PlcAlarmModel() { Id = id, IsWarning = isWaring, RestorationIsActive = restorationIsActive, Process = processes }); } #endregion Helper Function } }