By Marc Stephens 1153500
#536122 Hello,
With the new audio codec coming out I have decided to move away from fsinn and use v-pilot. I am looking at how to control the Stby/mode C/Ident externally to v-pilot. I have done some research and have found that it is possible via SimConnect using the Squawkbox client data area. What is this client data area? How do I access it? Is there a guide as to how to set this up? I have looked but have not yet found anything.
Many thanks
Marc
By Andreas Fuchs 810809
#536124 Hi Marc,

without knowing what SIM and setup you are using, I guess that it will just work out of the box. Have you tested vpilot already with your SIM? You should be able to install and use it in parallel to FsInn.
By Marc Stephens 1153500
#536138 Thanks guys for your responses, apologies for my lack of info. So I am in the middle of building a sim cockpit panel based on Carenado's A36 Bonanza. I am currently flying FSX but am planning on making the move to p3d as the future is 64 bit. I am interfacing my hardware to fsx via arduino & link2fs. I would like to be able to be able to select stby/mode c using a switch and ident using a button.

Fsinn has a settings page where I could select either a key press or a joystick button to trigger mode c. I did try using Link2fs to connect a switch to a key press and although windows was detecting the key press it would not work in fsinn.

I did have a look to see if the aircraft transponder would trigger mode c in vpilot but it did not work.

Hope that all makes sense.
Many thanks
Marc
By Ross Carlson 887155
#536154 Your best bet would be to use FSUIPC to set the offsets. That is much simpler than using the SimConnect client data area. Is FSUIPC an option for you?
By Marc Stephens 1153500
#536182 Hi Ross, It's not at the minute but only because I do not own a registered version but I have not yet bought it as I have not yet needed the registered version. Thinking about it, I coud be wrong but there is a section in Link2fs with an FSUIPC offsets page, I'm not sure if it needs a registered version to work or not. So are you saying that vpilot will recognise a switch using fsuipc offests? I am not against getting the registered version if I have to. I have a LIST OF fsuipc's offsets so will have a play and see what happens.
Many thanks
Marc
Last edited by Marc Stephens 1153500 on Wed Oct 02, 2019 4:14 pm, edited 1 time in total.
By Ross Carlson 887155
#536183 Okay, sounds good. If you don't end up going the FSUIPC route, let me know and I'll assist you with the SimConnect client data area setup.

Note that there is an undocumented plugin interface for vPilot if you want to go that route. If you can develop a .net assembly, you can build a vPilot plugin, which gives you the ability to control the transponder, connect/disconnect, among other things.
By Ed Wilson 827425
#541130 I am interested in information regarding using SimConnect in C/C++ to interact with vPilot. I have read the documentation for vPilot and can find no SDK information at all. Where can I locate SDK info for external control from an addon such as an aircraft?

Thank you
By Ross Carlson 887155
#541131 Hi Ed,

The reason you can't find any documentation for vPilot SDK is because the transponder control stuff is part of the Squawkbox SDK. vPilot just supports it, so that aircraft written to support the Squawkbox transponder offsets will inherently work with vPilot.

Here's where the Squawkbox offsets are defined:

http://squawkbox.ca/doc/sdk/fsuipc.php

Also, Pete Dowson added functionality to FSUIPC such that the values of all the Squawkbox offsets are copied to/from a SimConnect CDA (Client Data Area) so that the offsets can be written to or read from via SimConnect as well as via FSUIPC, as long as FSUIPC is running. The name of that CDA is "SquawkBox Data".

That should get you started ... let me know if you have any questions.
By Ed Wilson 827425
#541424 At this point, I am unable to get current data settings from Squawkbox Data. I can tell vPIlot to turn on/off Mode C. I can tell vPilot to IDENT. However, at no time can I see that Mode C is active via SimConnect and Squawkbox Data. I also can not see IDENT active, nor COM transmit active.

I don't see running nor connected. In short, no part of the Squawkbox Data area is usable for determining the state of the interface. This is using current version of vPilot.

This is the code I used to connect and set up the data:

Code: Select all   hResult = simConnect->MapClientDataNameToID("SquawkBox Data", SQUAWKBOX_DATA);

   simConnect->AddToClientDataDefinition(SQUAWKBOX_DATA_ID_RUNNING, 0, 1);
   simConnect->AddToClientDataDefinition(SQUAWKBOX_DATA_ID_CONNECTED, 1, 1);
   simConnect->AddToClientDataDefinition(SQUAWKBOX_DATA_ID_TRANSPONDER_MODE, 17, 1);
   simConnect->AddToClientDataDefinition(SQUAWKBOX_DATA_ID_ATC_PING, 18, 1);
   simConnect->AddToClientDataDefinition(SQUAWKBOX_DATA_ID_IDENT, 19, 1);
   simConnect->AddToClientDataDefinition(SQUAWKBOX_DATA_ID_COM1_VOICE_ACTIVE, 20, 1);
   simConnect->AddToClientDataDefinition(SQUAWKBOX_DATA_ID_COM1_VOICE_RECEIVE, 21, 1);
   simConnect->AddToClientDataDefinition(SQUAWKBOX_DATA_ID_COM1_VOICE_TRANSMIT, 22, 1);
   simConnect->AddToClientDataDefinition(SQUAWKBOX_DATA_ID_COM2_VOICE_ACTIVE, 24, 1);
   simConnect->AddToClientDataDefinition(SQUAWKBOX_DATA_ID_COM2_VOICE_RECEIVE, 25, 1);
   simConnect->AddToClientDataDefinition(SQUAWKBOX_DATA_ID_COM2_VOICE_TRANSMIT, 26, 1);
   simConnect->AddToClientDataDefinition(SQUAWKBOX_DATA_ID_ATC_PING_COUNT, 27, 1);
   simConnect->AddToClientDataDefinition(SQUAWKBOX_DATA_ID_MESSAGE_RECEIVED, 28, 1);
   simConnect->AddToClientDataDefinition(SQUAWKBOX_DATA_ID_SELCAL_NOTIFICATION, 29, 1);
   simConnect->AddToClientDataDefinition(SQUAWKBOX_DATA_ID_TEXT_TYPE, 32, 1);
   simConnect->AddToClientDataDefinition(SQUAWKBOX_DATA_ID_TEXT_AREA, 33, 65);


   simConnect->RequestClientData(SQUAWKBOX_DATA, SQUAWKBOX_REQUEST_ID_RUNNING, SQUAWKBOX_DATA_ID_RUNNING, SIMCONNECT_CLIENT_DATA_PERIOD_ON_SET, SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_CHANGED);
   simConnect->RequestClientData(SQUAWKBOX_DATA, SQUAWKBOX_REQUEST_ID_CONNECTED, SQUAWKBOX_DATA_ID_CONNECTED, SIMCONNECT_CLIENT_DATA_PERIOD_ON_SET, SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_CHANGED);
   simConnect->RequestClientData(SQUAWKBOX_DATA, SQUAWKBOX_REQUEST_ID_TRANSPONDER_MODE, SQUAWKBOX_DATA_ID_TRANSPONDER_MODE, SIMCONNECT_CLIENT_DATA_PERIOD_ON_SET, SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_CHANGED);
   simConnect->RequestClientData(SQUAWKBOX_DATA, SQUAWKBOX_REQUEST_ID_ATC_PING, SQUAWKBOX_DATA_ID_ATC_PING, SIMCONNECT_CLIENT_DATA_PERIOD_ON_SET, SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_CHANGED);
   simConnect->RequestClientData(SQUAWKBOX_DATA, SQUAWKBOX_REQUEST_ID_IDENT, SQUAWKBOX_DATA_ID_IDENT, SIMCONNECT_CLIENT_DATA_PERIOD_ON_SET, SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_CHANGED);
   simConnect->RequestClientData(SQUAWKBOX_DATA, SQUAWKBOX_REQUEST_ID_COM1_VOICE_ACTIVE, SQUAWKBOX_DATA_ID_COM1_VOICE_ACTIVE, SIMCONNECT_CLIENT_DATA_PERIOD_ON_SET, SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_CHANGED);
   simConnect->RequestClientData(SQUAWKBOX_DATA, SQUAWKBOX_REQUEST_ID_COM1_VOICE_RECEIVE, SQUAWKBOX_DATA_ID_COM1_VOICE_RECEIVE, SIMCONNECT_CLIENT_DATA_PERIOD_ON_SET, SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_CHANGED);
   simConnect->RequestClientData(SQUAWKBOX_DATA, SQUAWKBOX_REQUEST_ID_COM1_VOICE_TRANSMIT, SQUAWKBOX_DATA_ID_COM1_VOICE_TRANSMIT, SIMCONNECT_CLIENT_DATA_PERIOD_ON_SET, SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_CHANGED);
   simConnect->RequestClientData(SQUAWKBOX_DATA, SQUAWKBOX_REQUEST_ID_COM2_VOICE_ACTIVE, SQUAWKBOX_DATA_ID_COM2_VOICE_ACTIVE, SIMCONNECT_CLIENT_DATA_PERIOD_ON_SET, SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_CHANGED);
   simConnect->RequestClientData(SQUAWKBOX_DATA, SQUAWKBOX_REQUEST_ID_COM2_VOICE_RECEIVE, SQUAWKBOX_DATA_ID_COM2_VOICE_RECEIVE, SIMCONNECT_CLIENT_DATA_PERIOD_ON_SET, SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_CHANGED);
   simConnect->RequestClientData(SQUAWKBOX_DATA, SQUAWKBOX_REQUEST_ID_COM2_VOICE_TRANSMIT, SQUAWKBOX_DATA_ID_COM2_VOICE_TRANSMIT, SIMCONNECT_CLIENT_DATA_PERIOD_ON_SET, SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_CHANGED);
   simConnect->RequestClientData(SQUAWKBOX_DATA, SQUAWKBOX_REQUEST_ID_ATC_PING_COUNT, SQUAWKBOX_DATA_ID_ATC_PING_COUNT, SIMCONNECT_CLIENT_DATA_PERIOD_ON_SET, SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_CHANGED);
   simConnect->RequestClientData(SQUAWKBOX_DATA, SQUAWKBOX_REQUEST_ID_MESSAGE_RECEIVED, SQUAWKBOX_DATA_ID_MESSAGE_RECEIVED, SIMCONNECT_CLIENT_DATA_PERIOD_ON_SET, SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_CHANGED);
   simConnect->RequestClientData(SQUAWKBOX_DATA, SQUAWKBOX_REQUEST_ID_SELCAL_NOTIFICATION, SQUAWKBOX_DATA_ID_SELCAL_NOTIFICATION, SIMCONNECT_CLIENT_DATA_PERIOD_ON_SET, SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_CHANGED);
   simConnect->RequestClientData(SQUAWKBOX_DATA, SQUAWKBOX_REQUEST_ID_TEXT_TYPE, SQUAWKBOX_DATA_ID_TEXT_TYPE, SIMCONNECT_CLIENT_DATA_PERIOD_ON_SET, SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_CHANGED);
   simConnect->RequestClientData(SQUAWKBOX_DATA, SQUAWKBOX_REQUEST_ID_TEXT_AREA, SQUAWKBOX_DATA_ID_TEXT_AREA, SIMCONNECT_CLIENT_DATA_PERIOD_ON_SET, SIMCONNECT_CLIENT_DATA_REQUEST_FLAG_CHANGED);
By Ross Carlson 887155
#541443 Hi Ed,

vPilot only supports a few of the SquawkBox CDA offsets. They are:

0 - running
1 - connected
17 - transponder mode
19 - ident trigger

It does not support the others.

I'm not sure why you would be able to set the transponder mode and trigger an ident, but not be able to see the "running" and "connected" bytes toggle. It might be that you are only asking SimConnect to tell you about changes to values. You might need to fetch the current value when your aircraft first loads, and then subscribe to changes.
By Ed Wilson 827425
#541507 I switched to reading directly via FSUIPC offsets. I see 0 for running, 0 for connected, 1 for mode c, 0 for ident. I have confirmed this by having FSUIPC display those offsets in a window in the sim.

Clearly something isn't working as expected.

As for the other offsets... the ones that I would be interested in are the COM transmit indications and the SELCAL notification. vPilot is seeing these events (obviously)... it would be useful if they were set accordingly at their offsets.
By Ross Carlson 887155
#541539 I'm afraid I don't know why you aren't seeing the values change. This has been working well in vPilot for years.

Note that you should not expect to see a change in the ident offset when you ident using the button in the vPilot UI. The offset in the CDA is only for triggering an ident, not for signaling that ident is active.