Jump to content
Sign in to follow this  
N520AT

Looking for some help with Majestic Q400

Recommended Posts

Hi All,

I'm making a home cockpit for the Majestic Q400 and I've just finished my Weather Radar panel. I've downloaded the excellent LINDA files for the Q400 however no controls for the Weather radar are in the file for assignment to my panel.

I've worked out how to do the Weather Mode (OFF, STBY, TEST, ON) as well as the Wx, WxA and GND MAP modes.

I'm stuck on getting the programming right for tilt and gain functions. Additionally, I'd like to make a toggle function for the Stab control.

Here's what Majestic supplies about these functions:

 

Name							Index	Type	Dir	Cockpit	UDP		Description
						
WXR_->controls.stab_off_cntr	F602	BYTE	IN	YES		YES		0 STAB ON, 1 STAB OFF (TILT knob pulled).
WXR_->controls.tilt_cntrl		F603	WORD	IN	YES		YES		0x0000 to 0xFFFF. Neutral 0x8000
WXR_->controls.gain_cntrl		F604	WORD	IN	YES		YES		0x0000 to 0xFFFF. Neutral 0x8000

Anyone have any insight on the best way to get these functions into my LINDA user file?

Share this post


Link to post
Share on other sites

Got the tilt working with the code below. This was tricky to figure out, but eventually I was able to do it. First, the range of the Tilt Knob is from 0 to 65535. There are 32 different tilt sets for the full range of motion on the radar (-15.9, -15, -14.....+13, +14,+15). 65535 divided by 32 is 2047.968. Essentially you're having LINDA read the position of the radar from MJC as a hex value, and then as long as it's not in the maximum range either way (-15.9 corresponds to 0 and +15 corresponds to 65535), LINDA adds 2047.96857 to the hex value to increase the tilt or subtracts to decrease the tilt. Clear as mud?

Next..the gain.

 

WxTiltDelta = 2047.96875

function WXR_Tilt_Inc ()
    WxTiltVar = MJCD8_Read(33799)

    if WxTiltVar < 63487 then
    WxTiltVar = WxTiltVar + WxTiltDelta
    else
    WxtiltVar = 65535
    end
    MJCD8_Write(WxTiltVar, 33799)

end

function WxTilt_Dec ()
    WxTiltVar = MJCD8_Read(33799)

    if WxTiltVar > 2000 then
    WxTiltVar = WxTiltVar - WxTiltDelta
    else
    WxTiltVar = 0
    end
    MJCD8_Write(WxTiltVar, 33799)

end

Working on the gain next.

Share this post


Link to post
Share on other sites
WxGainDelta = 3120.7142857

function WXR_Gain_Dec ()
    WxGainVar = MJCD8_Read(33287)

    if WxGainVar > 3119 then
    WxGainVar = WxGainVar - WxGainDelta
    else
    WxGainVar = 0
    end
    MJCD8_Write(WxGainVar, 33287)

end

function WXR_Gain_Inc ()
    WxGainVar = MJCD8_Read(33287)

    if WxGainVar < 62413 then
    WxGainVar = WxGainVar + WxGainDelta
    else
    WxtiltVar = 65535
    end
    MJCD8_Write(WxGainVar, 33287)

end

Here is the code for the gain increase/decrease.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...