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.
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.
08-17-2012 09:03 AM
Hi there,
I'm taking advice from around the forum to create a shutdown button for my VI. When the user sends the shutdown command, the loop stops all processes running and turns off all heaters. Then when this is complete it passes a shutdown variable to all loops allowing them to close. This seems to work perfectly once, but when I hit run again and test it again, it fails. If I abort the VI and restart again, the shutdown works. I can't quite figure out what the behavior is doing here.
Attached is my program, it's a little messy but everything works, and it has to be added to by someone who isn't me, so I tried to keep everything clear and seperate. If anyone's got any ideas as to what is causing this strange behavior I'd love to hear it.
Thanks,
Chris.
08-17-2012 09:23 AM
You need to read the button in the event case that handles its value change to reset the button state for next time.
08-17-2012 09:35 AM
On first call I'm turning the shutdown variable to false. I thought that would take care of it. Is that not true?
08-17-2012 10:28 AM
@Chris Johnson wrote:
On first call I'm turning the shutdown variable to false. I thought that would take care of it. Is that not true?
Your shutdown variable is a different entity to the "Shutdown PB" button, so no, that won't do the job.
08-17-2012 10:38 AM - edited 08-17-2012 10:41 AM
First of all, your event loop should look something more like this. Otherwise you won't exit the loop until another event comes through.
Secondly, I think you are writing to the wrong control here (this is in your timed loop). I have no clue what is in the subVI, but I don't think it should be looking at the Shutdown PB control. That control should be in it's event case. But here you are trying to cause the shutdown event, but you are writing to the wrong control.