From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sequence restart

Solved!
Go to solution

Hi guys,

 

the concept on which im trying to gain some advice would be a tad convoluted to try explain fully through text so Ive added a vid showing the app im trying to mess with and explaining what I want to do also my code involves vernier drivers and such so i just thought this would be handier, I'll attach the code anyways in case you still want to have a gander, apologies for not having the commenting done yet I generally wait till im finished to do that

 

basically I have an overall sequence structure, frame 0 is the start of the app, then I have case structures in the next frames which will run code if certain options are checked. When the case is true this will start a sequence structure which will be a seperate test (4 in all). I want to give the user the option to restart a test if they made a ham of they're first go, so say they're doing test 3 and they decide to restart the test, programatically they will stay within the fourth sequence of the overall structure but go back to the begining of the sequence within the case structure of the 4th frame of the overall sequence structure.

 

hopefully that will make more sense after watching the vid

https://www.youtube.com/watch?v=gwrJrKE873M&feature=youtu.be

 

please disregard my silly Father Ted accent

0 Kudos
Message 1 of 9
(3,182 Views)
Solution
Accepted by topic author ecleary

I highly recommend getting rid of the sequence structures and make a proper State Machine.  It will make your life SOOOOOOOOOOOOOO much simpler.


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 2 of 9
(3,172 Views)
Starting off in the direction you are going in right now you had better pray like Father Ted too because divine intervention will be your only hope for a successful outcome.

You should also consider separating your GUI from the testcengine functionality.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 3 of 9
(3,159 Views)

Thanks for the reply 

 

Did a bit of reading and yer I can see what your talking about, if i had a state machine i would be able recall states and manipulate where i am in the sequence.  Shame I didnt know about this when i started

 

The thing that has me head scratching is that i have some local variables that i need to use, for example where im comparing both sets of data i need to take the data from the previous run and then compare it to the last run, instaed of using local variables could i use a shift register to pass the array on when required?

 

 

0 Kudos
Message 4 of 9
(3,129 Views)

ecleary wrote:

The thing that has me head scratching is that i have some local variables that i need to use, for example where im comparing both sets of data i need to take the data from the previous run and then compare it to the last run, instaed of using local variables could i use a shift register to pass the array on when required?


Absolutely!  That is what shift registers are there for.  They are also a lot more efficient than local variables (memory and time).


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 5 of 9
(3,109 Views)

While you're reading, you might want to check here. If you start from the beginning, is shows in a step-wise fashion how things can fit together. It also shows how to address some common issues -- like how do you design and build a state machine.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 6 of 9
(3,099 Views)

Thanks for the reply guys, Ive got the functionality that i was looking for working which meant spending the morning half rewriting my code but job done 🙂 so all is good with the world plus i'll prob get extra marks for using the state machine seeing as we hadn't been told about it in class 

 

nice to see that my logic with using the shift registers for passing arrays and constants throught the different states was correct 

 

mike, im registerd and the page is bookmarked, serious amount of work done there, fair dinkim as we say in the motherland.  My future is full of labview as im studying applied physics and instrumentation so i can see the site being a regular go to, so on behalf of future me thankyou 

0 Kudos
Message 7 of 9
(3,079 Views)

there is one thing that i would ask about the site mike 

 

its to do with navigation, near every post ive read so far starts with, "the last couple of post ive talked about", is there a way in which i can see a list of the posts as they were posted sequentially (i.e. from the start) so that I may work my way through them cause i can see theres alot there that wont be learnt from text books and id like to do a thorough job on the material 

0 Kudos
Message 8 of 9
(3,063 Views)
Thanks for the good words -- I take it you are an Aussie living away from home.

At the bottom of each post are links to the next and previous posts. In addition if you look in the archive section, they are listed in chronological order.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 9 of 9
(3,057 Views)