Developer Portal Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 
    SOLVED

    Pause chain or object execution

    Pause chain or object execution

    maj9bj
    Long-established Member

    In current project there is a safety light grid controlling valve terminal ouputs voltage. One part of the machine is loading mechanism, which runs all the time and loads components when it is necessary. During this operation about 6 mechanical movements are executed in one sequence.

    During the cycle, operator puts some parts into the machine and iterrupts signal from safety light grid which producess error mesages from BasMove objects because of missing air pressure at valve terminal.

    I would like to suppress these messages when the light grid is interrupted, but I do not how to do that correctly. Is it possible to pause chain or object execution when the grid inactive?

    2 REPLIES 2

    SteffenR-
    Community Moderator
    Community Moderator

    You can pause a chain with _env.ChainControl:=OpconChainControl.PAUSE (and implement OnChainPause with return value OK to continue chain).

    But once an object command is started, it cannot be paused. Therefore the chain pause doesn't help you.

    The only solution that comes into my mind: if the light grid is interrupted, the BasMoves must be canceled (e.g. implement the method CmdHandlerUnit._manageLightGrid). I would suggest to use BasMove.Unit.Execute:=FALSE to cancel only the BasMoves that are already running. BasMove.Unit.Cancel:=TRUE would cancel also the ones that are currently not running.

    Very important is the waiting step in your chains: You cannot use the default implemention with CheckUnitDone or ExecuteUnit. You must explicitly check for ExecState=CANCEL (or ExecState=READY which will be reached after cancel) and then jump back to the start step (or just set Execute again to repeat the command).

    When repeating the command, you could get a PreStartCheck error if the cylinder is not in a defined end position. You can prevent this error with one of these settings:

    • Set ParCmd.PreStartCheck:=FALSE (like in homing chain). With this setting the command is started even if the cylinder is not in a defined position.
      You should set PreStartCheck:=FALSE only in case of homing or repeating a command, not during normal operation.
      PS: In case of a timeout error PreStartCheck is automatically ignored by the BasMove object when the next command is executed. But in your case you won't get a timeout error. For any other repeating commands like in your case you must handle PreStartCheck manually.
    • Set CpStudio parameter ResetOutputOnCancel to NO. With this setting the output stays TRUE. After releasing the light grid the output is still set and the cylinder will continue its movement (also the command is not running anymore).
      Depending on the valve type (deaerated or locked air), the cylinder size/force and the station dimension (can someone go into the station?), setting ResetOutputOnCancel to NO is not a good recommendation due to safety risks.
    •  

    maj9bj
    Long-established Member

    Steffen, thank you for sharing your ideas 👍! I will try to implement it and later I will post there some result or example.

    Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist