Fix osai
added Fanuc maxOffset number
This commit is contained in:
@@ -116,12 +116,15 @@ namespace CMS_CORE_Application
|
||||
|
||||
//cmsError = N.PROC_RSelectedProcessData(1, ref selected);
|
||||
|
||||
cmsError = N.PLC_WAssistedToolingCmd(1, 1, 1, 1, 1, ASSISTED_TOOLING_ACTION.UNLOAD);
|
||||
AssistedToolingModel ass = new AssistedToolingModel();
|
||||
cmsError = N.PLC_RAssistedToolingData(ref ass);
|
||||
//cmsError = N.PLC_WAssistedToolingCmd(1, 1, 1, 1, 1, ASSISTED_TOOLING_ACTION.UNLOAD);
|
||||
//AssistedToolingModel ass = new AssistedToolingModel();
|
||||
//cmsError = N.PLC_RAssistedToolingData(ref ass);
|
||||
N.TOOLS_WStartEditData();
|
||||
cmsError = N.PROC_RSelectedProcessData(1, ref selected);
|
||||
File.ReadAllLines("test");
|
||||
|
||||
ProcessDataModel procData = new ProcessDataModel();
|
||||
cmsError = N.PROC_RStatusAndData(1, ref procData);
|
||||
|
||||
sw.Stop();
|
||||
Console.WriteLine(sw.ElapsedMilliseconds);
|
||||
|
||||
|
||||
@@ -2303,7 +2303,7 @@ namespace CMS_CORE_Library.Demo
|
||||
config.MultitoolOptionActive = demoConf.MultitoolOption;
|
||||
config.FamilyOptionActive = demoConf.FamilyOption;
|
||||
config.MagPositionOptionActive = demoConf.MagPositionOption;
|
||||
config.MaxOffsets = 5;
|
||||
config.MaxOffsets = 100;
|
||||
|
||||
// Get magazine status
|
||||
Dictionary<int, bool> magazineStatus = new Dictionary<int, bool>();
|
||||
|
||||
@@ -1494,6 +1494,9 @@ namespace CMS_CORE_Library.Fanuc
|
||||
|
||||
public override CmsError PROC_RSelectedProcessData(int processId, ref SelectedProcessData processData)
|
||||
{
|
||||
if (processId <= 0)
|
||||
return PROC_NOT_FOUND_ERROR;
|
||||
|
||||
short number = 1;
|
||||
ODBGCD odb = new ODBGCD();
|
||||
|
||||
@@ -2961,6 +2964,11 @@ namespace CMS_CORE_Library.Fanuc
|
||||
|
||||
public override CmsError TOOLS_RConfiguration(ref ToolTableConfiguration config)
|
||||
{
|
||||
// Check if the NC is connected
|
||||
CmsError cmsError = CheckConnection();
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
// Set limits
|
||||
config.MaxTools = NC_MAX_TOOL_NUMER;
|
||||
config.MaxEdgesPerTools = NC_MAX_EDGES_PER_TOOL;
|
||||
@@ -2969,9 +2977,6 @@ namespace CMS_CORE_Library.Fanuc
|
||||
config.MaxToolsPerMultitools = NC_MAX_TOOLS_PER_MULTITOOL;
|
||||
|
||||
// Set options
|
||||
//config.MultitoolOptionActive = MULTITOOL_OPTION_ACTIVE;
|
||||
//config.FamilyOptionActive = true;
|
||||
//config.MagPositionOptionActive = true;
|
||||
config.RadiusMetricType = false;
|
||||
|
||||
// Set fields configurations
|
||||
@@ -2981,11 +2986,18 @@ namespace CMS_CORE_Library.Fanuc
|
||||
config.MagazinePosConfiguration = NcMagazinePosFieldsConfig;
|
||||
config.EdgesConfiguration = NcOffsetFieldsConfiguration;
|
||||
config.MagPositionOptionActive = true;
|
||||
config.MaxOffsets = 10;
|
||||
|
||||
// Read max offset number
|
||||
ODBTLINF2 off = new ODBTLINF2();
|
||||
short nReturn = Focas1.cnc_rdtofsinfo2(nLibHandle[0], off);
|
||||
if (nReturn != 0)
|
||||
return GetNcError(nReturn);
|
||||
// Set max offsets number
|
||||
config.MaxOffsets = off.use_no;
|
||||
|
||||
// Setup magazine list
|
||||
List<NcMagazineConfigModel> conf = new List<NcMagazineConfigModel>();
|
||||
CmsError cmsError = TOOLS_RMagazineConfig(ref conf);
|
||||
cmsError = TOOLS_RMagazineConfig(ref conf);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@ namespace CMS_CORE_Library.Osai
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return ManageException(ex);
|
||||
return NOT_CONNECTED_ERROR;
|
||||
}
|
||||
|
||||
return NO_ERROR;
|
||||
@@ -1496,6 +1496,9 @@ namespace CMS_CORE_Library.Osai
|
||||
|
||||
public override CmsError PROC_RSelectedProcessData(int processId, ref SelectedProcessData processData)
|
||||
{
|
||||
if (processId <= 0)
|
||||
return PROC_NOT_FOUND_ERROR;
|
||||
|
||||
CmsError cmsError = CheckConnection();
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
@@ -2752,7 +2755,7 @@ namespace CMS_CORE_Library.Osai
|
||||
config.MagazinePosConfiguration = NcMagazinePosFieldsConfig;
|
||||
config.EdgesConfiguration = NcOffsetFieldsConfiguration;
|
||||
config.MagPositionOptionActive = true;
|
||||
config.MaxOffsets = 10;
|
||||
config.MaxOffsets = 300;
|
||||
|
||||
// Setup magazine list
|
||||
List<NcMagazineConfigModel> conf = new List<NcMagazineConfigModel>();
|
||||
@@ -3011,6 +3014,10 @@ namespace CMS_CORE_Library.Osai
|
||||
CmsError cmsError = CheckConnection();
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
cmsError = CreateBackup();
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
ushort status = 0;
|
||||
// Read tool manager status
|
||||
@@ -3032,10 +3039,6 @@ namespace CMS_CORE_Library.Osai
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
cmsError = CreateBackup();
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
@@ -3658,7 +3661,7 @@ namespace CMS_CORE_Library.Osai
|
||||
return cmsError;
|
||||
|
||||
ushort nReturn = OpenNC.LogFSFindFirst(path, out FILEFINDDATA data, out uint finder, out uint errClass, out uint errNum);
|
||||
if (errClass != 0 || errNum != 0 || nReturn == 0)
|
||||
if ((errClass != 0 && errClass != 5) || (errNum != 0 && errNum != 10))
|
||||
return GetNCError(errClass, errNum);
|
||||
|
||||
nReturn = OpenNC.LogFSFindClose(finder, out errClass, out errNum);
|
||||
@@ -3750,6 +3753,10 @@ namespace CMS_CORE_Library.Osai
|
||||
//Read Static Data
|
||||
private CmsError ReadStaticNCData()
|
||||
{
|
||||
CmsError cmsError = CheckConnection();
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
ushort nReturn;
|
||||
|
||||
//Read oly one time every X seconds
|
||||
@@ -3976,11 +3983,10 @@ namespace CMS_CORE_Library.Osai
|
||||
ushort Level = 1;
|
||||
string mainPath = "";
|
||||
string SubPath = "";
|
||||
uint errorClass = 0; uint errorNum = 0;
|
||||
//Try to get information
|
||||
try
|
||||
{
|
||||
nReturn = OpenNC.GetActivePartProgramW(procNumber, out Level, out mainPath, out SubPath, out errorClass, out errorNum);
|
||||
nReturn = OpenNC.GetActivePartProgram(procNumber, out Level, out mainPath, out SubPath, out uint errorClass, out uint errorNum);
|
||||
if (errorClass != 0 || errorNum != 0 || nReturn == 0)
|
||||
return GetNCError(errorClass, errorNum);
|
||||
|
||||
|
||||
@@ -53,12 +53,10 @@ namespace CMS_CORE_Library.Siemens
|
||||
|
||||
private const string ACT_PROG_LINES_PATH = "/Channel/ProgramInfo/actPartProgram";
|
||||
private const string ACT_PROG_NAME_PATH = "/Channel/ProgramPointer/progName";
|
||||
|
||||
private const string MAGAZINE_ACTION_PATH = "DB258.DBB4000";
|
||||
|
||||
// TOOLS
|
||||
private const string NC_TOOL_FILE_PATH = "//NC/ACT.DIR/TO.DIR/TO_INI.INI";
|
||||
|
||||
private const string LOCALE_TOOL_FILE_PATH = "C:\\CMS\\Active\\TMP\\TO_INI.INI";
|
||||
|
||||
// Global Variables
|
||||
@@ -100,7 +98,7 @@ namespace CMS_CORE_Library.Siemens
|
||||
private static bool MULTITOOL_OPTION_ACTIVE;
|
||||
|
||||
private const string PLC_MESSAGES_FILE_PATH = "C:\\Program Files (x86)\\Siemens\\MotionControl\\oem\\sinumerik\\hmi\\lng\\";
|
||||
private static readonly string AXES_FILE_PATH = System.AppDomain.CurrentDomain.BaseDirectory + "\\Config\\axesConfig.xml";
|
||||
private static readonly string AXES_FILE_PATH = AppDomain.CurrentDomain.BaseDirectory + "\\Config\\axesConfig.xml";
|
||||
|
||||
private SiemensEdgesConfiguration Add_Edges_Param_Config = new SiemensEdgesConfiguration();
|
||||
|
||||
@@ -120,15 +118,12 @@ namespace CMS_CORE_Library.Siemens
|
||||
|
||||
// File paths
|
||||
public const string BASE_FILE_PATH = "//NC/";
|
||||
|
||||
public const string NC_FILE_PATH = "MPF.DIR";
|
||||
|
||||
// Test
|
||||
private static DataSvc AxesSvc;
|
||||
|
||||
private static DataSvc SelectedProcessSvc;
|
||||
|
||||
private static ushort SelectedProcess = 0;
|
||||
|
||||
private static Dictionary<string, double> MachineAxesPosition = new Dictionary<string, double>();
|
||||
private static Dictionary<string, double> ToGoAxesPosition = new Dictionary<string, double>();
|
||||
private static Dictionary<string, double> InterpAxesPosition = new Dictionary<string, double>();
|
||||
@@ -207,7 +202,7 @@ namespace CMS_CORE_Library.Siemens
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return ManageException(ex);
|
||||
return NOT_CONNECTED_ERROR;
|
||||
}
|
||||
|
||||
return NO_ERROR;
|
||||
@@ -1732,6 +1727,9 @@ namespace CMS_CORE_Library.Siemens
|
||||
|
||||
public override CmsError PROC_RSelectedProcessData(int processId, ref SelectedProcessData processData)
|
||||
{
|
||||
if (processId <= 0)
|
||||
return PROC_NOT_FOUND_ERROR;
|
||||
|
||||
try
|
||||
{
|
||||
Item[] items = new Item[2]
|
||||
|
||||
Reference in New Issue
Block a user