04-30-2015 07:42 PM
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
Solved! Go to Solution.
04-30-2015 07:55 PM
I highly recommend getting rid of the sequence structures and make a proper State Machine. It will make your life SOOOOOOOOOOOOOO much simpler.
04-30-2015 08:26 PM
05-01-2015 04:30 AM
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?
05-01-2015 06:46 AM
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).
05-01-2015 07:11 AM
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...
05-01-2015 11:10 AM
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
05-01-2015 11:35 AM
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
05-01-2015 11:46 AM