03-22-2006 02:52 PM
03-22-2006 02:58 PM
03-22-2006 03:01 PM
Thanks for the quick response! What you said makes sense. Although small, do you think there possibly could be a minute performance hit by using the shift register? Perhaps they require more "maintenance" than the tunnel (I know I am being pick here 🙂
Jason
03-22-2006 03:13 PM
No overhead that I know of...there's a place in memory allocated for that shift register, just like there's a place allocated for that tunnel. You're reading from a block of memory associated with the shift register or the tunnel at the start of the loop, and you're writing to a place in memory for the shift register or tunnel when the iteration is done. I just did some benchmarking of tunnel vs. shift register performance and saw no difference. As a convention, I pretty much always use shift registers, mainly so I never have to worry about the zero-iteration behavior of tunnels in For Loops, since I've trained myself to always use shift registers when passing data through and out of a loop.
-D
03-23-2006 07:09 AM
03-23-2006 08:25 AM
Well, you're certainly going to have more overhead. I know what you mean about the stripes - graphical programming has its advantages sometimes, but sometimes it's a pain-in-the-rear - especially when you have a queue reference and error cluster to propogate around.
What I sometimes will do, dependeng on the layout of the wiring diagram, is to just get a reference to a named queue, rather than running the reference around - it saves a lot of wiring and makes it less sloppy!
Jason
03-23-2006 11:30 AM
03-23-2006 12:13 PM
Sometimes speed is not so important. When using a state machine, obtaining data from the queue and pushing data onto the queue is a very small part of the overall program. I can certainly live with a few extra usecs. I think this is a good idea unless speed is of the utmost importance. So I wrote a small example in LV7.1 with method comparisons below the main loop. Have a look at it.
03-23-2006 12:58 PM
One of the rules mentioned in the LabVIEW Style Guide (that I have also seen mentioned in other style resources) is to *never* use local or global variables as a replacement for wiring. There are myriad reasons for this rule, including memory usage, speed, race conditions, lack of data flow, and of course, appearance.
I recommend you live with your bent error wires and stick with using wires exclusively in the afore-mentioned example.
-D
03-23-2006 02:49 PM - edited 03-23-2006 02:49 PM
Message Edited by shoneill on 03-23-200609:51 PM