HP Forums

Full Version: Need to tame control/program alarms (HP 48)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Some of you have probably heard about the medical-related stuff I've been pounding out on my 48 in the hospital. I've got a program that alerts me when I can use the PCA pump again (it's got a 6-minute cool-down), and I've written it to schedule a program alarm so I can play a custom tune, and not have to bother with ACKing the alarm if I miss it/sleep through it.

It works mostly as intended, but misbehaves a bit sometimes. Just looking for a little input to see if I should be doing it better. Everything is stored in the { HOME PCA } directory.

There's a main PCA program that does the data entry and scheduling. This is essentially how the alarm gets scheduled:



The alarm goes off in 6 minutes, and the embedded program ensures it's in the { HOME PCA } directory, then calls the READY program which displays a message and plays a tune.

This is the READY program, which handles displaying the message and playing a sound:



F and D are two short lists of frequencies/durations, and PLAYSOUND is a program that lives in { HOME } which streams them through BEEP.

Two problems:

1. Once in a great while, the alarm doesn't seem to execute (or at the very least doesn't get cleaned up), and I find it still sitting in the browse alarms list. The scheduling code is actually a tiny bit more sophisticated than shown above, as I check to see if I need to advance the date if the scheduled time wraps past midnight.

2. Execution of the alarm program is very intrusive. If I'm using the calculator, it will boot me to the stack when it executes READY. I've had it throw me out of the editor and cause me to lose a couple minutes of RPL coding at least once. Can I make the alarm program more civil in any way? I'd settle for being able to check if the calc is in use (i.e. not idle at the stack), and just set a user flag so there's some kind of display annunciator.

I'd just do it with a string-based message alarm, but then it would sound like my alarm clock... (a 48G with a couple minor screen defects that I use for that specific purpose)
Reference URL's