LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Block subdiagrams for parallel execution

Solved!
Go to solution

I'm still new to LabVIEW, so this question is very likely stupid. But I'm a little puzzled by the basics.

 

Let's have some hypothetic test setup. To begin a measurement I need to:

1. Turn on a couple of Power Supplies;

2. Turn on a temperature chamber and set a temperature);

3. While temperature is being set but strictly after turning on Power Supplies I need to do some leveling/calibration with a couple of generators and a couple of Power Sensors, and I want the commands for these equipment to be sent parallelly.

 

Well, LabVIEW is good in it, there are many structures I can use to run this sequence: Power Meters setup... then other equipment commands. I can use flat sequence. I can use nested case structures. But my question is: is there any way to just combine some subdiagrams to let them run together?

 

To be more specific: I like the "In place element structure" for its look and behavior, but the description in help leaves me confused a bit, if it's a good fit. May be there is some better structure?

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

Before discussing architectures, what sort of interface do you have to the instruments? Does it even support parallel communication?

 

No, the In Place Element would not seem appropriate and certainly the flat sequence structure would not be. You typically just use the error in/out wires to enforce execution order. Branching the error wire allows for parallel execution. You can also use a separate loop, launch an ansynchronous call, etc.

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

Most of instruments are GPIB controlled. I have also VISA-compliant USB power sensors and a couple of non VISA-compliant USB signal generators. Any pair of generator and power sensor I suppose to use can work in parallel, I believe.

 

What if I need to do something that has no Error In/Error Out terminals at the same time with something that has one? Like, for example, incrementing  attempt counter when I'm leveling the signal generator output at some frequency and power?

0 Kudos
Message 3 of 13
(3,657 Views)

GPIB does NOT support parallel operations.

 

There is always a way to enforce dataflow with wires. SubVIs can have error in/out connections added or use a single frame of a flat sequence structure.

 

We are talking in generalities here. Need code examples to get more specific.

Message 4 of 13
(3,645 Views)
Solution
Accepted by topic author Arkady_V

There are nicer ways to do this as things get more complicated but for the basics, this is what it looks like.  You can group some VI together inside a structure like below to ensure they are done together.

 

 

 

Message 5 of 13
(3,641 Views)

I think GPIB can work in parallel with non GPIB equipment, and my power sensors are USB, while generators are either GPIB or USB. Thank you, I've got the idea of error in/error out, so now I understand how to enforce the contrtoling order. Now I want to do something like this:

 

 

 

Every time I'm setting the power on the generator I'm incrementing some counter. I use the case structure to combine these operations, but it's clumsy.

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

Olivier, I thought that flat sequence structure that you suggest to use is designed primarily for the case when you have more than one frame to be executed consequentally. In case of one frame it looks weird. Why is it better than "in place element"?

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

GPIB cannot work with non-GPIB equipment.

 

I would not use a local variable. I would use a shift register/feedback node. There is no point in using a case structure with a constant wired to the selector.

0 Kudos
Message 8 of 13
(3,625 Views)

GPIB equipment can work in parallel with non-GPIB equipment. I use it this way with no problem at all.

 

Dennis, that's my question, what is to be used instead of this case structure? I don't like the way I use it, but what's the proper alternative? There is no shift register in case structure by the way.

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

We are saying two different things. You said GPIB can work with non-GPIB equipment. To me, that means you are saying you can use a GPIB controller with non-GPIB instruments. Obviously, a system with GPIB and non-GPIB instruments can exist.

 

Don't use a case statement at all. I don't see the point. There must be a while loop in your program. The shift register can go there.

0 Kudos
Message 10 of 13
(3,611 Views)