01-05-2011 04:00 PM
Solved! Go to Solution.
01-05-2011 04:02 PM
There is a method (invoke node): Reinitalize to default.
Felix
08-12-2011 10:33 AM
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.
08-12-2011 12:44 PM
@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.
08-12-2011 01:32 PM
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
08-12-2011 01:50 PM
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.
08-16-2011 09:58 AM
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
08-16-2011 10:06 AM
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.