12-28-2014 11:17 PM
Hi all,
We want to run for loop inside event node with 50ms delay. But when i am doing it the Labview is crashing. Please let me know if somebody did this.
Thanks in advance,
Regards,
Harish. G
12-28-2014 11:53 PM - edited 12-28-2014 11:53 PM
Which version of LabVIEW are you using? When you said its crashing, is it happening when you are trying to execute the code or trying to fire that particular event?
It would be helpful if you can attach the code (in 2011 version please).
12-29-2014 12:19 AM
It's hard to help when you give us essentially nothing to work with.
Do you want this to happen every 50ms or only after an event triggers it? Do you want it to happen once after the event or continuously after it is triggered?
When you say crashing, do you mean LabVIEW closes with a crash report? Or, how are you defining crash?
12-29-2014 12:20 AM
What are you doing inside the For loop? Do you mean the Delay as the delay inside the For loop, or the Event Timeout value? Be more specific, and post the code or tis snippet to get more help in the right direction.
12-29-2014 12:25 AM
Hi all,
I am using Labview 2012. I want to run FOR LOOP of 72 inside Event node structure with 50ms delay.
Inside for loop am calling one DLL function.
12-29-2014 12:28 AM
Try a simple VI first. Can you call that DLL a single time without issues?
12-29-2014 12:30 AM - edited 12-29-2014 12:39 AM
@harishg92 wrote:
Hi all,
We want to run for loop inside event node with 50ms delay. But when i am doing it the Labview is crashing. Please let me know if somebody did this.
Thanks in advance,
Regards,
Harish. G
You're implementing a For loop inside an event structure? (I don't know of any event "node" in which you can run a For loop)
If so, that's a bad idea because LabVIEW won't be able to process any events while waiting for your For loop to get done, which might be why its crashing.
There are tricks to accomplishing what you're trying to do without putting any for loops inside event structure. See what I have attached and if it helps. "N" is number of times you run your For loop, timeout is whatever delay you want in each loop. This can be done in many ways without adding delays in events, another way could be to fire a separate subVI using Asynchronous call (without waiting for the VI to finish) during those delays, just make sure that such subVI finishes processing within your allocated time (that's how I'd ideally implement things). That method is better because you're doing minimal work inside events structure while using wait period wisely in a separate/parallel process.
I hope that I understood you correctly and did not go off on a tangent.
-BTC
12-29-2014 12:32 AM
Hi,
I am not able to open that VI. Please send me screenshot.
12-29-2014 12:46 AM - edited 12-29-2014 12:47 AM
The above code is just to tell you how to use Event structure. Please answer natasftw's question. Also you try to attach the code/screenshot to stop us giving a wild guesses on the issue.