12-26-2014 11:22 AM
Hello,
I'm new of this forum and I have been using Labview for 1 year. I'm realising a VI and I have encountered a problem during the development of this one. My project consists of a states machine in which each state it's made up of various sub-VI. I would like to protect the execution of my tests from accident interruptions (ie. shut down of the instruments or other reasons). I wonder if it's possible to save the current state of the states machine in order to resume the execution in a second moment.
Hope you will help me.
Regards, Giuseppe.
12-26-2014 11:38 AM
Yes. Just build that condition into your state machine. If you detect a problem, go to a state that saves that data to a file. Have the state machine detect when the problem is resolved and resume executioin from where you left off. If you need to shutdown the VI or the PC running it, have a state at the beginning upon restart that detects whether data has been saved to a file, load that data, and pick up where you left off.
12-26-2014 12:52 PM
Thanks for your reply.
My states machine have a state of Error. I have idea how to discriminate this error but i don't understand how can resume the execution from the last sub-VI of the state that has been run.
There are some example in regard?
P.S. The data generate from sub-VI are save in txt format.
12-28-2014 11:23 AM
You can't resume at the last subVI. Actually, you possibly could, but that would make things more complicated. If that is the situation, you should define your states as smaller segments. Instead of having 1 larger state that has several activities, break it up into smaller states, 1 for each activity.
12-30-2014 10:23 AM
Thanks for your reply.
I would like to ask you another question. Is it possible to access and ”read" the compiling file of the main.vi and resume a subVI by simply jumping to the corresponding line of code?
Regards, Giuseppe.
12-30-2014 10:35 AM
@argento_89 wrote:
Thanks for your reply.
I would like to ask you another question. Is it possible to access and ”read" the compiling file of the main.vi and resume a subVI by simply jumping to the corresponding line of code?
Regards, Giuseppe.
No. A compiled file (whether it is coming from LabVIEW, C, Java, or any other language) does not have a line of code. Besides, you have to have some way to save the state of the variables etc for what you are really trying to do. If you set your state machine up properly, you can start your application from a saved state.
12-30-2014 10:41 AM
12-30-2014 11:10 AM
@Dennis_Knutson wrote:
If an operator does something to an instrument during a test, the operator should be disciplined.
Let the flogging commence!
12-30-2014 11:23 AM
12-30-2014 01:25 PM
Thanks to everybody for the replies.
Dennis_Knutson ha scritto:
If an operator does something to an instrument during a test, the operator should be disciplined. The instruments should also be protected from clumsy fingers.
There aren't indisciplined operators (also if one error can be occur) and the test will be totally automatic. The principal problem could be one blackout. Given that the pick of power require by instruments could be of 20 kW, UPS solution can be too expensive (in this moment). It's this the reason of my question.
Dennis_Knutson ha scritto:
There are so many variables in trying to resume that it's just simpler to start from the beginning.
I know this, but the test will be running for many days and will be destructive for the DUT.
Thanks to everybody for have explain my doubts.
Regards, Giuseppe.