|
|
|
@@ -8,8 +8,10 @@ using System.Linq;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
using static CMS_CORE_Library.Models.DataStructures;
|
|
|
|
|
using static CMS_CORE_Library.Siemens.MEMORY_ADDRESS;
|
|
|
|
|
using static CMS_CORE_Library.Fanuc.MEMORY_ADDRESS;
|
|
|
|
|
using static CMS_CORE_Library.Utils.Nc_Utils;
|
|
|
|
|
using static CMS_CORE_Library.Nc;
|
|
|
|
|
using static Focas1;
|
|
|
|
|
|
|
|
|
|
#pragma warning disable 1591
|
|
|
|
|
|
|
|
|
@@ -382,50 +384,102 @@ namespace CMS_CORE_Library.Fanuc
|
|
|
|
|
//Get the PMC Messages
|
|
|
|
|
public override CmsError PLC_RActiveMessages(ref List<PlcAlarmModel> alarms)
|
|
|
|
|
{
|
|
|
|
|
//Check if the NC is Connected
|
|
|
|
|
CmsError cmsError = CheckConnection();
|
|
|
|
|
////Check if the NC is Connected
|
|
|
|
|
//CmsError cmsError = CheckConnection();
|
|
|
|
|
//if (cmsError.IsError())
|
|
|
|
|
// return cmsError;
|
|
|
|
|
|
|
|
|
|
//Focas1.OPMSG3 Messg = new Focas1.OPMSG3();
|
|
|
|
|
//short nReturn = 0;
|
|
|
|
|
//short count = FANUC_MAXMSGPMC;
|
|
|
|
|
|
|
|
|
|
////Execute the method
|
|
|
|
|
//nReturn = Focas1.cnc_rdopmsg3(nLibHandle[0], -1, ref count, Messg);
|
|
|
|
|
|
|
|
|
|
////Throw Exception if there's an error
|
|
|
|
|
//if (nReturn != 0)
|
|
|
|
|
// return GetNcError(nReturn);
|
|
|
|
|
|
|
|
|
|
//// Add Alarm in List
|
|
|
|
|
//alarms.Clear();
|
|
|
|
|
|
|
|
|
|
//if (count >= 1 && Messg.msg1.datano >= 0)
|
|
|
|
|
// AddPlcAlarmsToList((ushort)Messg.msg1.datano, false, false, new List<int>() { 1 }, alarms);
|
|
|
|
|
|
|
|
|
|
//if (count >= 2 && Messg.msg2.datano >= 0)
|
|
|
|
|
// AddPlcAlarmsToList((ushort)Messg.msg2.datano, false, false, new List<int>() { 1 }, alarms);
|
|
|
|
|
|
|
|
|
|
//if (count >= 3 && Messg.msg3.datano >= 0)
|
|
|
|
|
// AddPlcAlarmsToList((ushort)Messg.msg3.datano, false, false, new List<int>() { 1 }, alarms);
|
|
|
|
|
|
|
|
|
|
//if (count >= 4 && Messg.msg4.datano >= 0)
|
|
|
|
|
// AddPlcAlarmsToList((ushort)Messg.msg4.datano, false, false, new List<int>() { 1 }, alarms);
|
|
|
|
|
|
|
|
|
|
//if (count >= 5 && Messg.msg5.datano >= 0)
|
|
|
|
|
// AddPlcAlarmsToList((ushort)Messg.msg5.datano, false, false, new List<int>() { 1 }, alarms);
|
|
|
|
|
|
|
|
|
|
alarms.Clear();
|
|
|
|
|
List<int> readValues = new List<int>();
|
|
|
|
|
|
|
|
|
|
// Read on data from memory
|
|
|
|
|
CmsError cmsError = MEM_RWIntegerList(R, 0,
|
|
|
|
|
ALARMS_STATUS.MemType,
|
|
|
|
|
ALARMS_STATUS.Address,
|
|
|
|
|
(ALARMS_STATUS.Size + ALARMS_DATA.Size) / 4, // byte / 4
|
|
|
|
|
ref readValues);
|
|
|
|
|
|
|
|
|
|
if (cmsError.IsError())
|
|
|
|
|
return cmsError;
|
|
|
|
|
// Convert integer array into bit array
|
|
|
|
|
bool[] statusBits = IntToBool(readValues.ToArray());
|
|
|
|
|
|
|
|
|
|
Focas1.OPMSG3 Messg = new Focas1.OPMSG3();
|
|
|
|
|
short nReturn = 0;
|
|
|
|
|
short count = FANUC_MAXMSGPMC;
|
|
|
|
|
for (int i = 0; i < ALARMS_STATUS.Size * 8; i++)
|
|
|
|
|
{
|
|
|
|
|
// If alarm is active
|
|
|
|
|
if (statusBits[i])
|
|
|
|
|
{
|
|
|
|
|
// Calculate matching alarm byte info address
|
|
|
|
|
int dataByteAddress = i * 8 + ALARMS_NUMBER;
|
|
|
|
|
|
|
|
|
|
//Execute the method
|
|
|
|
|
nReturn = Focas1.cnc_rdopmsg3(nLibHandle[0], -1, ref count, Messg);
|
|
|
|
|
var processList = new List<int>();
|
|
|
|
|
|
|
|
|
|
//Throw Exception if there's an error
|
|
|
|
|
if (nReturn != 0)
|
|
|
|
|
return GetNcError(nReturn);
|
|
|
|
|
|
|
|
|
|
// Add Alarm in List
|
|
|
|
|
alarms.Clear();
|
|
|
|
|
|
|
|
|
|
if (count >= 1 && Messg.msg1.datano >= 0)
|
|
|
|
|
AddPlcAlarmsToList((ushort)Messg.msg1.datano, false, false, new List<int>() { 1 }, alarms);
|
|
|
|
|
|
|
|
|
|
if (count >= 2 && Messg.msg2.datano >= 0)
|
|
|
|
|
AddPlcAlarmsToList((ushort)Messg.msg2.datano, false, false, new List<int>() { 1 }, alarms);
|
|
|
|
|
|
|
|
|
|
if (count >= 3 && Messg.msg3.datano >= 0)
|
|
|
|
|
AddPlcAlarmsToList((ushort)Messg.msg3.datano, false, false, new List<int>() { 1 }, alarms);
|
|
|
|
|
|
|
|
|
|
if (count >= 4 && Messg.msg4.datano >= 0)
|
|
|
|
|
AddPlcAlarmsToList((ushort)Messg.msg4.datano, false, false, new List<int>() { 1 }, alarms);
|
|
|
|
|
|
|
|
|
|
if (count >= 5 && Messg.msg5.datano >= 0)
|
|
|
|
|
AddPlcAlarmsToList((ushort)Messg.msg5.datano, false, false, new List<int>() { 1 }, alarms);
|
|
|
|
|
// Get processes on which alarm is active
|
|
|
|
|
for (int j = dataByteAddress; j < dataByteAddress + 6; j++)
|
|
|
|
|
{
|
|
|
|
|
if (statusBits[j])
|
|
|
|
|
processList.Add(j + 1 - dataByteAddress);
|
|
|
|
|
}
|
|
|
|
|
// Add alarm info into active alarms list
|
|
|
|
|
alarms.Add(new PlcAlarmModel()
|
|
|
|
|
{
|
|
|
|
|
Id = (uint)i + 1,
|
|
|
|
|
IsWarning = statusBits[dataByteAddress + 7],
|
|
|
|
|
RestorationIsActive = statusBits[dataByteAddress + 6],
|
|
|
|
|
Process = processList
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return NO_ERROR;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override CmsError PLC_WRefreshMessage(uint id)
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
// Set to 1 refresh strobe
|
|
|
|
|
CmsError cmsError = PLC_WStrobe(ALARM_ACK, ALARM_RESTORATION_STROBE, id);
|
|
|
|
|
if (cmsError.IsError())
|
|
|
|
|
return cmsError;
|
|
|
|
|
|
|
|
|
|
return NO_ERROR;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override CmsError PLC_WRestoreMessage(uint id)
|
|
|
|
|
{
|
|
|
|
|
// Set to 1 restore strobe
|
|
|
|
|
CmsError cmsError = PLC_WStrobe(ALARM_ACK, ALARM_REFRESH_STROBE, id);
|
|
|
|
|
if (cmsError.IsError())
|
|
|
|
|
return cmsError;
|
|
|
|
|
|
|
|
|
|
return NO_ERROR;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -477,19 +531,68 @@ namespace CMS_CORE_Library.Fanuc
|
|
|
|
|
// Write power on data
|
|
|
|
|
public override CmsError PLC_WPowerOnData(uint id, bool value)
|
|
|
|
|
{
|
|
|
|
|
// Check bit range
|
|
|
|
|
if (id > 16)
|
|
|
|
|
return INCORRECT_PARAMETERS_ERROR;
|
|
|
|
|
|
|
|
|
|
// Call restore message
|
|
|
|
|
CmsError cmsError = PLC_WStrobe(PRE_POST_POWER_ON_ACK, PRE_POST_POWER_ON_CLICKED, id);
|
|
|
|
|
if (cmsError.IsError())
|
|
|
|
|
return cmsError;
|
|
|
|
|
|
|
|
|
|
return NO_ERROR;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Get functionality data
|
|
|
|
|
public override CmsError PLC_RFunctionAccess(ref List<FunctionalityModel> functions)
|
|
|
|
|
{
|
|
|
|
|
List<int> readValues = new List<int>();
|
|
|
|
|
int numberOfIntegers = FUNCTION_ACCESS.Size / 4;
|
|
|
|
|
// Read functions access data from memory
|
|
|
|
|
CmsError cmsError = MEM_RWIntegerList(R, 0, FUNCTION_ACCESS.MemType, FUNCTION_ACCESS.Address, numberOfIntegers, ref readValues);
|
|
|
|
|
if (cmsError.IsError())
|
|
|
|
|
return cmsError;
|
|
|
|
|
|
|
|
|
|
functions = new List<FunctionalityModel>();
|
|
|
|
|
// Convert int into to true/false array
|
|
|
|
|
bool[] bits = IntToBool(readValues.ToArray());
|
|
|
|
|
|
|
|
|
|
// Convert array into structured data
|
|
|
|
|
for (int i = 0; i < bits.Count(); i++)
|
|
|
|
|
{
|
|
|
|
|
functions.Add(new FunctionalityModel()
|
|
|
|
|
{
|
|
|
|
|
Id = (uint)i + 1,
|
|
|
|
|
IsActive = bits[i]
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return NO_ERROR;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Get axis reset procedure data
|
|
|
|
|
public override CmsError PLC_RAxesResetData(ref AxisResetDataModel axisResetData)
|
|
|
|
|
{
|
|
|
|
|
byte value = 0;
|
|
|
|
|
// Read byte from memory
|
|
|
|
|
CmsError cmsError = MEM_RWByte(R, 0, AXIS_RESET_PROCEDURE.MemType, AXIS_RESET_PROCEDURE.Address, 0, ref value);
|
|
|
|
|
if (cmsError.IsError())
|
|
|
|
|
return cmsError;
|
|
|
|
|
|
|
|
|
|
// Check last bit if is active
|
|
|
|
|
if ((value & 128) == 128)
|
|
|
|
|
{
|
|
|
|
|
// Set to 0 last bit( isActive bit x - 128 )
|
|
|
|
|
// From 0 to 6 bits represent percentage
|
|
|
|
|
// If higher than 100 then value = 100
|
|
|
|
|
byte percentage = value - 128 > 100 ? (byte)100 : (byte)(value - 128);
|
|
|
|
|
axisResetData = new AxisResetDataModel()
|
|
|
|
|
{
|
|
|
|
|
IsActive = true,
|
|
|
|
|
Percentage = percentage
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return NO_ERROR;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -501,31 +604,103 @@ namespace CMS_CORE_Library.Fanuc
|
|
|
|
|
|
|
|
|
|
public override CmsError PLC_RNcSoftKeys(ref List<SoftKeysModel> ncSoftKeys)
|
|
|
|
|
{
|
|
|
|
|
CmsError cmsError = PLC_RSoftKeys(NC_SOFTKEYS_VALUE, NC_SOFTKEYS_CLICKABLE, ref ncSoftKeys);
|
|
|
|
|
if (cmsError.IsError())
|
|
|
|
|
return cmsError;
|
|
|
|
|
|
|
|
|
|
return NO_ERROR;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override CmsError PLC_RUserSoftKeys(ref List<SoftKeysModel> softKeys)
|
|
|
|
|
{
|
|
|
|
|
CmsError cmsError = PLC_RSoftKeys(USER_SOFTKEYS_VALUE, USER_SOFTKEYS_CLICKABLE, ref softKeys);
|
|
|
|
|
if (cmsError.IsError())
|
|
|
|
|
return cmsError;
|
|
|
|
|
|
|
|
|
|
return NO_ERROR;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override CmsError PLC_WNcSoftKey(uint id)
|
|
|
|
|
{
|
|
|
|
|
// Check id range
|
|
|
|
|
if (id > NC_SOFTKEYS_NUMBER)
|
|
|
|
|
return INCORRECT_PARAMETERS_ERROR;
|
|
|
|
|
|
|
|
|
|
// Write strobe into memory
|
|
|
|
|
CmsError cmsError = PLC_WStrobe(NC_SOFT_KEYS_ACK, NC_SOFT_KEYS_CLICKED, id);
|
|
|
|
|
if (cmsError.IsError())
|
|
|
|
|
return cmsError;
|
|
|
|
|
|
|
|
|
|
return NO_ERROR;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override CmsError PLC_WUserSoftKey(uint id)
|
|
|
|
|
{
|
|
|
|
|
// Check id range
|
|
|
|
|
if (id > USER_SOFTKEYS_NUMBER)
|
|
|
|
|
return INCORRECT_PARAMETERS_ERROR;
|
|
|
|
|
|
|
|
|
|
// Write strobe into memory
|
|
|
|
|
CmsError cmsError = PLC_WStrobe(USER_SOFT_KEYS_ACK, USER_SOFT_KEYS_CLICKED, id);
|
|
|
|
|
if (cmsError.IsError())
|
|
|
|
|
return cmsError;
|
|
|
|
|
|
|
|
|
|
return NO_ERROR;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override CmsError PLC_RHeadsData(List<HeadDataModel> heads, int number)
|
|
|
|
|
{
|
|
|
|
|
// Check parameters
|
|
|
|
|
if (number > MAX_HEADS_NUMBER)
|
|
|
|
|
return INCORRECT_PARAMETERS_ERROR;
|
|
|
|
|
heads.Clear();
|
|
|
|
|
|
|
|
|
|
List<int> readInts = new List<int>();
|
|
|
|
|
List<byte> readValues = new List<byte>();
|
|
|
|
|
// Find the size of a single head
|
|
|
|
|
int headsByte = (HEADS_DATA.Size / MAX_HEADS_NUMBER);
|
|
|
|
|
double headsInts = Math.Ceiling((double)(headsByte / 4) + 1);
|
|
|
|
|
|
|
|
|
|
// Read data for N heads
|
|
|
|
|
CmsError cmsError = MEM_RWIntegerList(R, 0, HEADS_DATA.MemType, 0, HEADS_DATA.Address, (int)headsInts * number, ref readInts);
|
|
|
|
|
if (cmsError.IsError())
|
|
|
|
|
return cmsError;
|
|
|
|
|
readValues = readInts.SelectMany(BitConverter.GetBytes).ToList();
|
|
|
|
|
|
|
|
|
|
// Parse and format read data
|
|
|
|
|
for (int i = 0; i < number; i++)
|
|
|
|
|
{
|
|
|
|
|
// Head address = posizion * size of single head in memory
|
|
|
|
|
var headOffset = i * headsByte;
|
|
|
|
|
heads.Add(new HeadDataModel()
|
|
|
|
|
{
|
|
|
|
|
Id = (uint)i + 1,
|
|
|
|
|
Process = readValues[headOffset],
|
|
|
|
|
Override = readValues[headOffset + 1],
|
|
|
|
|
Load_Abrasive = BitConverter.ToUInt16(readValues.ToArray(), headOffset + 2), // Uint 16 = 2byte
|
|
|
|
|
MountedTool_Vacum = BitConverter.ToInt16(readValues.ToArray(), headOffset + 4), // Uint 16 = 2byte
|
|
|
|
|
ActualSpeed_Pressure = BitConverter.ToInt32(readValues.ToArray(), headOffset + 6), // Int32 = 4byte
|
|
|
|
|
IsActive = (readValues[headOffset + 10] & 1) != 0, // bit 0
|
|
|
|
|
IsSelected = (readValues[headOffset + 10] & 2) != 0, // bit 1
|
|
|
|
|
OverrideEditable = (readValues[headOffset + 10] & 4) != 0 // bit 2
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return NO_ERROR;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override CmsError PLC_WHeadOverride(uint id, HEAD_OVERRIDE_SIGN sign)
|
|
|
|
|
{
|
|
|
|
|
if (id > MAX_HEADS_NUMBER)
|
|
|
|
|
return INCORRECT_PARAMETERS_ERROR;
|
|
|
|
|
|
|
|
|
|
MEMORY_CELL currentStrobeCell = sign == HEAD_OVERRIDE_SIGN.PLUS ? HEADS_STROBE_INCREMENT : HEADS_STROBE_DECREMENT;
|
|
|
|
|
|
|
|
|
|
// Write strobe into memory
|
|
|
|
|
CmsError cmsError = PLC_WStrobe(HEADS_ACK, currentStrobeCell, id);
|
|
|
|
|
if (cmsError.IsError())
|
|
|
|
|
return cmsError;
|
|
|
|
|
|
|
|
|
|
return NO_ERROR;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -578,7 +753,7 @@ namespace CMS_CORE_Library.Fanuc
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//Get the process Alarms
|
|
|
|
|
public override CmsError PROC_RActiveAlarms(ushort ProcNumber, ref List<AlarmModel> Alarms)
|
|
|
|
|
public override CmsError PROC_RActiveAlarms(ushort procNumber, ref List<AlarmModel> Alarms)
|
|
|
|
|
{
|
|
|
|
|
Alarms.Clear();
|
|
|
|
|
|
|
|
|
@@ -586,7 +761,7 @@ namespace CMS_CORE_Library.Fanuc
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//Get PP Lines
|
|
|
|
|
public override CmsError PROC_RPPLines(ushort ProcNumber, ref List<string> Lines)
|
|
|
|
|
public override CmsError PROC_RPPLines(ushort procNumber, ref List<string> lines)
|
|
|
|
|
{
|
|
|
|
|
//Check if the NC is Connected
|
|
|
|
|
CmsError cmsError = CheckConnection();
|
|
|
|
@@ -600,7 +775,7 @@ namespace CMS_CORE_Library.Fanuc
|
|
|
|
|
char[] Chars = new char[255];
|
|
|
|
|
string[] newLines;
|
|
|
|
|
|
|
|
|
|
short path = GetHandleIndexFromPath(ProcNumber);
|
|
|
|
|
short path = GetHandleIndexFromPath(procNumber);
|
|
|
|
|
if (path < 0)
|
|
|
|
|
return PROC_NOT_FOUND_ERROR;
|
|
|
|
|
|
|
|
|
@@ -612,7 +787,7 @@ namespace CMS_CORE_Library.Fanuc
|
|
|
|
|
if (nReturn != 0)
|
|
|
|
|
return GetNcError(nReturn);
|
|
|
|
|
|
|
|
|
|
path = GetHandleIndexFromPath(ProcNumber);
|
|
|
|
|
path = GetHandleIndexFromPath(procNumber);
|
|
|
|
|
if (path < 0)
|
|
|
|
|
return PROC_NOT_FOUND_ERROR;
|
|
|
|
|
|
|
|
|
@@ -625,15 +800,15 @@ namespace CMS_CORE_Library.Fanuc
|
|
|
|
|
return GetNcError(nReturn);
|
|
|
|
|
|
|
|
|
|
//Setup the return values
|
|
|
|
|
Lines.Clear();
|
|
|
|
|
lines.Clear();
|
|
|
|
|
foreach (string Line in newLines)
|
|
|
|
|
Lines.Add(Line);
|
|
|
|
|
lines.Add(Line);
|
|
|
|
|
|
|
|
|
|
return NO_ERROR;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//Get Active PP Name
|
|
|
|
|
public override CmsError PROC_RSelectedPPName(ushort ProcNumber, ref string Name)
|
|
|
|
|
public override CmsError PROC_RSelectedPPName(ushort procNumber, ref string name)
|
|
|
|
|
{
|
|
|
|
|
//Check if the NC is Connected
|
|
|
|
|
CmsError cmsError = CheckConnection();
|
|
|
|
@@ -641,29 +816,29 @@ namespace CMS_CORE_Library.Fanuc
|
|
|
|
|
return cmsError;
|
|
|
|
|
|
|
|
|
|
short nReturn = 0;
|
|
|
|
|
Focas1.ODBEXEPRG Prg = new Focas1.ODBEXEPRG(); ;
|
|
|
|
|
Focas1.ODBEXEPRG partPrg = new Focas1.ODBEXEPRG();
|
|
|
|
|
|
|
|
|
|
// Get path index
|
|
|
|
|
short path = GetHandleIndexFromPath(ProcNumber);
|
|
|
|
|
short path = GetHandleIndexFromPath(procNumber);
|
|
|
|
|
if (path < 0)
|
|
|
|
|
return PROC_NOT_FOUND_ERROR;
|
|
|
|
|
|
|
|
|
|
//Execute the method
|
|
|
|
|
nReturn = Focas1.cnc_exeprgname(nLibHandle[path], Prg);
|
|
|
|
|
nReturn = Focas1.cnc_exeprgname(nLibHandle[path], partPrg);
|
|
|
|
|
|
|
|
|
|
//Throw Exception if there's an error
|
|
|
|
|
if (nReturn != 0)
|
|
|
|
|
return GetNcError(nReturn);
|
|
|
|
|
|
|
|
|
|
Name = new string(Prg.name).Replace("\0", string.Empty);
|
|
|
|
|
name = new string(partPrg.name).Replace("\0", string.Empty);
|
|
|
|
|
|
|
|
|
|
return NO_ERROR;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//Get the process status
|
|
|
|
|
public override CmsError PROC_RStatus(ushort Number, ref PROC_STATUS Status)
|
|
|
|
|
public override CmsError PROC_RStatus(ushort procNumber, ref PROC_STATUS Status)
|
|
|
|
|
{
|
|
|
|
|
Focas1.ODBST StatInfo = new Focas1.ODBST();
|
|
|
|
|
Focas1.ODBST statusInfo = new Focas1.ODBST();
|
|
|
|
|
short nReturn;
|
|
|
|
|
|
|
|
|
|
//Check if the NC is Connected
|
|
|
|
@@ -672,26 +847,26 @@ namespace CMS_CORE_Library.Fanuc
|
|
|
|
|
return cmsError;
|
|
|
|
|
|
|
|
|
|
// Get path index
|
|
|
|
|
short path = GetHandleIndexFromPath(Number);
|
|
|
|
|
short path = GetHandleIndexFromPath(procNumber);
|
|
|
|
|
if (path < 0)
|
|
|
|
|
return PROC_NOT_FOUND_ERROR;
|
|
|
|
|
|
|
|
|
|
//Execute the method
|
|
|
|
|
nReturn = Focas1.cnc_statinfo(nLibHandle[path], StatInfo);
|
|
|
|
|
nReturn = Focas1.cnc_statinfo(nLibHandle[path], statusInfo);
|
|
|
|
|
|
|
|
|
|
//Throw Exception if there's an error
|
|
|
|
|
if (nReturn != 0)
|
|
|
|
|
return GetNcError(nReturn);
|
|
|
|
|
|
|
|
|
|
Status = ConverToSTEPStatus(StatInfo);
|
|
|
|
|
Status = ConverToSTEPStatus(statusInfo);
|
|
|
|
|
|
|
|
|
|
return NO_ERROR;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//Get the process Mode
|
|
|
|
|
public override CmsError PROC_RMode(ushort Number, ref PROC_MODE Mode)
|
|
|
|
|
public override CmsError PROC_RMode(ushort procNumber, ref PROC_MODE Mode)
|
|
|
|
|
{
|
|
|
|
|
Focas1.ODBST StatInfo = new Focas1.ODBST();
|
|
|
|
|
Focas1.ODBST statusInfo = new Focas1.ODBST();
|
|
|
|
|
short nReturn = 0;
|
|
|
|
|
|
|
|
|
|
//Check if the NC is Connected
|
|
|
|
@@ -700,30 +875,56 @@ namespace CMS_CORE_Library.Fanuc
|
|
|
|
|
return cmsError;
|
|
|
|
|
|
|
|
|
|
// Get path index
|
|
|
|
|
short path = GetHandleIndexFromPath(Number);
|
|
|
|
|
short path = GetHandleIndexFromPath(procNumber);
|
|
|
|
|
if (path < 0)
|
|
|
|
|
return PROC_NOT_FOUND_ERROR;
|
|
|
|
|
|
|
|
|
|
//Execute the method
|
|
|
|
|
nReturn = Focas1.cnc_statinfo(nLibHandle[path], StatInfo);
|
|
|
|
|
nReturn = Focas1.cnc_statinfo(nLibHandle[path], statusInfo);
|
|
|
|
|
|
|
|
|
|
//Throw Exception if there's an error
|
|
|
|
|
if (nReturn != 0)
|
|
|
|
|
return GetNcError(nReturn);
|
|
|
|
|
|
|
|
|
|
Mode = ConverToSTEPMode(StatInfo);
|
|
|
|
|
Mode = ConverToSTEPMode(statusInfo);
|
|
|
|
|
|
|
|
|
|
return NO_ERROR;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override CmsError PROC_RSelectedProcess(ref ushort procNumber)
|
|
|
|
|
{
|
|
|
|
|
procNumber = 1;
|
|
|
|
|
CmsError cmsError;
|
|
|
|
|
bool readValue = false;
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < PROCESS_NUMBER; i++)
|
|
|
|
|
{
|
|
|
|
|
int memoryAddress = SELECTED_PROCESS.Address + i * (2);
|
|
|
|
|
// Read memory from plc
|
|
|
|
|
cmsError = MEM_RWBoolean(R, 0, SELECTED_PROCESS.MemType, memoryAddress, SELECTED_PROCESS.SubAddress, ref readValue);
|
|
|
|
|
if (cmsError.IsError())
|
|
|
|
|
return cmsError;
|
|
|
|
|
|
|
|
|
|
if (readValue)
|
|
|
|
|
procNumber = (ushort)(i + 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return NO_ERROR;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override CmsError PROC_WSelectProcess(ushort procNumber)
|
|
|
|
|
{
|
|
|
|
|
CmsError cmsError;
|
|
|
|
|
byte processNum = (byte)procNumber;
|
|
|
|
|
|
|
|
|
|
// Check parameter
|
|
|
|
|
if (processNum > PROCESS_NUMBER)
|
|
|
|
|
return INCORRECT_PARAMETERS_ERROR;
|
|
|
|
|
|
|
|
|
|
// Write process number
|
|
|
|
|
cmsError = MEM_RWByte(W, 0, SELECT_PROCESS.MemType, SELECT_PROCESS.Address, SELECT_PROCESS.SubAddress, ref processNum);
|
|
|
|
|
if (cmsError.IsError())
|
|
|
|
|
return cmsError;
|
|
|
|
|
|
|
|
|
|
return NO_ERROR;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -760,9 +961,7 @@ namespace CMS_CORE_Library.Fanuc
|
|
|
|
|
|
|
|
|
|
//If an axis goes out from Process Clear the List
|
|
|
|
|
if (Axes.Count > NumAxes)
|
|
|
|
|
{
|
|
|
|
|
Axes.Clear();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//Fill all the List
|
|
|
|
|
for (i = 1; i <= NumAxes; i++)
|
|
|
|
@@ -1002,16 +1201,99 @@ namespace CMS_CORE_Library.Fanuc
|
|
|
|
|
|
|
|
|
|
public override CmsError AXES_RAxesNames(ushort process, ref List<AxisModel> axesData)
|
|
|
|
|
{
|
|
|
|
|
short numAxesRead = MAX_AXIS;
|
|
|
|
|
|
|
|
|
|
ODBEXAXISNAME sOdbExAxisName = new ODBEXAXISNAME();
|
|
|
|
|
// Read from NC
|
|
|
|
|
short nReturn = Focas1.cnc_exaxisname(nLibHandle[process], 0, ref numAxesRead, sOdbExAxisName);
|
|
|
|
|
if (nReturn != 0)
|
|
|
|
|
return GetNcError(nReturn);
|
|
|
|
|
// Parse data
|
|
|
|
|
if (numAxesRead >= 1)
|
|
|
|
|
axesData.Add(new AxisModel() { Id = 1, Name = sOdbExAxisName.axname1 });
|
|
|
|
|
if (numAxesRead >= 2)
|
|
|
|
|
axesData.Add(new AxisModel() { Id = 2, Name = sOdbExAxisName.axname2 });
|
|
|
|
|
if (numAxesRead >= 3)
|
|
|
|
|
axesData.Add(new AxisModel() { Id = 3, Name = sOdbExAxisName.axname3 });
|
|
|
|
|
if (numAxesRead >= 4)
|
|
|
|
|
axesData.Add(new AxisModel() { Id = 4, Name = sOdbExAxisName.axname4 });
|
|
|
|
|
if (numAxesRead >= 5)
|
|
|
|
|
axesData.Add(new AxisModel() { Id = 5, Name = sOdbExAxisName.axname5 });
|
|
|
|
|
if (numAxesRead >= 6)
|
|
|
|
|
axesData.Add(new AxisModel() { Id = 6, Name = sOdbExAxisName.axname6 });
|
|
|
|
|
if (numAxesRead >= 7)
|
|
|
|
|
axesData.Add(new AxisModel() { Id = 7, Name = sOdbExAxisName.axname7 });
|
|
|
|
|
if (numAxesRead >= 8)
|
|
|
|
|
axesData.Add(new AxisModel() { Id = 8, Name = sOdbExAxisName.axname8 });
|
|
|
|
|
if (numAxesRead >= 9)
|
|
|
|
|
axesData.Add(new AxisModel() { Id = 9, Name = sOdbExAxisName.axname9 });
|
|
|
|
|
if (numAxesRead >= 10)
|
|
|
|
|
axesData.Add(new AxisModel() { Id = 10, Name = sOdbExAxisName.axname10 });
|
|
|
|
|
if (numAxesRead >= 11)
|
|
|
|
|
axesData.Add(new AxisModel() { Id = 11, Name = sOdbExAxisName.axname11 });
|
|
|
|
|
if (numAxesRead >= 12)
|
|
|
|
|
axesData.Add(new AxisModel() { Id = 12, Name = sOdbExAxisName.axname12 });
|
|
|
|
|
if (numAxesRead >= 13)
|
|
|
|
|
axesData.Add(new AxisModel() { Id = 13, Name = sOdbExAxisName.axname13 });
|
|
|
|
|
if (numAxesRead >= 14)
|
|
|
|
|
axesData.Add(new AxisModel() { Id = 14, Name = sOdbExAxisName.axname14 });
|
|
|
|
|
if (numAxesRead >= 15)
|
|
|
|
|
axesData.Add(new AxisModel() { Id = 15, Name = sOdbExAxisName.axname15 });
|
|
|
|
|
if (numAxesRead >= 16)
|
|
|
|
|
axesData.Add(new AxisModel() { Id = 16, Name = sOdbExAxisName.axname16 });
|
|
|
|
|
if (numAxesRead >= 17)
|
|
|
|
|
axesData.Add(new AxisModel() { Id = 17, Name = sOdbExAxisName.axname17 });
|
|
|
|
|
if (numAxesRead >= 18)
|
|
|
|
|
axesData.Add(new AxisModel() { Id = 18, Name = sOdbExAxisName.axname18 });
|
|
|
|
|
if (numAxesRead >= 19)
|
|
|
|
|
axesData.Add(new AxisModel() { Id = 19, Name = sOdbExAxisName.axname19 });
|
|
|
|
|
if (numAxesRead >= 20)
|
|
|
|
|
axesData.Add(new AxisModel() { Id = 20, Name = sOdbExAxisName.axname20 });
|
|
|
|
|
if (numAxesRead >= 21)
|
|
|
|
|
axesData.Add(new AxisModel() { Id = 21, Name = sOdbExAxisName.axname21 });
|
|
|
|
|
if (numAxesRead >= 22)
|
|
|
|
|
axesData.Add(new AxisModel() { Id = 22, Name = sOdbExAxisName.axname22 });
|
|
|
|
|
if (numAxesRead >= 23)
|
|
|
|
|
axesData.Add(new AxisModel() { Id = 23, Name = sOdbExAxisName.axname23 });
|
|
|
|
|
if (numAxesRead >= 24)
|
|
|
|
|
axesData.Add(new AxisModel() { Id = 24, Name = sOdbExAxisName.axname24 });
|
|
|
|
|
if (numAxesRead >= 25)
|
|
|
|
|
axesData.Add(new AxisModel() { Id = 25, Name = sOdbExAxisName.axname25 });
|
|
|
|
|
if (numAxesRead >= 26)
|
|
|
|
|
axesData.Add(new AxisModel() { Id = 26, Name = sOdbExAxisName.axname26 });
|
|
|
|
|
if (numAxesRead >= 27)
|
|
|
|
|
axesData.Add(new AxisModel() { Id = 27, Name = sOdbExAxisName.axname27 });
|
|
|
|
|
if (numAxesRead >= 28)
|
|
|
|
|
axesData.Add(new AxisModel() { Id = 28, Name = sOdbExAxisName.axname28 });
|
|
|
|
|
if (numAxesRead >= 29)
|
|
|
|
|
axesData.Add(new AxisModel() { Id = 29, Name = sOdbExAxisName.axname29 });
|
|
|
|
|
if (numAxesRead >= 30)
|
|
|
|
|
axesData.Add(new AxisModel() { Id = 30, Name = sOdbExAxisName.axname30 });
|
|
|
|
|
if (numAxesRead >= 31)
|
|
|
|
|
axesData.Add(new AxisModel() { Id = 31, Name = sOdbExAxisName.axname31 });
|
|
|
|
|
if (numAxesRead >= 32)
|
|
|
|
|
axesData.Add(new AxisModel() { Id = 32, Name = sOdbExAxisName.axname31 });
|
|
|
|
|
|
|
|
|
|
return NO_ERROR;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override CmsError AXES_RSelectedAxis(ref byte axisId)
|
|
|
|
|
{
|
|
|
|
|
// Read byte from memory
|
|
|
|
|
CmsError cmsError = MEM_RWByte(R, 0, SELECTED_AXIS.MemType, SELECTED_AXIS.Address, SELECTED_AXIS.SubAddress, ref axisId);
|
|
|
|
|
if (cmsError.IsError())
|
|
|
|
|
return cmsError;
|
|
|
|
|
|
|
|
|
|
return NO_ERROR;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override CmsError AXES_WSelectAxis(byte axisId)
|
|
|
|
|
{
|
|
|
|
|
// Write new axis id to memory
|
|
|
|
|
CmsError cmsError = MEM_RWByte(W, 0, SELECT_AXIS.MemType, SELECT_AXIS.Address, SELECT_AXIS.SubAddress, ref axisId);
|
|
|
|
|
if (cmsError.IsError())
|
|
|
|
|
return cmsError;
|
|
|
|
|
|
|
|
|
|
return NO_ERROR;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -2033,6 +2315,137 @@ namespace CMS_CORE_Library.Fanuc
|
|
|
|
|
|
|
|
|
|
#region Subordinate Private Functions
|
|
|
|
|
|
|
|
|
|
#region Memory private Functions
|
|
|
|
|
|
|
|
|
|
private CmsError PLC_WStrobe(MEMORY_CELL ackCell, MEMORY_CELL strobeCell, uint id)
|
|
|
|
|
{
|
|
|
|
|
CmsError cmsError;
|
|
|
|
|
bool readValue = false;
|
|
|
|
|
bool writeValue = true;
|
|
|
|
|
|
|
|
|
|
SetupAckStrobeAddresses(ackCell.Address, strobeCell.Address, id, out int ackWord, out int strobeWord, out int bitIndex);
|
|
|
|
|
|
|
|
|
|
// Check Strobe
|
|
|
|
|
cmsError = MEM_RWBoolean(R, 0, strobeCell.MemType, strobeWord, bitIndex, ref readValue);
|
|
|
|
|
if (cmsError.IsError())
|
|
|
|
|
return cmsError;
|
|
|
|
|
|
|
|
|
|
// If strobe == 1 return
|
|
|
|
|
if (readValue)
|
|
|
|
|
return NO_ERROR;
|
|
|
|
|
|
|
|
|
|
// Check ACK
|
|
|
|
|
cmsError = MEM_RWBoolean(R, 0, ackCell.MemType, ackWord, bitIndex, ref readValue);
|
|
|
|
|
if (cmsError.IsError())
|
|
|
|
|
return cmsError;
|
|
|
|
|
|
|
|
|
|
// If PLC it's performing another request then return
|
|
|
|
|
if (readValue)
|
|
|
|
|
return NO_ERROR;
|
|
|
|
|
|
|
|
|
|
// Write strobe into memory
|
|
|
|
|
cmsError = MEM_RWBoolean(W, 0, strobeCell.MemType, strobeWord, bitIndex, ref writeValue);
|
|
|
|
|
if (cmsError.IsError())
|
|
|
|
|
return cmsError;
|
|
|
|
|
|
|
|
|
|
// Reset wait ack = 1 and reset the strobe
|
|
|
|
|
cmsError = ResetStrobe(bitIndex, strobeWord, ackWord, ackCell.MemType);
|
|
|
|
|
if (cmsError.IsError())
|
|
|
|
|
return cmsError;
|
|
|
|
|
|
|
|
|
|
return NO_ERROR;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void SetupAckStrobeAddresses(int ackAddress, int strobeAddress, uint id, out int ackWord, out int strobeWord, out int bit)
|
|
|
|
|
{
|
|
|
|
|
ackWord = ackAddress + (((int)id - 1) / 8);
|
|
|
|
|
strobeWord = strobeAddress + (((int)id - 1) / 8);
|
|
|
|
|
bit = (((int)id - 1) % 8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private CmsError ResetStrobe(int bit, int strobeByte, int ackByte, MEMORY_TYPE memType)
|
|
|
|
|
{
|
|
|
|
|
int n = 1200; // 30 seconds
|
|
|
|
|
bool readValue = false;
|
|
|
|
|
bool writeValue = false;
|
|
|
|
|
bool ok = false;
|
|
|
|
|
|
|
|
|
|
CmsError cmsError;
|
|
|
|
|
do
|
|
|
|
|
{
|
|
|
|
|
// Check ACK
|
|
|
|
|
cmsError = MEM_RWBoolean(R, 0, memType, ackByte, bit, ref readValue);
|
|
|
|
|
if (cmsError.IsError())
|
|
|
|
|
return cmsError;
|
|
|
|
|
|
|
|
|
|
// If true reset strobe
|
|
|
|
|
if (readValue)
|
|
|
|
|
{
|
|
|
|
|
// Reset strobe
|
|
|
|
|
cmsError = MEM_RWBoolean(W, 0, memType, strobeByte, bit, ref writeValue);
|
|
|
|
|
if (cmsError.IsError())
|
|
|
|
|
return cmsError;
|
|
|
|
|
// Exit from cycle
|
|
|
|
|
n = 0;
|
|
|
|
|
ok = true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// Decrement
|
|
|
|
|
n--;
|
|
|
|
|
// Wait befor next cycle
|
|
|
|
|
Thread.Sleep(25);
|
|
|
|
|
}
|
|
|
|
|
} while (n > 0);
|
|
|
|
|
|
|
|
|
|
// If loop timeout goes in timeout
|
|
|
|
|
if (!ok)
|
|
|
|
|
{
|
|
|
|
|
// Reset strobe
|
|
|
|
|
cmsError = MEM_RWBoolean(W, 0, memType, strobeByte, bit, ref writeValue);
|
|
|
|
|
if (cmsError.IsError())
|
|
|
|
|
return cmsError;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return cmsError;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private CmsError PLC_RSoftKeys(MEMORY_CELL softKeyStatusMemory, MEMORY_CELL softKeysClickableMemory, ref List<SoftKeysModel> softKeys)
|
|
|
|
|
{
|
|
|
|
|
softKeys = new List<SoftKeysModel>();
|
|
|
|
|
List<int> readValue = new List<int>();
|
|
|
|
|
|
|
|
|
|
int memorySizeToRead = (softKeyStatusMemory.Size + softKeysClickableMemory.Size);
|
|
|
|
|
// Offset between status and clickable data
|
|
|
|
|
int offset = softKeyStatusMemory.Size * 8;
|
|
|
|
|
|
|
|
|
|
// Read on data from memory
|
|
|
|
|
CmsError cmsError = MEM_RWIntegerList(R, 0,
|
|
|
|
|
softKeyStatusMemory.MemType,
|
|
|
|
|
softKeyStatusMemory.Address,
|
|
|
|
|
memorySizeToRead / 4,
|
|
|
|
|
ref readValue);
|
|
|
|
|
|
|
|
|
|
if (cmsError.IsError())
|
|
|
|
|
return cmsError;
|
|
|
|
|
|
|
|
|
|
bool[] bits = IntToBool(readValue.ToArray());
|
|
|
|
|
|
|
|
|
|
// Convert array into structured data
|
|
|
|
|
for (ushort i = 0; i < bits.Count() / 2; i++)
|
|
|
|
|
{
|
|
|
|
|
softKeys.Add(new SoftKeysModel()
|
|
|
|
|
{
|
|
|
|
|
Id = (uint)i + 1,
|
|
|
|
|
Value = bits[i],
|
|
|
|
|
Active = bits[i + offset]
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return NO_ERROR;
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
private Focas1.page_code ConvertStepToFanucScreen(SCREEN_PAGE page)
|
|
|
|
|
{
|
|
|
|
|
switch (page)
|
|
|
|
@@ -2473,71 +2886,137 @@ namespace CMS_CORE_Library.Fanuc
|
|
|
|
|
#endregion Subordinate Private Functions
|
|
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
//internal static class MEMORY_ADDRESS
|
|
|
|
|
//{
|
|
|
|
|
// internal const int STARTING_ADDRESS = 50000;
|
|
|
|
|
// internal static MEMORY_CELL FUNCTION_ACCESS = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 50005, 8);
|
|
|
|
|
|
|
|
|
|
internal static class MEMORY_ADDRESS
|
|
|
|
|
{
|
|
|
|
|
internal const int STARTING_ADDRESS = 50000;
|
|
|
|
|
internal static MEMORY_CELL FUNCTION_ACCESS = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 50005, 8);
|
|
|
|
|
// internal static MEMORY_CELL PRE_POST_POWER_ON = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52573, 2);
|
|
|
|
|
// internal static MEMORY_CELL PRE_POST_POWER_ON_CLICKABLE = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52575, 2);
|
|
|
|
|
// internal static MEMORY_CELL PRE_POST_POWER_ON_ACK = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52577, 2);
|
|
|
|
|
// internal static MEMORY_CELL PRE_POST_POWER_ON_CLICKED = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52579, 2);
|
|
|
|
|
|
|
|
|
|
internal static MEMORY_CELL PRE_POST_POWER_ON = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52573, 2);
|
|
|
|
|
internal static MEMORY_CELL PRE_POST_POWER_ON_CLICKABLE = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52575, 2);
|
|
|
|
|
internal static MEMORY_CELL PRE_POST_POWER_ON_ACK = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52577, 2);
|
|
|
|
|
internal static MEMORY_CELL PRE_POST_POWER_ON_CLICKED = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52579, 2);
|
|
|
|
|
// internal static MEMORY_CELL AXIS_RESET_PROCEDURE = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52607, 7, 1);
|
|
|
|
|
|
|
|
|
|
internal static MEMORY_CELL AXIS_RESET_PROCEDURE = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52607, 7, 1);
|
|
|
|
|
// internal static MEMORY_CELL PROCESS_STATUS = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52581, 0, 24);
|
|
|
|
|
// internal static MEMORY_CELL SELECTED_PROCESS = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52581, 2, 24);
|
|
|
|
|
// internal static MEMORY_CELL SELECT_PROCESS = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52605, 1);
|
|
|
|
|
|
|
|
|
|
internal static MEMORY_CELL PROCESS_STATUS = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52581, 0, 24);
|
|
|
|
|
internal static MEMORY_CELL SELECTED_PROCESS = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52581, 2, 24);
|
|
|
|
|
internal static MEMORY_CELL SELECT_PROCESS = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52605, 1);
|
|
|
|
|
// internal static MEMORY_CELL COUNTERS = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 43, 0, 40);
|
|
|
|
|
|
|
|
|
|
internal static MEMORY_CELL COUNTERS = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 43, 0, 40);
|
|
|
|
|
// internal static MEMORY_CELL SELECTED_AXIS = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52624, 0, 1);
|
|
|
|
|
// internal static MEMORY_CELL SELECT_AXIS = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52625, 1, 1);
|
|
|
|
|
|
|
|
|
|
internal static MEMORY_CELL SELECTED_AXIS = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52624, 0, 1);
|
|
|
|
|
internal static MEMORY_CELL SELECT_AXIS = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52625, 1, 1);
|
|
|
|
|
// internal static MEMORY_CELL NC_SOFTKEYS_VALUE = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52608, 0, 4);
|
|
|
|
|
// internal static MEMORY_CELL NC_SOFTKEYS_CLICKABLE = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52612, 0, 4);
|
|
|
|
|
// internal static MEMORY_CELL NC_SOFT_KEYS_ACK = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52616, 4);
|
|
|
|
|
// internal static MEMORY_CELL NC_SOFT_KEYS_CLICKED = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52620, 4);
|
|
|
|
|
|
|
|
|
|
internal static MEMORY_CELL NC_SOFTKEYS_VALUE = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52608, 0, 4);
|
|
|
|
|
internal static MEMORY_CELL NC_SOFTKEYS_CLICKABLE = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52612, 0, 4);
|
|
|
|
|
internal static MEMORY_CELL NC_SOFT_KEYS_ACK = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52616, 4);
|
|
|
|
|
internal static MEMORY_CELL NC_SOFT_KEYS_CLICKED = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52620, 4);
|
|
|
|
|
// internal static MEMORY_CELL USER_SOFTKEYS_VALUE = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52626, 0, 16);
|
|
|
|
|
// internal static MEMORY_CELL USER_SOFTKEYS_CLICKABLE = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52642, 0, 16);
|
|
|
|
|
// internal static MEMORY_CELL USER_SOFT_KEYS_ACK = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52658, 16);
|
|
|
|
|
// internal static MEMORY_CELL USER_SOFT_KEYS_CLICKED = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52674, 16);
|
|
|
|
|
|
|
|
|
|
internal static MEMORY_CELL USER_SOFTKEYS_VALUE = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52626, 0, 16);
|
|
|
|
|
internal static MEMORY_CELL USER_SOFTKEYS_CLICKABLE = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52642, 0, 16);
|
|
|
|
|
internal static MEMORY_CELL USER_SOFT_KEYS_ACK = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52658, 16);
|
|
|
|
|
internal static MEMORY_CELL USER_SOFT_KEYS_CLICKED = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52674, 16);
|
|
|
|
|
// internal static MEMORY_CELL ALARMS_STATUS = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 50013, 128);
|
|
|
|
|
// internal static MEMORY_CELL ALARMS_DATA = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 50141, 1024);
|
|
|
|
|
|
|
|
|
|
internal static MEMORY_CELL ALARMS_STATUS = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 50013, 128);
|
|
|
|
|
internal static MEMORY_CELL ALARMS_DATA = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 50141, 1024);
|
|
|
|
|
// internal static MEMORY_CELL ALARM_ACK = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52189, 128);
|
|
|
|
|
// internal static MEMORY_CELL ALARM_RESTORATION_STROBE = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52445, 128);
|
|
|
|
|
// internal static MEMORY_CELL ALARM_REFRESH_STROBE = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52445, 128);
|
|
|
|
|
|
|
|
|
|
internal static MEMORY_CELL ALARM_ACK = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52189, 128);
|
|
|
|
|
internal static MEMORY_CELL ALARM_RESTORATION_STROBE = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52445, 128);
|
|
|
|
|
internal static MEMORY_CELL ALARM_REFRESH_STROBE = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52445, 128);
|
|
|
|
|
// internal static MEMORY_CELL HEADS_DATA = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52690, 240);
|
|
|
|
|
|
|
|
|
|
internal static MEMORY_CELL HEADS_DATA = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52690, 240);
|
|
|
|
|
// internal static MEMORY_CELL HEADS_ACK = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52921, 4);
|
|
|
|
|
// internal static MEMORY_CELL HEADS_STROBE_INCREMENT = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52924, 4);
|
|
|
|
|
// internal static MEMORY_CELL HEADS_STROBE_DECREMENT = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52927, 4);
|
|
|
|
|
|
|
|
|
|
internal static MEMORY_CELL HEADS_ACK = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52921, 4);
|
|
|
|
|
internal static MEMORY_CELL HEADS_STROBE_INCREMENT = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52924, 4);
|
|
|
|
|
internal static MEMORY_CELL HEADS_STROBE_DECREMENT = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52927, 4);
|
|
|
|
|
// // Tool manager areas
|
|
|
|
|
// internal static MEMORY_CELL TOOL_MANAGER_COMMAND = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 13000, 2);
|
|
|
|
|
|
|
|
|
|
// Tool manager areas
|
|
|
|
|
internal static MEMORY_CELL TOOL_MANAGER_COMMAND = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 13000, 2);
|
|
|
|
|
// internal static MEMORY_CELL TOOL_MANAGER_STATUS = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 13001, 2);
|
|
|
|
|
|
|
|
|
|
internal static MEMORY_CELL TOOL_MANAGER_STATUS = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 13001, 2);
|
|
|
|
|
// internal static MEMORY_CELL TOOL_MANAGER_OPTIONS = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 13002, 2);
|
|
|
|
|
|
|
|
|
|
internal static MEMORY_CELL TOOL_MANAGER_OPTIONS = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 13002, 2);
|
|
|
|
|
// internal static MEMORY_CELL MAGAZINE_TYPES = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 13062, 4);
|
|
|
|
|
// internal static MEMORY_CELL MAGAZINE_POSITIONS_NUMBER = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 13072, 4);
|
|
|
|
|
|
|
|
|
|
internal static MEMORY_CELL MAGAZINE_TYPES = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 13062, 4);
|
|
|
|
|
internal static MEMORY_CELL MAGAZINE_POSITIONS_NUMBER = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 13072, 4);
|
|
|
|
|
// internal static MEMORY_CELL MAGAZINES_ENABLED_CMD = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 13082, 2);
|
|
|
|
|
// internal static MEMORY_CELL MAGAZINES_TOOLING_CMD = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 13084, 2);
|
|
|
|
|
|
|
|
|
|
internal static MEMORY_CELL MAGAZINES_ENABLED_CMD = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 13082, 2);
|
|
|
|
|
internal static MEMORY_CELL MAGAZINES_TOOLING_CMD = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 13084, 2);
|
|
|
|
|
// internal static MEMORY_CELL TOOL_STATUS_UPDATED_CMD = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 13003, 2);
|
|
|
|
|
// internal static MEMORY_CELL TOOL_LIFE_UPDATED_CMD = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 13005, 2);
|
|
|
|
|
// internal static MEMORY_CELL TOOL_STATUS_UPDATED_ACK = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 13007, 2);
|
|
|
|
|
// internal static MEMORY_CELL TOOL_LIFE_UPDATED_ACK = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 13009, 2);
|
|
|
|
|
|
|
|
|
|
internal static MEMORY_CELL TOOL_STATUS_UPDATED_CMD = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 13003, 2);
|
|
|
|
|
internal static MEMORY_CELL TOOL_LIFE_UPDATED_CMD = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 13005, 2);
|
|
|
|
|
internal static MEMORY_CELL TOOL_STATUS_UPDATED_ACK = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 13007, 2);
|
|
|
|
|
internal static MEMORY_CELL TOOL_LIFE_UPDATED_ACK = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 13009, 2);
|
|
|
|
|
|
|
|
|
|
internal static MEMORY_CELL TOOL_STATUS_UPDATED_DATA = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 13011, 10);
|
|
|
|
|
internal static MEMORY_CELL TOOL_LIFE_UPDATED_DATA = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 13022, 40);
|
|
|
|
|
}
|
|
|
|
|
// internal static MEMORY_CELL TOOL_STATUS_UPDATED_DATA = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 13011, 10);
|
|
|
|
|
// internal static MEMORY_CELL TOOL_LIFE_UPDATED_DATA = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 13022, 40);
|
|
|
|
|
//}
|
|
|
|
|
}
|
|
|
|
|
internal static class MEMORY_ADDRESS
|
|
|
|
|
{
|
|
|
|
|
internal const int STARTING_ADDRESS = 50000;
|
|
|
|
|
internal static MEMORY_CELL FUNCTION_ACCESS = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 50005, 8);
|
|
|
|
|
|
|
|
|
|
internal static MEMORY_CELL PRE_POST_POWER_ON = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 1000, 2);
|
|
|
|
|
internal static MEMORY_CELL PRE_POST_POWER_ON_CLICKABLE = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 1002, 2);
|
|
|
|
|
internal static MEMORY_CELL PRE_POST_POWER_ON_ACK = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 1004, 2);
|
|
|
|
|
internal static MEMORY_CELL PRE_POST_POWER_ON_CLICKED = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 1006, 2);
|
|
|
|
|
|
|
|
|
|
internal static MEMORY_CELL AXIS_RESET_PROCEDURE = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52607, 7, 1);
|
|
|
|
|
|
|
|
|
|
internal static MEMORY_CELL PROCESS_STATUS = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52581, 0, 24);
|
|
|
|
|
internal static MEMORY_CELL SELECTED_PROCESS = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52581, 2, 24);
|
|
|
|
|
internal static MEMORY_CELL SELECT_PROCESS = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52605, 1);
|
|
|
|
|
|
|
|
|
|
internal static MEMORY_CELL COUNTERS = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 43, 0, 40);
|
|
|
|
|
|
|
|
|
|
internal static MEMORY_CELL SELECTED_AXIS = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52624, 0, 1);
|
|
|
|
|
internal static MEMORY_CELL SELECT_AXIS = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52625, 1, 1);
|
|
|
|
|
|
|
|
|
|
internal static MEMORY_CELL NC_SOFTKEYS_VALUE = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52608, 0, 4);
|
|
|
|
|
internal static MEMORY_CELL NC_SOFTKEYS_CLICKABLE = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52612, 0, 4);
|
|
|
|
|
internal static MEMORY_CELL NC_SOFT_KEYS_ACK = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52616, 4);
|
|
|
|
|
internal static MEMORY_CELL NC_SOFT_KEYS_CLICKED = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52620, 4);
|
|
|
|
|
|
|
|
|
|
internal static MEMORY_CELL USER_SOFTKEYS_VALUE = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52626, 0, 16);
|
|
|
|
|
internal static MEMORY_CELL USER_SOFTKEYS_CLICKABLE = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52642, 0, 16);
|
|
|
|
|
internal static MEMORY_CELL USER_SOFT_KEYS_ACK = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52658, 16);
|
|
|
|
|
internal static MEMORY_CELL USER_SOFT_KEYS_CLICKED = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52674, 16);
|
|
|
|
|
|
|
|
|
|
internal static MEMORY_CELL ALARMS_STATUS = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 1000, 128);
|
|
|
|
|
internal static MEMORY_CELL ALARMS_DATA = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 1128, 1024);
|
|
|
|
|
|
|
|
|
|
internal static MEMORY_CELL ALARM_ACK = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 2152, 128);
|
|
|
|
|
internal static MEMORY_CELL ALARM_RESTORATION_STROBE = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 2280, 128);
|
|
|
|
|
internal static MEMORY_CELL ALARM_REFRESH_STROBE = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 2408, 128);
|
|
|
|
|
|
|
|
|
|
internal static MEMORY_CELL HEADS_DATA = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52690, 240);
|
|
|
|
|
|
|
|
|
|
internal static MEMORY_CELL HEADS_ACK = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52921, 4);
|
|
|
|
|
internal static MEMORY_CELL HEADS_STROBE_INCREMENT = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52924, 4);
|
|
|
|
|
internal static MEMORY_CELL HEADS_STROBE_DECREMENT = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 52927, 4);
|
|
|
|
|
|
|
|
|
|
// Tool manager areas
|
|
|
|
|
internal static MEMORY_CELL TOOL_MANAGER_COMMAND = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 13000, 2);
|
|
|
|
|
|
|
|
|
|
internal static MEMORY_CELL TOOL_MANAGER_STATUS = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 13001, 2);
|
|
|
|
|
|
|
|
|
|
internal static MEMORY_CELL TOOL_MANAGER_OPTIONS = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 13002, 2);
|
|
|
|
|
|
|
|
|
|
internal static MEMORY_CELL MAGAZINE_TYPES = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 13062, 4);
|
|
|
|
|
internal static MEMORY_CELL MAGAZINE_POSITIONS_NUMBER = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 13072, 4);
|
|
|
|
|
|
|
|
|
|
internal static MEMORY_CELL MAGAZINES_ENABLED_CMD = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 13082, 2);
|
|
|
|
|
internal static MEMORY_CELL MAGAZINES_TOOLING_CMD = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 13084, 2);
|
|
|
|
|
|
|
|
|
|
internal static MEMORY_CELL TOOL_STATUS_UPDATED_CMD = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 13003, 2);
|
|
|
|
|
internal static MEMORY_CELL TOOL_LIFE_UPDATED_CMD = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 13005, 2);
|
|
|
|
|
internal static MEMORY_CELL TOOL_STATUS_UPDATED_ACK = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 13007, 2);
|
|
|
|
|
internal static MEMORY_CELL TOOL_LIFE_UPDATED_ACK = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 13009, 2);
|
|
|
|
|
|
|
|
|
|
internal static MEMORY_CELL TOOL_STATUS_UPDATED_DATA = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 13011, 10);
|
|
|
|
|
internal static MEMORY_CELL TOOL_LIFE_UPDATED_DATA = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 13022, 40);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|