Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

vba excel daqmx multiple analog inputs

Hi,
 
 
I've just started working with LabView, therefore I'm not all that familiar with it.  So, in order to get a simple DAQ test software for a setup I have I've created it using VBA in Excel.  I was able to use the DIO example to send the digital outputs that I needed to do.  However, I haven't been able to figure out how to read multiple Analog Input Channels and put that data into an array.  This seems like it should be a simple task, but there are about a billion DAQmx commands and I haven't been able to find the ones I think should be there....can anyone help me with this?  Thanks!
 
Nick
0 Kudos
Message 1 of 4
(3,571 Views)
Open the example finder (Help>Find Examples) and one of the simplest examples to start with is Hardware Input and Output>DAQmx>Analog Measurements>Voltage>Cont Acq&Graph Voltage-Int Clk. To get multiple channels, you just have to add them to the Physical Channel control. If you have continuous channels, the syntax is Dev1/ai0:2 for example. For non-continuous, it would be something like Dev1/ai0, Dev1/ai2. Dev1/ai5. You can also click the down arrow on the right side of the control and select browse. For beginners, using the DAQ Assistant can often give you a big headstart. Just select this on the NI Measurements>DAQmx palette.
0 Kudos
Message 2 of 4
(3,568 Views)

Dennis,

I don't have a problem understanding how to use the DAQ Assistant to acquire these measurements. 

However, I need to create a series of loops, to perform other tasks, take measurements of 12 AI channels, perform some additional tasks, take more measurements, do a bunch of calculations and comparisons with the data, etc...  I have to have this finished by end of day tomorrow and don't have enough time to learn all of the ways to do this in LabView when I all ready know how to do them in VB and VBA.  Unfortunately, at the facility I'm at I don't have a VB 6...so it leaves me no choice but to do this in Excel VBA.  I have everything completed, except for building a function to make the Analog Input measurements.  Any assistance on which DAQmx commands need to be used to accomplish this would be helpful (i.e. configuring the channels, setting them up as differential voltage measurements, etc...). 

I really want to learn LabView in depth, but because of resource issues (most importantly time) I've had to work with what I all ready know.  Thanks for any assistance!

Nick

0 Kudos
Message 3 of 4
(3,565 Views)
Sorry I misunderstood. I don't use VB but I have seen related posts and I believe that installing DAQmx also installs examples for VB and that there is a similarly named example for that. If VB is not installed, you may need to rerun the installer and explicitly select to install the VB examples. Hopefully, someone who uses VB can provide a better answer.
0 Kudos
Message 4 of 4
(3,562 Views)