04-15-2011 03:18 AM
Hi,
I want to generate a waveform on one output channel using NI-9263 and acquire data on two input channels using NI-9219, on NI mDAQ-9172. My VI outputs data ok but I have a few issues am still to solve, if anyone has an idea what I need to correct or add, please help.
1. Both input channels have repeated values in the output file, with single acquired data point repeating 9 times.
2. The time step is not recorded, and neither is it incrementing on the time column as I expect it to
3. I am running in continous mode but the data collection appears to be in batches of 100 (which is my sample to be read setting)
I have tried setting the timing to High speed on the input task and specifying the source for the timing VI as onboard clock on both input and output channels but this does not help. I've also tried synchronising the input channels sampling clock to be the output module's sample clock, but I get an error message.
Any help will be most appreciated...
Thank you.
04-15-2011 05:04 PM
Hi,
Is it possible to synchronize the timing on the cDAQ9172 chassis while using NI 9219 and Ni-9263 modules for the input and output tasks respectively? If anyone has an idea how I can go about this, please help. I am desperate to get over this huddle like yesterday.
Many thanks for your help.
Tickle
04-18-2011 04:02 PM
Hi, this is Paul from Applications Engineering at NI.
I'm going to try and give you some broad answers at first because I'm not totally sure what you are asking, but think it will help resolve your overall problems. If you come back with more specific questions after we will try to work with those too.
It sounds like you need to be sharing the sample clocks between your input and output modules, which is fortunately easy to do with LabVIEW and our cSeries modules. Your two best resources are going to be:
1. Synchronization Explained - http://zone.ni.com/devzone/cda/tut/p/id/11369
2. Our shipping examples - In LabVIEW, goto Help>Find Examples>Browse>Hardware Input and Output>DAQmx>Synchronization>Multi-Device
You are actually pretty close to what you need to be doing in your example file, and you may already be doing it correctly, but I'm not sure because I don't have the same devices set up as you. As you have it set up you would be using your Analog Input's clock as the sample clock. If you specify your Output Task's timing source to be the /DevXXX/ai/SampleClock then they will be sharing the same sample clock.
As for your analog output. You are never writing any analog output, because your write function is coming before your task function. Any reads and writes will need to be performed after the task has started. If you just want to output this generated signal one time, you can place the write function between the task start and while loop. Because your input and output will be synchronized at this point and both tasks will have been started, even though this write is coming "before" your inputs in the code, they will still be synced up, because the your device will begin buffering inputs as soon as the task is started, even if you haven't told it to perform a read yet.
As for your questions;
1. Both input channels have repeated values in the output file, with single acquired data point repeating 9 times - I think this will be resolved once you work with the above steps.
2. The time step is not recorded, and neither is it incrementing on the time column as I expect it to - I'm not sure about this, I seem to be seeing correct operation on my end. This may be a product of different problems.
3. I am running in continous mode but the data collection appears to be in batches of 100 (which is my sample to be read setting) - The 100 is a buffer. Every time you request a read, it is reading in chunks of 100 out of the buffer. So if there are 50 items in the buffer when you request the read, then it won't output until it reaches 100. If there are 150 items in the buffer when you request a read, it will give you the 100 oldest.
04-19-2011 01:05 AM
Hi,
Thank you for this info. I will go through the links and try to locate where I am going wrong.
When I try to set the timing VI source to either input or output I get an error that the hardware does not allow the operation. I can only use the 'onboard clock'. I will however go through the synchonization link first and try again.
Thanks again for you advice.
Tickle