02-28-2011 12:02 PM
Hello,
I am trying to sample two analog inputs, sum the two inputs, and output the summed signal through one analog output. Sampling input rate and output update rate at 51.2k/s/ch.
Devices I am using are:
1 x NI 9234 mounted on ethernet carrier (analog input)
1 x NI 9263 mounted on usb 4 slot chassis (analog output)
I have encountered the error -200279 and do not know what to do. Strangely enoguh, before I purchased the 9263 (higher resolution), I was using the PCMCIA card 6062E card for the analog output and the error was not present using the same program. The delay between input and output, (for testing, input is from Function generator, output monitored on scope, varying frequency and amplitude) is noticebly shorter on the 6062E card than the 9263 as well (just before the -200279 error kicked in for the 9263).
I have tried to increase the buffer size (not hooking a value to terminal as well) and specified fixed value to read. The only thing left is to "reading data more frequently", if that is related to sampling frequency then I can't read any faster since 51.2k is the max rate for 9234.
Is there something about the hardware between 6062 and 9263 that could explain for the differences?
I will also welcome any advice on how I can improve my program, I am sure there are more efficient ways to implement what I have in mind.
The current program I have is attached.
Thank you
03-01-2011 11:47 AM
Can you downgrade it to 2009?
Kind regards,
Bjorn
03-01-2011 04:07 PM
Hello Lathan,
It appears that your acquisition takes too long to read prior to processing and using the new data for analog generation. My two suggestions are:
1) Place another DAQmx Read vi prior to the while loop. Using a shift register, connect the output to the input of the 2 channel adder, and connect the result to the DAQmx Write. Lastly, connect the output of DAQmx Read to the right shift register. This will allow both DAQmx Read and Write to run simultaneously/in parallel instead of the current serial configuration of DAQmx Write waiting for DAQmx Read. This will hopefully decrease the amount of time for the while loop to process and may solve the issue. I attached the update to this post.
2) Place the NI 9234 in the 4 slot chassis with the NI 9263. Doing so will reduce the USB communications overhead of using both a sleeve and chassis.
I also included a link which should be helpful for troubleshooting this issue. I hope this helps.
Why Do I Get Error -200279 from my DAQmx Read VI or Property Node?
http://digital.ni.com/public.nsf/allkb/AB7D4CA85967804586257380006F0E62
03-02-2011 05:58 AM
Hello guys,
Bjorn,
I saved the original program for labview 2009, it is attached below. Let me know if it doesn't work.
Sandoval,
Thanks for your suggestions, I tried your fix of my program and I am still getting error 200279. Increasing the buffer size (at the timing Daqmx) seems to just prolonged when the error will show up and I have already specify a specific sample size to read. I think I will try to split up the two task, have them in different loops and share data using queues.
Oh, the reason why one is in the enet carrier and the other in usb chassis is because I will be taking data remotely and have the reconstructed/summed data locally (usb). Currently they are both sitting on my desk for testing.
Thank you
03-02-2011 11:13 AM
Hi Lahan,
Since you're reading from 2 different Modules @ the same time, I would create 2 different channels for it and match the signals through the timestamp.
I've noticed in the past that reading 2 inputs from different modules (through the same channel) isn't allways working because all kinds of factors, mainly hardware differences.
Solution :
Split the two channels and create 2 different channels to read. Synchronise the two channels if needed and add them afterwards.
SECOND :
Is there a reason why you have the DAQ start task behind the write? Because this does not seem "natural" to me 😉
Kind regards,
Bjorn
03-02-2011 11:18 AM
Lahan,
By the way if you're new to DAQmx, i once found this document which came really handy to me 😉
Kind regards,
Bjorn
03-02-2011 02:30 PM
Hi Bjron,
I am not reading two inputs through two different modules, it is just two inputs/channels from the NI 9234 in the ethernet chassis. What is happening with the other module is it is writing/outputting the summed data from the two inputs.
As for the Start task vi being behind the write vi, I just thought they should always be there since it is waiting to recieve something before starting and most of the sample Write programs I've seen has the Start located behind the write (including the link you have provided). I don't know if it could be place before, have to check tommorrow.
03-07-2011 11:59 AM
Hi guys,
Managed to get rid of error 200279.
What I need help on next is the phase. I was expecting to have constant phase/delay between the original signal coming from the function generator and the output signal but what I get is an output that constantly scrolls/changing (slowly) phase against the original signal viwed from scope.
Is there a way to phase delay constant?
03-08-2011 12:20 PM
Hello Lathan,
Phase coherency accross multiple devices is often achieved by the sharing of an external clock and triggers. Doing so oftentimes requires the use of NI-Sync and modules which are PXI based. Since you are using two independent carriers (ENET and USB based) with independent internal clock sources, you will encounter phase incoherency. Moreover, another factor is the latency and communication overhead associated with the ENET and USB buses. Since these buses use different protocols associated with the sending of packets of different sizes and handshaking, you will encounter less deterministic results.
Nevertheless, you may be able to achieve more phase stablity by providing sufficent buffered data to the output carrier/module. This can be done by constructing a producer/consumer system. Note that doing so will increase latency because the buffer will need to be filled prior to sending an output. Regarding your implementation, the producer is associated with the reading of the analog inputs and summation. The consumer loop will involve the sending of calculated data to the analog output. Below are a few resources/links:
NI-Sync User Manual:
http://www.ni.com/pdf/manuals/370926d.pdf
NI-Sync 3.1:
http://joule.ni.com/nidu/cds/view/p/id/1367/lang/en
Application Design Patterns: Producer/Consumer:
http://zone.ni.com/devzone/cda/tut/p/id/3023
03-08-2011 04:00 PM
Hello Lahan,
What you are seeing is drift due to the timebases on the devices not being Phase-Locked Looped. I am attaching a couple links that discuss this topic and describe the setup requirements to acheive this level of synchronization.
http://digital.ni.com/public.nsf/allkb/07BC8D77D4E9AE258625708B007CE74F
http://digital.ni.com/public.nsf/allkb/2F675A9F2162EA24862572570059A308
Regards,
Justin