|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: OpenCV and New Control System
Quote:
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. |
|
#2
|
||||
|
||||
|
Re: OpenCV and New Control System
Quote:
--Ryan |
|
#3
|
|||
|
|||
|
Re: OpenCV and New Control System
Quote:
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 |
|
#4
|
|||||
|
|||||
|
Re: OpenCV and New Control System
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.
|
|
#5
|
|||
|
|||
|
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. |
|
#6
|
|||
|
|||
|
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 |
|
#7
|
|||||
|
|||||
|
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? |
|
#8
|
|||
|
|||
|
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 |
|
#9
|
||||
|
||||
|
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! |
|
#10
|
|||||
|
|||||
|
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. |
|
#11
|
||||
|
||||
|
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. |
|
#12
|
||||||
|
||||||
|
Re: Basic Labview Programming Questions
Quote:
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. Last edited by Joe Ross : 12-10-2008 at 15:24. |
|
#13
|
||||
|
||||
|
Re: Basic Labview Programming Questions
Quote:
|
|
#14
|
|||||
|
|||||
|
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.
|
|
#15
|
|||||
|
|||||
|
Re: Basic Labview Programming Questions
Quote:
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. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |