Ok, so I "ported" my DM42 program for calculating Relative humidity and dew point to the WP43.
I had to redo a few progam steps, d.t not having the same program features (or I didn't find them).
AlL set up, 63 code lines - aand it didn't work (Dew point at -295°c ).
Went through te program steps line by line, comparing. Couldn't find any errors.
Well, I found the culprit (mostly me) - I have set my calc to 8 level stack, thus having X, Y, Z, T, A, B, C, D. When I stored a variable in "B", which gets instantly repopulated d.t stack lift, the "stored" variable became, well, varable.
So, for programming, when storing named variables, it's beneficial to name stored variables/values with two or more letters (or locally I presume). After redoing "STO 'B'" to "STO 'Ba'", the program run flawlessly.
Now I only wait for the "WriteP" to be coded. So only way to "port" the code here is to write by hand.
Here goes:
Code: Select all
0000: { Prgm #2: 278 bytes / 63 steps }
0001:▸LBL 'RHD'
0002: FIX 02
0003: INPUT 'Tw'
0004: STO 'Tw'
0005: INPUT 'Td'
0006: STO 'Td'
0007: INPUT 'mB'
0008: STO 'mB'
0009: CLSTK
0010: 17.27
0011: RCL× 'Td'
0012: 237.3
0013: RCL+ 'Td'
0014: /
0015: E↑X
0016: 6.108
0017: ×
0018: STO 'Es'
0019: 17.27
0020: RCL× 'Tw'
0021: 237.3
0022: RCL+ 'Tw'
0023: /
0024: E↑X
0025: 6.108
0026: ×
0027: STO 'Ew'
0028: 115E-5
0029: RCL× 'Tw'
0030: 1
0031: +
0032: RCL 'Td'
0033: RCL- 'Tw'
0034: ×
0035: RCL× 'mB'
0036: 66E-5
0037: ×
0038: +/-
0039: RCL+ 'Ew'
0040: STO 'Ea'
0041: RCL 'Ea'
0042: RCL 'Es'
0043: /
0044: 100
0045: ×
0046: STO 'RH'
0047: RCL 'Ea'
0048: 6.108
0049: /
0050: LN
0051: 17.27
0052: /
0053: STO 'Ba'
0054: 237.3
0055: RCL× 'Ba'
0056: 1
0057: RCL- 'Ba'
0058: /
0059: STO 'Dew'
0060: CLSTK
0061: RCL 'RH'
0062: RCL 'Dew'
0063: END
As in:
Stack Y shows "RH = {value}"
Stack X shows "Dew = {value}
(It's probably in the OM, which I've read, all 350 pages, but cant remember whether tis was described)