Go to Post FIRST needs a disclaimer that parts of the field can become flying projectiles under hurricane force winds. - Barry Bonzack [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 31-08-2011, 19:23
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,579
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Advanced LabVIEW programming?

Here's what made me think objects wouldn't work in 8.6 RT: http://zone.ni.com/reference/en-XX/h...portedvxworks/
Reply With Quote
  #2   Spotlight this post!  
Unread 31-08-2011, 21:14
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Advanced LabVIEW programming?

I found corroborating evidence that OOP wasn't enabled on RT until the 2009 edition. Oops.

http://zone.ni.com/devzone/cda/tut/p/id/3573

Greg McKaskle
Reply With Quote
  #3   Spotlight this post!  
Unread 27-10-2011, 01:25
SuperS_5's Avatar
SuperS_5 SuperS_5 is offline
[Certified LabVIEW Developer]
FRC #1219
 
Join Date: Dec 2010
Rookie Year: 2010
Location: Canada
Posts: 140
SuperS_5 will become famous soon enoughSuperS_5 will become famous soon enough
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:
Also, I've been trying to apply classes to FRC robotics programming, but I never got particularly far. What exactly would you encapsulate?
At the the of my first reply, I didn't realize that OOP was not supported for the cRIO. This years update will fix that though.
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:
  • Drive Train
  • Compressor
  • Arm System
  • Grabber System
    -- The solenoids and sensors would each be a separate class. (But not children of the above 2 systems.)


Quote:
Can you explain why you'd use functional globals instead of the actual Global that we use in the FRC framework? Is there a performance/readability/usability benefit?
I use functional globals a default over LabVIEW globals. The LabVIEW global is great for beginners, but, it can be limiting. (Just like using a boolean instead of a TypeDef'd Enum as an action.) The functional global allows for init code, calculations, and other interesting code to be done directly on the data before/after the stack. This allows for modification of the data globally for specific actions. This makes it a precursor to OOP. I generally make the functional global as part of the class that owns that data.


Quote:
However, compile/build time has been an issue
The newer versions of LabVIEW have improved on this a bit. LabVIEW 2011 has made significant improvements in the area. For FPGA coding, I have seen single wire edits take up to a minute or more in LabVIEW 2009 and below.
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)
  • System memory is the single biggest factor in LabVIEW performance up to 3GB of RAM. After that, other system resources become bottle necks for code development.

Quote:
Some things that helped us were to avoid organizing code in subvis and avoiding while loops in teleop and autonomous
I would highly recommend not avoiding subVIs. This is a very basic coding practice in LabVIEW. If you are having troubles with the compile time, maybe we can help you out in another thread. The alternative to the file reading is using FP controls, either directly on the subVI or the Driver Station control panel. (The former being easier, but requires running from the development system.)

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.
__________________
Mike B

Last edited by SuperS_5 : 27-10-2011 at 09:06.
Reply With Quote
  #4   Spotlight this post!  
Unread 07-11-2011, 21:27
Tom Line's Avatar
Tom Line Tom Line is offline
Raptors can't turn doorknobs.
FRC #1718 (The Fighting Pi)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 1999
Location: Armada, Michigan
Posts: 2,533
Tom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond repute
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.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 20:38.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi