07-24-2007 01:32 PM
I agree with all the posters above who say that you should not be trying to get rid of wires. You wouldn't try to get rid of text in a c program, would you?
What you should do is organize your wiring using the suggestions above (such as creating subVI s, clustering your wires, etc.).
07-24-2007 02:52 PM
07-24-2007 03:08 PM
07-24-2007 03:12 PM
@Hosehead wrote:
The less extra coding, the less likely a mistake...
When you're working on a large program, it will not only be easier for someone else to see what's going on, but for you as well, when you come back a month later and wonder, why did I put that in there?...I'm not a veteran or professional though, and my brain can't handle too much
It's interesting you should bring up those points, because they are often used to prove the exact opposite - when you make a reusable subVI, you don't need to test and code it again and again. When you have functionality encapsulated in a small icon, it's much easier to understand than having a large block of code (and a subVI can and should hold documentation which you can see with the context help window). When the functionality is in a single icon, your brain does not have to handle all the unnecessary code.
Just look at the NI VIs you use and imagine what would happen if the code for those VIs was inside your main VI.
Also, try imagining a more complicated project. Let's say you had to write a relatively simple program like Notepad, Paint or Hyperterminal. Think how large a single diagram would be.
07-24-2007 03:35 PM
07-24-2007 03:39 PM - edited 07-24-2007 03:39 PM
Are you serious?!? This is how you code?!? No offense, but did you not take even a single class in computer science? I have an EE degree, so I'm not a computer science expert, but I had to take computer science as part of my curriculum. Your example is the classic example of how not to code. Your method completely disregards decades of computer science development and the whole idea behind class oriented design. The fundamental problem with your method is one of inability to scale, as tst alluded to. Other problems:
(a bunch of stuff and posted a picture that made my eyes hurt)
Message Edited by smercurio_fc on 07-24-2007 03:40 PM
07-24-2007 03:39 PM
Hi Hosehead,
Speaking as person who once wrote code like that, I have to urge you to reconcider your style.
I have customers that have paid me to re-write code like that.
Well written sub-VI's will help make your code easier to read and not harder.
A new reader of your code would have to triple-click on wires and chase them 12 screens down to see what happens to it.
If those are decorations on your diagram to seperate code portions, then those are probably candidates for sub-VI's.
Trying to help,
Ben
07-24-2007 03:42 PM - edited 07-24-2007 03:42 PM
Message Edited by S G on 07-24-2007 03:44 PM
07-24-2007 03:49 PM
07-24-2007 04:11 PM