real time data transfer
Show older comments
Hello all,
I have implemented a Visual C ++ software that reads pressures from a data acquisition hardware and transfers every second (1s) data to Matlab.
To do this i used the Matlab Engine and sent through the engEvalString () function.
The data is correctly acquired by Matlab and the workspace arrays that contain these data are updated in real time. However, if i perform some operations such as plotting, calculation... , during the execution of these operations matlab's acquisition of data is interrupted.
How can allow multitasking of background data that does not interrupt when performing operations directly in the workspace?
PS: i would like to create matlabs GUI and wishes to run them during data capture, without these executions interfering temporarily blocking the acquisition.
Can anybody help me? Thank you!!!
Answers (1)
Walter Roberson
on 31 May 2017
Edited: Walter Roberson
on 31 May 2017
0 votes
You cannot do that using engEvalString to transfer the data.
You should consider using tcp to transfer the data. You can use callbacks so that the data is transferred in the background.
Or possibly write the data into a shared memory segment that is read by MATLAB. The File Exchange Contribution sharedmatrix is not coded for MS Windows, but the changes to get it to work with MS Windows should not be much.
You could also consider writing into a file and using memmapfile()
Categories
Find more on Data Acquisition Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!