From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Connecting a pump over rs232 for real time control

Solved!
Go to solution

It gives some credit to who helped you solve the problem.  But more importantly, if someone is searching for messages describing the problem they have, it gives them a way to jump directly to the most helpful message.  This is especially important when message threads grow to dozens or even hundreds of messages across multiple pages.

 

I guess the pumps have an in/out setup on their serial ports that allow it to take a message off of one port and transfer it to the other port for the next device in the chain to get.

0 Kudos
Message 41 of 46
(2,651 Views)

I guess the pumps have an in/out setup on their serial ports that allow it to take a message off of one port and transfer it to the other port for the next device in the chain to get.


 Exactly, but how do I go about assigning which messages skip the 1st pump and go straight to the second? 
0 Kudos
Message 42 of 46
(2,649 Views)
I don't think you have to worry about that at all.  Just set each pump to a unique address.  The pumps already have it built in to pass a message on from one of its ports to the other.  They'll ignore any command that is not specifically addressed to it.
0 Kudos
Message 43 of 46
(2,641 Views)

Ravens Fan is correct - this is a serial operation, so the commands will be sent on down the chain. You DO however need to set addresses to the pumps. The addresses are stored in memory (until cleared), so you'll have to first connect the pumps individually and set one of them to "0" and the other to "1" (your manual should tell you how to do this).

 

After that, you will send all your commands with an address in front. Again, see my example code, it's already setup to concatenate the string command with an address digit in front. You will send commands with the syntax "0RAT10" and "1RAT20". The easiest way to do this is to use a sequence inside your while loop, or just basically wire two "lines" through the while loop, one for pump 0 and the other for pump 1. You'll have two dials and two sets of VISA read/write for everything. They will be identical except for the address digit in front of everything.

0 Kudos
Message 44 of 46
(2,634 Views)
Ok so chaining the pumps works grea,t thanks again.  One last question for now. we were discussing other applications for the program and someone brought up inputting "recipes". such as run at 4ml/min for 3 min, then run at 2ml min for 10 min, etc. is this easily done? I've gotten reasonably comfortable with labview by now, just which functions are most easily applied to this? I want to code this one on my own more and I'll probably post back here in a few days with my progress.
0 Kudos
Message 45 of 46
(2,618 Views)

Sure it can be done easily.

 

The key things are maintaining the list of recipes.  That could be a little bit of code that opens up and reads a text file, or complicated code that allows you to edit, add, subtract, rearrange steps, all within LabVIEW as well as saving and loading the data files.

 

Ultimately you want to have your data stored in an array.  Perhaps an array of clusters where each cluster consists of a time, rate, ....  Then your code will step through the array picking off the data, keeping track of elapsed time, and determining when to move onto the next step.  At this point, the architecture will start to look more like a state machine.  Search for those words in the forum and you'll find hundreds of threads that will give you ideas on how to implement.  Also look in the example finder and under File / New.... on the menu for template architectures.

0 Kudos
Message 46 of 46
(2,613 Views)