How to generate a real time measurement output in MATLAB?

5 views (last 30 days)
Hello,
I am using a data logger with MATLAB shared library interface. I need to generate the real time measurement output of data logger. The code I am using only shows one measurement.
fullpathToDll = 'Z:\F1\2015_02_26_photometer_Datenlogger\PC-Software\CGMultChan.dll';
fullpathToHeader = 'Z:\F12015_02_26_photometer_Datenlogger\PC-Software\CGMultChan.h';
loadlibrary(fullpathToDll, fullpathToHeader,'alias','CGMultChanLib2');
m = libfunctions('CGMultChanLib2', '-full');
IP = calllib('CGMultChanLib2','CGMultChan_Connect','192.168.100.158');%Connect to Data Loger
if (IP == 0)
end
TI_ms = calllib('CGMultChanLib2','CGMultChan_SetIntTime',.02*1000);%Integration time
BufferSize=16;
pBuffer = libpointer('singlePtr',zeros(BufferSize,1));
measure = calllib('CGMultChanLib2','CGMultChan_MeasureAll',pBuffer);%Measurement
plot (result)
xlabel('time (s)');
ylabel('Illuminance (Lux)');
clear pBuffer
calllib('CGMultChanLib2','CGMultChan_Disconnect');%Disconnect from Data Logger

Answers (0)

Categories

Find more on Get Started with MATLAB in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!