Access to the DM42 virtual variables

Contributions to this software library are always welcome. Please ensure that you post program listings rather than .raw files. They give a reasonable idea of what your program does without having to load them into a DM42 and you can also include comments in your code. Check out the following link for a decoder/encoder: http://www.swissmicros.com/dm42/decoder/

You can then copy/paste the listing and post it in "code" tags.
Post Reply
dlachieze
Posts: 116
Joined: Thu May 04, 2017 10:20 am
Location: France

Access to the DM42 virtual variables

Post by dlachieze » Tue Dec 26, 2017 4:11 pm

Here is a program to retrieve and update the value of the 6 different virtual variables of the DM42.

With XEQ "VirtV" you get a menu to access each virtual variable. Press the corresponding F-key to recall the variable value or enter a value and press the corresponding F-key to update the value of the virtual variable.

Image

Note: storing a value to a read-only virtual variable (DevID, ResX, ResY, Vbat) has no effect.

EDIT: see the latest version below.

Code: Select all

00 { 151-Byte Prgm }
01▸LBL "VirtV"
02 "DevID"
03 KEY 1 GTO 01
04 "GrMod"
05 KEY 2 GTO 02
06 "ResX"
07 KEY 3 GTO 03
08 "ResY"
09 KEY 4 GTO 04
10 "Vbat"
11 KEY 5 GTO 05
12 "RefLCD"
13 KEY 6 GTO 06
14 KEY 7 GTO 07
15 KEY 8 GTO 07
16 KEY 9 GTO 09
17 MENU
18▸LBL 07
19 STOP
20▸LBL 09
21 RTN
22▸LBL 01
23 "DevID"
24 GTO 00
25▸LBL 02
26 "GrMod"
27 GTO 00
28▸LBL 03
29 "ResX"
30 GTO 00
31▸LBL 04
32 "ResY"
33 GTO 00
34▸LBL 05
35 "Vbat"
36 GTO 00
37▸LBL 06
38 "RefLCD"
39▸LBL 00
40 ASTO ST L
41 FS?C 22
42 STO IND ST L
43 CLX
44 RCL IND ST L
45 ├"="
46 ARCL ST X
47 AVIEW
48 END
virtvar.zip
(300 Bytes) Downloaded 31 times
Last edited by dlachieze on Mon Feb 26, 2018 5:59 am, edited 2 times in total.
DM42 SN: 00425

whuyse
Posts: 19
Joined: Thu Dec 21, 2017 12:23 pm

Re: Access to the DM42 virtual variables

Post by whuyse » Tue Dec 26, 2017 7:56 pm

I just use a program with MVAR instructions for the 6 virtual variables, then SOLVE it. Same effect.

Cheers, Werner
42S #3249S01123
DM42 #00345

dlachieze
Posts: 116
Joined: Thu May 04, 2017 10:20 am
Location: France

Re: Access to the DM42 virtual variables

Post by dlachieze » Wed Dec 27, 2017 12:02 am

whuyse wrote:
Tue Dec 26, 2017 7:56 pm
I just use a program with MVAR instructions for the 6 virtual variables, then SOLVE it. Same effect.
Good idea!

I have updated my virtvar program to add a second menu line allowing to directly select the graphic mode and/or which LCD item is refreshed without the need to know the virtual variable corresponding value.

Image

Graphic mode:
  • hp = 131x16 legacy HP 42S graphic mode
  • 200 = 200x120 full screen
  • 400 = 400x240 full screen
LCD refreshing (any combination of the three items is allowed to cover the 8 values of the RefLCD variable):
  • Main: Main area
  • Goos: Goose
  • Ann: Annunciators

Code: Select all

00 { 356-Byte Prgm }
01▸LBL "VirtV"
02▸LBL A
03 "DevID"
04 KEY 1 XEQ 01
05 "GrMod"
06 KEY 2 XEQ 02
07 "ResX"
08 KEY 3 XEQ 03
09 "ResY"
10 KEY 4 XEQ 04
11 "Vbat"
12 KEY 5 XEQ 05
13 "RefLCD"
14 KEY 6 XEQ 06
15 KEY 7 GTO B
16 KEY 8 GTO B
17 KEY 9 GTO 09
18 MENU
19 STOP
20▸LBL 09
21 RTN
22▸LBL B
23 RCL "GrMod"
24 "HP"
25 X=0?
26 ├"•"
27 KEY 1 GTO 11
28 "200"
29 2
30 -
31 X=0?
32 ├"•"
33 KEY 2 GTO 12
34 1
35 -
36 "400"
37 X=0?
38 ├"•"
39 KEY 3 GTO 13
40 1
41 RCL "RefLCD"
42 AND
43 "Main"
44 X≠0?
45 ├"•"
46 KEY 4 GTO 14
47 RCL "RefLCD"
48 2
49 AND
50 "Goos"
51 X≠0?
52 ├"•"
53 KEY 5 GTO 15
54 RCL "RefLCD"
55 4
56 AND
57 "Ann"
58 X≠0?
59 ├"•"
60 KEY 6 GTO 16
61 KEY 7 GTO A
62 KEY 8 GTO A
63 KEY 9 GTO 09
64 MENU
65 STOP
66 RTN
67▸LBL 01
68 "DevID"
69 GTO 00
70▸LBL 02
71 "GrMod"
72 GTO 00
73▸LBL 03
74 "ResX"
75 GTO 00
76▸LBL 04
77 "ResY"
78 GTO 00
79▸LBL 05
80 "Vbat"
81 GTO 00
82▸LBL 06
83 "RefLCD"
84▸LBL 00
85 ASTO ST L
86 FS?C 22
87 STO IND ST L
88 CLX
89 RCL IND ST L
90 ├"="
91 ARCL ST X
92 AVIEW
93 RTN
94▸LBL 11
95 CLX
96▸LBL 10
97 STO "GrMod"
98 GTO B
99▸LBL 12
100 2
101 GTO 10
102▸LBL 13
103 3
104 GTO 10
105▸LBL 14
106 1
107▸LBL 17
108 RCL "RefLCD"
109 XOR
110 STO "RefLCD"
111 GTO B
112▸LBL 15
113 2
114 GTO 17
115▸LBL 16
116 4
117 GTO 17
118 END
virtvar.zip
(437 Bytes) Downloaded 39 times
DM42 SN: 00425

wawachief
Posts: 21
Joined: Tue Dec 12, 2017 6:39 pm
Location: France, Normandie

Re: Access to the DM42 virtual variables

Post by wawachief » Wed Dec 27, 2017 8:20 am

I was just about to do the same thing ! thank you for saving me the time :)
If I may, I think there is a "GTO A" missing between lines 19 and 20 because there is a strange page change when you read twice the value of a virtual variable.
DM42 SN:00218
HP-11c - HP-19b - HP25 - HP 45 - HP42s - HP48gx

User avatar
Vitasam
Posts: 170
Joined: Thu Jun 01, 2017 9:51 am
Location: Finland
Contact:

Re: Access to the DM42 virtual variables

Post by Vitasam » Tue Feb 13, 2018 9:13 am

dlachieze wrote:
Wed Dec 27, 2017 12:02 am
I have updated my virtvar program to add a second menu line allowing to directly select the graphic mode and/or which LCD item is refreshed without the need to know the virtual variable corresponding value.
For some reason I cannot see 'HP', '200' etc. labels (see attached screenshot) - is there some bug? I'm using FW v.3.2
Attachments
20180213-11091157.png
20180213-11091157.png (1.98 KiB) Viewed 637 times
Elektronika MK-61, Elektronika MK-52, HP15c LE, DM42 SN: 00016

dlachieze
Posts: 116
Joined: Thu May 04, 2017 10:20 am
Location: France

Re: Access to the DM42 virtual variables

Post by dlachieze » Tue Feb 13, 2018 9:39 am

Vitasam wrote:
Tue Feb 13, 2018 9:13 am
dlachieze wrote:
Wed Dec 27, 2017 12:02 am
I have updated my virtvar program to add a second menu line allowing to directly select the graphic mode and/or which LCD item is refreshed without the need to know the virtual variable corresponding value.
For some reason I cannot see 'HP', '200' etc. labels (see attached screenshot) - is there some bug? I'm using FW v.3.2
Well normally these labels are visible if you press the up or down arrow keys.

Here is the updated version including the feedback from wawachief. I just tested it with v3.3 and it works as expected.
Note: if you prefer to start with the second line on the display by default ( 'HP', '200' etc.) just add a "GTO B" just after the LBL "VirtV"

Code: Select all

00 { 359-Byte Prgm }
01▸LBL "VirtV"
02▸LBL A
03 "DevID"
04 KEY 1 XEQ 01
05 "GrMod"
06 KEY 2 XEQ 02
07 "ResX"
08 KEY 3 XEQ 03
09 "ResY"
10 KEY 4 XEQ 04
11 "Vbat"
12 KEY 5 XEQ 05
13 "RefLCD"
14 KEY 6 XEQ 06
15 KEY 7 GTO B
16 KEY 8 GTO B
17 KEY 9 GTO 09
18 MENU
19 STOP
20 GTO A
21▸LBL 09
22 RTN
23▸LBL B
24 RCL "GrMod"
25 "HP"
26 X=0?
27 ├"•"
28 KEY 1 GTO 11
29 "200"
30 2
31 -
32 X=0?
33 ├"•"
34 KEY 2 GTO 12
35 1
36 -
37 "400"
38 X=0?
39 ├"•"
40 KEY 3 GTO 13
41 1
42 RCL "RefLCD"
43 AND
44 "Main"
45 X≠0?
46 ├"•"
47 KEY 4 GTO 14
48 RCL "RefLCD"
49 2
50 AND
51 "Goos"
52 X≠0?
53 ├"•"
54 KEY 5 GTO 15
55 RCL "RefLCD"
56 4
57 AND
58 "Ann"
59 X≠0?
60 ├"•"
61 KEY 6 GTO 16
62 KEY 7 GTO A
63 KEY 8 GTO A
64 KEY 9 GTO 09
65 MENU
66 STOP
67 RTN
68▸LBL 01
69 "DevID"
70 GTO 00
71▸LBL 02
72 "GrMod"
73 GTO 00
74▸LBL 03
75 "ResX"
76 GTO 00
77▸LBL 04
78 "ResY"
79 GTO 00
80▸LBL 05
81 "Vbat"
82 GTO 00
83▸LBL 06
84 "RefLCD"
85▸LBL 00
86 ASTO ST L
87 FS?C 22
88 STO IND ST L
89 CLX
90 RCL IND ST L
91 ├"="
92 ARCL ST X
93 AVIEW
94 RTN
95▸LBL 11
96 CLX
97▸LBL 10
98 STO "GrMod"
99 GTO B
100▸LBL 12
101 2
102 GTO 10
103▸LBL 13
104 3
105 GTO 10
106▸LBL 14
107 1
108▸LBL 17
109 RCL "RefLCD"
110 XOR
111 STO "RefLCD"
112 GTO B
113▸LBL 15
114 2
115 GTO 17
116▸LBL 16
117 4
118 GTO 17
119 END
virtvar.zip
(439 Bytes) Downloaded 36 times
DM42 SN: 00425

User avatar
Vitasam
Posts: 170
Joined: Thu Jun 01, 2017 9:51 am
Location: Finland
Contact:

Re: Access to the DM42 virtual variables

Post by Vitasam » Tue Feb 13, 2018 10:42 am

Thanks!
Elektronika MK-61, Elektronika MK-52, HP15c LE, DM42 SN: 00016

Post Reply