01-25-2007 09:51 AM - edited 01-25-2007 09:51 AM
Message Edited by shoneill on 01-25-2007 04:52 PM
01-25-2007 10:00 AM - edited 01-25-2007 10:00 AM
Message Edited by altenbach on 01-25-2007 08:02 AM
01-25-2007 10:13 AM - edited 01-25-2007 10:13 AM
JoeLabView a écrit:
Here's one such sub-vi within that code. Not that it's wrong... Just : WHY??? (PS: that is the entire content of the sub-vi)
Message Edited by JoeLabView on 01-25-2007 10:37 AM
Message Edité par TiTou le 01-25-2007 05:14 PM
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
01-25-2007 10:13 AM - edited 01-25-2007 10:13 AM
JoeLabView wrote:
Here's one such sub-vi within that code. Not that it's wrong... Just : WHY??? (PS: that is the entire content of the sub-vi)
Hmmm... maybe the custom subVI has a much nicer and more descriptive and intuitive icon. 😮 Maybe it has the old style icon (from a few versions back) for nostalgic reason or to avoid being completely confused by all these new style file tools.....?
Of course it could have real hidden functionality, e.g. a FP with lots of explanatory text next to the file name display that prints on completion so you have a hardcopy of what got deleted. 😉
Message Edited by altenbach on 01-25-2007 08:17 AM
01-25-2007 11:24 AM
nope.. all it does is delete a file..
Back to youe example to turn on one (exactly one) of 100 LEDs depending on some number. Picture that example. Replace the Case Structure with a Stacked Sequential Structure. 100 wires to the left. 100 wires to the right. And the vi is to initialize an array.
I've been reviewing some of my code. I saw a R-G code of my own... I'll post it with an explanation of how it came to be,.. and how easy it is to fall into this trap!!!
As Ray F mentionned earlier, we're all guilty of this at some point or other!
🙂
01-25-2007 11:49 AM - edited 01-25-2007 11:49 AM
Here is one I caught this morning of my own doing...
How did this happen? Simple... It started out that the Case Statement contained a a full (sub) vi.
From the beginning... A Case Statement was created to select one of two Spectrum Analyzers to do a "quick" measurement. Since equipment is shared, one of the two may appear as part of the setup. Later, programmed evolved and the Case Statement moved elsewhere (and duplicated). At some point, the instrument initialization routine was taken out of the sub-vi's within this particular Case Statement.
Lo & Behold.. After another mod, the sub-vi then became a simple VISA Write function (that was part of the evolution. And ther was No need to have a vi for that.). Then the same was done (at a later date) for the other SA. Most likely noticed after a switch, where the VI was no longer "suitable". So then, both cases became a simple VISA Write... Which is what you see in the picture.. Of course the code was done in a hurry, with little thinking and even less coffee!!! 😮
I can already hear the laughter! 😄
Message Edited by JoeLabView on 01-25-2007 12:50 PM
Message Edited by JoeLabView on 01-25-2007 12:54 PM
02-24-2007 03:02 PM - edited 02-24-2007 03:02 PM
Message Edited by altenbach on 02-24-2007 01:07 PM
02-24-2007 05:19 PM - edited 02-24-2007 05:19 PM
Message Edited by TonP on 02-25-2007 12:21 AM
Message Edited by TonP on 02-25-2007 12:22 AM
02-24-2007 05:38 PM - edited 02-24-2007 05:38 PM
Message Edited by altenbach on 02-24-2007 03:47 PM
03-15-2007 09:50 PM