ni.com is currently undergoing scheduled maintenance.
Some services may be unavailable at this time. Please contact us for help or try again later.
03-26-2008 12:49 PM
03-27-2008 05:11 PM - edited 03-27-2008 05:19 PM
Hi Robert W,
I understand that you want to acquire data from 4 different AI channels and apply a different scale to each channel. You can do this by creating an Analog Input task, add the four channels to it and apply a different scale to each channel. There is a create scale vi, part of the DAQmx drivers, that creates and configures a scale. I think it could be really helpful in your application since it applies the scale to the input (or output) data. You can find it in the Functions palette > Measurement I/O > NI-DAQmx > Advance > Scale Setup > DAQmx Create Scale.vi. This screenshot should be helpful in how to setup the channels (and uses the create scale vi). I hope this is helpful, if I misunderstood your goal please post back.
Message Edited by Ana P on 03-27-2008 05:16 PM
04-01-2008 01:13 PM
04-01-2008 01:13 PM
04-01-2008 02:28 PM
Did you change your DAQmx Read to NChannel from 1Channel?
Once you have NChannel, this will return either a 2D array or 1D Waveform array. Use the 2D input of Write to Spreadsheet file or use Export Waveforms to Spreadsheet File.
04-01-2008 03:07 PM
04-01-2008 09:08 PM - edited 04-01-2008 09:09 PM
Inside if you want to save all of the results. Something like below with the Array to Spreadsheet String function.
You can also place the file write in a separate loop and pass data to it via a queue. This has the advantage of not slowing down your acquisition loop.
04-02-2008 07:39 AM
04-03-2008 11:05 AM
Another option, without having to go into queues, sorry Dennis, is that you can index your array in the loop and then write the data all at once outside of the loop. There are pros and cons to all of these solutions so use which one works best for your application. It is going to be a tradeoff between programming knowledge and complexity, speed, memory, and robustness.
StuartG
04-03-2008 11:46 AM