04-01-2010 05:04 PM
Hi,
I'm in trouble about continuously read 2 tasks with different sample rates with a SCXI system. I want to read a task with 2 accelerometers with a sample rate of 20kHz and another one with 10 voltage channels at 1khz.
When I use the reverve/unreserve of daqmx control task the signals became discontinuous, and when I use the start/stop daqmx task the signals became discontinuous too and the loop period increases very much.
What is the best way to resolve this problem?
04-02-2010 02:52 AM
04-05-2010 09:25 AM
I do not use any trigger , only a button ON. The task access the same communication module SXCI 1600, and I want to monitor 2 sets of channels with different samples rates.
04-05-2010 09:53 AM
04-05-2010 10:00 AM
04-05-2010 10:33 AM
04-05-2010 10:56 AM
04-05-2010 11:26 AM
04-05-2010 11:47 AM
I'm not sure if this will be helpful or not but the following code does something similar (to the most recent description of your question):
The way the program works is as follows:
1. Configure the Convert Clock rate to be the desired aggregate sample rate (200 kHz max on the 1600)
2. Use a separate DAQmx Virtual Channel for every sample to be taken. This allows you some freedom to dictate how the device scans through channels (although some SCXI hardware is limited in scanning options). A few examples of how you could use the concept, depending on what SCXI modules you are using:
a) Switch between individual channels without delay while sampling at the maximum rate of the device (this is what the example is set up for). To do this your channel list would look something like this:
[0 0 0 0 0 0 ... 1 1 1 1 1 1 ... etc.]
b) Switch between groups of channels sampled at the maximum aggregate rate (for example you could sample 2 channels at 100 kHz on the 1600 then switch to another 2 channels with no delay):
[0 1 0 1 0 1 ... 2 3 2 3 2 3 ... etc.]
c) Sample channels at "different rates". By repeating channels in the scan list you can achieve different effective sample rates across multiple channels. Keep in mind that the convert clock generated by the 1600 is not going to change its rate on the fly* so if you don't space the channel list evenly you will have an inconsistent sample rate. Here's an example scan list that shows how you could have a uniform rate on each channel while sampling channel 0 4x faster than the other four channels in your task (with a 200 kHz convert rate this would give rates of 100 kHz on channel 0, and 25 kHz on channels 1-4):
[0 1 0 2 0 3 0 4]
* If using an X Series DAQ Device, one could use a buffered counter output to generate a non-uniform convert clock to get more creative with scanning.
3. Based off of the Scan List chosen, you then parse out the data and display it appropriately for the end-user.
Only case a) from above is shown in the example, but to get the other behaviors it's just a matter of building the appropriate scan list. I'm still not clear on exactly what your scan list and rates are going to look like (you may have to make some compromises) but you might be able to play around with the above example to get something close to what you want.
The idea isn't exactly the most straightforward but I have worked with it before in specific use cases. Assuming your hardware supports multiplexing in this way then this might be a suitable starting point for what you need to do. If you provide more details about your application we could offer more specific advice for building your scan list.
Best Regards,