07-02-2010 08:21 AM
Dear all, I hope I'll find some help because I'm stuck in my problem since more than a week right now...
I'm working on labview 2009 on a NI PCI - 6221 M SERIES DAQ.
What I want to achieve is the simultaneous acquisition of 4 channels, and till here no problems.
Then I want to be able to apply a pulse stimulus, whenever I want, just by clicking a button and monitor the current answer I get from my system.
Said in other words, I want a continuous acquisition from 3 channels, and with the 4th I just want to see displayed the answer I get from my system generated from the stimulus that I apply with a button at a random time, a random number of times during an experiment...
What I find extremly difficult is to syncronize the output and the input having a continuous acquisition....
Any Ideas on how to do this?
Best regards, and thanks in advance,
Prevat
07-07-2010
02:00 AM
- last edited on
05-02-2024
01:39 PM
by
Content Cleaner
Hi Prevat,
it seems that you still have to fight with the same problems as in this post:
If you are only trying to synchronize the analog output with the analog input: In the NI Example finder you will find good examples under Hardware Input and Output>DAQmx>Synchronization>Multifunction, for example Multi-Function-Synch AI-AO-Ext Dig Trigger.vi or Multi-Function-Synch AI-AO.vi. Maybe you have to adapt the vi a little bit but in general it is a synchronization of AO and AI.
cheggers
07-07-2010 03:30 AM
Hi Cheggers,
thank you very much for having answered!
My Problem now isn't related with the synchronization anymore, I have achieved to run my VI properly, also thanks to you.
I now have the need to acquire data in parallel and continuously from other channels, but since my card only has one analoge digital converter I don't manage how to do that.
I've attached a simplified version of my program. As it is now, I can create single pulses and immediately record the answer i get from the system and this works perfectl. My biggest Problem is what can I do now if I want to acquire continuously from other channels?
Should I buy an acquisition card with more than one AD converter?
thank you in advance for the help
Regards,
Prevat
07-09-2010 06:53 AM
Hi Prevat,
--> I now have the need to acquire data in parallel and continuously from other channels, but since my card only has one analoge digital converter I don't manage how to do that.
I believe that you are not yet fully understood how the analog input works on a M-Series device. If you want to aquire data in parallel or in other word aquire data from multiple AI's there's no difference in the labview code if you have an M-Series device (with one AD converter) or an S-Series (with one ADC per channel)! A Task can have one channel or multiple channels.
Look at this example: A AI Task aquires samples from AI 0 and AI 1. Since you have only one ADC which has to switch from channel to channel you have a phase delay from about 5us between AI 0 and AI 1.
M-Series: Interval Scanning
M-Series vs. S-Series:
--> My biggest Problem is what can I do now if I want to acquire continuously from other channels?
A Task can aquire data from one OR multiple channels.
Task= Channel(s)+Timinginformation+Triggerinformation
In the first image you would aquire only from one channel, in the second you would aquire from AI 0 - AI 15
cheggers
07-09-2010 05:18 PM
Dear cheggers,
thank you for the answer, but maybe I haven't explained sufficielntly well my problem.
I need to generate a pulse(say 1 ms) with irregular intervals, let's say on a click event and immediately acquire the answer of that impulse. I've managed to do that starting a task as the event click occours and in synchro I also start the task that acquires the answer.
Till here no problem at all, but as you can see the task isn't running on continuous mode.
The problem arises now: I want to acquire continuously other signal from other channels... that's because I think I need a S-Series card...
other suggestions?
regards and thanks again
prevat
07-10-2010 10:38 AM
Hi Prevat,
if you want to aquire finite samples from one analog input and aquire continous samples from other analog inputs you will need a second DAQ device. This is not possible for M- or S-Series devices (you can simulate the DAQ device and try..). Since you can only have one task for the analog input you have to devine if this task is finite or continous. Both at the same time is not possible - you would get a "device is reserved"-error.
So if you realy need a finite and continous analo input task you will need a second DAQ device.
cheggers
07-12-2010 03:14 AM
Hi cheggers,
first of all thank yôu again for the answer..
As you said I think I need another card. I was just wondering if there was another intelligent method to generate a pulse and immediately acquire the system response working with the analog output in finite mode and with the analog input in continuous mode. But after a week of unsuccessful tries (I couldn't achieve a satisfying synchornization) I think I'll give up and i'll buy another card.
I have one other question... you wrote: " aquire finite samples from one analog input and aquire continous samples from other analog inputs[...]is not possible for M- or S-Series devices.
But S-Series have a dedicated ADC for each channel and I've read that it is possile tio iacquire data independently for each channel (also indipendent clock rate), what isn't possible for the M series instead... Therefore I don't understand why you say that you ônly can have one task for the analog input... ^then how can you define the different clock speed? why would I get a " device is reserved" error if I have one ADC for each channel?
thank you very much again for your disponibility,
bests,
Prevat
07-12-2010
12:47 PM
- last edited on
05-02-2024
01:41 PM
by
Content Cleaner
Hi Prevat,
The ADCs on S Series all have the same timing and triggering inputs. Since your clock and triggers must be the same for every channel, they all must be part of the same task in DAQmx. The main benefit of a simultaneous card is that all acquisitions occur truly simultaneously and there is no need to worry about settling time concerns that can potentially be introduced by multilpexed boards.
Having said this, it sounds like you want to be able to run several channels continuously and another channel as a finite acquisition. Why not just run all of the channels continuously? You could implement a buffer for the "finite" channel and use a sort of software-defined reference trigger so that your display / file is only updated when a signal is read on the input channel.
The alternative to programmatically implementing this is to use a second board. Since you already have a 6221, adding another PCI DAQ card would give you two boards so you could run one continuously and the other one as a finite acquisition. Assuming you'd like similar analog performance to your existing 6221 and that you don't need any additional AO channels, you'd probably want to go with either a 6220 or a 6320 (if PCIe is an option).
Our only current multifunction DAQ hardware that has support for multiple analog input timing engines are the second generation Compact DAQ chassis (9174 / 9178). The cDAQ chassis is a platform that gives interchanageable analog front-ends that provide conditioning for particular sensor-based measurements. The chassis itself has 3 analog input timing engines so you could run three tasks simultaneously. The typical use case for this is to be able to run fast and slow tasks concurrently.
To recap, there are essentially three options:
- Use your existing hardware, implement the "finite" acquisition in software by using a continuous acquisition and throwing away undesired samples
- Supplement your existing hardware with another board that will be able to run independently of the first.
- Switch to cDAQ platform which provides 3 analog input timing engines.
My favorite option is the first one--to use your existing hardware and just acquire continuously on all channels, keeping only the data you are interested in on the "finite" channel. The third option doesn't make much sense at this point since you already have a 6221. Adding another PCI or PCIe DAQ card to your existing setup should give you what you need at a lower cost.
Best Regards,
07-13-2010 03:18 AM
Hi John,
thank you for your help!
I've already tried the first solution you proposed, just to run all channels continuously, but I didn't managed to achieve an acceptable synchronization. The main problem I have is that the answer I get from my system can be a very small voltage, in which the signal isn't always distinguishable from ^the background noise... Therefore I don't know how to "find" in the buffer the data I need.
How complicated do you think that will be to programmaticaly implement this? Will be it me more convenient to buy another card?
I've already invested a lot of time in trying to achieve my needs just using my card...
if someone knows how to do it, can I ask to post an example? I really would appreciate it...
bests,
Prevat
07-13-2010 01:18 PM
Hi Prevat,
What is the pulse stimulus that you are applying? Regardless of what the response is, this stimulus should always be a measurable voltage right? Is the pulse stimulus TTL? If so you could synchronize a DI task with your AI task to check for the stimulus that way. If not, you could use another AI channel (although this will lower the maximum AI rate you can achieve per channel).
Once you know when the stimulus occurs, you can build an array of the data from the "finite channel" starting at that point for however many samples you want to acquire. If you want pre-trigger samples then you'll need to constantly store them in a software buffer until the stimulus is detected.
A second board would certainly make this easier, but I do think it should be possible with a single board. I can look into trying to write an example if I get a bit more information:
-Is the stimulus TTL (0-5 Volts?)
-If so, is the DI subsystem available for use?
-Do you need pre-trigger samples?
Best Regards,