How can we help?

Ignore Short Cycle Stops

You are here:
< All Topics

Overview

There are times when an expression should only evaluate as true after a certain amount of time. In order to accomplish this a custom variable can be used to track the amount of time a particular expression has been true.

A Custom Variable can be created and then the Custom Variable Value and Custom Variable Time PCSDB variables can be used to track how long a particular scenario has been true.

Scenario

A piece of equipment has frequent short periods of time where the cycle stops for 10 to 20 seconds such as tool changes. These short stops should be ignored, therefore the machine stops will be tracked with a custom variable. With the following solution an end cycle will only be entered when the custom variable time is greater than 30 seconds eliminating all of the short stops.

In this case the desired Cycle End expression used will be unchanged. However, rather than the Target being PCSDB.send_end_cycle{} the target will be a Custom Variable.

Solution

The first step is to create the custom variable. On the ribbon bar go to DataXchange → Variable → PCS Custom. For this example, create a custom variable named “cycle_stop”.

To easily modify the cycle end delay across multiple expressions, a Constant can be created and used in the expression later. Go to Variable → PCSDB Constants and create a Constant names “cycleEndDelay” if it does not exist already. Set the value to 30 seconds. More information about using Constants can be found here.

Now go to DataXchange → Expressions → Create Expressions. Select the current Cycle End expression and then press the Copy button on the form and change the Result from

[PCSDB.send_end_cycle]{cycle_status}

to

[PCSDB.send_custom_variable_value]{cycle_stop}

where cycle_status is the associated cycle status such as 101. Enter a new name for the Expression and click Enter.

This Expression will now reset the time stamp associated with the custom variable when a cycle end occurs. The next step will be to create a new expression to read the custom variable time and if it’s greater than our desired time of 30 seconds DataXchange will then trigger the actual cycle end.

Now create a copy of the original cycle end and append the following to the expression.

AND (([PCSDB.custom_variable_time]{cycle_stop}) >= ([PCSDB.constant] {cycleEndDelay})) AND (([PCSDB.prev_custom_variable_time]{cycle_stop}) < ([PCSDB.constant] {cycleEndDelay}))

and set the Result to use the cycle end command.

[PCSDB.send_end_cycle]{cycle_status}

where cycle_status is the associated cycle status such as 101.

The final step is to unassign the old Cycle End expression and assign the new expressions to the appropriate piece(s) of equipment.

If you would like to change the cycle delay in the future, simply go to Variable → PCSDB Constants and change the value of cycleEndDelay.

Table of Contents