LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Syringe Pump program

Solved!
Go to solution

Hello Everyone.

 

I am using labview to try and communicate and control New Era syringe pumps. In my code I am able to set the parameters, i.e syringe diameter, flow rate, units, etc. for 2 pumps. however my third pump will not respond to its given line of parameters. Unless I change the address in the first two lines, I am unable to set the parameters for the third pump. I can however run all three pumps. so the issue is with setting the parameters only. I have attached by code below since I am sure I might not have explained everything comprehensively or properly. If anyone has any tips, that would help me out so much.

 

Thank You In Advance

0 Kudos
Message 1 of 12
(5,134 Views)

All the subVIs (probably the LabVIEW driver) are missing from your VI so it is a little bit to tell what is going on.

 

With serial communication, you can only have 1 device per port. It means that you should have 3 serial ports to communicate with 3 syringes. Each syringe should have its own port number.

 

Sometimes LabVIEW drivers provided by manufacturers have only a limited number of ports listed (enum with COM1 to COM3 for example). You might have to go in and check how the addresses are set within the driver and modify it if necessary.

 

Finally, I would suggest that you make a very simple VI that would only check if communication works with 3 syringes at a time. If that does not work, you can troubleshoot that VI to figure out the problem. Ultimately, you can post that VI if you cannot figure out the problem.

Marc Dubois
0 Kudos
Message 2 of 12
(5,105 Views)

It's kind of a tangled mess, but are you SURE that pump 3 is actually pump 3 in your block diagram???  Send P3 is the third bit in your number.  If it's on it won't be a "3" in the case structure!

 

This is wrong if you want to operate all the pumps at the same time.  Let's say all the pumps are on at once.  This is 111 binary.  That's a 7 in decimal.

 

This would explain why you can't control pump 3.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 3 of 12
(5,089 Views)

Now, about that code...

 

I'm assuming you've programmed in other, text-based languages, so I will provide analogies.

 

Lots of duplicate code:  What happens if you find yourself constantly duplicating code in a text-based language?  You move the code into a function so you can save space, and if you have to change the way that code works, you change it only in one spot.  In LabVIEW, you make a subVI so you can us it in different places.

 

Lots of wires going in all different directions, too many bends, nothing is lined up:  Besides being unfair to my OCD issues, it just makes it difficult to read.  An analogy in a text-based language would be random indents.  The compiler doesn't care, but if your fellow coder had to work on that code and then went to strangle you in your cubicle, I'd just put my headphones on max so I wouldn't have to listen to your dying gasps.  😉

 

See all those property nodes sitting out there all lonely outside the loop?  Just because they are to the right of the WHILE loop doesn't mean they execute first!  In fact, we don't really know when they are going to execute.  All we know is they will execute exactly ONCE every time you run the VI.

 

There are lots of helpful links to training on the main page of the forum.  Plus a lot of (sometimes grumpy, but always more than willing to be helpful) people who patrol this forum.  Do the training.  Ask lots of questions.  🙂

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 12
(5,081 Views)

Thought experiment: What would happen if you could press "Send P1", "Send P2", "Go P1" and "Go P2" at the same time?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 5 of 12
(5,075 Views)

Hi Athakore

Disclosure - I make a gui program for the New Era pump family and sell it - it's called SyringePumpPro.

 

You only need a single communications port to talk to all three of your pumps. They connect in daisy chain fashion. See my FAQ on pump connectivity for diagrams of how to connect the pumps and how to set their addresses. There is a lot of info there which will help you.

 

Are all your pumps connecting and talking properly?

If your not sure - I suggest that you download my free trial - you certainly don't need to purchase anything. My software will soon tell you if your third pump is communicating correctly.

 

catch ya

timb

 

If you think I can be of help - please contact me through my website.

 

0 Kudos
Message 6 of 12
(5,053 Views)

thanks everyone for the responses I was actually able to use a bit of each suggestion to improve my code. however when I daisy chain the pumps for some reason the last two pumps do not work. I have 12 pumps in total however it does not matter which pumps are the last two in the chain, it is always the last two regardless of address or pump location, that seem to not respond.

0 Kudos
Message 7 of 12
(5,039 Views)

@Athakore wrote:

thanks everyone for the responses I was actually able to use a bit of each suggestion to improve my code. however when I daisy chain the pumps for some reason the last two pumps do not work. I have 12 pumps in total however it does not matter which pumps are the last two in the chain, it is always the last two regardless of address or pump location, that seem to not respond.


The units probably have a DIP switch setting that tells it if it is the last or only pump on the serial port or not.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 8 of 12
(5,029 Views)
Solution
Accepted by topic author Athakore

There's no dip switches anywhere. Smiley Happy

 

It's very likely you have a broken wire - if your sure that all your pumps have unique addresses. Try swapping the cable connecting the first dead pump with the cable connecting the last live pump - to computer side - I am talking about. If the last three pumps wont talk - you found your problem.

 

timb

Message 9 of 12
(5,024 Views)

 Thank You, this was in fact a similar problem to what you said. seems like the network port on one of the pumps was broken and therefore all the pumps following it in the daisy chain were not able to receive any signals or connect.

0 Kudos
Message 10 of 12
(5,008 Views)