Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

I have some problem with programmin measurement application.

I write some program in C++ using wxDevC++. And i have problem with data acquisition. I want to measure some data, save it to file and display it in graph. But I need do it in 1 second. It's impossible. I used SCAN_to_Disk function but it saved data to file in a unknown format for me. I want to save voltage. And in same time display measured data in graph that I made myself. How can I do it? i have main thread, thread for storing data and anotherone for displaying data.
0 Kudos
Message 1 of 2
(6,371 Views)

Hello Fullist,

If you take a look here, it has more details on the format that the Scan_to_disk function uses.  In addition, the Scan_to_disk function performs both the data measurement and saves to disk all in one task.  This means that you will have to read the data from the file to display it to a graph.  If you want to display the data to a graph, I would suggest using another function to read in the data.  If you are using Traditional NI-DAQ, I would take a look at the AI_Read or AI_Read_Scan functions to acquire the data into the form of an array.  This would allow you to graph the array and save the array to file using one of the file I/O functions provided by your programming environment.  I’m not familiar with wxDevC++ and I would recommend contacting them to determine the fastest and most appropriate function to write to file.

In regards to whether or not it is impossible to measure data, save to file, and display the data on a graph in one second, there are many factors that affect the speed you can do these three functions.  The rate that you can complete these functions will depend on your operating system, hard drive speed, CPU speed, Data Acquisition card, programming environment, what device driver you're using, etc.  I would recommend running each thread seperately to determine it's individual speed.  This might help you determine which task is slowing down your execution.  You  might also look at methods of storing the array in PC memory until the total acquisition is done until you write it to disk.  This would depend on the rate you are acquiring and the total time you will be acquiring at that rate as to whether you can store this information in memory.  However, this would increase the loop rate you're using to read in the data from the DAQ card and display to graph.

Regards,
Paul C.
0 Kudos
Message 2 of 2
(6,305 Views)