HP48SX program HELPPPP...



#4

Hi There, I tried to write a simple program that receives ASCII characters (from RS232 port), and performs any task according to it (for the HP48SX calculator). I spent lots of time programing it and I don't understand why the program dosn't performs the CASE loop instructions. I will appreciate very much if you can help my to solve the problem. The program is:

%%HP: T(1)A(D)F(.); « CLLCD ERASE DO @ START INFINITY LOOP.

1 SRECV DROP NUM  A @ RECEIVE CHARACTER TO LOCAL VAR. A.

«

CASE @ START CASE LOOP.

A 50 SAME @ ASCII 50 IS 2 KEY?.

THEN

"TWO" @ PRINT "TWO" IF 2 KEY IS PRESS.

END

A 50 @ IF OTHER KEYS PRESS?.

THEN

A 1 * @ PRINT ASCII CHR. OF A KEY.

END

END

» UNTIL 0 @ INFINITY LOOP. END »

Thank you, Best regards, Tal. email: td@chem.ch.huji.ac.il


#5

Tal,

Your second test "A 50" doesn't have a test condition, so the CASE takes the 50 from the stack as the flag condition for the statement. (Remember, many languages test as follows : 0 = FALSE; All other numbers = TRUE ).

Also, you should remember to OPENIO at the start of the program and CLOSEIO at the end. I read that closing the I/O extends battery life. Change your IOPAR variable, fourth value to 1 so that handshake is on between the PC and the 48.

I have tried something like this before using the 48 User code with limited success. The input buffer reads only 255 characters, you have no direct control over the serial port, etc,etc.etc. Keep trying but expect some challanges.

Joe

#6

To all;

There's more to this program that is causing problems. I MUST REMEMBER to check out the code and refer to the manuals before providing answers.

Joe


Possibly Related Threads...
Thread Author Replies Views Last Post
  HP Prime: run a program in another program Davi Ribeiro de Oliveira 6 611 11-11-2013, 08:28 PM
Last Post: Davi Ribeiro de Oliveira
  HP41 emulator for HP48sx - keyboard overlay needed Doug (NYC) 3 403 12-31-2012, 03:11 PM
Last Post: Allen
  HP48SX seems fully functional won't run SELF TESTS? Bruce Larrabee 5 511 07-16-2012, 11:04 PM
Last Post: Luiz C. Vieira (Brazil)
  Did We Miss The 20th Anniv. of the HP48SX? Jake Schwartz 6 443 03-19-2010, 05:55 AM
Last Post: Bill Zimmerly
  HP48SX accuracy questioned. Pal G. 3 325 09-10-2009, 09:01 PM
Last Post: hugh steers
  HP48SX LCD problem... Geoff Quickfall 4 301 08-16-2009, 04:35 PM
Last Post: NACHO
  Kermit K95 ver 2.1.3 GUI and the hp48sx Mike Reed 6 482 01-28-2008, 11:37 PM
Last Post: Mike Reed
  HP-41 MCODE: Making an MCODE program call another MCODE program Geir Isene 10 764 01-13-2008, 05:58 AM
Last Post: Raymond Del Tondo
  HP48SX case removal Ryan 1 193 07-19-2006, 03:58 PM
Last Post: Han
  HP48SX with black LCD (photos inside) Han 3 302 06-02-2006, 04:02 AM
Last Post: Han

Forum Jump: