popupMenu call with direct-initialized dyn_string causes unresponsive UI with max CPU

Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
6 posts • Page 1 of 1
ChristianGoehring
Posts:14
Joined: Fri Feb 24, 2017 9:29 am

popupMenu call with direct-initialized dyn_string causes unresponsive UI with max CPU

Post by ChristianGoehring »

A call to popupMenu with the text-parameter being directly initialized beforehand instead of declaration and then assignment of the value causes the UI Manager to hang and the process go to max CPU (or rather max-thread-CPU).

I am using WinCC 3.15 P05 on Win 7. You can recreate the behaviour by creating a panel and within the RightMousePressed event define the following:

Code: Select all

main(mapping event)
{
  const dyn_string txt = makeDynString("PUSH_BUTTON, text1, 1, 1");
  int answer;
  popupMenu(txt, answer);     
}
When you right-click within the panel the outline of the poup menu shows up and the UI becomes unresponsive. Within the task manager, you can find that the process reaches max CPU (which might be an endless loop, but this is just an assumption). You have to kill this process to end the UI.

However, the following code works perfectly:

Code: Select all

main(mapping event)
{
  dyn_string txt;
  txt = makeDynString("PUSH_BUTTON, text1, 1, 1");
  int answer;
  popupMenu(txt, answer);     
} 
The behaviour is the same whether in QuickTest mode or via UI manager.

schneebergera
Posts:89
Joined: Sun Apr 03, 2016 5:52 pm

Re: popupMenu call with direct-initialized dyn_string causes unresponsive UI with max CPU

Post by schneebergera »

Hello,
within actual version of WinCC_OA 3.15 I couldn't reproduce the described behavior.
with best regards,
Andreas

nmnogueira
Posts:125
Joined: Thu May 05, 2011 12:59 pm

Re: popupMenu call with direct-initialized dyn_string causes unresponsive UI with max CPU

Post by nmnogueira »

Christian, have you tried removing the "const" from the initialization?

schneebergera
Posts:89
Joined: Sun Apr 03, 2016 5:52 pm

Re: popupMenu call with direct-initialized dyn_string causes unresponsive UI with max CPU

Post by schneebergera »

Hello,
it seems that there is a problem in WinCC_OA 3.15 P006.
An internal task was created and delegated to development.

best regards,
Andreas

ChristianGoehring
Posts:14
Joined: Fri Feb 24, 2017 9:29 am

Re: popupMenu call with direct-initialized dyn_string causes unresponsive UI with max CPU

Post by ChristianGoehring »

@Nuno
Yes, I tried without the const and it showed the same behaviour.

@Andreas
Okay, thank you.

schneebergera
Posts:89
Joined: Sun Apr 03, 2016 5:52 pm

Re: popupMenu call with direct-initialized dyn_string causes unresponsive UI with max CPU

Post by schneebergera »

Hello,

it seems to be a problem according a "fade effect", which is handled by operating system (Win7, Win10) settings.
As a workaround, please change system settings in windows.

[Systemsteuerung\\System und Sicherheit\\System - Erweiterte Systemeinstellungen]
[Systemeigenschaften] - Erweitert - Leistung (Visuelle Effekte, Prozessorzeitplanung, Speichernutzung und virtueller Speicher)
Auswahl aufheben:
de: "Menüs in Ansicht ein- oder ausblenden"
---
[Control Panel\\System and Security\\System - Advanced system settings]
[System Properties] - Advanced - Performance (Visual effects, processor scheduling, memory usage and virtual memory)
uncheck:
en: "Fade or slide menus into view"



with best regards,
Andreas Image
Attachments
Performance_Options.png

6 posts • Page 1 of 1