Click or drag to resize

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
C#
public bool PersInSync { get; }

Property Value

Type: Boolean
Returns 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
ExceptionCondition
GeneralExceptionA General Exception has occurred.
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)
    {
      // iterate modules and read its PersInSync property to see if the PERS variables have been updated
      modules = t.GetModules();
      for(int i = 0; i < modules; i++
      {
          bool sync = modules[i].PersInSync;
          if(sync == false)
          {
              //update the PERS variables of the module to their current values
              bool updated = modules[i].SyncPers();
          }
       }
     }
  }
  catch (GeneralException ge)
  {
    // TODO: Add error handling
  }
  catch (System.Exception se)
  {
    // TODO: Add error handling
  }
}
See Also