Community news, upcoming events and general discussions
Threads: 36 Posts: 88
Get technical support from the community
Threads: 1427 Posts: 7608
Threads: 18 Posts: 64
Tell us how to make XDK better!
Threads: 36 Posts: 119
Share and discuss community member projects
Threads: 81 Posts: 350
I have modified the example project 'StreamSensorDataOverUsb', for transmitting the sensor data over USB to PC.
The portion of the code (in AppController.h),
#define APP_CONTROLLER_TX_DELAY UINT32_C (1000)
was changed to
#define APP_CONTROLLER_TX_DELAY UINT32_C (100)
for transmitting the data @ 10 Hz (10 samples per second)
But, the data rate I got is less than 10 Hz - Recorded data for 101sec, and obtained only 984 data packets instead of 1010 packets.
Please help me solve this.
on a first sight i am not able to find an explanation for this behavior.
Have you done any other modifications to the program?
Maybe you could add an automatic incrementing integer counter to your data packets. This way you can exactly check if packets are missing.
I hope this was helpfull.
Thank you for the reply.
We have tried putting packet count in each packet but no packets were found missing.
Is there any other methods to check the data rate of the XDK?
Thanks & regards,
now we have the information that no packets are actually missing. I think with this information we can work on the problem step by step.
One possible reason for the unexpected number of packets could be the function "printf". This is a really generic function so it takes some time to execute. Corresponding on the number of sensors you read data from and so the number of printf calls this could be responsible for the delay.
I think the next step would be to include the header "Serval_Clock.h" in your program. In this header you can find the function "Clock_getTimeMillis()". This function returns the current time since the XDK was started in milliseconds. You could print out these values in every loop execution and compare the values to see how long it takes for the XDK to execute the loop.
This should give you more information about your system behavior.