LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using two while loops

I'm currently doing a blood pressure measurement project. I want to get both the systolic and diastolic values without having to end the VI. Is it possible to create a while loop around the diastolic part within the current loop i have to make sure that it keeps running when i stop the systolic part? If i were to create a totally new loop for the diastolic part which isn't within the current loop, do i have to use a separate DAQ assistant and would it give the same result as my previous loop? Do let me know soon.
 
Thanks
 
Regards
Shidah
0 Kudos
Message 1 of 4
(2,367 Views)

Let's start with the basics...  How many transducers are you using?  In other words, please describe how the actual pressure measurement is done.   I did something like this many years ago with a single pressure transducer.  Since you speak of the DAQ assistant, you must be using a DAQ card.  How many channels are you using on the DAQ to carry out the pressure measurements?  (a single one? two?)

There are many ways to implement a solution (with a dependency on how you are getting the signal).  It could be as simple as a single loop, or more depending on how you want to implement the solution.  For instance, you can also use a seperate vi (or sub-vi) for the systole & diastole measurements... but that depends on your answer to the top paragraph.

Sorry to ask so many questions...  by answering the questions above, you can adapt the measuring portion of the code to the physical aspect of the project.

RayR

0 Kudos
Message 2 of 4
(2,356 Views)

I'm using one pressure transducer and a single input to the DAQ which is in USB.How do i create a sub VI then?

Shidah

0 Kudos
Message 3 of 4
(2,347 Views)

Hi Shidah,

As I suspected, you are using a single transducer to a single channel.  Before we go to the creation of a sub-vi, let's consider your previous questions:

I want to get both the systolic and diastolic values without having to end the VI.

Yes, you can do that within a single loop within a main vi. 

Is it possible to create a while loop around the diastolic part within the current loop i have to make sure that it keeps running when i stop the systolic part?

This is the part I don't understand...  Why do you want to stop one part of the measurement while you are carrying out the other part?  The blood-pressure resembles somewhat a sinesuidal shape... well not exactly, but you have an upper peak (systole) and a lower valey (diastole).  When you carry out the measurement over a pulse cycle, you get both values.  So maybe I am missing something where you want to focus on half the cycle...  I don't understand this part.  Can you describe how the measurement is interpreted or why you would want to take one measurement but not the other..??

If i were to create a totally new loop for the diastolic part which isn't within the current loop, do i have to use a separate DAQ assistant and would it give the same result as my previous loop?

This will get answered as part of my previous question..

==============+====================+===============

Onto the sub-vi question.

A sub-vi can be created two ways.  One is using LV to create it, under the Edit menu, using "Create sub-vi".  I prefer the second method.

The second method is to create a vi, which has a single function.  Similar to a function (or sub-routine) in textual-based languages.  The vi is then placed into a main vi, thus we can refer to it as a sub-vi.  There is one aspect which is important in creating a sub-vi, it is the use of the connector pane which is how you wire to and from the vi (or sub-vi).  We can go into more details if needed... 

For now, I recommend concentrating on the pressure measurement aspect of your project.  A single DAQ routine should suffice, and for the time being, it could be contained within a single While Loop.  Read the DAQ and store the results to a text (ASCII) file.  You can also wire the results outside the while loop to a chart or graph.  Just take a few pulses for now and verify the results in the file as well as to the graph.  You can save to the file after the while loop as well.  And don't forget to put a stop button as well as a short delay (ie: 1 to 10ms) within the loop. 

How this will take shape will depend on your answer to the questions above.

RayR

 

Message 4 of 4
(2,318 Views)