Methods

The following section provides a summary of each method associated with the
Batch Phase Execution
control and a description of how each method is used. There are no parameters associated with any of these methods.
Method summary
Method
Return value
Description
CheckPoint
True = success
False = failure
Called to force an update of the checkpoint data file.
Initialize
True = success
False = failure
Used to initialize the control. The control will not function properly if this method is not invoked.
LogTagNames
True
Used to write all tag names to the activity log file.
TerminateState
None
Your application must call this method to complete the transition of an Active state.
CommandAbort
True = success
False = failure
Used to transition the phase to ABORTING.
CommandHold
True = success
False = failure
Used to transition the phase to HOLDING.
CommandReset
True = success
False = failure
Used to transition the phase to IDLE.
CommandRestart
True = success
False = failure
Used to transition the phase to RESTARTING.
CommandStart
True = success
False = failure
Used to transition the phase to RUNNING.
CommandStop
True = success
False = failure
Used to transition the phase to STOPPING.
Method description
  • Checkpoint
    : This method is invoked to update the checkpoint data file. Typically, this is not needed since the checkpoints are saved as needed at the end of every PLI scan. It should only be called AFTER the
    Initialize
    method has been called and executed successfully.
      • Initialize
        : This method performs all initialization and MUST be called before the phase will execute properly. It only needs to be called once and in fact, will not execute again if called more than once. You should check the return value and not allow the application to continue if this method fails.
        Initialize
        does the following:
        • Loads checkpoint data if required (fires
          OnCheckPointFail
          if the checkpoint read fails).
        • Creates and initializes all tags.
        • Creates the watchdog.
        • Creates a timer based on the
          Interval
          property.
        • Fires the
          OnPowerUp
          event.
    • LogTagNames
      : This method writes all tag names to the activity log file. It is used as a tool to view the current tag names. It should only be called AFTER the
      Initialize
      method has created and initialized the tags. It will always return a value of TRUE.
    • TerminateState
      : This method is used to terminate an active state and transition the phase to the next desired state. In other words, it will cause the phase to change state as shown in the following table:
      Current state
      Transitioned state upon call of TerminateState
      ABORTING
      ABORTED
      HOLDING
      HELD
      STOPPING
      STOPPED
      RESTARTING
      RUNNING
      RUNNING
      COMPLETE
    The phase programmer must use
    TerminateState
    within the phase logic to transition the phase state at the appropriate time. Refer to the
    PCD Programmer Technical Reference Guide
    for complete instructions regarding state transition logic.
  • Transition command methods
    : The Transition Command methods allow the phase programmer to change the state of the phase from within the source code. The state transition rules must be followed in order for the PLI within the
    Batch Phase Execution
    control to honor the command. The following table shows the command name, the state to which the phase will transition, and the state(s) that the phase must be in for the command to be honored.
    Method
    Phase transitions to:
    Phase state must be:
    CommandAbort
    ABORTING
    HOLDING, STOPPING, RUNNING, RESTARTING, or HELD
    CommandHold
    HOLDING
    RUNNING or RESTARTING
    CommandReset
    IDLE
    COMPLETE, ABORTED, or STOPPED
    CommandRestart
    RESTARTING
    HELD (and the phase has not failed)
    CommandStart
    RUNNING
    IDLE (and the phase has not failed)
    CommandStop
    STOPPING
    HOLDING, RUNNING, RESTARTING, or HELD
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal