Industry Automation and Control Forum
This forum is addressing industrial automation design & engineering, operations, asset performance, cyber security and digital transformation for Plants & Machines.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2020-11-03 08:16 PM
Hello @janim
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;
end_if;
if (sysTimer - uiStartTime) > 300000 then
retUINT := Video_SendEvent(kWM_Key, kKEY_VK_F1);
uiStartTime := sysTimer;
end_if;
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).
Regards,
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
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 ?
Regards
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
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.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
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.
Regards
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.