11-23-2011 02:49 PM
The attached JPG shows that when Case Structure 1 is TRUE, it will then make Case Structure 2 also true. Which then in turn makes the Boolean Control TRUE via its Property Value. But it does not do so.
But if I remove all of the Configuration File VIs, and then manually make Case Structure 1 TRUE, it will work then.
Why is this so?
11-23-2011 02:58 PM
First, I have no idea what you are trying to accomplish with this code. Secondly, the first case structre is not needed at all. Simply wire the result of the comparison to the Or. Your logic basically says if comparison is true retunr true else return false. Kind of pointless logic don't you think?
What is the intent of Boolean? When/how do you expect it to change? What ultimately do you want to do with this code?
11-23-2011 03:12 PM - edited 11-23-2011 03:13 PM
This is a SUB VI that once it reads a text string of INITIAL_PWR, Case Structure 1 will become TRUE, and then make Case Structure 2 TRUE.
Then once Case Structure 2 reads a blank text string, it will “Latch ON” the Boolean, thus no matter what happens in the future, Case Structure 2 will always be true.
Then when Boolean BLANK senses a TRUE , it will then send that state to the mail VI that is in a Conditional For Loop, which will cause it to stop, and continue with the main VI code.
11-23-2011 03:20 PM
At some point you will need a shift register to hold the state of the Boolean (which is a bad name BTW. You should use meaningful names for your controls and indicators). It would probably make most sense in the calling VI. You will pass in the current value and then pass out the updated value. However, as written this is overly complex and convoluted code to do what you want. It would be much more understanable to separate the two pieces of code from each other. Find your initial value first and then simply repeat the second search for the blank text.
11-23-2011 03:30 PM
Here is the main VI. It reads values from the sub vi and writes it to a CSV file. And I want to abort the write, once it reads a blank text string AFTER it has read a text string of INITIAL_PWR and not before.
Anyway, I just want to know why it works one way, and not the other. (Please read my initial question)
11-23-2011 03:40 PM
Is the image you posted earlier the Write CSV subVI you have in this image? It's a little confusing because your earlier image doesn't do any writing to a CSV file.
Note that if the earlier image is your subVI, writing to the boolean control value property node doesn't do anything useful. As soon as the subVI ends, that information is lost. The next time the subVI runs, the boolean control is going to begin running at its default value unless you have it wired to the connector pane and have some other value wired into the subVI terminal.
11-23-2011 03:41 PM
Because the value of Boolean is not maintained from call to call. It is reinitialized with every call. As I stated, you need to add a shift register to your For loop and pass out the value of Boolean. Wire that to the shift register on the right side of the loop. Booelan must be wired to your connector pane of the subVI and passed in as well using the wire from the left side of the shift register. You need to maintain state between calls and the shift register will allow you to do this.
11-23-2011 04:53 PM
Yes, I can see now my error with my logic, the Boolean would reset its self every time. So I am now using a shift register, and it now works. But I just do not understand why the Boolean Control NEVER gets changed to a TRUE state, even for just one instance even when the Property Value tells it to set itself to TRUE. It does so when I remove all Configuration File Vis.
11-23-2011 05:01 PM
Since it has has no function, maybe the compiler optimized it away?
/Y