PSTimer

roo

New Member
I got the PSTimer to work, but it is affecting other windows in the application. It doesn't appear to take focus away when you're in another window, yet the application is freezing up from time to time. When I took the PSTimer out, the application had no more problems with freezing up.

Is anyone aware of this problem and, if so, what can be done about it? In the tick procedure, I set the interval to 0 and then reset it back at the end of the procedure. Should I also be disabling the timer for the duration of the tick procedure, and enable it afterwards?
 

roo

New Member
What I'm doing in the tick procedure

Here's the code:

PROCEDURE AlertTimer.PSTimer.Tick:
DO WITH FRAME {&frame-name}:

chAlertTimer:pSTimer:interval = 0.

ASSIGN
fillStatus = "Status Display"
fillAlert = dayofWeek(WEEKDAY(TODAY)) + " " + monthReturn(MONTH(TODAY)) + " " + STRING(DAY(TODAY)) + ", " + STRING(YEAR(TODAY)) + " " + STRING(time, "HH:MM:SS").

DISPLAY fillStatus fillAlert.

chAlertTimer:pSTimer:interval = 5000.

END.

END PROCEDURE. /* ControlFrame.PSTimer.Tick */


---------------------------------------------------

Any idea on why this is causing the application to freeze up would be much appreciated.

Thanks,
Roo
 

roo

New Member
I tried checking for a transaction and returning no-apply, but it didn't work. Everything ends up freezing when the tick procedure gets called, but only when particular windows are open. For example, I tried a CTRL-ALT-D, clicked on Persistent Procedures, and waited while this dialog was open for the tick procedure to get called. Once the tick procedure gets called, everything freezes up, and I can't close anything. I have to kill the task.

Here's the code I currently have:

PROCEDURE cfAlertTimer.PSTimer.Tick:

IF TRANSACTION
THEN RETURN.

DO WITH FRAME {&frame-name}:

ASSIGN
chcfAlertTimer:pSTimer:interval = 0.

IF vCount = 0
THEN
vCount = 1.
ELSE
vCount = 0.

IF vCount = 1
THEN
chcfAlertMarquee:navigate("J:\rxtfc\wip\src\common\marquee2.html").
ELSE
chcfAlertMarquee:navigate("J:\rxtfc\wip\src\common\marquee.html").

ASSIGN
chcfAlertTimer:pSTimer:interval = 20000.

END.

RETURN NO-APPLY.

END PROCEDURE.

----------------------------------------------

Any ideas on what else I can try?

Thanks,
Randy
 
Perhaps Progress doesn't like talking to the OCX when a dialog-box is active?

Does it freeze with normal windows?


Do you really use hardcoded pathnames?
 

bendaluz2

Member
This has just occurred to me (so it may be completely wrong), but

you have
<pre>
ASSIGN
chcfAlertTimer:pSTimer:interval = 0.
</pre>
to disable the ticks while your trigger is running, and
<pre>
ASSIGN
chcfAlertTimer:pSTimer:interval = 20000.
</pre>
to reenable them afterwards, which is a reasonable thing want to do. However, by reducing the interval to 0, wont that just make it fire off repeatedly over and over again, and lock up the system (as seems to be happening). It would be better to do
<pre>
ASSIGN
chcfAlertTimer:pSTimer:enabled = no.
</pre>
and
<pre>
ASSIGN
chcfAlertTimer:pSTimer:enabled = yes.
</pre>

Hope this helps :)
 

roo

New Member
It doesn't , so far anyway, freeze with normal windows. It seems to be a dialog box thing, but not all dialogs, so I can't quite pinpoint why it's happening. Maybe its a problem with nested dialogs, and by that I mean a dialog box open from another dialog box. It seems to be okay with a single dialog box open, but if two dialog boxes are open at the same time, it freezes up.

The hardcoded pathnames are temporary.

I don't think setting the interval to 0 would cause a problem, as I believe this has the same effect as disabling the timer.

Being that we will have a large number of customers using this software, I need to get around the problem.

Do you know a way around this problem, or of any other type of timer/code I could use?

Thanks for all your advice,
Randy
 

bendaluz2

Member
I have had similar problems myself with dialogs, it causes a GPF when the tick occurs and a dialog is present. To get round this problem, I disable the timer when I create the dialog, and reenable it when the dialog is fulfilled, though this may not be acceptable for what you want to do.
 
Using different timers OCX's will not help the problem. The problem is with progress not handling mutiple threads/events etc.

If you have an empty tick procedure does it still freeze in dialog boxes?


If not you need to work out which line/part of your tick procedure causes the freeze.
 

roo

New Member
It has been awhile since I worked on this, and I just got back at it again.

If I have an empty tick procedure, it still freezes when there are two dialog boxes open. It seems like it is freezing just when the tick procedure is called, or just when the interval is up, which should mean the tick procedure is being called, unless there is some other activity I don't know about when the interval is up.

Any suggestions? Is there any way to skip the call to the tick procedure for an interval(s), if there is an active transaction?

Thanks to all the people who have given me advice so far,
Randy
 

Axel

New Member
We have the same problem with the PSTimer. Each time a modal dialog is open and the OCX fires, Progress freezes.

As far as I know, this is a reported bug and fixed in 9.1e.

With Windows XP we have similar effects with other OCX firing events not related to user input: Progress freezes with 100% CPU load.
 

bendaluz2

Member
Only way to solve it is to disable the timer when you create the dialog, and then catch up when you close the dialog. If you really need to do something like this and need to keep the timer going, dont use a dialog. Use a window, but disable all the other windows so its modal.

Originally posted by Axel
We have the same problem with the PSTimer. Each time a modal dialog is open and the OCX fires, Progress freezes.

As far as I know, this is a reported bug and fixed in 9.1e.

With Windows XP we have similar effects with other OCX firing events not related to user input: Progress freezes with 100% CPU load.
 

CraigS

New Member
Forgive me ignorance... but being relatively new to the progress language, I am not sure if this PSTimer is something I can use.

One of my many projects on the go requires a timer based trigger... i.e. at 8:00 pm every Tuesday night I need to run a certain dot-p. Is this tool something that can help me?

If so, could someone please point me in the right direction with some sample code or a reference point?
 

roo

New Member
I'm fairly new to Progress myself, so I'm no expert, but I would say no to using the PSTimer for such a specific time...unless the window you have the OCX in is always running, but it will get complicated with setting the interval, especially since it is in milliseconds. The PSTimer OCX Trigger fires at a set interval, whatever you set it to. I suppose you could set it to go off once a week, but that would be a very large number for the interval, and I cannot remember for sure, but I think there is a limit to what you can set the interval to.

If the window you have the PSTimer OCX in ever closes, you'll lose the handle to the OCX. As well, the timer competes with other system activity, so the interval is not always accurate, depending on other activity.

You'll probably have to create some sort of background process. We use crontab at our company for running certain things at specfic times.

Randy


CraigS said:
Forgive me ignorance... but being relatively new to the progress language, I am not sure if this PSTimer is something I can use.

One of my many projects on the go requires a timer based trigger... i.e. at 8:00 pm every Tuesday night I need to run a certain dot-p. Is this tool something that can help me?

If so, could someone please point me in the right direction with some sample code or a reference point?
 
For this I would not use pstimer (an ocx that comes with Progress).

I would use cron - on unix. Or AT (scheduler) - on NT.


CraigS said:
Forgive me ignorance... but being relatively new to the progress language, I am not sure if this PSTimer is something I can use.

One of my many projects on the go requires a timer based trigger... i.e. at 8:00 pm every Tuesday night I need to run a certain dot-p. Is this tool something that can help me?

If so, could someone please point me in the right direction with some sample code or a reference point?
 
Top