- Create a "Standard project" and select CODESYS Control Win V3 as the device.
- Define the target system by means of the Network scan.
Edit the PLC_PRG POU as follows:
- Create a new POU IsWebVisu (type: function).
The return value is type BOOL and the implementation language is ST.
Edit the IsWebVisu POU as follows:
- Insert a visualization in the device tree.
Then the Visualization Manager is inserted automatically with the visu types TargetVisu and WebVisu .In addition, a VISU_TASK is also created automatically.
- In the Visualization, set a Rectangle element and configure the element as follows:
- Download the project to the controller and start it.
The counter is incremented only when you click the rectanle in the TargetVisu.
The rectangle is disabled (gray) in the WebVisu.