|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#5
|
|||
|
|||
|
Re: Load file quicker
Thanks for posting the code. I still have several questions, and some comments about the way the code is written.
How much data is being written? File size and array size? What is the typical delta between the points? I'm not sure that you really need to record at 50Hz, but that appears to be what you are doing. I suspect that 1/10th of that much data would still be a pretty good autonomous recording. For the coding comments -- first off, I wouldn't put this into RobotMain at all. You can put it into the Disabled subVI instead, or you can put it into an independent loop, probably into periodic tasks. A few times a second, check a load or reload global or button on the panel and use the panel to show, perhaps even graph out the file that was loaded. The Autonomous subVI has a loop with no sleeps. It spins as fast as possible waiting for the clock to pass up the retrieved timestamp. Perhaps you should instead, compute when the point is due, and sleep the loop by that amount. This will lower the CPU from guarantees 100% to far less. The other comment about the code is that it uses far too many global and sequences. As an example, I've uploaded the load diagram written using wires to transfer the path and array. You can make the code correct with globals, but it is more difficult, and you will get burned by parallel updates or race conditions. Also, it is far less efficient than using wires. You don't need to immediately stop using globals and sequences, they are a useful tool. But if you find yourself using them to pass data between frames of a sequence, try using a wire instead. The code comments will improve your runtime performance somewhat, but my guess is that this is a large file and that the bulk of the time is spent loading it. Go ahead and measure that. Put a sequence around the load and the parse nodes and determine the time they take. This will be a cool tool for your team if you can get the implementation cleaned up a bit. Greg McKaskle |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|