0 votes
asked by (20 points)

Hi,

I'm setting up an encoder panel to control radios, etc.  I'm testing the commands with a Packet Sender program, and am able to control the functions with the CMND function.  For example, CMND+sim/autopilot/altitude_up from the Packet Sender converts the ASCII to hex and causes the altitude setting to increase in the sim.  Notice I took the 0 after D out to make it work. (Documentation states: CMND0+sim/flight_controls/flaps_up)

The documentation/syntax (D:\X-Plane 11\Instructions\X-Plane SPECS from Austin\Exchanging Data with X-Plane.rtfd\TXT.rtf) is unclear to me for the DREF command:

DREF0+(4byte byte value of 1)+ sim/cockpit/switches/anti_ice_surf_heat_left+0+spaces to complete to 509 bytes

Assuming I only want to use datarefs with a value of 0 or 1, and I wanted to set night vision on, the resulting syntax doesn't seem to work:

DREF0(????)sim/cockpit/electrical/night_vision_on0

[followed by enough spaces to get to 504 bytes, which differs from documentation stating 509 bytes].  

I believe my difficulty is the piece I've notated with the question marks.  The 4-byte byte value for 1, and whether parentheses or spaces are needed around it, or commas/dashes between.

I would appreciate clarification if someone has it, i.e., a statement that works in the Packet Sender, and later in an Arduino program.

Thank You,  RF

1 Answer

0 votes
answered by (20 points)
I resolved this.

Correct ASCII syntax for night vision off is "DREF\00\00\00\00\00sim/cockpit/electrical/night_vision_on\00", padded with spaces out to 504 bytes (+ DREF0 = 509 bytes).

This translates to:  44 52 45 46 00 00 00 00 00 73 69 6d 2f 63 6f 63 6b 70 69 74 2f 65 6c 65 63 74 72 69 63 61 6c 2f 6e 69 67 68 74 5f 76 69 73 69 6f 6e 5f 6f 6e 00 (padded with spaces 20 20 20 etc. to 504 bytes).

Night vision on:  44 52 45 46 00 00 00 80 3f 73 69 6d 2f 63 6f 63 6b 70 69 74 2f 65 6c 65 63 74 72 69 63 61 6c 2f 6e 69 67 68 74 5f 76 69 73 69 6f 6e 5f 6f 6e 00 (padded with spaces 20 20 20 etc. to 504 bytes).

Welcome to X-Plane Q&A, where you can ask support questions and get answers from members of the community.

This site is for X-Plane support questions only. Please search for existing answers before posting your question. Off-topic questions will be locked.

If you’re new, you’ll need to register before asking your first question.

If your question is answered, click on the check mark to select the best response.

Categories

...