Chris Posted February 14, 2018 Share Posted February 14, 2018 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 Link to comment Share on other sites More sharing options...
AzeoTech Posted February 15, 2018 Share Posted February 15, 2018 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 Link to comment Share on other sites More sharing options...
Chris Posted February 17, 2018 Author Share Posted February 17, 2018 Thanks! Chris Link to comment Share on other sites More sharing options...
Chris Posted February 22, 2018 Author Share Posted February 22, 2018 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). screenshot.bmp Link to comment Share on other sites More sharing options...
AzeoTech Posted February 23, 2018 Share Posted February 23, 2018 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. Link to comment Share on other sites More sharing options...
Chris Posted February 26, 2018 Author Share Posted February 26, 2018 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 Link to comment Share on other sites More sharing options...
AzeoTech Posted February 26, 2018 Share Posted February 26, 2018 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.