Add methor for AXES gen Status/Command
This commit is contained in:
@@ -687,6 +687,20 @@ namespace CMS_CORE_Library
|
||||
/// <returns></returns>
|
||||
public abstract CmsError PLC_WAxisCommand(int AxisNum, uint CommandBit, bool WritePos, double TargetPos);
|
||||
|
||||
/// <summary>
|
||||
/// Send Axes Gen Control
|
||||
/// </summary>
|
||||
/// <param name="AdvMode">Boolean for advanced mode</param>
|
||||
/// <returns></returns>
|
||||
public abstract CmsError PLC_WAxisGeneralControl(bool AdvMode);
|
||||
|
||||
/// <summary>
|
||||
/// Read Axes Gen Control
|
||||
/// </summary>
|
||||
/// <param name="AdvMode">Boolean for advanced mode</param>
|
||||
/// <returns></returns>
|
||||
public abstract CmsError PLC_RAxisGeneralStatus(ref bool AdvMode);
|
||||
|
||||
/// <summary>
|
||||
/// Confirm FLIR image acquired and copied to PLC
|
||||
/// </summary>
|
||||
|
||||
@@ -45,6 +45,10 @@ namespace CMS_CORE_Library.S7Net
|
||||
|
||||
internal static MEMORY_CELL AXES_COMMAND = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, 616, 512, 512);
|
||||
|
||||
internal static MEMORY_CELL AXES_GEN_CONTROL = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, 616, 1026, 2);
|
||||
|
||||
internal static MEMORY_CELL AXES_GEN_STATUS = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, 616, 1024, 2);
|
||||
|
||||
internal static MEMORY_CELL AXES_INFO = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, 616, 0, 512);
|
||||
|
||||
internal static MEMORY_CELL AXES_RTDATA = new MEMORY_CELL(MEMORY_TYPE.Siemens_DB, 615, 0, 768);
|
||||
@@ -4659,6 +4663,56 @@ namespace CMS_CORE_Library.S7Net
|
||||
return libraryError;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Send Axes Gen Control
|
||||
/// </summary>
|
||||
/// <param name="AdvMode">Boolean for advanced mode</param>
|
||||
/// <returns></returns>
|
||||
public override CmsError PLC_WAxisGeneralControl(bool AdvMode)
|
||||
{
|
||||
CmsError libraryError = NO_ERROR;
|
||||
|
||||
// preparo la word
|
||||
ushort controlData = 0;
|
||||
if (AdvMode)
|
||||
{
|
||||
controlData = 1;
|
||||
}
|
||||
|
||||
MEMORY_CELL caTgtPos = new MEMORY_CELL(AXES_GEN_CONTROL.MemType, AXES_GEN_CONTROL.Address, AXES_GEN_CONTROL.SubAddress, 2);
|
||||
// in primis scrivo la TargetPos nei 4 byte DWord...
|
||||
libraryError = MEM_RWWord(W, 0, caTgtPos.MemType, caTgtPos.Address, caTgtPos.SubAddress, ref controlData);
|
||||
if (libraryError.IsError())
|
||||
return libraryError;
|
||||
|
||||
return libraryError;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Read Axes Gen Control
|
||||
/// </summary>
|
||||
/// <param name="AdvMode">Boolean for advanced mode</param>
|
||||
/// <returns></returns>
|
||||
public override CmsError PLC_RAxisGeneralStatus(ref bool AdvMode)
|
||||
{
|
||||
CmsError libraryError = NO_ERROR;
|
||||
|
||||
// preparo la word
|
||||
ushort controlData = 0;
|
||||
|
||||
MEMORY_CELL caTgtPos = new MEMORY_CELL(AXES_GEN_STATUS.MemType, AXES_GEN_STATUS.Address, AXES_GEN_STATUS.SubAddress, 2);
|
||||
// in primis scrivo la TargetPos nei 4 byte DWord...
|
||||
libraryError = MEM_RWWord(R, 0, caTgtPos.MemType, caTgtPos.Address, caTgtPos.SubAddress, ref controlData);
|
||||
if (libraryError.IsError())
|
||||
return libraryError;
|
||||
|
||||
AdvMode = (controlData == 1);
|
||||
|
||||
return libraryError;
|
||||
}
|
||||
|
||||
|
||||
public override CmsError PLC_WRefreshAllMessages()
|
||||
{
|
||||
// imposto come UserSoftKey
|
||||
|
||||
Reference in New Issue
Block a user