DM42

General discussion about calculators, SwissMicros or otherwise
User avatar
Leechpool
Posts: 30
Joined: Mon Nov 20, 2017 5:12 pm

Re: DM42

Post by Leechpool »

jfb9301 wrote:
Wed Dec 13, 2017 11:01 am
Did you look through these? http://thomasokken.com/free42/42progs/
Yes thanks jfb9301, that was one of the first places I looked, and I did take the convert programme and try it in a Free42 emulator; it does the trick in terms of common unit conversions.
jfb9301 wrote:
Wed Dec 13, 2017 11:01 am
Or are you looking more for constants like speed of light, gravitational constant, and Avogadro's number?
Walter is right, now that I've found a unit convert programme, physical constants like those listed above and things like permittivity and permeability of free space etc, plank's constant etc. etc. would be really useful.

I've looked in the 42S programming help manual and there is a good example of how to use in-programme menus, so I could adapt that to be able to select and load different physical constants in the X register, but if someone has something already written that would be even better....

:D
rprosperi
Posts: 1703
Joined: Mon Apr 24, 2017 7:48 pm
Location: New York

Re: DM42

Post by rprosperi »

Unless you need something elegant, why not just create a dead simple program to put all your favorite constants into the X register when you call by name, something like:

Code: Select all

01 LBL "C"
02 299792458 
03 RTN
04 LBL "AVGDRO"
05 6022140857E14 
05 RTN
07 ...
NN END
Then the calling program simply recalls the constants by name (and of course be aware of the units you use):

Code: Select all

01 LBL "TEST"
02 XEQ "C"
03 2
04 *
05 "Real fast = "
06 ARCL ST X
07 AVIEW
08 END
--bob p

DM42: β00071 & 00282, DM41X: β00071 & 00656, DM10L: 071/100
grsbanks
Posts: 1122
Joined: Tue Apr 25, 2017 11:23 am
Location: Preston, Lancs, UK
Contact:

Re: DM42

Post by grsbanks »

Leechpool wrote:
Thu Dec 14, 2017 6:39 pm
Walter is right, now that I've found a unit convert programme, physical constants like those listed above and things like permittivity and permeability of free space etc, plank's constant etc. etc. would be really useful.
Try this: http://howto-pages.org/SwissMicros/const.raw

It's based on the constants embedded in the HP-35S.

Connect your DM42 to your computer with a standard microUSB cable then SETUP > File > Activate USB Disk

This connects the DM42 as if it were a small, 6MB memory stick. You will see a directory called "PROGRAMS" in there. Copy the const.raw file downloaded earlier into this PROGRAMS directory.

Now "eject" the DM42 as you would a memory stick. Depending on your computer and how you eject the DM42, you might have to press [EXIT] a couple of times to get back to the SETUP > File menu.

Now go into "Load program". Scroll down until const.raw is selected and press ENTER.

Exit the SETUP. From now on, all you have to do is XEQ "CONST" and you have a library of constants at your disposal.
There are only 10 kinds of people in the world: those who understand binary and those who do not.
tgray
Posts: 27
Joined: Fri Jul 28, 2017 3:36 am

Re: DM42

Post by tgray »

This is not perfect but might get you started. I wrote a short constants program the other week for Free42, in preparation for receiving my DM42. I removed many of the constants I don't need access to, but the general idea of how to build a multi screen menu that returns constants is demonstrated. My program has 18 constants split across three menus. I pulled value from NIST.

If anyone has a better way of doing this, I'd love to know. I do think it would be great if the DM42 had a list of constants built in. I suspect you could come up with a more elegant interface if done at a lower level in the firmware than as a program.

Code: Select all

00 { 504-Byte Prgm }
01▸LBL "CNST"
02▸LBL A
03 CLMENU
04 "μ"
05 KEY 1 XEQ 01
06 "eps"
07 KEY 2 XEQ 02
08 "kb"
09 KEY 3 XEQ 03
10 "e/eV"
11 KEY 4 XEQ 04
12 "me"
13 KEY 5 XEQ 05
14 "mp"
15 KEY 6 XEQ 06
16 KEY 7 XEQ C
17 KEY 8 XEQ B
18 MENU
19 STOP
20 GTO A
21▸LBL B
22 CLMENU
23 "c"
24 KEY 1 XEQ 07
25 "h"
26 KEY 2 XEQ 08
27 "hbar"
28 KEY 3 XEQ 09
29 "bigG"
30 KEY 4 XEQ 10
31 "g"
32 KEY 5 XEQ 11
33 "EeV"
34 KEY 6 XEQ 12
35 KEY 7 XEQ A
36 KEY 8 XEQ C
37 MENU
38 STOP
39 GTO B
40▸LBL C
41 CLMENU
42 "1/alp"
43 KEY 1 XEQ 13
44 "mu"
45 KEY 2 XEQ 14
46 "NA"
47 KEY 3 XEQ 15
48 "R"
49 KEY 4 XEQ 16
50 "RT/p"
51 KEY 5 XEQ 17
52 "ATM"
53 KEY 6 XEQ 18
54 KEY 7 XEQ B
55 KEY 8 XEQ A
56 MENU
57 STOP
58 GTO B
59▸LBL 01
60 1.256637061435917295385057353311801ᴇ-6
61 STOP
62▸LBL 02
63 885418781762038985053656303171075ᴇ-44
64 STOP
65▸LBL 03
66 138064852ᴇ-31
67 STOP
68▸LBL 04
69 16021766208ᴇ-29
70 STOP
71▸LBL 05
72 91093856ᴇ-38
73 STOP
74▸LBL 06
75 1672621898ᴇ-36
76 STOP
77▸LBL 07
78 299792458
79 STOP
80▸LBL 08
81 662607004ᴇ-42
82 STOP
83▸LBL 09
84 6022140857ᴇ14
85 STOP
86▸LBL 10
87 667408ᴇ-16
88 STOP
89▸LBL 11
90 9.8067
91 STOP
92▸LBL 12
93 11604
94 STOP
95▸LBL 13
96 137.035999139
97 STOP
98▸LBL 14
99 166053904ᴇ-35
100 STOP
101▸LBL 15
102 6022140857ᴇ14
103 STOP
104▸LBL 16
105 8.3144598
106 STOP
107▸LBL 17
108 22.413962
109 STOP
110▸LBL 18
111 101.325
112 STOP
113 END
c785
Posts: 84
Joined: Mon Apr 24, 2017 11:22 pm

Re: DM42

Post by c785 »

Here's my version of the beginning of a constant library, with the added bonus of showing the unit as well. It's been a while since I coded this, so maybe I've already posted it somewhere. (BTW, unit algebra is something I miss after using it extensively on the HP48).

Code: Select all

00 { 369-Byte Prgm }
01>LBL "COLIB"
02>LBL A
03 CLMENU
04 "c"
05 KEY 1 GTO 11
06 "e0"
07 KEY 2 GTO 12
08 "m0"
09 KEY 3 GTO 13
10 "qE"
11 KEY 4 GTO 14
12 "mE"
13 KEY 5 GTO 15
14 "mP"
15 KEY 6 GTO 16
16 KEY 7 GTO C
17 KEY 8 GTO B
18 MENU
19>LBL 10
20 STOP
21 GTO 10
22>LBL B
23 CLMENU
24 "h"
25 KEY 1 GTO 21
26 "hbar"
27 KEY 2 GTO 22
28 "G"
29 KEY 3 GTO 23
30 KEY 7 GTO A
31 KEY 8 GTO C
32 MENU
33>LBL 20
34 STOP
35 GTO 20
36>LBL C
37 CLMENU
38 "kB"
39 KEY 1 GTO 31
40 KEY 7 GTO B
41 KEY 8 GTO A
42 MENU
43>LBL 30
44 STOP
45 GTO 30
46>LBL 11
47 "c [m/s]"
48 299792458
49 GTO 99
50>LBL 12
51 XEQ 11
52 X^2
53 1/X
54 XEQ 13
55 ÷
56 "eps0 [F/m]"
57 GTO 99
58>LBL 13
59 "µ0 [H/m]"
60 4E-7
61 PI
62 ×
63 GTO 99
64>LBL 14
65 "qE [C]"
66 160217733E-27
67 GTO 99
68>LBL 15
69 "mE [kg]"
70 91093897E-38
71 GTO 99
72>LBL 16
73 "mP [kg]"
74 16726231E-34
75 GTO 99
76>LBL 21
77 "h [Js]"
78 66260755E-41
79 GTO 99
80>LBL 22
81 "hbar [Js]"
82 105457266E-42
83 GTO 99
84>LBL 23
85 "G [m^3/s^2/kg]"
86 667259E-16
87 GTO 99
88>LBL 99
89 EXITALL
90 AVIEW
91 .END.
DM42 #84
User avatar
Leechpool
Posts: 30
Joined: Mon Nov 20, 2017 5:12 pm

Re: DM42

Post by Leechpool »

This clearly is a very supportive community. Thanks for all the replies regarding a physical constants programme. I've been busy for several days and not had chance to check into the forum.....and now when I do, I find a number of people have posted with code examples etc. That people would bother to help in this way really made me smile.

My DM42 arrived today (UK); after a quick check (seems like a great machine), it's been put away for Christmas. If I'm a good boy and I get the DM42 on Christmas day, I will pursue the physical constants programme then. The code that various people have provided will clearly give me a head start, if not a complete solution (I've only skim read the replies before posting this thank you)....

Thanks again,
I really appreciate the help!
:D
pyridine
Posts: 30
Joined: Fri Sep 01, 2017 11:48 pm

Re: DM42

Post by pyridine »

Leechpool wrote:
Tue Dec 19, 2017 5:31 pm
after a quick check (seems like a great machine), it's been put away for Christmas. If I'm a good boy and I get the DM42 on Christmas day,
I am relieved, I am not the only one !! :D
cdmackay
Posts: 281
Joined: Fri Oct 05, 2018 8:33 pm
Location: Cambridge, UK
Contact:

Re: DM42

Post by cdmackay »

grsbanks wrote:
Sat Dec 16, 2017 1:52 am
Leechpool wrote:
Thu Dec 14, 2017 6:39 pm
Walter is right, now that I've found a unit convert programme, physical constants like those listed above and things like permittivity and permeability of free space etc, plank's constant etc. etc. would be really useful.
Try this: http://howto-pages.org/SwissMicros/const.raw

It's based on the constants embedded in the HP-35S.
Thanks for posting this, a while back.

I'm not sure if it's yours, or whether you were passing it on?

I think I found a wee bug:

Code: Select all

46 "me"
47 KEY 2 XEQ 12
…
65▸LBL 12
66 910938188ᴇ23
last line should be, I think:

Code: Select all

66 910938188ᴇ-39
i.e. E23 -> E-39, since the electron mass is ~= 9.1E-31

makes quite a difference :)


thanks again.

[edit: corrected correction]
Last edited by cdmackay on Mon Oct 08, 2018 10:50 pm, edited 1 time in total.
Cambridge, UK
41CL/DM41X 12/15C/16C DM15/16 17B/II/II+ 28S 42S/DM42 32SII 48GX 50g 35s WP34S PrimeG2 WP43S/pilot
Casio, Rockwell 18R
User avatar
Walter
Posts: 3070
Joined: Tue May 02, 2017 11:13 am
Location: On a mission close to DRS, Germany

Re: DM42

Post by Walter »

This was a HUGE error! Must not be, even if you may be a physicist... :shock:
WP43 SN00000, 34S, and 31S for obvious reasons; HP-35, 45, ..., 35S, 15CE, DM16L S/N# 00093, DM42β SN:00041
grsbanks
Posts: 1122
Joined: Tue Apr 25, 2017 11:23 am
Location: Preston, Lancs, UK
Contact:

Re: DM42

Post by grsbanks »

cdmackay wrote:
Mon Oct 08, 2018 4:29 am
I think I found a wee bug:

Code: Select all

46 "me"
47 KEY 2 XEQ 12
…
65▸LBL 12
66 910938188ᴇ23
last line should be, I think:

Code: Select all

66 910938188ᴇ-39
Oops.... Apologies for that, err... slight discrepancy. Should be corrected now.
There are only 10 kinds of people in the world: those who understand binary and those who do not.
Post Reply