Back Up Next

70.  Is there is a tool to compile programs on a PC?


    See question #69 for information on sRPL if you mean assembly code.  However if you mean a tool for use with the built in HP-Basic language then although you may use the PC to write them (text editing) you don't actually compile them on the PC - you download them to the calculator and let it compile them.  If you want to compose them on the PC then you have to use the ADK39 (Aplet Development Kit), which can be found on my Utilities page. Extensive examples on how to use the ADK are given in my Programming section on my Help page.

71.  How can I solve linear systems of equations like the one shown below using the CAS on the hp 40gs?



    Before I begin, it is important that you understand that this can only be done on the HP40G or hp 40gs, which have a CAS (Computer Algebra System), not on an HP38G, HP39G hp 39g+ or hp 39gs.

    To do this you need to use the LINSOLV function in the CAS, which requires that the problem be in equation not matrix form. See the screens on the right.


    Some points to note:


    You must put a multiply between the K and the Y, otherwise it will interpret it as a variable called KY. The CAS allows variable names to have more than one letter.


    When you enter the '=' in the first equation you may find that it brackets the Y. If this happens, highlight the 2X+KY before pressing =.


72.  Can I use the infra-red port on my computer to communicate directly with my calculator and remove the need for a cable?


The information below is from Christoph Giesslink, the main author of the PC Emulator program (see my Utilities page ).  I will simply add to it that I have spent a lot of time trying to make it work, for obvious reasons, with no success.  If you manage to figure out how to do it reliably then PLEASE let the rest of us know how!

*      IR transfer between a PC and the HP38/39/48             *

There are several questions about transferring data from a PC to a HP and vice versa using the Infrared port.

1) Hardware

Some theoretical aspects:

Pulse width:
 HP transmitter : typ = 52us, min = 46.8us, max = 57.2us
 HP receiver    : typ = 52us, min = 40.0us, max = 80.0us
 IrDA: 3/16 of Baudrate = 1/2400*3/16 = 78us or 1.6us
 HP: 940nm
 IrDA: 850..900nm

Remember: You can only use this interface to connect with the 2400 Baud serial protocol, connecting the HP82240B infrared printer isn't possible.

The first problem we have is the pulse width. If your PC IrDA interface is generating the pulse width with 3/16 of the baudrate it's OK, but there are several interfaces out there, which are using a 1.6us pulse width for all baudrates. That's too short for the HP IR interface, so no chance to get it working.

2) Software protocol layer

Next we have to distinguish between the software protocol layers. The IrDA 1.0 specification describes the hardware and the software protocol stack layer. The IrDA protocol stack defines several parts for data transport, especially the framing of the data. The framing isn't compatible with the HP one. An optional component is the IrCOMM layer which shows the IrDA hardware as virtual COM port. Here the application itself can make the framing. So you need an operating system which can access the IrCOMM layer of the IrDA hardware. The newer Microsoft Windows operating systems have an integrated IrDA support. That causes also problems. Here are my experiences with some MS Windows versions.

3) Operating system

I tested an Infrared connection with a Tekram IRmate IR-220 for motherboard connection supported by the BIOS on COM2 and with the IrDA interface of a Compaq Armada 1570D Laptop (fixed a resource problem with the factory setting of the IrDA port first). The testing distance was 5..30cm.

- Win95:

Only tested on the laptop, here it worked.

- Win98:

Only tested on the PC. Doesn't work, even when I disable the IrDA driver. I don't know what going wrong. Perhaps my fault.

- WinNT4.0 SP3:

Only tested on the PC. Worked with the Tekram IRmate IR-220 IR module.

- Win2k SP1:

Only tested on the PC. In this operating system the needed IrCOMM protocol stack layer for virtual COM ports is missing, so you need a 3rd party product. I tried it with a software driver for mobile phones, but it also don't work.

4) Terminal applications

For the first test I used a HP48 and Emu48 as software on the PC (OS NT4.0) and on the Laptop (OS Win95). I transferred an UserRpl file in binary mode. Both hardware works.

As second test software I used MS-DOS Kermit 2.32/A. I tried to transfer the same UserRpl file in binary mode as before. With the Tekram adapter this work, the Compaq transfer fail!

In general, the biggest problem is that you get IR reflections from the transmitter to your receiver while transmitting data. Before you receive the answer, the software has to clear the receive buffer. Some IrDA receiver hardware does this without software support, so most communication software will run on this hardware. Emu48 has no problems, because the original HP romcode is running, the HP clears the receive buffer after transmitting data. Most popular transfer software doesn't clear it's receive buffer after transmitting, so it mostly depends on your hardware if the IR transfer works. The Temic IrDA-Transceiver TFDS3000 for example has problems with the IR reflections from the transmitter, the newer TFDS4000 or TFDS4500 doesn't.

So that's the reason of the different behavior or the Tekram IRmate IR-220 and of the Compaq Armada 1570D Laptop. The Tekram IRmate clears the IR reflections by hardware, the Laptop doesn't. Emu48, or better the emulated calculator, takes care about the reflections, so it worked also on the Laptop in this case.

5) Result

The IR transfer with IrDA hardware between PC and HP calculator might work, but because of the many exceptions, explained above, it mostly will fail.

06/27/01 (c) by Christoph Gießelink,

73.  How do I transfer the results from a CAS calculation on an HP40G or hp 40gs to the Function aplet?


Highlight the expression which you want to transfer and then press the PLOT button.  The calculator will ask which of the Function, Polar or Parametric aplets you want to transfer it to. It will then ask which of F1(X)..F0(X) (or R1 or X1,Y1) you want it put into. You have to manually tick/check the equation in the aplet before you can graph it. 


74.  Can you use HP38G aplets with an HP39G (or vice versa)?


The answer is both "Yes" and "No".  You can SEND and RECV programs, notes, lists or matrices from an HP38G to an HP39/40G or vice versa with no problems. 

But...  if you SEND an aplet from an HP38G to an HP39G (or vice versa) then it will appear to succeed and will then appear in the APLET LIBRARY view of the new calculator. However, if you try to START it then you will not only find that it doesn't work, you may well find that your whole calculator will crash, losing your memory in the process. If it happens this will not cause permanent damage and all the built-in aplets will still be there but anything you have stored will be lost.

The easy solution is to use the Aplet Converter, which can be found on my Utilities Page, to convert your HP38G aplets to HP39G aplets.  Of course they have to be stored on a PC before you can do this, which means you have to have a cable and the HPGComm communications program (also on my Utilities Page). If you don't have this - if all you have is an HP38G and an HP39G - then there's nothing you can do I'm afraid. You'll have to reconstruct the aplet from scratch. The Aplet Converter also only works in one direction - there's no way to convert an HP39G aplet to an HP38G aplet.


75.  Why does the 3 character in the SPECIAL CHARS view give a -1 instead?


You may not have noticed but if you choose the 3 character from the SPECIAL CHARS view (see image right) then that's not what appears in the HOME view or a Note.

You'll find that what you get is a power of -1!

Why?  Well it goes back to the original model, the 38G. On the 38G if you pressed (say) 4 and then the X-1 key on the keyboard what actually appeared was 4^(-1). This was a bit clumsy and Jean-Yves, the principal programmer for the 39G upgrade, decided to add a new character to the font so that the power of -1 could be shown directly. To do this he had to 'borrow' one of the other characters and change its appearance. He chose to adapt the 3 character because it was no use for anything very much. If you tried to use it to cube something it didn't work - you just got a syntax error because it was only ever intended to be used in Notes as are other chars such as ¿ or ½.

The only problem was that he must have forgotten to update the CHARS view to reflect the changed appearance and it's never been fixed in subsequent models.  Oops! :-)

76. How can I stop my batteries discharging unevenly?


The following are excerpts from an HP User newsgroup. The answers were penned by various people and collected by Joe Horn in response to some very strange questions (and humorous answers) about batteries....

Question 1: When I replace my batteries I always find that the middle one is dead but the other two still have some life in them. How can I balance out the current drain from the batteries, so that the middle one doesn't die first?

That's a tough one to change. The middle one drains first because of centrifugal effects. The zig-zag pattern of installation helps, because it lowers the power system inductance, decreasing the gyromagnetic moment. One option we discussed is to have an alarm preprogrammed which, when it goes off, suggests that you remove your batteries an rearrange them. This would be comparable to rotating the tires on the car every six months. We didn't do this because the alarm repeat interval would be different in the Southern Hemisphere from that in the Northern Hemisphere, and we didn't want to seem insensitive to our international customer base.

And if you believe that, I can offer you a real bargain on the Brooklyn-Wheatstone Bridge.


Question 2:  ...under further experimentation I discovered that if I reinserted the same 3 batteries in the calculator but in different positions I got another 3-4 months out of the set... ...Logically I can assume that not every battery is the same so they  may fail at different times. This does not account for the effect  of position in the calculator though...

To which DEB3291@TNTECH.BITNET [David Byrd] replies:

Could you please clue a fellow EE student, as well as all the other subscribers, on *which* battery positions you are talking about? I'd do anything to get batteries to last a little longer.

The clue to both of these puzzles is: The Ether Wind. Batteries tend to drain at different speeds depending on their Absolute Position in The Universe due to the effect of the Ether Wind (see any pre-1881 physics text). Although most users carry their HP 48 about, and randomize its position enough, some users apparently are so sedentary that they keep theirs in one Absolute Position long enough to give the battery(s) facing one direction constipation, and give the other(s), uh, a higher rate of drainage.

If you find that the battery(s) facing a particular direction always die first, I suggest any of the following to neutralize this effect of the Ether Wind and to make your batteries last as long as possible:

(1) Keep your HP 48 wrapped in several layers of lead foil. (You can have a hole above the display, since the batteries are at the other end, and you know the keyboard by heart by now anyhow). If you use the HP 48 a lot, you can avoid lead poisoning by covering the lead foil with a layer of aluminum foil. (Helpful hint: also keep your spare batteries refrigerated and individually wrapped in lead foil).

(2) Hold the 48 rightside up one week, then upside down the next week, and so on. You'll probably want to switch hands, too, since your wrist will tend to cover the display otherwise. You can get used to it in just a few months.

(3) Store your 48 at night on a rotating object, such as a microwave oven's turntable. (Do *not* tie it to the blade of a fan, however, since the centrifugal force will distribute the electrons unevenly in the batteries causing the electricity to get clogged.)

(4) Stop being such a couch hacker; program while driving, skiing, skydiving, and other mobile activities.

(5) Use a marble slab, pool of mercury, laser beam, mirrors, and diffraction grating to determine the direction of the Ether Wind, and rotate your couch accordingly.

Sorry to belabor the obvious, but people keep asking.

-Joe Horn- -Peripheral Vision, Ltd.-

77. The ADK will not edit sketches on my computer which runs Windows XP.

Question by: Ameen

I am having trouble editing a sketch in the ADK because the Windows Paint program doesn't load up in Windows XP. Can you please tell me the directory it expects paint to be in, and the filename it is referring to?


On my computer, running Windows 98, you just edit the aplet in the ADK39, go to the Views menu/Sketch view, display the sketch you want to edit and click on the Edit button. This runs Windows Paint. Unfortunately on Windows XP they seem to have renamed the Paint progam so that the ADK tries to call the wrong program. Just go to the C:\WINDOWS\SYSTEM32 directory, make a copy of MSPAINT.EXE and then rename the copy to PBRUSH.EXE, which is what it was called prior to Windows XP. You should then find that it works.

Some relevant tips...

  1. To transfer a sketch from one aplet to another on the calculator just use STO on the original to store the sketch in part or whole to one of the graphics variables G1 (G2,G3...).  Now go to the new sketch and press VARS, choose the HOME variable list using SK1, scroll to Graphics vars and choose the one you used to store the sketch. Now choose VALue using SK4 and press OK. The saved image will be pasted into your sketch view.
  2. If you are using sketches to illustrate notes that you've stored on the calculator then you should save yourself a lot of work by doing the editing of the sketch on the computer by storing the aplet to the PC and then editing it using the ADK39.
  3. You can capture an image of any screen on the calculator (not just graphs) by pressing ON+PLOT (hold down ON and press PLOT).  This will store a screen capture into G0 which you can then paste into any sketch view using the VARS button as outlined in point 1 above.
  4. If you want to paste an image into a sketch from some other source then you can do this by editing the sketch using Windows Paint and pasting the image over the top of the one you are editing.  Just be sure that the new image is no larger than the existing one and is only black and white.

78. Does the serial number on the back of my HP mean anything?

Thanks to Samuel Sosa in Venezuela for the following information:

Serial numbers follow the pattern of...  ccywwnnnnn


bulletcc    is place of manufacture (a two-letter code)
The known codes are:
bulletSG = Singapore
bulletID = Indonesia
bulletMY = Malaysia
bulletCN = China
bullety    is year of manufacture and consists of the last digit of the year.
        For example, a 7 would mean 1997.
bulletww    is week of manufacture (01-53).
bulletnnnnn    is the unit number for that week. The first unit made on Monday is 00001.

For example, if your serial number were SG72706543, then the unit was the 6543rd unit manufactured in Singapore during the 27th week of 1997.

79. What is this rumour about an aplet that turns an HP39G into an HP40G with CAS?

The HP39G and the HP39G were released at the same time in April, 2000. The HP40G has a computer algebra system (CAS) but no infra-red. The HP39G has infra-red but no CAS. When we were designing the machine one of the programmers came up with a brilliant idea to save money. Instead of having a chip for each machine, he wanted to build just one chip that would be used for both. It would have both IR and CAS with an internal switch that would determine what calculator the chip was in and enable/disable the CAS and IR accordingly. Of course, we were concerned that there would be the chance of someone changing their machine type but he assured us that the internal switch would be encrypted and could not be broken.

So.... of course about 8 months later I was contacted by a hacker in Spain who thought he was terribly clever because he'd come up with an aplet which would change a 39G into a 40G. Sigh!  I spent the next month trying to convince him not to release the aplet because I knew that if it became available the reaction of the examining bodies would not be good. Certainly in my home state of Western Australia at least. However, he was adamant that I was wrong about the likelihood of the authorities banning the HP from being used. After all, he was in his twenties and knew it all, whereas I'd only been teaching for as long as he'd been alive so what did I know? In the end he compromised in two ways. Firstly, he agreed not to announce it publicly and to make it available only if people asked for it. Secondly, he (quite cleverly) programmed the aplet, which was called the "CAS Enabler", so that if you renamed it then it no longer worked. This at least made it easy for examiners to see whether it was on the calculator simply by checking the APLET view. He also embedded a special character in the name that couldn't be accessed from the keyboard or the CHARS view. This meant that if you renamed it before an exam and then tried to change the name back afterwards you couldn't access this special character and so it still wouldn't work.

This worked for about another year. Then gradually there began to be rumours about the aplet's existence and finally it reached Western Australia via, I believe, a student who had a friend in Italy or had been on holiday there. At this point someone contacted the State Curriculum Council about it. When they asked me about it I confirmed the problem and explained the conditions the author had placed on it. Based on this they decided that the current students (year 12) who were about to do their exams would be allowed to continue to use the calculator, subject to inspection at the beginning of the exam to ensure the CAS Enabler aplet wasn't on any calculators. The same was to hold for the following year's students (year 11) but the year 10s were told that they would not be able to use the 39G in their uni entrance exams and it was now officially banned. I was told that they were originally talking about billing HP for extra examiners to check the calculators but in the end teachers did it.

As you can imagine this ban did not go down well with the students who had bought calculators at the start of year 10 and were now being told they couldn't use them. Fortunately HP had had enough warning that they had had time to bring out a replacement model, the 39g+, which had a chip in which the CAS had been completely removed. To their credit they replaced all the calculators for the year 10s in the whole state free of charge. It must have cost them a fortune! The problem was that the 39g+ had been produced in a rush and the keyboard design was outsourced to China. This proved to be a mistake. There had been occasional problems with the keyboard of the 39G/40G but the original 39g+ keyboard was terrible! A second release was done later with a much improved keyboard and any machines that gave problems were replaced under warrantee but the damage had already been considerable to HPs reputation. It was not until the release of the 39gs/40gs, which use a completely different design, that the keyboard problems were finally fixed.

If you've read this question before then you'll know that for some years now I've refusing to confirm the existence of this aplet or make it available on this site. There were a number of reasons for this. Firstly, I've signed contracts with HP that limit what information I'm allowed to discuss for 5 years after a project's release and so haven't been able to discuss it before this. Secondly, let's suppose that I had made the aplet available on this site. Since its use was clearly illegal in any examination, all I'd be doing is helping a student to cheat. Morally this is hardly a good idea. Additionally, I'd probably be laying myself open to a law suite if a student was caught and their uni career ruined as a result of having obtained the aplet from me.

In the meantime, if a teacher contacted me to ask about it then I would email them back telling them that if they requested a copy on official school letterhead then I'd send it to them. A couple of students tried to pretend that they were teachers but never got back when I told them this! I'm still not going to put it on this site and I'm only telling you all this now because I doubt if there are any students out there still using the old 39G. If you want a copy of the aplet for some reason then contact me and just convince me you're allowed to have it.

So, now you know!

Last modified: 19 Dec 2007                                             Sitemap        Home        Contact Me