LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Run for loop inside event node

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

Thanks & Regards,
Harish. G.
0 Kudos
Message 1 of 9
(4,636 Views)

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).

-----

The best solution is the one you find it by yourself
0 Kudos
Message 2 of 9
(4,622 Views)

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?

0 Kudos
Message 3 of 9
(4,611 Views)

 

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.

- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 4 of 9
(4,608 Views)

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. 

Thanks & Regards,
Harish. G.
0 Kudos
Message 5 of 9
(4,601 Views)

Try a simple VI first.  Can you call that DLL a single time without issues?

0 Kudos
Message 6 of 9
(4,597 Views)

@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

 

 screen1.png

 screen2.png

 

--------------------------------------------------------

New Controls & Indicators made using vector graphics & animations? Click below for Pebbles UI


0 Kudos
Message 7 of 9
(4,588 Views)

Hi,

 

I am not able to open that VI. Please send me screenshot.

Thanks & Regards,
Harish. G.
0 Kudos
Message 8 of 9
(4,584 Views)

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.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 9 of 9
(4,561 Views)