Go to Post Developing new "classes" of super-competition would totally defeat the concepts of info-sharing, partnerships, alliances, etc and create an elitist society within FIRST. - dhitchco [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 08-10-2008, 00:22
comphappy comphappy is offline
Registered User
AKA: Brennan Ashton
FRC #2605 (A2D_16)
Team Role: Leadership
 
Join Date: Jan 2008
Rookie Year: 2008
Location: Bellingham, WA
Posts: 157
comphappy is a splendid one to beholdcomphappy is a splendid one to beholdcomphappy is a splendid one to beholdcomphappy is a splendid one to beholdcomphappy is a splendid one to beholdcomphappy is a splendid one to beholdcomphappy is a splendid one to behold
Send a message via AIM to comphappy
Re: OpenCV and New Control System

Quote:
Originally Posted by RyanCahoon View Post
I don't mean to discourage you if you really want to try it, but you're probably ahead to use the image processing framework included with LabVIEW. Trust me... LabVIEW really isn't the "easy way out" for programming.
No it really it not, from what I have been experimenting with for the last 3 months it has been the hard way to program robots. I am finding while signal processing will be a snap and perhaps the vision stuff as well. Effective drive code that may be oh 300 lines of straightforward C is turning into a convoluted mess of lines and VIs. Just creating a toggle variable (need a 1 and then 0 to do a ~) in C is a few simple lines, just try it in Labview it is a mess.

While I am training the rest of the underclassmen who are doing programming labview as it connected with the NXT and RXT stuff that they are already learning, I think I might just be writing this years code in C.

While I am amazed at what LabView can do (really I am), I am also shocked at what it does inefficiently.

CImg should run on the VxWorks stuff I would think, but I am waiting to see what comes out of WPI before I embark on that. We should know soon as the beta teams progress.
__________________
A2D Solving the Imaginary Error Function...
Reply With Quote
  #2   Spotlight this post!  
Unread 08-10-2008, 03:27
RyanCahoon's Avatar
RyanCahoon RyanCahoon is offline
Disassembling my prior presumptions
FRC #0766 (M-A Bears)
 
Join Date: Dec 2007
Rookie Year: 2007
Location: Mountain View
Posts: 689
RyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond repute
Re: OpenCV and New Control System

Quote:
Originally Posted by comphappy View Post
No it really it not, from what I have been experimenting with for the last 3 months it has been the hard way to program robots. I am finding while signal processing will be a snap and perhaps the vision stuff as well. Effective drive code that may be oh 300 lines of straightforward C is turning into a convoluted mess of lines and VIs. Just creating a toggle variable (need a 1 and then 0 to do a ~) in C is a few simple lines, just try it in Labview it is a mess.
Heh not my original intention, but I do understand what you mean. Changing programming paradigms can be an unsettling undertaking. Any language that can automatically implement parallelism without me having to do anything gets some nice remarks in my book though. The overall theme is you trade detailed control for prebuild high-level functionality; same transform that's been going on since compilers were first invented. To each his/her own. Good luck with your learning.

--Ryan
__________________
FRC 2046, 2007-2008, Student member
FRC 1708, 2009-2012, College mentor; 2013-2014, Mentor
FRC 766, 2015-, Mentor
Reply With Quote
  #3   Spotlight this post!  
Unread 08-10-2008, 08:40
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,748
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: OpenCV and New Control System

Quote:
Originally Posted by comphappy View Post
Just creating a toggle variable (need a 1 and then 0 to do a ~) in C is a few simple lines, just try it in Labview it is a mess.

While I am training the rest of the underclassmen who are doing programming labview as it connected with the NXT and RXT stuff that they are already learning, I think I might just be writing this years code in C.

While I am amazed at what LabView can do (really I am), I am also shocked at what it does inefficiently.
This isn't the appropriate thread, but if you want to discuss other ways of doing things in LV, I'm game. It will be a learning experience for many if you are willing to pose the questions.

But I don't really know what the issue is with the toggle variable. I think you just want a shift register with a negate, so that each loop iteration produces the opposite of the last iteration. You can also do this with a feedback node.

It really shouldn't take lots of messy C or LV code once you have the hang of the languages. I'm happy to answer LV questions here or on other forums.

Greg McKaskle
Reply With Quote
  #4   Spotlight this post!  
Unread 08-10-2008, 13:27
Kevin Sevcik's Avatar
Kevin Sevcik Kevin Sevcik is offline
(Insert witty comment here)
FRC #0057 (The Leopards)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Houston, Texas
Posts: 3,587
Kevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond repute
Send a message via AIM to Kevin Sevcik Send a message via Yahoo to Kevin Sevcik
Re: OpenCV and New Control System

Quote:
Originally Posted by comphappy View Post
Just creating a toggle variable (need a 1 and then 0 to do a ~) in C is a few simple lines, just try it in Labview it is a mess.
I'm assuming this means you wanted to toggle some value from 0 to 1 to 0 only when some other value changes from 1 to 0. If so, the LV code is pretty easy. See the attached picture and VI. I don't think LabView is necessarily less efficient than C++, but it requires a very different mindset to get efficiency out of it.
Attached Thumbnails
Click image for larger version

Name:	Toggle.JPG
Views:	179
Size:	12.4 KB
ID:	6875  
Attached Files
File Type: vi Toggle.vi (8.2 KB, 50 views)
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter
Reply With Quote
  #5   Spotlight this post!  
Unread 08-10-2008, 19:37
comphappy comphappy is offline
Registered User
AKA: Brennan Ashton
FRC #2605 (A2D_16)
Team Role: Leadership
 
Join Date: Jan 2008
Rookie Year: 2008
Location: Bellingham, WA
Posts: 157
comphappy is a splendid one to beholdcomphappy is a splendid one to beholdcomphappy is a splendid one to beholdcomphappy is a splendid one to beholdcomphappy is a splendid one to beholdcomphappy is a splendid one to beholdcomphappy is a splendid one to behold
Send a message via AIM to comphappy
Re: OpenCV and New Control System

it was not my intention to hijack the thread so sorry for that, some of the words clicked and off I went.

That VI was similar to what I came up with in the end, but it is still much larger then the c code for the same thing. I am just finding that I do a lot more of this type of low level variable manipulation stuff in robotics then I do signal processing, but that my change we will see.
__________________
A2D Solving the Imaginary Error Function...
Reply With Quote
  #6   Spotlight this post!  
Unread 08-10-2008, 23:09
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,748
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: OpenCV and New Control System

Not to continue the hijack, but the reason that the signal processing may seem cleaner implementation is that they often flip the state storage from the outer diagram into the subVI. As an example, if a filter has state, it is possible to require the caller to be responsible for the state, pass it in, update it, pass it back out, etc. This is totally legal, but since it spills out on the the top diagram, it just ends up looking messier. It also exposes the important state info in a way that it can be mucked with unnecessarily.

To tidy things up a bit, the state is kept within the subVI, which is usually made reentrant so that the states from different calls don't mix. So, to apply this idea to the Boolean toggle, you make a subVI from the whole thing, one Boolean in, one Boolean out. You have to figure out a name that represents it well, and you end up with something that works well in more complicated diagrams. The only subtle difficulty to this is the initialization.

Greg McKaskle
Reply With Quote
  #7   Spotlight this post!  
Unread 09-10-2008, 09:27
JBotAlan's Avatar
JBotAlan JBotAlan is offline
Forever chasing the 'bot around
AKA: Jacob Rau
FRC #5263
Team Role: Mentor
 
Join Date: Sep 2004
Rookie Year: 2004
Location: Riverview, MI
Posts: 723
JBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond repute
Send a message via AIM to JBotAlan Send a message via Yahoo to JBotAlan
Re: OpenCV and New Control System

Continuing to threadjack...

I really have been trying my hardest at this LabVIEW stuff, but I can't seem to get even the simplest code working. I am not at my laptop at the moment, so I can't post screenshots, but I tried to make a timed loop add 1 to a variable each second and output it to an indicator. What, exactly, am I doing wrong? "i" gives me the increment; that's working fine. But this isn't.

I could go through all the tutorials in the world and still be in the dark...

JBot

EDIT: Oh. If I put the indicator inside the loop, things work. But why doesn't that value get sent out the shift register? Does it when the loop stops?
Attached Thumbnails
Click image for larger version

Name:	test vi.PNG
Views:	140
Size:	7.1 KB
ID:	6880  
__________________
Aren't signatures a bit outdated?
Reply With Quote
  #8   Spotlight this post!  
Unread 09-10-2008, 11:48
Russ Beavis Russ Beavis is offline
Registered User
no team
 
Join Date: Nov 2005
Location: Manchester, NH - DEKA R&D Corp.
Posts: 341
Russ Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond repute
Re: OpenCV and New Control System

The output isn't updated until the timed loop finishes execution. To help visualize the data flow, I would strongly encourage you to use the "highlight execution" debugging mode (the little lightbulb on the toolbar) to "see" how the program is executed.

"Highlight Execution" mode and wire probing (including the use of graphs) are, IMHO, a VERY useful set of debugging features in LabVIEW. You gotta check 'em out.

Russ
Reply With Quote
  #9   Spotlight this post!  
Unread 10-10-2008, 09:42
Jon236's Avatar
Jon236 Jon236 is offline
Registered User
AKA: Jon Mittelman
FRC #2648 (Infinite Loop)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2000
Location: Windsor, Maine
Posts: 741
Jon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond reputeJon236 has a reputation beyond repute
Re: Basic Labview Programming Questions

After asking Greg the question, I found this on the NI site:

http://zone.ni.com/reference/en-XX/h...pts/checklist/

It is very useful and I suggest the team programmers go over it thoroughly!
__________________
Jon Mittelman

Senior Judge Advisor New England & Israel 2014-2015
Infinite Loop Mentor 2011-2015
TechnoTicks Mentor 2000-2011
Championship Chairman's Award 2009 Team236 TechnoTicks
Judge 2010-2015 Championships
Senior Judge Advisor New England District Championship 2014-2015
Judge Advisor Tel Aviv Regional 2007-2015
Judge Advisor Pine Tree Regional 2013
Maine Regional Planning Committee
New England District Planning Committee
Lead Inspector Microsoft Tel Aviv Regional 2006-2008
Judge & Lead Inspector GM/Technion Tel Aviv Regional 2006
Judge UTC Hartford Regional 2006
Reply With Quote
  #10   Spotlight this post!  
Unread 10-10-2008, 23:47
PhilBot's Avatar
PhilBot PhilBot is offline
Get a life? This IS my life!
AKA: Phil Malone
FRC #1629 (GaCo: The Garrett Coalition)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Maryland
Posts: 744
PhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond repute
Re: Basic Labview Programming Questions

The best 30 minutes I ever spent was going trough JUST the video presentations on this page.

Spend 30 minutes to save yourself 30 hours.

You'll not remember it all, but you'll know where to go back to refresh your memory.

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

That was untill their site went down tonight for some unknown reason

Phil.
__________________
Phil Malone
Garrett Engineering And Robotics Society (GEARS) founder.
http://www.GEARSinc.org

FRC1629 Mentor, FTC2818 Coach, FTC4240 Mentor, FLL NeXTGEN Mentor
Reply With Quote
  #11   Spotlight this post!  
Unread 12-10-2008, 14:03
tivomatic's Avatar
tivomatic tivomatic is offline
Registered User
FRC #2262
Team Role: Mentor
 
Join Date: Sep 2008
Rookie Year: 2007
Location: Massachusetts
Posts: 2
tivomatic is an unknown quantity at this point
Re: Basic Labview Programming Questions

I am trying to write a Labview vi that takes a one dimensional numerical array, for example A= 5,4,3,2,1, and sorts the values in ascending order. We do not want to use the sort array operator since the whole purpose is to practice using labview. Although I can write this no problem using Basic, I am having trouble in Labview. . I have attached the vi.

Thanks.
Attached Files
File Type: vi Sorting arrays.vi (10.4 KB, 80 views)
Reply With Quote
  #12   Spotlight this post!  
Unread 12-10-2008, 15:21
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,557
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: Basic Labview Programming Questions

Quote:
Originally Posted by tivomatic View Post
I am trying to write a Labview vi that takes a one dimensional numerical array, for example A= 5,4,3,2,1, and sorts the values in ascending order. We do not want to use the sort array operator since the whole purpose is to practice using labview. Although I can write this no problem using Basic, I am having trouble in Labview. . I have attached the vi.

Thanks.
I've attached a version that does what I think you want. The main thing you needed was a shift register (or feedback node) to take your changed array and feed it back so it could be operated on. The way you had it, each loop it was always operating on the original array. I must admit that this has been the thing I've messed up the most in LabVIEW.

You'll need another loop of some type to finish sorting. You can also use the array size VI for the input to the count terminal input of the for loop.
Attached Files
File Type: vi Sorting arrays.vi (11.2 KB, 108 views)

Last edited by Joe Ross : 12-10-2008 at 15:24.
Reply With Quote
  #13   Spotlight this post!  
Unread 13-10-2008, 13:25
BitTwiddler's Avatar
BitTwiddler BitTwiddler is offline
electronics/programming mentor
AKA: Mr Tanguay
FRC #1726 (N.E.R.D.S.)
Team Role: Mentor
 
Join Date: Oct 2008
Rookie Year: 2006
Location: Sierra Vista, AZ
Posts: 240
BitTwiddler is on a distinguished road
Re: Basic Labview Programming Questions

Quote:
Originally Posted by Joe Ross View Post
I've attached a version that does what I think you want. The main thing you needed was a shift register (or feedback node) to take your changed array and feed it back so it could be operated on. The way you had it, each loop it was always operating on the original array. I must admit that this has been the thing I've messed up the most in LabVIEW.

You'll need another loop of some type to finish sorting. You can also use the array size VI for the input to the count terminal input of the for loop.
Taking Mr. Ross' vi a bit further, I've modified it to swap array elements without overwriting the ith array element. Still needs another loop to control the number of passes through the array in order to propagate all of the changes each pass makes.
Attached Files
File Type: vi Sorting arrays.vi (13.2 KB, 93 views)
Reply With Quote
  #14   Spotlight this post!  
Unread 13-10-2008, 14:24
Kevin Sevcik's Avatar
Kevin Sevcik Kevin Sevcik is offline
(Insert witty comment here)
FRC #0057 (The Leopards)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Houston, Texas
Posts: 3,587
Kevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond repute
Send a message via AIM to Kevin Sevcik Send a message via Yahoo to Kevin Sevcik
Re: Basic Labview Programming Questions

Well that last VI is mostly correct, aside from either a second FOR loop to run it n-1 times, or a while loop that will stop if it didn't make any swaps in the last run of that inner FOR loop... But seeing Bubble Sort implemented in Labview seems very very wrong to me. There's a reason NI has VIs like this already made, after all.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter
Reply With Quote
  #15   Spotlight this post!  
Unread 13-10-2008, 14:47
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Basic Labview Programming Questions

Quote:
Originally Posted by Kevin Sevcik View Post
But seeing Bubble Sort implemented in Labview seems very very wrong to me.
I enthusiastically agree. Bubble Sort is a highly procedural algorithm, something which LabVIEW does only grudgingly. I wonder if a Partition Sort would more closely align with LabVIEW's data-flow nature.

But I think sorting is the kind of operation that should be implemented by people having deep knowledge of the runtime environment, and not used as an exercise in learning how to use a data-driven programming language.
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
A few Labview questions Japper NI LabVIEW 14 09-09-2008 20:41
A few basic EasyC Pro questions Joe G. Programming 5 11-03-2008 21:18
Some Basic Questions... bglass Motors 5 02-07-2007 21:53
BASIC programming John Gutmann Programming 3 17-05-2005 12:15
Very Basic Programming Question kewlkid382 Chit-Chat 5 18-01-2003 11:11


All times are GMT -5. The time now is 08:47.

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