LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

User controlled sequence

Solved!
Go to solution

Hello Community,

I am quite new to LabVIEW, but I have some programming experience with Assembler and C. I am now working on a complex LabVIEW Project for the first time. Now to my Problem:

I want to create a Programm in which the user can choose between multiple functions (SubVI's) and align them in their prefered order for execution. Each function requires the user to enter some variables. The user should also be able to use the same function multiple times with different variables each time.

For example a sequence like this:
1: Function Name: Addition

    Required Variables: A,B

    Set A to 5, Set B to 6

2: Function Name: Delay

    Required Varaibels: T

    Set T to 500ms

3: Function Name: Addition

    Reqired Variables: A, B

    Set A to 6, Set B to 6

.

.

Then the Code would execude in the desired order. Each function that has an Output value that Need to be saved should be collected in a Protocoll which is shown in the end:
1: Sum: 11

2: Sum: 12 

 

All my functions are working fine on their own. The creation of a fixed sequence is also not a Problem. It would be nice if someone has an idea how to create such an interface and can Point me in the Right direction to do so.

 

Any help is highly appreciated. Thank you very much!

0 Kudos
Message 1 of 7
(2,414 Views)

@Mathimo wrote:

All my functions are working fine on their own. The creation of a fixed sequence is also not a Problem. It would be nice if someone has an idea how to create such an interface and can Point me in the Right direction to do so.

 


you need State Machines

0 Kudos
Message 2 of 7
(2,401 Views)

Thank you. Using a state machine solves the issue with the sequencing. 

But what do I have to do if I want load one state multiple times, each time with different variables? If I understand the "simple" state machine correctly I can assign variables to the states only once. What I want to do is to assign the variables directly to the state in the Queue.

0 Kudos
Message 3 of 7
(2,368 Views)
Solution
Accepted by topic author Mathimo

simple example for ideas

state.png

0 Kudos
Message 4 of 7
(2,363 Views)

Thank you! That Looks good for me!

 

0 Kudos
Message 5 of 7
(2,359 Views)

Hi Mathimo,

 

if the Artem.SPb tip works for you, please mark it as a solution.

 

Thanks,

Andrzej

0 Kudos
Message 6 of 7
(2,337 Views)

Hello, 

I finally have time to continue my Project. And another Problem occured. Artem suggested to use an Array of Clusters. This technically works. I use an enum to choose the state and multiple nummeric controls/Combo boxes and string controls to deliver the parameters. The Problem is that each Array consists of the same items but with different parameters. Some states only need 1 parameter and others 5. Because of that my guess is that an Array of clusters might be the wrong approach.

 

What I wish to happen is that if the user chooses the first function the right controls appear for that function. When he chooses the second function the Right controls for that function appear and that could be controls of differnt types and/or a different amount. 

 

I hope I was able to explain my issue. English is not my first language. 

0 Kudos
Message 7 of 7
(2,292 Views)