LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with Sequential LabVIEW Program Design

Hi, I'm new to LabVIEW.

We’re trying to design a LabVIEW program that runs in a sequence as follows:

  • 5 minutes of syringe pump operation

  • 5-minute break

  • 5 minutes of O₂ injection via MFC

  • Another 5-minute break

This full cycle should repeat about 10 times.

We received individual LabVIEW programs from the equipment manufacturers, each using its own case structure and while loop. We initially tried to run them in sequence by placing the two programs side by side in the block diagram.

 

However, the result wasn’t what we expected. When we clicked the Run button, only the syringe pump program started. The MFC program didn’t run—until we clicked the close (X) button, and then it suddenly started operating on its own.

What’s causing this issue?

 

We suspect that this might be due to how the programs are structured to run in parallel rather than in sequence.

If that’s the case, is it correct to say that we need to redesign the entire flow ourselves using a unified case structure and while loop, instead of relying on the manufacturer’s individual programs?

 

Any guidance would be greatly appreciated!

Download All
0 Kudos
Message 1 of 5
(214 Views)

@janghanihani wrote:

We initially tried to run them in sequence by placing the two programs side by side in the block diagram.

!


Execution order is determined entirely by dataflow, not by position on the block diagram. If you have two independent code "islands" on the diagram, they will run in parallel.. Pressing the [X} will abort the code, and nothing else should run, I assume you don't use the "continuous run" mode.

 

while you could force execution order by using a sequence structure, there are much better ways. What you needs is a simple state machine architecture.

Message 2 of 5
(204 Views)

Thank you very much for your kind and helpful response.

We followed your advice and applied some changes, but unfortunately, the issue still persists.
We placed each software module inside a For Loop and Sequence Structure, arranged side by side. However, the same behavior continues—

the MFC program only starts operating after we manually click the close (X) button of the syringe pump program.

We are not sure what’s causing this behavior in the flow.

Could it be related to how the loops or structures are interacting?

We would greatly appreciate it if you could provide further guidance on how to resolve this issue.
Thank you again for your support.

Download All
0 Kudos
Message 3 of 5
(111 Views)

@janghanihani wrote:

Hi, I'm new to LabVIEW.

We’re trying to design a LabVIEW program that runs in a sequence as follows:

  • 5 minutes of syringe pump operation

  • 5-minute break

  • 5 minutes of O₂ injection via MFC

  • Another 5-minute break

This full cycle should repeat about 10 times.

We received individual LabVIEW programs from the equipment manufacturers, each using its own case structure and while loop.


Hello.  Let me summarize what you've outlined above.

  • You want to do "something" 10 times.  The "something" consists of the following 4 "tasks":
    • Run "Syringe Pump" for 5 minutes.
    • Do "nothing" for 5 minutes.
    • Run Oxygen injection via MFC (whatever that means) for 5 minutes.
    • Do "nothing" for 5 minutes.
  • You have code that will do the first and third tasks for you.
  • To be "consistent", you could write a third "sub-VI" that would work for the second and fourth task.

What LabVIEW structure suggests itself for "Do this 10 times"?  Put whatever you want to do "inside" this structure.

 

What LabVIEW structure lets you "choose" between three (!) alternatives in a pattern "Task 1, Task 2, Task 3, Task 1 (again)"?

 

If I were doing this, I would make Task 1, Task 2, and Task 3 separate Sub-VIs (I might even name them "Task 1", "Task 2", and "Task 3") and would make sure that the Error Line ran into each from the Lower Left and out from the Lower Right of the default 4-2-2-4 Connector Pane of the sub-VI.

 

This structure of a Loop surrounding a Case Structure that does different things each time around the Loop is sometimes called a "State Machine" (you might have heard of this term).

 

Bob Schor

0 Kudos
Message 4 of 5
(93 Views)

Thank you for your helpful and detailed response.

 

We have placed each task inside a sequence structure so that they are executed sequentially.

As I understand it, in a sequence structure, each frame should be executed one after another.

 

However, after the syringe pump injection (Task 1), the loop did not end, and as a result, the next step—a 5-minute waiting period (Task 2)—did not start.

 

How can I set up Task 1 to automatically complete after the full injection, so that the sequence can proceed to Task 2 without requiring manual termination (e.g., pressing a Quit button)?

 

If you have a moment to review my LabVIEW VI,
I would sincerely appreciate your guidance and feedback.

0 Kudos
Message 5 of 5
(72 Views)