LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I stop an event structure loop?

Solved!
Go to solution

I created simple VI and I would like to stop when I start collecting data. It seems like I cannot stop the run once I start acquiring data. I have attached my blockd diagram.

Thank you for your help!

0 Kudos
Message 1 of 18
(1,292 Views)

Hi GRCK,

 


@GRCK5000 wrote:

I would like to stop when I start collecting data. It seems like I cannot stop the run once I start acquiring data.


The VI exactly does what you have programmed/configured to do! (This might be different to your requirements…)

 

Did you read the LabVIEW help for the event structure?

Did you read the "Caveats" section for the event structure?

Did you understand all the items written in there?

 

One main point: the code inside an event case should be executed within a (very) short period of time. This usually prevents using loops within event cases!

One more item: did you configure the event case on your own? Do you understand all the options in the event case configuration dialog? Did you set them all to useful values? (Answer: No!)

 

What's the point of those local variables in that tiny VI???

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 18
(1,284 Views)

OK OK, I'll find a different way. Not everyone have access to the free labview course. I don't. Everyone talks about free labview course, but no one shares the link. I am learning labView using this forum and watching video, but then you have people roasting me for this. We all have different ways to learn. I personally learn by doing and if I get something wrong and you correct me. I'll not repeat the same mistake again. 

0 Kudos
Message 3 of 18
(1,278 Views)
  • Look at all the learning resources listed at the top of the forum.
  • Look at the shipping examples
  • look at the help included with LabVIEW
  • Look at the design templates
  • Search the forum.
  • Ask anything here.
  • use execution highlighting while looking at the diagram when the VI is running
0 Kudos
Message 4 of 18
(1,272 Views)

Mr. Altenbach. It seems like for some people you cannot ask anything here. They want you to be an expert or intermediate level. If you are a beginner, people wants to be rude/mean. You are an exception though. Even when someone corrects my bad block diagram, I always spend time to understand what they did and try to see what I am doing wrong. I always take note. Trust me and I can share my note. 

0 Kudos
Message 5 of 18
(1,264 Views)

Here are some quick comments:

 

  • Your event is set to lock the front panel until the event completes, so the user interactions are not seen in the inner loop. Catch 22!
  • Your inner loop spins billions of times per second. Can you think of a more reasonable rate and then place a small wait?
  • None of you local variables are needed..
  • "Your stop data loop" is an indicator, so don't make it look like a switch. In fact you don't need it. You mostly seem to use it a a scaffold for a local variable.
  • You can use the outer loop to repeat code (hint: timeout event!)
  • Is is extremely annoying to look mostly at grey or whitespace. Don't maximize the front panel and diagram so you can see both as well as the help pages you always need. Being able to only look at one thing at a time gives you tunnel vision.
  • Your "stop run" should be a button with latch action.
  • Your "acquire data" could be used as a toggle to acquire or pause data without having to stop the VI
  • etc.
Message 6 of 18
(1,249 Views)
Solution
Accepted by GRCK5000

See if this can give you some ideas:

 

altenbach_0-1648222769144.png

 

Message 7 of 18
(1,245 Views)

@GRCK5000 wrote:

Mr. Altenbach. It seems like for some people you cannot ask anything here. They want you to be an expert or intermediate level. If you are a beginner, people wants to be rude/mean. You are an exception though. Even when someone corrects my bad block diagram, I always spend time to understand what they did and try to see what I am doing wrong. I always take note. Trust me and I can share my note. 


You can ask anything here and you got a useful answer within 13 minutes!!! It was not rude. Just because it did not spoon-feed you in intricate detail does not mean it was not useful. Read it again! Very good advice!

 

You have been here for over two months progressing at a crawling pace (looking at your questions history), so obviously something did not fully click and you seem to have significant misconceptions about the magic of dataflow and LabVIEW programming in general. Once you get the hang of it, things will fall into place.

 

Problems with learning LabVIEW concepts can have many reasons:

 

  • for example if you have learned text programming before and are an expert, you might try to apply concepts that are wrong for graphical programming (In LabVIEW, "the wire is the variable", there are no "variables" in the classic sense, locals just point to front panel objects and are useful in the rare cases you need to change the value of a control, for example).
  • Another reason could be that programming is just not for you. Maybe other fields of study would be more fun. Do you really enjoy programming? Be honest!

 

0 Kudos
Message 8 of 18
(1,215 Views)

Hi GRCK,

 


@GRCK5000 wrote:

I am learning labView using this forum and watching video, but then you have people roasting me for this. We all have different ways to learn. I personally learn by doing and if I get something wrong and you correct me. I'll not repeat the same mistake again. 


Where did I "roast" you?

I just asked some questions on your code on how you created it. And I gave you hints on what you should (re)read in the LabVIEW help! Do you need more to learn LabVIEW?

 

Christian already gave you more information on where to find learning material and examples - use them!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 18
(1,204 Views)

It sounds like you're getting some help with your specific problem so I'll help you out with the links you asked about:

 

https://learn.ni.com/pages/getting-started

https://learn.ni.com/courses/labview-core-1-lesson-1

https://learn.ni.com/catalog?labels=%5B%5D&page=1&query=LabVIEW%20Core%201&values=%5B%5D

 

Some of that DOES require an active SSP but it's pretty common to have those. Here's where I got the links:

BertMcMahan_0-1648229395603.png

 

 

Also, in LabVIEW, go to Help -> Find Examples. LabVIEW ships with a boatload of examples and 99.9% of them are actually really good and helpful. I've only found a couple that didn't help and they're for some fairly specific things.

 

0 Kudos
Message 10 of 18
(1,196 Views)