1

I'm compelety new to Qt,QWT and have a basic knowledge in C++.

According to the project that i got, i have to acquire some data given by the sensors on a caravan, like solar panel voltage and current, the temperature,humidity and so on. All these datas are acquired by some sensors and collected by a NI 6229 DAQ Device.

Until now, i just gave the sidelights. Now i'm coming to the real problem.

I want to acquire the datas that came from the DAQ device and show,plot,record and log in a program.

I've decided to use C++, Qt and QWT. And the NIDAQMX API for acquiring the data from the DAQ device of course.

I've already designed a GUI partly, but the point where i stuck is the real working part of my code.

I don't know how to implement all these stuff with taking the performance criterias into account and i really need a guide.

How should i handle data acquisition ?

How should i plot the datas that i acquire ?

Are these need to be seperated by different threads or some another structure ?

Does collecting almost 10 or 12 channels data and plotting it in real time cause reasonable performance problems ? If so, how can i handle it ?

Thanks in advance.

1
  • It depends on how the NIDAQMX API works. Does it trigger events? How often? How much data is involved? Commented Oct 4, 2012 at 21:54

1 Answer 1

3

If you write a simple program to work with NI 6229, you need to set the priority of operations: plotting or recording data.
In most cases, data storage is the most important operation.
In my practice, I used the following algorithm:

  • 1 GUI thread (common UI + plotting), 1 thread for data acquisition for every device, 1 thread for recording data.
  • Thread for data acquisition runs every dT time (we ask device: - how much data ready? - 10000 samples - ok, gimme it). Because the NI 6659 has a sampling frequency less 1 MSamples/s, I think the value of dT will be roughly 50-200 ms (depends on interface).
  • After reading data from device I send data to thread for recording by using queue for that.
  • The same about plotting. I use qwt with data decimation (but you should save peaks). Qwt has not bad example for it. Also you can find solutions to increase plotting performance. My advice is to split charts to groups, for example, one group may contain 4 charts.

It's solution for simple program only and not for realtime OS.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.