Fix M154 Read Data
This commit is contained in:
@@ -4330,8 +4330,8 @@ namespace CMS_CORE_Library.Fanuc
|
||||
internal static MEMORY_CELL M155_INPUT_STROBE = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, STARTING_ADDRESS + 3006, 1);
|
||||
|
||||
internal static MEMORY_CELL M154_SWITCH_ONOFF = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, STARTING_ADDRESS, 2);
|
||||
internal static MEMORY_CELL M154_STROBE = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, STARTING_ADDRESS + 3031, 1);
|
||||
internal static MEMORY_CELL M154_ACK = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, STARTING_ADDRESS + 3032, 1);
|
||||
internal static MEMORY_CELL M154_ACK = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, STARTING_ADDRESS + 3031, 1);
|
||||
internal static MEMORY_CELL M154_STROBE = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, STARTING_ADDRESS + 3032, 1);
|
||||
|
||||
internal static MEMORY_CELL AXES_BUTTON_VISIBLE = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, STARTING_ADDRESS + 3033, 16);
|
||||
|
||||
|
||||
@@ -4173,8 +4173,8 @@ namespace CMS_CORE_Library.Osai
|
||||
internal static MEMORY_CELL M155_INPUT_STROBE = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 4310, 1);
|
||||
|
||||
internal static MEMORY_CELL M154_SWITCH_ONOFF = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 4000, 1, 2);
|
||||
internal static MEMORY_CELL M154_STROBE = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 4312, 1);
|
||||
internal static MEMORY_CELL M154_ACK = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 4314, 1);
|
||||
internal static MEMORY_CELL M154_ACK = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 4312, 1);
|
||||
internal static MEMORY_CELL M154_STROBE = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 4314, 1);
|
||||
|
||||
internal static MEMORY_CELL AXES_BUTTON_VISIBLE = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 4320, 16);
|
||||
|
||||
|
||||
@@ -1121,7 +1121,7 @@ namespace CMS_CORE_Library.Siemens
|
||||
return cmsError;
|
||||
|
||||
byte val = 0;
|
||||
cmsError = MEM_RWByte(R, 0, M154_STROBE.MemType, M154_STROBE.Address, 0, ref val);
|
||||
cmsError = MEM_RWByte(R, 0, M154_STROBE.MemType, M154_STROBE.Address, M154_STROBE.SubAddress, 0, ref val);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
@@ -1156,7 +1156,7 @@ namespace CMS_CORE_Library.Siemens
|
||||
|
||||
public override CmsError PLC_W154ManageAck(int processId)
|
||||
{
|
||||
return PLC_ManageActiveAck(M154_STROBE.Address, processId - 1, M154_ACK.Address, processId - 1, M154_STROBE.MemType);
|
||||
return PLC_ManageActiveAck(M154_STROBE.Address, M154_STROBE.SubAddress, processId - 1, M154_ACK.Address, M154_ACK.SubAddress, processId - 1, M154_STROBE.MemType);
|
||||
}
|
||||
|
||||
public override CmsError PLC_RScadaValue(string memIndex, SCADA_MEM_TYPE memType, ref object value)
|
||||
@@ -1332,21 +1332,21 @@ namespace CMS_CORE_Library.Siemens
|
||||
return cmsError;
|
||||
}
|
||||
|
||||
private CmsError PLC_ManageActiveAck(int strobeByte, int strobeBit, int ackByte, int ackBit, MEMORY_TYPE memType)
|
||||
private CmsError PLC_ManageActiveAck(int strobeByte, int strobeSubByte, int strobeBit, int ackByte, int ackSubByte, int ackBit, MEMORY_TYPE memType)
|
||||
{
|
||||
int n = 1200; // 30 seconds
|
||||
bool readValue = false;
|
||||
bool writeValue = true;
|
||||
bool ok = false;
|
||||
// Set ack to 1
|
||||
CmsError cmsError = MEM_RWBoolean(W, 0, memType, ackByte, ackBit, ref writeValue);
|
||||
CmsError cmsError = MEM_RWBoolean(W, 0, memType, ackByte, ackSubByte , ackBit, ref writeValue);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
do
|
||||
{
|
||||
// Check strobe
|
||||
cmsError = MEM_RWBoolean(R, 0, memType, strobeByte, strobeBit, ref readValue);
|
||||
cmsError = MEM_RWBoolean(R, 0, memType, strobeByte, strobeSubByte, strobeBit, ref readValue);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
@@ -1355,7 +1355,7 @@ namespace CMS_CORE_Library.Siemens
|
||||
{
|
||||
writeValue = false;
|
||||
// Reset acknowledge
|
||||
cmsError = MEM_RWBoolean(W, 0, memType, ackByte, ackBit, ref writeValue);
|
||||
cmsError = MEM_RWBoolean(W, 0, memType, ackByte, ackSubByte, ackBit, ref writeValue);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
// Exit from cycle
|
||||
@@ -1376,7 +1376,7 @@ namespace CMS_CORE_Library.Siemens
|
||||
{
|
||||
// Reset acknowledge
|
||||
writeValue = false;
|
||||
cmsError = MEM_RWBoolean(W, 0, memType, ackByte, ackBit, ref writeValue);
|
||||
cmsError = MEM_RWBoolean(W, 0, memType, ackByte, ackSubByte, ackBit, ref writeValue);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
}
|
||||
@@ -5829,8 +5829,8 @@ namespace CMS_CORE_Library.Siemens
|
||||
internal static MEMORY_CELL M155_INPUT_ACK = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, TABLE, 3015, 1);
|
||||
internal static MEMORY_CELL M155_INPUT_STROBE = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, TABLE, 3016, 1);
|
||||
|
||||
internal static MEMORY_CELL M154_STROBE = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, TABLE, 3042, 1);
|
||||
internal static MEMORY_CELL M154_ACK = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, TABLE, 3043, 1);
|
||||
internal static MEMORY_CELL M154_ACK = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, TABLE, 3042, 1);
|
||||
internal static MEMORY_CELL M154_STROBE = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, TABLE, 3043, 1);
|
||||
internal static MEMORY_CELL M154_SWITCH_ONOFF = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, TABLE, 0, 2);
|
||||
|
||||
internal static MEMORY_CELL AXES_BUTTON_VISIBLE = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, TABLE, 3044, 16);
|
||||
|
||||
@@ -240,7 +240,8 @@ namespace CMS_CORE_Library.Utils
|
||||
if (endPos != -1)
|
||||
tmpString = codeLine.Substring(startPos, endPos - startPos - 1);
|
||||
|
||||
returnVal = tmpString.Split(',');
|
||||
|
||||
returnVal = tmpString.Trim(';').Split(',');
|
||||
}
|
||||
|
||||
return returnVal;
|
||||
|
||||
Reference in New Issue
Block a user