LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Storing Data in Excel

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.

0 Kudos
Message 11 of 15
(1,224 Views)

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. 

 

johntrich1971_0-1634146886454.png

 

 

 

 

0 Kudos
Message 12 of 15
(1,214 Views)

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.

0 Kudos
Message 13 of 15
(1,209 Views)

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 14 of 15
(1,206 Views)

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.

0 Kudos
Message 15 of 15
(1,182 Views)