DME generic selector knob control

Peer support for Air Manager desktop users

Moderators: russ, Ralph

Message
Author
ramberga
Posts: 25
Joined: Sat Dec 19, 2020 10:47 pm

Re: DME generic selector knob control

#21 Post by ramberga »

Tony, Ralph, Keith, others -

I had a "Eureka' moment about editing an online instrument. If AM is being used to edit an existing instrument - and that instrument was from an online source - then the edits are local to AM. So, if a panel is using an online instrument - and that instrument is edited within 'create/edit' of AM, the online instrument "seen" by the panel is untouched by any of the edit.

Right?

Pete

User avatar
Ralph
Posts: 7876
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: DME generic selector knob control

#22 Post by Ralph »

No, the sources used in the Home tab are the same as in the Create/Edit.

User avatar
Ralph
Posts: 7876
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: DME generic selector knob control

#23 Post by Ralph »

I've added the hardware code to the instrument to make it easier. You only have to select the pins.

ramberga
Posts: 25
Joined: Sat Dec 19, 2020 10:47 pm

Re: DME generic selector knob control

#24 Post by ramberga »

Ralph - I see your code. It makes sense. I was thinking that changes made to an online instrument within AM would not affect the instrument in 'home', but I was mistaken. It made sense to me as soon as I saw your edited code in an online instrument!! :)

I am using the generic DME display instrument, rather than the receiver (which you edited). I have the 'display' unit working now, with a 3 way rotary switch.

Thanks for the help.

Pete

P.S. AM is a terrific piece of software. Great work, you guys...

ramberga
Posts: 25
Joined: Sat Dec 19, 2020 10:47 pm

Re: DME generic selector knob control

#25 Post by ramberga »

Ralph, Tony, Keith, others -

Update: each time I either put my computer to sleep, or stop AM and restart it, none of the external hardware devices work. I have to re-add the instruments back into the panel I am using. After I re-add the instruments to the panel, the hardware work again.

Understand that the instruments from before are still there - they simply do not allow the hardware devices to operate them.

I have a rotary switch with the generic DME display and two encoders with the VOR NAV1/ILS and VOR NAV2 online instruments.

All hardware works fine, until I either stop and restart AM or I put my computer to sleep and restart it. At that point, I have to re-add the 3 instruments back into the panel for the hardware to work.

BTW, the instruments show up in the panel list in 'home' regardless. I end up re-adding the same 'cloned' instrument to the panel and move it over the top of the existing one.

Also, Arduino shows as being connected regardless.

Any ideas?

Pete

User avatar
Ralph
Posts: 7876
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: DME generic selector knob control

#26 Post by Ralph »

How about the pin configuration? Is that still present?

ramberga
Posts: 25
Joined: Sat Dec 19, 2020 10:47 pm

Re: DME generic selector knob control

#27 Post by ramberga »

Ralph - I hard-coded the pin numbers into the LUA code, using hardware_id. So, the pins haven't changed positions. I haven't altered the Arduino board or the USB connection. AM shows that the Arduino board is connected on COM 9, as always.

Do you remember the issue I had last year concerning my computer having the issue with AM using all of the CPU time? You suggested I try to updated BETA version and the CPU issue never came back.

Is this another computer issue on my end?

It just seems so odd. I just tried it again to make sure - every time I stop and restart AM, the instruments show up in the panel and Arduino board shows up as connected. But, the hardware devices don't work. As soon as I re-add the same cloned instruments back into the panel (they are now duplicates of the others), the hardware devices work.

???

ramberga
Posts: 25
Joined: Sat Dec 19, 2020 10:47 pm

Re: DME generic selector knob control

#28 Post by ramberga »

P.S. code I added for the generic DME display:

dme_switch = hw_switch_add("ARDUINO_LEONARDO_A_D2", "ARDUINO_LEONARDO_A_D3", "ARDUINO_LEONARDO_A_D4", new_state)


It works great and the 3 way switch operates correctly - until I stop and restart AM (or put the computer to sleep and wake it).


VOR NAV2 instrument code:

dial_obs = hw_dial_add ("ARDUINO_LEONARDO_A_D10","ARDUINO_LEONARDO_A_D11", "TYPE_1_DETENT_PER_PULSE", 1, new_obs)


Again, the encoder works great, until I stop and restart AM.

?????

User avatar
Ralph
Posts: 7876
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: DME generic selector knob control

#29 Post by Ralph »

Can you tell me which instrument you're using exactly, then I'll add the script, because it's all very vague on what you did exactly.

I'm also a bit confused about the hardware you're using, I thought you were using a 3 way switch.

ramberga
Posts: 25
Joined: Sat Dec 19, 2020 10:47 pm

Re: DME generic selector knob control

#30 Post by ramberga »

Ralph - let me try to simplify things.

1. initial problem was that I could get the external hardware device (3 way rotary switch) to operate the 'generic DME display' instrument in the 'create/edit' tab when doing a 'run', but not the 'home' tab..
2. when I 'stopped' the run and went to 'home' tab, the same generic DME display instrument would not operate with the rotary switch.
3. I asked the forum about anything that might be wrong, and Tony got me to understand that 'cloning' any online instrument should be done (for reasons I now understand).
4. I re-did everything, but used the cloned version of the generic DME display instrument. Same problem.
5. I went ahead and made 2 other rotary encoders work with the VOR NAV1/ILS and the VOR NAV2 instruments, but only in the 'create/edit' tab when 'running' them. Again, same problem.

6. So, now I erased all of those instruments from my panel, started over and just used your online generic DME receiver in which you added a 3 way rotary switch option. You will see 2 screenshots attached that show the pin configurations in the 'create/edit' tab, as well as the 'home' tab.
7. the same problem occurs with your instrument. I can 'run/stop' in the 'create/edit' tab and the instrument works perfectly with the 3 way rotary switch (using Arduino pins D2, D3 and D4). But, if I 'stop' the instrument in 'create/edit' and go to the 'home' tab to run AM with X-Plane, the instrument (cloned version that I added to the panel) will not operate with the 3 way rotary switch.

It's as if the 'home' instrument does not recognize the pin assignment - like there is no connection whatsoever to the 3 way switch via the Arduino board.

Hope this makes more sense.

Pete
DME receiver in create edit tab.jpg
DME receiver in home tab.jpg

Post Reply