LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Linear mixing gradient with solenoid valves

Hello Everyone, 
I have finally come to a problem in labview that is over my head. Until now I have been making small programs using MC DAQ-USB 1208 or USB 1608 to run my programs and have gotten pretty good at reading block diagrams but still struggle with making them.

 

I am looking to control a series of solenoid valves of a proportional valve to dispense two liquids to create a linear gradient. For those of you not familiar with how a proportional valve works, if you programmed it to deliver 75% of A-solvent and 25% of B-solvent, the valves would open A-B-A-B-A-B… in a 75:25 ratio of opening times. To deliver a gradient like i am wanting, the ratio of the opening times of the various proportioning valves will change during the gradient to change the overall concentration.

 

I have done all the math which i have attached below and have included a setup of my system as well. There will be two pumps, each with a different flow rate. One pump, P2 will be used to pull the gradient from the proportional valve into a loop of known volume. once the loop is filled, a 6 port 2-way valve will be switched and using the second pump, P2, the liquid will be pushed though the outlet.

 

Below I think i have included everything that will be on the project window. There will be a series of steps with each step having time and %B as inputs (we can ignore pump flow rate because it will be a constant). Those inputs translate to the picture below to generate the slope. There are also a series of constants listed to the right that will not change throughout gradient formation. The equations of the program are listed at the bottom and if someone could assist me in getting this program off the ground that would be amazing.

 

Any questions or clarifications I would be glad to make and any assistance would greatly be appreciated. And I am runing LV2013 64-bit.

0 Kudos
Message 1 of 11
(3,759 Views)

Is there a specific question buried in this post somewhere? This forum is very good at answering technical questions, but not very useful for vague, "please help me" type posts. What are you hoping to see in a reply? Do you think someone will write your code for you? See what you can get done on your own. You might have to rewrite your code several times, but that's part of the learning process. Once you have some code written, attach it, with a more specific message about what isn't working.

 

As a start, ignore the valve control portion, and instead put indicators on the screen to show the valve state. Or you might put the valve states on a graph (1=open, 0=closed) so you can see when the valves are open relative to each other over time.

0 Kudos
Message 2 of 11
(3,736 Views)

Thank you for your reply. I will finish up with what I currently have and post the VI later tonight with what I am having problems with.

0 Kudos
Message 3 of 11
(3,730 Views)

Attached is the VI for what I have come up with for my project. I have a few questions. I have a circuit that I have attached that has a relay controled by a DO on my DAQ. I am using MC USB-1208LS. I have the VI set up where i am tracking the percent A and B along the gradient time but I am wondering how to take a snapshot of this at the duration of time/cycle (~4 seconds) and tell that to send a signal to the DO. The relay I am using is axicom fp2 d3023 and will have solenoid A open when given signal and closed when it isnt and vise versa for B. I have attached the circuit for the solenoids (already tested) and A will be in pin 2 on the relay and B in pin 4 and the 5 V signal from the DAQ is getting amplified to 12V and in pin 3. If someone could help me with how to send a signal (it would be a snapshot of the %A and that would be multiplied by the time per cycle to tell it how long to give the signal for in milliseconds. That would get repeated for the entire duration of the gradient (or total number of cycles). 

Download All
0 Kudos
Message 4 of 11
(3,566 Views)

Sorry, I'm still on LabVIEW 2012 here, so I can't open your VI. I do not understand the question you are asking, although perhaps it would be clearer if I were able to see your code.

 

Are you asking how to turn on or off the digital output? The details of your circuit seem irrelevant to the logic in LabVIEW.

0 Kudos
Message 5 of 11
(3,550 Views)

I want an ouput number, thats time dependant to be the input in sending a DO signal to a relay. Right now I have two VIs working separately but I would like to replace the numeric in the relay control with the %A output number and I'm not sure how to connect the two loops. If I put them all in one the program doesnt work anymore. attached are the two VI

0 Kudos
Message 6 of 11
(3,539 Views)

Here are the two VI i am trying to combine. Im using LV2013

Download All
0 Kudos
Message 7 of 11
(3,537 Views)

Again, I can't open your VIs (I'm on LabVIEW 2012).

 

How are you trying to connect the two loops? Why do you need two separate loops? When you try putting them in one VI, have you tried running with execution highlighting to see what happens? What do you mean by "doesn't work anymore"? Is there an error? Does your code run, but not the way you expect? Try the execution highlighting.

0 Kudos
Message 8 of 11
(3,522 Views)

There is no error. It runs, but what i am noticing is that i want the gradient portion to keep running while the relay works every cycle time. I need to have some sort of wait function on the relay portion to only take the signal from the gradient at a given time interval and I am not sure how to do that.
Kyle

0 Kudos
Message 9 of 11
(3,510 Views)

There are a couple of possibilities. One is that you do everything in a single loop that runs at a regular interval but only updates the digital output when the desired amount of time has elapsed (or, you can write to the digital output on every loop cycle, even if the value hasn't changed - it won't hurt anything). However, you should pull the digital output configuration out of the loop - you only need to do that once, before the loop starts.

 

Another possibility is that you keep it in separate loops and you pass the information from one loop to the other using a queue or notifier.

0 Kudos
Message 10 of 11
(3,495 Views)