KVB HMI - Displaying Bitwise Variables in KVB / AKI2G
Introduction
KAS application developers can combine multiple pieces of information into one variable. One example is storing the status of up to 16 items into a 16-bit Integer or INT variable. As an example the bits of the INT could be designated as follows:
- At Home
- Operation 1 Active
- Operation 2 Active
- Operation 3 Active
- Operation 4 Active
- Operation 5 Active
- Operation 6 Active
- Operation 7 Active
- High Speed Operation
- Low Speed Operation
- Product Jam
- High Temperature
- Daily Product Goal Met
- Time for Maintenance
- Input Bin Empty
- Replace Filter
If the application status was stored in a variable called OperationStatus and the machine status was Operation3 Active (bit 3), High Speed Operation (bit 8) , and Input Bin Empty (bit 14), the value of OperationStatus would be set in by the running program to 16, 648.
- 23 + 28 + 214 = (0100 0001 0000 1000) bin or (16,648) dec
OperationStatus can be sent to the AKI2G HMI via Modbus TCP/IP and the status displayed.
Generic Example
The following example reviews displaying information from an INT in the .kas project onto an AKI2G(Advanced Kollmorgen Interface) screen. 2 LED objects, indicating on and off, will be used for each of the 16 bits in the INT.
Start off by checking the variable in the KAS IDE dictionary to be used in KVB. For this example, the variable INT16_1 was created.
Compile the .kas project, then open KVB (Kollmorgen Visualization Builder) from inside the IDE. In KVB the variable will be automatically added in the KVB tag list. An LED object is then added to the display for each of the 16 status bits
Each LEDs is placed on the screen using the KVB Multi-picture control:
The multi-picture is then configured as follows using the Configure Pictures button. For each bit, a boolean mask expression is set up with an output of 1 (LED on) or 0 (LED off) Example below: to evaluate Bit 10 the Expression (value & 0x1000)== 0x1000 is created