05-05-2008 11:28 PM
05-06-2008 08:37 AM
05-06-2008 09:10 AM
05-06-2008 09:30 AM
05-06-2008 09:48 AM
05-06-2008 10:55 AM
05-06-2008 02:18 PM
Hi Joe42,
I don't know if you've noticed Dennis' icon? It was made specially for him for 10,000+ posts. The guy knows what he's talking about. Like Dennis mentioned, you can create different channels for ranges and input types (voltage and current, etc.) but they all must have the same timing. You can sample at the fastest rate you need and then decimate the data afterwards, but that's the closest you'll get with the same piece of hardware.
Loquito
05-06-2008 03:45 PM - edited 05-06-2008 03:45 PM
Hi Joe,
Welcome to the forums! I wanted to expand some on the answers that Dennis and Loquito provided. Loquito’s suggestion that you sample faster than you need to and then decimate (or skip/throw out the extra samples) in post processing was a great tip. This would let you put both channels in the same task, sample at a high rate, and achieve the necessary synchronization with the appearance of different sample rates. The image below is what Dennis was referring to when he said “To use different gains, just add another DAQmx Create Channel to the existing task”. Each Create Channel function would have a different physical channel input wired to it, but you could then wire different gain values.
The reason that you can only have one task of any given type running at a time is that the second task’s DAQmx Start, Write, or Read Functions would need the Reference Clock, which is in use and reserved by the first task. I am sure that when you were creating this code you experienced resource reserved errors. This is also why you were only able to get the code to work by removing the second start function. By removing the start function, you let the second task auto-start once the resources were freed (i.e. after the first task finished). You can only have one task of each type running on a single device, for example you can have 1 analog output and 1 analog input, but not two analog inputs at the same time on the same card. It sounds like we have a work around though.
Regards, Mallori M.
12-04-2013 05:36 PM
I'm have the same issue with synchronizing multiple AI channels with a single trigger source. I have attached both the front panel and the block diagram for a reference. I am using the NI cDAQ-9174 chasis with a NI 9402 (slot 1) module and NI 9205 (slot 4) module. It seems whatever channel is created first is in sync with the trigger source while the second channel in not (returns something around 0). I have tried to putting both channels in the same DAQmx Create Channel.vi with the same results, just the first channel is in sync. If I each channel individually I get a signal in the channel.
Any ideas?
12-05-2013 06:34 PM
Hi BPyke,
Just for clarification, what happens when you get a signal in a channel?
Regards,
Jordan G.