ClearSCADA

In some cases it may be desirable to put a button on a mimic that performs a hyperlink to the event list and for the events that are displayed to be different based on some criteria stored in a String Parameter.

This type of 'variable hyperlink' is useful in a number of different areas of the product, but the most common use is within templates where the query depends on the instance name.

Configure initial hyperlink

To configure a hyperlink to an event list, start by displaying the event list and filtering the list to display only those events that you are interested in.

From the Edit menu, select Copy Shortcut.

On the mimic where you are creating the hyperlink, select Paste from the Edit menu. This will create a text box that contains a configured hyperlink to the filtered event list on display.

Change Pick Action to Animation

To be able to dynamically change the target of the hyperlink, it is necessary to use the animations for pick actions. Open the text box, and copy the pick action URL.

Open the animations for the text box and enter the text into the PickParam animation.

Make the following changes to the copied text:

  1. Add a single quote around the entire expression.
  2. Replace any single quotes with two single quotes (not double quotes).

As an example, the following hyperlink URL

SCX:///main/List/Title="Events"&System="main"&InitialSQL="SELECT ""RecordTime"" AS ""~RecordTime"", ""Source"", ""Message"" FROM CDBEVENTJOURNAL WHERE ( ""~RecordTime"" BETWEEN
{ OPC 'H-23H' }
AND
{ OPC 'H+1H' }
) AND ( ""Source"" LIKE '%Group1%' ) ORDER BY ""~RecordTime"" DESC"

becomes the following PickParam animation

'SCX:///main/List/Title="Events"&System="main"&InitialSQL="SELECT ""RecordTime"" AS ""~RecordTime"", ""Source"", ""Message"" FROM CDBEVENTJOURNAL WHERE ( ""~RecordTime"" BETWEEN
{ OPC ''H-23H'' } AND { OPC ''H+1H'' } ) AND ( ""Source"" LIKE ''%Group1%'' ) ORDER BY ""~RecordTime"" DESC"'

Now configure the PickType animation and set it to the value 3. This tells ViewX to run this as a hyperlink.

Make the Hyperlink Dynamic

To configure the hyperlink such that the WHERE clause chooses points whose name is like the value in a string parameter name StringParam, modify the query above as below:

'SCX:///main/List/Title="Events"&System="main"&InitialSQL="SELECT ""RecordTime"" AS ""~RecordTime"", ""Source"", ""Message"" FROM CDBEVENTJOURNAL WHERE ( ""~RecordTime"" BETWEEN { OPC ''H-23H'' }
AND
{ OPC ''H+1H'' }
) AND ( ""Source"" LIKE ''%' + StringParam.String + '%'' ) ORDER BY ""~RecordTime"" DESC"'