using CncLib.CNC; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace IOB_WIN { /// /// Definizione area memoria SIEMENS /// public class memAreaSiemens { /// /// Indice DB /// public int DbNum = 0; /// /// Tipo Memoria (DBD, DBW...) /// public string tipoMem = ""; /// /// Indice partenza memoria (es DBD0 --> 0) /// public int indiceMem = 0; /// /// Inizializza da un formato stringa /// /// public memAreaSiemens(string strFormat) { string[] memComp = strFormat.Split('.'); int.TryParse(memComp[0].Replace("DB", ""), out DbNum); tipoMem = memComp[1].Substring(2, 1); int.TryParse(memComp[1].Replace("DB", "").Replace(tipoMem, ""), out indiceMem); } } /// /// Definizione area memoria FANUC /// public class memAreaFanuc { /// /// Nome area memoria /// public string areaName; /// /// Indice inizio array /// public int startIdx; /// /// Dimensione array memoria /// public int arraySize; } /// /// Definizione indirizzo memoria FANUC /// public class memAddressFanuc { /// /// Tipo memoria /// public FANUC.MemType mType; /// /// Posizione memoria /// public int mPos; /// /// Tipo valore /// public string vType; /// /// Inizializza da un formato stringa /// /// Stringa TipoMem.Indice.DimMem (es D.1604.DW) public memAddressFanuc(string strFormat) { string[] memComp = strFormat.Split('.'); switch (memComp[0]) { case "A": mType = FANUC.MemType.A; break; case "C": mType = FANUC.MemType.C; break; case "CM": mType = FANUC.MemType.CM; break; case "D": mType = FANUC.MemType.D; break; case "E": mType = FANUC.MemType.E; break; case "F": mType = FANUC.MemType.F; break; case "G": mType = FANUC.MemType.G; break; case "K": mType = FANUC.MemType.K; break; case "M": mType = FANUC.MemType.M; break; case "N": mType = FANUC.MemType.N; break; case "R": mType = FANUC.MemType.R; break; case "T": mType = FANUC.MemType.T; break; case "X": mType = FANUC.MemType.X; break; case "Y": mType = FANUC.MemType.Y; break; case "Z": mType = FANUC.MemType.Z; break; default: break; } int.TryParse(memComp[1], out mPos); vType = memComp[2]; } } }