Callback function after addlistener for National Instruments board

3 次查看(过去 30 天)
Probab not really a Matlab question:
After daq sessions are set (getting data from a NI card):
devices = daq.getDevices;
DataSession = daq.createSession('ni'); % start a session with the National Instruments
and addlistener is called:
lh0 = addlistener(DataSession,'DataAvailable',@(src, event)logData_v1p1(src, event, fid1));
It works, but I cannot find ANYWHERE the file logData_v1p1 which logs data to the file (fid1).
I've searched all Matlab folders, subfolders, etc., and files I've put in "Box". Where might logData_v1p1 be?
OR: how can I search properly??
OR: if I just want to "massage" the data before it's written to a file, how I access the data, massage it, and then write it to a file?

回答(1 个)

Steven Lord
Steven Lord 2025-4-11
The only place where a search of the MathWorks website finds that function name is this post. Can you tell us where you found that addlistener call that you are asking about, the one where logData_v1p1 is called? Was it in an example (potentially from an older release), was it something that you found elsewhere online, was it something you got from your professor (if you're a student) or from a colleague, was it something hallucinated by ChatGPT, etc.?
  5 个评论
Steven Lord
Steven Lord 2025-4-12
At first glance, assuming you've created fid1 using fopen before adding the listener, I think that's correct. I haven't worked with Data Acquisition Toolbox so I'm not 100% certain.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Graphics Performance 的更多信息

产品


版本

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by