ModulePersInSync Property |
Checks if the persistent data of the Module object is in sync with the real values of the controller.
Namespace:
ABB.Robotics.Controllers.RapidDomain
Assembly:
ABB.Robotics.Controllers (in ABB.Robotics.Controllers.dll) Version: 6.5.129.0
Syntax public bool PersInSync { get; }
Property Value
Type:
BooleanReturns true if persistent variables are in sync, false if there has been a change of any persistent data in the controller program memory.
If false is returned a
SyncPers call is required
in order to update the Module object with the real values in the controller.
Exceptions Remarks Returns true if the module is write protected.
Examples
In this example a check is done each time the task is stopped to find out whether the values of the persistent
variables of the module are in sync with the real values in the controller. If not a SyncPers call is made.
using ABB.Robotics;
using ABB.Robotics.Controllers;
using ABB.Robotics.Controllers.RapidDomain;
...
Controller c = new Controller();
Rapid r = c.Rapid;
Task t = r.GetTask("T_ROB1");
t.ExecutionStateChanged += new ABB.Robotics.Controllers.RapidDomain.ExecutionStateChangedEventHandler(t_ExecutionStateChanged);
...
private void t_ExecutionStateChanged(object sender, ABB.Robotics.Controllers.RapidDomain.ExecutionStateChangedEventArgs e)
{
try
{
if (e.ExecutionState == ExecutionState.Stopped)
{
modules = t.GetModules();
for(int i = 0; i < modules; i++
{
bool sync = modules[i].PersInSync;
if(sync == false)
{
bool updated = modules[i].SyncPers();
}
}
}
}
catch (GeneralException ge)
{
}
catch (System.Exception se)
{
}
}
See Also