01-08-2013 12:31 PM
@Bert_Hannon wrote:
I indeed forgot to implement a Wait. But what do you mean with overcomplicating things? I don't think the event structure makes it that less complicated.
1. The event structure doesn't poll (ie burn up CPU)
2. The event structure is less complicated. I totally misinterpreted your code at first glance. The extra loop was throwing me for a...loop. I see an event structure and I know immediately what is causing what.
3. The event structure is a lot more expandable.
01-08-2013 12:33 PM - edited 01-08-2013 01:15 PM
If you simply remove the inner loop and place a wait in the outer loop, you have basically the same functionality with half the number of loops and also eliminate the boolean operation. 🙂
01-08-2013 12:39 PM
It's indeed more extendable, but I'm not convinced that it's less complicated... However, that's ofcourse a subjective question. Thanks for the info.
01-08-2013 12:41 PM
But yes, I would definitely use an event structure here. However, often the new data comes from an instrument and something else is better.
In the above example with events, I would also place the array indicator to the left of the event structure so all stale data gets cleared immediately when the program is started. Else you see garbage until the firs row is added.
01-08-2013 12:41 PM
@altenbach wrote:
If you simply remove the inner loop and place a wait in the outer loop, you have basically the same functionality with half the number of loops and also eliminate the boolean operation. 🙂
I see . Thanks!
01-08-2013 12:43 PM
Can you attach that VI where you have used event structure?
01-08-2013 12:57 PM
@NapDynamite wrote:
Can you attach that VI where you have used event structure?
I actually saved that as a snippet. You can save off that png file and then drag it onto a block diagram and you will automagically have code.
01-08-2013 01:08 PM
@NapDynamite wrote:
I want 4 number of rows.
Since you also have four columns, the final size of the array is fixed and known from the start. For better memory efficiency, it would bet better to initilalize the 4x4 array from the beginning (e.g. containing all NaN) and then replace rows as you go, keeping the size constant.
(It won't really make a difference here because the array is so small, but once you operate on much larger datasets, it will be many orders of magnitude more efficient.)
01-08-2013 03:16 PM
Thanks altan. Thanks you Bert as well. You both have been really helpful.
Looking forward for more help next time