11-02-2007 10:30 AM
11-05-2007 10:53 AM
11-05-2007 11:32 AM
Hi Chris-
It looks like you're using NI-DAQmx for Linux, so the NI-DAQmx Base tutorial will not be helpful.
In order to create persisted Global Virtual Channels and Tasks in NI-DAQmx for Linux you need to use the NI-DAQmx Storage VIs. These are available from the Measurement I/O>>DAQmx - Data Acquisition>>DAQmx Advanced>>System Setup>>DAQmx Storage palette in LabVIEW. You'll need to set up your channel or task and all parameters programmatically and then use the Storage VIs to save them into the DAQmx persisted storage database.
This example program entry provides a couple of LabVIEW 8.0 examples that show how to use the NI-DAQmx Storage API. Those examples should be a good starting point to help with your system configuration.
Hopefully this helps-
11-05-2007 02:55 PM
11-05-2007 03:52 PM - edited 11-05-2007 03:52 PM
Hi Chris-
In order to contain multiple channels with similar timing information but dissimilar (or similar) channel options (such as input range, coupling, input configuration, etc) you will need to use an NI-DAQmx Task. A Task can contain multiple persisted Global Virtual Channels, or it can contain virtual channels created at runtime via the DAQmx Create Channel VI.
In general, most DAQ hardware (including the two devices you mention) only allow one analog input operation to run at any given time due to the fact that only one AI timing engine is available. So, DAQmx limits in software the ability to run one task at a time. You can not run multiple AI operations in parallel independently of one another, but you can group multiple virtual channels within one task and share the timing information between the multiple channels.
For your case where the application might need to adapt based on the DAQ device in use, I would suggest using the NI-DAQmx LabVIEW API to create your channels and tasks rather than creating them as persisted entities. This will allow you to change the channels in use and their parameters at runtime rather than having to create persisted tasks and channels for each possible hardware configuration.
I have attached a quick example that shows how to combine two channels or lists of channels into a single task. The timing and triggering information will be shared by all channels in the task, but the individual channel parameters (i.e. channel range, input configuration) can vary within the same task. In case you have trouble opening the VI, here's a screenshot of the block diagram:
11-05-2007 03:55 PM
Chris-
I'm not able to edit my last post for some reason, but I wanted to point out that you will need to insert a DAQmx Start Task VI between the DAQmx Sample Clock VI and the beginning of the While loop execution in my previous example. Apologies for any confusion.
11-05-2007 04:26 PM
11-05-2007 05:00 PM
Hi Chris-
Absolutely- you can group channels with similar input ranges, measurement types, and configurations into a single DAQmx Create Channel VI using the syntax "DevX/aiN:M" where X is the device number and N and M are the boundaries of a sequential list of channels. For other channels or channel lists with dissimilar channel parameters you can then daisy-chain multiple DAQmx Create Channel VIs with appropriate input parameters. Each call to DAQmx Create Channel will add the new virtual channels to whichever task you provide to the Tasks/Channels in input of DAQmx Create Channel.
So for example, you could call the DAQmx Create Channel VI instance for sound pressure with 2 channels on your S Series board and then call the DAQmx Create Channel VI for voltage input for a third or fourth channel on the same board if needed. The biggest limitation to keep in mind is that the task must only contain channels from the same device, so you will need to create two seperate tasks for the M Series- and S Series-based measurements you'll be making.
One notable caveat to this rule is the fact that multiple S Series devices can be contained within the same task if the devices are connected via RTSI or a PXI chassis backplace. In that case you could create a channel list to the DAQmx Create Channel VI of the form "DevX/aiN:M, DevY/aiJ:K" where X and Y would refer to two seperate S Series devices. Since it sounds like you're only using on S Series device this probably won't help, but you might consider it if your system expands in the future.
02-22-2008 12:52 PM
02-25-2008 04:25 PM - edited 02-25-2008 04:26 PM
Hi Chris-
You should be able to delete the superfluous channels and tasks using the DAQmx Delete Saved Global Channel and DAQmx Delete Saved Task VIs. I don't have a Linux/DAQmx test box here now, but they're supported on Windows and should be supported on Linux as well.
You can create digital I/O global channels for the SCC modules. You may want to manually edit your DAQmx config file to include the SCC carrier and/or modules so that the I/O controls will populate correctly in LabVIEW. More info about using nidaqmxconfig with SCC/SCXI is available here. An example configuration entry for an SCC carrier and module is shown here.