Jump to content

You're browsing the 2004-2023 VATSIM Forums archive. All content is preserved in a read-only fashion.
For the latest forum posts, please visit https://forum.vatsim.net.

Need to find something? Use the Google search below.

Help with external transponder control,


Marc Stephens
 Share

Recommended Posts

Marc Stephens
Posted
Posted

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

Link to comment
Share on other sites

Andreas Fuchs
Posted
Posted

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.

Link to comment
Share on other sites

Trevor Hannant
Posted
Posted

It will also depend on the aircraft you’re using - some in-cockpit controls send Mode c/ident messages through to vPilot and therefore the network, others don’t.

Trevor Hannant

Link to comment
Share on other sites

Ross Carlson
Posted
Posted

If you were able to control the transponder mode with FSInn, it should work with vPilot as well. Is that not the case?

Developer: vPilot, VRC, vSTARS, vERAM, VAT-Spy

Senior Controller, Boston Virtual ARTCC

Link to comment
Share on other sites

Marc Stephens
Posted
Posted

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

Link to comment
Share on other sites

Ross Carlson
Posted
Posted

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?

Developer: vPilot, VRC, vSTARS, vERAM, VAT-Spy

Senior Controller, Boston Virtual ARTCC

Link to comment
Share on other sites

Marc Stephens
Posted
Posted (edited)

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

Edited by Guest
Link to comment
Share on other sites

Ross Carlson
Posted
Posted

Okay, sounds good. If you don't end up going the FSUIPC route, let me know and I'll [Mod - Happy Thoughts]ist you with the SimConnect client data area setup.

 

Note that there is an undocomeented plugin interface for vPilot if you want to go that route. If you can develop a .net [Mod - Happy Thoughts]embly, you can build a vPilot plugin, which gives you the ability to control the transponder, connect/disconnect, among other things.

Developer: vPilot, VRC, vSTARS, vERAM, VAT-Spy

Senior Controller, Boston Virtual ARTCC

Link to comment
Share on other sites

  • 2 months later...
Ed Wilson
Posted
Posted

I am interested in information regarding using SimConnect in C/C++ to interact with vPilot. I have read the docomeentation 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

Ed Wilson

Gauge Programmer

Link to comment
Share on other sites

Ross Carlson
Posted
Posted

Hi Ed,

 

The reason you can't find any docomeentation 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.

Developer: vPilot, VRC, vSTARS, vERAM, VAT-Spy

Senior Controller, Boston Virtual ARTCC

Link to comment
Share on other sites

Ed Wilson
Posted
Posted

Thank you for your response. I got the Mode C and Ident to function. Now I'm trying to get the SELCAL notification to work... I hear the SELCAL tone in vPilot... but I never see the notification from the client data.

Ed Wilson

Gauge Programmer

Link to comment
Share on other sites

Ed Wilson
Posted
Posted

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:

 

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);

Ed Wilson

Gauge Programmer

Link to comment
Share on other sites

Ross Carlson
Posted
Posted

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.

Developer: vPilot, VRC, vSTARS, vERAM, VAT-Spy

Senior Controller, Boston Virtual ARTCC

Link to comment
Share on other sites

Ed Wilson
Posted
Posted

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.

Ed Wilson

Gauge Programmer

Link to comment
Share on other sites

Ross Carlson
Posted
Posted

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.

Developer: vPilot, VRC, vSTARS, vERAM, VAT-Spy

Senior Controller, Boston Virtual ARTCC

Link to comment
Share on other sites

Kyle Weber
Posted
Posted

On a bit of a similar note, I have a third party aircraft that seems to have a transponder gauge not functioning correctly. It seems to constantly send a squawk standby command to vPilot, regardless of how I have the transponder knob set in the cockpit. Is there a way to completely ignore transponder variables from the aircraft and operate the transponder in "manual" mode via vPilot?

 

The option to force the transponder in mode C when airborne sort of works, but still not able to control it on the ground then.

 

Thanks.

Kyle Weber

Minneapolis ARTCC, VATUSA, C3 / P2

Link to comment
Share on other sites

Ross Carlson
Posted
Posted

No, there's no way to have vPilot ignore the squawkbox offsets ... sounds like that aircraft has a bug, if it is constantly setting the standby value in the squawk mode offset.

Developer: vPilot, VRC, vSTARS, vERAM, VAT-Spy

Senior Controller, Boston Virtual ARTCC

Link to comment
Share on other sites

Kyle Weber
Posted
Posted
sounds like that aircraft has a bug, if it is constantly setting the standby value in the squawk mode offset.

 

Yes, I agree. Trying to figure out any kind of work around.

Kyle Weber

Minneapolis ARTCC, VATUSA, C3 / P2

Link to comment
Share on other sites

  • 2 weeks later...
Ed Wilson
Posted
Posted

I would hazard that if the aircraft in question doesn't see vPilot as active/connected that it may not allow the transponder to change state. Just a thought.

Ed Wilson

Gauge Programmer

Link to comment
Share on other sites

 Share