LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Add dynamic sequences

Solved!
Go to solution

Hi everyone,

Here I am asking for help on the dynamic sequence input control. To be specific, I have 4 Boolean controls, labeled as A,B,C and D. In a cycle number N using a for loop, for example,  we may need 10 sub cycles for A and B on for 5 sec, 10 sub cycles A and C or DA for 2 sec and so on so forth. The number of the sub-cycles and sequences could be different each time. So do you have an easy way to achieve this in Labview? We have our hardware programmed with labview and used for a while for fixed recipes already, for this upgrade purpose, it would be much more convenient to keep everything in this environment.

Thanks in advance   

0 Kudos
Message 1 of 13
(3,913 Views)

I don't complete understand what you are describing.  But it sounds like what you want is a State Machine architecture.   Search the forums and LabVIEW examples.  Look at File >>  New .....   and look for a template for that.

0 Kudos
Message 2 of 13
(3,887 Views)

I wonder if you could describe how you want to input the number of cycles? It sounds like you already have working code for 'fixed recipes', which I'm guessing might involve file I/O or block diagram constants. Do you want to have a dialog or some numeric controls to set the number of subcycles and duration, for example?


GCentral
0 Kudos
Message 3 of 13
(3,881 Views)

Sorry for the confusion and thanks for your help.  Here I describe it as following:

Total Cycle : N times (through a for loop)

Sub cycle1: n1 times with A first on for 1 sec, then B on for 5 sec.

Sub cycle2: n2 times with B first on for 3 sec, then A on for 2 sec;

Sub cycyle3: n3 times with A first on for 1 sec, then C for 1 sec, then D for 10 sec.

...

The sub cycle(n) is not fixed and the Boolean sequence  could be changeable.

Hope  this time I make myself clear

Best

0 Kudos
Message 4 of 13
(3,879 Views)

How will you set those values? By dynamic, I'm guessing you mean at runtime, but you still need to set the values somehow, no?


GCentral
0 Kudos
Message 5 of 13
(3,874 Views)

I just want the time and sequence are all input as controllable 

0 Kudos
Message 6 of 13
(3,871 Views)

All of that would be part of an array control.

 

The state machine would iterate through all the steps, and iterate through each line of the arrays as you progress.

0 Kudos
Message 7 of 13
(3,862 Views)

Something like this?

 

SequenceTypedef.png


GCentral
0 Kudos
Message 8 of 13
(3,854 Views)

Thank you for your help, but I am using Labview 2013, and I cannot open your ctrl file. It seems close to what I need.  

0 Kudos
Message 9 of 13
(3,851 Views)

Anticipating that difficulty, I included a picture! There's really nothing much to it. However, here is a 2013 version for you to look at. You'll still need to write the accompanying logic (perhaps using the State Machine that RavensFan suggested).


GCentral
0 Kudos
Message 10 of 13
(3,845 Views)