05-02-2017 12:53 PM
Need help writing a program using LakeShore 425 gauss meter.
Goal: Need to read 8 different peak (max) gauss readings and call out the MIN value of the 8.
Process: Press START button, record the max value on an array, reset the gauss meter to zero, press start again, record the max value on an array....complete 8 readings and display the MIN. Reset the meter after each reading and at the end.
05-02-2017 01:04 PM
What do you have for now?
05-02-2017 01:30 PM
05-03-2017 08:10 AM
This is what I have right now. Just added the Event Structure and didn't test yet. When I run. Start button is not working correctly and it will record 8 readings at one time. Need to press start and record, 8x
Thanks for the help.
05-03-2017 08:11 AM
I think you should look up some state machine examples, your event structure should be inside the loop
05-03-2017 08:19 AM
Hi,
I completely agree with GerdW. You should use a state-machine design pattern in this case. You can read more about it here:
http://www.ni.com/white-paper/3024/en/
In the case where you are waiting for the user to press the start button, you can move that event structure to perhaps an "Idle" case or state as we would refer to it, and return to this state after the other actions have been performed such as the data acquisition. Suggested states for this might be: Initialize, Idle (Wait for Start), Acquire, Cleanup. The beauty of this design is that you do not have to execute in any particular order (though some should be thought out such as Cleanup happens only after others) and you can repeat states until your 8 separate records are finished.
05-03-2017 12:51 PM
Thank you for the suggestions. I will look into State machine and Idle case.
Thanks