View Single Post
  #15   Spotlight this post!  
Unread 03-02-2009, 13: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,561
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: labview comressor help!!

Quote:
Originally Posted by paulcd2000 View Post
Having done a pretty detailed run-through of the compressor code, i've decided that it's a load of rubbish. It's far easier to write your own compressor code than it is to actually use the library provided. In fact, i can see no way that the provided VIs would EVER work, but i could just be missing something. The code needed is quite simple. feed a relay and a DIO in, and then feed the DIO value to a case structure. If it's true, stop the compressor. if it's false, run the compressor in reverse (at least, that's what worked for us).
I agree that the compressor code is confusing (especially when I was looking at it as a new LabVIEW programmer). However, it does work, and there's a couple reasons it was written the way it was. While writing your own code to control the compressor is easy, it isn't easier then using the compressor VIs.

First how it works: Compressor Open spawns a new task that runs the compressor run VI. If you want to see how everything actually works, look at the compressor run VI (double click on the static VI reference in compressor open).

The reason that it works this way is so that it runs in both telop and in autonomous independent (which is also a separate task). If you chose the iterative style, it wouldn't be hard to do it in both auto and telop, however it's not as easy if you want to do a linear style programming in autonomous independent. By putting it in a separate task, you make sure it always works, regardless of the programming style of the user. Secondarily, it's a good example of how to spawn a task and do inter-task communication, which I know I appreciated.
Reply With Quote