Jump to content

JS32 autopilot ON


Recommended Posts

I am right now out of the office.. but if I don't remember bad I made a custom dataref for this one because need some logic to behave like the real one. I think there is a plugin to assign any keyboard or joystick button to any custom dataref... but right now I don't remember which one it is. Maybe others can help you with that.

Link to comment
Share on other sites

Thanks for the reply.

 

Ok, I wait here for other help.

 

 

Edit:

Your location ... Madrid - Spain

Yes, I know from the manual introduction (good reading it)

 

I will file over your house on my first CRJ200 tutor flight ... after I finish  reading data into my head.

But today I finish setting up your JS32 on PC .. all is OK.

Edited by vonmarty
Link to comment
Share on other sites

I need help binding a yoke button to turn ON the autopilot (blue switch/button on the panel).

I tried servos ON and servos Toggle but thse just blinks the Autopilot blue switch/button ....  autopilot will not stay ON.

Try this one: (Note:1=ON, 0=OFF).

J32/AutopilotServosON

 

Remember it's one of javier's custom datarefs, so you might not see it in DataRefEditor unless you define it in DataRefs.txt like I did on my Windows 7 installation, and remember to backup the original DataRefs.txt file in X-Plane 10\Resources\plugins cos you will crash XP if you get the formatting wrong!.

Javier posted a full list of JS32 datarefs here:

post-7830-0-27041500-1419608443_thumb.jp

cessna729.

Edited by cessna729
Link to comment
Share on other sites

I downloaded the DRE.

I have it in my top XP10 menu.

I can view the contents of the DataRefs.txt

I know now I cannot edit with it!

 

"Remember it's one of javier's custom datarefs, so you might not see it in DataRefEditor unless you define it in DataRefs.txt like I did on my Windows 7 installation,"

I need to know how to do it ( I have win 7 also).

 

So, now I know I have to manually edit the DataRefs.txt file .. correct?

I need to know exactly what DATA I have to put into the the file and does Upper and lower case matter?

And can I put it anywhere in the file?

 

If so, I need to know what this means:

Try this one: (Note:1=ON, 0=OFF).

J32/AutopilotServosON

 

Do I add e.g. :

J32/AutopilotServos1

 

to the top of the DataRefs.txt file?

 

or e.g.:

J32/AutopilotServos=1

 

or :

 

J32/AutopilotServosON

 

After looking around I wonder if it is the Commands file that should get the new data?

 

 

edit:

What I see in Dataref file is very program'ish e.g.:

sim/cockpit/autopilot/autopilot_mode    int    y    enum    The autopilot master mode (off=0, flight director=1, on=2)
sim/cockpit/autopilot/airspeed_mode    int    n    enum    Airspeed mode for the autopilot. DEPRECATED
sim/cockpit/autopilot/heading_mode    int    n    enum    Lateral navigation mode (GPS, heading, L-Nav approach). DEPRECATED
sim/cockpit/autopilot/altitude_mode    int    n    enum    Vertical navigation (alt hold, VVI hold, V-Nav approach). DEPRECATED
sim/cockpit/autopilot/backcourse_on    int    y    boolean    Back course selection
sim/cockpit/autopilot/altitude    float    y    ftmsl    Altitude dialed into the AP

Edited by vonmarty
Link to comment
Share on other sites

No, sorry I'd assumed as you said "I need help binding a yoke button to turn ON the autopilot (blue switch/button on the panel)." that you were building a cockpit & just had trouble figuring out what the dataref was called, I didn't realise you didn't know what DRE was.

You need something like Ben's Gizmo , SASL or FlyWithLua ect. to "be able to do something" with the dataref, DRE will just allow you to view and change a dataref by typing a new value into a list, it just shows you what happens when the value changes.

 

To enable DRE to display the custom dataref  J32/AutopilotServosON
(note: normal XP Joystick & Equipment, Buttons & Keys option won't display undeclared Custom DataRefs)

Just backup the original DataRefs.txt file in X-Plane 10\Resources\plugins and then add this one line at the end of DataRefs.txt.
J32/AutopilotServosON    int    n    ???    ServosOn

Start X-Plane, go to plugins and start DRE, go Show Datarefs get it to display all datarefs starting with "J32" by entering J32 in the window at the bottonleft corner of the list.

post-7830-0-70527000-1419704126_thumb.jp

Then by editing the value, you can show what happens.

post-7830-0-45719700-1419704419_thumb.jp  post-7830-0-83101800-1419704398_thumb.jp

cessna729.

Edited by cessna729
Link to comment
Share on other sites

I copied and pasted ********* using a text editor .... is that OK?? :

J32/AutopilotServosON    int    n    ???    ServosOn

 

It does not show up in the DRE when I search .... I can search for other items ok..

 

Is this line supposed to be formatted in a special way .. number of spaces between columns?

 

Is this ???    ServosOn :

ServosOn a zero 0n     or a letter On

 

I do not know what is wrong.

 

I have my  Yoke button already assigned to the servo ON.

it does not turn ON the autopilot .( blue light) just the servos (two green).

 

Am I supposed to assign to a different one?

 

I also tried servo toggle (that is what I really want) ... it does not turn ON the autopilot .( blue light) just the servos (two green).

 

Does not lite the Autopilot light just the 2 green .

post-21117-0-18734100-1419710982_thumb.j

Edited by vonmarty
Link to comment
Share on other sites

I copied and pasted ********* using a text editor .... is that OK?? :

J32/AutopilotServosON    int    n    ???    ServosOn

Sorry, I was trying to help, but you appear to be getting more confused. :unsure:

 

So, I'll try one last time.

DRE will only allow you to see and edit datarefs, (to enable DRE to display a Custom Dararef you need a good quality text editor, on my Windows 7 machine I use Notepad++ and add that line to dataref.txt file. There is a Tab Character between each of the fields

J32/AutopilotServosON int n ??? ServosOn

The only numerals in that line is the "32", all the rest are letters.

 

It dos'nt allow X-Plane Joystick & Equipment, Buttons & Keys option to suddenly start using Custom DataRefs! (I never said that, but I'm sorry if I gave that impression).

 

J32/AutopilotServosON is a Custom DataRef, and You need something like Ben's Gizmo , SASL or FlyWithLua or some other tool ect. to "be able to do something" with the dataref".

Checkout the links I've included, follow them and they will explain how to bind custom datarefs to your joystick or keyboard.

For example in the FlyWithLua_Manual_en.pdf see section 11, Manage your joysticks.

cessna729.

 

Edited by cessna729
Link to comment
Share on other sites

Well,

 

I took a quick look and discovered I am not a programmer.

 

It takes all this to assign one yoke button to turn on the AutoPilot in JRollon Jetstream32?

 

Question:

 

For a programmer .. who knows the steps ... load this .. do this etc.

 

Are there many steps to accomplish this?

Edited by vonmarty
Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...
  • 1 month later...
I had some small issues to get it working the way I wanted. My solution uses FlyWithLua (see the x-plane forums on how to install this). I added the reference to the J32 autopilot in DataRefs.txt as explained above by cessna729 just as an extra possibility to see if things are working as expected (but the script works without this reference as well). EDIT: the dataref is only visible if you directly load the Jetstream at startup (otherwise the dataref is unknown and ignored -> therefore when it all worked I removed the reference...)

 

Create a lua script (with Notepad or Notepad++) with the following code (EDIT: I edited the script to make it simpler and moved the dataref line!):

 

-----

function toggle_AP()

  if button(484) then

   J32_APengage = 1 - J32_APengage

  end

end

 

if PLANE_ICAO == "JS32" then

    dataref( "J32_APengage" , "J32/AutopilotServosON" , "writable" )

    do_often("toggle_AP()")

end

-----

 

I used button 484, but change that to the button you want. NB: X-plane will report this button with a value of 1 higher. So my 484 button shows in X-plane (Buttons:Adv) as 485...

Be sure that no other command is assigned to this button: the script does not clear any assignments.

 

Give the script a name (for instance APJ32.lua) and put it in the scripts folder (within the FlyWithLua folder). When you load the Jetstream it should work.

You have to hold the button a bit longer -> until the autopilot light goes on or off. Because I used 'do_often' instead of 'do_every_frame', a short 'click' is often not enough.

For me it works fine this way... If I use do_every_frame on my PC it reacts way too nervous and sometimes switches on and off with the same click...but perhaps it works fine on other PC's...  

 

I hope it helps!

Edited by MH1212
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...