5.1 How to Use the Library

The user can program the HMI over REX.HMI interface. It contain several public methods for reading and writing items from REX targets. To create and build your custom HMI based on the RexHMI library follow these steps:

  1. Create project directory with exec.mdl. Add the HMI block to the executive (see the [1] for more details)
  2. Create *.hmi.js file in ./hmisrc directory with REX.HMI.init = function(){} function inside.
  3. Start writing your script

When the script is ready, enable generation of RexHMI using GenerateRexHMI parameter in the HMI block of the executive. Then run Compile and Download function in the RexDraw. The content of the *.hmi.js file is inserted to the RexHMI template with all the necessary scripts and libraries, also all other content of the hmisrc directory is copied to the target ./hmi folder. The HMI is then downloaded to the target and available from the internal webserver.

The REX.HMI interface is described in following sections. Each function contain short example with common parameters.

1// Common usage 
2// Append this function to the HTML document or use predefined placeholder in the template 
3REX.HMI.init = function(){ 
4// Change some basic settings 
5 
6}