04-08-2013 12:57 PM
It is mentioned briefly in your article section on flat sequence structures, but error handling in general is a big one - not wiring error terminals, or just wiring simple error handlers in subVIs. Basic error handling can really help with troubleshooting and enforcing data flow.
Jeff Peacock
Product Support Engineer | LabVIEW R&D | National Instruments
04-08-2013 12:59 PM
Documentation. Documentation. Documentation. Guilty as charged.
04-08-2013 01:21 PM
Jeff,
I completely agree. Error handling is one of those conversations I have with many new LabVIEW users. Just using the error wires and a simple error handler, like you said, is the first stepping stone to an actual strategy.
04-08-2013 01:24 PM
Open/close functions INSIDE THE WHILE LOOP! I see this daily, and then people ask "why is it taking so long to write to my file, the VISA connection etc.
04-08-2013 01:27 PM
@for(imstuck) wrote:
Open/close functions INSIDE THE WHILE LOOP! I see this daily, and then people ask "why is it taking so long to write to my file, the VISA connection etc.
Absolutely agree, I see this all the time. Related to that - not managing loop timing correctly to avoid hogging the CPU.
Jeff Peacock
Product Support Engineer | LabVIEW R&D | National Instruments
04-08-2013 01:31 PM - edited 04-08-2013 01:32 PM
04-08-2013 01:36 PM
@PiDi wrote:
One more common mistake... My very personal memory (luckily, without the red colored text)
Generally, shift register are often misunderstood.
Yeah, I think all of us who have been using LabVIEW for more than a few years have ran into this problem, usually self-inflicting. I sure remember when I found that in my code.
04-08-2013 01:41 PM
It's funny you mention NOT using projects... I am no expert (just finished Core3) and am about 20% grayer struggling with "code re-use" vs. projects. I know C/C++, VB, etc; and design circuit boards. In those cases, I can write a nice re-usable module (say a driver). As mentioned, copy & paste in Windows is all I need to re-use. I am trying to "pull together" existing code here at the lab that is literally sitting in numerous folders across a couple different letter drives (I feel you wincing). But that's another story for now.
I am running into nightmares trying to re-use code (in projects). A simple save-as to the new location doesn't work 90% of the time because of all the sub-vi's break. Another example is a driver I downloaded for stepper motors. It consists of a few folders, and I made a nice .lvlib wrapper. I had to move this project in it's entirety to a different location, and a bomb went off, even doing the "save-as" moves.
One thinig that I feel wasn't covered well in CORE2 / CORE3 was say "implementing" or "heres how to" implement good strategies for code-reuse. I asked a question and the instructor said to save and rename everything so there aren't naming conflicts. But that seems counter-intuitive.
In another simpler example, I wrote a module (call it ModuleA) that I want to use in many different applications. ModuleA has a few subVI's. If I want to add it to new project in another location, how can do it without breaking it? On simple VI's to reuse I copy the code and paste it into another VI and give it a new name, seems like all I can do.
Anyways, sorry for the book, but a good lesson with examples and how-to's on code reuse with respect to the above (say code with many subVIs) would be great!! Worth many Kudos!!
Thanks,
Steve
04-08-2013 01:42 PM - edited 04-08-2013 01:44 PM
@PiDi wrote:
One more common mistake... My very personal memory (luckily, without the red colored text)
Generally, shift register are often misunderstood.
The following is somewhat off topic...sorry...
I actually have this as an interview question. Notice the for loop with the empty array. Gets um every time, although the clear errors and the split queue reference wire should be a hint...
04-08-2013 01:44 PM