0301-21 REST API Webpage Javascript

Example Projects > 0301 Human Machine Interface HMI > 0301-21 REST API Webpage Javascript

Custom HMI example using REST API and plain Javascript

This project is an extension of the example 0301-20. It shows how to build your very own HMI using HTML, plain Javascript and the REST API of REXYGEN.

One real constant block (CNR) and two Boolean constant blocks (CNB1 and CNB2) can be changed from web HMI. If both CNB's are ON, the sine wave from generator (SG) is passed to the output. In all other cases, the CNR constant filtered by a rate limiter (RLIM) makes it to the output.


  • REXYGEN Runtime Core must be installed and running on the target device.

Running the example

  • The *exec.mdl file is the project main file.
  • Open it with REXYGEN Studio.
  • Compile and download the project to the target device.
  • Switch to Watch mode and observe the algorithm in real-time.
  • Use Target -> Web interface from the menu in Studio and change the CNR, CNB1 and CNB2 values from web HMI. Observe the result in both the HMI and Studio.
  • Changing the values directly within REXYGEN Studio has the same effect.

Timing of the project

The algorithm runs each 100 milliseconds (0.1 s). See the EXEC function block,
tick x ntick0 = 0.05 x 2 = 0.1


Additional information

  • Visit the REXYGEN webpage for more information about the example projects and developing advanced automation and control solutions using REXYGEN.