05-01-2015 10:29 PM
Hi everyone,
I am trying to learn how to use state machines to improve my VI, which is designed to run stress-relaxation tests on materials. I currently use a for loop with a sequence structure to account for the different levels of strain we are applying to the material, but I think a state machine could make it simpler.
The basic process is:
1st: Motor displaces according to first strain control
2nd: 2 min relaxation period with Camera firing
3rd: 17 min relaxation, no camera
4th: 1 min relaxation with camera
Then the process repeats for the 2nd, 3rd, 4th, and so on strain controls.
This may sound silly, but my big issue with state machines are the inputs. How would I link up all of my strain levels to run (as well as running less when desired), as each variation in strain includes a different value to give the motor? Ive completed a couple of the basic state machines, but they are always so different from the project I am working on.
Any advice is greatly appreciated
05-02-2015 02:11 AM
First off for some good information on designing and building stgate machines, check here and here.
Second, in terms of handing the data, I would setup all the required strain values in an array that you carry in a shift register and an initialization state extracts the first value from the array, and uses it to run the 4 or 5 states that define the test procedure. The state machine then goes back to the intialize state to get the next strain value.
This process would continue until you have used up all the strain settings in the array.
Mike...
BTW: If there are multiple parameters needed to define a test run, change the array to an array of clusters where each element contains all the data requirred for a single test run.