10-21-2008 05:00 PM
10-21-2008 05:24 PM
For some reason you use two event structures in the same while loop, forcing you to make them "transparent" via a timeout case. It would seem more logical to use a single events tructure with multiple cases and the "reading" done in the timeout case.
The booleans (e.g. "stop VI" and "start/stop turbo pump" should be inside their respective event frame. I assume that "stop VI is latch action, and placing it inside the frame esures that is resets when read. Having "start/stop turbo pump" outside the event frame is a disaster waiting to happen. You cannot guarantee that the small case structure receives the new value. The terminal gets read with each iteration fo the big loop and the value placed into the input tunnel of the event structure. When you fire the event, it will read the (possibly stale) boolean from the input tunnel, while the "new value" has not traveled there yet. Another option would be to tap into the "new value" event terminal. This also ensures fresh data.
Writing TRUE to the "program running" LED, needs to be done only once before the loop, and not every 50ms.
You are writing a lot of value properties after the loop has finished. Unfortunately, you don't show the label so it is impossible to tell from a picture what you are doing. If you want to reset all to default, you can do that with a single property node.
10-22-2008 02:35 PM
10-23-2008 06:29 PM
Hello,
I'm not aware of any way to reinitialize the values of only booleans or only strings, etc.. to default programmatically. You could have an initialization portion of your program like you would in text-based programming, and then wire those values in to the terminals where they should be.
Does that help at all?
Thanks,
Dan Richards
10-23-2008 07:01 PM
I would use local variables instead of vlaue properties. For correct execution order place a single-frame flat sequence around the final "stop pump" an place the locals also in it. This will postpone the reset until the big loop has finished.
Also note that one boolean FALSE is sufficient for all three, you can branch the wire.
There is no need to create three instances of the same diagram constant. 🙂