Post Reply 
HP Prime auto shut down behavior
02-09-2020, 07:16 PM
Post: #1
HP Prime auto shut down behavior
I noticed the following behavior of my calculator (G2 running f/w 2020 01 21):
If I execute a program which runs longer than the shutdown value defined in TOff, the calculator immediately shuts down after the program terminates (regardless of key presses or screen touches during execution)--unless TOff is modified in this program; in the latter case the shut down time set by the program starts counting from the moment when it terminates.

Here is a simple program and experiment demonstrating the issue:
Code:
EXPORT WHATEVER()
BEGIN
//  TOff:=15000;
  PRINT();
  PRINT("STARTED...");
  LOCAL Time:=TICKS(),Elapsed; 
  REPEAT
    Elapsed:=TICKS()-Time;
    GETKEY();
    MOUSE();
    IF Elapsed==25000 THEN
      PRINT("NOW !");
    END;
  UNTIL Elapsed>=30000;
  PRINT("DONE");
  WAIT(1); 
END;

1. Set TOff to 15000 (15 sec) from the keyboard.
2. Run the program without touching keyboard or touch screen. The calculator will display: "STARTED..." at 0 sec, "NOW !" at 25 sec, and "DONE" at 30 sec. One second later (because of WAIT instruction) the calculator will shut down.
3. Run the program again, this time pressing any key (with exception of 'On', of course) when "NOW !" appears. The results will be the same as above.
4. Run the program again, this time touching the screen when "NOW !" appears. The results will be the same as above.
(Conclusion: under conditions described above, i.e., program execution time is longer than the shut down value defined by TOff, the calculator shuts down when the program terminates regardless of user interaction during program execution. If the key presses/touches affected shut down counter, in (3) and/or (4) the calculator would shut down 10 seconds after termination of the program.)
5. Modify the program by uncommenting 'TOff:=15000;' line.
6. Run the program without touching keyboard or touch screen. After displaying "DONE" and waiting additional 1 sec forced by WAIT, the calculator will remain on for next 15 seconds, and then will shut down.
7. The same behavior will be observed during conducting tests (3) and (4). (This test is not really necessary, but for the sake of completeness...)
(Conclusion: when TOff is modified within the program, the shut down time is reset, and the counting begins when the program terminates.)

I ran across this issue when I was using a program I had written, with which I was interacting by touching screen, and which kept running for longer than default 5 minutes (which I had never changed). After some time spent on trying to figure out what bug I planted in the code so the calculator shuts down, I discovered that it the behavior was shut down time related.
An additional discovery was calculator's behavior when TOff is modified during the program execution. I am guessing that when the program terminates, the OS "discovers" modified TOff value, and resets the shut down counter before the previous elapsed countdown value event takes effect.

In my opinion, when a program is ran on the calculator, regardless of user interaction during that time (i.e., regardless whether any key is pressed or the screen is touched), the shut down counter should be reset every time when the program terminates. In other words, regardless of how long the program runs, the calculator should remain on for a time defined by TOff after it terminates. This seems more intuitive to me.

A work around this issue is to put a clause in the program which reads TOff, and stores is back again.
Code:
...
TOff:=TOff;
...
seems to be working.

(Note: I have not checked how the previous versions of calculator f/w behave. I also assumed that the system installation on my calculator is clean, and it's not an artifact, but normal behavior, thus did not perform factory reset to start from the clean slate state. I also did not scan the user's manual looking for possible mentioning of this behavior buried deeply in hundreds of pages of text.)

Darius
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
HP Prime auto shut down behavior - DrDarius - 02-09-2020 07:16 PM



User(s) browsing this thread: 1 Guest(s)