Welcome to Cockpitbuilders.com. Please login or sign up.

April 18, 2024, 05:58:33 AM

Login with username, password and session length

PROUDLY ENDORSING


Fly Elise-ng
143 Guests, 0 Users
Members
  • Total Members: 4,154
  • Latest: xyligo
Stats
  • Total Posts: 59,640
  • Total Topics: 7,853
  • Online today: 143
  • Online ever: 582
  • (January 22, 2020, 08:44:01 AM)
Users Online
Users: 0
Guests: 143
Total: 143

COUNTDOWN TO WF2022


WORLDFLIGHT TEAM USA

Will Depart in...

Recent

Welcome

X-Plane, Custom Datarefs, Master Warn/Caution, and grey hair...

Started by RayS, May 04, 2016, 10:45:10 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

RayS

Of all things to have trouble with, it's the Master Warn/Caution lights. There's several default datarefs for these 2 lights, and 2 cutoms datarefs. (Carenado Beech 1900)

The custom datarefs:
   thrandra/sound/MasterWarning
   thrandra/sound/MasterCaution
   
Using Dataref Editor, I cannot 'see' these custom datarefs. (There's also 'DatarefTool', but using it involves downloading the sourcecode from GitHub, installing some libraries, compiling it...etc.. so..... no)

Anyway, back to Dataref Editor. I can briefly get the Warn/Caution lights to flash by manipulating some of the native datarefs, but they are instantly overwritten by a custom dataref.

So at this point, I'm stuck.

Without a way to view the custom datarefs to see what is being set/reset, my Master Caution/Warning lights remain cold and dark.

I can probably code my own (Teensy) function and just look for discrete annunciator events myself and build the MasterCaution/Warning logic myself.

I could do that, but I don't want to.

Can anyone offer any advice as to how to tackle this?
Ray Sotkiewicz

KyleH

Kyle

Chief Pilot
Worldflight Team USA
http://www.worldflightusa.com

RayS

...my dad said you can't come over to play anymore! :-)

I could try with FSUIPC, but not sure if

1. The custom dataref will interpret correctly
2. I'd need to migrate to a different hardware interface cuz I'm currently wired in with Teensy.
Ray Sotkiewicz

iwik


RayS


Thanks, Les

I'm already using several functions in those libraries and while they work quite well, they don't address the specific issue I am facing. :-(

I don't think there's any way around it. Carenado has bent over backwards for me, providing documentation well beyond what they consider 'normal support', so I think I'm on my own on this one.

Who knew that something so simple would be one of the most complex undertakings.

Time to dust off my Bitwise Operand textbooks. :-)
Ray Sotkiewicz

727737Nut

Ray,
Strange that datref viewer doesn't show the Carenado specific datarefs, red flag number 1    What version of x-plane?   There is another method which isn't to difficult.  Must go thru the files in the aircraft folder and find the dataref in listed in the object files.  I found mine in cockpit object file.  Once i updated to 10.45 all the datarefs showed up in the viewer so no more scouring the innards of the aircraft file system. 

Also, you never replied back, did that reverse code help you that I sent you??

Rob
737 Junkie

RayS

Thanks, Rob!

Sorry I didn't reply back to you. That code is --> exactly <-- what I was looking for! Right now I am using 2 switches wired in series to engage reverse thrust but I like your idea better. One of the projects I have coming up in the Fall is to rebuild the TQ, so that will be going in with it.

To the Dataref issue:
I'm running 10.45. I'll start looking at the AC files. I'm not sure why the custom datarefs aren't showing up in the Dataref viewer. I *can* view the native datarefs, and all remain "0" when monkeying with the Master Caution/Warn lights, so *something* is triggering it. I just can't find it yet. :-( ??? :( >:( :huh:   
Ray Sotkiewicz

mikeybear

Ray,

I think the data ref editor is only displaying refs that are in the dataref.txt file , or those that have been registered using a call in a plugin.

I can see a couple of thandra datarefs , though I'm not sure how they got there, I've done a lot a over the last year :)

I've  picked up quite a few custom datarefs from the Carenado c208b, so I may be able to help you.

What system are you running on ?

Regards

Dave

Edit:  Snippet of  Code I've used in a plugin to expose my custom datarefs , some of the Carenado C208 ones , and tried adding yours
If they don't exist they don't appear

XPLMRegisterFlightLoopCallback(RegAnnunciatorDataRefInDRE, 1, NULL);   // This FLCB will register our custom dataref in DRE

float RegAnnunciatorDataRefInDRE(float elapsedMe, float elapsedSim, int counter, void * refcon)
{
     XPLMPluginID PluginID = XPLMFindPluginBySignature("xplanesdk.examples.DataRefEditor");
     if (PluginID != XPLM_NO_PLUGIN_ID)
     {
          XPLMSendMessageToPlugin(PluginID, MSG_ADD_DATAREF, (void*)"DaveH/C208/annunciator");
        XPLMSendMessageToPlugin(PluginID, MSG_ADD_DATAREF, (void*)"DaveH/C208/annunciator2");
        XPLMSendMessageToPlugin(PluginID, MSG_ADD_DATAREF, (void*)"DaveH/C208/ardsimtest");
        XPLMSendMessageToPlugin(PluginID, MSG_ADD_DATAREF, (void*)"com/dkmp/FireDetectTest");
        XPLMSendMessageToPlugin(PluginID, MSG_ADD_DATAREF, (void*)"com/dkmp/ThrottleEmer");
        XPLMSendMessageToPlugin(PluginID, MSG_ADD_DATAREF, (void*)"com/dkmp/StbyElecPwrOn");
        XPLMSendMessageToPlugin(PluginID, MSG_ADD_DATAREF, (void*)"com/dkmp/StbyElecPwrInop");
        XPLMSendMessageToPlugin(PluginID, MSG_ADD_DATAREF, (void*)"com/dkmp/doorwarning");
        XPLMSendMessageToPlugin(PluginID, MSG_ADD_DATAREF, (void*)"thrandra/sound/MasterWarning");
   XPLMSendMessageToPlugin(PluginID, MSG_ADD_DATAREF, (void*)"com/dkmp/BeaconReflection");
      
     }

     return 0;  // Flight loop is called only once! 
}



727737Nut

Did you find the datarefs Ray?  You can find them in the Object files in the aircraft folder

Rob
737 Junkie

RayS

After a few more hours of struggling, I decided to back away for a bit and tackle another project for the sim. I'll probably get back to this one after getting the DFC-90 autopilot installed and working.

If I don't have any luck with the datarefs, I am thinking of doing it the hard way... monitoring things that can fail and doing my own WARN/CAUTION logic in the microcontroller.

Ray Sotkiewicz

Like the Website ?
Support Cockpitbuilders.com and Click Below to Donate