From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What is this function?

Solved!
Go to solution

What is it.jpg

Hi,

I am really new to LabView. I've been trying to set up a project with several VIs in it. The challenge here for me is to make the VIs happen in a certain order. For this, I've put some stacked sequences and while loops (because each VIs contain an "elapsed time". The thing here is that each VIs are also related to one same value (a control). But when the control is outside the loops, it does not work anymore. 

I think the picture above is the solution for my problem. Basically, I need to "refer" to the same control withing different frame and loops. Could this work?

And could you tell me what is this function? And how to create it?

 

Thank you very much for your help!

0 Kudos
Message 1 of 6
(2,602 Views)
Solution
Accepted by HZintern

right mouse button on the control-> Create local Variable.
The local variable can be changed to read / write mode. Also on the right mouse button

Labview 4.0, 5.0, 6.1, 8.6, 2009, 2011, 2012, 2014
If you do not know something, ask me.
0 Kudos
Message 2 of 6
(2,594 Views)

Instead of peppering the diagram with stacked sequences and local variables, do a few simple tutorials!

 

Look into a state machine architecture. Show us what you have and we will point you in the right direction.

 

(stacked sequences and local variable overuse are a hallmark or beginner code that will scale very poorly in the future).

0 Kudos
Message 3 of 6
(2,577 Views)

Thank you so much! Exactly what I needed

0 Kudos
Message 4 of 6
(2,525 Views)

Hi,

I attached the project and the diagram of how it is supposed to work.
(The diagram says "read", which is on this project simply controls.)

 

Do you really think the sequences are too much? I'm not sure if it is possible to get rid of it. If you have time to take a look, that would be great 🙂

 

Thank you!

Download All
0 Kudos
Message 5 of 6
(2,523 Views)

@Charly.-- wrote:

 

Do you really think the sequences are too much? I'm not sure if it is possible to get rid of it. If you have time to take a look, that would be great 🙂

 

Of course it's possible to get rid of sequences. I have +3000 VI's in just one project and not a single sequence structure (ok maybe one or two).

 

Do some tutorials, including OO tutorials. Learning to program OO is not more difficult then learning "normal" programming. Might as well start learning to program properly from the start .

 

Here's my philosophy. The control is an object you want to use. Put it's reference in the init of a class. Make methods that have error in and error outs (like all VI's should have). The error in\out's will force synchronised execution.

 

If you need to wait, add a timer class (could be very simple), and put them between the VI's you have.

 

No sequence structures are ever needed. During testing they are sometimes convenient, but they are never needed and very undesirable.

0 Kudos
Message 6 of 6
(2,507 Views)