Visit Captain Sim web site  
  Welcome, Guest. Please Login or Register

 

Page Index Toggle Pages: [1]  Send TopicPrint
 25 SDK (Read 8831 times)
Skipy
Full Member
*
Offline



Posts: 25
Joined: May 28th, 2018
SDK
Apr 21st, 2020 at 9:11pm
Print Post  
Hi,

I was waiting for a long time the 767 Smiley. Will we have a SDK at release time? The 757 III one was very useful for lua script programming.

Skip.
  
Back to top
 
IP Logged
 
Captain Sim
CS Team
*
Offline



Posts: 4235
Joined: Nov 7th, 2005
Re: SDK
Reply #1 - Apr 21st, 2020 at 9:59pm
Print Post  
Thanks!

Skipy wrote on Apr 21st, 2020 at 9:11pm:
Will we have a SDK at release time?

Not at release time, but it's on the list.
  
Back to top
IP Logged
 
Edo
Full Member
*
Offline



Posts: 7
Location: Milano, Italy
Joined: Apr 21st, 2020
Gender: Male
Re: SDK
Reply #2 - Apr 21st, 2020 at 11:36pm
Print Post  
Hello, I would be veeeeery much interested in this particular aspect as well. I would like to discuss with you integration possibilities owning a real 767 cockpit. I also can give you feedbacks on your logic, using part of real computers as well, let me know if interested.

THanks and regards

  

IMG_5248.jpg ( 109 KB | 231 Downloads )
IMG_5248.jpg
Back to top
IP Logged
 
Captain Sim
CS Team
*
Offline



Posts: 4235
Joined: Nov 7th, 2005
Re: SDK
Reply #3 - Apr 22nd, 2020 at 12:56am
Print Post  
Edo wrote on Apr 21st, 2020 at 11:36pm:
let me know if interested

Many people would be interested to watch such a great piece of hardware integration. Pls keep us posted. I'd even open a dedicated thread for your project.
  
Back to top
IP Logged
 
Edo
Full Member
*
Offline



Posts: 7
Location: Milano, Italy
Joined: Apr 21st, 2020
Gender: Male
Re: SDK
Reply #4 - Apr 22nd, 2020 at 12:15pm
Print Post  
Captain Sim wrote on Apr 22nd, 2020 at 12:56am:
Pls keep us posted. I'd even open a dedicated thread for your project.


Sure if you feel like no prob.

I would like to give you my contribute in system logic, being quite well into these specific things in order to have your product to reflect real thing as much as possible.
On the other hand integrating it in a complex environment would require some particular data exchange to be avail thru sdk, so if you feel like to have a talk about this also with the team, I'd me more then happy to do it thru email/whatsapp/skype.

Regards
  
Back to top
IP Logged
 
cptjaco
Full Member
*
Offline



Posts: 9
Location: mxp
Joined: Apr 4th, 2019
Gender: Male
Re: SDK
Reply #5 - Apr 22nd, 2020 at 3:25pm
Print Post  
Ti verrei a trovare per provarlo visto che stiamo a milano....
He registrazione aveva?
  
Back to top
 
IP Logged
 
Edo
Full Member
*
Offline



Posts: 7
Location: Milano, Italy
Joined: Apr 21st, 2020
Gender: Male
Re: SDK
Reply #6 - Apr 22nd, 2020 at 6:37pm
Print Post  
GBZHC. Non si puó provare, c’è ancora molto lavoro da fare.
  
Back to top
IP Logged
 
Angel of Attack
Full Member
*
Offline



Posts: 249
Joined: Dec 15th, 2019
Re: SDK
Reply #7 - Apr 23rd, 2020 at 12:23am
Print Post  
I think I'll wait for that, I can't fly without my MCP Huh
  
Back to top
 
IP Logged
 
Skipy
Full Member
*
Offline



Posts: 25
Joined: May 28th, 2018
Re: SDK
Reply #8 - Apr 28th, 2020 at 9:38pm
Print Post  
Angel of Attack wrote on Apr 23rd, 2020 at 12:23am:
I think I'll wait for that, I can't fly without my MCP Huh


Is there any chance that the 767 and 767 SDK are similar (button names)?
  
Back to top
 
IP Logged
 
Captain Sim
CS Team
*
Offline



Posts: 4235
Joined: Nov 7th, 2005
Re: SDK
Reply #9 - Apr 28th, 2020 at 10:32pm
Print Post  
Skipy wrote on Apr 28th, 2020 at 9:38pm:
Is there any chance that the 767 and 767 SDK are similar (button names)?

Some systems are identical, for the rest you'd try the Manual part 2.
All 757-767 differences are highlighted there.
  
Back to top
IP Logged
 
Dave763
New Member
Offline



Posts: 2
Joined: Apr 6th, 2020
Gear Lever Off assignment possible?
Reply #10 - May 4th, 2020 at 11:41am
Print Post  
Hi everyone,

Does anyone know how to set an assignment (either for a lever or button) for the gear lever off position so that you do not need to use the mouse to drag it to that position?

I have set a throttle quadrant lever as an axis for the gear in FSUIPC but I cannot get it to stop at the 'off' position.

Cheers
  
Back to top
 
IP Logged
 
Edo
Full Member
*
Offline



Posts: 7
Location: Milano, Italy
Joined: Apr 21st, 2020
Gender: Male
Re: SDK
Reply #11 - May 7th, 2020 at 1:45pm
Print Post  
Captain Sim wrote on Apr 22nd, 2020 at 12:56am:
Edo wrote on Apr 21st, 2020 at 11:36pm:
let me know if interested

Many people would be interested to watch such a great piece of hardware integration. Pls keep us posted. I'd even open a dedicated thread for your project.


Sent you a PM. Plz can you check and get back to me?  Thx
  
Back to top
IP Logged
 
Captain Sim
CS Team
*
Offline



Posts: 4235
Joined: Nov 7th, 2005
Re: SDK
Reply #12 - May 7th, 2020 at 2:35pm
Print Post  
Edo wrote on May 7th, 2020 at 1:45pm:
Sent you a PM. Plz can you check and get back to me?

SDK will be available after the 1.0 release.
If there's not enough information in the SDK, we'd add some more upon request.

  
Back to top
IP Logged
 
Captain Sim
CS Team
*
Offline



Posts: 4235
Joined: Nov 7th, 2005
Re: SDK
Reply #13 - May 8th, 2020 at 5:21pm
Print Post  
SDK is available
  
Back to top
IP Logged
 
Kees
Full Member
*
Offline



Posts: 72
Joined: Apr 20th, 2020
Re: SDK
Reply #14 - May 9th, 2020 at 10:04pm
Print Post  
Thanks for the SDK. Finally I can reprogram my home cockpit from the another company to the CS. And can use it with P3D  Smiley

Only one question, is there a picture with the MCP's buttons and switches available? It is not currently in the SDK.

Regards,
Kees
  
Back to top
 
IP Logged
 
Captain Sim
CS Team
*
Offline



Posts: 4235
Joined: Nov 7th, 2005
Re: SDK
Reply #15 - May 11th, 2020 at 3:40pm
Print Post  
Kees wrote on May 9th, 2020 at 10:04pm:
is there a picture with the MCP's buttons and switches available?

Thanks, updated https://drive.google.com/open?id=1enMcTxYPyCwTxiRmpKTmLZPce7PDShdp
  
Back to top
IP Logged
 
Kees
Full Member
*
Offline



Posts: 72
Joined: Apr 20th, 2020
Re: SDK
Reply #16 - May 11th, 2020 at 10:09pm
Print Post  
Great! Thanks
  
Back to top
 
IP Logged
 
Kees
Full Member
*
Offline



Posts: 72
Joined: Apr 20th, 2020
write to LVar of an IND
Reply #17 - May 16th, 2020 at 3:57pm
Print Post  
Why is it not possible to write to the LVAR L:G03_001_IND? The reason I would like this to do is, that I have an own MCP. This is programmed with SIOC from Open Cockpits. When I turn the knob of my speed on my MCP, open cockpits reads (via a LUA script) the value of G03_001_IND, changes it and writes is to a free offset in FSUIPC.
Now I would like to write the value of that offset to G03_001_IND in a LUA script with:
ipc.writeLvar("L:G03_001_IND", value)

But that doesn't anything.

Kind regards,
Kees
  
Back to top
 
IP Logged
 
EY
CS Team
*
Offline



Posts: 352
Location: Canada
Joined: Nov 9th, 2005
Gender: Male
Re: write to LVar of an IND
Reply #18 - May 16th, 2020 at 9:15pm
Print Post  
Kees wrote on May 16th, 2020 at 3:57pm:
Why is it not possible to write to the LVAR L:G03_001_IND?
Kees


Kees, you can not set G03_001_IND, because the aircraft systems (MCP, electrical) refresh it continuously.
To change the value of this particular indicator of IAS/Mach, you can use the (L:klid) variable with the values:
1703010  //IAS/Mach Knob Increase
-1703010 //IAS/Mach Knob Decrease
1703110  //IAS/Mach Selector Button
  

Back to top
IP Logged
 
Kees
Full Member
*
Offline



Posts: 72
Joined: Apr 20th, 2020
Re: SDK
Reply #19 - May 16th, 2020 at 9:30pm
Print Post  
This is indeed the way I have programmed it now. However, this doesn't work as smoothly as the way I expressed in my question. That is why I would still like it if I could write directly to the IND. I think that with me, many who also used the another company first and now switch to Captain Sim, would certainly appreciate this opportunity.

Kees
  
Back to top
 
IP Logged
 
Kees
Full Member
*
Offline



Posts: 72
Joined: Apr 20th, 2020
Re: SDK
Reply #20 - May 16th, 2020 at 9:37pm
Print Post  
In short, what is the difference between turning the knob to change the IND and writing the Lvar of the IND directly to change it.
  
Back to top
 
IP Logged
 
Kees
Full Member
*
Offline



Posts: 72
Joined: Apr 20th, 2020
Re: SDK
Reply #21 - May 17th, 2020 at 7:44pm
Print Post  
I cannot find the lights (LT1 and LT2) of the airplane lightning panel.

These Lvars don't seem to exist:
O20_001_LT1 (+ LT2)
O20_002_LT1 (+ LT2)
O20_003_LT1 (+ LT2)
O20_004_LT1 (+ LT2)

I want to read them so I can light the corresponding lights in my homepit.
  
Back to top
 
IP Logged
 
EY
CS Team
*
Offline



Posts: 352
Location: Canada
Joined: Nov 9th, 2005
Gender: Male
Re: SDK
Reply #22 - May 18th, 2020 at 2:35pm
Print Post  
Kees wrote on May 17th, 2020 at 7:44pm:
I cannot find the lights (LT1 and LT2) of the airplane lightning panel.

These Lvars don't seem to exist:
O20_001_LT1 (+ LT2)
O20_002_LT1 (+ LT2)
O20_003_LT1 (+ LT2)
O20_004_LT1 (+ LT2)


Use
O20_001_BUT
O20_002_BUT
O20_003_BUT
O20_004_BUT
  

Back to top
IP Logged
 
EY
CS Team
*
Offline



Posts: 352
Location: Canada
Joined: Nov 9th, 2005
Gender: Male
Re: SDK
Reply #23 - May 18th, 2020 at 2:44pm
Print Post  
Kees wrote on May 16th, 2020 at 9:37pm:
In short, what is the difference between turning the knob to change the IND and writing the Lvar of the IND directly to change it.


The status of the indicator depends on several conditions, not only from the knob.
What will happen if the MCP panel loses electrical power? And, after that you will set some value for the indicator.
Right. It will show the value without electricity.

I don't think this is the expected result
  

Back to top
IP Logged
 
Kees
Full Member
*
Offline



Posts: 72
Joined: Apr 20th, 2020
Re: SDK
Reply #24 - May 22nd, 2020 at 9:57am
Print Post  
EY wrote on May 18th, 2020 at 2:35pm:
Use
O20_001_BUT
O20_002_BUT
O20_003_BUT
O20_004_BUT


Thanks, this did the trick
  
Back to top
 
IP Logged
 
Kees
Full Member
*
Offline



Posts: 72
Joined: Apr 20th, 2020
Re: SDK
Reply #25 - May 22nd, 2020 at 10:01am
Print Post  
EY wrote on May 18th, 2020 at 2:44pm:
What will happen if the MCP panel loses electrical power? And, after that you will set some value for the indicator.
Right. It will show the value without electricity.


Well, i can program my hompeit to do blank the displays in case that occurs  Smiley.
So writing to the IND's still stays on my wishlist, because turning the knobs in my own made MCP would give a more realistic feeling then the workaround that I have mad now.  Wink
  
Back to top
 
IP Logged
 
Kees
Full Member
*
Offline



Posts: 72
Joined: Apr 20th, 2020
Re: SDK
Reply #26 - Jun 3rd, 2020 at 8:45pm
Print Post  
Kees wrote on May 22nd, 2020 at 10:01am:
EY wrote on May 18th, 2020 at 2:44pm:
What will happen if the MCP panel loses electrical power? And, after that you will set some value for the indicator.
Right. It will show the value without electricity. 

Well, i can program my hompeit to do blank the displays in case that occurs  Smiley.
So writing to the IND's still stays on my wishlist, because turning the knobs in my own made MCP would give a more realistic feeling then the workaround that I have mad now. 


No reaction? I would like my homepit as realistic as possible. With no possibility, writing to the IND's, the encoders do absolutely not feel as real. There will be not much people who shall write to the IND's, but I am for sure that all former another company pilots who have their own homepit, would greatly appreciate this possibility. This their chance top swicth over to P3d in combination with the CS767 and will not be stuck with the old FSX with the old another company.

I hope you will reconsider this option.
  
Back to top
 
IP Logged
 
Captain Sim
CS Team
*
Offline



Posts: 4235
Joined: Nov 7th, 2005
Re: SDK
Reply #27 - Jun 4th, 2020 at 2:55pm
Print Post  
Kees wrote on Jun 3rd, 2020 at 8:45pm:
I hope you will reconsider this option.

Well, you are asking us to re-build the entire 767 code from scratch (which is years of work) just to make it fit better one particular homepit needs.
The answer is no, sorry.
  
Back to top
IP Logged
 
Kees
Full Member
*
Offline



Posts: 72
Joined: Apr 20th, 2020
Re: SDK
Reply #28 - Jun 4th, 2020 at 3:18pm
Print Post  
Thanks for your reply. Of course I do not know how the code of the 767 is written. But it looks to me (as a amateur programmer) that you don”t have To rewrite the entirely code just to be able to write to a few var”s.
And it is not just one person with a 767 homepit, but some more. As I already mentioned, much another company simmers with a homepit are now stuck to the FSX and see now the chance to jump over to 64 bits p3d. Good chance that that will be the CS767 because all the other functions needed for a homepit are already in your model. This is the only thing that I really mis.

Kind regards,
Kees
  
Back to top
 
IP Logged
 
flyingjayaraj
New Member
Offline



Posts: 3
Joined: Aug 3rd, 2020
767 - SDK - Scripting Issues FSX / Mobiflight
Reply #29 - Aug 17th, 2020 at 7:43pm
Print Post  
Hello everone, i am stuck at a point where i am unable to program my MCP, due to limited knowledge in coding and deciphering the 757/767 SDK.

CS-767 & 757 - FSX - FSUIPC - Mobiflight

At present, i have used the Lvar for the MCP airspeed written it to a free offset and displaying it on the 7-segment successfully, below is the code that i used.

-----------------------------------------------------
while true do
        n=ipc.readLvar("L:MCP_IAS_Disp")
        ipc.writeUD(0x66C8,n)
        ipc.sleep(100)
        end
------------------------------------------------------------

To increase or decrease the airspeed value - i followed the instructions from the SDK

I created a lua file - CS757SPEEDDEC.LUA

ipc.writeLvar(“L:klid",-1703010)

and another - CS757SPEEDINC.LUA

ipc.writeLvar(“L:klid", 1703010)

These lua files now show up in my FSUIPC list.

Now the next step is to add an entry to auto-run the lua, i have made that entry too.

[Auto]
1=Lua CS757SPEEDINC
2=Lua CS757SPEEDDEC

Now in the macro file, what is the entry that i have to have ?
i tried different entry but none seem to work.

Could anyone please share some script that has worked ? or the steps, assigning the ID to a variable has got me stuck for weeks now, been searching for the forms but unable to find any definite answer.  Cry
  
Back to top
 
IP Logged
 
Edo
Full Member
*
Offline



Posts: 7
Location: Milano, Italy
Joined: Apr 21st, 2020
Gender: Male
Re: SDK
Reply #30 - Dec 7th, 2020 at 2:39pm
Print Post  
Hello, I was tryin to read Lua events for the Eicas and ADI display but looks like no data is available out of those...can you confirm?
  
Back to top
IP Logged
 
Dave Snyder WI
Full Member
*
Offline



Posts: 34
Joined: May 22nd, 2020
SimConnect C++ and CS767 LVARS...
Reply #31 - Mar 19th, 2021 at 3:18am
Print Post  
Does anyone have any experience writing a C++ or C# application that uses SimConnect.  Specifically, I am writing an application that needs to R/W the CS767 LVARS for my home cockpit.  See other post recently here by me - I am subscribing to SIOC events (for my OpenCockpits hardware) and need to sync button presses etc in my hardware to the SIM.  Additionally, I will need to read values from CS767 LVARS to update my various LEDs etc.  Any advice would be greatly appreciated.
  
Back to top
 
IP Logged
 
Dave Snyder WI
Full Member
*
Offline



Posts: 34
Joined: May 22nd, 2020
Re: SDK
Reply #32 - Mar 19th, 2021 at 8:58pm
Print Post  
I am aware how to create individual LUA scripts for each LVAR that I wish to set, however, since I have a opencockpits program I am writing to get the state of all of my various switches, buttons, etc, I would like to set those LVARS from in that same program as doing all kinds of LUA mini scripts is cumbersome and wouldn't be tied to my actual hardware.
Perhaps the CaptaimSim folk can do a short description of how to access LVARS ???
  
Back to top
 
IP Logged
 
Dave Snyder WI
Full Member
*
Offline



Posts: 34
Joined: May 22nd, 2020
Re: 767 - SDK - Scripting Issues FSX / Mobiflight
Reply #33 - Mar 19th, 2021 at 10:06pm
Print Post  
flyingjayaraj wrote on Aug 17th, 2020 at 7:43pm:
Hello everone, i am stuck at a point where i am unable to program my MCP, due to limited knowledge in coding and deciphering the 757/767 SDK.

CS-767 & 757 - FSX - FSUIPC - Mobiflight

To increase or decrease the airspeed value - i followed the instructions from the SDK

I created a lua file - CS757SPEEDDEC.LUA

ipc.writeLvar(“L:klid",-1703010)

and another - CS757SPEEDINC.LUA

ipc.writeLvar(“L:klid", 1703010)

These lua files now show up in my FSUIPC list.

Now the next step is to add an entry to auto-run the lua, i have made that entry too.

[Auto]
1=Lua CS757SPEEDINC
2=Lua CS757SPEEDDEC

Now in the macro file, what is the entry that i have to have ?
i tried different entry but none seem to work.

Could anyone please share some script that has worked ? or the steps, assigning the ID to a variable has got me stuck for weeks now, been searching for the forms but unable to find any definite answer.  Cry


I have not yet tried this myself, but it looks like you are missing a trigger to cause these events to happen.  You would need to map a joystick button or keypress to trigger one of these LUA scripts to execute.  I have seen a decent YouTube video to explain this step (https://www.youtube.com/watch?v=mOO32FiMNS0).  Hopefully that helps.
  
Back to top
 
IP Logged
 
Dave Snyder WI
Full Member
*
Offline



Posts: 34
Joined: May 22nd, 2020
Re: SDK
Reply #34 - Mar 19th, 2021 at 10:13pm
Print Post  
You could also look at this video as well...
https://youtu.be/_NVpSf4SZJM

He also shows a section in FSUIPC.ini called [LuaFiles] that you may need to add (in addition to your Lua entries in [Auto]) if you are saving FSUIPC macros that call on the scripts.

  
Back to top
 
IP Logged
 
Dave Snyder WI
Full Member
*
Offline



Posts: 34
Joined: May 22nd, 2020
Re: SDK
Reply #35 - Mar 19th, 2021 at 10:17pm
Print Post  
Captain Sim wrote on Jun 4th, 2020 at 2:55pm:
Kees wrote on Jun 3rd, 2020 at 8:45pm:
I hope you will reconsider this option.

Well, you are asking us to re-build the entire 767 code from scratch (which is years of work) just to make it fit better one particular homepit needs.
The answer is no, sorry.


So, I suspect that the main need isn't to necessarily write those values directly, but instead get a fast performance so that rotary inputs can change values quickly.  I haven't gotten to actually try this out yet (hopefully this weekend), but I wonder if the slow response is because it is calling LUA scripts to access LVARS as opposed to a more performant environment like C++/SimConnect.  Anyway, I do not know how to access LVARS outsite of a Lua script (yet), but hopefully there is a way...
  
Back to top
 
IP Logged
 
Dave Snyder WI
Full Member
*
Offline



Posts: 34
Joined: May 22nd, 2020
Re: SimConnect C++ and CS767 LVARS...
Reply #36 - Mar 19th, 2021 at 10:33pm
Print Post  
Dave Snyder WI wrote on Mar 19th, 2021 at 3:18am:
Does anyone have any experience writing a C++ or C# application that uses SimConnect.  Specifically, I am writing an application that needs to R/W the CS767 LVARS for my home cockpit.  See other post recently here by me - I am subscribing to SIOC events (for my OpenCockpits hardware) and need to sync button presses etc in my hardware to the SIM.  Additionally, I will need to read values from CS767 LVARS to update my various LEDs etc.  Any advice would be greatly appreciated.


Found a great video on YouTube () that I think gets me very close...

I'll paste in the code that looks to at least get the built-in variables for generic aircraft, just not quite sure how to change the request for LVARS - I wonder if it is simple as putting in the klid number instead of the #define of the variable?

#include <windows.h>
#include <iostream>
#include "SimConnect.h"

int quit = 0;
HANDLE hSimConnect = NULL;

static enum DATA_DEFINE_ID {
     DEFINITION_1,
};

static enum DATA_REQUEST_ID {
     REQUEST_1,
     REQUEST_2,
};

struct SimResponse {
     double altitude;
     int32_t heading;
     int32_t speed;
     int32_t vertical_speed;
};

void CALLBACK MyDispatchProc1(SIMCONNECT_RECV* pData, DWORD cbData, void* pContext) {
     switch (pData->dwID)
     {

     case SIMCONNECT_RECV_ID_SIMOBJECT_DATA:
     {
           SIMCONNECT_RECV_SIMOBJECT_DATA* pObjData = (SIMCONNECT_RECV_SIMOBJECT_DATA*)pData;

           switch (pObjData->dwRequestID)
           {
           case REQUEST_1:

                 SimResponse* pS = (SimResponse*)&pObjData->dwData;

                 std::cout
                       
                       << "\rAltitude: " << pS->altitude
                       << " - Heading: " << pS->heading
                       << " - Speed (knots): " << pS->speed
                       << " - Vertical Speed: " << pS->vertical_speed
                       
                       << std::flush;

                 break;
           }
           break;
     }

     case SIMCONNECT_RECV_ID_QUIT:
     {
           quit = 1;
           break;
     }

     default:
           break;
     }
}

bool initSimEvents() {
     HRESULT hr;

     if (SUCCEEDED(SimConnect_Open(&hSimConnect, "Client Event Demo", NULL, 0, NULL, 0))) {
           std::cout << "\nConnected To Microsoft Flight Simulator 2020!\n";

           // DATA
           hr = SimConnect_AddToDataDefinition(hSimConnect, DEFINITION_1, "Indicated Altitude", "feet");
           hr = SimConnect_AddToDataDefinition(hSimConnect, DEFINITION_1, "HEADING INDICATOR", "degrees", SIMCONNECT_DATATYPE_INT32);
           hr = SimConnect_AddToDataDefinition(hSimConnect, DEFINITION_1, "Airspeed Indicated", "knots", SIMCONNECT_DATATYPE_INT32);
           hr = SimConnect_AddToDataDefinition(hSimConnect, DEFINITION_1, "VERTICAL SPEED", "Feet per second", SIMCONNECT_DATATYPE_INT32);

           // EVERY SECOND REQUEST DATA FOR DEFINITION 1 ON THE CURRENT USER AIRCRAFT (SIMCONNECT_OBJECT_ID_USER)
           hr = SimConnect_RequestDataOnSimObject(hSimConnect, REQUEST_1, DEFINITION_1, SIMCONNECT_OBJECT_ID_USER, SIMCONNECT_PERIOD_SECOND);

           // Process incoming SimConnect Server messages
           while (quit == 0) {
                 // Continuously call SimConnect_CallDispatch until quit - MyDispatchProc1 will handle simulation events
                 SimConnect_CallDispatch(hSimConnect, MyDispatchProc1, NULL);
                 Sleep(1);
           }

           hr = SimConnect_Close(hSimConnect);
           return true;
     }
     else {
           std::cout << "\nFailed to Connect!!!!\n";
           return false;
     }
}

int main() {
     initSimEvents();
     return 0;
}


For example, in the code above, I could try replacing "HEADING INDICATOR" with the numeric klid?

Anyone know?  I'll code this up this weekend and find out...

  
Back to top
 
IP Logged
 
Dave Snyder WI
Full Member
*
Offline



Posts: 34
Joined: May 22nd, 2020
Re: SDK
Reply #37 - Mar 19th, 2021 at 10:35pm
Print Post  
Oops - forgot to post the YouTube link - https://www.youtube.com/watch?v=M9dWihPtkrQ

The person who did the video wrote the above code.
  
Back to top
 
IP Logged
 
Dave Snyder WI
Full Member
*
Offline



Posts: 34
Joined: May 22nd, 2020
Re: SDK
Reply #38 - Mar 19th, 2021 at 10:48pm
Print Post  
Ugh - digging further, it seems this might now work for LVARS as those would only be accessible in-proc (and not from separate process of P3D).  Other sites have discussed making a custom C/C++ gauge control and that seems to be able to access LVARS.  Anyway, just putting this info out here for the future when someone will be able to answer...
  
Back to top
 
IP Logged
 
Dave Snyder WI
Full Member
*
Offline



Posts: 34
Joined: May 22nd, 2020
Re: SDK (LVARS and C/C++)
Reply #39 - Apr 14th, 2021 at 2:00am
Print Post  
BUMP! - Does anyone on the CaptainSim team actually know how to access LVARS via C/C++ or SimConnect???  Seems like someone should know how to interact with these outside the LUA script method...
  
Back to top
 
IP Logged
 
Dave Snyder WI
Full Member
*
Offline



Posts: 34
Joined: May 22nd, 2020
Re: SDK
Reply #40 - Aug 6th, 2021 at 3:06pm
Print Post  
One more bump...

Anyone out there interested in trying to solve this?  I have a full-size 767 cockpit that I am desperately trying to port over from LD767 and FSX to P3D CS767 and need this functionality.

Summary: Need a C++ way to Read/Write CS767 LVARS.

Specifically, It looks like I need to build a custom gauge DLL (that is in-proc w/ P3D) that can r/w the LVARS in CS767 and then does an IPC (maybe socket) to a module that can talk via SimConnect or FSUIPC and my OpenCockpits Modules.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 
Send TopicPrint
 
  « Board Index ‹ Board  ^Top