Text Encoder Processor¶
The “Text Encoder Processor” is installed with the Dataristix Application. The processor accepts any input value and replaces input tag references in a text template with input values. The output is the resulting string.
Add to Task¶
Add the “Text Encoder Processor” to a task by dragging it from the “Build” panel onto the task’s “Task Builder” panel.
Configuration¶
Select the “Text Encoder Processor” item in the “Task Builder” panel to view its properties.
You can change the following properties:
- Name
- The title of the “Text Encoder” as it appears within the task builder.
- String Value Escape Mode
- Determines how string values are encoded when substituting values within the text template. Select “None” if the text template is plain text, “JSON” if the text template is a JSON document, and “XML” if the text template is an XML document. This will ensure that characters that may otherwise be invalid within the target document are replaced with compatible character escape sequences.
- Text template
- A text template containing placeholders in places where input tag values should be substituted (see below).
Press the “Apply” button to commit your changes.
Placeholders¶
Placeholders within the text template are replaced with matching input tag values and properties and take
the form {@TagName}
or {@TagName:Property}
where “TagName” is the name of an
input tag sent to the Text Encoder and “Property” is the name of a property associated with the tag.
Assuming the tag name is “Tag1” then placeholders may be:
{@Tag1}
or{@Tag1:Value}
- This placeholder will be substituted with the current value of the tag.
{@Tag1:Timestamp}
- This placeholder will be substituted with the timestamp of the current tag value.
{@Tag1:Status}
- This placeholder will be substituted with the status text (“Good”, “Uncertain”, etc.) of the current tag value.
{@Tag1:StatusCode}
- This placeholder will be substituted with the numerical status code of the current tag value.
Example¶
The following example shows a task that receives a signal and replaces the {@Signal}
placeholder
in the text template with the live value.
Settings used were: