LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reinitialize Sub-vi to Defaults Within Run

Hello all,

 

I am trying to create a labview program that runs a test and when completed, asks the user if they would like to run another test.  Essentially I have a sub-vi that runs the test and is placed within a while loop where when the user says they want to run another test, the loop just continues and runs the sub-vi again.  However, I am running into the problem where my sub-vi is not reinitializing to default settings.  I have coded the sub-vi itself to initially reinitialize all values to default, however this does not seem to work.  

 

Any help would be greatly appreciated!

-Derek Spivey

0 Kudos
Message 1 of 6
(4,071 Views)

It would help if you show your code.

 

How do you reinitialize in the subVI?  How do you call the subVI again when the user wants to run another test?  There are multiple ways of doing these things and some may be more effective than others.

 

Lynn

0 Kudos
Message 2 of 6
(4,057 Views)

@djspivey wrote:

Hello all,

 

I am trying to create a labview program that runs a test and when completed, asks the user if they would like to run another test.  Essentially I have a sub-vi that runs the test and is placed within a while loop where when the user says they want to run another test, the loop just continues and runs the sub-vi again.  However, I am running into the problem where my sub-vi is not reinitializing to default settings.  I have coded the sub-vi itself to initially reinitialize all values to default, however this does not seem to work.  

 

Any help would be greatly appreciated!

-Derek Spivey


yes, make a case statement.."initialize" with your values or property node.

0 Kudos
Message 3 of 6
(4,056 Views)
  • If you are worried about indicators, configure the execution properties to "clear indicators when called".
  • If you are worried about controls, assign them to connectors and wire the desired values for each call.
  • If you are worried about data in uninitialized shift registers, initialize them.

If you still have questions, please show us some code.

0 Kudos
Message 4 of 6
(4,047 Views)

Thanks for the reply, johnsold!

 

I have attached an image of the code that I am referring to.  Pretty much, I'm trying to reinitialize the sub-vi "Smart Hound-T."  As you can see in the code, a user is asked if they want to run another test after the sub-vi has completed its run.  Located within the sub-vi, I reset the values back to default by placing a property node inside the first frame of a stacked sequence frame and have it connected to a VI Server Reference called, "This VI."  This seems to work perfectly fine when running the sub-vi by itself, but for some reason when I run it by calling from a main program, the sub-vi immediately tells me that the test is over.  Which is not correct because the test is supposed to run anywhere from 5 to 20 seconds.

 

-Derek Spivey

0 Kudos
Message 5 of 6
(4,041 Views)

Please show us more code! Your picture makes very little sense. Can you show the code of the subVI? Maybe there is a race condition somewhere.

 

(... and while you are at it, eliminate that stacked sequence! 🐵

0 Kudos
Message 6 of 6
(4,032 Views)