01-24-2019 04:27 AM
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!
Solved! Go to Solution.
01-24-2019 04:42 AM
@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
01-24-2019 08:49 AM
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.
01-24-2019 09:19 AM
simple example for ideas
01-24-2019 09:34 AM
Thank you! That Looks good for me!
01-25-2019 04:49 AM - edited 01-25-2019 04:50 AM
Hi Mathimo,
if the Artem.SPb tip works for you, please mark it as a solution.
Thanks,
Andrzej
02-06-2019 08:20 AM - edited 02-06-2019 08:23 AM
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.