07-21-2014 05:11 PM
I have a VI containing a case structure. Is there a way to programmatically select some cases and build a new case structure? This needs to happen at run time. I was reading about VI Scripting and I am unable to find how to copy...
07-21-2014 05:25 PM
No. You cannot change the program while it is running.
Can you tell us more about what you are trying to accomplish functionally with the program (as opposed to how you wanted to do it)? Someone can probably suggest an alternative.
State mcahine?
Lynn
07-22-2014 07:13 AM
Dynamically dispatched class VIs will also do this, especially since you can load the classes at run time.
To repeat Lynn's request: Please let us know what you are trying to do and we can probably find you a way to do it.
07-22-2014 08:37 AM
I have built a state machine for a test sequence. Product A uses, for e.g., sequence 1 through 20, product B uses sequence 1 to 5 and 10 to 15 skipping state 13. What I would like to do is, when the product is identified (by serial number), only specific cases are loaded in the case structure of the state machine for the test. Is there a way to achieve this?
Thank you.
07-22-2014 09:08 AM
Hi Les,
when you already have a state machine architecture: after you selected the test sequence you just call the states according to the test sequence…
Instead of directly linking state 15 to be executed after state 14 you need to include a function that determines the next state depending on your test sequence!
07-22-2014 09:08 AM - edited 07-22-2014 09:09 AM
Since you are already using a state machine, it is easy to control which state is ran when. So where is your problem?
Using a queue to hold your states works wonderfully in this instance. Just dequeue to get which state to go to. Enqueue all of the states you need to run before the state machine starts.
07-22-2014 09:21 AM
Maybe there is an easier way, I am just not seeing it.
I gave an example with 2 products A and B. What if I had product A through Z? The intent is to keep the FrameName of the case structure on a spec file (txt), then when the product is identified by the program, it loads the cases.
Thanks.
07-22-2014 09:27 AM - edited 07-22-2014 09:27 AM
Hi Les,
no, you don't load any cases (aka STATES) - you select them!
The test sequence determines the order of the states. That's it.
(You have to provide all needed states for all possible test sequences in your state machine, but you only execute those mentioned in the current test sequence!)
07-22-2014 09:50 AM
Do you want to test multiple devices simultaneously with different test sequences? Or do you want to run different test squences one at a time on a variety of devices?
Lynn
07-22-2014 10:35 AM
LesElec wrote:
I gave an example with 2 products A and B. What if I had product A through Z? The intent is to keep the FrameName of the case structure on a spec file (txt), then when the product is identified by the program, it loads the cases.
You read the spec file to get the states to run. That's simple. Store all of the states in an array. From there, you can use a FOR loop to sequence your states. Again, it is very simple.