TheBoss Posted June 11, 2012 Report Share Posted June 11, 2012 Hi, im looking for opinions/advice on best way to create a re-useable code for e.g test program, Automated machine programs. That can be modified for different projects, would you say using a standard State machine template would be best?? Any opinions would be greatly appreciated. Stu Quote Link to comment
0_o Posted June 11, 2012 Report Share Posted June 11, 2012 You need to clarify first what kind of testing you want to do. If it is regression testing over a framework with unit tests it is one thing (TestStand). If you want an automatic machine that tests something in the real word it is something else (HAL+MAL). If you want to virtually test SW with stubs to allow for a much faster development it is again a different task (Command design pattern in the ASL level that records input/output along UI actions). If the tests are predefined with good requirements it is one thing (unit tests) but if you need an expert to explore the functions and create tests on the fly it is something else (UI record + analyze + replay mechanism). Also, if a computer can analyze the results and you can easily write automatic analysis functions then you have an easy scenario. If you need image processing you might have a bigger problem. The logic of each of those options might contain a state machine or a command design pattern with messaging between actors and it might be a good idea to combine all the methodologies if you have the time and money. As for the logic of the state machine, if you are talking about a large scale application I would conceder integrating a parallel UI state machine + Command/Actor state machine + Messaging mechanism with a fuzzy logic rule based expert system (I didn't try it yet in LabVIEW but I'm going to soon enough). Anyhow, the first thing I would do is make sure my boss takes into consideration the need for supporting applications and frameworks that it takes long time+money to choose/develop. Good luck. Quote Link to comment
Aristos Queue Posted June 11, 2012 Report Share Posted June 11, 2012 I can't go into any details because the product is not yet released, but LabVIEW 2012 will have a significantly better answer to this question than previous versions of LabVIEW. If you're still looking for an answer to this question come August, check out the new release. 1 Quote Link to comment
Daklu Posted June 13, 2012 Report Share Posted June 13, 2012 Hi, im looking for opinions/advice on best way to create a re-useable code for e.g test program, Automated machine programs. That can be modified for different projects, would you say using a standard State machine template would be best?? Any opinions would be greatly appreciated. Stu Your question is far too broad. It's a bit like asking, "I need flexible transportation. Should I get a skateboard?" There are dozens of additional details we need to know before we can help you decide if a skateboard is a good solution for you. It could be a great solution for a teenager living in suburbia. It's a much less desirable solution if you need to do grocery shopping or had a leg amputated. In the same way there are dozens of additional details about your specific application we'd need to know about before we can suggest an architecture. 0_o listed some of them. You say you want "reusable code that can be modified for different projects." How different will the projects be? What elements will stay the same and what elements will change? Are you working in a lab environment where each project is a temporary setup and tweaking code is part of the discovery process, or a production environment where code needs to be extremely stable and software releases are significant events? The nature of your question leads me to believe you don't have a lot of experience designing software. (I see you've used Labview off and on since 98, but writing code is not the same as designing software.) I suggest your first step to creating modular (and reusable) software is to learn how to separate the user interface from the business logic. Write your application so you could replace the entire UI without breaking any of the business logic. You can use the lessons learned from that exercise to modularize the rest of your application. To answer your question more directly (but less usefully,) I would say using a standard state machine template is best if it's the best solution for your requirements. Perhaps slightly more useful advice is this: use the state machine template only if you are designing your application (or that part of your application) as a state machine. As an aside, I wouldn't consider any of the bundled templates an "architecture." They are implementation templates, not architectural templates. An architectural template would be a LV Project prepopulated with tens or hundreds of vis implementing the architecture of choice. 1 Quote Link to comment
TheBoss Posted June 17, 2012 Author Report Share Posted June 17, 2012 Your question is far too broad. It's a bit like asking, "I need flexible transportation. Should I get a skateboard?" There are dozens of additional details we need to know before we can help you decide if a skateboard is a good solution for you. It could be a great solution for a teenager living in suburbia. It's a much less desirable solution if you need to do grocery shopping or had a leg amputated. In the same way there are dozens of additional details about your specific application we'd need to know about before we can suggest an architecture. 0_o listed some of them. You say you want "reusable code that can be modified for different projects." How different will the projects be? What elements will stay the same and what elements will change? Are you working in a lab environment where each project is a temporary setup and tweaking code is part of the discovery process, or a production environment where code needs to be extremely stable and software releases are significant events? The nature of your question leads me to believe you don't have a lot of experience designing software. (I see you've used Labview off and on since 98, but writing code is not the same as designing software.) I suggest your first step to creating modular (and reusable) software is to learn how to separate the user interface from the business logic. Write your application so you could replace the entire UI without breaking any of the business logic. You can use the lessons learned from that exercise to modularize the rest of your application. To answer your question more directly (but less usefully,) I would say using a standard state machine template is best if it's the best solution for your requirements. Perhaps slightly more useful advice is this: use the state machine template only if you are designing your application (or that part of your application) as a state machine. As an aside, I wouldn't consider any of the bundled templates an "architecture." They are implementation templates, not architectural templates. An architectural template would be a LV Project prepopulated with tens or hundreds of vis implementing the architecture of choice. Thanks for your answer, much appreciated. I have designed software for several different projects and used modular re-useable code within my project. Seems the best way to me. Think i was looking to create a "swiss army Knife" of projects. So i will take each project as it comes and evaluate each project on its own merits. Quote Link to comment
Daklu Posted June 17, 2012 Report Share Posted June 17, 2012 Think i was looking to create a "swiss army Knife" of projects. Fair enough. I know I spent some time looking for it too. I've since decided it doesn't exist and have instead focused on developing practices that facilitate easy refactoring as requirements change. 1 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.