How to automatically change screen saver with barcode scans

How to automatically change screen saver with barcode scans
none 0.0 0
  • HMI Model: cmt-fhdx-820
  • EasyBuilder Pro Version: v6.09.02.651

I am using an action trigger on my screen 80[screen saver] page to login in users via a RFID scanner. This action trigger is using the barcode scanner/keyboard device flag 0 to initiate the login and also changes window to the operator’s screen.

The problem I am having is that if the operators just login in to view this screen and don’t touch the screen, the HMI will not go back to the screen saver page. My screen saver is enabled and set to 2 minutes.

Thanks for any input.

Hi @KeithO ,

Thank you for reaching out!

Could you send us images of your screen saver settings, PLC control objects, and the action trigger set up to help use investigate the issue further.

Thank you!

Screen saver settings

Action trigger that is on the screen saver page

Ive reduced this trigger down to changing the screen to our main screen[16] and am still getting the same outcome of the screen saver not activating until one minute after the screen is touched.

“Barcode” settings for RFID reader, this is an Elatec TWN4 T4PK-F02TR6-P model

Hi @KeithO ,

Could you enable auto logout within system parameters as well and see if this triggers the screen saver window.

Thank you!

Yes, this is enabled

I isolated the action command to just the reader flag changing value to trigger going to the main screen from the screen saver. After this action is complete, if there are no touches on the screen, the screen saver will not activate.

Hi @KeithO ,

Thank you for checking and updating me about the auto logout.

Next, could you try adding an idle timeout to your project and see if that leads you back to the screen saver page? This will be within a Global Action Trigger.

If that still does not work, could you place a numeric object on the window with the barcode scanner address set to LW 9041? This system address turns to 1 when a user touches the HMI. To ensure the barcode scanner isn’t accidentally being detected as a touch due to polling, please verify that this address returns to 0 after the login process is complete.

I tried the idle time out but that doesn’t activate the screen saver. The scanner does not change lw 9041 from 0 unless it happens faster than the screen will register.

@KeithO,

If the application screen saver is enabled within the system parameters the application should change to the screen saver window unless:

  • A user interacts with the screen which would reset the screen change.
  • A PLC Control object is controlling the window operation and changing the screen that is open.

Can you please send us an image of the PLC control object setup so that we can see if there is anything in the project that might cause a conflict with the window change?

I dont have any PLC crontrolled objects set up for this

I did try using an action trigger to write to lw 9041 to simulate a user interaction after swiping the card but that appears to be a read only register.

Tried making a new project using this hmi and just a barcode device and this project replicates this same problem using offline simulation. I am triggering the barcode device flag via diagnoser.

Setup:

Settings:

Window 10:

Screen Saver:

Hi @KeithO ,

We were able to replicate your issue, and our recommended solution is to use a macro to keep a count on the login page and a PLC Control object to switch windows.

In the macro below, a counter variable “i” increments each second the user is on the login page and not interacting with the screen. When the count reaches MAX_TIME, which is set to 30 seconds initially, the PLC Control command at LW-0 changes the project window to the screen saver (window 80).

When the barcode scanner performs a scan (the result variable is set), the project uses the LW-0 PLC Control address to change the window back to the login page.

A Global Action Trigger is also used to reset the count if the user touches the screen to ensure idle functionality.

The macro is shown below, and here is the link to the demo project.
Screen Saver Demo Project

Please let us know if you run into any problems or have any questions.

macro_command main()
	short MAX_TIME = 30 // time to be idle before setting to screen saver window. 
	
	//command
	short result = 0
	short clear = 0
	
	// counter
	short i = 0
	
	//windows
	short window = 0
	short home = 10, saver = 80
	
	GetData(window, "Local HMI", LW, 9050, 1) // get the current active window
	GetData(result, "Barcode Scanner/Keyboard", RESULT, 0, 1) // result of the barcode scanner 
	GetData(i, "Local HMI", LW, 1000, 1) // counter
	
	// Check to see if barcode has scanned to indicate if HMI is idle 
	// Action trigger will also check if HMI is idle
	// If HMI recieves scan or if user touches screen the count is reset
	if result == 0 and window <> 80 then
		i = i + 1
		SetData(i, "Local HMI", LW, 1000, 1)
	else if result == 1 and window <> 80 then
		result = 0
		SetData(result, "Barcode Scanner/Keyboard", RESULT, 0, 1)
		i = 0
		SetData(i, "Local HMI", LW, 1000, 1)
	else if result == 1 and window == 80 then
		result = 0
		SetData(result, "Barcode Scanner/Keyboard", RESULT, 0, 1)
		SetData(home, "Local HMI", LW, 0, 1)
		DELAY(250)
		SetData(clear, "Local HMI", LW, 0, 1)
	end if
	
	// If HMI is "idle" for 30s then switch to screen saver window
	if i == MAX_TIME and window <> 80 then
		i = 0
		SetData(i, "Local HMI", LW, 1000, 1)
		SetData(saver, "Local HMI", LW, 0, 1)
		DELAY(250)
		SetData(clear, "Local HMI", LW, 0, 1)
	end if
		
end macro_command
1 Like