VisualHMI QR Code Control: Dynamically Generated QR Code, Error Correction Level, and Content Register

freeFree Technical Resource

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

The QR Code control dynamically generates a standard QR Codeon the HMI interface, with content updated at runtime. It is commonly used in payment, operation and maintenance, and after-sales scenarios - a QR code is directly generated on the screen, which can be accessed by scanning with a mobile phone.

1. Attribute Introduction

1.1 Basic Settings

AttributesDescription
Read AddressBound Variable Address
Text LengthThe maximum length of the string displayed, default is 16. The content is stored in continuous registers, with 2 bytes per address (non-characters, some characters occupy 2 bytes such as %, ℃), up to 512 bytes (when the error correction is at least 7%)

VisualHMI QR Code Control: Dynamically Generated QR Code, Error Correction Level, and Content Register插图

Example: Content "https://www.baidu.com/”, registers from 0x1001, 16 registers (0x1001~0x1008) allocated:

Register0x10010x10020x10030x1008
Register value (hex)0x68 0x740x74 0x700x73 0x3A0x69 0x64
Characterhttps:id

1.2 Appearance Attributes

  • Error Correction: Highest (30%) / Higher (25%) / Medium (15%) / Lowest (7%) - Fault Tolerance, Partial Damage Still Recognizable
  • Color: QR Code Foreground Color

VisualHMI QR Code Control: Dynamically Generated QR Code, Error Correction Level, and Content Register插图1

2. Application Cases

Screen with QR Code Control: ReadLW1001, Text Length 32, Error Correction Highest (30%), Color Black. Add a Text Control (also bound to LW1001, Length 32) to display the QR Code content.

VisualHMI QR Code Control: Dynamically Generated QR Code, Error Correction Level, and Content Register插图2

Operation: PLC writes LW1001 content, QR Code refreshes in real time. Set "https://www.baidu.com/" for direct access via phone scanning.

VisualHMI QR Code Control: Dynamically Generated QR Code, Error Correction Level, and Content Register插图3

QR Code Contentis stored byte by byte in sequential registers, with 2 bytes per register. Chinese characters occupy 2 bytes (UTF-8 Chinese occupies 3 bytes), and the text length must be calculated based on the number of bytes, otherwise the content will be truncated. Select high error correction for dirty on-site environments.

Compiled from the VisualHMI development documentation of Guangzhou Dacai Technology (hmi-doc.gz-dc.com), the configuration control tutorial "QR Code", copyright reserved 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 *.