Sign in to follow this  
Chris

Pump control using analog input

Recommended Posts

I would like to be able to control a peristaltic pump using a table of data (time vs voltage output; see attached simple file by way of example). The goal is to increase pump speed over time.  If you look at the simple Excel table it has 2 columns; column 1 is time (in hours) and column 2 is the voltage output (0-5V for pump control). So, I would like to be able to create a table like the one attached (in any suitable format), have a program read it (DAQFactory) and then via the Labjack send the nominated voltage output (for that particular time) to the pump to control its speed.

 

Many Thanks

Example.xlsx

Share this post


Link to post
Share on other sites

OK, here is a working sample.  You have to convert the Excel file to a simple CSV file.  I've attached the one you gave.  If your data is always this simple you might want to skip Excel and just edit it in Notepad.  Put that file in c:\daqfactory, though you can change the path in the controlPump sequence.  That sequence will read the file, then change a channel called "output" based on those values and the time.  Change the output channel to point to the LabJack output.

 

 

chris.csv

filePlayback.ctl

Share this post


Link to post
Share on other sites

Hi

The script you wrote seems to be reading the Excel file OK (see screenshot). However i get these error messages below and it is not sending the correct voltage to the Labjack (i have connected the output to GND and DAC0 on a Labjack U3-HV).

 

blob.thumb.png.ec433bcb4ee8f60d01f3f1e3c85eb130.png

screenshot.bmp

Share this post


Link to post
Share on other sites

The problem is that there are actually 3 different LabJack drivers, based on the generation of LabJack device you are using.  The U12 uses one driver, the U3, U6, UE9 use a different one (the UD), and the T7 and other T devices use a third (the M series).  This is because LabJack created new drivers for new generations of devices.  It looks like you selected the device for the U12.  You need to select the one for UD devices.

 

Share this post


Link to post
Share on other sites

Hi

I don't seem to be able to get the DAQFactory to find the Labjack? I can control the output voltage using the LabJack U3 Test Panel, so computer and LJ are communicating. i have posted a copy of the DAQFactory Channel Table view. Maybe i have some setting wrong here?

 

Thanks Again, Chris

DAQ channeltable 2602.bmp

Share this post


Link to post
Share on other sites

Is the LabJack set to ID 1?  (you can find out in the Test Panel).  You might want to use D# 0, which means "First found", though that is not recommended if you are ever going to have more than 1 LabJack.  Also note that the UD does not support having two programs accessing it at the same time, so DAQFactory won't be able to access your device if you have Test Panel running.  You may even have to quit both then start DAQFactory after the Test Panel has quit.

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this