This tutorial demonstrates how to create a simple web visualization of traffic lights on the RevPi Connect using CODESYS WebVisu.

Prerequisites #

Hardware #

✓ RevPi Connect+
RevPi DIO

For detailed instructions about how to set up your system, see Getting Started.

Software #

✓ CODESYS Development System installed on your PC

✓ RevPi Connect and RevPi DIO are properly connected and configured in the CODESYS device tree.

To ensure a compatible system with suitable software, see Software Compatibility.

Overview #

The application simulates a traffic light system with the following modes:

  1. Normal Mode:

    • Red and green lights are active for 10 seconds each.

    • Yellow light acts as a transition for 2 seconds.

  2. Night Mode:

    • Only the yellow light flashes in this mode.

The following figure provides an overview of the CODESYS device tree for the setup:

CODESYS Device Tree Overview
Adapting for RevPi Core or RevPi Compact

▷ Open the context menu of RevPi Connect in the CODESYS device tree.

▷ Select Update device.

▷ Select RevPi Core or RevPi Compact as the replacement and rename the device accordingly.

Deploying and Testing the Application #

  1. Compile and Download:

▷ Ensure there are no errors in your program.

▷ Download the application to the RevPi Connect.

  1. Access the Web Visualization:

▷ Open a browser and navigate to your RevPi Connect’s web server:

http://<RevPi-IP-Address>:8080/webvisu.htm

Example: http://192.168.168.159:8080/webvisu.htm.

Webvisu
Adapting for RevPi Core or RevPi Compact
  1. Test the Traffic Light:

▷ Verify normal mode operation with the specified durations.

▷ Toggle the night mode switch and observe the yellow light flashing.

Note

The visualization design can be customized to include additional controls or indicators as needed.