Do we have any weintek HMI gurus here?

dipsy01

Member
Join Date
Jan 2020
Location
Utah
Posts
7
I'm having one heck of a time trying to get the screen to change automatically to the login screen when someone logs out. I essentially want the HMI to be locked out unless someone is logged in. I'm also using the auto login/logout with the USB key functionality. I've tried using a macro but it never changes the screen.

Below is the main macro I've been trying to use. I've got it set to run once a second, and then I also have a PLC control word, LW-100, set to be a "Change Window" attribute, which is where I write the login window value to.
Code:
macro_command main()
	
	short logged_in  // where the current security class is stored, anything other than 0 is logged in
	short login_window = 70  // value of login screen
	
	GetData(logged_in, "Local HMI", LW, 9222, 1)  // Read from LW-9222, where current class is stored
	
	if logged_in == 0 then
		SetData(login_window, "Local HMI", LW, 100, 1)  // if LW-9222 is 0, change screen to login screen
	else
	end if
		

end macro_command

Any help would be greatly appreciated, I've been stuck on this for like 3 days :(
 
I assume you have set up a PLC Control object that uses LW100 as the trigger for a screen change. When you set that object up did you make sure the "Clear data after window change" was checked?

Keith
 
I just cannot figure out what I'm doing wrong. My macros do stuff, like turning on bits and I can do while loops and change things. But for some reason, when a user logs out, the screen will not change back to the login screen.

For example, I added a few lines of code to the above macro so that it also turns on the LB-0 bit, so I can use that to enable/disable a button when a user logs in/out and it works. The button appears and disappears. So my macro is running. But the dang screen doesn't change XD

Code:
macro_command main()
	
	short logged_in  // where the current security class is stored, anything other than 0 is logged in
	short login_window = 70  // value of login screen
	short bit_val
	
	GetData(logged_in, "Local HMI", LW, 9222, 1)  // Read from LW-9222, where current class is stored
	
	if logged_in == 0 then
		bit_val = 0
		SetData(login_window, "Local HMI", LW, 100, 1)  // if LW-9222 is 0, change screen to login screen
		SetData(bit_val, "Local HMI", LB, 0, 1)
	else
		bit_val = 1
		SetData(bit_val, "Local HMI", LB, 0, 1)
	end if
		

end macro_command
 
I guess I would confirm that LW100 is actually being set back to zero by the plc control. Display LW100 somewhere you can see it on the HMI. If LW100 is not getting set back to zero the PLC control won't see a change in the trigger.

Keith
 
I guess I would confirm that LW100 is actually being set back to zero by the plc control. Display LW100 somewhere you can see it on the HMI. If LW100 is not getting set back to zero the PLC control won't see a change in the trigger.

Keith

That must be the problem then, because I've already been displaying it and it's not getting cleared. What you said makes sense. Now I just gotta figure out why it's not doing that. If the "clear data after window changed" functionality is broken in easybuilder, maybe I can just clear it in my macro.
 
I would clear it in the macro. The way the control stated the selection it looks like the actual window change must happen before register is cleared, not that the control detected a change. So if the window doesn't change the register is not cleared.

Keith
 
I would clear it in the macro. The way the control stated the selection it looks like the actual window change must happen before register is cleared, not that the control detected a change. So if the window doesn't change the register is not cleared.

Keith

You're the best, thank you. This worked. I NEVER would have figured that out. I have one more question.....any idea on how to get this not to pop up every time I insert a USB? I don't want this window popping up everytime a user inserts their USB to login. See imgur link below

https://i.imgur.com/H0RxqFz.jpg
 
You might want to drop in a plc control that performs this function as well:

Write data to PLC (current base window)
When the HMI initializes, and when the Base Window changes (for any reason), the number of the new
Base Window is written to the PLC Register specified by the Trigger address.

This will provide the actual screen number the HMI is on. that info can be pretty useful and can allow for some more creative screen change schemes.

You can disable that pop-up coming up by de-selecting "Pop-up download window" in the Miscellaneous tab of the System Settings on the HMI.

Keith
 
You might want to drop in a plc control that performs this function as well:

Write data to PLC (current base window)
When the HMI initializes, and when the Base Window changes (for any reason), the number of the new
Base Window is written to the PLC Register specified by the Trigger address.

This will provide the actual screen number the HMI is on. that info can be pretty useful and can allow for some more creative screen change schemes.

You can disable that pop-up coming up by de-selecting "Pop-up download window" in the Miscellaneous tab of the System Settings on the HMI.

Keith

Absolutely brilliant. Thank you so much! Now these things are actually useful :ROFLMAO:
 

Similar Topics

Hello everyone, I am currently facing a challenge while trying to connect two Weintek HMI units with a Mitsubishi FX2N PLC. When connecting a...
Replies
5
Views
546
Hi guys: I'm looking for, the programming software for Weintek MT8150iE, I looked for at Weintek Website, but , I can't find it help me please AD
Replies
5
Views
1,342
I'm attaching an image. Ideally, I want to display a week worth of data on the hmi, but the max seconds I can enter for the x axis second display...
Replies
0
Views
801
Having some fun with a system I’ve been asked to recode. The HMI is manufactured by Weintek (EasyBuilder Pro) and the PLC is an ABB PM573. Linked...
Replies
0
Views
1,022
Hi; I have Weintek HMI MT8051XE at a machine. I want to play a customized alarm sound. I uploaded the alarm sound in project and downloaded to...
Replies
0
Views
1,628
Back
Top Bottom