![]() |
Re: Advanced LabVIEW programming?
Quote:
|
Re: Advanced LabVIEW programming?
Quote:
You can minimize compile and build time by: 1. Using text files that read in constants that you use. You can FTP the text file, modify it, FTP it back, then have your code re-read it. This requires a little knowledge of the File I/O pallet and FTP, but it's a huge boon when you are tweaking things like autonomous. 2. Run the program from your laptop / computer rather than building it and deploying it. Use controls instead of constants. Once you've reached the right values, right click on the control and change it to default to your new value. In fact, in 2010, the very first time we deployed code was the week of bag. Up until then we were always running from the computer while we updated it. Labview handles loops just fine. The problem with using loops in Teleop and elesewhere is that the robot framework is already a giant loop that runs over and over again. The timing is tied into the driver station packet timing, and watchdogs monitor that your code is inputting and outputting often enough. If you have a loop in teleop and that loop takes some time to complete (we're talking more than around 1/20 seconds) you'll trigger the watchdogs. They assume something has gone wrong, and begin disabling functions on the robot for safety reasons. Because Teleop is already one big loop, there's never really a reason to RUN a loop there. If you need something to loop more quickly, then use the period tasks (the area where the vision VI is put) in robot main. |
Re: Advanced LabVIEW programming?
Hi,
I ended up getting really busy after posting on this thread, and then totally forgot about it. The recent bump brought it back into my attention. Quote:
One of the principles of OOP in LabVIEW is to make nearly everything a subVI. If you need data out of the OOP wire, you use a specialized subVI. (Accessor) All methods can be made into subVIs. I especially force this when working with specialized code like database calls, or any kind of math algorithm. These can change often, so if they are subVIs, it makes it to modify later. Different "Objects" would each be a separate class. For example, the vision system would have it's own class. Acquiring test images, might come from a web camera on your laptop. The testing web camera, and the robot camera would each be a child class of the vision class. (This is starting to get into dynamic dispatching, which should be in a different thread.) In particular the various physical devices that you are controlling would each be a different class. For Example:
Quote:
Quote:
Unfortunately the only solution for this year is to get faster computers. I didn't actually see much a problem in this area for FRC on my laptop, even though I was using a virtual machine to code in. (I have an i5 at 2.4GHz and at the time 4GB of RAM)
Quote:
Nested Loops, except in very distinct cases, are usually very bad practice. Unfortunately it is way too easy to do. Generally junior programmers will do this when they don't know about the framework that they are working within. This applies to FRC and the professional world. |
Re: Advanced LabVIEW programming?
On a happy note, we are using Labview 11 for the beta test and are very pleased with the run, build, and deploy times. The first time you build and run as startup is the same speed as the old software, but after that it seems to go VERY fast (perhaps not bothering to build and deploy unchanged files). It's a nice change.
|
| All times are GMT -5. The time now is 20:38. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi