LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Resume the execution of VI

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.

0 Kudos
Message 1 of 11
(3,383 Views)

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.

0 Kudos
Message 2 of 11
(3,373 Views)

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.

0 Kudos
Message 3 of 11
(3,361 Views)

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.

0 Kudos
Message 4 of 11
(3,283 Views)

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.

0 Kudos
Message 5 of 11
(3,221 Views)

@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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 11
(3,216 Views)
No and even if it was, it would not be very practicable in my opinion. In the situation you mention where an instrument might be turned off, you would almost certainly need to perform some other steps to return the instrument to a known state. 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 are so many variables in trying to resume that it's just simpler to start from the beginning.
0 Kudos
Message 7 of 11
(3,212 Views)

@Dennis_Knutson wrote:
If an operator does something to an instrument during a test, the operator should be disciplined.

Let the flogging commence!


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 11
(3,204 Views)
Flogging was often way too lenient for some of the operators I've had to deal with.
0 Kudos
Message 9 of 11
(3,200 Views)

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.

0 Kudos
Message 10 of 11
(3,179 Views)