This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

UDP Warning - Unable to Read All Data

These remedies apply to the case when you receive some data and you get this warning message:

'udp' unable to read all requested data

ASCII Data

When using the UDP interface for:

  • Reading ASCII (text) data using the fscanf, fgets, or fgetl functions

these are possible causes and remedies:

CauseSolution
An incorrect read terminator was used.Verify that the Terminator property is set to the value required by your device. For more information about setting the property, see Terminator.
Communication with the device was interrupted.Check your device connection. For more information about troubleshooting configuration and connection, see Troubleshooting UDP Interface.

Binary Data

When using the UDP interface for:

  • Reading binary data using the fread function

these are possible causes and remedies:

CauseSolution
The number of values to read was not specified and was set to the InputBufferSize by default.Set the number of values to read using the size argument on the fread function, or change the InputBufferSize property. For more information about setting the property, see InputBufferSize. For information about setting number of values to read, see fread.
Device did not send all the requested data.Check your device connection. For more information about troubleshooting configuration and connection, see Troubleshooting UDP Interface.
There was a data format mismatch.Verify that the device data format matches the specified read format. Data format is set using the Precision property. For more information about supported precisions, see fread.
If the amount of data being received spans multiple UDP packets, it is possible that the system dropped packets.The UDP packet size is controlled by the OutputDatagramPacketSize property. You can specify the size, in bytes, between 1 and 65,535, and the default value is 512. You can increase or decrease the packet size if necessary.

Binblock Data

When using the UDP interface for:

  • Reading binblock (binary-block) data using the binblockread function

these are possible causes and remedies:

CauseSolution
The timeout value might be too short for the amount of data being read.Increase the Timeout property value. For more information about setting the property, see Timeout.
Communication with the device was interrupted.Check your device connection. For more information about troubleshooting configuration and connection, see Troubleshooting UDP Interface.

More Troubleshooting Help

For more information about troubleshooting the UDP interface, including supported platforms, adaptor requirements, configuration and connection, and other troubleshooting tips, see Troubleshooting UDP Interface.