10-26-2017 09:02 AM
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
Solved! Go to Solution.
10-26-2017 10:12 AM
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.
10-26-2017 02:07 PM - edited 10-26-2017 02:28 PM
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.
10-26-2017 02:25 PM
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. 🙂
10-26-2017 02:35 PM - edited 10-26-2017 02:42 PM
Thought experiment: What would happen if you could press "Send P1", "Send P2", "Go P1" and "Go P2" at the same time?
10-27-2017 04:23 AM
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.
10-27-2017 07:32 AM
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.
10-27-2017 12:19 PM
@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.
10-27-2017 08:05 PM
There's no dip switches anywhere.
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
10-30-2017 07:33 AM
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.