LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event structure with value changes

Solved!
Go to solution

I did the dynamic events because I just followed the instructions in other thread but I don't understand exactly how it works. Its function is to make the user be able to stop the event, as I understood.

0 Kudos
Message 71 of 92
(1,452 Views)

Sorry about all these posts, but I'm just trying to make you think about all the coding have done so far.

 

I think you need to take a step back and think for just a second or 2 about what your vi's are doing. 

Or else, try to take the tutorial again, it will probably give you some new ideas.

0 Kudos
Message 72 of 92
(1,451 Views)

I think I should stop the loop in my sub vi to make my main vi keep flowing.

0 Kudos
Message 73 of 92
(1,448 Views)

@Bombbooo wrote:
... You can be my labview tutor.)

Thanks for the kind words, but I already have 2 "students" in my company.

 


@Bombbooo wrote:
I did the dynamic events because I just followed the instructions in other thread but I don't understand exactly how it works. Its function is to make the user be able to stop the event, as I understood.

What other thread ?

If you don't understand how it works, you need to look it up or ask before using it.

 

The only think that can make the Event structure in your subvi run some code, is if one of the controls change value by the user. So the user needs to see the Front panel to be able to change a controls value.

That is how you have made it now.

 

But is there a reason for having the while loop and the Event structure in the sub vi in the first place ?

 

0 Kudos
Message 74 of 92
(1,447 Views)

I think "no". Not necessary to have a while loop at the first place.

 

What about the dynamic event stuffs there?

 

0 Kudos
Message 75 of 92
(1,445 Views)
I think my program is wrong. It's not what I want. I want the values to change when the unit is adjusted before clicking "run" button. Oh God!!! Because I want to limit the user to have only one unit in each measurement saved in the file, as you can see in my vi, there are the units at the beginning. God damn!! 😞
0 Kudos
Message 76 of 92
(1,447 Views)
I think my program is wrong. It's not what I want. I want the values to change when the unit is adjusted before clicking "run" button. Oh God!!! Because I want to limit the user to have only one unit in each measurement saved in the file, as you can see in my vi, there are the units at the beginning. God damn!! 😞
0 Kudos
Message 77 of 92
(1,446 Views)

Don't worry. You'll get there.

0 Kudos
Message 78 of 92
(1,431 Views)

Well....

I'll cut to the chase...

 

You've learned an important lesson...

 

Unless you r-e-a-l-l-y really really know what you are doing, never use an Event Structure inside a sub-vi.

The Event Structure should be part of the main program, whereas the sub-vi's should be considered liked sub-routines or function calls in text-based languages.

 

You need to design / architecture the code.  You need to understand what it is supposed to do in your mind or on paper.  This goes for any programming language.  Once you understand how the code should be written, you can proceed to write it. 

 

Having shown us part of the story will may only get you part of the solution.  Having seen more of your code, it is more than what you described when I asked "what is your code supposed to do?"  or "Can you provide the requirements or assignment description?"  Only part of the description was offered.

 

Reading the tutorials on how to program with LabVIEW is okay to learn about LabVIEW.  You need to learn how to design software.  Maybe that's the goal of your exercise... I don't know.  But you do need to step away, process all of what you've been told and come back with a fresh view of where you need to start.  Who knows...  You may have to trash your code, refactor it, or if you are lucky salvage some of it.  But you need to understand how the flow of the program needs to behave.

 

21 more posts and we'll hit 100.  It's not that bad..  WHen we reach 300 then we'll start to wonder.. 😉

0 Kudos
Message 79 of 92
(1,426 Views)

You are so nice to answer every question of mine (sometimes my questions are stupid). Can I have byour personal chat address or email or something like that from both of you so that I can ask you personally? It looks bad to keep posting 100 replies in public

0 Kudos
Message 80 of 92
(1,406 Views)