Function For Screen Locked For Cleaning A Touchscreen

Recommended Posts


I am trying to create the ability for the user to lock the screen for a set period of time (say 30-seconds) so that a Touch Screen can be wiped clean without pressing a button by accident.

I have created a seperate page with a symbol which is as big as the screen. When the user presses the LOCK SCREEN button this calls this page (on top of the existing page) - by calling the whatever page the user is currently on as well as the locked screen page with the full page symbol. I have made sure that I have 'BRING TO FRONT' the symbol; but am have some problems where sometimes I can still press buttons that are below this symbol. What am I doing wrong??

Is there a better way of doing what I am trying to acheive?

Many thanks...

Link to comment
Share on other sites

Why are you keeping the other page visible? Just switch to the cleaning page, then switch back after 30 seconds.

You cannot block component actions by putting a component on top of another. If it did, then, for example, you wouldn't be able to do things like make custom buttons with a text component on top of an image without giving both components the same action. Basically, DAQFactory works its way through the stack until it finds something (if anything). This is actually how many UI's work.

Link to comment
Share on other sites

I want to keep the page that the user is on still visable (the screen also displays alarm indicators; that I still want to be seen); one thing I forgot to mention is that the 'LOCK SCREEN' symbol that I created is blank (IE there is no graphic on it, such that it is transparent) - but it does have an action to reset the timer to 30-seconds (so that there has to be no activity for 30-seconds before the user can use the screen again).

If this symbol in on top of all the 'other' buttons/symbols etc - does this not take priority? or are you suggesting that if there are two symbols - one on top of the other - that both actions will be done?

I have found that this does work in most instances but not in others and I have not discovered a reason why it sometimes works and sometimes doesn't... (maybe it is that some of my sybmols have a TOGGLE BETWEEN function and others have a QUICK SEQUENCE).

Link to comment
Share on other sites

First, make sure the 30 second timer is actually a sequence. Don't do delay(30) in a component action. That will freeze the UI.

Next, its important to understand that there are actually two different groups of components in terms of ordering, and ordering changes only affect the order within the group. Most of the components are in the top group, but graphs, panels and symbols are in a separate group that are always displayed behind the first group.

This was done because those items are drawn in the background thread, allowing you to create complex graphs without bogging down your system. This was much more of an issue when DAQFactory was first released 11 years ago. Now, computers are much more powerful, and pretty much all are multicore, so the issue isn't as big, but for backwards compatability we've kept it that way. It will likely change in upcoming releases as we try and clean out some of these older "features".

Probably the best solution is to create a duplicate of the page you want to keep visible, then on the duplicate page, remove all the component actions, so its just a display screen. Maybe add something so the customer knows you are on the "no-interaction, clean your screen now!" page, and then you can just switch between them from script as needed.

The alternative would be to make it so all the screen components use a quick sequence action, and have that action always check some sort of enabled flag you created with a global variable.

Toggle between, btw, can be implemented in script simply as:

myChannel = !myChannel[0]

assuming myChannel has been initialized in script to some value during startup.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.