LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Step Function Correlating to Data

Solved!
Go to solution

Hello all:

 

I am currently working on a project that looks at pressure loading a system with a syringe pump. I have a pressure transducer that reads the system pressure. I want to have a step function that increases in increments of 10 mmHg from 10 to 180 mmHg. Basically, what needs to happen is the pump should turn on when the pressure in the system is lower than that being produced by the step function. So, for example, the program will begin and the system pressure will be 0 mmHg. The first step in the step function would be at 10 mmHg, so this is compared to the acquired data of 0 mmHg initially and the pump turns on. When the system pressure reaches 10 mmHg, the pump stops and there would need to be a ~60 second delay, then the next step would be 20 mmHg. The pump would turn on until the system reaches 20 mmHg, then another ~60 second delay would occur. This would go on until a system pressure of 180 mmHg is reached. Any suggestions for how to generate such a step function and compare the function value to pressure value being acquired by the DAQ card?

 

Thank you in advance!

0 Kudos
Message 1 of 3
(2,640 Views)

Maybe it would be easier to see the VI file, so I have attached a picture of the code so far as well as the VI file. Its pretty simple at this juncture, you can see the data acquisition going on toward the bottom and at the top is the true/false loop for the syringe pump.

 

What I want is for that loop to be 'true' when the desired pressure (the step function) is greater than the pressure being read by the transducer, and false when the system pressure reaches the desired pressure. The issue is that I am unsure how to create this step function and how to make Labview compare the step function with the acquired data.

 

Any help would be greatly appreciated!

Untitled

0 Kudos
Message 2 of 3
(2,612 Views)
Solution
Accepted by topic author brjohns

Hi brjohns!

 

To create the stepped ramp ups, you could use a case structure and a local variable.   You can use an Equal? function to determine if the current transducer pressure matches the Desired Level (or step).  If both are equal, inside the true case, you can set up your 60 sec pause, then add 20 to your Desired Level to continue ramping up to the next step.   In the false case, you would just make sure the pump is still turned on to continue ramping.   The following screenshot gives an example of how this might look. 

 

Capture.PNG

0 Kudos
Message 3 of 3
(2,590 Views)