Click or drag to resize

4.2.2 Custom Trigger Streaming

The C:\Program Files\RAYLASE\ProcessDataAnalyzer\API\SampleCode\SampleApplications\CustomTriggerStreaming connects the Process Data Analyzer server to one or more control cards and starts a stream on each connected card.

This example implements several conditions, which will trigger a trace to be saved. The parameters of each condition can be adapted from the Configurations.cs file.

  • Condition 1: Trigger a trace when the commanded or the measured field position is within pre-defined squares while gate is on.

  • Condition 2: Trigger a trace when the difference between commanded and measured position is greater than a pre-defined threshold while gate is on.

Example Usage

In this section we will take a look at the setup and use of this sample application.

JSON Parameter Configuration

First, we take a look at the Configuration.json.

For each control card you plan to connect, add another entry of the single configured card within the Cards element. Each card then needs the parameters described in Configuration.cs set.

Additionally, the cards in use must configure the signals, which should be recorded by the Process Data Analyzer so that they are available during streaming. This can be done by connecting one card within the Process Data Analyzer UI and configuring the signals. If one card should be used, it is sufficient to set the path argument to the PDA UI Configurations.json. On the other hand, if multiple cards are used, the configuration for the current card must be duplicated in the above mentioned PDA UI configuration file with an adapted ConnectionID for each card.

Command Line Parameters

With the cards and trigger properties set, we can run the CustomTriggerExample from the command line with following arguments:

Start the custom trigger streaming example
".\Files\Configuration.json" ".\Files\PdaConfig.json" "optionally\path\to\ProcessDataAnalyzer.Service.exe\if\installed\to\custom\location"

Please note that the above command uses a local copy of the PDA UI's Configurations.json file, which was renamed to PdaConfig.json.

On enter, the application will connect to each listed card, set the card's signal configuration and start the stream. When any of the trigger conditions are met, a trace will be saved to the configured path (relative to the Process Data Analyzer server location. The trace file can be opened with the Process Data Analyzer UI for further inspection.

Pressing any key will stop the streaming and close the application. A statistic overview will be printed to the console.