06-22-2006 02:30 AM
06-22-2006 07:32 AM
06-22-2006 07:38 AM
Hi
I always try to find the appropriate coding style. Compared to a sequence structure or dataflow, using a SM (even for 10 steps) allows you to simply deactivate existing code without removing it. Just by simply changing the transition value. For me this is sometimes very very useful.
But of course you're right - don't use something where it doesn't make sense.
Thomas
06-22-2006 07:49 AM
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
06-22-2006 08:03 AM - edited 06-22-2006 08:03 AM
Message Edited by shoneill on 06-22-2006 03:04 PM
Message Edited by shoneill on 06-22-2006 03:04 PM
06-22-2006 08:10 AM
Titou,
I probably would not use any state maching for that situation. You state one of my main reasons being dataflow. I also believe in code reuse and state machines mostly tend to be application specific. I would separate the code into functional blocks and try to be as object oriented as possible. I would keep data flow and handle errors in individual vis. If some elaborate error handling is needed then error code may be coded. I can see situations where a state machine would be useful if are different ways of handling errors or if the ability to correct the error exists.
06-22-2006 08:16 AM
06-22-2006 08:18 AM
06-22-2006 08:21 AM - edited 06-22-2006 08:21 AM
Message Edited by shoneill on 06-22-2006 03:24 PM
06-22-2006 08:21 AM
I think we all agree that SM's are an outstanding architecture for maintainablity and scalability. However they can be overkill for some small vi's. With that said it really does not matter how this thread turns out because we all have our own style of programming. we all program the way we feel comfortable doing so. I may link error clusters and you may use a SM. The point is it gets the job done and we feel good about the job that we did. This is just about the same discussion as about local and global variables. It can go on and on. The fact is we get into a comfort zone. If your comfortable always using SM's then hey go for it, if not then don't use. we are not going to convince anybody to change if they simply do not want to no matter how much we want them to, if we could there would be no war in IRAQ.
just my 2 cents.