beckhoff TwinCAT 2 PLC Control — 9.2.2.3 XML File for dynamic Texts

Visualization Example: You want to have two visualization elements, one for visualizing the current machine identification, the other for visualizing an error message according to a currently given error number: (1) Define in PLC_PRG the following variables: ivar of type INT, defining the current machine identification; errnum of type INT defining the current error number. (2) Configure a visualization element for displaying the current machine identification: a. Enter in category ‚Text’ in the text field: "% " b. Enter in category ‚Variables’ at Textdisplay“: „PLC_PRG.ivar” (3) Configure another visualization element for displaying the error message for the currently occurred error: a.

Enter in category ‚Text’ in the text field: "% " b. Enter in category ‚Variables’ at Textdisplay“: "PLC_PRG.errnum“ (4) Create a xml-file, e.g. with name dynamictextsample.xml, according to the syntax described above, which should look as follows for the current example: deutsch deutsch Arial 0,0,0 -13 700 false false false 0 english Arial 0,0,0 -13 700 false false false 0 Fehler an Position 4711 Error at position 4711 Fehler an Position 815 Error at position 815 mehrere Zeilen]]> one line]]> (5) In the visualization open dialog ‚Settings’, category Language: Activate option ‚Dynamic Texts’; Add file dynamictextsample.xml, now available on your computer, to the file list.

(6) Go online with the project. (7) In the visualization settings set language to "deutsch". Set PLC_PRG.ivar to "1" and PLC_PRG.errnum to "4711". Now in the visualization elements the following texts should be displayed: "Vorschub" resp. "Fehler TwinCAT 2 PLC Control 247 Version: 1.0