01-03-2014 10:20 AM
Hi,
I am student. I would like to know how to get the counter values outside the For loop parallely while the loop runs rather that getting the finally value outside the For loop. Looking forward for answers.
Thanks,
Athira
Solved! Go to Solution.
01-03-2014 10:33 AM
Can you give a little more detail? What count? What is reading the values outside of the loop? Do you have a VI you can show us what you are trying to do?
It almost sounds like you want to use a queue, but it is hard to say without more information.
01-03-2014 10:42 AM
Hi
I am adding the SIMPLE screen shot of what i want.
Out side the loop iam getting either the final value or as an array. I want each iteration outside the loop.
thanks,
01-03-2014 10:44 AM - edited 01-03-2014 10:47 AM
You could use a notifier (since it is a single value) or a reference (with a property node) to a control that gets the value elsewhere in another VI.
If it is within the same VI, you could use a property node (right click > create > property node > value) from the control within the same VI located outside the loop.
If you promiss NOT to abuse the use of Local Variables, you could use that to only write from ONE location within the For Loop to a control outside the loop, similar to the property node mentionned earlier. (Of course, I will be struct by lightening for mentionning that and scolded by other LabVIEW coders for having a change of heart on the use of Locals.... Shivers are already crawling up my spine).
You could use a queue, but that might be an overkill, unless: the count is generated faster than it is being read elsewhere...
As crossrulz mentionned, can you describe what you will be doing with the count? Because synchronizing data (fresh / stale / etc) is very important within LabVIEW as it executes based on dataflow rather than a sequential order.
Hope this helps.
EDIT:
You have not fully provided the answer. We figured that much of your code from your description, but what is reading the value of the count? Is it in a separate loop? If not, it may only deal with the first value, which is likely 0. The proper advice depends on how you process the received data (count).
01-03-2014 10:53 AM
Hi,
I intend to read all the data of an array without loop.
01-03-2014 10:59 AM
@athiras wrote:
Hi
Out side the loop iam getting either the final value or as an array. I want each iteration outside the loop.
thanks,
This code will execute in about a few nanosecond so, as others have said already, we need to know what other code segment consumes these iteration values that seem so important to you. It is crucial to catch all of them or is it sufficient to occasionally (e.g. every 20ms) monitor the progress of this loop?
You really need to provide more detail. Thanks!
01-03-2014 11:00 AM
Please answer the questions. Simply saying you intend to read the all of the data is essentially meaningless. Why do you not read the data inside the loop? You need to provide details on what is going on in the rest of your code and why you think it's necessary to pass data from inside a for loop.
01-03-2014 11:08 AM
I know we can read values inside the loop. I just wanna know is there any way to read array elements outside the loop.
01-03-2014 11:11 AM - edited 01-03-2014 11:12 AM
You've already been told yes and you've already been told some of the different ways (notifiers, locals, reference, queue, etc.). Since the information has been provided to your simple request, can the thread be considered closed? If you want details on how to implement something, you need to provide the details on what you are doing.
01-03-2014 11:23 AM
Four people told you yes.
Suggestions were offered...
I would recommed that you experiment with one of the suggestions so that you can observe what is going on..
To learn more about LabVIEW, I suggest you try looking at some of these tutorials.