04-25-2012 07:13 PM
Hello,
I have a CDAQ-9188 that has the modules NI 9213, NI 9217, NI 9205, and two of the NI 9403, and NI 9263.
I am trying to write a CVI program to communicate with all of them, get data and diaplay the data.
I am able to do that with the NI9205 as long as the only device configured is that module. If I add the others and
try to display the data from all of them (Only the Analog channels for now. Exclude NI9403s and NI9263), the data
is garbage. And the program crashes after displaying the data for about 1 minute. I have used sample programs to
create the one attached. I think the problem is with sampling rate, buffer length and the scan length. I am not sure
how to set these values and how the CDAQ-9188 uses them. Is the order of samples based on the order of modules
configured. For example if the TC channels (NI 9213) is configured first, the the first samples are from that module.
How do you set the sampling rate of the TC channels. Does the CDAQ reads all the samples from one module and then goes to the next. Or it take a set number of samples from each channel and goes through all channels before putting them into the buffer.
When it crashes, it gives me the message attached here call crash.gif.
The site does not allow me to attach the file. So I will try to do another post and attach it there.
Thanks
Bobby
04-26-2012
03:46 PM
- last edited on
07-16-2024
03:14 PM
by
Content Cleaner
Hi Bobby,
You should be able to add file via the Attachments section in the bottom left. You’re also welcome to upload them to our FTP site: Please name the file something corresponding to your request and let me know when they’re uploaded.
Can you also attach or upload a screen shot of the crash you are getting.
Do your other devices collect data accurately alone? Are you using a single task for all your Analog In modules and a separate task for your Output module?
Regards,
Michael M
NI Americas | AE
04-26-2012 07:17 PM
Hello,
Here is the crash screen.
Bobby
04-26-2012 07:34 PM
Hello,
I have been trying to attach the Files but for some reason it does not like the files.
This is the message I get when I try to attach the File.
Please correct the highlighted errors and try again.
Thanks
Bobby
04-26-2012 07:43 PM
Hello Michael,
I was able to upload the file in the FTP server. It is in the INCOMING directory and it is called
Analog Inputs.c
Thanks
Bobby
04-27-2012
03:26 PM
- last edited on
07-16-2024
03:15 PM
by
Content Cleaner
Hi Bobby,
You should be able to read for particular channels the same regardless of what additional modules you have in place. You can change how you read in the samples with the DAQmxReadAnalogF64() call you are making by changing the numSamplesPerChan or the timeout. If you highlight the function you can press F1 to get the help for the function under question.
I would suggest sampling quicker by changing the samples to read like this KB suggests (Why do I Get Error -200279). The code is in LabVIEW but the concepts are the same.
I received your code off of the FTP, may I post it here?
I would also suggest testing out modules in chunks because it is hard to tell where you might be getting the error if you bring in all the modules at once.
Regards,
Michael M
NI Americas | AE
04-27-2012 05:14 PM
Hello,
Yes go ahead and make any changes you would like to it and post it.
I will download it and try it.
How does CDAQ-9188 collects the data from all the modules. When I do a DAQmxReadAnalogF64(), Does it go
through all the modules installed in it (NI 9213, NI 9217, NI 9205, ....) and collects the data from all of them and
then puts it in the Data buffer. If so in what order does it do it. Is the order based on the physical location of the
modules or which module is configured first in the program.
The physical slots I have module installed in are,
Slot 1 = NI9213
Slot 2 = NI 9217
Slot 3 = NI 9205
Slot 4 = NI 9403
Slot 5 = NI 9403
Slot 6 = NI 9263
The reason for this question is that I need to know the location of the samples for each module so I can display the
data correctly. At this time I only display the first 32 positions of the data buffer to see which data points belong to
which module.
Regarding the timeout, I did increased it but it still failed afetr a while.
Thanks
Bobby
04-30-2012
09:41 AM
- last edited on
07-16-2024
03:16 PM
by
Content Cleaner
Hi Bobby,
The cDAQ/modules have their own internal buffers that automatically write (with DMA) all the collected data to a buffer on your OS. When you perform a function such as the DAQmxReadAnalogF64() you are reading from this OS buffer (Buffer Allocation).
If you go to Start » All Programs » National Instruments » NI-DAQ » NI-DAQmx Help and search Task from the Index you can find a good article (Tasks in NI-DAQmx) that explains in detail what a task means in DAQmx.
When you use the DAQmxReadAnalogF64(), this function reads from all the channels specified in the Task Handle you pass. The Task Handle determines which channels on your device are being read.
The ordering for the channels is determined by the “fillMode” parameter. You can see more information on how the data is stored in the readArray by clicking on the interleaved link in the CVI help under the help topic for DAQmxReadAnalogF64 (highlight the function and click F1).
I’m attaching your C file for consistency, I didn’t change anything. I’m hoping that the explanation for fillmode will help you get on the right track.
Regards,
Michael M
NI Americas | AE