prayami Posted March 28, 2007 Report Share Posted March 28, 2007 Hi.. I have made one VI. In which some portion of code I want to execute only once. For that I have made one case statement. First time case condition is true and desire code is executed. But how can I stop executing that code second time. Means second time I want to make case condition variable false. How can I do that? Thanks in advance....... Quote Link to comment
Aristos Queue Posted March 28, 2007 Report Share Posted March 28, 2007 QUOTE(prayami @ Mar 26 2007, 05:39 PM) Hi..I have made one VI. In which some portion of code I want to execute only once. For that I have made one case statement. First time case condition is true and desire code is executed. But how can I stop executing that code second time. Means second time I want to make case condition variable false. How can I do that? Thanks in advance....... Search in the palettes for the "First call?" primitive. Wire that boolean output to your case structure. That prim will return true the first time it is called, but false thereafter. If you stop the VI running and restart, the prim resets. Quote Link to comment
gleichman Posted March 28, 2007 Report Share Posted March 28, 2007 QUOTE(Aristos Queue @ Mar 26 2007, 06:22 PM) Search in the palettes for the "First call?" primitive. Wire that boolean output to your case structure. That prim will return true the first time it is called, but false thereafter. If you stop the VI running and restart, the prim resets. First call works well if you only want the case called only once during program execution, but if this is a subvi that needs to be initialized each time it is called you should use a shift register. Quote Link to comment
prayami Posted March 29, 2007 Author Report Share Posted March 29, 2007 Thanks for reply. I want to make subVI so gleichman is right. I have to make shift register. I tried to make one but as I am new to LabVIEW. I am not getting success. I know it is very basic but don't know, why I can't make it happen? Is there anybody who can send me simple subVI in which (may be using Shift Register) some portion of code can be called once even though the subVI is in the while loop when that subVI will be used. Thanks in advance....... Quote Link to comment
Aristos Queue Posted March 30, 2007 Report Share Posted March 30, 2007 QUOTE(prayami @ Mar 28 2007, 02:08 PM) Thanks in advance....... Check the Examples that ship with LV ( Help >> Find Examples... in the menus). Search for keyword "uninitialized". The only VI that is returned in the find results should be educational. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.