08-13-2009 11:45 PM
08-13-2009 11:49 PM
08-14-2009 03:07 AM
Base on ur suggestion i tried using local variable and global variable but don't help. it still needs to wait for the while loop to stop before updating the variable.The rest are new to me....... will try them after some reading or u can help to elaborate the one u think easiest ...... thx.
08-14-2009 03:19 AM
Hi hito88,
when the locals "don't work", then the rest will show problems too...
You have to think in "dataflow", not in "variables". Probably your while loop is blocking the dataflow and so the updating of the indicator. Show us some code to get more/better help.
08-14-2009 03:27 AM - edited 08-14-2009 03:35 AM
Hi,
As GerdW told, you are some where blocking the data flow. I give you example to pass the data through the locals.
Use local variables to access front panel objects from more than one location in a single VI and pass data between block diagram nodes that you cannot connect with a wire.With a local variable, you can write to or read from a control or indicator on the front panel. Writing to a local variable is similar to passing data to any other terminal. However, with a local variable you can write to it even if it is a control or read from it even if it is an indicator. In effect, with a local variable, you can access a front panel object as both an input and an output.
For example, if the user interface requires users to log in, you can clear the Login and Password prompts each time a new user logs in. Use a local variable to read from the Login and Password string controls when a user logs in and to write empty strings to these controls when the user logs out.
Right-click an existing front panel object or block diagram terminal and select Create»Local Variable from the shortcut menu to create a local variable. A local variable icon for the object appears on the block diagram.
You also can select a local variable from the Functions palette and place it on the block diagram. The local variable node, shown as follows, is not yet associated with a control or indicator.
08-14-2009 04:51 AM
Thx for all the reply. Great, I did manage to extract the data at last using the variables... I can see that global variable is a memory eater..... I extracts only one 2D array of video data and my computer lags like crazy ...
From the suggestions by Ravens Fan any one of them that is "memory efficient"?
Herei also attach my vi but u will need IMAQ and IMAQ for USB.
08-14-2009 05:36 AM
What are you trying to do? Can you explain because I have none IMAQ experience. But it looks like you are doing some typical Labview beginner faults. Perhaps you should take a look at some online tutorials. Have you browsed through some Labview examples. You find Labview examples like this. Go to help in toolbar, select Find Examples, then search.
Good luck
08-14-2009 05:57 AM - edited 08-14-2009 06:04 AM
hito88,
You need to keep the indicator(for which you created local variable) in the loop and the data need the wired to the subVI. use Queues to pass the data to avoid racing conditions.
This is very good example Queue Vs Locals.
08-14-2009 06:02 AM
08-14-2009 06:09 AM
Oh, boy! I sure do hate local/global/shared variables and wish I could convey my disdain effectively. Avoid getting in the habit of using them as they're rarely necessary or appropriate. If your loop is producing data to be consumed somewhere else, you have a "Producer-Consumer" situation and would be well served by reviewing that architecture.