You can subscribe to this forum after you log in or create your free account..
Posted: 2020-11-03 08:16 PM
There is no specific manual for the M172P DCL as far as I know. You can reference the legacy Display/HMI manual.
To answer your question you can use this (create as global ex. gbl_TimeOut) script:
//Timeout Script Return to main
if (sysKeyPressed AND 2) = 0 and sysKeyPressed <> 0 then
uiStartTime := sysTimer;
if (sysTimer - uiStartTime) > 300000 then
retUINT := Video_SendEvent(kWM_Key, kKEY_VK_F1);
uiStartTime := sysTimer;
sysKeyPressed := sysKeyPressed OR 2;
Next you need to set the Project/Properties/GlobalOnTimer to point to the above global script.
You should create a DINT global variables such as uiStartTime
Set an event for kKEY_VK_F1 (open page,etc)
Set the 300000 to your desired timeout (ms).
Posted: 2022-01-02 04:21 AM
Thanks for sharing the script, it works great. I could not find information regarding "syskeypressed". Could you please tell me where to find it ?
Other than this, and just as an advice, I was thinking that while these secondary pages are open it would be a nice gesture for the operator to keep the light on (sysBackLight =1 seems to work). Any reason why I should not do it that you are aware of ?
Posted: 2022-01-02 10:48 PM
syskeypressed is a target variabel on TM17**D or TM171DGRP or TM172DGRP which shows the status of the onboard keyboard. TM172DCL has no keyboard. Regarding to this the variabel is not available.
But you could look at the variabel "sysLCD_Pressure" in Programming tab or Target Vars/Display.
This variabel is a strucutre which shows the coordinates of the last press and release.
You could use sysBacklight = 1 constantly. But in that case you will reduce normaly the lifetime of the backlight of the HMI.
This point is not espacially descripted but it is in my opinion the normaly technical behaivor.
Posted: 2022-01-03 07:02 AM
Hello Bastian and thanks for your feedback.
I did not notice the post title actually so I´m sure you got confused about my question. My question is actually not related to a TM172DCL.
I implemented the script given on the original answer by DZ_JAPAN on a TM172PDG18R HMI and it works. This HMI has this variable "syskeypressed" available which has format dw (double word) but I could not figure out how to check it´s format, I mean, what bits of the word change when I press one specific key, and how would I know which key is touched programatically.
Actually my ultimate goal is to develop a script to be able to increase or decrease an integer by pressing the up key or down key. This is the standard behaviour for "controllers" and I wanted to mimic it instead of entering the different digits one by one which could be rather cumbersome sometimes.
Thinking a little bit further I guess I could write a global action related to "right key" and "left key" to do this.... Not something that I really need to do it but I think this could be easier for changing values on the HMI.
Posted: 2022-01-03 07:54 AM
You could see the meaning of the system variabel here in a picture of an old training sheet.
But in you case you could use directly an action on a button tocall a local procedur to increase or decrease a value.