# XPlaneConnect Toolbox-sendDATA

<-- Back

# sendDATA

Send X-Plane formatted DATA over UDP. This function is used to change one of the parameters listed in the x-plane udp data screen (see http://www.nuclearprojects.com/xplane/images/xp_datainout.jpg)

## Inputs

- data: X-Plane formatted data. Is a matlab structure with the following fields:
  - .h: Header array containing header numbers corresponding to values in the X-Plane UDP Data screen.
  - .d: 2-D Data array. Each row contains eight values corresponding to the header value (.h(1) corresponds to .d(1,:))
- IP Address (optional): IP Address of the machine that will receive the data as a character array. Default is '127.0.0.1' (local machine)
- port (optional): Port on the receiving machine where the data will be sent. Default is 49009 (XPlaneConnect). In general use 49009 to send to the plugin and 49005 to send to the x-plane udp

## Outputs

- status: If there was an error. Status=1 means there was an error.

## Use

1. import XPlaneConnect.*;
2. data = struct('h',14,'d',[1,-998,-998,-998,-998,-998,-998,-998]); %Set Gear
3. %Send the data array to port 49005 on the computer at IP address 172.0.100.54.
4. status = sendDATA(data, '172.0.100.54', 49005);

## note

Note: send the value -998 to not overwrite that parameter. That is, if -998 is sent, the parameter will stay at the current X-Plane value

## Change Log

10/01/14: [CT] V0.9: updated to function with new xpcPlugin
06/10/13: [CT] First created
<-- Back