Files
XPlaneConnectCSP/MATLAB/pages/readDATA.html
Chris Teubert 8013ce1003 Initial Version
2014-10-22 15:52:38 -07:00

59 lines
2.0 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title>XPlaneConnect Toolbox-readDATA</title>
<meta name="Generator" content="Cocoa HTML Writer">
<meta name="CocoaVersion" content="1138.51">
</head>
<body>
<a href="../Documentation (MATLAB).html"><-- Back</a><br />
<h1>readDATA</h1>
Reads UDP Socket and interprets data
<h2>Inputs</h2>
<ul>
<li><b>location:</b> Either an opened UDP Socket or integer port number</li>
</ul>
<h2>Outputs</h2>
If data is X-Plane data format:
<ul>
<li><b>data:</b> Matlab X-Plane DATA Structure<ul>
<li>.h: Header array containing header numbers corresponding to values in the X-Plane UDP Data screen. </li>
<li>.d: 2-D Data array. Each row contains eight values corresponding to the header value (.h(1) corresponds to .d(1,:))</li>
<li>.raw: raw UDP data array received by readUDP</li></ul></li>
</ul>
If data is matlab structure:
<ul>
<li><b>data:</b> Matlab Structure. Raw udp data saved to data.raw</li>
</ul>
If data is any other format:
<ul>
<li><b>data:</b> Matlab Structure containing one field <ul>
<li>.raw & .d: raw UDP data array received by readUDP</li></ul></li>
</ul>
<h2>Use</h2>
1. import XPlaneConnect.*;<br />
2. socket = openUDP(49005); <br />
3. data = readDATA(socket); <br />
4. status = closeUDP(socket); <br /><br />
or <br /> <br />
1. import XPlaneConnect.*;<br />
2. data = readDATA(49005);
<h2>Note</h2>
NOTE: sending in a port number instead of an opened socket clears the UDP buffer. This only works if the data is being sent at a fast rate. Sending in a UDP Socket reads the first packet in the buffer. <br />
<h2>Change Log</h2>
10/02/14: [CT] V0.9: Updated to work with updated xpcPlugin<br />
09/10/13: [CT] Updated to receive UDP socket or port number<br />
06/10/13: [CT] Code created<br /><br />
<a href="../Documentation (MATLAB).html"><-- Back</a><br />
</body>
</html>