07-04-2007 11:01 PM
07-04-2007 11:52 PM
One way of doing it would be to make sub VI's for the step1 and step2 sections of the program.
This makes your block diagram more compact and readable
You could use an error in / error out to these sub VI's to ensure data flow direction
I recommend you read the style guide and the LabVIEW Programming Techniques - The Good, The Bad, and the Ugly from the turotials section
07-04-2007 11:56 PM
07-05-2007 11:18 PM
07-06-2007 12:54 AM
Hi,
Sequences do have there uses, one of them being to group all those items that need initialising at the start of your application.
But to have nested sequences is not a good practice.
Regards
Ray Farmer
07-06-2007 01:20 AM
Sometimes it helps to think about the really necessary steps. For example why would you need to initialize an array to empty if you assign values in the next step anyway a few milliseonds later. In this case, you can just assing the values and skip the first step. The final result will be the same. 😉
@user_1 wrote:
Suppose i have to initialise the an array to empty at a particular step of my application and then assign values to it(just an example).
07-06-2007 01:51 AM
Thank u for ur reply.
Suppose i have an array of type integer.The steps being carried out in a for loop.In the first iteration the array is having a lengthof 30 and the second iteration i am going to assign 20 numbers.If i am not emptying the array (b4 the 2nd iteration), in the second iteration also it will contain 30 elements(20 of the current iteration and the next 10 that is not being cleared off from the previous iteration,instead of containing 20 elements))
This is just an example.There may be having better methods other than this.
07-06-2007 09:43 AM
In this case (and most othere cases!), there are still no sequences needed. You would simply carry your array in a shift register and operate on it at each iteration. You would clear certain elements by replacing a subset with zeroes and repalce with data in the same way. since all operations happen on the same wire, the order of operations in strictly determined by the order you line up the operation along the array wire. No sequences needed!
Of course if you would chop up your code by shuffling the array data via e.g. local variables (breaking all natural dataflow in the process), you would need to artificially restablish execution order with sequence structures. This leads to complex and inefficient code.
The need for excessive sequences is most often an indication of poor program design overall. In >99% of all cases, there is a better way! 🙂
For some related easy reading, see also the following threads: "wire or local variable" and "Stacked Sequence Exterminator" 🙂