From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Resetting default values

Solved!
Go to solution

 

LabVIEW 2010
I have a dialog VI that repeatedly called by TestStand. It has a boolean control that defaults to zero but since the VI apparently stays in memory the default value does not get set again. What is a good method for re-initializing my control value?
Thanks,
jvh

 

0 Kudos
Message 1 of 8
(4,549 Views)
Solution
Accepted by jvh75021

There is a method (invoke node): Reinitalize to default.

 

Felix

0 Kudos
Message 2 of 8
(4,546 Views)

Hi,

 

I have a similar problem.  I would like to set my boolean to its default value but I want this to happen right before the program stops executing.  I have a 5 volt signal being sent to some hardware but I need that 5 volts to return to 0 volts when the program closes. 

I tried Felix's suggestion but that resets the default when the program starts to run not at the end.  Any suggestions?

 

Thanks.

0 Kudos
Message 3 of 8
(4,389 Views)

@theghost wrote:

Hi,

 

I have a similar problem.  I would like to set my boolean to its default value but I want this to happen right before the program stops executing.  I have a 5 volt signal being sent to some hardware but I need that 5 volts to return to 0 volts when the program closes. 

I tried Felix's suggestion but that resets the default when the program starts to run not at the end.  Any suggestions?

 

Thanks.


Make sure you call the method at the right time. You are probably calling it in the beginning of your code. If you want to reset before you exit make sure it executes right before you exit.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 4 of 8
(4,374 Views)

Mark,

Thank you for the suggestion.  I thought I could use a flat sequence to make sure the last thing that executed was the rest.  After trying this, I realized that it was not the boolean switch that I needed to reset it was the DAQ assistant.  I have attached a picture of my code.  The 'fire' button tells the DAQ to send a 0 or 5 volt signal.  That signal is sent to hardware that controls other things.  However after the code finishes I need the DAQ to send a 0 volt signal.  Do you have any suggestions on how to do this?

 

Thanks,

theghost

0 Kudos
Message 5 of 8
(4,367 Views)

Place a singal frame after the wire loop. Wire the boolean value to the frame (you won't actually use that value). Inside the frame send the 0 value to the device.

 

Also, if you plan on doing more programming you may want to learn how to use the DAQ calls directly and not use the express VIs.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 6 of 8
(4,359 Views)

Mark,

 

Thank you again for your suggestions and help.  I reset the DAQ a different way.  I replaced the while loop termination condition to a stop button.  I then changed the 'fire' button's operation to 'latch when pressed.'

 

You had mentioned that it would be a good idea to learn the DAQ calls directly instead of using the express VI.  Why is this method better and do you know a good place to read about them.  I had been using the book LabVIEW 8 Student Edition to teach myself LabVIEW.  This book did not go into great detail about the direct calls.

 

Thanks again,

theghost

0 Kudos
Message 7 of 8
(4,319 Views)

I am not a DAQ expert so I can't give you all the of the specifics. However, in general the Express VIs (all of them, not just the DAQ) are there to help people get something working very quickly. They are not intended nor were they designed to be the most efficient and optimal code. If I am not mistaken a good example of this is that in the DAQ Express VIs things getting initialized, opened/closed and started/stopped much more than they need to. If you use the DAQ primitives you have complete control over your application and can really optimize it for performance and efficiency. You can't really do that using Express VIs.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 8 of 8
(4,314 Views)