VisualHMI sliding interface: fixed/dynamic/arbitrary three sliding ranges and navigation points

freeFree Technical Resource

This content is free to read, suitable for basic learning and search traffic.

The sliding screen is acontainer-type control: Define a rectangular window on the main screen, allowing users to slide their fingers left/right/up/down to switch between a set of preset screens, similar to the paging of a mobile phone desktop. It supports three modes: fixed range, dynamic range, and arbitrary screen collection.

1. Three sliding range

modesdescriptionaddress layout
fixedsliding within a fixed range (starting screen ~ ending screen)addr=current screen ID, addr+1=start, addr+2=end
dynamiccontinuous screen range can be changed during runtime (e.g. 5~7, 8~11)Ditto (start/end can be changed)
AnyAny set of screens (e.g. {13,16,15,14})addr=current ID, addr+1=quantity N, addr+2~addr+N=each screen ID

VisualHMI sliding interface: fixed/dynamic/arbitrary three sliding ranges and navigation points插图

Other attributes: sliding direction (left/right/up/down), circular sliding (can return to the beginning when reaching the end), sliding duration (automatically slide for ms after released).

VisualHMI sliding interface: fixed/dynamic/arbitrary three sliding ranges and navigation points插图1

⚠️ During design, do not place controls with sliding operations (such as sliders) within the sliding window range - when the slider sliding direction is consistent with the page sliding direction,priority should be given to responding to control operations and not executing page sliding. Additionally, the starting screen must be within the sliding set, and screen IDs within the set cannot be duplicate.

2. Application Cases

2.1 Fixed Range + Navigation Points

Fixed sliding range (2_fixed range 1 ~ 4_fixed range 3), direction left/right, read/write addressesLW8000. Equipped with multi-state indicator lights as navigation points: read LW8000, state number 3, conversion table 2;3;4 (corresponding to screens 2~4). Navigation points follow during sliding.

VisualHMI sliding interface: fixed/dynamic/arbitrary three sliding ranges and navigation points插图2

VisualHMI sliding interface: fixed/dynamic/arbitrary three sliding ranges and navigation points插图3

2.2 Dynamic range (LUA change range)

Sliding range dynamics, starting with 5_dynamic range 1, ending with 7_dynamic range 3, direction up and down, looping, read and writeLW8100(8100=current, 8101=start, 8102=end). The bit status indicator (LWF000) switches between two sets of ranges, and the register is modified in LUA on_update:

if key == 0 then
  set_uint16(VT_LW, 0x8100, 5)  -- 当前页
  set_uint16(VT_LW, 0x8101, 5)  -- 开始
  set_uint16(VT_LW, 0x8102, 7)  -- 结束
elseif key == 1 then
  set_uint16(VT_LW, 0x8100, 8)
  set_uint16(VT_LW, 0x8101, 8)
  set_uint16(VT_LW, 0x8102, 11)
end

Two navigation multi-state indicators display according to the value condition of LWF000 (==0 displays range 1 navigation, ==1 displays range 2 navigation).

VisualHMI sliding interface: fixed/dynamic/arbitrary three sliding ranges and navigation points插图4

VisualHMI sliding interface: fixed/dynamic/arbitrary three sliding ranges and navigation points插图5

2.3 Arbitrary screen collection

Sliding range arbitrary, screen collection 13;LW8200(8200=current, 8201=quantity, 8202+ =each screen ID). LUA uses set_array to modify the collection:

set_uint16(VT_LW, 0x8200, 13)
set_array(VT_LW, 0x8201, {4, 13, 16, 15, 14})  -- 数量4 + 各画面ID

VisualHMI sliding interface: fixed/dynamic/arbitrary three sliding ranges and navigation points插图6

VisualHMI sliding interface: fixed/dynamic/arbitrary three sliding ranges and navigation points插图7

When changing the set dynamically/within any range, the navigation multi-state indicator lights should be equippedControl permission(Conditional address + comparison) Display the corresponding navigation according to the mode, otherwise both sets of navigation will be illuminated simultaneously.

Compiled from the VisualHMI development documentation of Guangzhou Dacai Technology (hmi-doc.gz-dc.com), the configuration control tutorial "Sliding Screen" is owned by Dacai Technology.

Put this resource to use in a real project?

Go to the Tool Center for message parsing, CRC verification and device debugging, or submit your requirements for selection and integration advice.

Engineer Membership

Turn this article into actionable debugging resources

After activation, you can use advanced message parsing, resource pack downloads, code examples, engineering cases and priority technical support, suitable for real project delivery.

Unlimited Advanced Tools
Resource & Code Packs
Complete Engineering Case Library
Priority Technical Support

Leave a Reply

Your email address will not be published. Required fields are marked *.