Fix counters
This commit is contained in:
@@ -129,6 +129,8 @@ namespace CMS_CORE_Application
|
||||
SelectedProcessData selected = new SelectedProcessData();
|
||||
cmsError = N.PROC_RSelectedProcessData(1, ref selected);
|
||||
|
||||
N.PLC_WAssistedToolingCmd(1, 1, 1, 1, 1, ASSISTED_TOOLING_ACTION.EXCHANGE);
|
||||
|
||||
cmsError = N.NC_SetScreenVisible(Nc.SCREEN_PAGE.Fanuc_Custom2);
|
||||
List<AxisModel> ax = new List<AxisModel>();
|
||||
cmsError = N.AXES_RAxesNames(1, ref ax);
|
||||
|
||||
@@ -758,6 +758,7 @@ namespace CMS_CORE_Library.Fanuc
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
// MACHINE COUNTERS
|
||||
// Get all the machine counters
|
||||
public override CmsError PLC_RMachineCounters(ref List<CounterModel> counters)
|
||||
{
|
||||
@@ -781,7 +782,7 @@ namespace CMS_CORE_Library.Fanuc
|
||||
|
||||
public override CmsError PLC_WResetMachineCounters(uint counter)
|
||||
{
|
||||
Boolean isResettable = false;
|
||||
bool isResettable = false;
|
||||
CmsError cmsError = MEM_RWBoolean(R, 0, COUNTER_IS_RESETTABLE.MemType, COUNTER_IS_RESETTABLE.Address, (int)(counter - 1), ref isResettable);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
@@ -709,7 +709,8 @@ namespace CMS_CORE_Library.Osai
|
||||
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
// MACHINE COUNTERS
|
||||
public override CmsError PLC_RMachineCounters(ref List<CounterModel> counters)
|
||||
{
|
||||
List<uint> val = new List<uint>();
|
||||
@@ -732,7 +733,19 @@ namespace CMS_CORE_Library.Osai
|
||||
|
||||
public override CmsError PLC_WResetMachineCounters(uint counter)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
bool isResettable = false;
|
||||
CmsError cmsError = MEM_RWBoolean(R, 0, COUNTER_IS_RESETTABLE.MemType, COUNTER_IS_RESETTABLE.Address, (int)(counter - 1), ref isResettable);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
if (!isResettable)
|
||||
return FUNCTION_NOT_ALLOWED_ERROR;
|
||||
|
||||
cmsError = PLC_WStrobe(COUNTER_IS_RESETTABLE_ACK, COUNTER_IS_RESETTABLE_STROBE, counter);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
public override CmsError PLC_RNcSoftKeys(ref List<SoftKeysModel> ncSoftKeys)
|
||||
@@ -1279,7 +1292,7 @@ namespace CMS_CORE_Library.Osai
|
||||
|
||||
// Write action
|
||||
byte val = (byte)action;
|
||||
cmsError = MEM_RWByte(W, 1, ASSISTED_TOOLING_DATA.MemType, ASSISTED_TOOLING_DATA.Address + (values.Count() * 2), 0, ref val);
|
||||
cmsError = MEM_RWByte(W, 1, ASSISTED_TOOLING_DATA.MemType, ASSISTED_TOOLING_DATA.Address + (values.Count()), 0, ref val);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
@@ -1291,7 +1304,8 @@ namespace CMS_CORE_Library.Osai
|
||||
{
|
||||
byte procFinalValue = 0;
|
||||
// Read procedure final value
|
||||
CmsError cmsError = MEM_RWByte(R, 0, PLC_ASSISTED_TOOLING_STROBE.MemType, PLC_ASSISTED_TOOLING_STROBE.Address, 0, ref procFinalValue);
|
||||
CmsError cmsError = MEM_RWByte(R, 0
|
||||
, PLC_ASSISTED_TOOLING_STROBE.MemType, PLC_ASSISTED_TOOLING_STROBE.Address, 0, ref procFinalValue);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
|
||||
@@ -1103,13 +1103,13 @@ namespace CMS_CORE_Library.Siemens
|
||||
return INCORRECT_PARAMETERS_ERROR;
|
||||
|
||||
// Read status
|
||||
CmsError cmsError = MEM_RWByte(R, 0, HEAD_RESET_WORKED_TIME.MemType, HEAD_RESET_WORKED_TIME.Address, HEADS_WORKED_TIMES.SubAddress, 0, ref usControlWord);
|
||||
CmsError cmsError = MEM_RWByte(R, 0, HEAD_RESET_WORKED_TIME.MemType, HEAD_RESET_WORKED_TIME.Address, HEAD_RESET_WORKED_TIME.SubAddress, 0, ref usControlWord);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
// Re-Write it status
|
||||
usControlWord = Convert.ToByte((usControlWord & 0xE0) | (head & 0X1F));
|
||||
cmsError = MEM_RWByte(W, 0, HEAD_RESET_WORKED_TIME.MemType, HEAD_RESET_WORKED_TIME.Address, HEADS_WORKED_TIMES.SubAddress, 0, ref usControlWord);
|
||||
cmsError = MEM_RWByte(W, 0, HEAD_RESET_WORKED_TIME.MemType, HEAD_RESET_WORKED_TIME.Address, HEAD_RESET_WORKED_TIME.SubAddress, 0, ref usControlWord);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
@@ -1197,6 +1197,7 @@ namespace CMS_CORE_Library.Siemens
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
// MACHINE COUNTERS
|
||||
public override CmsError PLC_RMachineCounters(ref List<CounterModel> counters)
|
||||
{
|
||||
List<uint> val = new List<uint>();
|
||||
@@ -1219,7 +1220,19 @@ namespace CMS_CORE_Library.Siemens
|
||||
|
||||
public override CmsError PLC_WResetMachineCounters(uint counter)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
bool isResettable = false;
|
||||
CmsError cmsError = MEM_RWBoolean(R, 0, COUNTER_IS_RESETTABLE.MemType, COUNTER_IS_RESETTABLE.Address, COUNTER_IS_RESETTABLE.SubAddress, (int)(counter - 1), ref isResettable);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
if (!isResettable)
|
||||
return FUNCTION_NOT_ALLOWED_ERROR;
|
||||
|
||||
cmsError = PLC_WStrobe(COUNTER_IS_RESETTABLE_ACK, COUNTER_IS_RESETTABLE_STROBE, counter);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
public override CmsError PLC_ROperatorInputIsNeeded(ref List<M155InputIsNeededModel> value)
|
||||
@@ -6255,8 +6268,9 @@ namespace CMS_CORE_Library.Siemens
|
||||
internal static MEMORY_CELL HEADS_STROBE_DECREMENT = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, TABLE, 2940, 4);
|
||||
|
||||
internal static MEMORY_CELL COUNTERS_DATA = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, TABLE, 2944, 64);
|
||||
internal static MEMORY_CELL COUNTERS_ACK = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, TABLE, 3008, 2);
|
||||
internal static MEMORY_CELL COUNTERS_STROBE = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, TABLE, 3010, 2);
|
||||
internal static MEMORY_CELL COUNTER_IS_RESETTABLE = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, TABLE, 3008, 2);
|
||||
internal static MEMORY_CELL COUNTER_IS_RESETTABLE_ACK = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, TABLE, 3010, 2);
|
||||
internal static MEMORY_CELL COUNTER_IS_RESETTABLE_STROBE = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, TABLE, 3012, 2);
|
||||
|
||||
internal static MEMORY_CELL M155_INPUT_NEEDED = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, TABLE, 3014, 1);
|
||||
internal static MEMORY_CELL M155_INPUT_ACK = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, TABLE, 3015, 1);
|
||||
@@ -6274,7 +6288,7 @@ namespace CMS_CORE_Library.Siemens
|
||||
internal static MEMORY_CELL HEADS_WORKED_TIMES = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, 254, 60, 4);
|
||||
internal static MEMORY_CELL HEAD_RESET_WORKED_TIME = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, 255, 92, 4);
|
||||
internal static MEMORY_CELL MACHINE_WORKED_TIME = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, 255, 94, 4);
|
||||
internal static MEMORY_CELL MACHINE_RESET_WORKED_TIME = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, 98, 92, 4);
|
||||
internal static MEMORY_CELL MACHINE_RESET_WORKED_TIME = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, 255, 98, 4);
|
||||
internal static MEMORY_CELL CANDY_MEM = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, 255, 120, 1);
|
||||
internal static MEMORY_CELL EXP_CANDY_MEM = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, 255, 92, 1);
|
||||
internal static MEMORY_CELL SELF_ADAPTIVE_PATH = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, 253, 16, 4);
|
||||
|
||||
Reference in New Issue
Block a user