Mcgs Hmi Password Work May 2026
In industrial automation, Human-Machine Interfaces (HMIs) often serve as the primary point of control for operators, engineers, and maintenance personnel. To prevent unauthorized operation, accidental parameter changes, or safety violations, implementing a robust password protection system is critical.
MCGS (specifically MCGS Embedded version, commonly used with Weintek and Kinco HMIs) provides a multi-tiered user security framework. This guide details the mechanisms of setting up users, assigning access levels, and programming security logic.
Right-click on your target screen → Properties → Access Control. Check "Enable Access Control" and set condition: Login_Flag = 1. If a user tries to jump to this screen while Login_Flag = 0, the system shows a “No Access” message. mcgs hmi password work
When you implement the above, here is what happens inside the MCGS processor:
MCGS standard numeric input objects only handle digits. For alphanumeric passwords (e.g., "ABC123"): Right-click on your target screen → Properties →
IF Str_PW = "ADMIN99" THEN
Login_Flag = 1
ENDIF
Note: String comparison is case-sensitive in MCGS. Convert both to upper case using StrUpper() if needed.
A good password system auto-logs out after inactivity. Implement this using a Cyclic Script (runs every 1 second): MCGS standard numeric input objects only handle digits
' Cyclic script, event: Timer, cycle time: 1000 ms
Static LastActionTime
IF AnyTouchValue > 0 THEN ' Simulate touch detection
LastActionTime = SysSecond() ' System seconds counter
ENDIF
IF (SysSecond() - LastActionTime) > 300 THEN ' 5 minutes timeout
Login_Flag = 0
Access_Level = 0
' Optional: Jump to login screen
IF Screen <> 0 THEN Screen = 0
ENDIF
Add a Label (text: "Enter Password"). Add a Numeric Input object linked to Entered_PW. Under its properties, set "Input Format" to decimal, "Max Length" = 4.
You can create a password popup:
Example script (button click):
IF Pwd_Input = Sys_Pwd THEN
!SetDevice(DeviceName, Cmd, Value) ' unlock function
Pwd_Input = 0
ELSE
MessageBox("Wrong password")
ENDIF
Store passwords in internal variables or user database.