Configuring a Historian Simulator Provider
- On the Gateway Webpage, navigate to the Config section.
- Under the TAGS heading in the sidebar, click on History.
- On the History Provider listing, click Create new Historical Tag Provider.
- From the listing of available types, select Simulator, and click Next.
- The simulator requires a unique name from other historical providers on the same Gateway, but otherwise does not require any other configuration settings. The bulk of configuration occurs when attempting to request records from the simulator. For now just provide a name, and click the Create New Historical Tag Provider button to finish configuring the provider.
- You'll be redirected back to the History Provider listing. You're now ready to use the simulator.
Retrieving Simulated Data
Once a Simulator Provider has been configured, you need a Tag Historian Query to start retrieving records from it. Lots of different interfaces can request Tag Historian Queries, but for the sake of simplicity we'll only focus on Tag history bindings in Vision. Browsing for available historical Tags using a Vision Tag History binding reveals the following Tags:
To get started quickly, you can use the default Tags in the list above. The one exception would be the "
function_period_amplitude_resolution " Tag, as that's simply there for syntax reference. The rest of the Tags utilizes the simulator's pathing syntax.
Simulator Path Syntax
The built-in "Tags" provided by the simulator are a great example of the simulator can do, but it is worth knowing that the data returned by the simulator can be customized. Doing so involves modifying the Tag path in the Tag history query.
As a refresher, history providers require a path that contains multiple components. Together, the components identify where the data came from. For example, a historical path could have a
histprov component that represents the history provider associated with the data, and a
Tag component that represents the Tag path of the Tag. A hypothetical historical path would look like the following:
With that understanding, retrieving records from the simulator involves providing the name of the simulator configuration on the gateway (the
histprov ) and a Tag path. Again, the simulator doesn't store any records. Rather, it looks at the Tag path provided, parses it, and returns a result set based off of contents in the path.
The simulator expects Tag paths to use the following notation, with each "parameter" delimited by an underscore:
Each parameter is described below:
The function to use when generating the raw data. The following functions are available:
|periodTime||How often the data sequence starts over. Values for periodTime need a time unit.|
|amplitude||Used as a peak value by most of the functions.|
|resolutionTime||How often raw data points are generated. Like periodTime, this parameter requires a time unit.|
For those functions utilizing a time unit represented by certain notation. A description of each notation can be found below:
Editing the Paths
With the knowledge of how the paths work, you can easily use the existing Tag history interfaces to request datasets with custom paths, usually by simply typing in the desired parameters.
For example, the image below shows Vision's Tag History Binding interface, but we modified the Selected Historical Tag path to use the realistic function over a period of 30 minutes, instead of the default one day.
For example, the Tag in the path below utilizes a sine function, over a period of 10 seconds, with an amplitude of 20, and a raw point will be generated every 500 milliseconds.
The following would generate a square wave, with an amplitude of 10, repeating every day, while generating a raw value for every 5 minutes.
The realistic function is unique in that it only utilizes the periodTime parameter, therefore: