Use Nav1 Radio to set NAV1 and Nav2 (Solved)

This is a new forum for the OC4BAv4.
gblair
Posts: 33
Joined: Tue Sep 15, 2015 10:37 pm

Use Nav1 Radio to set NAV1 and Nav2 (Solved)

Post by gblair »

Hi Roar and all,

I am using Opencockpits 1 X NAV, 1 X COM and 1 X XPDR on my pedestal, all working correctly with OC4BA v4.

I am using PMDG 737NGX in my sim. When making ILS approach both NAV radios need to be tuned to the ILS frequency to do a complete coupled approach.

My question is how to modify SIOC script so that when I tune NAV1 it also tunes NAV2 ?

Regards

Gordon
Last edited by gblair on Fri Jun 22, 2018 7:51 pm, edited 1 time in total.
mvr1918
Site Admin
Posts: 1703
Joined: Thu Aug 30, 2012 3:35 pm

Re: Use Nav1 Radio to set NAV1 and Nav2

Post by mvr1918 »

I have no time to look into this issue myself.

I believe it can be done quite easily by using the NAV1's TEST button as a latch for selecting either NAV 1 or NAV2. All code for both NAV1 and NAV2 is in the script already, but needs to be modified so that
it uses the NAV2 script codes when TEST is ON and NAV1 when TEST is OFF.

At least this is the way I would have tried to do it.
gblair
Posts: 33
Joined: Tue Sep 15, 2015 10:37 pm

Re: Use Nav1 Radio to set NAV1 and Nav2

Post by gblair »

Hi Roar, appreciate that your busy.

I'm still a newbie with SIOC and don't really follow the section on NAv1 and Nav2 in the script

I just need the Nav2 radio to follow the settings from NAV1. Isn't there a simple way to make the appropriate Nav2 variable/offset = the Nav1 variable/offset ?

Regards

Gordon
Alpin-Flier
Posts: 46
Joined: Sun May 24, 2015 2:59 pm

Re: Use Nav1 Radio to set NAV1 and Nav2

Post by Alpin-Flier »

Hi Gordon

I'm not an expert but I have done some successful script writing for my home cockpit. Let me try to help you.
If you use OCP4NGX_v4.0.txt or similar, you should make the following changes. Look for the two coincidences

&N1STtoNGX = TOBCD &ST_NAV1

and add for both immediately below

&N2STtoNGX = TOBCD &ST_NAV1

So the standby frequency is changed in the PMDG on both NAV units, when external NAV1 is changed.

Now you have to copy the transfer button of NAV1 to TFR NAV2. Look for

Var 6448, name NAV1_TFR, static, Link IOCARD_SW, Device 9, Input 6, Type P // Active/Standby swap button
{
L0 = &AC_NAV1
L1 = &ST_NAV1
&ST_NAV1 = L0
&AC_NAV1 = L1
CALL &OutAC_NAV1
CALL &OutST_NAV1
}

Insert a line at the end like follows

Var 6448, name NAV1_TFR, static, Link IOCARD_SW, Device 9, Input 6, Type P // Active/Standby swap button
{
L0 = &AC_NAV1
L1 = &ST_NAV1
&ST_NAV1 = L0
&AC_NAV1 = L1
CALL &OutAC_NAV1
CALL &OutST_NAV1
&NAV2_TFR = NAV1_TFR
}

I could not try it, but it should work. Please let us know the result.

Regards
Urs
gblair
Posts: 33
Joined: Tue Sep 15, 2015 10:37 pm

Re: Use Nav1 Radio to set NAV1 and Nav2

Post by gblair »

Hi Urs,

Thanks for helping me, I was looking in the right place but not sue what changes to make.

After making your suggested changes and compiling, I get the following error:

Open file "F:\Lockheed Martin\SIOC\OCP4NGX_v4.4_NAV12.txt"
10:40:17 PM
Phase 1
.OK.

Phase 2
ERROR! - Unknow operator
Line: 2985 &NAV2_TFR = NAV1_TFR
==> NAV1_TFR
Alpin-Flier
Posts: 46
Joined: Sun May 24, 2015 2:59 pm

Re: Use Nav1 Radio to set NAV1 and Nav2

Post by Alpin-Flier »

Hi Gordon

Ups, sorry, my fault. The last line must be

&NAV2_TFR = &NAV1_TFR

Try with this. Good luck.

Urs
gblair
Posts: 33
Joined: Tue Sep 15, 2015 10:37 pm

Re: Use Nav1 Radio to set NAV1 and Nav2

Post by gblair »

Hi Urs,

Thanks very much, works perfect and I'm beginning to understand more of SIOC.

If you don't mind me asking, where did you learn SIOC ?

I have been looking at Niko Kaan's site http://www.lekseecon.nl/howto.html anything else you can recommend?

Regards,

Gordon
Alpin-Flier
Posts: 46
Joined: Sun May 24, 2015 2:59 pm

Re: Use Nav1 Radio to set NAV1 and Nav2

Post by Alpin-Flier »

Hi Gordon

Thank you very much for the positive feedback. I started with the same informations you have. The rest is learning by doing, from short test scripts to quite large programs, e.g. for the chronometers, that did not work the same way as in the PMDG. Now they do :)

All the best
Urs
gblair
Posts: 33
Joined: Tue Sep 15, 2015 10:37 pm

Re: Use Nav1 Radio to set NAV1 and Nav2

Post by gblair »

Hi all,

I have updated to the latest script v4.6 which seems quite different to the older version that I was using when Alpin-Flier helped me to modify the script.

Now I cant find the section where I need to make the modifications again.

Can someone please help me to do this in the v4.6 script

Thanks
Gordon
gblair
Posts: 33
Joined: Tue Sep 15, 2015 10:37 pm

Re: Use Nav1 Radio to set NAV1 and Nav2

Post by gblair »

Anyone able to offer some help ?
Post Reply