html_ref()

This function loads a reference into an HTML reference. The parameters will be replaced.

Synopsis

void html_ref(string &html, string sFilename, dyn_string asDollar, int x, int y)

Parameters

Parameter Description
&html The returned HTML site.
sFilenanme Name of the HTML site to be loaded, for example, "refs/examples/valueRef.html "
asDollar The $ parameters as dyn_string, for example, makeDynString("$DPE:ExampleDP_Result.", "$Text:Ref_Result")
x The x position of the reference. This parameter will be transferred as a $x to the reference.
y The y Position of the reference. This parameter will be transferred as a $x to the reference.

Return value

None

Error

Description

This function loads a reference into a HTML reference. The parameters will be replaced. It is also possible to referencein references.

Furthermore, each reference contains the following information:

  • $User: logged in WinCC OA user (for example, for authorization control).

    For instance, pPermission = getUserPermission(5, getUserId($User));

  • $Ip: TCP-IP address of the -Adresse des Teilnehmers.

  • $LangId: WinCC OA language ID (necessary to select a text from the message catalogs) for example, sErrorText = getCatStr("http", "errFileLoad", http_getLangId($Ip));

For nesting references (that is, ref. in ref.), these three parameters pass trough and are available anywhere.

Example

In the following example, the CTRL function html_ref() reads the value of the data point ExampleDP_Result and writes it to the text field "Ref_Result".

<%={string sHtml; html_ref(sHtml,

refs/examples/valueRef.html",

makeDynString("$DPE:ExampleDP_Result.",$Text:Ref_Result"),

$x, 80);return(sHtml);}%>

Assignment

CTRL PlugIn

Availability

CTRL