Can you save all the values of the UserData field of a data acquisition session?

조회 수: 2 (최근 30일)
melanie basnak
melanie basnak . 2020년 8월 10일
댓글: melanie basnak . 2020년 8월 13일
I'm acquiring data through a NiDaq device and have created a data acquisition session.
There are two fields that I created using the UserData (src.UserData.trip_type and src.UserData.trip_counter) .
I'm updating the values of these two fields when certain conditions are met (a voltage threshold) by one of the signals I'm acquiring.
This means that my UserData fields keep changing once those conditions are met, but I would like to constantly record their values, and get the timestamp of when their value changed. Is there a way to do that?
  댓글 수: 2
melanie basnak
melanie basnak 2020년 8월 13일
I'm not sure how to do that but if you can that would work! You can see my full function in the other comment.

댓글을 달려면 로그인하십시오.

답변 (1개)

Aman Vyas
Aman Vyas 2020년 8월 13일
편집: Aman Vyas 님. 2020년 8월 13일
Hi Melanie,
  • Would it make sense to log the data and count it later?
  • pre-calculate the zeros() and store them in a variable instead of having the zeros() inside the loop
You can use this:
which is going to be identical to
(acqData(end) - acqData(1)) / (length(acqData) - 1)
You can look at "Acquire Timestamped data" section for more info in the following link:
Hope it helps!
  댓글 수: 5
melanie basnak
melanie basnak 2020년 8월 13일
Oh but I am already doing that! I am acquiring my NiDaq data in the background, and I have a listener, which is calling that function I pasted up there. The variables that I want to store are not the voltage signals picked up by the NiDaq themselves, but rather these new variables I'm creating into the UserData of the session.

댓글을 달려면 로그인하십시오.


Help CenterFile Exchange에서 Analog Input and Output에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by