The DiscreteDevice object can be used to control and monitor discrete devices that have two or more states.
Click one of the following Help topics to navigate to information about that topic.
The DiscreteDevice object is a general purpose ApplicationObject that represents a large class of physical equipment common in manufacturing, such as pumps, valves, motors, and conveyors. These devices have two or more discrete physical states (for example, Open, Closed, and Moving). The actual state of a device is monitored via a combination of discrete inputs, and a device can be optionally controlled using a combination of discrete outputs. For more information on states, see DiscreteDevice Object States.
The state names are configurable and are mapped to both input and output Boolean combinations in truth-table form. The meaning of the states depends on the type of discrete device. For a pump, the states might be configured as "Off" and "On," while for a valve they might be configured as "Open," "Closed," and "Moving." Note that a control valve has a continuous position represented by an analog signal of 0 to 100% and is not properly represented with a discrete device. Control valves are best represented with the AnalogDevice object.
When a DiscreteDevice object is commanded to a new state, it sets the configured combination of discrete outputs for that state. When one or more of its monitored discrete inputs change, the DiscreteDevice object determines the new actual state of the equipment and sets the process value (PV) appropriately.
For more information, see Monitoring a Discrete Device via Inputs and Controlling a Discrete Device via Outputs.
Input and output states are totally independent of each other and can be configured as required by your application; however, the input and output states can be linked by alarms. This allows the object to detect a command timeout and uncommanded change alarms when devices unexpectedly change, or fail to change when commanded to do so. For more information, see Alarm Capabilities.
Historization of key attributes including the current state (PV) and commanded state (Cmd) can also be configured.
Finally, the DiscreteDevice object supports a rich set of statistics reporting that you can enable during configuration. For more information, see Statistical Features.
For general information on objects, including relationships, deployment, and alarm distribution, see the Integrated Development Environment (IDE) documentation.
For information on configuration options of object scripts, attributes, or features, click Attributes Help in the Help file header.
The DiscreteDevice object has two key attributes that represent the current state (PV) and the commanded state (Cmd). Both of these are enumerations. The DiscreteDevice object can have up to five states that can be configured with state names that are appropriate to the equipment being monitored. The actual meanings of the states are dependent on the equipment:
If you configure the DiscreteDevice object to have inputs (feedback) from the field, the input values will be used to update the overall state of the device. A DiscreteDevice object can have up to four inputs. After defining the inputs, you will need to map the different input combinations to the possible states for the device.
For example, you might have a valve on your discrete device that can be either opened or closed. You have defined the passive state of the device as Closed, the first active state as Opened, and the fault state as Bad. You would then create references for two field inputs: one for the open position (Valve_Open), and one for the closed position (Valve_Close). You then would map the inputs to the defined states. For example:
where:
1=TRUE
0=FALSE
By default, when the monitored discrete inputs change, the DiscreteDevice object determines the new actual state of the equipment and updates the value of the process value (PV) appropriately.
You can configure the DiscreteDevice object to allow or disallow overriding of the PV value. If you enable the PV override, then the object can be placed in Auto, Manual, or Simulate modes using the PVMode attribute.
You can control (command) the passive, first active, and second active states of the discrete device via the Cmd attribute. The transition and fault states are not commandable. When a DiscreteDevice object is commanded to a new state, it sets an appropriate combination of discrete outputs for that state.
For example, you might map the first active state of "Open" to a discrete device output reference that will turn a valve to the open position. When you set the Cmd attribute to "Open," the valve will be "commanded" to be opened. If inputs (feedback) are configured for the DiscreteDevice object, the object could then detect when the valve is actually open or closed.
Commanding a discrete device to a new state does not directly change the PV unless you have the PVMode set to "Simulate."
Controller-oriented features for the DiscreteDevice object include:
The DiscreteDevice object provides sophisticated alarming capabilities, including:
The DiscreteDevice object offers advanced built-in state tracking calculations that can be used for equipment monitoring and time-in-use tracking, including:
Run-time behavior pertains to the running state of a deployed DiscreteDevice object. Once deployed and operating, DiscreteDevice objects can assume one of the following states:
Feedback processing (when feedbacks are enabled)
If you configure the object to have input or input/output and advisement of active items is enabled globally, both the reference count and suspend count for the PV attribute is incremented when the object starts up. This puts the object into a suspended state and propagates a suspend message to the input source.
When the object is in a suspended state, no input scanning occurs, because no new input values are being sent by the input source. The quality of the suspended attribute is INITIALIZING.
If the PV mode is Manual, the PV keeps the last value, time stamp, and UNCERTAIN quality, regardless of any PVAuto and input changes.
If the PV mode is Auto and there is only one input specified, the PV, PVAuto, and state attributes are computed based on the input value. The input time stamp is used to update the time stamp of PV, PVAuto, and the state attributes.
If the PV mode is Auto and more than one input is specified, the PV, PVAuto, and state attributes are computed based on the input values. The time of the computation is used to update the time stamp of PV, PVAuto, and the state attributes.
If the CtrlMode is Manual, Cmd has changed, and the output receives a new value based on the result of calculation, then the current time is also set to the output.
An explicit time set request to Cmd does not change the Cmd’s value, time, or quality (VTQ). No calculation is performed and no new VTQ is set to the output values.
If the object changes any attribute value and quality, the current time is used to update the attribute's time stamp.
The following sections describe the object editor options for configuration and the associated attributes:
For general information on objects, including relationships, deployment, and alarm distribution, see the Integrated Development Environment (IDE) documentation.
For information on configuration options of object scripts, attributes, or features, click Attributes Help in the Help file header.
Use the General tab to specify whether the device has feedback (has inputs), can receive commands (has outputs), or both.
|
Editor Option
|
Associated Attribute
|
Description
|
Run-Time Access (Supervisory, User, Read-Only, None)
|
|---|---|---|---|
| Enable inputs |
HasFeedback |
If enabled, this discrete device can have feedback (input) from the field. |
None |
| Historize PV |
PV.Historized |
If enabled, the PV value will be historized. |
None |
| Force storage period |
PV.ForceStoragePeriod |
See History Attributes. |
Supervisory, User |
| SampleCount |
PV.SampleCount |
See History Attributes. |
Supervisory, User |
| Generate event upon PV change |
PV.LogDataChangeEvent |
If enabled, data change events for the PV will be logged to event history. |
Supervisory, User |
| Enable outputs |
HasCmd |
If enabled, the discrete device can be commanded to change state. |
None |
| Historize command |
Cmd.Historized |
If enabled, command changes will be historized. |
None |
| Force storage period |
Cmd.ForceStoragePeriod |
See History Attributes. |
Supervisory, User |
| SampleCount |
Cmd.SampleCount |
See History Attributes. |
Supervisory, User |
| Enable statistics |
Stats.Enabled |
Used to enable statistics. You can only enable statistics if the object has been configured to have feedback. Statistics provide useful process information calculations on the discrete device being monitored, such as duty cycles and time running utilizations. Statistics also allow you to monitor equipment usage. |
None |
Use the States tab to specify the name of each state for the DiscreteDevice object.
|
Editor Option
|
Associated Attribute
|
Description
|
Run-Time Access (Supervisory, User, Read-Only, None)
|
|---|---|---|---|
| Enable second active state |
EnableStateActive2 |
If enabled, a second active state is allowed. Second active states typically will exist for devices such as reversible motors. If you unlock this option, the following options will also be unlocked:
If you lock the following options, this option will also be locked:
|
Read-Only |
| Enable transition state |
EnableStateInTransition |
If enabled, a transition state is allowed. A transition state typically will exist for devices such as dual-input solenoid valves. If you unlock this option, the Input to PV Map option on the Inputs tab will also be unlocked. For more information, see Inputs Configuration. If you lock the Input to PV Map option on the Inputs tab, this option will also be locked. For more information, see Inputs Configuration. |
Read-Only |
| Passive state |
StateNames[1] |
The name of the passive state. |
Read-Only |
| First Active state |
StateNames[2] |
The name of the first active state. |
Read-Only |
| Second Active state |
StateNames[3] |
The name of the second active state. |
Read-Only |
| Transition state |
StateNames[4] |
The name of the transition state. |
Read-Only |
| Fault state |
StateNames[5] |
The name of the fault state. |
Read-Only |
Use the Inputs tab to configure the inputs that will determine the monitored state of the DiscreteDevice object. Options on this tab are only available when the This object has inputs check box is selected on the General tab.
|
Editor Option
|
Associated Attribute
|
Description
|
Run-Time Access (Supervisory, User, Read-Only, None)
|
|---|---|---|---|
| Number of Inputs |
InputCnt |
The number of inputs for this object. A default input name appears for each input. The maximum number of inputs allowed is four. If you unlock this option, the Input Name and Input to PV Map options will also be unlocked. If you lock the Input Name and Input to PV Map options, this option will also be locked. |
Read-Only |
| Input Name (Input 1 - Input 4) |
InputNames[1-4] |
The name assigned to the input reference. The name cannot include spaces or special characters, such as $, #, :, and _. If you lock this option, the Number of Inputs will also be locked. If you unlock the Number of Inputs option, this option will also be unlocked. |
Read-Only |
| Input Source Reference (Input 1 - Input 4) |
[Input Name].InputSource |
The target source from which the value (plus quality) is to be read. Click the ellipse button to access the Attribute Browser. |
Supervisory, User |
| Input to PV Map |
FieldInputToPVMap[1-16] |
An array that is used to specify how to calculate PVAuto for each valid combination of input values. The lowest order bit is Input1. The length of the array depends on the number of inputs. States that are not applicable are not included in this array. All elements should be set to a non-Null value. If you lock this option, the following options will also be locked:
If the following options are unlocked, this option will also be unlocked:
|
User |
| Allow manual or simulate PV modes |
PVOverrideEnabled |
If enabled, the PV mode can be set to Manual or Simulate instead of the default of Auto. In Auto mode, the PV will be calculated internally based on the inputs. |
User |
| Initial PV mode |
PVMode |
The PV mode override setting, either "Manual," "Auto," or "Simulate."
|
Supervisory, User |
Use the Outputs tab to configure the outputs that will be controlled by the commanded state of the DiscreteDevice object. Options on this tab are only available if the This object has outputs check box is selected on the General tab.
|
Editor Option
|
Associated Attribute
|
Description
|
Run-Time Access (Supervisory, User, Read-Only, None)
|
|---|---|---|---|
| Number of outputs |
OutputCnt |
The number of outputs for this object. A default output name appears for each output. The maximum number of outputs allowed is six. If you unlock this option, the Output Name, Passive, Active1, and Active2 options will also be unlocked. If you lock the Output Name, Passive, Active1, and Active2 options, this option will also be locked. |
Read-Only |
| Output Name (Output 1 - Output 6) |
OutputNames[1-6] |
The name assigned to the output reference. The name cannot include spaces or special characters, such as $, #, :, and _. If you lock this option, the Number of outputs option will also be locked. If you unlock the Number of outputs option, this option will also be unlocked. |
Read-Only |
| Output Destination Reference (Output 1 - Output 6) |
[Output Name].OutputDest |
The target location (address) from which the output value will be obtained. Click the ellipse button to access the Attribute Browser. If you create a reference to "me" for the output destination reference, you must have inputs enabled, or else the reference will not resolve. |
Supervisory, User |
| Passive (Output 1 - Output 6) |
PassiveStateOutputs[1-6] |
Used to enable outputs for the passive state. If you lock this option, then the Number of outputs option will be locked. If you unlock the Number of outputs option, this option will also be unlocked. |
User |
| Active1 (Output 1 - Output 6) |
Active1StateOutputs[1-6] |
Used to enable outputs for the first active state. If you lock this option, then the Number of outputs option will also be locked. If you unlock the Number of outputs option, this option will also be unlocked. |
User |
| Active2 (Output 1 - Output 6) |
Active2StateOutputs[1-6] |
Used to enable outputs for the second active state. If you lock this option, the following options will also be locked:
The Active2 commandable state can only be locked if the Active2 state is enabled on the States tab. If you unlock following options, the Active2 option will also be unlocked:
|
User |
| Initial control mode |
CtrlMode |
Used to specify whether an operator (user) or other objects (supervisory) can set the value of the Cmd attribute. Valid values are "Manual" and "Cascade." In Manual mode, the object can be written to by an operator, but not by other objects. In Cascade mode, the object can be written to by other objects, but not by an operator. |
Supervisory, User |
| Control tracking enabled |
CtrlTrack.Enabled |
If enabled, the commandable state of the device will continually reflect the value of PV. Normally, the Cmd attribute is externally set by users or other objects (depending on the control mode). However, if control tracking is enabled, then the value of the Cmd attribute takes the value of the PV, regardless of the control mode. The output is NULL if control tracking and PV are not in a commandable state. |
None |
| Control track input source |
CtrlTrack.InputSource |
The reference to an external Boolean flag for control tracking. You can configure the object such that a PLC notifies the object that the PLC is in control of the state of the actual physical device and is no longer accepting commands. If configured in this way, the commandable state reflects the value of PV. Click the ellipse button to access the Attribute Browser. |
Supervisory, User |
Use the Alarms tab to enable alarming for the different states of the DiscreteDevice object.
|
Editor Option
|
Associated Attribute
|
Description
|
Run-Time Access (Supervisory, User, Read-Only, None)
|
|---|---|---|---|
| Detect uncommanded change alarm |
UncommandedChangeAlarm.Alarmed |
If enabled, an alarm will be triggered when the PV changes from the currently commanded state to any other state. This alarm cannot be detected without feedbacks, so if the object does not have feedbacks, then you cannot enable this alarm. |
None |
| Priority |
UncommandedChangeAlarm.Priority |
See Alarm Attributes. |
Supervisory, User |
| Alarm message attribute |
UncommandedChangeAlarm.DescAttrName |
See Alarm Attributes. Click the ellipse button to access the Attribute Browser. |
None |
| Detect command timeout alarm |
CmdTimeoutAlarm.Alarmed |
If enabled, an alarm will be triggered when a command causes the PV to change within the timeout period. |
None |
| Priority |
CmdTimeoutAlarm.Priority |
See Alarm Attributes. |
Supervisory, User |
| Limit |
CmdTimeoutAlarm.Limit |
The maximum amount of time allowed for the value of the PV to match the command value before an alarm is generated, if alarming is enabled. The value you specify will be converted to the following format: days hh:mm:ss.fffffff. |
Supervisory, User |
| Alarm message attribute |
CmdTimeoutAlarm.DescAttrName |
See Alarm Attributes. Click the ellipse button to access the Attribute Browser. |
None |
| Report the first active state as an alarm |
PV.IsActive1.Alarmed |
If enabled, an alarm will be triggered when the first active state occurs. |
None |
| Priority |
PV.IsActive1.Priority |
See Alarm Attributes. |
Supervisory, User |
| Alarm message attribute |
PV.IsActive1.DescAttrName |
See Alarm Attributes. Click the ellipse button to access the Attribute Browser. |
None |
| Report the second active state as an alarm |
PV.IsActive2.Alarmed |
If enabled, an alarm will be triggered when the second active state occurs. |
None |
| Priority |
PV.IsActive2.Priority |
See Alarm Attributes. |
Supervisory, User |
| Alarm message attribute |
PV.IsActive2.DescAttrName |
See Alarm Attributes. Click the ellipse button to access the Attribute Browser. |
None |
| Report the fault state as an alarm |
PV.IsNull.Alarmed |
If enabled, an alarm will be triggered when the fault state occurs. |
None |
| Priority |
PV.IsNull.Priority |
See Alarm Attributes. |
Supervisory, User |
| Alarm message attribute |
PV.IsNull.DescAttrName |
See Alarm Attributes. Click the ellipse button to access the Attribute Browser. |
None |
| Report the first active state duration alarm |
Stats.Active1DurationAlarm.Alarmed |
If enabled, an alarm will be triggered if the object is in the first active state longer than the duration limit. |
None |
| Priority |
Stats.Active1DurationAlarm.Priority |
See Alarm Attributes. |
Supervisory, User |
| Limit |
Stats.Active1DurationAlarm.Limit |
The duration that the object can remain in the first active state (since the last statistics reset) before an alarm is generated, if alarming is enabled. This value can only be cleared by a statistics reset. The value you specify will be converted to the following format: days hh:mm:ss.fffffff. |
Supervisory, User |
| Alarm message attribute |
Stats.Active1DurationAlarm.DescAttrName |
See Alarm Attributes. Click the ellipse button to access the Attribute Browser. |
None |
| Report the second active state duration alarm |
Stats.Active2DurationAlarm.Alarmed |
If enabled, an alarm will be triggered if the object is in the second active state longer than the duration limit. |
None |
| Priority |
Stats.Active2DurationAlarm.Priority |
See Alarm Attributes. |
Supervisory, User |
| Limit |
Stats.Active2DurationAlarm.Limit |
The duration that the object can remain in the second active state (since the last statistics reset) before an alarm is generated, if alarming is enabled. This value can only be cleared by a statistics reset. The value you specify will be converted to the following format: days hh:mm:ss.fffffff. |
Supervisory, User |
| Alarm message attribute |
Stats.Active2DurationAlarm.DescAttrName |
See Alarm Attributes. Click the ellipse button to access the Attribute Browser. |
None |
The following table describes the run-time only attributes for the object.
Note Configurable run-time attributes are described in the configuration sections. For more information, see Configuration.
For a list of common attributes, click Attributes Help in the Help file header.
|
Attribute
|
Description
|
Run-Time Access
(Supervisory, User, Read-Only, None)
|
|---|---|---|
| Cmd |
The commanded state of the DiscreteDevice object. This value can be any of the defined state names for the passive, first active, or second active states. If CtrlMode is Manual, Cmd can be written to by an operator (user). If CtrlMode is Cascade, Cmd can be written by other objects (supervisory). Any valid external set to Cmd results in the associated state outputs being written out during the next execute. Before being stored to Wonderware Historian history, the value is converted to an integer, where 1 = Passive state, 2 = Active1 state, 3 = Active2 state, 4 = Transition state, and 5 = Fault state. |
Supervisory, User |
| CmdTimeoutAlarm.Condition |
Set to TRUE when both: This attribute is not available if there are no inputs, the command timeout alarm limit is set to 0, control tracking is enabled, or the PVMode is set to Simulate. |
Read-Only |
| CtrlTrack.Datatype |
The data type for the control tracking input. |
Read-Only |
| CtrlTrack.ReadStatus |
The current calculated read status for control tracking input. |
Read-Only |
| CtrlTrack.Value |
The current value for the control tracking Boolean flag. |
Read-Only |
| PV |
The monitored state of the DiscreteDevice object. By default, PV is internally calculated (transferred from PVAuto) based on the values of the inputs. If PVMode is Manual, the value of PV can be externally written to by operators (users). If PVMode is Simulate, the value is copied from the Cmd value. Before being stored to Wonderware Historian history, the value is converted to an integer, where 1 = Passive state, 2 = Active1 state, 3 = Active2 state, 4 = Transition state, and 5 = Fault state. For extra quality information, see Quality Handling. |
Supervisory, User |
| PV.IsActive1 |
If TRUE, the PV is in the first active state. For extra quality information, see Quality Handling. |
Read-Only |
| PV.IsActive2 |
If TRUE, the PV is in the second active state. For extra quality information, see Quality Handling. |
Read-Only |
| PV.IsInTransition |
If TRUE, the PV is in the transition state. |
Read-Only |
| PV.IsNull |
If TRUE, the PV is NULL, and the quality of PV is not INITIALIZING. |
Read-Only |
| PV.IsPassive |
If TRUE, the PV is in the passive state. |
Read-Only |
| PVAuto |
The monitored state of the DiscreteDevice object. This value is internally calculated based on the values of the inputs. For extra quality information, see Quality Handling. |
Read-Only |
| Stats.Active1Cnt |
The number of transitions of the PV into the first active state since the last statistics reset. |
Read-Only |
| Stats.Active1DurationAlarm.Condition |
Set to TRUE if the total amount of time that the PV is in the first active state exceeds the duration alarm limit. |
Read-Only |
| Stats.Active1DurationLast |
The most recent duration that the PV was in the first active state. The format is: days hh:mm:ss.fffffff. |
Read-Only |
| Stats.Active1DurationTotal |
The total amount of time that the PV was in the first active state since the last statistics reset. The format is: days hh:mm:ss.fffffff. |
Read-Only |
| Stats.Active2Cnt |
The number of transitions of the PV into the second active state since the last statistics reset. |
Read-Only |
| Stats.Active2DurationAlarm.Condition |
Set to TRUE if the total amount of time that the PV is in the second active state exceeds the duration alarm limit. |
Read-Only |
| Stats.Active2DurationLast |
The most recent duration that the PV was in the second active state. The format is days hh:mm:ss.fffffff. |
Read-Only |
| Stats.Active2DurationTotal |
The total amount of time that the PV was in the second active state since the last statistics reset. The format is: days hh:mm:ss.fffffff. |
Read-Only |
| Stats.ElapsedTime |
The amount of time since the last statistics reset. This time includes the amount of time that the object is offscan. The format is: days hh:mm:ss.fffffff. |
Read-Only |
| Stats.LastReset |
The time of the last statistics reset. |
Read-Only |
| Stats.PassiveCnt |
The number of transitions of the PV into the passive state since the last statistics reset. |
Read-Only |
| Stats.PassiveDurationLast |
The most recent duration that the PV was in the passive state. The format is: days hh:mm:ss.fffffff. |
Read-Only |
| Stats.PassiveDurationTotal |
The total amount of time that the PV was in the passive state since the last statistics reset. The format is: days hh:mm:ss.fffffff. |
Read-Only |
| Stats.Reset |
Used to reset all statistical counters. |
Supervisory, User |
| UncommandedChangeAlarm.Condition |
Set to TRUE when the PV changes from the currently commanded state to any other state and the quality of PV is GOOD or UNCERTAIN (not BAD). This attribute is not available if there are no feedbacks, control tracking is enabled, or the PVMode is set to Simulate. |
Read-Only |
The following attributes are available for all Objects. If alarm aggregation is enabled on the Area, the following attributes aggregate their respective alarm status values for the Area, for all sub-Areas, contained objects, and their descendants assigned to the Area. If alarm aggregation is disabled, these attributes remain at their default values. Alarm aggregation attributes behave similarly to alarm aggregation of individual attributes.
If a historization Feature is enabled, then the following additional history-related attributes become available. None of these attributes can be alarmed.
If an alarm attribute is enabled, then the following additional alarm attributes become available. None of these attributes can be alarmed.
If an alarm attribute is enabled, then the following additional alarm attributes become available. None of these attributes can be alarmed.
Attributes that have extra quality values (other than GOOD) are listed in the following table:
© 2014 Invensys Systems, Inc. All Rights Reserved.
Invensys is a Schneider Electric company
10/17/14