05-16-2017 05:16 AM
Dear All,
I am doing a project in which my boss requires to run different set of codes sequentially. I have implemented individual test using event based state machine (Triggered by a button as event). The requirement is to run a set of programs one after another. There should be selection in which we could select; Run test 2, then test 1 then test 3 and so on (of course automatically). I tried to demonstrate the requirement in the following diagram, hope you’ll understand my point. Can we create such an interface in labview?
Solved! Go to Solution.
05-16-2017 05:24 AM
Hi zahid,
I have implemented individual test using event based state machine (Triggered by a button as event).
Then convert your implementation to a queued message handler!
This way you can either send commands into the queue from your event structure - or by sending them "automatically" to call a sequence of commands!
05-16-2017 09:03 AM - edited 05-16-2017 09:06 AM
Here is one way to do it. Basically, you'll need two listboxes where you take items from one box and add them to the other. If the same test can be run more than once, don't remove it from the available tests. Otherwise you'll want to remove it. You may want to have a reorder feature where you can move a test routine up or down. Drag and Drop would also be a nice addition, as well as Double Click to move.
05-18-2017 05:03 AM
Dear Aputman,
Thank you for the nice idea. I have implemented listbox and created string according to serial wise tests (And saved them in FGV). Now, i need to run tests according to entered sequence. Can you guide how to implement this? I was thinking to build a case structure, but seems that it will not work. Attached is my VI for your kind review.
Regards,
Khan.
05-18-2017 08:36 AM
First of all, you'll probably want to put all of the test VIs in their own separate directory. And rather than populating the available tests with a static list, grab a list of the VIs in the directory and build an array using the VI name (or something similar). That way, if you add another test, you don't need to worry about updating the selection routine manually.
For the rest of the application, you really need to look into a proper state machine architecture. I always recommend the JKI state machine because of its flexibility. It might be a little complicated for newbies to understand at first but after using it a bit, you'll get the hang of it.
After the test routine selection is done, you want to queue up the test names into your state machine and let it run.