Create Volume Controls

The volume of the default sound device of the Workstation can be controlled using Workflows. The below examples show how to create these controls, as well as automatically adjust the volume when an event occurs.

Display Current Volume

When choosing to change the volume, it can be helpful for Runtime users to know the current volume. To display the current volume in Runtime:

  1. In the Display Layout or Map you wish to display thew current volume on, add a label.
  2. Create a new Workflow for the project.
  3. Configure the Workflow to trigger when the volume changes.
    1. Double-click the Start block to open the trigger browser.
    2. Click Add.
    3. In the Objects pane, select Sounds Service.
    4. In the Events pane, select System Volume Changed.
    5. Click OK.
  4. Add another Workflow trigger for when Runtime starts up.
    1. Click Add.
    2. In the Objects pane, select Display Layout.
    3. In the Events pane, select Started Runtime.
    4. Click OK, then click OK again.
  5. Add an Action block to the Workflow, and connect it to the Start and Stop blocks.
  6. Configure the Action block.
    1. Double-click the Action block.
    2. In the Objects pane, navigate to the Display Layout/Map the label was added to.
    3. Select the text label.
    4. In the Commands pane, select Set Text.
    5. In the Expression pane, click Text.
    6. In the Objects pane, expand Triggering Item and select Initial.
    7. In the Properties pane, double-click Current System Volume.
    8. Click OK, then OK again.

Create Volume Up/Down Buttons

Buttons to turn the volume up/down can be created to allow for management of the default sound device's volume. To create these buttons:

  1. Drag and drop two Buttons from the Toolbox onto the Map/Display Layout you want them displayed on.
  2. Change the Caption on each button to indicate which button will be turning the volume up/down.
  3. Double-click the button which is meant to turn the volume up to configure it.
    1. In the Objects pane, click Sound Service.
    2. In the Commands pane, click Increase System Volume.
    3. In the Expression pane, click Percent to configure how much the volume will be changed. In this example, we will set this to 10.
      Note: This can only change the volume within the configured Sound Project Setting thresholds.
    4. Click OK.
  4. Double-click the button which is meant to turn the volume down to configure it.
    1. In the Objects pane, click Sound Service.
    2. In the Commands pane, click Decrease System Volume.
    3. In the Expression pane, click Percent to configure how much the volume will be changed. In this example, we will set this to 10.
      Note: This can only change the volume within the configured Sound Project Setting thresholds.
    4. Click OK.

Set the Workstation Volume to a Specific Value

You may need to have the system volume set to a specific value. For example, when an asset alarm becomes active, you may want to set the volume to a value high enough to ensure the Runtime operator can hear it. To configure a Workflow for this:

  1. Create a new Workflow for the project.
  2. Configure the Workflow to trigger when an asset is in alarm.
    1. Double-click the Start block to open the trigger browser.
    2. Click Add.
    3. In the Objects pane, expand the Integrated System which we want this Workflow to fire for. Click Assets.
    4. In the Events pane, select Status Changed.
    5. Click OK.
  3. Add a Logic block to the Workflow and connect it to the Start block. Double-click the Logic block to configure it.
    1. In the Objects pane, expand Triggering Item and click Initial.
    2. In the Properties pane, double-click In Alarm.
    3. Click OK.
  4. Add an Action block to the Workflow.
  5. Connect the True exit path for the Logic block to the Action block. Connect the False exit path to the Stop block.
  6. Double-click the Action block to configure it.
    1. In the Objects pane, click Sound Service.
    2. In the Commands pane, click Set System Volume.
    3. In the Expression pane, click Percent.
    4. Enter the volume you wish to have the system set to. In this example, we will enter 60.
      Note: This can only change the volume within the configured Sound Project Setting thresholds.
    5. Click OK, then OK again.
  7. Connect the exit path for the Action block to the Stop block.