10-13-2021 11:27 AM
This schematic might give you a better idea of what the project entails. You see two 'counters' connecting to two stages of MUXs. We need to somehow cycle through the select lines, which is what that program is currently doing if you run it, albeit in a clumsy way. The boolean indicators on the front panel cycle through the select lines.
10-13-2021 12:48 PM
What is supposed to happen first here? There is no way to determine that. You have multiple race conditions. Using a state machine allows you to sequence the program and readily pass data from one state to the next.
10-13-2021 01:22 PM
If I'm going to scrap the program I would like to know the general process that goes into developing a state machine, if you had to explain to a beginner the process, how would you put it?
There's a few youtube videos I watched but it still was unclear how I would go about implementing what I need using that design methodology.
10-13-2021 01:35 PM
Hi PH,
@PH196 wrote:
If I'm going to scrap the program I would like to know the general process that goes into developing a state machine, if you had to explain to a beginner the process, how would you put it?
LabVIEW comes with a huge library of example VIs and example projects!
When you create a new project you can select between several predefined templates, one of them being a statemachine!
You really should take those "Training resources" listed at the top of the LabVIEW board to know such basics…
10-14-2021 07:40 AM
With a state machine you would start out by defining the states that you program can be in. For instance your first state might be initialize. In each state you would typically have code to determine the next state (continue in current state, go to a specific state, go to an idle state, go to the exit state, etc.). A good start would be to define states from your sequence structure. Create a cluster to contain your data and pass it from state to state via a shift register. You can update the control data before entering each state and the indicators after leaving each state if necessary, or you can have a state to handle this. No local or global variables required and everything is updated in a controlled manner. Please do go through the training materials and take a look at the state machine template and then come back with specific questions.