Main Content

Serial Device Issues

Data Issues

Incorrect values of NumBytesAvailable

NumBytesAvailable shows incorrect values:

  • At the time of object creation, the value of NumBytesAvailable is non-zero.

  • Although, there is no device connected to the RxPin, the value on NumBytesAvailable changes after writing data from the device

This is caused if the serial device connections are changed after the arduino object is created in the workspace. If you do not change the connections, you will not see this issue.

If you continue to see the issue, create the arduino object again with ForceBuildOn set to true, and do not disturb the connections.