Fix osai library
This commit is contained in:
@@ -77,6 +77,7 @@ namespace CMS_CORE_Application
|
||||
List<AxisModel> axesNames = new List<AxisModel>();
|
||||
List<FunctionalityModel> functionality = new List<FunctionalityModel>();
|
||||
AxisResetDataModel axesReset = new AxisResetDataModel();
|
||||
ProcessDataModel processData = new ProcessDataModel();
|
||||
|
||||
byte axisId = 0;
|
||||
|
||||
@@ -89,7 +90,6 @@ namespace CMS_CORE_Application
|
||||
|
||||
while (true)
|
||||
{
|
||||
|
||||
sw.Restart();
|
||||
cmsError = N.PROC_RMode(1, ref mode);
|
||||
if (cmsError.IsError())
|
||||
@@ -136,7 +136,7 @@ namespace CMS_CORE_Application
|
||||
error = true;
|
||||
SetError(Lines, cmsError);
|
||||
}
|
||||
N.PLC_WRefreshMessage(1023);
|
||||
N.PLC_WRefreshMessage(445);
|
||||
|
||||
N.PLC_RPowerOnData(ref powerOn);
|
||||
|
||||
@@ -148,18 +148,20 @@ namespace CMS_CORE_Application
|
||||
cmsError = N.PLC_RNcSoftKeys(ref keys);
|
||||
cmsError = N.PLC_WNcSoftKey(1);
|
||||
|
||||
N.PROC_RStatusAndData(2, ref processData);
|
||||
|
||||
//cmsError = N.AXES_RAxesNames(2, ref axesNames);
|
||||
//cmsError = N.AXES_WSelectAxis(2);
|
||||
|
||||
N.PROC_WSelectProcess(4);
|
||||
//cmsError = N.AXES_RSelectedAxis(ref axisId);
|
||||
//cmsError = N.PLC_WRefreshAllMessages();
|
||||
cmsError = N.PLC_RHeadsData(headsTest, 1);
|
||||
//cmsError = N.PLC_WHeadOverride(19, HEAD_OVERRIDE_SIGN.MINUS);
|
||||
cmsError = N.PLC_WHeadOverride(1, HEAD_OVERRIDE_SIGN.PLUS);
|
||||
|
||||
//Dictionary<int, string> messages = new Dictionary<int, string>();
|
||||
//cmsError = N.NC_GetTranslatedPlcMessages("en", ref messages);
|
||||
Dictionary<int, string> messages = new Dictionary<int, string>();
|
||||
cmsError = N.NC_GetTranslatedPlcMessages("fr", ref messages);
|
||||
|
||||
//cmsError = N.PROC_RSelectedProcess(ref procnum);
|
||||
cmsError = N.PROC_RSelectedProcess(ref procnum);
|
||||
cmsError = N.PLC_RUserSoftKeys(ref keys);
|
||||
|
||||
sw.Stop();
|
||||
|
||||
@@ -198,10 +198,11 @@ namespace CMS_CORE_Library
|
||||
public string PartProgramName;
|
||||
public string Status;
|
||||
public bool Visible;
|
||||
public byte Reps;
|
||||
public ushort Reps;
|
||||
public bool IsSelected;
|
||||
}
|
||||
|
||||
public struct FunctionalityModel
|
||||
public class FunctionalityModel
|
||||
{
|
||||
public uint Id;
|
||||
public bool IsActive;
|
||||
|
||||
@@ -11,7 +11,9 @@ using System.Linq;
|
||||
using System.ServiceModel;
|
||||
using System.ServiceModel.Description;
|
||||
using System.Threading;
|
||||
using static CMS_CORE.Nc;
|
||||
using static CMS_CORE_Library.DataStructures;
|
||||
using static CMS_CORE.Demo.MEMORY_ADDRESS;
|
||||
|
||||
namespace CMS_CORE.Demo
|
||||
{
|
||||
@@ -305,9 +307,9 @@ namespace CMS_CORE.Demo
|
||||
|
||||
// // Read status alarm data data from memory
|
||||
// CmsError cmsError = MEM_RWIntegerList(R, 0,
|
||||
// MEMORY_ADDRESS.ALARMS_STATUS.MemType,
|
||||
// MEMORY_ADDRESS.ALARMS_STATUS.Address,
|
||||
// MEMORY_ADDRESS.ALARMS_STATUS.Size / 4,
|
||||
// ALARMS_STATUS.MemType,
|
||||
// ALARMS_STATUS.Address,
|
||||
// ALARMS_STATUS.Size / 4,
|
||||
// ref readValues);
|
||||
|
||||
// bool[] statusBits = new BitArray(readValues.ToArray()).Cast<bool>().ToArray();
|
||||
@@ -320,7 +322,7 @@ namespace CMS_CORE.Demo
|
||||
// if (statusBits[i])
|
||||
// {
|
||||
// // Read data from plc
|
||||
// cmsError = MEM_RWByte(R, 0, MEMORY_ADDRESS.ALARMS_DATA.MemType, MEMORY_ADDRESS.ALARMS_DATA.Address + i, 0, ref alarmData);
|
||||
// cmsError = MEM_RWByte(R, 0, ALARMS_DATA.MemType, ALARMS_DATA.Address + i, 0, ref alarmData);
|
||||
// if (cmsError.IsError())
|
||||
// return cmsError;
|
||||
// var dataBits = new BitArray(new int[] { alarmData }).Cast<bool>().ToArray();
|
||||
@@ -368,9 +370,9 @@ namespace CMS_CORE.Demo
|
||||
|
||||
// Read on data from memory
|
||||
CmsError cmsError = MEM_RWIntegerList(R, 0,
|
||||
MEMORY_ADDRESS.ALARMS_STATUS.MemType,
|
||||
MEMORY_ADDRESS.ALARMS_STATUS.Address,
|
||||
(MEMORY_ADDRESS.ALARMS_STATUS.Size + MEMORY_ADDRESS.ALARMS_DATA.Size) / 4,
|
||||
ALARMS_STATUS.MemType,
|
||||
ALARMS_STATUS.Address,
|
||||
(ALARMS_STATUS.Size + ALARMS_DATA.Size) / 4,
|
||||
ref readValues);
|
||||
|
||||
if (cmsError.IsError())
|
||||
@@ -378,13 +380,13 @@ namespace CMS_CORE.Demo
|
||||
// Convert integer array into bit array
|
||||
bool[] statusBits = new BitArray(readValues.ToArray()).Cast<bool>().ToArray();
|
||||
|
||||
for (int i = 0; i < MEMORY_ADDRESS.ALARMS_STATUS.Size * 8; i++)
|
||||
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 + (MEMORY_ADDRESS.ALARMS_STATUS.Size * 8);
|
||||
int dataByteAddress = i * 8 + (ALARMS_STATUS.Size * 8);
|
||||
|
||||
var processList = new List<int>();
|
||||
|
||||
@@ -418,12 +420,12 @@ namespace CMS_CORE.Demo
|
||||
bool readValue = false;
|
||||
bool writeValue = true;
|
||||
|
||||
int ackByte = MEMORY_ADDRESS.ALARM_ACK.Address + (((int)id - 1) / 8);
|
||||
int strobeByte = MEMORY_ADDRESS.ALARM_REFRESH_STROBE.Address + (((int)id - 1) / 8);
|
||||
int ackByte = ALARM_ACK.Address + (((int)id - 1) / 8);
|
||||
int strobeByte = ALARM_REFRESH_STROBE.Address + (((int)id - 1) / 8);
|
||||
int alarmBitId = (((int)id - 1) % 8);
|
||||
|
||||
// Check ACK
|
||||
cmsError = MEM_RWBoolean(R, 0, MEMORY_ADDRESS.ALARM_ACK.MemType, ackByte, alarmBitId, ref readValue);
|
||||
cmsError = MEM_RWBoolean(R, 0, ALARM_ACK.MemType, ackByte, alarmBitId, ref readValue);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
@@ -432,12 +434,12 @@ namespace CMS_CORE.Demo
|
||||
return NO_ERROR;
|
||||
|
||||
// Write data
|
||||
cmsError = MEM_RWBoolean(W, 0, MEMORY_ADDRESS.ALARM_REFRESH_STROBE.MemType, strobeByte, alarmBitId, ref writeValue);
|
||||
cmsError = MEM_RWBoolean(W, 0, ALARM_REFRESH_STROBE.MemType, strobeByte, alarmBitId, ref writeValue);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
// Reset wait ack = 1 and reset the strobe
|
||||
cmsError = ResetStrobe(alarmBitId, strobeByte, ackByte, MEMORY_ADDRESS.ALARM_REFRESH_STROBE.MemType);
|
||||
cmsError = ResetStrobe(alarmBitId, strobeByte, ackByte, ALARM_REFRESH_STROBE.MemType);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
@@ -459,7 +461,7 @@ namespace CMS_CORE.Demo
|
||||
int numberOfInteger = (32 / 8) / 4;
|
||||
List<uint> defaultValue = Enumerable.Repeat(uint.MaxValue, numberOfInteger).ToList();
|
||||
|
||||
CmsError cmsError = MEM_RWDWordList(W, 0, MEMORY_ADDRESS.ALARM_REFRESH_STROBE.MemType, MEMORY_ADDRESS.ALARM_REFRESH_STROBE.Address, numberOfInteger, ref defaultValue);
|
||||
CmsError cmsError = MEM_RWDWordList(W, 0, ALARM_REFRESH_STROBE.MemType, ALARM_REFRESH_STROBE.Address, numberOfInteger, ref defaultValue);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
@@ -470,7 +472,7 @@ namespace CMS_CORE.Demo
|
||||
{
|
||||
int readValue = 0;
|
||||
// Read pre power on and post power on data from memory
|
||||
CmsError cmsError = MEM_RWInteger(R, 0, MEMORY_ADDRESS.PRE_POWER_ON.MemType, MEMORY_ADDRESS.PRE_POWER_ON.Address, ref readValue);
|
||||
CmsError cmsError = MEM_RWInteger(R, 0, PRE_POWER_ON.MemType, PRE_POWER_ON.Address, ref readValue);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
@@ -513,10 +515,10 @@ namespace CMS_CORE.Demo
|
||||
// Choose Pre-Power-On or Post-Power-Om
|
||||
if (id < 8)
|
||||
// Pre: memory bit = id
|
||||
cmsError = MEM_RWBoolean(W, 0, MEMORY_ADDRESS.PRE_POWER_ON_CLICKED.MemType, MEMORY_ADDRESS.PRE_POWER_ON_CLICKED.Address, (int)id, ref value);
|
||||
cmsError = MEM_RWBoolean(W, 0, PRE_POWER_ON_CLICKED.MemType, PRE_POWER_ON_CLICKED.Address, (int)id, ref value);
|
||||
else
|
||||
// Post: memory bit = id - 8
|
||||
cmsError = MEM_RWBoolean(W, 0, MEMORY_ADDRESS.POST_POWER_ON_CLICKED.MemType, MEMORY_ADDRESS.POST_POWER_ON_CLICKED.Address, (int)id - 8, ref value);
|
||||
cmsError = MEM_RWBoolean(W, 0, POST_POWER_ON_CLICKED.MemType, POST_POWER_ON_CLICKED.Address, (int)id - 8, ref value);
|
||||
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
@@ -528,7 +530,7 @@ namespace CMS_CORE.Demo
|
||||
{
|
||||
List<int> readValues = new List<int>();
|
||||
// Read functions access data from memory
|
||||
CmsError cmsError = MEM_RWIntegerList(R, 0, MEMORY_ADDRESS.FUNCTION_ACCESS.MemType, MEMORY_ADDRESS.FUNCTION_ACCESS.Address, 4, ref readValues);
|
||||
CmsError cmsError = MEM_RWIntegerList(R, 0, FUNCTION_ACCESS.MemType, FUNCTION_ACCESS.Address, 4, ref readValues);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
@@ -552,7 +554,7 @@ namespace CMS_CORE.Demo
|
||||
{
|
||||
byte value = 0;
|
||||
// Read byte from memory
|
||||
CmsError cmsError = MEM_RWByte(R, 0, MEMORY_ADDRESS.AXIS_RESET_PROCEDURE.MemType, MEMORY_ADDRESS.AXIS_RESET_PROCEDURE.Address, 1, ref value);
|
||||
CmsError cmsError = MEM_RWByte(R, 0, AXIS_RESET_PROCEDURE.MemType, AXIS_RESET_PROCEDURE.Address, 1, ref value);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
@@ -576,7 +578,7 @@ namespace CMS_CORE.Demo
|
||||
counters = new List<CounterModel>();
|
||||
List<int> readValues = new List<int>();
|
||||
// Read on data from memory
|
||||
CmsError cmsError = MEM_RWIntegerList(R, 0, MEMORY_ADDRESS.COUNTERS.MemType, MEMORY_ADDRESS.COUNTERS.Address, MEMORY_ADDRESS.COUNTERS.Size / 4, ref readValues);
|
||||
CmsError cmsError = MEM_RWIntegerList(R, 0, COUNTERS.MemType, COUNTERS.Address, COUNTERS.Size / 4, ref readValues);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
@@ -596,7 +598,7 @@ namespace CMS_CORE.Demo
|
||||
|
||||
public override CmsError PLC_RNcSoftKeys(ref List<SoftKeysModel> ncSoftKeys)
|
||||
{
|
||||
CmsError cmsError = PLC_RSoftKeys(MEMORY_ADDRESS.NC_SOFTKEYS_VALUE, MEMORY_ADDRESS.NC_SOFTKEYS_CLICKABLE, ref ncSoftKeys);
|
||||
CmsError cmsError = PLC_RSoftKeys(NC_SOFTKEYS_VALUE, NC_SOFTKEYS_CLICKABLE, ref ncSoftKeys);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
@@ -605,7 +607,7 @@ namespace CMS_CORE.Demo
|
||||
|
||||
public override CmsError PLC_RUserSoftKeys(ref List<SoftKeysModel> softKeys)
|
||||
{
|
||||
CmsError cmsError = PLC_RSoftKeys(MEMORY_ADDRESS.USER_SOFTKEYS_VALUE, MEMORY_ADDRESS.USER_SOFTKEYS_CLICKABLE, ref softKeys);
|
||||
CmsError cmsError = PLC_RSoftKeys(USER_SOFTKEYS_VALUE, USER_SOFTKEYS_CLICKABLE, ref softKeys);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
@@ -657,12 +659,12 @@ namespace CMS_CORE.Demo
|
||||
bool readValue = false;
|
||||
bool writeValue = true;
|
||||
|
||||
int ackByte = MEMORY_ADDRESS.NC_SOFT_KEYS_ACK.Address + (((int)id - 1) / 8);
|
||||
int strobeByte = MEMORY_ADDRESS.NC_SOFT_KEYS_CLICKED.Address + (((int)id - 1) / 8);
|
||||
int ackByte = NC_SOFT_KEYS_ACK.Address + (((int)id - 1) / 8);
|
||||
int strobeByte = NC_SOFT_KEYS_CLICKED.Address + (((int)id - 1) / 8);
|
||||
int softkeyBitId = (((int)id - 1) % 8);
|
||||
|
||||
// Check ACK
|
||||
cmsError = MEM_RWBoolean(R, 0, MEMORY_ADDRESS.NC_SOFT_KEYS_ACK.MemType, ackByte, softkeyBitId, ref readValue);
|
||||
cmsError = MEM_RWBoolean(R, 0, NC_SOFT_KEYS_ACK.MemType, ackByte, softkeyBitId, ref readValue);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
@@ -671,12 +673,12 @@ namespace CMS_CORE.Demo
|
||||
return NO_ERROR;
|
||||
|
||||
// Write data
|
||||
cmsError = MEM_RWBoolean(W, 0, MEMORY_ADDRESS.NC_SOFT_KEYS_CLICKED.MemType, strobeByte, softkeyBitId, ref writeValue);
|
||||
cmsError = MEM_RWBoolean(W, 0, NC_SOFT_KEYS_CLICKED.MemType, strobeByte, softkeyBitId, ref writeValue);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
// Reset wait ack = 1 and reset the strobe
|
||||
cmsError = ResetStrobe(softkeyBitId, strobeByte, ackByte, MEMORY_ADDRESS.NC_SOFT_KEYS_CLICKED.MemType);
|
||||
cmsError = ResetStrobe(softkeyBitId, strobeByte, ackByte, NC_SOFT_KEYS_CLICKED.MemType);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
@@ -693,12 +695,12 @@ namespace CMS_CORE.Demo
|
||||
bool readValue = false;
|
||||
bool writeValue = true;
|
||||
|
||||
int ackByte = MEMORY_ADDRESS.USER_SOFT_KEYS_ACK.Address + (((int)id - 1) / 8);
|
||||
int strobeByte = MEMORY_ADDRESS.USER_SOFT_KEYS_CLICKED.Address + (((int)id - 1) / 8);
|
||||
int ackByte = USER_SOFT_KEYS_ACK.Address + (((int)id - 1) / 8);
|
||||
int strobeByte = USER_SOFT_KEYS_CLICKED.Address + (((int)id - 1) / 8);
|
||||
int softkeyBitId = (((int)id - 1) % 8);
|
||||
|
||||
// Check ACK
|
||||
cmsError = MEM_RWBoolean(R, 0, MEMORY_ADDRESS.USER_SOFT_KEYS_ACK.MemType, ackByte, softkeyBitId, ref readValue);
|
||||
cmsError = MEM_RWBoolean(R, 0, USER_SOFT_KEYS_ACK.MemType, ackByte, softkeyBitId, ref readValue);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
@@ -707,12 +709,12 @@ namespace CMS_CORE.Demo
|
||||
return NO_ERROR;
|
||||
|
||||
// Write data
|
||||
cmsError = MEM_RWBoolean(W, 0, MEMORY_ADDRESS.USER_SOFT_KEYS_CLICKED.MemType, strobeByte, softkeyBitId, ref writeValue);
|
||||
cmsError = MEM_RWBoolean(W, 0, USER_SOFT_KEYS_CLICKED.MemType, strobeByte, softkeyBitId, ref writeValue);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
// Reset wait ack = 1 and reset the strobe
|
||||
cmsError = ResetStrobe(softkeyBitId, strobeByte, ackByte, MEMORY_ADDRESS.USER_SOFT_KEYS_CLICKED.MemType);
|
||||
cmsError = ResetStrobe(softkeyBitId, strobeByte, ackByte, USER_SOFT_KEYS_CLICKED.MemType);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
@@ -729,11 +731,11 @@ namespace CMS_CORE.Demo
|
||||
List<int> readInts = new List<int>();
|
||||
List<byte> readValues = new List<byte>();
|
||||
// Find the size of a single head
|
||||
int headsByte = (MEMORY_ADDRESS.HEADS_DATA.Size / HEADS_NUMBER);
|
||||
int headsByte = (HEADS_DATA.Size / HEADS_NUMBER);
|
||||
double headsInts = Math.Ceiling((double)(headsByte / 4 ) + 1);
|
||||
|
||||
// Read data for N heads
|
||||
CmsError cmsError = MEM_RWIntegerList(R, 0, MEMORY_ADDRESS.HEADS_DATA.MemType, 0,MEMORY_ADDRESS.HEADS_DATA.Address, (int)headsInts * number, ref readInts);
|
||||
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();
|
||||
@@ -769,14 +771,14 @@ namespace CMS_CORE.Demo
|
||||
bool readValue = false;
|
||||
bool writeValue = true;
|
||||
|
||||
MEMORY_CELL currentStrobeCell = sign == HEAD_OVERRIDE_SIGN.PLUS ? MEMORY_ADDRESS.HEADS_STROBE_INCREMENT : MEMORY_ADDRESS.HEADS_STROBE_DECREMENT;
|
||||
MEMORY_CELL currentStrobeCell = sign == HEAD_OVERRIDE_SIGN.PLUS ? HEADS_STROBE_INCREMENT : HEADS_STROBE_DECREMENT;
|
||||
|
||||
int ackByte = MEMORY_ADDRESS.HEADS_ACK.Address + (((int)id - 1) / 8);
|
||||
int ackByte = HEADS_ACK.Address + (((int)id - 1) / 8);
|
||||
int strobeByte = currentStrobeCell.Address + (((int)id - 1) / 8);
|
||||
int headBit = (((int)id - 1) % 8);
|
||||
|
||||
// Check ACK
|
||||
cmsError = MEM_RWBoolean(R, 0, MEMORY_ADDRESS.HEADS_ACK.MemType, ackByte, headBit, ref readValue);
|
||||
cmsError = MEM_RWBoolean(R, 0, HEADS_ACK.MemType, ackByte, headBit, ref readValue);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
@@ -924,7 +926,7 @@ namespace CMS_CORE.Demo
|
||||
|
||||
ushort readValue = 0;
|
||||
// Read processes status from memory
|
||||
cmsError = MEM_RWWord(R, 0, MEMORY_ADDRESS.PRE_POWER_ON.MemType, MEMORY_ADDRESS.PROCESS_STATUS.Address + 2 * (procNumber - 1), ref readValue);
|
||||
cmsError = MEM_RWWord(R, 0, PROCESS_STATUS.MemType, PROCESS_STATUS.Address + 2 * (procNumber - 1), ref readValue);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
@@ -936,6 +938,7 @@ namespace CMS_CORE.Demo
|
||||
// Populate response structure
|
||||
processData.Type = bits[0] ? "AUX" : "WORK";
|
||||
processData.IsInAlarm = bits[1];
|
||||
processData.IsSelected = bits[2];
|
||||
|
||||
// Choose process status
|
||||
if (bits[3])
|
||||
@@ -963,7 +966,7 @@ namespace CMS_CORE.Demo
|
||||
byte processNum = 0;
|
||||
|
||||
// Read memory from plc
|
||||
cmsError = MEM_RWByte(R, 0, MEMORY_ADDRESS.SELECTED_PROCESS.MemType, MEMORY_ADDRESS.SELECTED_PROCESS.Address, 1, ref processNum);
|
||||
cmsError = MEM_RWByte(R, 0, SELECTED_PROCESS.MemType, SELECTED_PROCESS.Address, 1, ref processNum);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
@@ -983,7 +986,7 @@ namespace CMS_CORE.Demo
|
||||
return INCORRECT_PARAMETERS_ERROR;
|
||||
|
||||
// Write process number
|
||||
cmsError = MEM_RWByte(W, 0, MEMORY_ADDRESS.SELECT_PROCESS.MemType, MEMORY_ADDRESS.SELECT_PROCESS.Address, 1, ref processNum);
|
||||
cmsError = MEM_RWByte(W, 0, SELECT_PROCESS.MemType, SELECT_PROCESS.Address, 1, ref processNum);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
@@ -1153,7 +1156,7 @@ namespace CMS_CORE.Demo
|
||||
public override CmsError AXES_RSelectedAxis(ref byte axisId)
|
||||
{
|
||||
// Read byte from memory
|
||||
CmsError cmsError = MEM_RWByte(R, 0, MEMORY_ADDRESS.SELECTED_AXIS.MemType, MEMORY_ADDRESS.SELECTED_AXIS.Address, 1, ref axisId);
|
||||
CmsError cmsError = MEM_RWByte(R, 0, SELECTED_AXIS.MemType, SELECTED_AXIS.Address, 1, ref axisId);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
@@ -1163,7 +1166,7 @@ namespace CMS_CORE.Demo
|
||||
public override CmsError AXES_WSelectAxis(byte axisId)
|
||||
{
|
||||
// Write byte from memory
|
||||
CmsError cmsError = MEM_RWByte(W, 0, MEMORY_ADDRESS.SELECT_AXIS.MemType, MEMORY_ADDRESS.SELECT_AXIS.Address, 1, ref axisId);
|
||||
CmsError cmsError = MEM_RWByte(W, 0, SELECT_AXIS.MemType, SELECT_AXIS.Address, 1, ref axisId);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
@@ -1764,60 +1767,60 @@ namespace CMS_CORE.Demo
|
||||
}
|
||||
|
||||
#endregion Subordinate Private Functions
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#region Memory addresses
|
||||
|
||||
internal static class MEMORY_ADDRESS
|
||||
{
|
||||
internal const int STARTING_ADDRESS = 0;
|
||||
|
||||
internal static MEMORY_CELL FUNCTION_ACCESS = new MEMORY_CELL(MEMORY_TYPE.Demo, 13, 8);
|
||||
|
||||
internal static MEMORY_CELL PRE_POWER_ON = new MEMORY_CELL(MEMORY_TYPE.Demo, 21, 1);
|
||||
internal static MEMORY_CELL PRE_POWER_ON_CLICKABLE = new MEMORY_CELL(MEMORY_TYPE.Demo, 22, 1);
|
||||
|
||||
internal static MEMORY_CELL POST_POWER_ON = new MEMORY_CELL(MEMORY_TYPE.Demo, 23, 1);
|
||||
internal static MEMORY_CELL POST_POWER_ON_CLICKABLE = new MEMORY_CELL(MEMORY_TYPE.Demo, 24, 1);
|
||||
|
||||
internal static MEMORY_CELL PRE_POWER_ON_CLICKED = new MEMORY_CELL(MEMORY_TYPE.Demo, 25, 1);
|
||||
internal static MEMORY_CELL POST_POWER_ON_CLICKED = new MEMORY_CELL(MEMORY_TYPE.Demo, 26, 1);
|
||||
|
||||
internal static MEMORY_CELL AXIS_RESET_PROCEDURE = new MEMORY_CELL(MEMORY_TYPE.Demo, 27, 7, 2);
|
||||
|
||||
internal static MEMORY_CELL SELECTED_PROCESS = new MEMORY_CELL(MEMORY_TYPE.Demo, 29, 1);
|
||||
internal static MEMORY_CELL SELECT_PROCESS = new MEMORY_CELL(MEMORY_TYPE.Demo, 30, 1);
|
||||
internal static MEMORY_CELL PROCESS_STATUS = new MEMORY_CELL(MEMORY_TYPE.Demo, 31, 0, 12);
|
||||
|
||||
internal static MEMORY_CELL COUNTERS = new MEMORY_CELL(MEMORY_TYPE.Demo, 43, 0, 40);
|
||||
|
||||
internal static MEMORY_CELL SELECTED_AXIS = new MEMORY_CELL(MEMORY_TYPE.Demo, 83, 0, 1);
|
||||
internal static MEMORY_CELL SELECT_AXIS = new MEMORY_CELL(MEMORY_TYPE.Demo, 84, 0, 1);
|
||||
|
||||
internal static MEMORY_CELL NC_SOFTKEYS_VALUE = new MEMORY_CELL(MEMORY_TYPE.Demo, 85, 0, 4);
|
||||
internal static MEMORY_CELL NC_SOFTKEYS_CLICKABLE = new MEMORY_CELL(MEMORY_TYPE.Demo, 89, 0, 4);
|
||||
internal static MEMORY_CELL NC_SOFT_KEYS_CLICKED = new MEMORY_CELL(MEMORY_TYPE.Demo, 93, 4);
|
||||
internal static MEMORY_CELL NC_SOFT_KEYS_ACK = new MEMORY_CELL(MEMORY_TYPE.Demo, 97, 4);
|
||||
|
||||
internal static MEMORY_CELL USER_SOFTKEYS_VALUE = new MEMORY_CELL(MEMORY_TYPE.Demo, 101, 0, 16);
|
||||
internal static MEMORY_CELL USER_SOFTKEYS_CLICKABLE = new MEMORY_CELL(MEMORY_TYPE.Demo, 117, 0, 16);
|
||||
internal static MEMORY_CELL USER_SOFT_KEYS_CLICKED = new MEMORY_CELL(MEMORY_TYPE.Demo, 133, 16);
|
||||
internal static MEMORY_CELL USER_SOFT_KEYS_ACK = new MEMORY_CELL(MEMORY_TYPE.Demo, 149, 16);
|
||||
|
||||
internal static MEMORY_CELL ALARMS_STATUS = new MEMORY_CELL(MEMORY_TYPE.Demo, 165, 4);
|
||||
internal static MEMORY_CELL ALARMS_DATA = new MEMORY_CELL(MEMORY_TYPE.Demo, 169, 32);
|
||||
|
||||
internal static MEMORY_CELL ALARM_ACK = new MEMORY_CELL(MEMORY_TYPE.Demo, 201, 4);
|
||||
internal static MEMORY_CELL ALARM_REFRESH_STROBE = new MEMORY_CELL(MEMORY_TYPE.Demo, 205, 4);
|
||||
|
||||
internal static MEMORY_CELL HEADS_DATA = new MEMORY_CELL(MEMORY_TYPE.Demo, 209, 220);
|
||||
|
||||
internal static MEMORY_CELL HEADS_ACK = new MEMORY_CELL(MEMORY_TYPE.Demo, 429, 4);
|
||||
internal static MEMORY_CELL HEADS_STROBE_INCREMENT = new MEMORY_CELL(MEMORY_TYPE.Demo, 432, 4);
|
||||
internal static MEMORY_CELL HEADS_STROBE_DECREMENT = new MEMORY_CELL(MEMORY_TYPE.Demo, 436, 4);
|
||||
}
|
||||
|
||||
#endregion Memory addresses
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#region Memory addresses
|
||||
|
||||
internal static class MEMORY_ADDRESS
|
||||
{
|
||||
internal const int STARTING_ADDRESS = 0;
|
||||
|
||||
internal static MEMORY_CELL FUNCTION_ACCESS = new MEMORY_CELL(MEMORY_TYPE.Demo, 13, 8);
|
||||
|
||||
internal static MEMORY_CELL PRE_POWER_ON = new MEMORY_CELL(MEMORY_TYPE.Demo, 21, 1);
|
||||
internal static MEMORY_CELL PRE_POWER_ON_CLICKABLE = new MEMORY_CELL(MEMORY_TYPE.Demo, 22, 1);
|
||||
|
||||
internal static MEMORY_CELL POST_POWER_ON = new MEMORY_CELL(MEMORY_TYPE.Demo, 23, 1);
|
||||
internal static MEMORY_CELL POST_POWER_ON_CLICKABLE = new MEMORY_CELL(MEMORY_TYPE.Demo, 24, 1);
|
||||
|
||||
internal static MEMORY_CELL PRE_POWER_ON_CLICKED = new MEMORY_CELL(MEMORY_TYPE.Demo, 25, 1);
|
||||
internal static MEMORY_CELL POST_POWER_ON_CLICKED = new MEMORY_CELL(MEMORY_TYPE.Demo, 26, 1);
|
||||
|
||||
internal static MEMORY_CELL AXIS_RESET_PROCEDURE = new MEMORY_CELL(MEMORY_TYPE.Demo, 27, 7, 2);
|
||||
|
||||
internal static MEMORY_CELL SELECTED_PROCESS = new MEMORY_CELL(MEMORY_TYPE.Demo, 29, 1);
|
||||
internal static MEMORY_CELL SELECT_PROCESS = new MEMORY_CELL(MEMORY_TYPE.Demo, 30, 1);
|
||||
internal static MEMORY_CELL PROCESS_STATUS = new MEMORY_CELL(MEMORY_TYPE.Demo, 31, 0, 12);
|
||||
|
||||
internal static MEMORY_CELL COUNTERS = new MEMORY_CELL(MEMORY_TYPE.Demo, 43, 0, 40);
|
||||
|
||||
internal static MEMORY_CELL SELECTED_AXIS = new MEMORY_CELL(MEMORY_TYPE.Demo, 83, 0, 1);
|
||||
internal static MEMORY_CELL SELECT_AXIS = new MEMORY_CELL(MEMORY_TYPE.Demo, 84, 0, 1);
|
||||
|
||||
internal static MEMORY_CELL NC_SOFTKEYS_VALUE = new MEMORY_CELL(MEMORY_TYPE.Demo, 85, 0, 4);
|
||||
internal static MEMORY_CELL NC_SOFTKEYS_CLICKABLE = new MEMORY_CELL(MEMORY_TYPE.Demo, 89, 0, 4);
|
||||
internal static MEMORY_CELL NC_SOFT_KEYS_CLICKED = new MEMORY_CELL(MEMORY_TYPE.Demo, 93, 4);
|
||||
internal static MEMORY_CELL NC_SOFT_KEYS_ACK = new MEMORY_CELL(MEMORY_TYPE.Demo, 97, 4);
|
||||
|
||||
internal static MEMORY_CELL USER_SOFTKEYS_VALUE = new MEMORY_CELL(MEMORY_TYPE.Demo, 101, 0, 16);
|
||||
internal static MEMORY_CELL USER_SOFTKEYS_CLICKABLE = new MEMORY_CELL(MEMORY_TYPE.Demo, 117, 0, 16);
|
||||
internal static MEMORY_CELL USER_SOFT_KEYS_CLICKED = new MEMORY_CELL(MEMORY_TYPE.Demo, 133, 16);
|
||||
internal static MEMORY_CELL USER_SOFT_KEYS_ACK = new MEMORY_CELL(MEMORY_TYPE.Demo, 149, 16);
|
||||
|
||||
internal static MEMORY_CELL ALARMS_STATUS = new MEMORY_CELL(MEMORY_TYPE.Demo, 165, 4);
|
||||
internal static MEMORY_CELL ALARMS_DATA = new MEMORY_CELL(MEMORY_TYPE.Demo, 169, 32);
|
||||
|
||||
internal static MEMORY_CELL ALARM_ACK = new MEMORY_CELL(MEMORY_TYPE.Demo, 201, 4);
|
||||
internal static MEMORY_CELL ALARM_REFRESH_STROBE = new MEMORY_CELL(MEMORY_TYPE.Demo, 205, 4);
|
||||
|
||||
internal static MEMORY_CELL HEADS_DATA = new MEMORY_CELL(MEMORY_TYPE.Demo, 209, 220);
|
||||
|
||||
internal static MEMORY_CELL HEADS_ACK = new MEMORY_CELL(MEMORY_TYPE.Demo, 429, 4);
|
||||
internal static MEMORY_CELL HEADS_STROBE_INCREMENT = new MEMORY_CELL(MEMORY_TYPE.Demo, 432, 4);
|
||||
internal static MEMORY_CELL HEADS_STROBE_DECREMENT = new MEMORY_CELL(MEMORY_TYPE.Demo, 436, 4);
|
||||
}
|
||||
|
||||
#endregion Memory addresses
|
||||
}
|
||||
@@ -17,10 +17,9 @@ namespace CMS_CORE
|
||||
internal ushort Port;
|
||||
internal Boolean UseProxy;
|
||||
internal String LibName = "CMS_CORE_Library.dll";
|
||||
|
||||
|
||||
//Osai Variable
|
||||
internal string OSAI_PlcMessagesPath = @"C:\CMS\OSAI\";
|
||||
|
||||
internal string OSAI_WinNbiPath = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + @"\OSAI\WinNBI\";
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
+227
-146
@@ -13,6 +13,8 @@ using System.ServiceModel;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using static CMS_CORE_Library.DataStructures;
|
||||
using static CMS_CORE.Nc;
|
||||
using static CMS_CORE.Osai.MEMORY_ADDRESS;
|
||||
|
||||
namespace CMS_CORE.Osai
|
||||
{
|
||||
@@ -33,6 +35,7 @@ namespace CMS_CORE.Osai
|
||||
private BasicHttpBinding HttpBinding;
|
||||
private static Dictionary<int, string> PlcMessages;
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#region Contructor & global methods
|
||||
@@ -118,7 +121,29 @@ namespace CMS_CORE.Osai
|
||||
|
||||
public override CmsError NC_GetTranslatedPlcMessages(string language, ref Dictionary<int, string> messages)
|
||||
{
|
||||
return NO_ERROR;
|
||||
String Path;
|
||||
try
|
||||
{
|
||||
PlcMessages = new Dictionary<int, string>();
|
||||
CultureInfo cultureInfo = CultureInfo.CreateSpecificCulture(language);
|
||||
string langName = "";
|
||||
if (cultureInfo.IsNeutralCulture)
|
||||
langName = cultureInfo.EnglishName;
|
||||
else
|
||||
langName = cultureInfo.Parent.EnglishName;
|
||||
|
||||
//Setup the Path
|
||||
Path = OSAI_PlcMessagesPath + @"Messaggi_" + langName + @".txt";
|
||||
|
||||
//Read From Files
|
||||
messages = File.ReadAllLines(Path).Select(line => line.Split(',')).ToDictionary(line => Convert.ToInt32(line[0]), line => line[1]);
|
||||
|
||||
return NO_ERROR;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return ManageException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Contructor & global methods
|
||||
@@ -402,9 +427,9 @@ namespace CMS_CORE.Osai
|
||||
|
||||
// Read on data from memory
|
||||
CmsError cmsError = MEM_RWIntegerList(R, 0,
|
||||
MEMORY_ADDRESS.ALARMS_STATUS.MemType,
|
||||
MEMORY_ADDRESS.ALARMS_STATUS.Address,
|
||||
(MEMORY_ADDRESS.ALARMS_STATUS.Size + MEMORY_ADDRESS.ALARMS_DATA.Size) / 4, // byte / 4
|
||||
ALARMS_STATUS.MemType,
|
||||
ALARMS_STATUS.Address,
|
||||
(ALARMS_STATUS.Size + ALARMS_DATA.Size) / 4, // byte / 4
|
||||
ref readValues);
|
||||
|
||||
if (cmsError.IsError())
|
||||
@@ -412,7 +437,7 @@ namespace CMS_CORE.Osai
|
||||
// Convert integer array into bit array
|
||||
bool[] statusBits = new BitArray(readValues.ToArray()).Cast<bool>().ToArray();
|
||||
|
||||
for (int i = 0; i < MEMORY_ADDRESS.ALARMS_STATUS.Size * 8; i++)
|
||||
for (int i = 0; i < ALARMS_STATUS.Size * 8; i++)
|
||||
{
|
||||
// If alarm is active
|
||||
if (statusBits[i])
|
||||
@@ -450,7 +475,7 @@ namespace CMS_CORE.Osai
|
||||
public override CmsError PLC_WRestoreMessage(uint id)
|
||||
{
|
||||
// Call restore message
|
||||
CmsError cmsError = PLC_WStrobe(MEMORY_ADDRESS.ALARM_ACK, MEMORY_ADDRESS.ALARM_RESTORATION_STROBE, id);
|
||||
CmsError cmsError = PLC_WStrobe(ALARM_ACK, ALARM_RESTORATION_STROBE, id);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
@@ -460,7 +485,7 @@ namespace CMS_CORE.Osai
|
||||
public override CmsError PLC_WRefreshMessage(uint id)
|
||||
{
|
||||
// Call restore message
|
||||
CmsError cmsError = PLC_WStrobe(MEMORY_ADDRESS.ALARM_ACK, MEMORY_ADDRESS.ALARM_REFRESH_STROBE, id);
|
||||
CmsError cmsError = PLC_WStrobe(ALARM_ACK, ALARM_REFRESH_STROBE, id);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
@@ -472,41 +497,7 @@ namespace CMS_CORE.Osai
|
||||
int numberOfInteger = (ALARMS_NUMBER / 8) / 4; // Number of integers to write 1024 / 8 = byte number
|
||||
List<uint> defaultValue = Enumerable.Repeat(uint.MaxValue, numberOfInteger).ToList();
|
||||
|
||||
CmsError cmsError = MEM_RWDWordList(W, 0, MEMORY_ADDRESS.ALARM_REFRESH_STROBE.MemType, MEMORY_ADDRESS.ALARM_REFRESH_STROBE.Address, numberOfInteger, ref defaultValue);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
private CmsError PLC_WStrobe(MEMORY_CELL ackCell, MEMORY_CELL strobeCell, uint id)
|
||||
{
|
||||
// Check id range
|
||||
if (id > ALARMS_NUMBER)
|
||||
return INCORRECT_PARAMETERS_ERROR;
|
||||
|
||||
CmsError cmsError;
|
||||
bool readValue = false;
|
||||
bool writeValue = true;
|
||||
|
||||
SetupAckStrobeAddresses(ackCell.Address, strobeCell.Address, id, out int ackWord, out int strobeWord, out int alarmBitId);
|
||||
|
||||
// Check ACK
|
||||
cmsError = MEM_RWBoolean(R, 0, ackCell.MemType, ackWord, alarmBitId, 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, alarmBitId, ref writeValue);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
// Reset wait ack = 1 and reset the strobe
|
||||
cmsError = ResetStrobe(alarmBitId, strobeWord, ackWord, ackCell.MemType);
|
||||
CmsError cmsError = MEM_RWDWordList(W, 0, ALARM_REFRESH_STROBE.MemType, ALARM_REFRESH_STROBE.Address, numberOfInteger, ref defaultValue);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
@@ -517,7 +508,7 @@ namespace CMS_CORE.Osai
|
||||
{
|
||||
int readValue = 0;
|
||||
// Read pre power on and post power on data from memory
|
||||
CmsError cmsError = MEM_RWInteger(R, 0, MEMORY_ADDRESS.PRE_POST_POWER_ON.MemType, MEMORY_ADDRESS.PRE_POST_POWER_ON.Address, ref readValue);
|
||||
CmsError cmsError = MEM_RWInteger(R, 0, PRE_POST_POWER_ON.MemType, PRE_POST_POWER_ON.Address, ref readValue);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
@@ -558,7 +549,7 @@ namespace CMS_CORE.Osai
|
||||
return INCORRECT_PARAMETERS_ERROR;
|
||||
|
||||
// Call restore message
|
||||
CmsError cmsError = PLC_WStrobe(MEMORY_ADDRESS.PRE_POST_POWER_ON_ACK, MEMORY_ADDRESS.PRE_POST_POWER_ON_CLICKED, id);
|
||||
CmsError cmsError = PLC_WStrobe(PRE_POST_POWER_ON_ACK, PRE_POST_POWER_ON_CLICKED, id);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
@@ -570,7 +561,7 @@ namespace CMS_CORE.Osai
|
||||
//bool readValue = false;
|
||||
|
||||
//// Check ACK
|
||||
//CmsError cmsError = MEM_RWBoolean(R, 0, MEMORY_ADDRESS.PRE_POST_POWER_ON_ACK.MemType, MEMORY_ADDRESS.PRE_POST_POWER_ON_ACK.Address, (int)id, ref readValue);
|
||||
//CmsError cmsError = MEM_RWBoolean(R, 0, PRE_POST_POWER_ON_ACK.MemType, PRE_POST_POWER_ON_ACK.Address, (int)id, ref readValue);
|
||||
//if (cmsError.IsError())
|
||||
// return cmsError;
|
||||
|
||||
@@ -580,12 +571,12 @@ namespace CMS_CORE.Osai
|
||||
|
||||
//// Bit = id
|
||||
//// Choose Pre-Power-On or Post-Power-Om
|
||||
//cmsError = MEM_RWBoolean(W, 0, MEMORY_ADDRESS.PRE_POST_POWER_ON_CLICKED.MemType, MEMORY_ADDRESS.PRE_POST_POWER_ON_CLICKED.Address, (int)id, ref value);
|
||||
//cmsError = MEM_RWBoolean(W, 0, PRE_POST_POWER_ON_CLICKED.MemType, PRE_POST_POWER_ON_CLICKED.Address, (int)id, ref value);
|
||||
//if (cmsError.IsError())
|
||||
// return cmsError;
|
||||
|
||||
//// Reset till wait ack = 1 and reset the strobe
|
||||
//cmsError = ResetStrobe((int)id, MEMORY_ADDRESS.PRE_POST_POWER_ON_CLICKED.Address, MEMORY_ADDRESS.PRE_POST_POWER_ON_ACK.Address, MEMORY_ADDRESS.PRE_POST_POWER_ON_ACK.MemType);
|
||||
//cmsError = ResetStrobe((int)id, PRE_POST_POWER_ON_CLICKED.Address, PRE_POST_POWER_ON_ACK.Address, PRE_POST_POWER_ON_ACK.MemType);
|
||||
//if (cmsError.IsError())
|
||||
// return cmsError;
|
||||
|
||||
@@ -595,9 +586,9 @@ namespace CMS_CORE.Osai
|
||||
public override CmsError PLC_RFunctionAccess(ref List<FunctionalityModel> functions)
|
||||
{
|
||||
List<int> readValues = new List<int>();
|
||||
int numberOfIntegers = MEMORY_ADDRESS.FUNCTION_ACCESS.Size / 4;
|
||||
int numberOfIntegers = FUNCTION_ACCESS.Size / 4;
|
||||
// Read functions access data from memory
|
||||
CmsError cmsError = MEM_RWIntegerList(R, 0, MEMORY_ADDRESS.FUNCTION_ACCESS.MemType, MEMORY_ADDRESS.FUNCTION_ACCESS.Address, numberOfIntegers, ref readValues);
|
||||
CmsError cmsError = MEM_RWIntegerList(R, 0, FUNCTION_ACCESS.MemType, FUNCTION_ACCESS.Address, numberOfIntegers, ref readValues);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
@@ -621,7 +612,7 @@ namespace CMS_CORE.Osai
|
||||
{
|
||||
byte value = 0;
|
||||
// Read byte from memory
|
||||
CmsError cmsError = MEM_RWByte(R, 0, MEMORY_ADDRESS.AXIS_RESET_PROCEDURE.MemType, MEMORY_ADDRESS.AXIS_RESET_PROCEDURE.Address, 0, ref value);
|
||||
CmsError cmsError = MEM_RWByte(R, 0, AXIS_RESET_PROCEDURE.MemType, AXIS_RESET_PROCEDURE.Address, 0, ref value);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
@@ -649,7 +640,7 @@ namespace CMS_CORE.Osai
|
||||
|
||||
public override CmsError PLC_RNcSoftKeys(ref List<SoftKeysModel> ncSoftKeys)
|
||||
{
|
||||
CmsError cmsError = PLC_RSoftKeys(MEMORY_ADDRESS.NC_SOFTKEYS_VALUE, MEMORY_ADDRESS.NC_SOFTKEYS_CLICKABLE, ref ncSoftKeys);
|
||||
CmsError cmsError = PLC_RSoftKeys(NC_SOFTKEYS_VALUE, NC_SOFTKEYS_CLICKABLE, ref ncSoftKeys);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
@@ -658,7 +649,7 @@ namespace CMS_CORE.Osai
|
||||
|
||||
public override CmsError PLC_RUserSoftKeys(ref List<SoftKeysModel> softKeys)
|
||||
{
|
||||
CmsError cmsError = PLC_RSoftKeys(MEMORY_ADDRESS.USER_SOFTKEYS_VALUE, MEMORY_ADDRESS.USER_SOFTKEYS_CLICKABLE, ref softKeys);
|
||||
CmsError cmsError = PLC_RSoftKeys(USER_SOFTKEYS_VALUE, USER_SOFTKEYS_CLICKABLE, ref softKeys);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
@@ -707,7 +698,7 @@ namespace CMS_CORE.Osai
|
||||
return INCORRECT_PARAMETERS_ERROR;
|
||||
|
||||
// Write strobe into memory
|
||||
CmsError cmsError = PLC_WStrobe(MEMORY_ADDRESS.NC_SOFT_KEYS_ACK, MEMORY_ADDRESS.NC_SOFT_KEYS_CLICKED, id);
|
||||
CmsError cmsError = PLC_WStrobe(NC_SOFT_KEYS_ACK, NC_SOFT_KEYS_CLICKED, id);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
@@ -721,7 +712,7 @@ namespace CMS_CORE.Osai
|
||||
return INCORRECT_PARAMETERS_ERROR;
|
||||
|
||||
// Write strobe into memory
|
||||
CmsError cmsError = PLC_WStrobe(MEMORY_ADDRESS.USER_SOFT_KEYS_ACK, MEMORY_ADDRESS.USER_SOFT_KEYS_CLICKED, id);
|
||||
CmsError cmsError = PLC_WStrobe(USER_SOFT_KEYS_ACK, USER_SOFT_KEYS_CLICKED, id);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
@@ -735,14 +726,18 @@ namespace CMS_CORE.Osai
|
||||
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 = (MEMORY_ADDRESS.HEADS_DATA.Size / HEADS_NUMBER);
|
||||
int headsByte = (HEADS_DATA.Size / HEADS_NUMBER);
|
||||
double headsInts = Math.Ceiling((double)(headsByte / 4) + 1);
|
||||
|
||||
// Read data for N heads
|
||||
CmsError cmsError = MEM_RWByteList(R, 0, MEMORY_ADDRESS.HEADS_DATA.MemType, MEMORY_ADDRESS.HEADS_DATA.Address, 0, headsByte * number, ref readValues);
|
||||
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 readed data
|
||||
for (int i = 0; i < number; i++)
|
||||
@@ -751,12 +746,12 @@ namespace CMS_CORE.Osai
|
||||
var headOffset = i * headsByte;
|
||||
heads.Add(new HeadDataModel()
|
||||
{
|
||||
Id = (uint)i,
|
||||
Id = (uint)i + 1,
|
||||
Process = readValues[headOffset],
|
||||
Override = readValues[headOffset + 1],
|
||||
Load_Abrasive = BitConverter.ToUInt16(readValues.ToArray(), headOffset + 2), // Uint 16 = 2byte
|
||||
ActualSpeed_Pressure = BitConverter.ToInt32(readValues.ToArray(), headOffset + 4), // Int32 = 4byte
|
||||
MountedTool_Vacum = BitConverter.ToInt16(readValues.ToArray(), headOffset + 8), // 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
|
||||
@@ -771,10 +766,53 @@ namespace CMS_CORE.Osai
|
||||
if (id > HEADS_NUMBER)
|
||||
return INCORRECT_PARAMETERS_ERROR;
|
||||
|
||||
MEMORY_CELL currentStrobeCell = sign == HEAD_OVERRIDE_SIGN.PLUS ? MEMORY_ADDRESS.HEADS_STROBE_INCREMENT : MEMORY_ADDRESS.HEADS_STROBE_DECREMENT;
|
||||
MEMORY_CELL currentStrobeCell = sign == HEAD_OVERRIDE_SIGN.PLUS ? HEADS_STROBE_INCREMENT : HEADS_STROBE_DECREMENT;
|
||||
|
||||
// Write strobe into memory
|
||||
CmsError cmsError = PLC_WStrobe(MEMORY_ADDRESS.HEADS_ACK, currentStrobeCell, id);
|
||||
CmsError cmsError = PLC_WStrobe(HEADS_ACK, currentStrobeCell, id);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
private CmsError PLC_WStrobe(MEMORY_CELL ackCell, MEMORY_CELL strobeCell, uint id)
|
||||
{
|
||||
// Check id range
|
||||
if (id > ALARMS_NUMBER)
|
||||
return INCORRECT_PARAMETERS_ERROR;
|
||||
|
||||
CmsError cmsError;
|
||||
bool readValue = false;
|
||||
bool writeValue = true;
|
||||
|
||||
SetupAckStrobeAddresses(ackCell.Address, strobeCell.Address, id, out int ackWord, out int strobeWord, out int alarmBitId);
|
||||
|
||||
// Check Strobe
|
||||
cmsError = MEM_RWBoolean(R, 0, strobeCell.MemType, strobeWord, alarmBitId, ref readValue);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
// If PLC it's performing another request then return
|
||||
if (readValue)
|
||||
return NO_ERROR;
|
||||
|
||||
// Check ACK
|
||||
cmsError = MEM_RWBoolean(R, 0, ackCell.MemType, ackWord, alarmBitId, 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, alarmBitId, ref writeValue);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
// Reset wait ack = 1 and reset the strobe
|
||||
cmsError = ResetStrobe(alarmBitId, strobeWord, ackWord, ackCell.MemType);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
@@ -783,7 +821,7 @@ namespace CMS_CORE.Osai
|
||||
|
||||
private CmsError ResetStrobe(int bitId, int strobeByte, int ackByte, MEMORY_TYPE memType)
|
||||
{
|
||||
int n = 5;
|
||||
int n = 200;
|
||||
bool readValue = false;
|
||||
bool writeValue = false;
|
||||
CmsError cmsError;
|
||||
@@ -809,7 +847,7 @@ namespace CMS_CORE.Osai
|
||||
// Decrement
|
||||
n--;
|
||||
// Wait befor next cycle
|
||||
Thread.Sleep(20);
|
||||
Thread.Sleep(25);
|
||||
}
|
||||
} while (n > 0);
|
||||
|
||||
@@ -1021,53 +1059,86 @@ namespace CMS_CORE.Osai
|
||||
//Get process part program data
|
||||
public override CmsError PROC_RStatusAndData(ushort procNumber, ref ProcessDataModel processData)
|
||||
{
|
||||
//processData.Id = procNumber;
|
||||
//// Read part program name
|
||||
//CmsError cmsError = PROC_RPPName(procNumber, ref processData.PartProgramName);
|
||||
//if (cmsError.IsError())
|
||||
// return cmsError;
|
||||
processData.Id = procNumber;
|
||||
// Read part program name
|
||||
CmsError cmsError = PROC_RPPName(procNumber, ref processData.PartProgramName);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
//ushort readValue = 0;
|
||||
//// Read processes status from memory
|
||||
//cmsError = MEM_RWWord(R, 0, MEMORY_ADDRESS.PRE_POWER_ON.MemType, MEMORY_ADDRESS.PROCESS_STATUS.Address + 2 * (procNumber - 1), ref readValue);
|
||||
//if (cmsError.IsError())
|
||||
// return cmsError;
|
||||
int readValue = 0;
|
||||
// Read processes status from memory
|
||||
cmsError = MEM_RWInteger(R, 0, PROCESS_STATUS.MemType, PROCESS_STATUS.Address + ((procNumber - 1) * 2), ref readValue);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
//byte[] bytes = BitConverter.GetBytes(readValue);
|
||||
byte[] bytes = BitConverter.GetBytes(readValue);
|
||||
|
||||
//// Convert Byte into true/false array
|
||||
//BitArray bits = new BitArray(new byte[] { bytes[0] }); //1st byte -> 0 : Proccess type (AUX-WORK), 1: Process in alarm status, 2: Run, 3: Hold, 4: Read, 5: PartProgramVisible
|
||||
//// Populate response structure
|
||||
//processData.Type = bits[0] ? "WORK" : "AUX";
|
||||
//processData.IsInAlarm = bits[1];
|
||||
//// Choose process status
|
||||
//if (bits[2])
|
||||
// processData.Status = "RUN";
|
||||
//else
|
||||
//{
|
||||
// if (bits[3])
|
||||
// processData.Status = "HOLD";
|
||||
// else
|
||||
// processData.Status = "READY";
|
||||
//}
|
||||
// Convert Byte into true/false array
|
||||
BitArray bits = new BitArray(new byte[] { bytes[0] }); //1st byte -> 0 : Proccess type (AUX-WORK), 1: Process in alarm status, 2: Run, 3: Hold, 4: Read, 5: PartProgramVisible
|
||||
|
||||
//// Get Reps from 2nd byte
|
||||
//processData.Reps = bytes[1];
|
||||
|
||||
//// Get part program info visibility
|
||||
//processData.Visible = bits[5];
|
||||
// Get part program info visibility
|
||||
processData.Visible = bits[0];
|
||||
|
||||
// Populate response structure
|
||||
processData.Type = bits[1] ? "AUX" : "WORK";
|
||||
processData.IsSelected = bits[2];
|
||||
processData.IsInAlarm = bits[3];
|
||||
|
||||
// Choose process status
|
||||
if (bytes[1] == 1)
|
||||
processData.Status = "HOLD";
|
||||
else
|
||||
{
|
||||
if (bytes[1] == 2)
|
||||
processData.Status = "RUN";
|
||||
else
|
||||
processData.Status = "READY";
|
||||
}
|
||||
|
||||
// Get Reps from 3nd-4th byte
|
||||
processData.Reps = BitConverter.ToUInt16(bytes, 2);
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -1384,11 +1455,21 @@ namespace CMS_CORE.Osai
|
||||
|
||||
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 byte from 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;
|
||||
}
|
||||
|
||||
@@ -2390,57 +2471,57 @@ namespace CMS_CORE.Osai
|
||||
}
|
||||
|
||||
#endregion Subordinate Private Functions
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#region Memory addresses
|
||||
|
||||
internal static class MEMORY_ADDRESS
|
||||
{
|
||||
internal const int STARTING_ADDRESS = 12000;
|
||||
|
||||
internal static MEMORY_CELL FUNCTION_ACCESS = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12003, 8);
|
||||
|
||||
internal static MEMORY_CELL PRE_POST_POWER_ON = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12775, 1);
|
||||
internal static MEMORY_CELL PRE_POST_POWER_ON_CLICKABLE = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12776, 1);
|
||||
internal static MEMORY_CELL PRE_POST_POWER_ON_ACK = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12777, 1);
|
||||
internal static MEMORY_CELL PRE_POST_POWER_ON_CLICKED = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12778, 1);
|
||||
|
||||
internal static MEMORY_CELL AXIS_RESET_PROCEDURE = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12792, 7, 1);
|
||||
|
||||
internal static MEMORY_CELL SELECTED_PROCESS = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 29, 1);
|
||||
internal static MEMORY_CELL SELECT_PROCESS = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 30, 1);
|
||||
internal static MEMORY_CELL PROCESS_STATUS = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 31, 0, 12);
|
||||
|
||||
internal static MEMORY_CELL COUNTERS = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 43, 0, 40);
|
||||
|
||||
internal static MEMORY_CELL SELECTED_AXIS = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 83, 0, 1);
|
||||
internal static MEMORY_CELL SELECT_AXIS = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 84, 0, 1);
|
||||
|
||||
internal static MEMORY_CELL NC_SOFTKEYS_VALUE = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12793, 0, 4);
|
||||
internal static MEMORY_CELL NC_SOFTKEYS_CLICKABLE = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12795, 0, 4);
|
||||
internal static MEMORY_CELL NC_SOFT_KEYS_ACK = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12797, 4);
|
||||
internal static MEMORY_CELL NC_SOFT_KEYS_CLICKED = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12799, 4);
|
||||
|
||||
internal static MEMORY_CELL USER_SOFTKEYS_VALUE = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12802, 0, 16);
|
||||
internal static MEMORY_CELL USER_SOFTKEYS_CLICKABLE = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12810, 0, 16);
|
||||
internal static MEMORY_CELL USER_SOFT_KEYS_ACK = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12818, 16);
|
||||
internal static MEMORY_CELL USER_SOFT_KEYS_CLICKED = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12825, 16);
|
||||
|
||||
internal static MEMORY_CELL ALARMS_STATUS = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12007, 128);
|
||||
internal static MEMORY_CELL ALARMS_DATA = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12071, 1024);
|
||||
|
||||
internal static MEMORY_CELL ALARM_ACK = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12583, 128);
|
||||
internal static MEMORY_CELL ALARM_RESTORATION_STROBE = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12647, 128);
|
||||
internal static MEMORY_CELL ALARM_REFRESH_STROBE = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12711, 128);
|
||||
|
||||
internal static MEMORY_CELL HEADS_DATA = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12833, 240);
|
||||
|
||||
internal static MEMORY_CELL HEADS_ACK = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 449, 4);
|
||||
internal static MEMORY_CELL HEADS_STROBE_INCREMENT = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 453, 4);
|
||||
internal static MEMORY_CELL HEADS_STROBE_DECREMENT = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 457, 4);
|
||||
}
|
||||
|
||||
#endregion Memory addresses
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#region Memory addresses
|
||||
|
||||
internal static class MEMORY_ADDRESS
|
||||
{
|
||||
internal const int STARTING_ADDRESS = 12000;
|
||||
|
||||
internal static MEMORY_CELL FUNCTION_ACCESS = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12003, 8);
|
||||
|
||||
internal static MEMORY_CELL PRE_POST_POWER_ON = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12775, 1);
|
||||
internal static MEMORY_CELL PRE_POST_POWER_ON_CLICKABLE = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12776, 1);
|
||||
internal static MEMORY_CELL PRE_POST_POWER_ON_ACK = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12777, 1);
|
||||
internal static MEMORY_CELL PRE_POST_POWER_ON_CLICKED = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12778, 1);
|
||||
|
||||
internal static MEMORY_CELL AXIS_RESET_PROCEDURE = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12792, 7, 1);
|
||||
|
||||
internal static MEMORY_CELL PROCESS_STATUS = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12779, 0, 24);
|
||||
internal static MEMORY_CELL SELECTED_PROCESS = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12779, 2, 24);
|
||||
internal static MEMORY_CELL SELECT_PROCESS = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12791, 1);
|
||||
|
||||
internal static MEMORY_CELL COUNTERS = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 43, 0, 40);
|
||||
|
||||
internal static MEMORY_CELL SELECTED_AXIS = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12801, 0, 1);
|
||||
internal static MEMORY_CELL SELECT_AXIS = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12801, 1, 1);
|
||||
|
||||
internal static MEMORY_CELL NC_SOFTKEYS_VALUE = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12793, 0, 4);
|
||||
internal static MEMORY_CELL NC_SOFTKEYS_CLICKABLE = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12795, 0, 4);
|
||||
internal static MEMORY_CELL NC_SOFT_KEYS_ACK = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12797, 4);
|
||||
internal static MEMORY_CELL NC_SOFT_KEYS_CLICKED = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12799, 4);
|
||||
|
||||
internal static MEMORY_CELL USER_SOFTKEYS_VALUE = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12802, 0, 16);
|
||||
internal static MEMORY_CELL USER_SOFTKEYS_CLICKABLE = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12810, 0, 16);
|
||||
internal static MEMORY_CELL USER_SOFT_KEYS_ACK = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12818, 16);
|
||||
internal static MEMORY_CELL USER_SOFT_KEYS_CLICKED = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12825, 16);
|
||||
|
||||
internal static MEMORY_CELL ALARMS_STATUS = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12007, 128);
|
||||
internal static MEMORY_CELL ALARMS_DATA = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12071, 1024);
|
||||
|
||||
internal static MEMORY_CELL ALARM_ACK = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12583, 128);
|
||||
internal static MEMORY_CELL ALARM_RESTORATION_STROBE = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12647, 128);
|
||||
internal static MEMORY_CELL ALARM_REFRESH_STROBE = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12711, 128);
|
||||
|
||||
internal static MEMORY_CELL HEADS_DATA = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12833, 240);
|
||||
|
||||
internal static MEMORY_CELL HEADS_ACK = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12953, 4);
|
||||
internal static MEMORY_CELL HEADS_STROBE_INCREMENT = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12955, 4);
|
||||
internal static MEMORY_CELL HEADS_STROBE_DECREMENT = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 12957, 4);
|
||||
}
|
||||
|
||||
#endregion Memory addresses
|
||||
}
|
||||
Reference in New Issue
Block a user