How can we help?

Automatically End Downtime when Cycling

You are here:
< All Topics


There are times when an evaluation of 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.


DataXchange has been configured to track downtimes such as Setup and Maintenance and to ignore machine cycles while in one of these downtimes. This is desirable since cycles used to prove out a setup or due to maintenance should be ignored. However, if the operator forgets to end the downtime before production begins then productions cycles are also not captured.

It is possible to track when a cycle start occurs and if the equipment has been cycling for a certain amount of time while the specific downtime codes are active the downtime can be ended automatically.

In this case the desired Cycle Start expression will be unmodified. A new Cycle Start expression will be created and the Target will be a Custom Variable. A new Downtime End expression will be created that will also look at the Custom Variable Time to determine if it should evaluate to True ending the downtime.


The first step is to create the custom variable. On the ribbon bar go to the DataXchange tab → Variables → PCS Database. For this example, create a custom variable named cycle_start.

Now go to DataXchange → Expressions → Create Expressions. Create a copy of the current Cycle Start expression and set the Target to:


Using the Target this way DataXchange will just reset the time stamp associated with the custom variable when a cycle start 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 5 minutes DataXchange will then trigger a downtime end and the cycle will then start automatically.

Create a new expression that looks to see if the machine is in any type of cycle, and the current planned downtime is active, and the downtime has been active for greater than 5 minutes. 

([PCSDB.general_equipment_status] = [PCSDB.CYCLING]) AND ([PCSDB.current_pdt_status_code]{202}) AND ([PCSDB.custom_variable_time]{cycle_start} >= 300) AND ([PCSDB.prev_custom_variable_time]{cycle_start} < 300)

where 202 is the downtime such as Setup. If we want this to work for multiple downtimes then multiple can be entered with an OR statement, or an Equipment Status Group can be used. The time is tracked in seconds therefore 300 is used for 5 minutes.

Next, set the Target to use the planned downtime end any command.


The final step is to assign the new expression to the equipment.

See Also

Require Manual Input for Downtime End

Using Status Code Groups in Expressions

Table of Contents