Sample FGP-State Example 1

FGP Download this FGP

Description

This FGP will decide a current operating State, to be used elsewhere in your sequences.

Image

FGP Image

Sequence of Operation

The current state will be dependent upon the status of a 7-day Schedule and an Afterhours timer. The Schedule will provide a single On and Off time for each of the seven days of the week. In additon, up to seven Special Day times can be defined. The Main State will reflect the status of the Schedule. If the Schedule is On, the Main State will be set to Occupied. If the Schedule is Off, the Main State will be set to Unoccupied.

If the Afterhours timer receives a request, the Afterhours timer will start, and will remain active for the value held in it's Time Allowed setting. While the Afterhours timer is active, the Main State shall be set to Occupied. When the Afterhours Timer expires, the Mains State will follow the status of the Schedule.

Table of Objects and Published Points

  • 1 Schedule Object
  • 1 State Object
  • 1 Afterhours Object
  • 1 Logic Object
#
Object
Name
Description
Public Point Type
Public Point Handle
1
SCH
OCC
Allows for 7-day scheduling and Special Events
2
AFT
Main AFT
Allow for afterhours operation through a binary event
Public Point
Request Handle, typically a Poll Manager or an Input
Input
Request Handle
3
STA
Main State
Determines whether the SCH or the AFT Objects are calling for the OCC State to be active
4
LOG
State is OCC
Provides a binary event to indicate whether the State is OCC
Public Point
BO
Link to anything else in the controller that needs to know if the current State is OCC
Output
Binary Output Handle

Tuning Help

Adjust the On and Off times of the Schedule Object to match the actual project needs. If you are not using Special Events as defined in the Calendar Object, you can disable the Special 1 values.

You will have to adjust the Time Allowed and Minimum Time values in the Afterhours Object. There are set for 5 minutes each in the FGP, for testing purposes. After testing, increase them to the actual time period needed.

If you are not using the Afterhours Object, then do not link a handle to the Request Handle. As another safeguard, disable Interlock 1 in the State Object.