Waste Model 304: Waste Occurs on Single Location

With Model 304, you use VB Script to enter logic that determines whether there is waste, and also the location, fault, type, and measurement of the waste. An easy-to-use editor aids in the creation of scripts, in similar manner to Downtime Models 210-212.

Maximum # of tags:  500

Maximum size of script:  7000 characters

To configure Waste Model 304

  1. In the Server Manager tree, expand the Plant Model and locate the production unit that you want to configure a waste event for.

  2. Right-click the production unit and choose Configure Events on <production unit name>. The Event Configuration dialog box appears, with the Enable Events tab active.

  3. Under Available Events to Add, click Waste, and then click Add Event. The waste event is added to the list under Events Enabled On This Unit.

If this is the first waste event on this unit, ensure that the waste event properties are configured. To do this, select the waste event and click the Event Properties button.

  1. Ensure that the waste event you just added is selected, and then click the Configure Event Detection Models tab.

  2. Under Events Enabled On This Unit, click Waste.

  3. Under Available Models to Assign, click to select Model 304, and then click Assign Model.

  4. Under Custom Configurations, click Edit. The Waste Model dialog box appears.

    Any changes you make in this dialog box must be saved by clicking the Save button in the top left corner. At any time before saving, you can click the Refresh button in the top left corner to reset all entries to their last-saved states.

  5. Click the General tab to enter description information:

  1. In the Description box, enter a description for this instance of Model 304.

  2. For Type of Waste Model, choose the mode by which the waste event will occur.

  3. In the Comment box, enter comments relevant to this configuration.

  1. Click the Identify Model Inputs tab to enter the tags and triggers for the waste event:

  1. If the tag is to be set as a trigger, select the Trigger check box. A minimum of one trigger tag is required.

  2. Click the Browse button beside the Tag box. The Tag Search dialog box appears. Click Search (you can enter search criteria prior to clicking the button if necessary). Select the tag and click OK.

  3. From the Attribute list, select either Value or Timestamp, depending on whether you want the value or time of the tag to be passed.

  4. From the Sampling Type list, select the type of sampling that is applied to the tag.

  5. In the Time Offset box, enter the number of seconds backward from the trigger time that the next value will be retrieved.

    For example:

    If you have trigger tag A in the list and you also have another tag B that is used as an input in the VB Script, you can specify what the time offset will be for tag B. This would be the amount of time backward from the trigger time that the EventMgr would attempt to get the ’r;Last Good Value’ for tag B. So if tag A changed at 2/28/06 7:00, and you specified a 10 second offset for tag B, then the EventMgr would attempt to retrieve the Last Good Value for tag B starting at 2/28/06 6:59:50.

  6. In the Precision box, enter the number of decimal places to keep when reading the Historian tag.

  7. Click Add to add an additional tag, and repeat steps 9a through 9g until all tags are entered.

  1. Click the Waste Logic tab to define waste amounts using VB Script. "Amount" is the required keyword.

  1. Optional: Click Insert Input. The Select Alias dialog box appears. Select the Alias and click OK. The Alias letter appears in the Waste Amount Script box.

  2. Enter the text of the VB Script directly in the Waste Amount Script box. Click here for an example.

  3. Click Check Syntax to ensure you have entered the VB Script correctly.

Amount = Null is used to signify that there was no waste event – exit model.

  1. Click the Location Logic tab to define the waste location using VB Script. "Location" is the required keyword.

  1. Optional: Click Insert Location. The Select Location dialog box appears. Select the location and click OK. The location appears in the Location Logic Script box.

  2. Optional: Click Insert Input. The Select Alias dialog box appears. Select the Alias and click OK. The Alias letter appears in the Location Logic Script box.

  3. Enter the text of the VB Script directly in the Location Logic Script box. Click here for an example.

  4. Click Check Syntax to ensure you have entered the VB Script correctly.

  1. Click the Fault Logic tab to define the fault logic using VB Script. "Fault" is the required keyword.

  1. From the Location list, select a location to apply the script to. A different script can exist for each location.

  2. Optional: Click Insert Fault. The Select Fault dialog box appears. Select the fault and click OK. The fault appears in the script description box.

  3. Optional: Click Insert Input. The Select Alias dialog box appears. Select the Alias and click OK. The Alias letter appears in the script description box.

  4. Enter the text of the VB Script directly in the script description box. Click here for an example.

  5. Click the Check Syntax button to ensure you have entered the VB Script correctly.

  1. Click the Type Logic tab to define waste type logic using VB Script. "WasteType" is the required keyword.

  1. Optional: Click Insert Input. The Select Alias dialog box appears. Select the Alias and click OK. The Alias letter appears in the Waste Type Logic Script box.

  2. Enter the text of the VB Script directly in the Waste Type Logic Script box. Click here for an example.

  3. Click Check Syntax to ensure you have entered the VB Script correctly.

  1. Click the Measurement Logic tab to define unit of measure logic using VB Script. "Measure" is the required keyword.

  1. Optional: Click Insert Input. The Select Alias dialog box appears. Select the Alias and click OK. The Alias letter appears in the Waste Unit of Measure Script box.

  2. Enter the text of the VB Script directly in the Waste Unit of Measure Script box. Click here for an example.

  3. Click Check Syntax to ensure you have entered the VB Script correctly.

VB Script Example (Model 304)

The following provides example inputs along with corresponding VB Script for Model 304.

Identify Model Inputs

1. A - Trigger Tag

2. B - Fault Value

3. C - Waste Type Value

4. D - Waste Identifier

5. E - Amount Value 1

6. F - Amount Value 2

7. G - Amount Value 3

Waste Logic

If D = 1 Then

     Amount = E

ElseIf D = 2 Then

     Amount = F

ElseIf D = 3 then

     Amount = G

Else

     Amount = Null

End If

Location Logic

Location = "My Unit 1"

Fault Logic

Fault = B

Type Logic

WasteType = D

Measurement Logic

If D = 1 Then

     Measure = "Lbs"

ElseIf D = 2 Then

     Measure = "Tons"

ElseIf D = 3 then

     Measure = "Kg"

End If

See Also