LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

flow control

I have three vi's. When I start any one of them, some varibles are intialized. Then I can input data as often as I like; get an output; then quit.
How do I put all three in one larger vi; be able to run them in the same way; run them multiple times; and in any order? Do I have to modify the vi's in any way in order to do this?

thanks
0 Kudos
Message 1 of 17
(4,270 Views)
Flow is determined by data flow = wires. I guess, you need to connect your indicators and controls to the connection terminals of the VIs (right click on the icon and select show connector terminals, wire to the c&i's).

Post your code, so we can help you.

Felix
0 Kudos
Message 2 of 17
(4,261 Views)
Do the three subVIs use the same input controls and output indicators or are they completely seperate?
Do you only need to run one of three at any given time or do you possbly need to run more than one concurrently?
 
It would really help if you could attach a small example so we have a better idea what you actually want to do. 🙂
Message 3 of 17
(4,259 Views)
Here is one of the three vi's. I can send the sub vi's it uses, but the program is written to run on a Mac and would need modification to run on a windows machine. The other two haven't been written yet. I may want to run some of the vi's concurrently. Hadn't thought about that. Thanks for asking.

Doug
0 Kudos
Message 4 of 17
(4,253 Views)
You should work with data flow, that means use wires instead of 'local varibles'; think about wires as that, what variables do in text-based programming (getting data from step n to step n+1).
So instead of write to the local varible and read it in the loop, just use a wire between, the same goes for the after the loop processing.

Felix
0 Kudos
Message 5 of 17
(4,243 Views)
Felix.
What does this have to do with my problem? Please read my first post.

I'm using local varibles so that I can assess them later. In fact, they may have to become global variables.
0 Kudos
Message 6 of 17
(4,240 Views)
OK, things become a bit clearer now. These subVIs are not just an algorithm, but actually have a user interface and need user interaction to complete.
 
It puzzles me that you seem to have a few indicators for return values, but yet nothing is hooked up in the connector pattern.
 
In any case (and as pointed out before elsewhere), you are completely misusing and misunderstanding local variables. A local variable is just a secondary standin for a control or indicator, so if you have a control, it makes absolutely no sense to directly wire its terminal to a local variable of itself. You are just reading the control and then writing the same values back to the same control!  A control retains its own data copy.
 
Loops like that also need a delay unless the subVI incorporates one.
 
Here's a quick cleanup attempt. Study it! 🙂
Message 7 of 17
(4,235 Views)


@exo wrote:
I may want to run some of the vi's concurrently.
I am also not quite sure why you are attaching a subVI if the problem is with the toplevel VI. In any case, use use an event structure in a loop where you lauch subVIs vi a method using VI references as needed.
Message 8 of 17
(4,229 Views)
I still have no idea, what your are wanting to do. Can you attach the subVI, please?

It really seams to me, that you try to 'transport' the data from one step to the next via those local variables. You should use wires, but I don't manage to show you a way in your code without the SubVi.
I show you my point in this vi
0 Kudos
Message 9 of 17
(4,226 Views)
Altenbach,
1. Your code failed in two ways. First, and I don't know why, it didn't access the file, just the internet. Second, the second time I run it,(i.e. not in the loop but when I start it up again, it doesn't reintialize object to blank and runs the vi instead of waiting for an imput.

2. I guessed using an event structure but have been able to impliment it. So far I haven't been able to get it to work the way I want.

3. More information. I changed the local varibles to global. I want to run get object. Then run set parameters. In set parameters, set parameters gets from the global variables information obtained in get object, gets more info from the user and then sends it on the telescope and other harware. I do not want to see the get object front panel, or even have it running. After sending the info to the hardware, there will be other vi's I need to run, like monitor the experiment. Hope this makes it clearer.


Doug
0 Kudos
Message 10 of 17
(4,224 Views)