Quote:
Originally Posted by kamocat
If you do this, make sure to do it in Periodic Tasks.
|
Yes, with an easily configurable sample rate.
You wouldn't want to sample data at 100Hz if the data only changes at 1Hz.
Quote:
|
I tried logging the status of the robot (for field diagnostics during matches), but found it slowed the code down to 150 to 230 ms per iteration. (That's a lot of lag for a driver.)
|
You were logging the data to a file no doubt.
If so, you were writing to flash file system and there's your SLOW.
Ideally, you would want to log raw binary data -- not formatted strings -- and you'd want to store into a RAM buffer.
The Wind River data monitor does exactly that.
The size of the buffer, whether it's a wrap-around buffer, and the upload-to-host threshold is configurable from Workbench.
If you must log to a file (because the buffer management/access functions are more work than you want to do) then look into creating a RAM disk just for the logging.
Quote:
|
It's possible that it had to do with the string processing functions I was using, but I have a feeling that the cRIO has slow memory writes. (Why else would it take several minutes to transfer your code?)
|
When you transfer code, it's going to the flash file system.
Writing to flash memory is always SLOW.