FACE Pro is a powerful tool that allows you to pull data from any source, whether from your FlowWorks sites and channels or from any third party source generating appropriate information, process that data through a customized Python or R script, then output the results to a target site and channel. The script itself can be developed in the development environment of your choice, tested and revised until it has exactly the capabilities you require, before being uploaded to FACE Pro to use with FlowWorks data.
FACE Pro provides efficient and flexible functionality that can be customized to meet any need. By replacing multiple computational steps with a single process scripted in Python or R, FACE Pro all but eliminates latency issues, which enables monitoring and processing data in near-real time. Furthermore, FACE Pro scripting enables you to create custom solutions that incorporate sample FlowWorks code, existing code libraries, and third-party resources.
FACE Pro Features
Using FACE Pro requires that you understand Templates and Bundles. Together, they allow you to create your own custom programmatic solutions using Python or R to meet any data-processing requirement.
Templates
Templates define how your data will be handled by FACE Pro. Templates are where you keep your code scripted in Python or R, and where you define other details, like input channels, target channels, scheduling, assets, that are shared across bundles. They are a framework that organizes your input channels and target channels, how data is processed programmatically by your script, and the schedule, ranging from monthly to in near real time.
You can use templates repeatedly for different projects by creating bundles, as long as the placeholder input and target channels defined in the template match the channels you are using in each project. When a bundle is created, the template placeholders are replaced with specific input and target channels as defined in FlowWorks.
Bundles
Bundles are instances of a template configured for use with a project. The template’s placeholder input and target channels are replaced with actual channels defined in FlowWorks, which provide the data that the bundle will process in FACE Pro. Bundles are project-specific, a particular implementation of the template on which they are based, and so are not portable to other projects the way templates are.
You can create any number of bundles from the same template, as long as the channels you are using match the placeholders in the template.
Scripting
The core of any FACE Pro template is the Python or R script you use to process your data. Using a script to create custom solutions means you can perform complex multi-step calculations all at once instead of needing intermediary channels to manage the data. This offers unprecedented latency reduction, enabling monitoring data sources and applying calculations to raw data in near-real-time.
Furthermore, FACE Pro’s script engine is fully capable of integrating third-party applications, and can use data from those sources when calculating the output to target channels in FlowWorks. This means that almost any appropriate data source can be used by FACE Pro directly, which greatly simplifies workflows involving disparate solutions that are not directly interoperable.
Using FACE Pro
To use FACE Pro, begin by logging in to the site. Once logged in, you have access to two tabs on the left side of the screen, Activities and Templates.
Templates Tab
The Templates tab is where you define new templates and bundles. By default, when selecting this tab you are shown the list of available templates, and can access the New Template feature.
Accessing Existing Templates
The main Templates screen shows a list of all the available templates. You can search for a template by name or stack (Python or R).
Once you have the correct template, click Show more to open the template where you can make edits or create new bundles. Refer to Creating or Editing a Template for information on the options available when editing a template.
Creating or Editing a Template
The first step to setting up a FACE Pro solution is to create a template. To create a template, go to the Template tab, then click New Template. This opens the template creation screen, where you can configure the details of your new template.
Quick Menu
You can jump to any of the main sections of the template by clicking the corresponding section of the quick menu on the right side of the screen.
Template Name and Description
First, enter a name for your new template, and enter a short description of the template’s function. Click the save icon in the lower right. You can’t make any other changes to a template until you have saved the name and description for your template.
You can edit the name and description of an existing template by clicking the Edit button. You can delete a template by clicking the Delete button.
Warning: Do not delete a template unless you are certain you no longer need it. Deleting a template can’t be reversed, and if you need it again you will have to recreate it from the beginning.
Input Channels
Input channels define the FlowWorks data sources where input for the FACE Pro calculation originates. Click New Input Channel to define an input channel. You must define at least one input channel, but more are possible. If you need to remove a channel, click the button marked with a minus sign (-) to the right of the channel to be removed.
When creating a template input channel, the only information that must be defined for each channel is the Script Reference, which identifies how the template’s script will access the channel.
There are other channel details that can be defined, including:
- Site Name
- Channel Name
- Start Date
- End Date
- Date or Last Of toggle
These can be left undefined in the template, to act as a placeholder for a channel defined in a bundle based on the template. If these details are defined in the template, they cannot be changed in any bundle based on the template.
Target Channel
Target channels define where results from the template script calculations will be recorded in FlowWorks. As with input channels, the only detail about a target channel that must be defined in the template is the Script Reference.
Other channel details, including Site Name and Channel Name, can be left blank to act as a placeholder for a channel defined in a bundle based on the template. If these details are defined in the template, they cannot be changed in any bundle based on the template.
Scheduling
Scheduling enables you to define how often bundles based on your new template will run. Scheduling options are:
- None
- Hourly
- Daily
- Weekly
- Monthly
Alternatively, you can click the Run in Real Time toggle to run the template script every time data in the input channel or channels updates.
Stack
The Stack field lets you determine which programming stack will be used to interpret your code. To select or change the stack, expand the Select Template Stack menu, then choose either Python or R.
Script Parameters
The Script Parameters section is where you can define additional variables for use in your FACE Pro script. To add a new parameter, click New parameters. Every parameter must have a Script Parameter Key, and a Script Parameter Value.
Assets
The Assets window is where you can include files for use by the template, for example a file containing your script, or other third party resources available locally. You can select a file in the Assets window to load it in the Script window.
Script
The Script window lets you directly write or edit your Python or R script. You can upload your script as an Asset, or cut and paste it directly into the Script Editor window. Once you are done editing your script, click Save file.
Save
Once you are done adding details to your template, click Save template. Your new template is now ready to use to create bundles.
Creating Bundles
Before you can perform calculations in FACE Pro based on a template, you must use it to create a bundle.
To create a bundle, select the template the bundle will be based on, and click Show more to open it. Next, in the upper right corner of the screen, change the toggle switch from Template config to Bundle list.
Bundle List
A new screen showing a list of existing bundles appears. If you have not created any bundles yet, the list is empty. Click New bundle+ to create a new bundle. Your new bundle appears in the list immediately, with a default name based on the template.
Once a bundle is properly configured, some of its details are shown in the bundle list to aid in identifying bundles to run calculations. These include:
- The bundle name.
- The input channel date limits and script reference.
- The target channel script reference.
- The description.
- The stack.
- The scheduling.
- The real-time status (enabled or disabled).
Editing Bundles
A newly-created bundle is a copy of the template from which it is made, and is not yet usable, because you must first replace the template’s placeholders with correct values for your project. Existing bundles can require changes to update their channel or scheduling information. In either case, you need to edit your bundle. Remember that all configurations made in the template cannot be changed in the bundle.
To begin editing a bundle, click the vertical ellipsis (⋮) to the left of the bundle, then select Edit.
The bundle screen opens, where you can fill in or edit any of the details of the bundle that were not defined in the template.
Note: This screen closely resembles the template editing screen, and most of the sections are similar.
Quick Menu
You can jump to any of the main sections of the bundle by clicking the corresponding section of the quick menu on the right side of the screen.
Input Channels
Configuring a new bundle requires that any input channel placeholders from the template have their details entered to represent a real channel that can provide data.
Target Channel
The target channel placeholders from the template must have their details entered to represent a real channel that can receive data.
Scheduling
The Scheduling options can be set in the bundle as long as they were not configured in the template.
Assets
The Assets list for a bundle is read-only, a way to review the assets used in the template to create the bundle.
Script Viewer
The Script Viewer is read-only, a way to review the Python script in the asset that the bundle will run. You can click Run Script to run the script, as long as the channel settings are properly configured.
Logs
The Logs window is where the calculation logs generated when the bundle is run are stored for later review. You can click Refresh to clear the logs before running the script again to generate a new set of results.
Plot
The Plot window can be used to graph the results of the bundle calculation by clicking Plot Data on Chart.
After the chart is generated, a color-coded legend with the input channels identified by their Script Reference is shown on the right side.
The Plot window has the following options, accessed using icons in the top right corner of the chart:
- Download plot as png
- Zoom
- Pan
- Zoom In
- Zoom Out
- Autoscale
- Reset axes
Mousing over the chart also shows you the x-axis and y-axis values associated with any data point.
Save Bundle and Delete Bundle
After you have completed your edits to the bundle configuration, click Save Bundle to save your changes. If you want to delete a bundle, you can click Delete Bundle instead.
Running a Bundle
Once you have configured and saved your bundle, you can run the calculation by clicking the vertical ellipsis (⋮), then clicking Run in the menu. This will generate results sent to the target channel and plotted on a chart in the Plot window, as well as logs recorded in the bundle’s Log window.
Activities Tab
The Activities tab is where you can track all your activities in FACE Pro, including the progress and results of the FACE Pro calculations you run. By default, all the actions you have taken are shown in chronological order, with the most recent first. You can filter the list using the filter options at the top of the screen.
You can search for the name you gave to a bundle or other specific text strings, or use some predefined filters to narrow the list. These are:
- Finished: Filters for completed calculations.
- Update Bundle: Filters for bundle updates.
- Update Template: Filters for template updates.
- Alerts: Filters for alerts.
Once you have defined your filters, click Search to apply the filters to the list.
Some of the activities recorded will include logs. In such cases, you can view the details by clicking Show Logs. This takes you to the bundle associated with the Activity tab entry, where you can review the associated logs.
0 Comments