11-16-2009 08:56 AM
Hi,
I have a task to develop a test system for a client that will thoroughly test PCBs that come from a factory. We have decided to use a PXI embedded controller, chassis, and two PXI modules, specifically a DMM, and a counter/timer.
I have created a flowchart for what the test system must do, and now i am trying to decide how the flow will be implemented. The test system will send digital control signals to a fixture PCB that will do switching in order to specify the component to be measured with either the DMM or counter/timer. The test system will sequence through several tasks including voltage, resistance, and frequency measurements. The test system will need to prompt the user to perform simple tasks and to press OK to continue the flow. It will also call executables developed by other developers to automatically program the PCBs with various firmware images. It will also communicate via a USB serial protocol to a C# application running on a Windows CE device which will aid in some of the functional testing. Finally, the test system will output an html report indicating pass or fail for each component tested.
We have decided not to use Test Stand as our test executive due to cost constraints and unfamiliarity with its use. We think that some sort of state machine can do the job, but I wanted to make a post to get some suggestions. How do I handle the user being able to press the Exit button at any time? Is a state machine good enough for everything that the test system must do? The app will interface with a USB protocol, PXI modules, digital output for control signals, will call external executables created in other languages, and will prompt the user to do simple tasks and to press OK to continue.
I created the flowcharts in Visio and they are attached.
Thanks,
Gary
11-16-2009 09:47 AM
Depeding on the timing of various activities either a single loop or duel loop state machine or queued message handler would work just fine. It does not look overly complicated from your flow chart. you can find an example of a single loop QSM by searching the examples for queued message handler or you can go to my website below for a different implementation of a single loop design, also if you search the forums or related Labview oriented websites, you can find other base implemented architectures. If you have the state chart toolkit, you can design it there as well.
The complexity of these archtitectures really depends on your labview programming experience.
11-16-2009 01:44 PM
Thanks PJS for the reply. I looked at your queued message handler project, but feel it may be a bit too complex for my experience level. I also looked at a producer/consumer architecture, but feel like a single loop state machine may be the easiest route to go for now.
The GUI of the test system will only need to illuminate LEDS (green-pass, red-fail) as each test completes and will not require an event structure to pass or queue user events to certain states. Inside each state, if there needs to be user interaction, i plan on displaying a dialog box which i hope halts all execution until the user clicks OK.
If you or anyone else have any more suggestions or forewarnings please let me know.
Thanks,
Gary
11-16-2009 05:09 PM - edited 11-16-2009 05:13 PM
A single loop structure using a QSM or SM architecture will give you the most flexibility. You did indicate that you wanted the stop button to work on demand. Well several ways to skin that cat, but for future flexibility, please consider some sort of state machine (queued or otherwise) architecture with an event handler. Use the timeout case in the event structure to continue execution while still monitoring for your stop button. That will also lead to a controlled shutdown instead of just leaving the device input(s) energized. If you go for much simplier, I promise, you will find yourself mired in bandaids.
(added later) If you get to the weekend still scratching your head, let me know, you should be able to email me from my signature. I will help put something together to start.
11-17-2009 10:56 AM
11-17-2009 11:18 AM
Since you are a beginner in LabVIEW and for everything that you have to do with external code and all. I would use TestStand. it is really not that hard to learn in it's basic form and you can use all of your external code. It also takes care of all your Pass/Fail needs and logging functions. I know that TS is kind of expensive but I think the time and money would be well spent. By the time you learned how to do everything that you need to do in LV you could have learned TS and LV at the same time.
Just my opinion,
Learning something that has all the functionality built in VS having to learn another program to which you would have to build the functionality.
I would kind of go for the first one. The learning curve is not that steep.