08-13-2007 10:17 AM - edited 08-13-2007 10:17 AM
@Ravens Fan wrote:
Note also that in a lot of places you send in a wire to an indicator and branch it off to a local variable of the same indicator. That is redundant. Sending the wire to the local variable does the same thing as sending the wire to the indicator. Try to use wires instead of local variables as much as possible. ...
Exactly! Actually, the current code is much worse than you think, because you send all these strings to hidden indicators that have no other purpose or prioviding local variables. Get rid of them! All you need is a plain wire as drawn for one example in the image. Repeat for all others.
You currently get serious race conditions due to lack of dataflow. Your code cannot guarantee that the read local will be read only after the terminal has received valid data since there is no data dependency. Most likely the local variable of the string will get read well before the indicator receives valid data! A wire as shown will fully determine execution order and ensure that correct data is available in the next structure.
LabVIEW does NOT execute left to right or in any predictable manner UNLESS execution order is determined by dataflow. If you have disconnected code "islands", each can execute in any order and the order cannot be predicted.
Overall, you have way too much code. For example all code in "MPS setup loader" could be done in a few simple programming strokes instead of all these duplicate operations. You do way to many explicit operation, for example b1...b18 could be made into an array, eliminating that nightmare of connections to the subVI.. I am not sure what determines the loop rate of the big loop.
In Prg-all-sub, you have 5 sequential copies of the same code, differing only in a string. Place one instance in a FOR loop and feed it an autoindexing string array and delete the others. Now you can just update the progress indicator in the loop.
This code was clearly written by somebody pretty fluent in text based programming and it shows. You need to adapt to a labVIEW programmers way of thinking. 🙂
Message Edited by altenbach on 08-13-2007 08:19 AM
08-13-2007 05:56 PM
08-14-2007 01:17 AM
08-14-2007 01:26 AM
08-14-2007 02:29 AM
08-14-2007 08:09 AM
Hello Vishal,
Your message is completely unrelated to the thread that you posted it into. If you want a reply, repost your message in a new thread.
08-14-2007 11:42 AM
08-14-2007 12:11 PM
09-19-2022 02:38 PM
thanks so much, it was very helpful,
Best Regards,
Kaveh,