LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sequence structure replacement


@idjuven1 wrote:

we have a VI with lots of sequence structures in a state machine(enclosed).

is it possible to replace these with event structures to make it more efficient?


That question makes no sense. Event structures are not functionally related to sequence structures and have a completely different purpose. You cannot substitute one for the other.

 

Now, if you want to re-architect the entire code from scratch, that's a different questions. Does the current code work correctly?

 

If you say "event structures" (plural!) that raises a lot or red flags, sirens, and flashing lights. Using more than one event structure on the same diagram is not something a beginner should even try (well, I do it all the time, but you need to really know what you are doing :o).

0 Kudos
Message 21 of 25
(647 Views)

Thanks.. I now understand it is a bad question..

 

my real question: is there a better way to rewrite it.. I have tested it.. it seems that it is working properly.

 

0 Kudos
Message 22 of 25
(643 Views)

Here's a literal cleanup (no real changes in functionality) that could give you some ideas. (there could be bugs, of course)

 

(All you state enums should be typedefs, not shown. You also had several race conditions.)

Message 23 of 25
(629 Views)

@idjuven1 wrote:

I have tested it.. it seems that it is working properly.


 It 'works' in that it successfully tells the computer what you want it to do. Good software should work for you (or other programmers), not just for the computer.

 

You've tested functionality, but you haven't tested how it will handle changes, additional features. In other words, modularity, maintainability, etc. If it stays this small (which I doubt), you can take that change and leave it like it is. You wouldn't be the first. And in all honesty, if it really stays this small, it won't hurt anybody. But if you think this program will grow, or if you intent to make bigger programs in the future, there is room for improvement. You could even decide to apply the improvements\suggestions for your next program\project.

 

We'll get you there, if you stay in long enough.

 

 

0 Kudos
Message 24 of 25
(600 Views)

Thanks so much..

 

I will be learning with you guys..

0 Kudos
Message 25 of 25
(588 Views)