02-16-2010 09:12 AM
I am using a flat file structure to run my test sequence. Inside each is a loop to perform the test. After completion I go to the next step. If I have a failure I have to exit the loop and give the operator controll. Repeat the test, Continue or fail. I am sure my software is not the greatest. But every week I get new changes to add.
My question: If I fail a loop and ask the operator to push one of three buttons? How can I return to the loop or a setup loop? I am in the process of learning State diagrams.
Thanks
Philip
02-16-2010 09:19 AM
Philip,
you should learn about State Machine, not State Diagrams. Your code is overly complex and must be worked over again.
Some points to improve:
- Remove all global variables. Maybe you will need some locals, but those are to prevented if possible.
- Remove the sequence structure.
- Remove all unneccessary frontpanel and block diagram elements (e.g. DAQ Assistant2)
hope this helps,
Norbert
02-16-2010 10:54 AM
How difficult is it to create State machine without the module from NI? I am in the process of developing examples for the State Maching.
Thanks
Philip
02-17-2010 02:48 AM
Philip,
a State Machine is no toolkit or something similar. It is an architecture for your code, so a design pattern for building your application (or at least the module).
You can find the basic layout of several design patterns in the Templatebrowser which can be opened by selecting File >> New. In this browse, move to VI >> From Template >> Frameworks >> Design Pattern.
You will find an example for the Standard State Machine there as well.
hope this helps,
Norbert
02-17-2010 08:09 AM
Is it worth the money to buy the State Machine toolkit from NI? Cost is close to $900 dollars. It may help me speed up the process.
Thanks for your help
Philip
02-17-2010
09:33 AM
- last edited on
04-25-2025
01:06 PM
by
Content Cleaner
Philip,
there is no State Machine toolkit for LV. I think you are talking about either the Statechart Module (LV 8.x and later) or the State Diagram Toolkit (LV 7.1.1 and prior).
Well, they could save some time indeed, but they also could cost you time. This depends how fast you can adopt the mechanisms running behind the scenes of the module/toolkit.
So you have to decide for yourself it is worth trying.
Nevertheless, none of the stated module/toolkit should replace the procedure of learning about basic design patterns in LV.....
hope this helps,
Norbert
02-17-2010 09:46 AM
Thanks for the explanation. I maybe able to purchase the State Module. But the other software is out of the question at this time. I am using a 30 day demo of the State Module. I am also looking at the examples. I am in the learning process. I have restarted the VI three times. Hallway meetings on changes? GRRR This is what keeps our jobs.
Thanks
Philip
02-17-2010 12:26 PM

02-17-2010 02:23 PM
02-17-2010 02:46 PM
I am now working with State Modules. This has improved the software structure dramaticaly. My thanks to all of the help I recieved.
Thanks
Philip![]()