LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Flat sequence doesn't execute sequentially

All I know is this code below works perfectly fine for me.  Therefore, there must be something wrong in one of your VIs.  My other thought is that you have another reference floating around somewhere that is resetting it.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 11 of 22
(1,358 Views)

I wrote a program, maybe similar,  you can play with. It seems the button did change before the subvi finishes.

Thank you!

 

@crossrulz wrote:

All I know is this code below works perfectly fine for me.  Therefore, there must be something wrong in one of your VIs.  My other thought is that you have another reference floating around somewhere that is resetting it.

 


 

Download All
0 Kudos
Message 12 of 22
(1,322 Views)

If you press cancel, you are changing the value of that button.

XLoop changes to zero because the subVI is called in the next iteration and quits immediately after writing the value property.

0 Kudos
Message 13 of 22
(1,318 Views)

Thanks. Sorry, I mixed the mechinical latch action, if there possible to hold the button till the subVI finishes?

 


@altenbach wrote:

If you press cancel, you are changing the value of that button.


 

0 Kudos
Message 14 of 22
(1,311 Views)

@binpersonl wrote:

Thanks. Sorry, I mixed the mechinical latch action, if there possible to hold the button till the subVI finishes? 


Holding a button is a user interaction. What do you want to happen code-wise if the button is held?

 

All this seems way to convoluted to solve a simple problem. What is the program actually supposed to do in the end?

0 Kudos
Message 15 of 22
(1,309 Views)

I want the "Cancel' button not change back so quick and wait till the subvi finished cancellation.

 

@altenbach wrote:



Holding a button is a user interaction. What do you want to happen code-wise if the button is held?

 

All this seems way to convoluted to solve a simple problem. What is the program actually supposed to do in the end?


 

0 Kudos
Message 16 of 22
(1,305 Views)

binpersonl wrote:

I want the "Cancel' button not change back so quick and wait till the subvi finished cancellation.


But it only changes when the user clicks it.  And for the subVI to stop, the user much change the value to FALSE.  It is not your writing to the property node that is doing that.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 17 of 22
(1,299 Views)

Also note that the exit button gets read in parallel to the subVI execution, thus the loop in the caller will iterate once more (calling the subVI and resetting the XLoop caunter) to read the new value before exit actually takes place.

Why are your numerics orange? They should be integers, right?

 

Again, there are probably much better ways to do all this. Why so convoluted?

0 Kudos
Message 18 of 22
(1,293 Views)

Could you change the program to a better way? When user click 'start', the loop in subvi runs and output xloop and yloop, when user click 'cancel' (can be the same or another button), the subvi finish calcellation, then the start button is back to default again.

 

Yes the numeric should be integers.

 

@altenbach wrote:

Also note that the exit button gets read in parallel to the subVI execution, thus the loop in the caller will iterate once more (calling the subVI and resetting the XLoop caunter) to read the new value before exit actually takes place.

Why are your numerics orange? They should be integers, right?

 

Again, there are probably much better ways to do all this. Why so convoluted?


 

0 Kudos
Message 19 of 22
(1,281 Views)

I don't understand why you even need a subVI? All this could be done in a very simple flat state machine. I assume this is a simplified demo of some more involved code. Can you explain what the purpose is?

0 Kudos
Message 20 of 22
(1,264 Views)