Map Variables to HMI
For HMI, the variable mapping is done in two phases.
- Phase 1 - Tag all of the variables to be exported from the HMI project (see procedure below).
- Phase 2 - Use this mapping file when designing the HMI
The tag operation directly takes place in the Dictionary:
- Open the Variable list editor available in the Dictionary toolbox
Double-click the Dictionary header to view the widget as a popup window.
- In the KVB column, select the variables to map.
-
-
Selecting the variable alone does not guarantee it is exported.
The POU must also be set to compile.
See Ensuring Variables are Exported. -
-
Based on Modbus, the communication is limited to 32-bits.
As a consequence:- Data type conversion can lead to a loss in accuracy:
- LREAL variables are saved as REAL.
- LINT variables are converted to DINT.
- ULINT variables are saved as UDINT.
- LWORD data types cannot be used in the HMI when using KVB.
- This is because variables of this type are not exported, even when selected.
- STRING variable data types are allowed in the HMI when using KVB 2.0 or later
- They are not supported in KVB 1.2.
- STRING variables allow a maximum of 240 characters.
- STRING variables whose size exceed the maximum string length of 240 characters generate a warning message in the Compiler Output window when being exported over Modbus.
- Only the first 240 characters are exported.
- See Compiler Output tab.
- Variables of types PNCode, ProfilesCode, or instances of UDFB cannot be used in the HMI.
- Data type conversion can lead to a loss in accuracy:
-
-
Non-primitive data types which are not exported over Modbus generate a warning message in the Compiler Output window.
See Compiler Output tab. - Compile the application to create the Modbus mapping file.
- If the set of tagged variables is changed in the dictionary, the text file must be updated by recompiling the project.
- The Modbus variables defined in KAS-IDE are imported into Kollmorgen Visualization Builder only when KVB is started.
There is no update in real-time between the two applications.
- Open the KVBProject from the Project Tree.
This automatically transfers the tagged variables.
Figure 1: Variable Mapping to KVB.
Variables to Export
These types of variables can be exported to the HMI:
- The fundamental data types: BOOL, BYTE, DINT, DWORD, INT, LREAL, REAL, SINT, STRING, TIME, UDINT, UINT, USINT, WORD
- Arrays of supported data types
- Structures that include members of supported data types
Structures to Export
- Arrays of BOOLs such as a structure that includes a BOOL array member and instances of UDFB members.
- An array of structures that include INT and LREAL members
- A structure that includes both instances of UDFB member as well as an embedded structure which includes an INT member and instances of a UDFB member.
- This is because the embedded structure has an INT member and the outer structure can be exported too.
Structure that Cannot be Exported
A structure that includes instances of UDFB or LWORD members only.