06-27-2015 05:30 AM - edited 06-27-2015 05:34 AM
Hi All !,
I have problem with my application for generating and measuring signals. Program works properly only once per six-seven times and problem which occurring is very repeatable. When it works wrong there is a probem with DAQmx read function, it not read data in every iteration. But when finally read it, there is much more data than expected (settings – samples per channel). Due to that data can't be continually displayed on the graph.
I do not have any idead how to solve it, I will very appreciate if you can help me.
Reguirements:
Simple program was created to exclude another part of the final program. Currently in Hardware Ao/0 is connected to Ai/0 to see what is going on.
Problem is visible especially when iteration will be plotted against: 1) available data to read, 2) data read during last iteration. Below are screen shots for situations: when programs works ok and when have delay ( works not ok)
Worinkg ok: no remaining data and every iteration 2560 data are read.
Program not working properly: DAQmx did not read data in every iteration, thus huge stack is growing.
Have you any idea what is the root cause of that?
In attachements please find MainVI.vi plus Source signal for generation
Regards,
finch18
06-27-2015 01:17 PM
I noticed one thing more. If data are measured from more that 1 channel, problem is less severe.
If acquisition using all 8 channels from 2 x 9234 there is no problem at all.....
So what is happening during acquisition from one channel?...
07-02-2015 04:07 AM
Hi Finch,
I have set up a similar system as in your case, however I have used a different cDAQ chassis ( cDAQ 9178 + NI 9234 + NI 9263 ) and run multiple times the code that you have provided - for me it works just fine ( see print screen attached ). Everytime I am receiving the correct amount of samples, so it's hard to tell what could be the issue. I would suggest as a first step to run one of the shipping examples that are coming with LabVIEW, for Analog Input, for just one channel, and see if you get the same behavour. Even better, you could try running your VI on a different PC and check how it works, or with a different hardware ( if you have another chassis available ). Otherwise, there might be multiple causes - DAQmx ( in which case you could try to reinstall the DAQmx driver), the OS or an antivirus which is slowing the execution. The code itself looks good, except that it is somewhat disorganised, so it would be a nice ideea to clean it a little.
Regards,
Denis